Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index aa8c9693442877c18b848d54e8e1e2ab3148ecc8..68fe89fca53af0108b04b8f1c6994725c7e50beb 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -7967,10 +7967,13 @@ 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, or an abstraction thereof. |
| + // This is either a SharedFunctionInfo or a JSFunction or a ModuleInfo |
| + // depending on whether the module has been instantiated and evaluated. See |
| + // Module::ModuleVerify() for the precise invariant. |
| DECL_ACCESSORS(code, Object) |
| + // The export table. |
| DECL_ACCESSORS(exports, ObjectHashTable) |
| // The namespace object (or undefined). |
| @@ -7981,22 +7984,16 @@ class Module : public Struct { |
| // ModuleInfo::module_requests. |
| DECL_ACCESSORS(requested_modules, FixedArray) |
| - // [[Evaluated]]: Whether this module has been evaluated. Modules |
| - // are only evaluated a single time. |
| - DECL_BOOLEAN_ACCESSORS(evaluated) |
| - |
| - // Storage for [[Evaluated]]. |
| - DECL_INT_ACCESSORS(flags) |
| - |
| // Hash for this object (a random non-zero Smi). |
| DECL_INT_ACCESSORS(hash) |
| - // Get the SharedFunctionInfo associated with the code. |
| - inline SharedFunctionInfo* shared() const; |
| - |
| // Get the ModuleInfo associated with the code. |
| inline ModuleInfo* info() const; |
| + inline bool instantiated() const; |
| + inline bool evaluated() const; |
| + inline void set_evaluated(); |
| + |
| // Implementation of spec operation ModuleDeclarationInstantiation. |
| // Returns false if an exception occurred during instantiation, true |
| // otherwise. |
| @@ -8022,8 +8019,7 @@ class Module : public Struct { |
| 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 kEmbedderDataOffset = kRequestedModulesOffset + kPointerSize; |
|
adamk
2016/10/14 18:01:02
Looks like you'll need a merge here, as embedder d
|
| static const int kModuleNamespaceOffset = kEmbedderDataOffset + kPointerSize; |
| static const int kHashOffset = kModuleNamespaceOffset + kPointerSize; |
| static const int kSize = kHashOffset + kPointerSize; |