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

Side by Side Diff: src/objects.h

Issue 2362153003: [modules] Support star exports. (Closed)
Patch Set: Address comments. 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 unified diff | Download patch
« no previous file with comments | « src/messages.h ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7944 matching lines...) Expand 10 before | Expand all | Expand 10 after
7955 static Handle<Object> LoadExport(Handle<Module> module, Handle<String> name); 7955 static Handle<Object> LoadExport(Handle<Module> module, Handle<String> name);
7956 static void StoreExport(Handle<Module> module, Handle<String> name, 7956 static void StoreExport(Handle<Module> module, Handle<String> name,
7957 Handle<Object> value); 7957 Handle<Object> value);
7958 7958
7959 static void CreateIndirectExport(Handle<Module> module, Handle<String> name, 7959 static void CreateIndirectExport(Handle<Module> module, Handle<String> name,
7960 Handle<ModuleInfoEntry> entry); 7960 Handle<ModuleInfoEntry> entry);
7961 7961
7962 static Handle<Object> LoadImport(Handle<Module> module, Handle<String> name, 7962 static Handle<Object> LoadImport(Handle<Module> module, Handle<String> name,
7963 int module_request); 7963 int module_request);
7964 7964
7965 // The [must_resolve] argument indicates whether or not an exception should be
7966 // thrown if the module does not provide an export named [name].
7967 //
7968 // If [must_resolve] is true, a null result indicates an exception. If
7969 // [must_resolve] is false, a null result does not necessarily indicate an
7970 // exception, but there may be one pending.
7971 //
7972 // Currently, an exception is always thrown in the case of a cycle and in the
7973 // case of conflicting star exports. TODO(neis): Make that spec-compliant.
7974 static MUST_USE_RESULT MaybeHandle<Cell> ResolveExport(Handle<Module> module,
7975 Handle<String> name,
7976 bool must_resolve);
7965 static MUST_USE_RESULT MaybeHandle<Cell> ResolveImport(Handle<Module> module, 7977 static MUST_USE_RESULT MaybeHandle<Cell> ResolveImport(Handle<Module> module,
7966 Handle<String> name, 7978 Handle<String> name,
7967 int module_request); 7979 int module_request,
7968 static MUST_USE_RESULT MaybeHandle<Cell> ResolveExport(Handle<Module> module, 7980 bool must_resolve);
7969 Handle<String> name);
7970 7981
7971 static const int kCodeOffset = HeapObject::kHeaderSize; 7982 static const int kCodeOffset = HeapObject::kHeaderSize;
7972 static const int kExportsOffset = kCodeOffset + kPointerSize; 7983 static const int kExportsOffset = kCodeOffset + kPointerSize;
7973 static const int kRequestedModulesOffset = kExportsOffset + kPointerSize; 7984 static const int kRequestedModulesOffset = kExportsOffset + kPointerSize;
7974 static const int kFlagsOffset = kRequestedModulesOffset + kPointerSize; 7985 static const int kFlagsOffset = kRequestedModulesOffset + kPointerSize;
7975 static const int kEmbedderDataOffset = kFlagsOffset + kPointerSize; 7986 static const int kEmbedderDataOffset = kFlagsOffset + kPointerSize;
7976 static const int kSize = kEmbedderDataOffset + kPointerSize; 7987 static const int kSize = kEmbedderDataOffset + kPointerSize;
7977 7988
7978 private: 7989 private:
7979 enum { kEvaluatedBit }; 7990 enum { kEvaluatedBit };
7980 7991
7992 // Helper for ResolveExport.
7993 static MUST_USE_RESULT MaybeHandle<Cell> ResolveExportUsingStarExports(
7994 Handle<Module> module, Handle<String> name, bool must_resolve);
7995
7981 DISALLOW_IMPLICIT_CONSTRUCTORS(Module); 7996 DISALLOW_IMPLICIT_CONSTRUCTORS(Module);
7982 }; 7997 };
7983 7998
7984 // JSBoundFunction describes a bound function exotic object. 7999 // JSBoundFunction describes a bound function exotic object.
7985 class JSBoundFunction : public JSObject { 8000 class JSBoundFunction : public JSObject {
7986 public: 8001 public:
7987 // [bound_target_function]: The wrapped function object. 8002 // [bound_target_function]: The wrapped function object.
7988 DECL_ACCESSORS(bound_target_function, JSReceiver) 8003 DECL_ACCESSORS(bound_target_function, JSReceiver)
7989 8004
7990 // [bound_this]: The value that is always passed as the this value when 8005 // [bound_this]: The value that is always passed as the this value when
(...skipping 3426 matching lines...) Expand 10 before | Expand all | Expand 10 after
11417 } 11432 }
11418 return value; 11433 return value;
11419 } 11434 }
11420 }; 11435 };
11421 11436
11422 11437
11423 } // NOLINT, false-positive due to second-order macros. 11438 } // NOLINT, false-positive due to second-order macros.
11424 } // NOLINT, false-positive due to second-order macros. 11439 } // NOLINT, false-positive due to second-order macros.
11425 11440
11426 #endif // V8_OBJECTS_H_ 11441 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/messages.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698