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 7932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7943 // [[Evaluated]]: Whether this module has been evaluated. Modules | 7943 // [[Evaluated]]: Whether this module has been evaluated. Modules |
7944 // are only evaluated a single time. | 7944 // are only evaluated a single time. |
7945 DECL_BOOLEAN_ACCESSORS(evaluated) | 7945 DECL_BOOLEAN_ACCESSORS(evaluated) |
7946 | 7946 |
7947 // Storage for [[Evaluated]] | 7947 // Storage for [[Evaluated]] |
7948 DECL_INT_ACCESSORS(flags) | 7948 DECL_INT_ACCESSORS(flags) |
7949 | 7949 |
7950 // Embedder-specified data | 7950 // Embedder-specified data |
7951 DECL_ACCESSORS(embedder_data, Object) | 7951 DECL_ACCESSORS(embedder_data, Object) |
7952 | 7952 |
| 7953 // Get the SharedFunctionInfo associated with the code. |
| 7954 inline SharedFunctionInfo* shared() const; |
| 7955 |
7953 // Get the ModuleInfo associated with the code. | 7956 // Get the ModuleInfo associated with the code. |
7954 inline ModuleInfo* info() const; | 7957 inline ModuleInfo* info() const; |
7955 | 7958 |
| 7959 // Compute a hash for this object. |
| 7960 inline uint32_t Hash() const; |
| 7961 |
7956 // Implementation of spec operation ModuleDeclarationInstantiation. | 7962 // Implementation of spec operation ModuleDeclarationInstantiation. |
7957 // Returns false if an exception occurred during instantiation, true | 7963 // Returns false if an exception occurred during instantiation, true |
7958 // otherwise. | 7964 // otherwise. |
7959 static MUST_USE_RESULT bool Instantiate(Handle<Module> module, | 7965 static MUST_USE_RESULT bool Instantiate(Handle<Module> module, |
7960 v8::Local<v8::Context> context, | 7966 v8::Local<v8::Context> context, |
7961 v8::Module::ResolveCallback callback, | 7967 v8::Module::ResolveCallback callback, |
7962 v8::Local<v8::Value> callback_data); | 7968 v8::Local<v8::Value> callback_data); |
7963 | 7969 |
7964 static Handle<Object> LoadExport(Handle<Module> module, Handle<String> name); | 7970 static Handle<Object> LoadExport(Handle<Module> module, Handle<String> name); |
7965 static void StoreExport(Handle<Module> module, Handle<String> name, | 7971 static void StoreExport(Handle<Module> module, Handle<String> name, |
(...skipping 18 matching lines...) Expand all Loading... |
7984 | 7990 |
7985 // The [must_resolve] argument indicates whether or not an exception should be | 7991 // The [must_resolve] argument indicates whether or not an exception should be |
7986 // thrown if the module does not provide an export named [name]. | 7992 // thrown if the module does not provide an export named [name]. |
7987 // | 7993 // |
7988 // If [must_resolve] is true, a null result indicates an exception. If | 7994 // If [must_resolve] is true, a null result indicates an exception. If |
7989 // [must_resolve] is false, a null result does not necessarily indicate an | 7995 // [must_resolve] is false, a null result does not necessarily indicate an |
7990 // exception, but there may be one pending. | 7996 // exception, but there may be one pending. |
7991 // | 7997 // |
7992 // Currently, an exception is always thrown in the case of a cycle and in the | 7998 // Currently, an exception is always thrown in the case of a cycle and in the |
7993 // case of conflicting star exports. TODO(neis): Make that spec-compliant. | 7999 // case of conflicting star exports. TODO(neis): Make that spec-compliant. |
7994 static MUST_USE_RESULT MaybeHandle<Cell> ResolveExport(Handle<Module> module, | 8000 class ResolveSet; |
7995 Handle<String> name, | 8001 static MUST_USE_RESULT MaybeHandle<Cell> ResolveExport( |
7996 bool must_resolve); | 8002 Handle<Module> module, Handle<String> name, bool must_resolve, |
7997 static MUST_USE_RESULT MaybeHandle<Cell> ResolveImport(Handle<Module> module, | 8003 ResolveSet* resolve_set); |
7998 Handle<String> name, | 8004 static MUST_USE_RESULT MaybeHandle<Cell> ResolveImport( |
7999 int module_request, | 8005 Handle<Module> module, Handle<String> name, int module_request, |
8000 bool must_resolve); | 8006 bool must_resolve, ResolveSet* resolve_set); |
8001 | 8007 |
8002 // Helper for ResolveExport. | 8008 // Helper for ResolveExport. |
8003 static MUST_USE_RESULT MaybeHandle<Cell> ResolveExportUsingStarExports( | 8009 static MUST_USE_RESULT MaybeHandle<Cell> ResolveExportUsingStarExports( |
8004 Handle<Module> module, Handle<String> name, bool must_resolve); | 8010 Handle<Module> module, Handle<String> name, bool must_resolve, |
| 8011 ResolveSet* resolve_set); |
8005 | 8012 |
8006 DISALLOW_IMPLICIT_CONSTRUCTORS(Module); | 8013 DISALLOW_IMPLICIT_CONSTRUCTORS(Module); |
8007 }; | 8014 }; |
8008 | 8015 |
8009 // JSBoundFunction describes a bound function exotic object. | 8016 // JSBoundFunction describes a bound function exotic object. |
8010 class JSBoundFunction : public JSObject { | 8017 class JSBoundFunction : public JSObject { |
8011 public: | 8018 public: |
8012 // [bound_target_function]: The wrapped function object. | 8019 // [bound_target_function]: The wrapped function object. |
8013 DECL_ACCESSORS(bound_target_function, JSReceiver) | 8020 DECL_ACCESSORS(bound_target_function, JSReceiver) |
8014 | 8021 |
(...skipping 3427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11442 } | 11449 } |
11443 return value; | 11450 return value; |
11444 } | 11451 } |
11445 }; | 11452 }; |
11446 | 11453 |
11447 | 11454 |
11448 } // NOLINT, false-positive due to second-order macros. | 11455 } // NOLINT, false-positive due to second-order macros. |
11449 } // NOLINT, false-positive due to second-order macros. | 11456 } // NOLINT, false-positive due to second-order macros. |
11450 | 11457 |
11451 #endif // V8_OBJECTS_H_ | 11458 #endif // V8_OBJECTS_H_ |
OLD | NEW |