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

Side by Side Diff: src/objects-inl.h

Issue 2367623004: [modules] Detect and throw exceptions for cyclic dependencies (Closed)
Patch Set: Handled review comments, added a test Created 4 years, 2 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/objects-debug.cc ('k') | test/cctest/interpreter/bytecode_expectations/ForOf.golden » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 5701 matching lines...) Expand 10 before | Expand all | Expand 10 after
5712 ACCESSORS(ContextExtension, scope_info, ScopeInfo, kScopeInfoOffset) 5712 ACCESSORS(ContextExtension, scope_info, ScopeInfo, kScopeInfoOffset)
5713 ACCESSORS(ContextExtension, extension, Object, kExtensionOffset) 5713 ACCESSORS(ContextExtension, extension, Object, kExtensionOffset)
5714 5714
5715 ACCESSORS(Module, code, Object, kCodeOffset) 5715 ACCESSORS(Module, code, Object, kCodeOffset)
5716 ACCESSORS(Module, exports, ObjectHashTable, kExportsOffset) 5716 ACCESSORS(Module, exports, ObjectHashTable, kExportsOffset)
5717 ACCESSORS(Module, requested_modules, FixedArray, kRequestedModulesOffset) 5717 ACCESSORS(Module, requested_modules, FixedArray, kRequestedModulesOffset)
5718 SMI_ACCESSORS(Module, flags, kFlagsOffset) 5718 SMI_ACCESSORS(Module, flags, kFlagsOffset)
5719 BOOL_ACCESSORS(Module, flags, evaluated, kEvaluatedBit) 5719 BOOL_ACCESSORS(Module, flags, evaluated, kEvaluatedBit)
5720 ACCESSORS(Module, embedder_data, Object, kEmbedderDataOffset) 5720 ACCESSORS(Module, embedder_data, Object, kEmbedderDataOffset)
5721 5721
5722 SharedFunctionInfo* Module::shared() const {
5723 return code()->IsSharedFunctionInfo() ? SharedFunctionInfo::cast(code())
5724 : JSFunction::cast(code())->shared();
5725 }
5726
5727 ModuleInfo* Module::info() const {
5728 return shared()->scope_info()->ModuleDescriptorInfo();
5729 }
5730
5731 uint32_t Module::Hash() const { return Symbol::cast(shared()->name())->Hash(); }
5732
5722 ACCESSORS(AccessorPair, getter, Object, kGetterOffset) 5733 ACCESSORS(AccessorPair, getter, Object, kGetterOffset)
5723 ACCESSORS(AccessorPair, setter, Object, kSetterOffset) 5734 ACCESSORS(AccessorPair, setter, Object, kSetterOffset)
5724 5735
5725 ACCESSORS(AccessCheckInfo, callback, Object, kCallbackOffset) 5736 ACCESSORS(AccessCheckInfo, callback, Object, kCallbackOffset)
5726 ACCESSORS(AccessCheckInfo, named_interceptor, Object, kNamedInterceptorOffset) 5737 ACCESSORS(AccessCheckInfo, named_interceptor, Object, kNamedInterceptorOffset)
5727 ACCESSORS(AccessCheckInfo, indexed_interceptor, Object, 5738 ACCESSORS(AccessCheckInfo, indexed_interceptor, Object,
5728 kIndexedInterceptorOffset) 5739 kIndexedInterceptorOffset)
5729 ACCESSORS(AccessCheckInfo, data, Object, kDataOffset) 5740 ACCESSORS(AccessCheckInfo, data, Object, kDataOffset)
5730 5741
5731 ACCESSORS(InterceptorInfo, getter, Object, kGetterOffset) 5742 ACCESSORS(InterceptorInfo, getter, Object, kGetterOffset)
(...skipping 2222 matching lines...) Expand 10 before | Expand all | Expand 10 after
7954 Object* ModuleInfoEntry::export_name() const { return get(kExportNameIndex); } 7965 Object* ModuleInfoEntry::export_name() const { return get(kExportNameIndex); }
7955 7966
7956 Object* ModuleInfoEntry::local_name() const { return get(kLocalNameIndex); } 7967 Object* ModuleInfoEntry::local_name() const { return get(kLocalNameIndex); }
7957 7968
7958 Object* ModuleInfoEntry::import_name() const { return get(kImportNameIndex); } 7969 Object* ModuleInfoEntry::import_name() const { return get(kImportNameIndex); }
7959 7970
7960 Object* ModuleInfoEntry::module_request() const { 7971 Object* ModuleInfoEntry::module_request() const {
7961 return get(kModuleRequestIndex); 7972 return get(kModuleRequestIndex);
7962 } 7973 }
7963 7974
7964 ModuleInfo* Module::info() const {
7965 DisallowHeapAllocation no_gc;
7966 SharedFunctionInfo* shared = code()->IsSharedFunctionInfo()
7967 ? SharedFunctionInfo::cast(code())
7968 : JSFunction::cast(code())->shared();
7969 return shared->scope_info()->ModuleDescriptorInfo();
7970 }
7971
7972 FixedArray* ModuleInfo::module_requests() const { 7975 FixedArray* ModuleInfo::module_requests() const {
7973 return FixedArray::cast(get(kModuleRequestsIndex)); 7976 return FixedArray::cast(get(kModuleRequestsIndex));
7974 } 7977 }
7975 7978
7976 FixedArray* ModuleInfo::special_exports() const { 7979 FixedArray* ModuleInfo::special_exports() const {
7977 return FixedArray::cast(get(kSpecialExportsIndex)); 7980 return FixedArray::cast(get(kSpecialExportsIndex));
7978 } 7981 }
7979 7982
7980 FixedArray* ModuleInfo::regular_exports() const { 7983 FixedArray* ModuleInfo::regular_exports() const {
7981 return FixedArray::cast(get(kRegularExportsIndex)); 7984 return FixedArray::cast(get(kRegularExportsIndex));
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
8332 #undef WRITE_INT64_FIELD 8335 #undef WRITE_INT64_FIELD
8333 #undef READ_BYTE_FIELD 8336 #undef READ_BYTE_FIELD
8334 #undef WRITE_BYTE_FIELD 8337 #undef WRITE_BYTE_FIELD
8335 #undef NOBARRIER_READ_BYTE_FIELD 8338 #undef NOBARRIER_READ_BYTE_FIELD
8336 #undef NOBARRIER_WRITE_BYTE_FIELD 8339 #undef NOBARRIER_WRITE_BYTE_FIELD
8337 8340
8338 } // namespace internal 8341 } // namespace internal
8339 } // namespace v8 8342 } // namespace v8
8340 8343
8341 #endif // V8_OBJECTS_INL_H_ 8344 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects-debug.cc ('k') | test/cctest/interpreter/bytecode_expectations/ForOf.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698