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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 __ ldr(receiver_map, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 651 __ ldr(receiver_map, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
652 // Check that the receiver does not require access checks and is not observed. | 652 // Check that the receiver does not require access checks and is not observed. |
653 // The generic stub does not perform map checks or handle observed objects. | 653 // The generic stub does not perform map checks or handle observed objects. |
654 __ ldrb(ip, FieldMemOperand(receiver_map, Map::kBitFieldOffset)); | 654 __ ldrb(ip, FieldMemOperand(receiver_map, Map::kBitFieldOffset)); |
655 __ tst(ip, Operand(1 << Map::kIsAccessCheckNeeded | 1 << Map::kIsObserved)); | 655 __ tst(ip, Operand(1 << Map::kIsAccessCheckNeeded | 1 << Map::kIsObserved)); |
656 __ b(ne, &slow); | 656 __ b(ne, &slow); |
657 // Check if the object is a JS array or not. | 657 // Check if the object is a JS array or not. |
658 __ ldrb(r4, FieldMemOperand(receiver_map, Map::kInstanceTypeOffset)); | 658 __ ldrb(r4, FieldMemOperand(receiver_map, Map::kInstanceTypeOffset)); |
659 __ cmp(r4, Operand(JS_ARRAY_TYPE)); | 659 __ cmp(r4, Operand(JS_ARRAY_TYPE)); |
660 __ b(eq, &array); | 660 __ b(eq, &array); |
661 // Check that the object is some kind of JSObject. | 661 // Check that the object is some kind of JS object EXCEPT JS Value type. In |
662 __ cmp(r4, Operand(FIRST_JS_OBJECT_TYPE)); | 662 // the case that the object is a value-wrapper object, we enter the runtime |
663 __ b(lt, &slow); | 663 // system to make sure that indexing into string objects works as intended. |
| 664 STATIC_ASSERT(JS_VALUE_TYPE < JS_OBJECT_TYPE); |
| 665 __ cmp(r4, Operand(JS_OBJECT_TYPE)); |
| 666 __ b(lo, &slow); |
664 | 667 |
665 // Object case: Check key against length in the elements array. | 668 // Object case: Check key against length in the elements array. |
666 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 669 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
667 // Check array bounds. Both the key and the length of FixedArray are smis. | 670 // Check array bounds. Both the key and the length of FixedArray are smis. |
668 __ ldr(ip, FieldMemOperand(elements, FixedArray::kLengthOffset)); | 671 __ ldr(ip, FieldMemOperand(elements, FixedArray::kLengthOffset)); |
669 __ cmp(key, Operand(ip)); | 672 __ cmp(key, Operand(ip)); |
670 __ b(lo, &fast_object); | 673 __ b(lo, &fast_object); |
671 | 674 |
672 // Slow case, handle jump to runtime. | 675 // Slow case, handle jump to runtime. |
673 __ bind(&slow); | 676 __ bind(&slow); |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 patcher.EmitCondition(ne); | 896 patcher.EmitCondition(ne); |
894 } else { | 897 } else { |
895 DCHECK(Assembler::GetCondition(branch_instr) == ne); | 898 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
896 patcher.EmitCondition(eq); | 899 patcher.EmitCondition(eq); |
897 } | 900 } |
898 } | 901 } |
899 } // namespace internal | 902 } // namespace internal |
900 } // namespace v8 | 903 } // namespace v8 |
901 | 904 |
902 #endif // V8_TARGET_ARCH_ARM | 905 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |