| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
| 6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 7825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7836 | 7836 |
| 7837 static Handle<Object> LoadVariable(Handle<Module> module, int cell_index); | 7837 static Handle<Object> LoadVariable(Handle<Module> module, int cell_index); |
| 7838 static void StoreVariable(Handle<Module> module, int cell_index, | 7838 static void StoreVariable(Handle<Module> module, int cell_index, |
| 7839 Handle<Object> value); | 7839 Handle<Object> value); |
| 7840 | 7840 |
| 7841 // Get the namespace object for [module_request] of [module]. If it doesn't | 7841 // Get the namespace object for [module_request] of [module]. If it doesn't |
| 7842 // exist yet, it is created. | 7842 // exist yet, it is created. |
| 7843 static Handle<JSModuleNamespace> GetModuleNamespace(Handle<Module> module, | 7843 static Handle<JSModuleNamespace> GetModuleNamespace(Handle<Module> module, |
| 7844 int module_request); | 7844 int module_request); |
| 7845 | 7845 |
| 7846 // Get the namespace object for [module]. If it doesn't exist yet, it is |
| 7847 // created. |
| 7848 static Handle<JSModuleNamespace> GetModuleNamespace(Handle<Module> module); |
| 7849 |
| 7846 static const int kCodeOffset = HeapObject::kHeaderSize; | 7850 static const int kCodeOffset = HeapObject::kHeaderSize; |
| 7847 static const int kExportsOffset = kCodeOffset + kPointerSize; | 7851 static const int kExportsOffset = kCodeOffset + kPointerSize; |
| 7848 static const int kRegularExportsOffset = kExportsOffset + kPointerSize; | 7852 static const int kRegularExportsOffset = kExportsOffset + kPointerSize; |
| 7849 static const int kRegularImportsOffset = kRegularExportsOffset + kPointerSize; | 7853 static const int kRegularImportsOffset = kRegularExportsOffset + kPointerSize; |
| 7850 static const int kHashOffset = kRegularImportsOffset + kPointerSize; | 7854 static const int kHashOffset = kRegularImportsOffset + kPointerSize; |
| 7851 static const int kModuleNamespaceOffset = kHashOffset + kPointerSize; | 7855 static const int kModuleNamespaceOffset = kHashOffset + kPointerSize; |
| 7852 static const int kRequestedModulesOffset = | 7856 static const int kRequestedModulesOffset = |
| 7853 kModuleNamespaceOffset + kPointerSize; | 7857 kModuleNamespaceOffset + kPointerSize; |
| 7854 static const int kStatusOffset = kRequestedModulesOffset + kPointerSize; | 7858 static const int kStatusOffset = kRequestedModulesOffset + kPointerSize; |
| 7855 static const int kSize = kStatusOffset + kPointerSize; | 7859 static const int kSize = kStatusOffset + kPointerSize; |
| 7856 | 7860 |
| 7857 private: | 7861 private: |
| 7858 static void CreateExport(Handle<Module> module, int cell_index, | 7862 static void CreateExport(Handle<Module> module, int cell_index, |
| 7859 Handle<FixedArray> names); | 7863 Handle<FixedArray> names); |
| 7860 static void CreateIndirectExport(Handle<Module> module, Handle<String> name, | 7864 static void CreateIndirectExport(Handle<Module> module, Handle<String> name, |
| 7861 Handle<ModuleInfoEntry> entry); | 7865 Handle<ModuleInfoEntry> entry); |
| 7862 | 7866 |
| 7863 // Get the namespace object for [module]. If it doesn't exist yet, it is | |
| 7864 // created. | |
| 7865 static Handle<JSModuleNamespace> GetModuleNamespace(Handle<Module> module); | |
| 7866 | |
| 7867 // The [must_resolve] argument indicates whether or not an exception should be | 7867 // The [must_resolve] argument indicates whether or not an exception should be |
| 7868 // thrown in case the module does not provide an export named [name] | 7868 // thrown in case the module does not provide an export named [name] |
| 7869 // (including when a cycle is detected). An exception is always thrown in the | 7869 // (including when a cycle is detected). An exception is always thrown in the |
| 7870 // case of conflicting star exports. | 7870 // case of conflicting star exports. |
| 7871 // | 7871 // |
| 7872 // If [must_resolve] is true, a null result indicates an exception. If | 7872 // If [must_resolve] is true, a null result indicates an exception. If |
| 7873 // [must_resolve] is false, a null result may or may not indicate an | 7873 // [must_resolve] is false, a null result may or may not indicate an |
| 7874 // exception (so check manually!). | 7874 // exception (so check manually!). |
| 7875 class ResolveSet; | 7875 class ResolveSet; |
| 7876 static MUST_USE_RESULT MaybeHandle<Cell> ResolveExport( | 7876 static MUST_USE_RESULT MaybeHandle<Cell> ResolveExport( |
| (...skipping 3711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11588 } | 11588 } |
| 11589 }; | 11589 }; |
| 11590 | 11590 |
| 11591 | 11591 |
| 11592 } // NOLINT, false-positive due to second-order macros. | 11592 } // NOLINT, false-positive due to second-order macros. |
| 11593 } // NOLINT, false-positive due to second-order macros. | 11593 } // NOLINT, false-positive due to second-order macros. |
| 11594 | 11594 |
| 11595 #include "src/objects/object-macros-undef.h" | 11595 #include "src/objects/object-macros-undef.h" |
| 11596 | 11596 |
| 11597 #endif // V8_OBJECTS_H_ | 11597 #endif // V8_OBJECTS_H_ |
| OLD | NEW |