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 7802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7813 | 7813 |
7814 static Handle<Object> LoadVariable(Handle<Module> module, int cell_index); | 7814 static Handle<Object> LoadVariable(Handle<Module> module, int cell_index); |
7815 static void StoreVariable(Handle<Module> module, int cell_index, | 7815 static void StoreVariable(Handle<Module> module, int cell_index, |
7816 Handle<Object> value); | 7816 Handle<Object> value); |
7817 | 7817 |
7818 // Get the namespace object for [module_request] of [module]. If it doesn't | 7818 // Get the namespace object for [module_request] of [module]. If it doesn't |
7819 // exist yet, it is created. | 7819 // exist yet, it is created. |
7820 static Handle<JSModuleNamespace> GetModuleNamespace(Handle<Module> module, | 7820 static Handle<JSModuleNamespace> GetModuleNamespace(Handle<Module> module, |
7821 int module_request); | 7821 int module_request); |
7822 | 7822 |
| 7823 // Get the namespace object for [module]. If it doesn't exist yet, it is |
| 7824 // created. |
| 7825 static Handle<JSModuleNamespace> GetModuleNamespace(Handle<Module> module); |
| 7826 |
7823 static const int kCodeOffset = HeapObject::kHeaderSize; | 7827 static const int kCodeOffset = HeapObject::kHeaderSize; |
7824 static const int kExportsOffset = kCodeOffset + kPointerSize; | 7828 static const int kExportsOffset = kCodeOffset + kPointerSize; |
7825 static const int kRegularExportsOffset = kExportsOffset + kPointerSize; | 7829 static const int kRegularExportsOffset = kExportsOffset + kPointerSize; |
7826 static const int kRegularImportsOffset = kRegularExportsOffset + kPointerSize; | 7830 static const int kRegularImportsOffset = kRegularExportsOffset + kPointerSize; |
7827 static const int kHashOffset = kRegularImportsOffset + kPointerSize; | 7831 static const int kHashOffset = kRegularImportsOffset + kPointerSize; |
7828 static const int kModuleNamespaceOffset = kHashOffset + kPointerSize; | 7832 static const int kModuleNamespaceOffset = kHashOffset + kPointerSize; |
7829 static const int kRequestedModulesOffset = | 7833 static const int kRequestedModulesOffset = |
7830 kModuleNamespaceOffset + kPointerSize; | 7834 kModuleNamespaceOffset + kPointerSize; |
7831 static const int kStatusOffset = kRequestedModulesOffset + kPointerSize; | 7835 static const int kStatusOffset = kRequestedModulesOffset + kPointerSize; |
7832 static const int kSize = kStatusOffset + kPointerSize; | 7836 static const int kSize = kStatusOffset + kPointerSize; |
7833 | 7837 |
7834 private: | 7838 private: |
7835 static void CreateExport(Handle<Module> module, int cell_index, | 7839 static void CreateExport(Handle<Module> module, int cell_index, |
7836 Handle<FixedArray> names); | 7840 Handle<FixedArray> names); |
7837 static void CreateIndirectExport(Handle<Module> module, Handle<String> name, | 7841 static void CreateIndirectExport(Handle<Module> module, Handle<String> name, |
7838 Handle<ModuleInfoEntry> entry); | 7842 Handle<ModuleInfoEntry> entry); |
7839 | 7843 |
7840 // Get the namespace object for [module]. If it doesn't exist yet, it is | |
7841 // created. | |
7842 static Handle<JSModuleNamespace> GetModuleNamespace(Handle<Module> module); | |
7843 | |
7844 // The [must_resolve] argument indicates whether or not an exception should be | 7844 // The [must_resolve] argument indicates whether or not an exception should be |
7845 // thrown in case the module does not provide an export named [name] | 7845 // thrown in case the module does not provide an export named [name] |
7846 // (including when a cycle is detected). An exception is always thrown in the | 7846 // (including when a cycle is detected). An exception is always thrown in the |
7847 // case of conflicting star exports. | 7847 // case of conflicting star exports. |
7848 // | 7848 // |
7849 // If [must_resolve] is true, a null result indicates an exception. If | 7849 // If [must_resolve] is true, a null result indicates an exception. If |
7850 // [must_resolve] is false, a null result may or may not indicate an | 7850 // [must_resolve] is false, a null result may or may not indicate an |
7851 // exception (so check manually!). | 7851 // exception (so check manually!). |
7852 class ResolveSet; | 7852 class ResolveSet; |
7853 static MUST_USE_RESULT MaybeHandle<Cell> ResolveExport( | 7853 static MUST_USE_RESULT MaybeHandle<Cell> ResolveExport( |
(...skipping 3721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11575 } | 11575 } |
11576 }; | 11576 }; |
11577 | 11577 |
11578 | 11578 |
11579 } // NOLINT, false-positive due to second-order macros. | 11579 } // NOLINT, false-positive due to second-order macros. |
11580 } // NOLINT, false-positive due to second-order macros. | 11580 } // NOLINT, false-positive due to second-order macros. |
11581 | 11581 |
11582 #include "src/objects/object-macros-undef.h" | 11582 #include "src/objects/object-macros-undef.h" |
11583 | 11583 |
11584 #endif // V8_OBJECTS_H_ | 11584 #endif // V8_OBJECTS_H_ |
OLD | NEW |