Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index ea086931a4d53768ab85c93eeb9a98d5669e4aa8..e5ff128e28880b00bc5673f9db16de94df6f135a 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -71,6 +71,7 @@ |
// - JSValue |
// - JSDate |
// - JSMessageObject |
+// - JSModuleNamespace |
// - JSProxy |
// - FixedArrayBase |
// - ByteArray |
@@ -416,6 +417,7 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1; |
V(JS_ARGUMENTS_TYPE) \ |
V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ |
V(JS_GENERATOR_OBJECT_TYPE) \ |
+ V(JS_MODULE_NAMESPACE_TYPE) \ |
V(JS_GLOBAL_OBJECT_TYPE) \ |
V(JS_GLOBAL_PROXY_TYPE) \ |
V(JS_API_OBJECT_TYPE) \ |
@@ -717,6 +719,7 @@ enum InstanceType { |
JS_ARGUMENTS_TYPE, |
JS_CONTEXT_EXTENSION_OBJECT_TYPE, |
JS_GENERATOR_OBJECT_TYPE, |
+ JS_MODULE_NAMESPACE_TYPE, |
JS_ARRAY_TYPE, |
JS_ARRAY_BUFFER_TYPE, |
JS_TYPED_ARRAY_TYPE, |
@@ -886,6 +889,7 @@ class LayoutDescriptor; |
class LiteralsArray; |
class LookupIterator; |
class FieldType; |
+class Module; |
class ModuleDescriptor; |
class ModuleInfoEntry; |
class ModuleInfo; |
@@ -970,6 +974,7 @@ template <class C> inline bool Is(Object* obj); |
V(JSObject) \ |
V(JSContextExtensionObject) \ |
V(JSGeneratorObject) \ |
+ V(JSModuleNamespace) \ |
V(Map) \ |
V(DescriptorArray) \ |
V(FrameArray) \ |
@@ -3950,6 +3955,9 @@ class ObjectHashTable: public HashTable<ObjectHashTable, |
Object* Lookup(Handle<Object> key, int32_t hash); |
Object* Lookup(Isolate* isolate, Handle<Object> key, int32_t hash); |
+ // Returns the value at entry. |
+ Object* ValueAt(int entry); |
+ |
// Adds (or overwrites) the value associated with the given key. |
static Handle<ObjectHashTable> Put(Handle<ObjectHashTable> table, |
Handle<Object> key, |
@@ -7898,6 +7906,22 @@ class JSGeneratorObject: public JSObject { |
DISALLOW_IMPLICIT_CONSTRUCTORS(JSGeneratorObject); |
}; |
+class JSModuleNamespace : public JSObject { |
adamk
2016/10/04 18:26:53
Please add a comment for those not as well-versed
neis
2016/10/05 08:18:41
Done.
|
+ public: |
+ DECLARE_CAST(JSModuleNamespace) |
+ DECLARE_VERIFIER(JSModuleNamespace) |
+ |
+ DECL_ACCESSORS(module, Module) |
adamk
2016/10/04 18:26:53
Comment please.
neis
2016/10/05 08:18:41
Done.
|
+ |
+ Object* Get(Handle<String> name); |
adamk
2016/10/04 18:26:53
Please add a comment. Get what? Possible return va
neis
2016/10/05 08:18:41
Done.
adamk
2016/10/05 17:21:54
Ah, I didn't realize ObjectHashTable had this API
|
+ |
+ static const int kModuleOffset = JSObject::kHeaderSize; |
+ static const int kSize = kModuleOffset + kPointerSize; |
+ |
+ private: |
+ DISALLOW_IMPLICIT_CONSTRUCTORS(JSModuleNamespace); |
+}; |
+ |
// A Module object is a mapping from export names to cells |
// This is still very much in flux. |
class Module : public Struct { |
@@ -7906,13 +7930,15 @@ class Module : public Struct { |
DECLARE_VERIFIER(Module) |
DECLARE_PRINTER(Module) |
- // The code representing this Module, either a |
- // SharedFunctionInfo or a JSFunction depending |
- // on whether it's been instantiated. |
+ // The code representing this Module, either a SharedFunctionInfo or a |
+ // JSFunction depending on whether it's been instantiated. |
DECL_ACCESSORS(code, Object) |
DECL_ACCESSORS(exports, ObjectHashTable) |
+ // The namespace object (or undefined). |
+ DECL_ACCESSORS(module_namespace, HeapObject) |
+ |
// [[RequestedModules]]: Modules imported or re-exported by this module. |
// Corresponds 1-to-1 to the module specifier strings in |
// ModuleInfo::module_requests. |
@@ -7922,7 +7948,7 @@ class Module : public Struct { |
// are only evaluated a single time. |
DECL_BOOLEAN_ACCESSORS(evaluated) |
- // Storage for [[Evaluated]] |
+ // Storage for [[Evaluated]]. |
DECL_INT_ACCESSORS(flags) |
// Embedder-specified data |
@@ -7955,12 +7981,18 @@ class Module : public Struct { |
static Handle<Object> LoadImport(Handle<Module> module, Handle<String> name, |
int module_request); |
+ static void FetchStarExports(Handle<Module> module, Zone* zone); |
+ static Handle<JSModuleNamespace> GetModuleNamespace(Handle<Module> module); |
adamk
2016/10/04 18:26:53
Should this function be private? It looks like the
neis
2016/10/05 08:18:41
Done.
|
+ static Handle<JSModuleNamespace> GetModuleNamespace(Handle<Module> module, |
adamk
2016/10/04 18:26:53
Please add a comment (specifically, the second arg
neis
2016/10/05 08:18:41
Done.
|
+ int module_request); |
+ |
static const int kCodeOffset = HeapObject::kHeaderSize; |
static const int kExportsOffset = kCodeOffset + kPointerSize; |
static const int kRequestedModulesOffset = kExportsOffset + kPointerSize; |
static const int kFlagsOffset = kRequestedModulesOffset + kPointerSize; |
static const int kEmbedderDataOffset = kFlagsOffset + kPointerSize; |
- static const int kSize = kEmbedderDataOffset + kPointerSize; |
+ static const int kModuleNamespaceOffset = kEmbedderDataOffset + kPointerSize; |
+ static const int kSize = kModuleNamespaceOffset + kPointerSize; |
private: |
enum { kEvaluatedBit }; |