OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 4297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4308 } | 4308 } |
4309 | 4309 |
4310 | 4310 |
4311 MaybeObject* JSReceiver::GetIdentityHash(CreationFlag flag) { | 4311 MaybeObject* JSReceiver::GetIdentityHash(CreationFlag flag) { |
4312 return IsJSProxy() | 4312 return IsJSProxy() |
4313 ? JSProxy::cast(this)->GetIdentityHash(flag) | 4313 ? JSProxy::cast(this)->GetIdentityHash(flag) |
4314 : JSObject::cast(this)->GetIdentityHash(flag); | 4314 : JSObject::cast(this)->GetIdentityHash(flag); |
4315 } | 4315 } |
4316 | 4316 |
4317 | 4317 |
4318 bool JSObject::HasHiddenPropertiesObject() { | |
4319 ASSERT(!IsJSGlobalProxy()); | |
4320 return GetPropertyAttributePostInterceptor(this, | |
4321 GetHeap()->hidden_symbol(), | |
4322 false) != ABSENT; | |
4323 } | |
4324 | |
4325 | |
4326 Object* JSObject::GetHiddenPropertiesObject() { | |
4327 ASSERT(!IsJSGlobalProxy()); | |
4328 PropertyAttributes attributes; | |
4329 // You can't install a getter on a property indexed by the hidden symbol, | |
4330 // so we can be sure that GetLocalPropertyPostInterceptor returns a real | |
4331 // object. | |
4332 Object* result = | |
4333 GetLocalPropertyPostInterceptor(this, | |
4334 GetHeap()->hidden_symbol(), | |
4335 &attributes)->ToObjectUnchecked(); | |
4336 return result; | |
4337 } | |
4338 | |
4339 | |
4340 MaybeObject* JSObject::SetHiddenPropertiesObject(Object* hidden_obj) { | |
4341 ASSERT(!IsJSGlobalProxy()); | |
4342 return SetPropertyPostInterceptor(GetHeap()->hidden_symbol(), | |
4343 hidden_obj, | |
4344 DONT_ENUM, | |
4345 kNonStrictMode); | |
4346 } | |
4347 | |
4348 | |
4349 bool JSObject::HasHiddenProperties() { | |
4350 return !GetHiddenProperties(OMIT_CREATION)->ToObjectChecked()->IsUndefined(); | |
4351 } | |
4352 | |
4353 | |
4354 bool JSReceiver::HasElement(uint32_t index) { | 4318 bool JSReceiver::HasElement(uint32_t index) { |
4355 if (IsJSProxy()) { | 4319 if (IsJSProxy()) { |
4356 return JSProxy::cast(this)->HasElementWithHandler(index); | 4320 return JSProxy::cast(this)->HasElementWithHandler(index); |
4357 } | 4321 } |
4358 return JSObject::cast(this)->HasElementWithReceiver(this, index); | 4322 return JSObject::cast(this)->HasElementWithReceiver(this, index); |
4359 } | 4323 } |
4360 | 4324 |
4361 | 4325 |
4362 bool AccessorInfo::all_can_read() { | 4326 bool AccessorInfo::all_can_read() { |
4363 return BooleanBit::get(flag(), kAllCanReadBit); | 4327 return BooleanBit::get(flag(), kAllCanReadBit); |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4645 #undef WRITE_INT_FIELD | 4609 #undef WRITE_INT_FIELD |
4646 #undef READ_SHORT_FIELD | 4610 #undef READ_SHORT_FIELD |
4647 #undef WRITE_SHORT_FIELD | 4611 #undef WRITE_SHORT_FIELD |
4648 #undef READ_BYTE_FIELD | 4612 #undef READ_BYTE_FIELD |
4649 #undef WRITE_BYTE_FIELD | 4613 #undef WRITE_BYTE_FIELD |
4650 | 4614 |
4651 | 4615 |
4652 } } // namespace v8::internal | 4616 } } // namespace v8::internal |
4653 | 4617 |
4654 #endif // V8_OBJECTS_INL_H_ | 4618 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |