"src/ic/ic-compiler.h",
"src/ic/stub-cache.cc",
"src/ic/stub-cache.h",
- "src/interface.cc",
- "src/interface.h",
"src/interface-descriptors.cc",
"src/interface-descriptors.h",
"src/interpreter-irregexp.cc",
"src/macro-assembler.h",
"src/messages.cc",
"src/messages.h",
+ "src/modules.cc",
+ "src/modules.h",
"src/msan.h",
"src/natives.h",
"src/objects-debug.cc",
void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) {
Variable* variable = declaration->proxy()->var();
- Interface* interface = declaration->module()->interface();
+ ModuleDescriptor* descriptor = declaration->module()->descriptor();
DCHECK(variable->location() == Variable::CONTEXT);
- DCHECK(interface->IsFrozen());
+ DCHECK(descriptor->IsFrozen());
Comment cmnt(masm_, "[ ModuleDeclaration");
EmitDebugCheckDeclarationContext(variable);
// Load instance object.
__ LoadContext(r1, scope_->ContextChainLength(scope_->ScriptScope()));
- __ ldr(r1, ContextOperand(r1, interface->Index()));
+ __ ldr(r1, ContextOperand(r1, descriptor->Index()));
__ ldr(r1, ContextOperand(r1, Context::EXTENSION_INDEX));
// Assign it.
void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) {
Variable* variable = declaration->proxy()->var();
- Interface* interface = declaration->module()->interface();
+ ModuleDescriptor* descriptor = declaration->module()->descriptor();
DCHECK(variable->location() == Variable::CONTEXT);
- DCHECK(interface->IsFrozen());
+ DCHECK(descriptor->IsFrozen());
Comment cmnt(masm_, "[ ModuleDeclaration");
EmitDebugCheckDeclarationContext(variable);
// Load instance object.
__ LoadContext(x1, scope_->ContextChainLength(scope_->ScriptScope()));
- __ Ldr(x1, ContextMemOperand(x1, interface->Index()));
+ __ Ldr(x1, ContextMemOperand(x1, descriptor->Index()));
__ Ldr(x1, ContextMemOperand(x1, Context::EXTENSION_INDEX));
// Assign it.
#include "src/ast-value-factory.h"
#include "src/bailout-reason.h"
#include "src/factory.h"
-#include "src/interface.h"
#include "src/isolate.h"
#include "src/jsregexp.h"
#include "src/list-inl.h"
+#include "src/modules.h"
#include "src/runtime/runtime.h"
#include "src/small-pointer-list.h"
#include "src/smart-pointers.h"
class Module : public AstNode {
public:
- Interface* interface() const { return interface_; }
+ ModuleDescriptor* descriptor() const { return descriptor_; }
Block* body() const { return body_; }
protected:
Module(Zone* zone, int pos)
- : AstNode(pos),
- interface_(Interface::New(zone)),
- body_(NULL) {}
- Module(Zone* zone, Interface* interface, int pos, Block* body = NULL)
- : AstNode(pos),
- interface_(interface),
- body_(body) {}
+ : AstNode(pos), descriptor_(ModuleDescriptor::New(zone)), body_(NULL) {}
+ Module(Zone* zone, ModuleDescriptor* descriptor, int pos, Block* body = NULL)
+ : AstNode(pos), descriptor_(descriptor), body_(body) {}
private:
- Interface* interface_;
+ ModuleDescriptor* descriptor_;
Block* body_;
};
DECLARE_NODE_TYPE(ModuleLiteral)
protected:
- ModuleLiteral(Zone* zone, Block* body, Interface* interface, int pos)
- : Module(zone, interface, pos, body) {}
+ ModuleLiteral(Zone* zone, Block* body, ModuleDescriptor* descriptor, int pos)
+ : Module(zone, descriptor, pos, body) {}
};
return new (zone_) ExportDeclaration(zone_, proxy, scope, pos);
}
- ModuleLiteral* NewModuleLiteral(Block* body, Interface* interface, int pos) {
- return new (zone_) ModuleLiteral(zone_, body, interface, pos);
+ ModuleLiteral* NewModuleLiteral(Block* body, ModuleDescriptor* descriptor,
+ int pos) {
+ return new (zone_) ModuleLiteral(zone_, body, descriptor, pos);
}
ModulePath* NewModulePath(Module* origin, const AstRawString* name, int pos) {
DEFINE_BOOL(print_turbo_replay, false,
"print C++ code to recreate TurboFan graphs")
-// interface.cc
-DEFINE_BOOL(print_interfaces, false, "print interfaces")
-DEFINE_BOOL(print_interface_details, false, "print interface inference details")
-DEFINE_INT(print_interface_depth, 5, "depth for printing interfaces")
-
// objects.cc
DEFINE_BOOL(trace_normalization, false,
"prints when objects are turned into dictionaries.")
if (module != NULL) {
Comment cmnt(masm_, "[ Link nested modules");
Scope* scope = module->body()->scope();
- Interface* interface = scope->interface();
- DCHECK(interface->IsFrozen());
+ DCHECK(scope->module()->IsFrozen());
- interface->Allocate(scope->module_var()->index());
+ scope->module()->Allocate(scope->module_var()->index());
// Set up module context.
- DCHECK(scope->interface()->Index() >= 0);
- __ Push(Smi::FromInt(scope->interface()->Index()));
+ DCHECK(scope->module()->Index() >= 0);
+ __ Push(Smi::FromInt(scope->module()->Index()));
__ Push(scope->GetScopeInfo(isolate()));
__ CallRuntime(Runtime::kPushModuleContext, 2);
StoreToFrameField(StandardFrameConstants::kContextOffset,
Block* block = module->body();
Scope* saved_scope = scope();
scope_ = block->scope();
- Interface* interface = scope_->interface();
+ ModuleDescriptor* descriptor = scope_->module();
Comment cmnt(masm_, "[ ModuleLiteral");
SetStatementPosition(block);
int index = module_index_++;
// Set up module context.
- DCHECK(interface->Index() >= 0);
- __ Push(Smi::FromInt(interface->Index()));
+ DCHECK(descriptor->Index() >= 0);
+ __ Push(Smi::FromInt(descriptor->Index()));
__ Push(Smi::FromInt(0));
__ CallRuntime(Runtime::kPushModuleContext, 2);
StoreToFrameField(StandardFrameConstants::kContextOffset, context_register());
// Populate the module description.
Handle<ModuleInfo> description =
- ModuleInfo::Create(isolate(), interface, scope_);
+ ModuleInfo::Create(isolate(), descriptor, scope_);
modules_->set(index, *description);
scope_ = saved_scope;
}
+// TODO(adamk): Delete ModulePath.
void FullCodeGenerator::VisitModulePath(ModulePath* module) {
- // Nothing to do.
- // The instance object is resolved statically through the module's interface.
}
+// TODO(adamk): Delete ModuleUrl.
void FullCodeGenerator::VisitModuleUrl(ModuleUrl* module) {
- // TODO(rossberg): dummy allocation for now.
- Scope* scope = module->body()->scope();
- Interface* interface = scope_->interface();
-
- DCHECK(interface->IsFrozen());
- DCHECK(!modules_.is_null());
- DCHECK(module_index_ < modules_->length());
- interface->Allocate(scope->module_var()->index());
- int index = module_index_++;
-
- Handle<ModuleInfo> description =
- ModuleInfo::Create(isolate(), interface, scope_);
- modules_->set(index, *description);
}
DCHECK(stmt->body()->scope()->is_module_scope());
- __ Push(Smi::FromInt(stmt->body()->scope()->interface()->Index()));
+ __ Push(Smi::FromInt(stmt->body()->scope()->module()->Index()));
__ Push(Smi::FromInt(0));
__ CallRuntime(Runtime::kPushModuleContext, 2);
StoreToFrameField(
void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) {
Variable* variable = declaration->proxy()->var();
- Interface* interface = declaration->module()->interface();
+ ModuleDescriptor* descriptor = declaration->module()->descriptor();
DCHECK(variable->location() == Variable::CONTEXT);
- DCHECK(interface->IsFrozen());
+ DCHECK(descriptor->IsFrozen());
Comment cmnt(masm_, "[ ModuleDeclaration");
EmitDebugCheckDeclarationContext(variable);
// Load instance object.
__ LoadContext(eax, scope_->ContextChainLength(scope_->ScriptScope()));
- __ mov(eax, ContextOperand(eax, interface->Index()));
+ __ mov(eax, ContextOperand(eax, descriptor->Index()));
__ mov(eax, ContextOperand(eax, Context::EXTENSION_INDEX));
// Assign it.
+++ /dev/null
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "src/v8.h"
-
-#include "src/interface.h"
-
-#include "src/ast-value-factory.h"
-
-namespace v8 {
-namespace internal {
-
-// ---------------------------------------------------------------------------
-// Addition.
-
-#ifdef DEBUG
-// Current nesting depth for debug output.
-class Nesting {
- public:
- Nesting() { current_ += 2; }
- ~Nesting() { current_ -= 2; }
- static int current() { return current_; }
- private:
- static int current_;
-};
-
-int Nesting::current_ = 0;
-#endif
-
-
-void Interface::Add(const AstRawString* name, Zone* zone, bool* ok) {
- void* key = const_cast<AstRawString*>(name);
-
-#ifdef DEBUG
- if (FLAG_print_interface_details) {
- PrintF("%*s# Adding...\n", Nesting::current(), "");
- PrintF("%*sthis = ", Nesting::current(), "");
- this->Print(Nesting::current());
- PrintF("%*s%.*s : ", Nesting::current(), "", name->length(),
- name->raw_data());
- }
-#endif
-
- ZoneHashMap** map = &exports_;
- ZoneAllocationPolicy allocator(zone);
-
- if (*map == nullptr) {
- *map = new(zone->New(sizeof(ZoneHashMap)))
- ZoneHashMap(ZoneHashMap::PointersMatch,
- ZoneHashMap::kDefaultHashMapCapacity, allocator);
- }
-
- ZoneHashMap::Entry* p =
- (*map)->Lookup(key, name->hash(), !IsFrozen(), allocator);
- if (p == nullptr || p->value != nullptr) {
- *ok = false;
- }
-
- p->value = key;
-
-#ifdef DEBUG
- if (FLAG_print_interface_details) {
- PrintF("%*sthis' = ", Nesting::current(), "");
- this->Print(Nesting::current());
- PrintF("%*s# Added.\n", Nesting::current(), "");
- }
-#endif
-}
-
-
-// ---------------------------------------------------------------------------
-// Printing.
-
-#ifdef DEBUG
-void Interface::Print(int n) {
- int n0 = n > 0 ? n : 0;
-
- if (FLAG_print_interface_details) {
- PrintF("%p ", static_cast<void*>(this));
- }
-
- PrintF("module %d %s{", Index(), IsFrozen() ? "" : "(unresolved) ");
- ZoneHashMap* map = exports_;
- if (map == nullptr || map->occupancy() == 0) {
- PrintF("}\n");
- } else if (n < 0 || n0 >= 2 * FLAG_print_interface_depth) {
- // Avoid infinite recursion on cyclic types.
- PrintF("...}\n");
- } else {
- PrintF("\n");
- for (ZoneHashMap::Entry* p = map->Start(); p != nullptr; p = map->Next(p)) {
- String* name = *static_cast<String**>(p->key);
- PrintF("%*s%s : ", n0 + 2, "", name->ToAsciiArray());
- }
- PrintF("%*s}\n", n0, "");
- }
-}
-#endif
-
-} } // namespace v8::internal
+++ /dev/null
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_INTERFACE_H_
-#define V8_INTERFACE_H_
-
-#include "src/zone.h"
-
-namespace v8 {
-namespace internal {
-
-
-class AstRawString;
-
-
-// This class represents the interface of a module: a set of exported names.
-//
-// TODO(adamk): Rename this to ModuleRecord, ModuleDescriptor, or similar.
-class Interface : public ZoneObject {
- public:
- // ---------------------------------------------------------------------------
- // Factory methods.
-
- static Interface* New(Zone* zone) { return new (zone) Interface(); }
-
- // ---------------------------------------------------------------------------
- // Mutators.
-
- // Add a name to the list of exports. If it already exists, or this interface
- // is frozen, that's an error.
- void Add(const AstRawString* name, Zone* zone, bool* ok);
-
- // Do not allow any further refinements, directly or through unification.
- void Freeze() { frozen_ = true; }
-
- // Assign an index.
- void Allocate(int index) {
- DCHECK(IsFrozen() && index_ == -1);
- index_ = index;
- }
-
- // ---------------------------------------------------------------------------
- // Accessors.
-
- // Check whether this is closed (i.e. fully determined).
- bool IsFrozen() { return frozen_; }
-
- int Length() {
- DCHECK(IsFrozen());
- ZoneHashMap* exports = exports_;
- return exports ? exports->occupancy() : 0;
- }
-
- // The context slot in the hosting script context pointing to this module.
- int Index() {
- DCHECK(IsFrozen());
- return index_;
- }
-
- // ---------------------------------------------------------------------------
- // Iterators.
-
- // Use like:
- // for (auto it = interface->iterator(); !it.done(); it.Advance()) {
- // ... it.name() ... it.interface() ...
- // }
- class Iterator {
- public:
- bool done() const { return entry_ == NULL; }
- const AstRawString* name() const {
- DCHECK(!done());
- return static_cast<const AstRawString*>(entry_->key);
- }
- void Advance() { entry_ = exports_->Next(entry_); }
-
- private:
- friend class Interface;
- explicit Iterator(const ZoneHashMap* exports)
- : exports_(exports), entry_(exports ? exports->Start() : NULL) {}
-
- const ZoneHashMap* exports_;
- ZoneHashMap::Entry* entry_;
- };
-
- Iterator iterator() const { return Iterator(this->exports_); }
-
- // ---------------------------------------------------------------------------
- // Debugging.
-#ifdef DEBUG
- void Print(int n = 0); // n = indentation; n < 0 => don't print recursively
-#endif
-
- // ---------------------------------------------------------------------------
- // Implementation.
- private:
- bool frozen_;
- ZoneHashMap* exports_; // Module exports and their types (allocated lazily)
- int index_;
-
- Interface() : frozen_(false), exports_(NULL), index_(-1) {
-#ifdef DEBUG
- if (FLAG_print_interface_details)
- PrintF("# Creating %p\n", static_cast<void*>(this));
-#endif
- }
-};
-
-} } // namespace v8::internal
-
-#endif // V8_INTERFACE_H_
void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) {
Variable* variable = declaration->proxy()->var();
- Interface* interface = declaration->module()->interface();
+ ModuleDescriptor* descriptor = declaration->module()->descriptor();
DCHECK(variable->location() == Variable::CONTEXT);
- DCHECK(interface->IsFrozen());
+ DCHECK(descriptor->IsFrozen());
Comment cmnt(masm_, "[ ModuleDeclaration");
EmitDebugCheckDeclarationContext(variable);
// Load instance object.
__ LoadContext(a1, scope_->ContextChainLength(scope_->ScriptScope()));
- __ lw(a1, ContextOperand(a1, interface->Index()));
+ __ lw(a1, ContextOperand(a1, descriptor->Index()));
__ lw(a1, ContextOperand(a1, Context::EXTENSION_INDEX));
// Assign it.
void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) {
Variable* variable = declaration->proxy()->var();
- Interface* interface = declaration->module()->interface();
+ ModuleDescriptor* descriptor = declaration->module()->descriptor();
DCHECK(variable->location() == Variable::CONTEXT);
- DCHECK(interface->IsFrozen());
+ DCHECK(descriptor->IsFrozen());
Comment cmnt(masm_, "[ ModuleDeclaration");
EmitDebugCheckDeclarationContext(variable);
// Load instance object.
__ LoadContext(a1, scope_->ContextChainLength(scope_->ScriptScope()));
- __ ld(a1, ContextOperand(a1, interface->Index()));
+ __ ld(a1, ContextOperand(a1, descriptor->Index()));
__ ld(a1, ContextOperand(a1, Context::EXTENSION_INDEX));
// Assign it.
--- /dev/null
+// Copyright 2012 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/v8.h"
+
+#include "src/modules.h"
+
+#include "src/ast-value-factory.h"
+
+namespace v8 {
+namespace internal {
+
+// ---------------------------------------------------------------------------
+// Addition.
+
+void ModuleDescriptor::Add(const AstRawString* name, Zone* zone, bool* ok) {
+ void* key = const_cast<AstRawString*>(name);
+
+ ZoneHashMap** map = &exports_;
+ ZoneAllocationPolicy allocator(zone);
+
+ if (*map == nullptr) {
+ *map = new (zone->New(sizeof(ZoneHashMap)))
+ ZoneHashMap(ZoneHashMap::PointersMatch,
+ ZoneHashMap::kDefaultHashMapCapacity, allocator);
+ }
+
+ ZoneHashMap::Entry* p =
+ (*map)->Lookup(key, name->hash(), !IsFrozen(), allocator);
+ if (p == nullptr || p->value != nullptr) {
+ *ok = false;
+ }
+
+ p->value = key;
+}
+}
+} // namespace v8::internal
--- /dev/null
+// Copyright 2012 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_MODULES_H_
+#define V8_MODULES_H_
+
+#include "src/zone.h"
+
+namespace v8 {
+namespace internal {
+
+
+class AstRawString;
+
+
+class ModuleDescriptor : public ZoneObject {
+ public:
+ // ---------------------------------------------------------------------------
+ // Factory methods.
+
+ static ModuleDescriptor* New(Zone* zone) {
+ return new (zone) ModuleDescriptor();
+ }
+
+ // ---------------------------------------------------------------------------
+ // Mutators.
+
+ // Add a name to the list of exports. If it already exists, or this descriptor
+ // is frozen, that's an error.
+ void Add(const AstRawString* name, Zone* zone, bool* ok);
+
+ // Do not allow any further refinements, directly or through unification.
+ void Freeze() { frozen_ = true; }
+
+ // Assign an index.
+ void Allocate(int index) {
+ DCHECK(IsFrozen() && index_ == -1);
+ index_ = index;
+ }
+
+ // ---------------------------------------------------------------------------
+ // Accessors.
+
+ // Check whether this is closed (i.e. fully determined).
+ bool IsFrozen() { return frozen_; }
+
+ int Length() {
+ DCHECK(IsFrozen());
+ ZoneHashMap* exports = exports_;
+ return exports ? exports->occupancy() : 0;
+ }
+
+ // The context slot in the hosting script context pointing to this module.
+ int Index() {
+ DCHECK(IsFrozen());
+ return index_;
+ }
+
+ // ---------------------------------------------------------------------------
+ // Iterators.
+
+ // Use like:
+ // for (auto it = descriptor->iterator(); !it.done(); it.Advance()) {
+ // ... it.name() ...
+ // }
+ class Iterator {
+ public:
+ bool done() const { return entry_ == NULL; }
+ const AstRawString* name() const {
+ DCHECK(!done());
+ return static_cast<const AstRawString*>(entry_->key);
+ }
+ void Advance() { entry_ = exports_->Next(entry_); }
+
+ private:
+ friend class ModuleDescriptor;
+ explicit Iterator(const ZoneHashMap* exports)
+ : exports_(exports), entry_(exports ? exports->Start() : NULL) {}
+
+ const ZoneHashMap* exports_;
+ ZoneHashMap::Entry* entry_;
+ };
+
+ Iterator iterator() const { return Iterator(this->exports_); }
+
+ // ---------------------------------------------------------------------------
+ // Implementation.
+ private:
+ bool frozen_;
+ ZoneHashMap* exports_; // Module exports and their types (allocated lazily)
+ int index_;
+
+ ModuleDescriptor() : frozen_(false), exports_(NULL), index_(-1) {}
+};
+
+} } // namespace v8::internal
+
+#endif // V8_MODULES_H_
body->set_scope(scope);
// Check that all exports are bound.
- Interface* interface = scope->interface();
- for (Interface::Iterator it = interface->iterator();
- !it.done(); it.Advance()) {
+ ModuleDescriptor* descriptor = scope->module();
+ for (ModuleDescriptor::Iterator it = descriptor->iterator(); !it.done();
+ it.Advance()) {
if (scope->LookupLocal(it.name()) == NULL) {
ParserTraits::ReportMessage("module_export_undefined", it.name());
*ok = false;
}
}
- scope->interface()->Freeze();
+ scope->module()->Freeze();
return body;
}
}
}
- // TODO(ES6): Add default export to scope_->interface()
+ // TODO(ES6): Add default export to scope_->module()
return result;
}
// TODO(ES6): Handle 'export from' once imports are properly implemented.
// For now we just drop such exports on the floor.
if (!is_export_from) {
- // Extract declared names into export declarations and interface.
- Interface* interface = scope_->interface();
+ // Extract declared names into export declarations and module descriptor.
+ ModuleDescriptor* descriptor = scope_->module();
for (int i = 0; i < names.length(); ++i) {
-#ifdef DEBUG
- if (FLAG_print_interface_details)
- PrintF("# Export %.*s ", names[i]->length(), names[i]->raw_data());
-#endif
// TODO(adamk): Make early errors here provide the right error message
// (duplicate exported names).
- interface->Add(names[i], zone(), CHECK_OK);
+ descriptor->Add(names[i], zone(), CHECK_OK);
// TODO(rossberg): Rethink whether we actually need to store export
// declarations (for compilation?).
// ExportDeclaration* declaration =
void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) {
Variable* variable = declaration->proxy()->var();
- Interface* interface = declaration->module()->interface();
+ ModuleDescriptor* descriptor = declaration->module()->descriptor();
DCHECK(variable->location() == Variable::CONTEXT);
- DCHECK(interface->IsFrozen());
+ DCHECK(descriptor->IsFrozen());
Comment cmnt(masm_, "[ ModuleDeclaration");
EmitDebugCheckDeclarationContext(variable);
// Load instance object.
__ LoadContext(r4, scope_->ContextChainLength(scope_->ScriptScope()));
- __ LoadP(r4, ContextOperand(r4, interface->Index()));
+ __ LoadP(r4, ContextOperand(r4, descriptor->Index()));
__ LoadP(r4, ContextOperand(r4, Context::EXTENSION_INDEX));
// Assign it.
//---------------------------------------------------------------------------
// ModuleInfo.
-Handle<ModuleInfo> ModuleInfo::Create(
- Isolate* isolate, Interface* interface, Scope* scope) {
- Handle<ModuleInfo> info = Allocate(isolate, interface->Length());
- info->set_host_index(interface->Index());
+Handle<ModuleInfo> ModuleInfo::Create(Isolate* isolate,
+ ModuleDescriptor* descriptor,
+ Scope* scope) {
+ Handle<ModuleInfo> info = Allocate(isolate, descriptor->Length());
+ info->set_host_index(descriptor->Index());
int i = 0;
- for (Interface::Iterator it = interface->iterator();
- !it.done(); it.Advance(), ++i) {
+ for (ModuleDescriptor::Iterator it = descriptor->iterator(); !it.done();
+ it.Advance(), ++i) {
Variable* var = scope->LookupLocal(it.name());
info->set_name(i, *(it.name()->string()));
info->set_mode(i, var->mode());
#define V8_SCOPEINFO_H_
#include "src/allocation.h"
-#include "src/interface.h"
+#include "src/modules.h"
#include "src/variables.h"
namespace v8 {
return static_cast<ModuleInfo*>(FixedArray::cast(description));
}
- static Handle<ModuleInfo> Create(
- Isolate* isolate, Interface* interface, Scope* scope);
+ static Handle<ModuleInfo> Create(Isolate* isolate,
+ ModuleDescriptor* descriptor, Scope* scope);
// Index of module's context in host context.
int host_index() { return Smi::cast(get(HOST_OFFSET))->value(); }
params_(4, zone),
unresolved_(16, zone),
decls_(4, zone),
- interface_(scope_type == MODULE_SCOPE ? Interface::New(zone)
- : NULL),
+ module_descriptor_(
+ scope_type == MODULE_SCOPE ? ModuleDescriptor::New(zone) : NULL),
already_resolved_(false),
ast_value_factory_(ast_value_factory),
zone_(zone) {
params_(4, zone),
unresolved_(16, zone),
decls_(4, zone),
- interface_(NULL),
+ module_descriptor_(NULL),
already_resolved_(true),
ast_value_factory_(value_factory),
zone_(zone) {
params_(0, zone),
unresolved_(0, zone),
decls_(0, zone),
- interface_(NULL),
+ module_descriptor_(NULL),
already_resolved_(true),
ast_value_factory_(value_factory),
zone_(zone) {
: FLAG_print_scopes) {
scope->Print();
}
-
- if (FLAG_harmony_modules && FLAG_print_interfaces && top->is_script_scope()) {
- PrintF("global : ");
- top->interface()->Print();
- }
#endif
info->PrepareForCompilation(scope);
void Scope::AllocateModulesRecursively(Scope* host_scope) {
if (already_resolved()) return;
if (is_module_scope()) {
- DCHECK(interface_->IsFrozen());
+ DCHECK(module_descriptor_->IsFrozen());
DCHECK(module_var_ == NULL);
module_var_ =
host_scope->NewInternal(ast_value_factory_->dot_module_string());
// The scope immediately surrounding this scope, or NULL.
Scope* outer_scope() const { return outer_scope_; }
- // The interface as inferred so far; only for module scopes.
- Interface* interface() const { return interface_; }
+ // The ModuleDescriptor for this scope; only for module scopes.
+ ModuleDescriptor* module() const { return module_descriptor_; }
// ---------------------------------------------------------------------------
// Variable allocation.
Variable* new_target_;
// Convenience variable; function scopes only.
Variable* arguments_;
- // Interface; module scopes only.
- Interface* interface_;
+ // Module descriptor; module scopes only.
+ ModuleDescriptor* module_descriptor_;
// Illegal redeclaration.
Expression* illegal_redecl_;
void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) {
Variable* variable = declaration->proxy()->var();
- Interface* interface = declaration->module()->interface();
+ ModuleDescriptor* descriptor = declaration->module()->descriptor();
DCHECK(variable->location() == Variable::CONTEXT);
- DCHECK(interface->IsFrozen());
+ DCHECK(descriptor->IsFrozen());
Comment cmnt(masm_, "[ ModuleDeclaration");
EmitDebugCheckDeclarationContext(variable);
// Load instance object.
__ LoadContext(rax, scope_->ContextChainLength(scope_->ScriptScope()));
- __ movp(rax, ContextOperand(rax, interface->Index()));
+ __ movp(rax, ContextOperand(rax, descriptor->Index()));
__ movp(rax, ContextOperand(rax, Context::EXTENSION_INDEX));
// Assign it.
void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) {
Variable* variable = declaration->proxy()->var();
- Interface* interface = declaration->module()->interface();
+ ModuleDescriptor* descriptor = declaration->module()->descriptor();
DCHECK(variable->location() == Variable::CONTEXT);
- DCHECK(interface->IsFrozen());
+ DCHECK(descriptor->IsFrozen());
Comment cmnt(masm_, "[ ModuleDeclaration");
EmitDebugCheckDeclarationContext(variable);
// Load instance object.
__ LoadContext(eax, scope_->ContextChainLength(scope_->ScriptScope()));
- __ mov(eax, ContextOperand(eax, interface->Index()));
+ __ mov(eax, ContextOperand(eax, descriptor->Index()));
__ mov(eax, ContextOperand(eax, Context::EXTENSION_INDEX));
// Assign it.
'../../src/ic/ic.h',
'../../src/ic/ic-compiler.cc',
'../../src/ic/ic-compiler.h',
- '../../src/interface.cc',
- '../../src/interface.h',
'../../src/interface-descriptors.cc',
'../../src/interface-descriptors.h',
'../../src/interpreter-irregexp.cc',
'../../src/macro-assembler.h',
'../../src/messages.cc',
'../../src/messages.h',
+ '../../src/modules.cc',
+ '../../src/modules.h',
'../../src/msan.h',
'../../src/natives.h',
'../../src/objects-debug.cc',