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 } |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1170 RelocInfo::CODE_TARGET, | 1170 RelocInfo::CODE_TARGET, |
1171 ne); | 1171 ne); |
1172 | 1172 |
1173 ParameterCount expected(0); | 1173 ParameterCount expected(0); |
1174 __ InvokeCode(r3, expected, expected, JUMP_FUNCTION, | 1174 __ InvokeCode(r3, expected, expected, JUMP_FUNCTION, |
1175 NullCallWrapper(), CALL_AS_METHOD); | 1175 NullCallWrapper(), CALL_AS_METHOD); |
1176 } | 1176 } |
1177 | 1177 |
1178 | 1178 |
1179 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { | 1179 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { |
1180 const int kIndexOffset = -5 * kPointerSize; | 1180 const int kIndexOffset = |
1181 const int kLimitOffset = -4 * kPointerSize; | 1181 StandardFrameConstants::kExpressionsOffset - (2 * kPointerSize); |
1182 const int kArgsOffset = 2 * kPointerSize; | 1182 const int kLimitOffset = |
1183 const int kRecvOffset = 3 * kPointerSize; | 1183 StandardFrameConstants::kExpressionsOffset - (1 * kPointerSize); |
1184 const int kFunctionOffset = 4 * kPointerSize; | 1184 const int kArgsOffset = 2 * kPointerSize; |
1185 const int kRecvOffset = 3 * kPointerSize; | |
1186 const int kFunctionOffset = 4 * kPointerSize; | |
1185 | 1187 |
1186 { | 1188 { |
1187 FrameScope frame_scope(masm, StackFrame::INTERNAL); | 1189 FrameScope frame_scope(masm, StackFrame::INTERNAL); |
1188 | 1190 |
1189 __ ldr(r0, MemOperand(fp, kFunctionOffset)); // get the function | 1191 __ ldr(r0, MemOperand(fp, kFunctionOffset)); // get the function |
1190 __ push(r0); | 1192 __ push(r0); |
1191 __ ldr(r0, MemOperand(fp, kArgsOffset)); // get the args array | 1193 __ ldr(r0, MemOperand(fp, kArgsOffset)); // get the args array |
1192 __ push(r0); | 1194 __ push(r0); |
1193 __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION); | 1195 __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION); |
1194 | 1196 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1334 } | 1336 } |
1335 __ add(sp, sp, Operand(3 * kPointerSize)); | 1337 __ add(sp, sp, Operand(3 * kPointerSize)); |
1336 __ Jump(lr); | 1338 __ Jump(lr); |
1337 } | 1339 } |
1338 | 1340 |
1339 | 1341 |
1340 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { | 1342 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { |
1341 __ SmiTag(r0); | 1343 __ SmiTag(r0); |
1342 __ mov(r4, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 1344 __ mov(r4, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
1343 __ stm(db_w, sp, r0.bit() | r1.bit() | r4.bit() | fp.bit() | lr.bit()); | 1345 __ stm(db_w, sp, r0.bit() | r1.bit() | r4.bit() | fp.bit() | lr.bit()); |
1344 __ add(fp, sp, Operand(3 * kPointerSize)); | 1346 __ add(fp, sp, Operand(3 * kPointerSize)); |
ulan
2013/11/20 09:31:37
Did you mean to remove this line?
rmcilroy
2013/11/20 11:17:06
Yes, good catch! Merge error issue. Done.
| |
1347 __ add(fp, sp, | |
1348 Operand(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize)); | |
1345 } | 1349 } |
1346 | 1350 |
1347 | 1351 |
1348 static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) { | 1352 static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) { |
1349 // ----------- S t a t e ------------- | 1353 // ----------- S t a t e ------------- |
1350 // -- r0 : result being passed through | 1354 // -- r0 : result being passed through |
1351 // ----------------------------------- | 1355 // ----------------------------------- |
1352 // Get the number of arguments passed (as a smi), tear down the frame and | 1356 // Get the number of arguments passed (as a smi), tear down the frame and |
1353 // then tear down the parameters. | 1357 // then tear down the parameters. |
1354 __ ldr(r1, MemOperand(fp, -3 * kPointerSize)); | 1358 __ ldr(r1, MemOperand(fp, -(StandardFrameConstants::kFixedFrameSizeFromFp + |
1359 kPointerSize))); | |
1355 __ mov(sp, fp); | 1360 __ mov(sp, fp); |
1356 __ ldm(ia_w, sp, fp.bit() | lr.bit()); | 1361 __ ldm(ia_w, sp, fp.bit() | lr.bit()); |
1357 __ add(sp, sp, Operand::PointerOffsetFromSmiKey(r1)); | 1362 __ add(sp, sp, Operand::PointerOffsetFromSmiKey(r1)); |
1358 __ add(sp, sp, Operand(kPointerSize)); // adjust for receiver | 1363 __ add(sp, sp, Operand(kPointerSize)); // adjust for receiver |
1359 } | 1364 } |
1360 | 1365 |
1361 | 1366 |
1362 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 1367 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
1363 // ----------- S t a t e ------------- | 1368 // ----------- S t a t e ------------- |
1364 // -- r0 : actual number of arguments | 1369 // -- 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. | 1436 __ cmp(r0, fp); // Compare before moving to next argument. |
1432 __ sub(r0, r0, Operand(kPointerSize)); | 1437 __ sub(r0, r0, Operand(kPointerSize)); |
1433 __ b(ne, ©); | 1438 __ b(ne, ©); |
1434 | 1439 |
1435 // Fill the remaining expected arguments with undefined. | 1440 // Fill the remaining expected arguments with undefined. |
1436 // r1: function | 1441 // r1: function |
1437 // r2: expected number of arguments | 1442 // r2: expected number of arguments |
1438 // r3: code entry to call | 1443 // r3: code entry to call |
1439 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 1444 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
1440 __ sub(r2, fp, Operand(r2, LSL, kPointerSizeLog2)); | 1445 __ sub(r2, fp, Operand(r2, LSL, kPointerSizeLog2)); |
1441 __ sub(r2, r2, Operand(4 * kPointerSize)); // Adjust for frame. | 1446 // Adjust for frame. |
1447 __ sub(r2, r2, Operand(StandardFrameConstants::kFixedFrameSizeFromFp + | |
1448 2 * kPointerSize)); | |
1442 | 1449 |
1443 Label fill; | 1450 Label fill; |
1444 __ bind(&fill); | 1451 __ bind(&fill); |
1445 __ push(ip); | 1452 __ push(ip); |
1446 __ cmp(sp, r2); | 1453 __ cmp(sp, r2); |
1447 __ b(ne, &fill); | 1454 __ b(ne, &fill); |
1448 } | 1455 } |
1449 | 1456 |
1450 // Call the entry point. | 1457 // Call the entry point. |
1451 __ bind(&invoke); | 1458 __ bind(&invoke); |
(...skipping 13 matching lines...) Expand all Loading... | |
1465 __ bind(&dont_adapt_arguments); | 1472 __ bind(&dont_adapt_arguments); |
1466 __ Jump(r3); | 1473 __ Jump(r3); |
1467 } | 1474 } |
1468 | 1475 |
1469 | 1476 |
1470 #undef __ | 1477 #undef __ |
1471 | 1478 |
1472 } } // namespace v8::internal | 1479 } } // namespace v8::internal |
1473 | 1480 |
1474 #endif // V8_TARGET_ARCH_ARM | 1481 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |