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 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1806 __ add(r0, r0, Operand(Smi::FromInt(argc))); | 1806 __ add(r0, r0, Operand(Smi::FromInt(argc))); |
1807 | 1807 |
1808 // Get the elements' length. | 1808 // Get the elements' length. |
1809 __ ldr(r4, FieldMemOperand(elements, FixedArray::kLengthOffset)); | 1809 __ ldr(r4, FieldMemOperand(elements, FixedArray::kLengthOffset)); |
1810 | 1810 |
1811 // Check if we could survive without allocation. | 1811 // Check if we could survive without allocation. |
1812 __ cmp(r0, r4); | 1812 __ cmp(r0, r4); |
1813 __ b(gt, &call_builtin); | 1813 __ b(gt, &call_builtin); |
1814 | 1814 |
1815 __ ldr(r4, MemOperand(sp, (argc - 1) * kPointerSize)); | 1815 __ ldr(r4, MemOperand(sp, (argc - 1) * kPointerSize)); |
1816 __ StoreNumberToDoubleElements(r4, r0, elements, r5, | 1816 __ StoreNumberToDoubleElements(r4, r0, elements, r5, d0, |
1817 &call_builtin, argc * kDoubleSize); | 1817 &call_builtin, argc * kDoubleSize); |
1818 | 1818 |
1819 // Save new length. | 1819 // Save new length. |
1820 __ str(r0, FieldMemOperand(receiver, JSArray::kLengthOffset)); | 1820 __ str(r0, FieldMemOperand(receiver, JSArray::kLengthOffset)); |
1821 | 1821 |
1822 // Check for a smi. | 1822 // Check for a smi. |
1823 __ Drop(argc + 1); | 1823 __ Drop(argc + 1); |
1824 __ Ret(); | 1824 __ Ret(); |
1825 | 1825 |
1826 __ bind(&with_write_barrier); | 1826 __ bind(&with_write_barrier); |
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3187 // -- r1 : receiver | 3187 // -- r1 : receiver |
3188 // ----------------------------------- | 3188 // ----------------------------------- |
3189 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); | 3189 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); |
3190 } | 3190 } |
3191 | 3191 |
3192 | 3192 |
3193 static void GenerateSmiKeyCheck(MacroAssembler* masm, | 3193 static void GenerateSmiKeyCheck(MacroAssembler* masm, |
3194 Register key, | 3194 Register key, |
3195 Register scratch0, | 3195 Register scratch0, |
3196 DwVfpRegister double_scratch0, | 3196 DwVfpRegister double_scratch0, |
3197 DwVfpRegister double_scratch1, | 3197 LowDwVfpRegister double_scratch1, |
3198 Label* fail) { | 3198 Label* fail) { |
3199 Label key_ok; | 3199 Label key_ok; |
3200 // Check for smi or a smi inside a heap number. We convert the heap | 3200 // Check for smi or a smi inside a heap number. We convert the heap |
3201 // number and check if the conversion is exact and fits into the smi | 3201 // number and check if the conversion is exact and fits into the smi |
3202 // range. | 3202 // range. |
3203 __ JumpIfSmi(key, &key_ok); | 3203 __ JumpIfSmi(key, &key_ok); |
3204 __ CheckMap(key, | 3204 __ CheckMap(key, |
3205 scratch0, | 3205 scratch0, |
3206 Heap::kHeapNumberMapRootIndex, | 3206 Heap::kHeapNumberMapRootIndex, |
3207 fail, | 3207 fail, |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3596 // indexes. | 3596 // indexes. |
3597 __ cmp(key_reg, scratch1); | 3597 __ cmp(key_reg, scratch1); |
3598 if (IsGrowStoreMode(store_mode)) { | 3598 if (IsGrowStoreMode(store_mode)) { |
3599 __ b(hs, &grow); | 3599 __ b(hs, &grow); |
3600 } else { | 3600 } else { |
3601 __ b(hs, &miss_force_generic); | 3601 __ b(hs, &miss_force_generic); |
3602 } | 3602 } |
3603 | 3603 |
3604 __ bind(&finish_store); | 3604 __ bind(&finish_store); |
3605 __ StoreNumberToDoubleElements(value_reg, key_reg, elements_reg, | 3605 __ StoreNumberToDoubleElements(value_reg, key_reg, elements_reg, |
3606 scratch1, &transition_elements_kind); | 3606 scratch1, d0, &transition_elements_kind); |
3607 __ Ret(); | 3607 __ Ret(); |
3608 | 3608 |
3609 // Handle store cache miss, replacing the ic with the generic stub. | 3609 // Handle store cache miss, replacing the ic with the generic stub. |
3610 __ bind(&miss_force_generic); | 3610 __ bind(&miss_force_generic); |
3611 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_MissForceGeneric); | 3611 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_MissForceGeneric); |
3612 | 3612 |
3613 __ bind(&transition_elements_kind); | 3613 __ bind(&transition_elements_kind); |
3614 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Miss); | 3614 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Miss); |
3615 | 3615 |
3616 if (is_js_array && IsGrowStoreMode(store_mode)) { | 3616 if (is_js_array && IsGrowStoreMode(store_mode)) { |
(...skipping 27 matching lines...) Expand all Loading... |
3644 // Initialize the new FixedDoubleArray. | 3644 // Initialize the new FixedDoubleArray. |
3645 __ LoadRoot(scratch1, Heap::kFixedDoubleArrayMapRootIndex); | 3645 __ LoadRoot(scratch1, Heap::kFixedDoubleArrayMapRootIndex); |
3646 __ str(scratch1, FieldMemOperand(elements_reg, JSObject::kMapOffset)); | 3646 __ str(scratch1, FieldMemOperand(elements_reg, JSObject::kMapOffset)); |
3647 __ mov(scratch1, | 3647 __ mov(scratch1, |
3648 Operand(Smi::FromInt(JSArray::kPreallocatedArrayElements))); | 3648 Operand(Smi::FromInt(JSArray::kPreallocatedArrayElements))); |
3649 __ str(scratch1, | 3649 __ str(scratch1, |
3650 FieldMemOperand(elements_reg, FixedDoubleArray::kLengthOffset)); | 3650 FieldMemOperand(elements_reg, FixedDoubleArray::kLengthOffset)); |
3651 | 3651 |
3652 __ mov(scratch1, elements_reg); | 3652 __ mov(scratch1, elements_reg); |
3653 __ StoreNumberToDoubleElements(value_reg, key_reg, scratch1, | 3653 __ StoreNumberToDoubleElements(value_reg, key_reg, scratch1, |
3654 scratch2, &transition_elements_kind); | 3654 scratch2, d0, &transition_elements_kind); |
3655 | 3655 |
3656 __ mov(scratch1, Operand(kHoleNanLower32)); | 3656 __ mov(scratch1, Operand(kHoleNanLower32)); |
3657 __ mov(scratch2, Operand(kHoleNanUpper32)); | 3657 __ mov(scratch2, Operand(kHoleNanUpper32)); |
3658 for (int i = 1; i < JSArray::kPreallocatedArrayElements; i++) { | 3658 for (int i = 1; i < JSArray::kPreallocatedArrayElements; i++) { |
3659 int offset = FixedDoubleArray::OffsetOfElementAt(i); | 3659 int offset = FixedDoubleArray::OffsetOfElementAt(i); |
3660 __ str(scratch1, FieldMemOperand(elements_reg, offset)); | 3660 __ str(scratch1, FieldMemOperand(elements_reg, offset)); |
3661 __ str(scratch2, FieldMemOperand(elements_reg, offset + kPointerSize)); | 3661 __ str(scratch2, FieldMemOperand(elements_reg, offset + kPointerSize)); |
3662 } | 3662 } |
3663 | 3663 |
3664 // Install the new backing store in the JSArray. | 3664 // Install the new backing store in the JSArray. |
(...skipping 26 matching lines...) Expand all Loading... |
3691 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); | 3691 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); |
3692 } | 3692 } |
3693 } | 3693 } |
3694 | 3694 |
3695 | 3695 |
3696 #undef __ | 3696 #undef __ |
3697 | 3697 |
3698 } } // namespace v8::internal | 3698 } } // namespace v8::internal |
3699 | 3699 |
3700 #endif // V8_TARGET_ARCH_ARM | 3700 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |