| Index: src/objects.h
|
| diff --git a/src/objects.h b/src/objects.h
|
| index 0cee2b9d606ad2d2bd6ddcf5a4f39cada3a17acb..d251ab6041c91c025ff54c40d65d857281cf4287 100644
|
| --- a/src/objects.h
|
| +++ b/src/objects.h
|
| @@ -70,6 +70,7 @@
|
| // - JSValue
|
| // - JSDate
|
| // - JSMessageObject
|
| +// - JSModule
|
| // - JSProxy
|
| // - FixedArrayBase
|
| // - ByteArray
|
| @@ -94,6 +95,7 @@
|
| // - TemplateList
|
| // - TransitionArray
|
| // - ScopeInfo
|
| +// - ModuleInfoEntry
|
| // - ModuleInfo
|
| // - ScriptContextTable
|
| // - WeakFixedArray
|
| @@ -879,6 +881,7 @@ class LiteralsArray;
|
| class LookupIterator;
|
| class FieldType;
|
| class ModuleDescriptor;
|
| +class ModuleInfoEntry;
|
| class ModuleInfo;
|
| class ObjectHashTable;
|
| class ObjectVisitor;
|
| @@ -961,6 +964,7 @@ template <class C> inline bool Is(Object* obj);
|
| V(JSObject) \
|
| V(JSContextExtensionObject) \
|
| V(JSGeneratorObject) \
|
| + V(JSModule) \
|
| V(Map) \
|
| V(DescriptorArray) \
|
| V(FrameArray) \
|
| @@ -980,6 +984,7 @@ template <class C> inline bool Is(Object* obj);
|
| V(ScriptContextTable) \
|
| V(NativeContext) \
|
| V(ScopeInfo) \
|
| + V(ModuleInfoEntry) \
|
| V(ModuleInfo) \
|
| V(JSBoundFunction) \
|
| V(JSFunction) \
|
| @@ -4403,7 +4408,7 @@ class ScopeInfo : public FixedArray {
|
|
|
| // The layout of the static part of a ScopeInfo is as follows. Each entry is
|
| // numeric and occupies one array slot.
|
| - // 1. A set of properties of the scope
|
| +// 1. A set of properties of the scope.
|
| // 2. The number of parameters. For non-function scopes this is 0.
|
| // 3. The number of non-parameter variables allocated on the stack.
|
| // 4. The number of non-parameter and parameter variables allocated in the
|
| @@ -4516,6 +4521,30 @@ class ScopeInfo : public FixedArray {
|
| friend class ScopeIterator;
|
| };
|
|
|
| +class ModuleInfoEntry : public FixedArray {
|
| + public:
|
| + DECLARE_CAST(ModuleInfoEntry)
|
| + static Handle<ModuleInfoEntry> New(Isolate* isolate,
|
| + Handle<Object> export_name,
|
| + Handle<Object> local_name,
|
| + Handle<Object> import_name,
|
| + Handle<Object> module_request);
|
| + inline Object* export_name() const;
|
| + inline Object* local_name() const;
|
| + inline Object* import_name() const;
|
| + inline Object* module_request() const;
|
| +
|
| + private:
|
| + friend class Factory;
|
| + enum {
|
| + kExportNameIndex,
|
| + kLocalNameIndex,
|
| + kImportNameIndex,
|
| + kModuleRequestIndex,
|
| + kLength
|
| + };
|
| +};
|
| +
|
| // ModuleInfo is to ModuleDescriptor what ScopeInfo is to Scope.
|
| class ModuleInfo : public FixedArray {
|
| public:
|
| @@ -6318,6 +6347,7 @@ class Map: public HeapObject {
|
| inline bool IsJSFunctionMap();
|
| inline bool IsStringMap();
|
| inline bool IsJSProxyMap();
|
| + inline bool IsJSModuleMap();
|
| inline bool IsJSGlobalProxyMap();
|
| inline bool IsJSGlobalObjectMap();
|
| inline bool IsJSTypedArrayMap();
|
| @@ -7789,6 +7819,21 @@ class JSGeneratorObject: public JSObject {
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(JSGeneratorObject);
|
| };
|
|
|
| +// A JSModule object is a mapping from export names to cells
|
| +// This is still very much in flux.
|
| +class JSModule : public JSObject {
|
| + public:
|
| + DECLARE_CAST(JSModule)
|
| + DECLARE_VERIFIER(JSModule)
|
| +
|
| + static const int kSize = JSObject::kHeaderSize;
|
| +
|
| + static void CreateExport(Handle<JSModule> module, Handle<String> name);
|
| + static void StoreExport(Handle<JSModule> module, Handle<String> name,
|
| + Handle<Object> value);
|
| + static Handle<Object> LoadExport(Handle<JSModule> module,
|
| + Handle<String> name);
|
| +};
|
|
|
| // JSBoundFunction describes a bound function exotic object.
|
| class JSBoundFunction : public JSObject {
|
|
|