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 3661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3672 vadd(temp_double_reg, input_reg, temp_double_reg); | 3672 vadd(temp_double_reg, input_reg, temp_double_reg); |
3673 vcvt_u32_f64(temp_double_reg.low(), temp_double_reg); | 3673 vcvt_u32_f64(temp_double_reg.low(), temp_double_reg); |
3674 vmov(result_reg, temp_double_reg.low()); | 3674 vmov(result_reg, temp_double_reg.low()); |
3675 bind(&done); | 3675 bind(&done); |
3676 } | 3676 } |
3677 | 3677 |
3678 | 3678 |
3679 void MacroAssembler::LoadInstanceDescriptors(Register map, | 3679 void MacroAssembler::LoadInstanceDescriptors(Register map, |
3680 Register descriptors, | 3680 Register descriptors, |
3681 Register scratch) { | 3681 Register scratch) { |
3682 ldr(descriptors, | 3682 Register temp = descriptors; |
3683 FieldMemOperand(map, Map::kInstanceDescriptorsOrBackPointerOffset)); | 3683 ldr(temp, FieldMemOperand(map, Map::kTransitionsOrBackPointerOffset)); |
3684 | 3684 |
3685 Label ok, fail; | 3685 Label ok, fail; |
3686 CheckMap(descriptors, | 3686 CheckMap(temp, |
3687 scratch, | 3687 scratch, |
3688 isolate()->factory()->fixed_array_map(), | 3688 isolate()->factory()->fixed_array_map(), |
3689 &fail, | 3689 &fail, |
3690 DONT_DO_SMI_CHECK); | 3690 DONT_DO_SMI_CHECK); |
3691 ldr(descriptors, FieldMemOperand(temp, TransitionArray::kDescriptorsOffset)); | |
3691 jmp(&ok); | 3692 jmp(&ok); |
3692 bind(&fail); | 3693 bind(&fail); |
3693 mov(descriptors, Operand(FACTORY->empty_descriptor_array())); | 3694 mov(descriptors, Operand(FACTORY->empty_descriptor_array())); |
3694 bind(&ok); | 3695 bind(&ok); |
3695 } | 3696 } |
3696 | 3697 |
3697 | 3698 |
3698 void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) { | 3699 void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) { |
3699 Label next; | 3700 Label next; |
3700 // Preload a couple of values used in the loop. | 3701 // Preload a couple of values used in the loop. |
3701 Register empty_fixed_array_value = r6; | 3702 Register empty_fixed_array_value = r6; |
3702 LoadRoot(empty_fixed_array_value, Heap::kEmptyFixedArrayRootIndex); | 3703 LoadRoot(empty_fixed_array_value, Heap::kEmptyFixedArrayRootIndex); |
3703 Register empty_descriptor_array_value = r7; | 3704 Register empty_descriptor_array_value = r7; |
Michael Starzinger
2012/08/06 14:15:52
Drop the "empty_descriptor_array_value".
Toon Verwaest
2012/08/07 08:33:04
Done.
| |
3704 LoadRoot(empty_descriptor_array_value, | |
3705 Heap::kEmptyDescriptorArrayRootIndex); | |
3706 mov(r1, r0); | 3705 mov(r1, r0); |
3707 bind(&next); | 3706 bind(&next); |
3708 | 3707 |
3709 // Check that there are no elements. Register r1 contains the | 3708 // Check that there are no elements. Register r1 contains the |
3710 // current JS object we've reached through the prototype chain. | 3709 // current JS object we've reached through the prototype chain. |
3711 ldr(r2, FieldMemOperand(r1, JSObject::kElementsOffset)); | 3710 ldr(r2, FieldMemOperand(r1, JSObject::kElementsOffset)); |
3712 cmp(r2, empty_fixed_array_value); | 3711 cmp(r2, empty_fixed_array_value); |
3713 b(ne, call_runtime); | 3712 b(ne, call_runtime); |
3714 | 3713 |
3715 // Check that instance descriptors are not empty so that we can | 3714 // Check that instance descriptors are not empty so that we can |
3716 // check for an enum cache. Leave the map in r2 for the subsequent | 3715 // check for an enum cache. Leave the map in r2 for the subsequent |
3717 // prototype load. | 3716 // prototype load. |
3718 ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); | 3717 ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); |
3719 ldr(r3, FieldMemOperand(r2, Map::kInstanceDescriptorsOrBackPointerOffset)); | 3718 ldr(r3, FieldMemOperand(r2, Map::kTransitionsOrBackPointerOffset)); |
3720 | 3719 |
3721 CheckMap(r3, | 3720 CheckMap(r3, |
3722 r7, | 3721 r7, |
3723 isolate()->factory()->fixed_array_map(), | 3722 isolate()->factory()->fixed_array_map(), |
3724 call_runtime, | 3723 call_runtime, |
3725 DONT_DO_SMI_CHECK); | 3724 DONT_DO_SMI_CHECK); |
3726 | 3725 |
3726 LoadRoot(empty_descriptor_array_value, | |
Michael Starzinger
2012/08/06 14:15:52
Better use r7 directly here, so that it's clear th
Toon Verwaest
2012/08/07 08:33:04
Done.
| |
3727 Heap::kEmptyDescriptorArrayRootIndex); | |
3728 ldr(r3, FieldMemOperand(r3, TransitionArray::kDescriptorsOffset)); | |
3729 cmp(r3, empty_descriptor_array_value); | |
3730 b(eq, call_runtime); | |
3731 | |
3727 // Check that there is an enum cache in the non-empty instance | 3732 // Check that there is an enum cache in the non-empty instance |
3728 // descriptors (r3). This is the case if the next enumeration | 3733 // descriptors (r3). This is the case if the next enumeration |
3729 // index field does not contain a smi. | 3734 // index field does not contain a smi. |
3730 ldr(r3, FieldMemOperand(r3, DescriptorArray::kEnumCacheOffset)); | 3735 ldr(r3, FieldMemOperand(r3, DescriptorArray::kEnumCacheOffset)); |
3731 JumpIfSmi(r3, call_runtime); | 3736 JumpIfSmi(r3, call_runtime); |
3732 | 3737 |
3733 // For all objects but the receiver, check that the cache is empty. | 3738 // For all objects but the receiver, check that the cache is empty. |
3734 Label check_prototype; | 3739 Label check_prototype; |
3735 cmp(r1, r0); | 3740 cmp(r1, r0); |
3736 b(eq, &check_prototype); | 3741 b(eq, &check_prototype); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3805 void CodePatcher::EmitCondition(Condition cond) { | 3810 void CodePatcher::EmitCondition(Condition cond) { |
3806 Instr instr = Assembler::instr_at(masm_.pc_); | 3811 Instr instr = Assembler::instr_at(masm_.pc_); |
3807 instr = (instr & ~kCondMask) | cond; | 3812 instr = (instr & ~kCondMask) | cond; |
3808 masm_.emit(instr); | 3813 masm_.emit(instr); |
3809 } | 3814 } |
3810 | 3815 |
3811 | 3816 |
3812 } } // namespace v8::internal | 3817 } } // namespace v8::internal |
3813 | 3818 |
3814 #endif // V8_TARGET_ARCH_ARM | 3819 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |