OLD | NEW |
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 5723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5734 ACCESSORS(JSModuleNamespace, module, Module, kModuleOffset) | 5734 ACCESSORS(JSModuleNamespace, module, Module, kModuleOffset) |
5735 | 5735 |
5736 ACCESSORS(JSFixedArrayIterator, array, FixedArray, kArrayOffset) | 5736 ACCESSORS(JSFixedArrayIterator, array, FixedArray, kArrayOffset) |
5737 SMI_ACCESSORS(JSFixedArrayIterator, index, kIndexOffset) | 5737 SMI_ACCESSORS(JSFixedArrayIterator, index, kIndexOffset) |
5738 ACCESSORS(JSFixedArrayIterator, initial_next, JSFunction, kNextOffset) | 5738 ACCESSORS(JSFixedArrayIterator, initial_next, JSFunction, kNextOffset) |
5739 | 5739 |
5740 ACCESSORS(Module, code, Object, kCodeOffset) | 5740 ACCESSORS(Module, code, Object, kCodeOffset) |
5741 ACCESSORS(Module, exports, ObjectHashTable, kExportsOffset) | 5741 ACCESSORS(Module, exports, ObjectHashTable, kExportsOffset) |
5742 ACCESSORS(Module, module_namespace, HeapObject, kModuleNamespaceOffset) | 5742 ACCESSORS(Module, module_namespace, HeapObject, kModuleNamespaceOffset) |
5743 ACCESSORS(Module, requested_modules, FixedArray, kRequestedModulesOffset) | 5743 ACCESSORS(Module, requested_modules, FixedArray, kRequestedModulesOffset) |
5744 SMI_ACCESSORS(Module, flags, kFlagsOffset) | |
5745 BOOL_ACCESSORS(Module, flags, evaluated, kEvaluatedBit) | |
5746 SMI_ACCESSORS(Module, hash, kHashOffset) | 5744 SMI_ACCESSORS(Module, hash, kHashOffset) |
5747 | 5745 |
5748 SharedFunctionInfo* Module::shared() const { | 5746 bool Module::evaluated() const { return code()->IsModuleInfo(); } |
5749 return code()->IsSharedFunctionInfo() ? SharedFunctionInfo::cast(code()) | 5747 |
5750 : JSFunction::cast(code())->shared(); | 5748 void Module::set_evaluated() { |
| 5749 DCHECK(instantiated()); |
| 5750 DCHECK(!evaluated()); |
| 5751 return set_code( |
| 5752 JSFunction::cast(code())->shared()->scope_info()->ModuleDescriptorInfo()); |
5751 } | 5753 } |
5752 | 5754 |
| 5755 bool Module::instantiated() const { return !code()->IsSharedFunctionInfo(); } |
| 5756 |
5753 ModuleInfo* Module::info() const { | 5757 ModuleInfo* Module::info() const { |
5754 return shared()->scope_info()->ModuleDescriptorInfo(); | 5758 if (evaluated()) return ModuleInfo::cast(code()); |
| 5759 ScopeInfo* scope_info = instantiated() |
| 5760 ? JSFunction::cast(code())->shared()->scope_info() |
| 5761 : SharedFunctionInfo::cast(code())->scope_info(); |
| 5762 return scope_info->ModuleDescriptorInfo(); |
5755 } | 5763 } |
5756 | 5764 |
5757 ACCESSORS(AccessorPair, getter, Object, kGetterOffset) | 5765 ACCESSORS(AccessorPair, getter, Object, kGetterOffset) |
5758 ACCESSORS(AccessorPair, setter, Object, kSetterOffset) | 5766 ACCESSORS(AccessorPair, setter, Object, kSetterOffset) |
5759 | 5767 |
5760 ACCESSORS(AccessCheckInfo, callback, Object, kCallbackOffset) | 5768 ACCESSORS(AccessCheckInfo, callback, Object, kCallbackOffset) |
5761 ACCESSORS(AccessCheckInfo, named_interceptor, Object, kNamedInterceptorOffset) | 5769 ACCESSORS(AccessCheckInfo, named_interceptor, Object, kNamedInterceptorOffset) |
5762 ACCESSORS(AccessCheckInfo, indexed_interceptor, Object, | 5770 ACCESSORS(AccessCheckInfo, indexed_interceptor, Object, |
5763 kIndexedInterceptorOffset) | 5771 kIndexedInterceptorOffset) |
5764 ACCESSORS(AccessCheckInfo, data, Object, kDataOffset) | 5772 ACCESSORS(AccessCheckInfo, data, Object, kDataOffset) |
(...skipping 2588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8353 #undef WRITE_INT64_FIELD | 8361 #undef WRITE_INT64_FIELD |
8354 #undef READ_BYTE_FIELD | 8362 #undef READ_BYTE_FIELD |
8355 #undef WRITE_BYTE_FIELD | 8363 #undef WRITE_BYTE_FIELD |
8356 #undef NOBARRIER_READ_BYTE_FIELD | 8364 #undef NOBARRIER_READ_BYTE_FIELD |
8357 #undef NOBARRIER_WRITE_BYTE_FIELD | 8365 #undef NOBARRIER_WRITE_BYTE_FIELD |
8358 | 8366 |
8359 } // namespace internal | 8367 } // namespace internal |
8360 } // namespace v8 | 8368 } // namespace v8 |
8361 | 8369 |
8362 #endif // V8_OBJECTS_INL_H_ | 8370 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |