Search code examples
v8

Where is namespace `i` defined


I am studying the source of the V8 engine. There is a namespace named i, which I guess should be an alias of v8::internal, but I could not find where it (or the alias) is defined.

I have grepped the whole source tree using namespace i, or using i =, but I could not find anything.

As shown in the following code snippet:

    if (!context.IsEmpty()) {
      i::Handle<i::Context> env = Utils::OpenHandle(*context);
      i::HandleScopeImplementer* impl = isolate->handle_scope_implementer();
......

as shown https://github.com/v8/v8/blob/master/src/api/api.cc#L277

Could anyone who is familiar with the code base tell me where it is defined?


Solution

  • It can be found at the end of globals.h:

    namespace i = v8::internal;