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 <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_ARM | 9 #if V8_TARGET_ARCH_ARM |
10 | 10 |
(...skipping 3773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3784 | 3784 |
3785 | 3785 |
3786 void MacroAssembler::JumpIfDictionaryInPrototypeChain( | 3786 void MacroAssembler::JumpIfDictionaryInPrototypeChain( |
3787 Register object, | 3787 Register object, |
3788 Register scratch0, | 3788 Register scratch0, |
3789 Register scratch1, | 3789 Register scratch1, |
3790 Label* found) { | 3790 Label* found) { |
3791 DCHECK(!scratch1.is(scratch0)); | 3791 DCHECK(!scratch1.is(scratch0)); |
3792 Factory* factory = isolate()->factory(); | 3792 Factory* factory = isolate()->factory(); |
3793 Register current = scratch0; | 3793 Register current = scratch0; |
3794 Label loop_again; | 3794 Label loop_again, end; |
3795 | 3795 |
3796 // scratch contained elements pointer. | 3796 // scratch contained elements pointer. |
3797 mov(current, object); | 3797 mov(current, object); |
3798 ldr(current, FieldMemOperand(current, HeapObject::kMapOffset)); | |
3799 ldr(current, FieldMemOperand(current, Map::kPrototypeOffset)); | |
3800 cmp(current, Operand(factory->null_value())); | |
Jakob Kummerow
2015/07/13 15:00:58
why not CompareRoot()?
| |
3801 b(eq, &end); | |
3798 | 3802 |
3799 // Loop based on the map going up the prototype chain. | 3803 // Loop based on the map going up the prototype chain. |
3800 bind(&loop_again); | 3804 bind(&loop_again); |
3801 ldr(current, FieldMemOperand(current, HeapObject::kMapOffset)); | 3805 ldr(current, FieldMemOperand(current, HeapObject::kMapOffset)); |
3806 | |
3807 DCHECK(JS_PROXY_TYPE < JS_OBJECT_TYPE); | |
3808 DCHECK(JS_VALUE_TYPE < JS_OBJECT_TYPE); | |
3809 ldrb(scratch1, FieldMemOperand(current, Map::kInstanceTypeOffset)); | |
3810 cmp(r4, Operand(JS_OBJECT_TYPE)); | |
Jakob Kummerow
2015/07/13 15:00:58
s/r4/scratch1/
Why don't tests catch this?
| |
3811 b(lt, found); | |
3812 | |
3802 ldr(scratch1, FieldMemOperand(current, Map::kBitField2Offset)); | 3813 ldr(scratch1, FieldMemOperand(current, Map::kBitField2Offset)); |
3803 DecodeField<Map::ElementsKindBits>(scratch1); | 3814 DecodeField<Map::ElementsKindBits>(scratch1); |
3804 cmp(scratch1, Operand(DICTIONARY_ELEMENTS)); | 3815 cmp(scratch1, Operand(DICTIONARY_ELEMENTS)); |
3805 b(eq, found); | 3816 b(eq, found); |
3806 ldr(current, FieldMemOperand(current, Map::kPrototypeOffset)); | 3817 ldr(current, FieldMemOperand(current, Map::kPrototypeOffset)); |
3807 cmp(current, Operand(factory->null_value())); | 3818 cmp(current, Operand(factory->null_value())); |
3808 b(ne, &loop_again); | 3819 b(ne, &loop_again); |
3820 | |
3821 bind(&end); | |
3809 } | 3822 } |
3810 | 3823 |
3811 | 3824 |
3812 #ifdef DEBUG | 3825 #ifdef DEBUG |
3813 bool AreAliased(Register reg1, | 3826 bool AreAliased(Register reg1, |
3814 Register reg2, | 3827 Register reg2, |
3815 Register reg3, | 3828 Register reg3, |
3816 Register reg4, | 3829 Register reg4, |
3817 Register reg5, | 3830 Register reg5, |
3818 Register reg6, | 3831 Register reg6, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3900 } | 3913 } |
3901 } | 3914 } |
3902 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 3915 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
3903 add(result, result, Operand(dividend, LSR, 31)); | 3916 add(result, result, Operand(dividend, LSR, 31)); |
3904 } | 3917 } |
3905 | 3918 |
3906 } // namespace internal | 3919 } // namespace internal |
3907 } // namespace v8 | 3920 } // namespace v8 |
3908 | 3921 |
3909 #endif // V8_TARGET_ARCH_ARM | 3922 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |