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 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 } | 1065 } |
1066 if (result_size() > 2) { | 1066 if (result_size() > 2) { |
1067 DCHECK_EQ(3, result_size()); | 1067 DCHECK_EQ(3, result_size()); |
1068 // Read result values stored on stack. | 1068 // Read result values stored on stack. |
1069 __ ldr(r2, MemOperand(r0, 2 * kPointerSize)); | 1069 __ ldr(r2, MemOperand(r0, 2 * kPointerSize)); |
1070 __ ldr(r1, MemOperand(r0, 1 * kPointerSize)); | 1070 __ ldr(r1, MemOperand(r0, 1 * kPointerSize)); |
1071 __ ldr(r0, MemOperand(r0, 0 * kPointerSize)); | 1071 __ ldr(r0, MemOperand(r0, 0 * kPointerSize)); |
1072 } | 1072 } |
1073 // Result returned in r0, r1:r0 or r2:r1:r0 - do not destroy these registers! | 1073 // Result returned in r0, r1:r0 or r2:r1:r0 - do not destroy these registers! |
1074 | 1074 |
1075 __ VFPEnsureFPSCRState(r3); | |
1076 | |
1077 // Check result for exception sentinel. | 1075 // Check result for exception sentinel. |
1078 Label exception_returned; | 1076 Label exception_returned; |
1079 __ CompareRoot(r0, Heap::kExceptionRootIndex); | 1077 __ CompareRoot(r0, Heap::kExceptionRootIndex); |
1080 __ b(eq, &exception_returned); | 1078 __ b(eq, &exception_returned); |
1081 | 1079 |
1082 // Check that there is no pending exception, otherwise we | 1080 // Check that there is no pending exception, otherwise we |
1083 // should have returned the exception sentinel. | 1081 // should have returned the exception sentinel. |
1084 if (FLAG_debug_code) { | 1082 if (FLAG_debug_code) { |
1085 Label okay; | 1083 Label okay; |
1086 ExternalReference pending_exception_address( | 1084 ExternalReference pending_exception_address( |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1176 | 1174 |
1177 // Called from C, so do not pop argc and args on exit (preserve sp) | 1175 // Called from C, so do not pop argc and args on exit (preserve sp) |
1178 // No need to save register-passed args | 1176 // No need to save register-passed args |
1179 // Save callee-saved registers (incl. cp and fp), sp, and lr | 1177 // Save callee-saved registers (incl. cp and fp), sp, and lr |
1180 __ stm(db_w, sp, kCalleeSaved | lr.bit()); | 1178 __ stm(db_w, sp, kCalleeSaved | lr.bit()); |
1181 | 1179 |
1182 // Save callee-saved vfp registers. | 1180 // Save callee-saved vfp registers. |
1183 __ vstm(db_w, sp, kFirstCalleeSavedDoubleReg, kLastCalleeSavedDoubleReg); | 1181 __ vstm(db_w, sp, kFirstCalleeSavedDoubleReg, kLastCalleeSavedDoubleReg); |
1184 // Set up the reserved register for 0.0. | 1182 // Set up the reserved register for 0.0. |
1185 __ vmov(kDoubleRegZero, 0.0); | 1183 __ vmov(kDoubleRegZero, 0.0); |
1186 __ VFPEnsureFPSCRState(r4); | |
1187 | 1184 |
1188 // Get address of argv, see stm above. | 1185 // Get address of argv, see stm above. |
1189 // r0: code entry | 1186 // r0: code entry |
1190 // r1: function | 1187 // r1: function |
1191 // r2: receiver | 1188 // r2: receiver |
1192 // r3: argc | 1189 // r3: argc |
1193 | 1190 |
1194 // Set up argv in r4. | 1191 // Set up argv in r4. |
1195 int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize; | 1192 int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize; |
1196 offset_to_argv += kNumDoubleCalleeSaved * kDoubleSize; | 1193 offset_to_argv += kNumDoubleCalleeSaved * kDoubleSize; |
(...skipping 2034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3231 | 3228 |
3232 __ Jump(r2); | 3229 __ Jump(r2); |
3233 } | 3230 } |
3234 | 3231 |
3235 | 3232 |
3236 void DirectCEntryStub::Generate(MacroAssembler* masm) { | 3233 void DirectCEntryStub::Generate(MacroAssembler* masm) { |
3237 // Place the return address on the stack, making the call | 3234 // Place the return address on the stack, making the call |
3238 // GC safe. The RegExp backend also relies on this. | 3235 // GC safe. The RegExp backend also relies on this. |
3239 __ str(lr, MemOperand(sp, 0)); | 3236 __ str(lr, MemOperand(sp, 0)); |
3240 __ blx(ip); // Call the C++ function. | 3237 __ blx(ip); // Call the C++ function. |
3241 __ VFPEnsureFPSCRState(r2); | |
3242 __ ldr(pc, MemOperand(sp, 0)); | 3238 __ ldr(pc, MemOperand(sp, 0)); |
3243 } | 3239 } |
3244 | 3240 |
3245 | 3241 |
3246 void DirectCEntryStub::GenerateCall(MacroAssembler* masm, | 3242 void DirectCEntryStub::GenerateCall(MacroAssembler* masm, |
3247 Register target) { | 3243 Register target) { |
3248 intptr_t code = | 3244 intptr_t code = |
3249 reinterpret_cast<intptr_t>(GetCode().location()); | 3245 reinterpret_cast<intptr_t>(GetCode().location()); |
3250 __ Move(ip, target); | 3246 __ Move(ip, target); |
3251 __ mov(lr, Operand(code, RelocInfo::CODE_TARGET)); | 3247 __ mov(lr, Operand(code, RelocInfo::CODE_TARGET)); |
(...skipping 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5712 __ bind(&use_heap_number); | 5708 __ bind(&use_heap_number); |
5713 ReturnAllocatedHeapNumber(masm, d0, r1, r2, r3); | 5709 ReturnAllocatedHeapNumber(masm, d0, r1, r2, r3); |
5714 } | 5710 } |
5715 | 5711 |
5716 #undef __ | 5712 #undef __ |
5717 | 5713 |
5718 } // namespace internal | 5714 } // namespace internal |
5719 } // namespace v8 | 5715 } // namespace v8 |
5720 | 5716 |
5721 #endif // V8_TARGET_ARCH_ARM | 5717 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |