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

Unified Diff: src/objects.h

Issue 2302783002: [modules] Basic support of exports (Closed)
Patch Set: Disable module tests for deopt fuzzer. 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/interpreter/bytecode-generator.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 47f6eade257bacce59778bd4efbbe2c191ba03cd..0f341219d35d1ed0116189684e781b8ec97841c0 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -70,6 +70,7 @@
// - JSValue
// - JSDate
// - JSMessageObject
+// - JSModule
// - JSProxy
// - FixedArrayBase
// - ByteArray
@@ -94,6 +95,7 @@
// - TemplateList
// - TransitionArray
// - ScopeInfo
+// - ModuleInfoEntry
// - ModuleInfo
// - ScriptContextTable
// - WeakFixedArray
@@ -879,6 +881,7 @@ class LiteralsArray;
class LookupIterator;
class FieldType;
class ModuleDescriptor;
+class ModuleInfoEntry;
class ModuleInfo;
class ObjectHashTable;
class ObjectVisitor;
@@ -961,6 +964,7 @@ template <class C> inline bool Is(Object* obj);
V(JSObject) \
V(JSContextExtensionObject) \
V(JSGeneratorObject) \
+ V(JSModule) \
V(Map) \
V(DescriptorArray) \
V(FrameArray) \
@@ -980,6 +984,7 @@ template <class C> inline bool Is(Object* obj);
V(ScriptContextTable) \
V(NativeContext) \
V(ScopeInfo) \
+ V(ModuleInfoEntry) \
V(ModuleInfo) \
V(JSBoundFunction) \
V(JSFunction) \
@@ -4412,7 +4417,7 @@ class ScopeInfo : public FixedArray {
// The layout of the static part of a ScopeInfo is as follows. Each entry is
// numeric and occupies one array slot.
- // 1. A set of properties of the scope
+// 1. A set of properties of the scope.
// 2. The number of parameters. For non-function scopes this is 0.
// 3. The number of non-parameter variables allocated on the stack.
// 4. The number of non-parameter and parameter variables allocated in the
@@ -4530,6 +4535,30 @@ class ScopeInfo : public FixedArray {
friend class ScopeIterator;
};
+class ModuleInfoEntry : public FixedArray {
+ public:
+ DECLARE_CAST(ModuleInfoEntry)
+ static Handle<ModuleInfoEntry> New(Isolate* isolate,
+ Handle<Object> export_name,
+ Handle<Object> local_name,
+ Handle<Object> import_name,
+ Handle<Object> module_request);
+ inline Object* export_name() const;
+ inline Object* local_name() const;
+ inline Object* import_name() const;
+ inline Object* module_request() const;
+
+ private:
+ friend class Factory;
+ enum {
+ kExportNameIndex,
+ kLocalNameIndex,
+ kImportNameIndex,
+ kModuleRequestIndex,
+ kLength
+ };
+};
+
// ModuleInfo is to ModuleDescriptor what ScopeInfo is to Scope.
class ModuleInfo : public FixedArray {
public:
@@ -6337,6 +6366,7 @@ class Map: public HeapObject {
inline bool IsJSFunctionMap();
inline bool IsStringMap();
inline bool IsJSProxyMap();
+ inline bool IsJSModuleMap();
inline bool IsJSGlobalProxyMap();
inline bool IsJSGlobalObjectMap();
inline bool IsJSTypedArrayMap();
@@ -7814,6 +7844,21 @@ class JSGeneratorObject: public JSObject {
DISALLOW_IMPLICIT_CONSTRUCTORS(JSGeneratorObject);
};
+// A JSModule object is a mapping from export names to cells
+// This is still very much in flux.
+class JSModule : public JSObject {
+ public:
+ DECLARE_CAST(JSModule)
+ DECLARE_VERIFIER(JSModule)
+
+ static const int kSize = JSObject::kHeaderSize;
+
+ static void CreateExport(Handle<JSModule> module, Handle<String> name);
+ static void StoreExport(Handle<JSModule> module, Handle<String> name,
+ Handle<Object> value);
+ static Handle<Object> LoadExport(Handle<JSModule> module,
+ Handle<String> name);
+};
// JSBoundFunction describes a bound function exotic object.
class JSBoundFunction : public JSObject {
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698