| 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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 FrameScope scope(masm, StackFrame::MANUAL); | 837 FrameScope scope(masm, StackFrame::MANUAL); |
| 838 __ stm(db_w, sp, r0.bit() | r1.bit() | fp.bit() | lr.bit()); | 838 __ stm(db_w, sp, r0.bit() | r1.bit() | fp.bit() | lr.bit()); |
| 839 __ PrepareCallCFunction(1, 0, r2); | 839 __ PrepareCallCFunction(1, 0, r2); |
| 840 __ mov(r1, Operand(ExternalReference::isolate_address(masm->isolate()))); | 840 __ mov(r1, Operand(ExternalReference::isolate_address(masm->isolate()))); |
| 841 __ CallCFunction(ExternalReference::get_mark_code_as_executed_function( | 841 __ CallCFunction(ExternalReference::get_mark_code_as_executed_function( |
| 842 masm->isolate()), 2); | 842 masm->isolate()), 2); |
| 843 __ ldm(ia_w, sp, r0.bit() | r1.bit() | fp.bit() | lr.bit()); | 843 __ ldm(ia_w, sp, r0.bit() | r1.bit() | fp.bit() | lr.bit()); |
| 844 | 844 |
| 845 // Perform prologue operations usually performed by the young code stub. | 845 // Perform prologue operations usually performed by the young code stub. |
| 846 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); | 846 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); |
| 847 __ add(fp, sp, Operand(2 * kPointerSize)); | 847 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
| 848 | 848 |
| 849 // Jump to point after the code-age stub. | 849 // Jump to point after the code-age stub. |
| 850 __ add(r0, r0, Operand(kNoCodeAgeSequenceLength * Assembler::kInstrSize)); | 850 __ add(r0, r0, Operand(kNoCodeAgeSequenceLength * Assembler::kInstrSize)); |
| 851 __ mov(pc, r0); | 851 __ mov(pc, r0); |
| 852 } | 852 } |
| 853 | 853 |
| 854 | 854 |
| 855 void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) { | 855 void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) { |
| 856 GenerateMakeCodeYoungAgainCommon(masm); | 856 GenerateMakeCodeYoungAgainCommon(masm); |
| 857 } | 857 } |
| 858 | 858 |
| 859 | 859 |
| 860 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { | 860 static void Generate_NotifyStubFailureHelper(MacroAssembler* masm, |
| 861 SaveFPRegsMode save_doubles) { |
| 861 { | 862 { |
| 862 FrameScope scope(masm, StackFrame::INTERNAL); | 863 FrameScope scope(masm, StackFrame::INTERNAL); |
| 863 | 864 |
| 864 // Preserve registers across notification, this is important for compiled | 865 // Preserve registers across notification, this is important for compiled |
| 865 // stubs that tail call the runtime on deopts passing their parameters in | 866 // stubs that tail call the runtime on deopts passing their parameters in |
| 866 // registers. | 867 // registers. |
| 867 __ stm(db_w, sp, kJSCallerSaved | kCalleeSaved); | 868 __ stm(db_w, sp, kJSCallerSaved | kCalleeSaved); |
| 868 // Pass the function and deoptimization type to the runtime system. | 869 // Pass the function and deoptimization type to the runtime system. |
| 869 __ CallRuntime(Runtime::kNotifyStubFailure, 0); | 870 __ CallRuntime(Runtime::kNotifyStubFailure, 0, save_doubles); |
| 870 __ ldm(ia_w, sp, kJSCallerSaved | kCalleeSaved); | 871 __ ldm(ia_w, sp, kJSCallerSaved | kCalleeSaved); |
| 871 } | 872 } |
| 872 | 873 |
| 873 __ add(sp, sp, Operand(kPointerSize)); // Ignore state | 874 __ add(sp, sp, Operand(kPointerSize)); // Ignore state |
| 874 __ mov(pc, lr); // Jump to miss handler | 875 __ mov(pc, lr); // Jump to miss handler |
| 875 } | 876 } |
| 876 | 877 |
| 877 | 878 |
| 879 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { |
| 880 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs); |
| 881 } |
| 882 |
| 883 |
| 884 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) { |
| 885 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs); |
| 886 } |
| 887 |
| 888 |
| 878 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, | 889 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, |
| 879 Deoptimizer::BailoutType type) { | 890 Deoptimizer::BailoutType type) { |
| 880 { | 891 { |
| 881 FrameScope scope(masm, StackFrame::INTERNAL); | 892 FrameScope scope(masm, StackFrame::INTERNAL); |
| 882 // Pass the function and deoptimization type to the runtime system. | 893 // Pass the function and deoptimization type to the runtime system. |
| 883 __ mov(r0, Operand(Smi::FromInt(static_cast<int>(type)))); | 894 __ mov(r0, Operand(Smi::FromInt(static_cast<int>(type)))); |
| 884 __ push(r0); | 895 __ push(r0); |
| 885 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); | 896 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); |
| 886 } | 897 } |
| 887 | 898 |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1170 RelocInfo::CODE_TARGET, | 1181 RelocInfo::CODE_TARGET, |
| 1171 ne); | 1182 ne); |
| 1172 | 1183 |
| 1173 ParameterCount expected(0); | 1184 ParameterCount expected(0); |
| 1174 __ InvokeCode(r3, expected, expected, JUMP_FUNCTION, | 1185 __ InvokeCode(r3, expected, expected, JUMP_FUNCTION, |
| 1175 NullCallWrapper(), CALL_AS_METHOD); | 1186 NullCallWrapper(), CALL_AS_METHOD); |
| 1176 } | 1187 } |
| 1177 | 1188 |
| 1178 | 1189 |
| 1179 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { | 1190 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { |
| 1180 const int kIndexOffset = -5 * kPointerSize; | 1191 const int kIndexOffset = |
| 1181 const int kLimitOffset = -4 * kPointerSize; | 1192 StandardFrameConstants::kExpressionsOffset - (2 * kPointerSize); |
| 1182 const int kArgsOffset = 2 * kPointerSize; | 1193 const int kLimitOffset = |
| 1183 const int kRecvOffset = 3 * kPointerSize; | 1194 StandardFrameConstants::kExpressionsOffset - (1 * kPointerSize); |
| 1184 const int kFunctionOffset = 4 * kPointerSize; | 1195 const int kArgsOffset = 2 * kPointerSize; |
| 1196 const int kRecvOffset = 3 * kPointerSize; |
| 1197 const int kFunctionOffset = 4 * kPointerSize; |
| 1185 | 1198 |
| 1186 { | 1199 { |
| 1187 FrameScope frame_scope(masm, StackFrame::INTERNAL); | 1200 FrameScope frame_scope(masm, StackFrame::INTERNAL); |
| 1188 | 1201 |
| 1189 __ ldr(r0, MemOperand(fp, kFunctionOffset)); // get the function | 1202 __ ldr(r0, MemOperand(fp, kFunctionOffset)); // get the function |
| 1190 __ push(r0); | 1203 __ push(r0); |
| 1191 __ ldr(r0, MemOperand(fp, kArgsOffset)); // get the args array | 1204 __ ldr(r0, MemOperand(fp, kArgsOffset)); // get the args array |
| 1192 __ push(r0); | 1205 __ push(r0); |
| 1193 __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION); | 1206 __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION); |
| 1194 | 1207 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1334 } | 1347 } |
| 1335 __ add(sp, sp, Operand(3 * kPointerSize)); | 1348 __ add(sp, sp, Operand(3 * kPointerSize)); |
| 1336 __ Jump(lr); | 1349 __ Jump(lr); |
| 1337 } | 1350 } |
| 1338 | 1351 |
| 1339 | 1352 |
| 1340 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { | 1353 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { |
| 1341 __ SmiTag(r0); | 1354 __ SmiTag(r0); |
| 1342 __ mov(r4, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 1355 __ mov(r4, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 1343 __ stm(db_w, sp, r0.bit() | r1.bit() | r4.bit() | fp.bit() | lr.bit()); | 1356 __ stm(db_w, sp, r0.bit() | r1.bit() | r4.bit() | fp.bit() | lr.bit()); |
| 1344 __ add(fp, sp, Operand(3 * kPointerSize)); | 1357 __ add(fp, sp, |
| 1358 Operand(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize)); |
| 1345 } | 1359 } |
| 1346 | 1360 |
| 1347 | 1361 |
| 1348 static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) { | 1362 static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) { |
| 1349 // ----------- S t a t e ------------- | 1363 // ----------- S t a t e ------------- |
| 1350 // -- r0 : result being passed through | 1364 // -- r0 : result being passed through |
| 1351 // ----------------------------------- | 1365 // ----------------------------------- |
| 1352 // Get the number of arguments passed (as a smi), tear down the frame and | 1366 // Get the number of arguments passed (as a smi), tear down the frame and |
| 1353 // then tear down the parameters. | 1367 // then tear down the parameters. |
| 1354 __ ldr(r1, MemOperand(fp, -3 * kPointerSize)); | 1368 __ ldr(r1, MemOperand(fp, -(StandardFrameConstants::kFixedFrameSizeFromFp + |
| 1369 kPointerSize))); |
| 1355 __ mov(sp, fp); | 1370 __ mov(sp, fp); |
| 1356 __ ldm(ia_w, sp, fp.bit() | lr.bit()); | 1371 __ ldm(ia_w, sp, fp.bit() | lr.bit()); |
| 1357 __ add(sp, sp, Operand::PointerOffsetFromSmiKey(r1)); | 1372 __ add(sp, sp, Operand::PointerOffsetFromSmiKey(r1)); |
| 1358 __ add(sp, sp, Operand(kPointerSize)); // adjust for receiver | 1373 __ add(sp, sp, Operand(kPointerSize)); // adjust for receiver |
| 1359 } | 1374 } |
| 1360 | 1375 |
| 1361 | 1376 |
| 1362 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 1377 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
| 1363 // ----------- S t a t e ------------- | 1378 // ----------- S t a t e ------------- |
| 1364 // -- r0 : actual number of arguments | 1379 // -- r0 : actual number of arguments |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1431 __ cmp(r0, fp); // Compare before moving to next argument. | 1446 __ cmp(r0, fp); // Compare before moving to next argument. |
| 1432 __ sub(r0, r0, Operand(kPointerSize)); | 1447 __ sub(r0, r0, Operand(kPointerSize)); |
| 1433 __ b(ne, ©); | 1448 __ b(ne, ©); |
| 1434 | 1449 |
| 1435 // Fill the remaining expected arguments with undefined. | 1450 // Fill the remaining expected arguments with undefined. |
| 1436 // r1: function | 1451 // r1: function |
| 1437 // r2: expected number of arguments | 1452 // r2: expected number of arguments |
| 1438 // r3: code entry to call | 1453 // r3: code entry to call |
| 1439 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 1454 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
| 1440 __ sub(r2, fp, Operand(r2, LSL, kPointerSizeLog2)); | 1455 __ sub(r2, fp, Operand(r2, LSL, kPointerSizeLog2)); |
| 1441 __ sub(r2, r2, Operand(4 * kPointerSize)); // Adjust for frame. | 1456 // Adjust for frame. |
| 1457 __ sub(r2, r2, Operand(StandardFrameConstants::kFixedFrameSizeFromFp + |
| 1458 2 * kPointerSize)); |
| 1442 | 1459 |
| 1443 Label fill; | 1460 Label fill; |
| 1444 __ bind(&fill); | 1461 __ bind(&fill); |
| 1445 __ push(ip); | 1462 __ push(ip); |
| 1446 __ cmp(sp, r2); | 1463 __ cmp(sp, r2); |
| 1447 __ b(ne, &fill); | 1464 __ b(ne, &fill); |
| 1448 } | 1465 } |
| 1449 | 1466 |
| 1450 // Call the entry point. | 1467 // Call the entry point. |
| 1451 __ bind(&invoke); | 1468 __ bind(&invoke); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1465 __ bind(&dont_adapt_arguments); | 1482 __ bind(&dont_adapt_arguments); |
| 1466 __ Jump(r3); | 1483 __ Jump(r3); |
| 1467 } | 1484 } |
| 1468 | 1485 |
| 1469 | 1486 |
| 1470 #undef __ | 1487 #undef __ |
| 1471 | 1488 |
| 1472 } } // namespace v8::internal | 1489 } } // namespace v8::internal |
| 1473 | 1490 |
| 1474 #endif // V8_TARGET_ARCH_ARM | 1491 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |