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 4310 matching lines...) Loading... |
4321 } | 4321 } |
4322 | 4322 |
4323 | 4323 |
4324 MaybeObject* JSReceiver::GetIdentityHash(CreationFlag flag) { | 4324 MaybeObject* JSReceiver::GetIdentityHash(CreationFlag flag) { |
4325 return IsJSProxy() | 4325 return IsJSProxy() |
4326 ? JSProxy::cast(this)->GetIdentityHash(flag) | 4326 ? JSProxy::cast(this)->GetIdentityHash(flag) |
4327 : JSObject::cast(this)->GetIdentityHash(flag); | 4327 : JSObject::cast(this)->GetIdentityHash(flag); |
4328 } | 4328 } |
4329 | 4329 |
4330 | 4330 |
4331 bool JSObject::HasHiddenPropertiesObject() { | |
4332 ASSERT(!IsJSGlobalProxy()); | |
4333 return GetPropertyAttributePostInterceptor(this, | |
4334 GetHeap()->hidden_symbol(), | |
4335 false) != ABSENT; | |
4336 } | |
4337 | |
4338 | |
4339 Object* JSObject::GetHiddenPropertiesObject() { | |
4340 ASSERT(!IsJSGlobalProxy()); | |
4341 PropertyAttributes attributes; | |
4342 // You can't install a getter on a property indexed by the hidden symbol, | |
4343 // so we can be sure that GetLocalPropertyPostInterceptor returns a real | |
4344 // object. | |
4345 Object* result = | |
4346 GetLocalPropertyPostInterceptor(this, | |
4347 GetHeap()->hidden_symbol(), | |
4348 &attributes)->ToObjectUnchecked(); | |
4349 return result; | |
4350 } | |
4351 | |
4352 | |
4353 MaybeObject* JSObject::SetHiddenPropertiesObject(Object* hidden_obj) { | |
4354 ASSERT(!IsJSGlobalProxy()); | |
4355 return SetPropertyPostInterceptor(GetHeap()->hidden_symbol(), | |
4356 hidden_obj, | |
4357 DONT_ENUM, | |
4358 kNonStrictMode); | |
4359 } | |
4360 | |
4361 | |
4362 bool JSObject::HasHiddenProperties() { | |
4363 return !GetHiddenProperties(OMIT_CREATION)->ToObjectChecked()->IsUndefined(); | |
4364 } | |
4365 | |
4366 | |
4367 bool JSReceiver::HasElement(uint32_t index) { | 4331 bool JSReceiver::HasElement(uint32_t index) { |
4368 if (IsJSProxy()) { | 4332 if (IsJSProxy()) { |
4369 return JSProxy::cast(this)->HasElementWithHandler(index); | 4333 return JSProxy::cast(this)->HasElementWithHandler(index); |
4370 } | 4334 } |
4371 return JSObject::cast(this)->HasElementWithReceiver(this, index); | 4335 return JSObject::cast(this)->HasElementWithReceiver(this, index); |
4372 } | 4336 } |
4373 | 4337 |
4374 | 4338 |
4375 bool AccessorInfo::all_can_read() { | 4339 bool AccessorInfo::all_can_read() { |
4376 return BooleanBit::get(flag(), kAllCanReadBit); | 4340 return BooleanBit::get(flag(), kAllCanReadBit); |
(...skipping 281 matching lines...) Loading... |
4658 #undef WRITE_INT_FIELD | 4622 #undef WRITE_INT_FIELD |
4659 #undef READ_SHORT_FIELD | 4623 #undef READ_SHORT_FIELD |
4660 #undef WRITE_SHORT_FIELD | 4624 #undef WRITE_SHORT_FIELD |
4661 #undef READ_BYTE_FIELD | 4625 #undef READ_BYTE_FIELD |
4662 #undef WRITE_BYTE_FIELD | 4626 #undef WRITE_BYTE_FIELD |
4663 | 4627 |
4664 | 4628 |
4665 } } // namespace v8::internal | 4629 } } // namespace v8::internal |
4666 | 4630 |
4667 #endif // V8_OBJECTS_INL_H_ | 4631 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |