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 5133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5144 ACCESSORS(Map, dependent_code, DependentCode, kDependentCodeOffset) | 5144 ACCESSORS(Map, dependent_code, DependentCode, kDependentCodeOffset) |
5145 ACCESSORS(Map, constructor, Object, kConstructorOffset) | 5145 ACCESSORS(Map, constructor, Object, kConstructorOffset) |
5146 | 5146 |
5147 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) | 5147 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) |
5148 ACCESSORS(JSFunction, literals_or_bindings, FixedArray, kLiteralsOffset) | 5148 ACCESSORS(JSFunction, literals_or_bindings, FixedArray, kLiteralsOffset) |
5149 ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset) | 5149 ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset) |
5150 | 5150 |
5151 ACCESSORS(GlobalObject, builtins, JSBuiltinsObject, kBuiltinsOffset) | 5151 ACCESSORS(GlobalObject, builtins, JSBuiltinsObject, kBuiltinsOffset) |
5152 ACCESSORS(GlobalObject, native_context, Context, kNativeContextOffset) | 5152 ACCESSORS(GlobalObject, native_context, Context, kNativeContextOffset) |
5153 ACCESSORS(GlobalObject, global_context, Context, kGlobalContextOffset) | 5153 ACCESSORS(GlobalObject, global_context, Context, kGlobalContextOffset) |
5154 ACCESSORS(GlobalObject, global_receiver, JSObject, kGlobalReceiverOffset) | 5154 ACCESSORS(GlobalObject, global_proxy, JSObject, kGlobalProxyOffset) |
5155 | 5155 |
5156 ACCESSORS(JSGlobalProxy, native_context, Object, kNativeContextOffset) | 5156 ACCESSORS(JSGlobalProxy, native_context, Object, kNativeContextOffset) |
5157 ACCESSORS(JSGlobalProxy, hash, Object, kHashOffset) | 5157 ACCESSORS(JSGlobalProxy, hash, Object, kHashOffset) |
5158 | 5158 |
5159 ACCESSORS(AccessorInfo, name, Object, kNameOffset) | 5159 ACCESSORS(AccessorInfo, name, Object, kNameOffset) |
5160 ACCESSORS_TO_SMI(AccessorInfo, flag, kFlagOffset) | 5160 ACCESSORS_TO_SMI(AccessorInfo, flag, kFlagOffset) |
5161 ACCESSORS(AccessorInfo, expected_receiver_type, Object, | 5161 ACCESSORS(AccessorInfo, expected_receiver_type, Object, |
5162 kExpectedReceiverTypeOffset) | 5162 kExpectedReceiverTypeOffset) |
5163 | 5163 |
5164 ACCESSORS(DeclaredAccessorDescriptor, serialized_data, ByteArray, | 5164 ACCESSORS(DeclaredAccessorDescriptor, serialized_data, ByteArray, |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5733 context()->native_context()->RemoveOptimizedFunction(this); | 5733 context()->native_context()->RemoveOptimizedFunction(this); |
5734 } | 5734 } |
5735 } | 5735 } |
5736 | 5736 |
5737 | 5737 |
5738 Context* JSFunction::context() { | 5738 Context* JSFunction::context() { |
5739 return Context::cast(READ_FIELD(this, kContextOffset)); | 5739 return Context::cast(READ_FIELD(this, kContextOffset)); |
5740 } | 5740 } |
5741 | 5741 |
5742 | 5742 |
| 5743 JSObject* JSFunction::global_proxy() { |
| 5744 return context()->global_proxy(); |
| 5745 } |
| 5746 |
| 5747 |
5743 void JSFunction::set_context(Object* value) { | 5748 void JSFunction::set_context(Object* value) { |
5744 ASSERT(value->IsUndefined() || value->IsContext()); | 5749 ASSERT(value->IsUndefined() || value->IsContext()); |
5745 WRITE_FIELD(this, kContextOffset, value); | 5750 WRITE_FIELD(this, kContextOffset, value); |
5746 WRITE_BARRIER(GetHeap(), this, kContextOffset, value); | 5751 WRITE_BARRIER(GetHeap(), this, kContextOffset, value); |
5747 } | 5752 } |
5748 | 5753 |
5749 ACCESSORS(JSFunction, prototype_or_initial_map, Object, | 5754 ACCESSORS(JSFunction, prototype_or_initial_map, Object, |
5750 kPrototypeOrInitialMapOffset) | 5755 kPrototypeOrInitialMapOffset) |
5751 | 5756 |
5752 | 5757 |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6475 if (object->IsJSProxy()) { | 6480 if (object->IsJSProxy()) { |
6476 return JSProxy::GetElementAttributeWithHandler( | 6481 return JSProxy::GetElementAttributeWithHandler( |
6477 Handle<JSProxy>::cast(object), object, index); | 6482 Handle<JSProxy>::cast(object), object, index); |
6478 } | 6483 } |
6479 return JSObject::GetElementAttributeWithReceiver( | 6484 return JSObject::GetElementAttributeWithReceiver( |
6480 Handle<JSObject>::cast(object), object, index, true); | 6485 Handle<JSObject>::cast(object), object, index, true); |
6481 } | 6486 } |
6482 | 6487 |
6483 | 6488 |
6484 bool JSGlobalObject::IsDetached() { | 6489 bool JSGlobalObject::IsDetached() { |
6485 return JSGlobalProxy::cast(global_receiver())->IsDetachedFrom(this); | 6490 return JSGlobalProxy::cast(global_proxy())->IsDetachedFrom(this); |
6486 } | 6491 } |
6487 | 6492 |
6488 | 6493 |
6489 bool JSGlobalProxy::IsDetachedFrom(GlobalObject* global) const { | 6494 bool JSGlobalProxy::IsDetachedFrom(GlobalObject* global) const { |
6490 return GetPrototype() != global; | 6495 return GetPrototype() != global; |
6491 } | 6496 } |
6492 | 6497 |
6493 | 6498 |
6494 Handle<Smi> JSReceiver::GetOrCreateIdentityHash(Handle<JSReceiver> object) { | 6499 Handle<Smi> JSReceiver::GetOrCreateIdentityHash(Handle<JSReceiver> object) { |
6495 return object->IsJSProxy() | 6500 return object->IsJSProxy() |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7023 #undef READ_SHORT_FIELD | 7028 #undef READ_SHORT_FIELD |
7024 #undef WRITE_SHORT_FIELD | 7029 #undef WRITE_SHORT_FIELD |
7025 #undef READ_BYTE_FIELD | 7030 #undef READ_BYTE_FIELD |
7026 #undef WRITE_BYTE_FIELD | 7031 #undef WRITE_BYTE_FIELD |
7027 #undef NOBARRIER_READ_BYTE_FIELD | 7032 #undef NOBARRIER_READ_BYTE_FIELD |
7028 #undef NOBARRIER_WRITE_BYTE_FIELD | 7033 #undef NOBARRIER_WRITE_BYTE_FIELD |
7029 | 7034 |
7030 } } // namespace v8::internal | 7035 } } // namespace v8::internal |
7031 | 7036 |
7032 #endif // V8_OBJECTS_INL_H_ | 7037 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |