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 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1890 } | 1890 } |
1891 | 1891 |
1892 | 1892 |
1893 void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { | 1893 void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { |
1894 ASSERT(Max(left_type_, right_type_) == BinaryOpIC::INT32); | 1894 ASSERT(Max(left_type_, right_type_) == BinaryOpIC::INT32); |
1895 | 1895 |
1896 Register left = r1; | 1896 Register left = r1; |
1897 Register right = r0; | 1897 Register right = r0; |
1898 Register scratch1 = r7; | 1898 Register scratch1 = r7; |
1899 Register scratch2 = r9; | 1899 Register scratch2 = r9; |
1900 DwVfpRegister double_scratch = d0; | 1900 LowDwVfpRegister double_scratch = d0; |
1901 | 1901 |
1902 Register heap_number_result = no_reg; | 1902 Register heap_number_result = no_reg; |
1903 Register heap_number_map = r6; | 1903 Register heap_number_map = r6; |
1904 __ LoadRoot(heap_number_map, Heap::kHeapNumberMapRootIndex); | 1904 __ LoadRoot(heap_number_map, Heap::kHeapNumberMapRootIndex); |
1905 | 1905 |
1906 Label call_runtime; | 1906 Label call_runtime; |
1907 // Labels for type transition, used for wrong input or output types. | 1907 // Labels for type transition, used for wrong input or output types. |
1908 // Both label are currently actually bound to the same position. We use two | 1908 // Both label are currently actually bound to the same position. We use two |
1909 // different label to differentiate the cause leading to type transition. | 1909 // different label to differentiate the cause leading to type transition. |
1910 Label transition; | 1910 Label transition; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1965 // not fit in a 32-bit integer. | 1965 // not fit in a 32-bit integer. |
1966 __ b(ne, &transition); | 1966 __ b(ne, &transition); |
1967 // Try to tag the result as a Smi, return heap number on overflow. | 1967 // Try to tag the result as a Smi, return heap number on overflow. |
1968 __ SmiTag(scratch1, SetCC); | 1968 __ SmiTag(scratch1, SetCC); |
1969 __ b(vs, &return_heap_number); | 1969 __ b(vs, &return_heap_number); |
1970 // Check for minus zero, transition in that case (because we need | 1970 // Check for minus zero, transition in that case (because we need |
1971 // to return a heap number). | 1971 // to return a heap number). |
1972 Label not_zero; | 1972 Label not_zero; |
1973 ASSERT(kSmiTag == 0); | 1973 ASSERT(kSmiTag == 0); |
1974 __ b(ne, ¬_zero); | 1974 __ b(ne, ¬_zero); |
1975 __ vmov(scratch2, d5.high()); | 1975 __ VmovHigh(scratch2, d5); |
1976 __ tst(scratch2, Operand(HeapNumber::kSignMask)); | 1976 __ tst(scratch2, Operand(HeapNumber::kSignMask)); |
1977 __ b(ne, &transition); | 1977 __ b(ne, &transition); |
1978 __ bind(¬_zero); | 1978 __ bind(¬_zero); |
1979 __ mov(r0, scratch1); | 1979 __ mov(r0, scratch1); |
1980 __ Ret(); | 1980 __ Ret(); |
1981 } | 1981 } |
1982 | 1982 |
1983 __ bind(&return_heap_number); | 1983 __ bind(&return_heap_number); |
1984 // Return a heap number, or fall through to type transition or runtime | 1984 // Return a heap number, or fall through to type transition or runtime |
1985 // call if we can't. | 1985 // call if we can't. |
(...skipping 1824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3810 __ Allocate(r1, r0, r2, r3, &runtime, | 3810 __ Allocate(r1, r0, r2, r3, &runtime, |
3811 static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS)); | 3811 static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS)); |
3812 | 3812 |
3813 // Get the arguments boilerplate from the current native context. | 3813 // Get the arguments boilerplate from the current native context. |
3814 __ ldr(r4, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 3814 __ ldr(r4, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
3815 __ ldr(r4, FieldMemOperand(r4, GlobalObject::kNativeContextOffset)); | 3815 __ ldr(r4, FieldMemOperand(r4, GlobalObject::kNativeContextOffset)); |
3816 __ ldr(r4, MemOperand(r4, Context::SlotOffset( | 3816 __ ldr(r4, MemOperand(r4, Context::SlotOffset( |
3817 Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX))); | 3817 Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX))); |
3818 | 3818 |
3819 // Copy the JS object part. | 3819 // Copy the JS object part. |
3820 __ CopyFields(r0, r4, d0, s0, JSObject::kHeaderSize / kPointerSize); | 3820 __ CopyFields(r0, r4, d0, JSObject::kHeaderSize / kPointerSize); |
3821 | 3821 |
3822 // Get the length (smi tagged) and set that as an in-object property too. | 3822 // Get the length (smi tagged) and set that as an in-object property too. |
3823 STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0); | 3823 STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0); |
3824 __ ldr(r1, MemOperand(sp, 0 * kPointerSize)); | 3824 __ ldr(r1, MemOperand(sp, 0 * kPointerSize)); |
3825 __ str(r1, FieldMemOperand(r0, JSObject::kHeaderSize + | 3825 __ str(r1, FieldMemOperand(r0, JSObject::kHeaderSize + |
3826 Heap::kArgumentsLengthIndex * kPointerSize)); | 3826 Heap::kArgumentsLengthIndex * kPointerSize)); |
3827 | 3827 |
3828 // If there are no actual arguments, we're done. | 3828 // If there are no actual arguments, we're done. |
3829 Label done; | 3829 Label done; |
3830 __ cmp(r1, Operand::Zero()); | 3830 __ cmp(r1, Operand::Zero()); |
(...skipping 2966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6797 // and value is Smi. | 6797 // and value is Smi. |
6798 __ bind(&smi_element); | 6798 __ bind(&smi_element); |
6799 __ ldr(r5, FieldMemOperand(r1, JSObject::kElementsOffset)); | 6799 __ ldr(r5, FieldMemOperand(r1, JSObject::kElementsOffset)); |
6800 __ add(r6, r5, Operand::PointerOffsetFromSmiKey(r3)); | 6800 __ add(r6, r5, Operand::PointerOffsetFromSmiKey(r3)); |
6801 __ str(r0, FieldMemOperand(r6, FixedArray::kHeaderSize)); | 6801 __ str(r0, FieldMemOperand(r6, FixedArray::kHeaderSize)); |
6802 __ Ret(); | 6802 __ Ret(); |
6803 | 6803 |
6804 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. | 6804 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. |
6805 __ bind(&double_elements); | 6805 __ bind(&double_elements); |
6806 __ ldr(r5, FieldMemOperand(r1, JSObject::kElementsOffset)); | 6806 __ ldr(r5, FieldMemOperand(r1, JSObject::kElementsOffset)); |
6807 __ StoreNumberToDoubleElements(r0, r3, r5, r6, &slow_elements); | 6807 __ StoreNumberToDoubleElements(r0, r3, r5, r6, d0, &slow_elements); |
6808 __ Ret(); | 6808 __ Ret(); |
6809 } | 6809 } |
6810 | 6810 |
6811 | 6811 |
6812 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { | 6812 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { |
6813 CEntryStub ces(1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs); | 6813 CEntryStub ces(1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs); |
6814 __ Call(ces.GetCode(masm->isolate()), RelocInfo::CODE_TARGET); | 6814 __ Call(ces.GetCode(masm->isolate()), RelocInfo::CODE_TARGET); |
6815 int parameter_count_offset = | 6815 int parameter_count_offset = |
6816 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; | 6816 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; |
6817 __ ldr(r1, MemOperand(fp, parameter_count_offset)); | 6817 __ ldr(r1, MemOperand(fp, parameter_count_offset)); |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7175 __ bind(&fast_elements_case); | 7175 __ bind(&fast_elements_case); |
7176 GenerateCase(masm, FAST_ELEMENTS); | 7176 GenerateCase(masm, FAST_ELEMENTS); |
7177 } | 7177 } |
7178 | 7178 |
7179 | 7179 |
7180 #undef __ | 7180 #undef __ |
7181 | 7181 |
7182 } } // namespace v8::internal | 7182 } } // namespace v8::internal |
7183 | 7183 |
7184 #endif // V8_TARGET_ARCH_ARM | 7184 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |