OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 } | 521 } |
522 | 522 |
523 virtual void Validate(JSObject* holder) { | 523 virtual void Validate(JSObject* holder) { |
524 ElementsAccessorSubclass::ValidateImpl(holder); | 524 ElementsAccessorSubclass::ValidateImpl(holder); |
525 } | 525 } |
526 | 526 |
527 static bool HasElementImpl(Object* receiver, | 527 static bool HasElementImpl(Object* receiver, |
528 JSObject* holder, | 528 JSObject* holder, |
529 uint32_t key, | 529 uint32_t key, |
530 BackingStore* backing_store) { | 530 BackingStore* backing_store) { |
531 MaybeObject* element = | 531 return ElementsAccessorSubclass::GetAttributesImpl( |
532 ElementsAccessorSubclass::GetImpl(receiver, holder, key, backing_store); | 532 receiver, holder, key, backing_store) != ABSENT; |
533 return !element->IsTheHole(); | |
534 } | 533 } |
535 | 534 |
536 virtual bool HasElement(Object* receiver, | 535 virtual bool HasElement(Object* receiver, |
537 JSObject* holder, | 536 JSObject* holder, |
538 uint32_t key, | 537 uint32_t key, |
539 FixedArrayBase* backing_store) { | 538 FixedArrayBase* backing_store) { |
540 if (backing_store == NULL) { | 539 if (backing_store == NULL) { |
541 backing_store = holder->elements(); | 540 backing_store = holder->elements(); |
542 } | 541 } |
543 return ElementsAccessorSubclass::HasElementImpl( | 542 return ElementsAccessorSubclass::HasElementImpl( |
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1748 if (!maybe_obj->To(&new_backing_store)) return maybe_obj; | 1747 if (!maybe_obj->To(&new_backing_store)) return maybe_obj; |
1749 new_backing_store->set(0, length); | 1748 new_backing_store->set(0, length); |
1750 { MaybeObject* result = array->SetContent(new_backing_store); | 1749 { MaybeObject* result = array->SetContent(new_backing_store); |
1751 if (result->IsFailure()) return result; | 1750 if (result->IsFailure()) return result; |
1752 } | 1751 } |
1753 return array; | 1752 return array; |
1754 } | 1753 } |
1755 | 1754 |
1756 | 1755 |
1757 } } // namespace v8::internal | 1756 } } // namespace v8::internal |
OLD | NEW |