Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Unified Diff: src/objects.h

Issue 2368393002: [modules] Move implementation of Instantiate to i::Module (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index d00a3a3c61fc65404fc3bbcbadd4fb3cf8ede2d7..5774b8acd92295e54398a73f7c6edb4f9849a12d 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -7953,17 +7953,35 @@ class Module : public Struct {
// Get the ModuleInfo associated with the code.
inline ModuleInfo* info() const;
- static void CreateExport(Handle<Module> module, Handle<FixedArray> names);
+ // Implementation of spec operation ModuleDeclarationInstantiation.
+ // Returns false if an exception occurred during instantiation, true
+ // otherwise.
+ static MUST_USE_RESULT bool Instantiate(Handle<Module> module,
+ v8::Local<v8::Context> context,
+ v8::Module::ResolveCallback callback,
+ v8::Local<v8::Value> callback_data);
+
static Handle<Object> LoadExport(Handle<Module> module, Handle<String> name);
static void StoreExport(Handle<Module> module, Handle<String> name,
Handle<Object> value);
- static void CreateIndirectExport(Handle<Module> module, Handle<String> name,
- Handle<ModuleInfoEntry> entry);
-
static Handle<Object> LoadImport(Handle<Module> module, Handle<String> name,
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;
+
+ private:
+ enum { kEvaluatedBit };
+
+ static void CreateExport(Handle<Module> module, Handle<FixedArray> names);
+ static void CreateIndirectExport(Handle<Module> module, Handle<String> name,
+ Handle<ModuleInfoEntry> entry);
+
// The [must_resolve] argument indicates whether or not an exception should be
// thrown if the module does not provide an export named [name].
//
@@ -7981,16 +7999,6 @@ class Module : public Struct {
int module_request,
bool must_resolve);
- 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;
-
- private:
- enum { kEvaluatedBit };
-
// Helper for ResolveExport.
static MUST_USE_RESULT MaybeHandle<Cell> ResolveExportUsingStarExports(
Handle<Module> module, Handle<String> name, bool must_resolve);
« no previous file with comments | « src/api.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698