Chromium Code Reviews| 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 7944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 // Currently, an exception is always thrown in the case of a cycle and in the | |
| 7968 // case of conflicting star exports. TODO(neis): Make that spec-compliant. | |
| 7969 static MUST_USE_RESULT MaybeHandle<Cell> ResolveExport(Handle<Module> module, | |
| 7970 Handle<String> name, | |
| 7971 bool must_resolve); | |
| 7965 static MUST_USE_RESULT MaybeHandle<Cell> ResolveImport(Handle<Module> module, | 7972 static MUST_USE_RESULT MaybeHandle<Cell> ResolveImport(Handle<Module> module, | 
| 7966 Handle<String> name, | 7973 Handle<String> name, | 
| 7967 int module_request); | 7974 int module_request, | 
| 7968 static MUST_USE_RESULT MaybeHandle<Cell> ResolveExport(Handle<Module> module, | 7975 bool must_resolve); | 
| 7969 Handle<String> name); | |
| 7970 | 7976 | 
| 7971 static const int kCodeOffset = HeapObject::kHeaderSize; | 7977 static const int kCodeOffset = HeapObject::kHeaderSize; | 
| 7972 static const int kExportsOffset = kCodeOffset + kPointerSize; | 7978 static const int kExportsOffset = kCodeOffset + kPointerSize; | 
| 7973 static const int kRequestedModulesOffset = kExportsOffset + kPointerSize; | 7979 static const int kRequestedModulesOffset = kExportsOffset + kPointerSize; | 
| 7974 static const int kFlagsOffset = kRequestedModulesOffset + kPointerSize; | 7980 static const int kFlagsOffset = kRequestedModulesOffset + kPointerSize; | 
| 7975 static const int kEmbedderDataOffset = kFlagsOffset + kPointerSize; | 7981 static const int kEmbedderDataOffset = kFlagsOffset + kPointerSize; | 
| 7976 static const int kSize = kEmbedderDataOffset + kPointerSize; | 7982 static const int kSize = kEmbedderDataOffset + kPointerSize; | 
| 7977 | 7983 | 
| 7978 private: | 7984 private: | 
| 7979 enum { kEvaluatedBit }; | 7985 enum { kEvaluatedBit }; | 
| 7980 | 7986 | 
| 7987 // Helper for ResolveExport. | |
| 
 
adamk
2016/09/24 01:01:00
Please document the fact that you have to check th
 
 | |
| 7988 static MUST_USE_RESULT MaybeHandle<Cell> ResolveExportUsingStarExports( | |
| 7989 Handle<Module> module, Handle<String> name, bool must_resolve); | |
| 7990 | |
| 7981 DISALLOW_IMPLICIT_CONSTRUCTORS(Module); | 7991 DISALLOW_IMPLICIT_CONSTRUCTORS(Module); | 
| 7982 }; | 7992 }; | 
| 7983 | 7993 | 
| 7984 // JSBoundFunction describes a bound function exotic object. | 7994 // JSBoundFunction describes a bound function exotic object. | 
| 7985 class JSBoundFunction : public JSObject { | 7995 class JSBoundFunction : public JSObject { | 
| 7986 public: | 7996 public: | 
| 7987 // [bound_target_function]: The wrapped function object. | 7997 // [bound_target_function]: The wrapped function object. | 
| 7988 DECL_ACCESSORS(bound_target_function, JSReceiver) | 7998 DECL_ACCESSORS(bound_target_function, JSReceiver) | 
| 7989 | 7999 | 
| 7990 // [bound_this]: The value that is always passed as the this value when | 8000 // [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 Loading... | |
| 11417 } | 11427 } | 
| 11418 return value; | 11428 return value; | 
| 11419 } | 11429 } | 
| 11420 }; | 11430 }; | 
| 11421 | 11431 | 
| 11422 | 11432 | 
| 11423 } // NOLINT, false-positive due to second-order macros. | 11433 } // NOLINT, false-positive due to second-order macros. | 
| 11424 } // NOLINT, false-positive due to second-order macros. | 11434 } // NOLINT, false-positive due to second-order macros. | 
| 11425 | 11435 | 
| 11426 #endif // V8_OBJECTS_H_ | 11436 #endif // V8_OBJECTS_H_ | 
| OLD | NEW |