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 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 __ MultiPush(saved_regs); | 872 __ MultiPush(saved_regs); |
873 __ PrepareCallCFunction(1, 0, a2); | 873 __ PrepareCallCFunction(1, 0, a2); |
874 __ li(a1, Operand(ExternalReference::isolate_address(masm->isolate()))); | 874 __ li(a1, Operand(ExternalReference::isolate_address(masm->isolate()))); |
875 __ CallCFunction( | 875 __ CallCFunction( |
876 ExternalReference::get_mark_code_as_executed_function(masm->isolate()), | 876 ExternalReference::get_mark_code_as_executed_function(masm->isolate()), |
877 2); | 877 2); |
878 __ MultiPop(saved_regs); | 878 __ MultiPop(saved_regs); |
879 | 879 |
880 // Perform prologue operations usually performed by the young code stub. | 880 // Perform prologue operations usually performed by the young code stub. |
881 __ Push(ra, fp, cp, a1); | 881 __ Push(ra, fp, cp, a1); |
882 __ Addu(fp, sp, Operand(2 * kPointerSize)); | 882 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
883 | 883 |
884 // Jump to point after the code-age stub. | 884 // Jump to point after the code-age stub. |
885 __ Addu(a0, a0, Operand((kNoCodeAgeSequenceLength) * Assembler::kInstrSize)); | 885 __ Addu(a0, a0, Operand((kNoCodeAgeSequenceLength) * Assembler::kInstrSize)); |
886 __ Jump(a0); | 886 __ Jump(a0); |
887 } | 887 } |
888 | 888 |
889 | 889 |
890 void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) { | 890 void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) { |
891 GenerateMakeCodeYoungAgainCommon(masm); | 891 GenerateMakeCodeYoungAgainCommon(masm); |
892 } | 892 } |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 1201 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
1202 RelocInfo::CODE_TARGET, ne, a2, Operand(a0)); | 1202 RelocInfo::CODE_TARGET, ne, a2, Operand(a0)); |
1203 | 1203 |
1204 ParameterCount expected(0); | 1204 ParameterCount expected(0); |
1205 __ InvokeCode(a3, expected, expected, JUMP_FUNCTION, | 1205 __ InvokeCode(a3, expected, expected, JUMP_FUNCTION, |
1206 NullCallWrapper(), CALL_AS_METHOD); | 1206 NullCallWrapper(), CALL_AS_METHOD); |
1207 } | 1207 } |
1208 | 1208 |
1209 | 1209 |
1210 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { | 1210 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { |
1211 const int kIndexOffset = -5 * kPointerSize; | 1211 const int kIndexOffset = |
1212 const int kLimitOffset = -4 * kPointerSize; | 1212 StandardFrameConstants::kExpressionsOffset - (2 * kPointerSize); |
1213 const int kArgsOffset = 2 * kPointerSize; | 1213 const int kLimitOffset = |
1214 const int kRecvOffset = 3 * kPointerSize; | 1214 StandardFrameConstants::kExpressionsOffset - (1 * kPointerSize); |
1215 const int kFunctionOffset = 4 * kPointerSize; | 1215 const int kArgsOffset = 2 * kPointerSize; |
| 1216 const int kRecvOffset = 3 * kPointerSize; |
| 1217 const int kFunctionOffset = 4 * kPointerSize; |
1216 | 1218 |
1217 { | 1219 { |
1218 FrameScope frame_scope(masm, StackFrame::INTERNAL); | 1220 FrameScope frame_scope(masm, StackFrame::INTERNAL); |
1219 __ lw(a0, MemOperand(fp, kFunctionOffset)); // Get the function. | 1221 __ lw(a0, MemOperand(fp, kFunctionOffset)); // Get the function. |
1220 __ push(a0); | 1222 __ push(a0); |
1221 __ lw(a0, MemOperand(fp, kArgsOffset)); // Get the args array. | 1223 __ lw(a0, MemOperand(fp, kArgsOffset)); // Get the args array. |
1222 __ push(a0); | 1224 __ push(a0); |
1223 // Returns (in v0) number of arguments to copy to stack as Smi. | 1225 // Returns (in v0) number of arguments to copy to stack as Smi. |
1224 __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION); | 1226 __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION); |
1225 | 1227 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 | 1366 |
1365 __ Ret(USE_DELAY_SLOT); | 1367 __ Ret(USE_DELAY_SLOT); |
1366 __ Addu(sp, sp, Operand(3 * kPointerSize)); // In delay slot. | 1368 __ Addu(sp, sp, Operand(3 * kPointerSize)); // In delay slot. |
1367 } | 1369 } |
1368 | 1370 |
1369 | 1371 |
1370 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { | 1372 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { |
1371 __ sll(a0, a0, kSmiTagSize); | 1373 __ sll(a0, a0, kSmiTagSize); |
1372 __ li(t0, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 1374 __ li(t0, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
1373 __ MultiPush(a0.bit() | a1.bit() | t0.bit() | fp.bit() | ra.bit()); | 1375 __ MultiPush(a0.bit() | a1.bit() | t0.bit() | fp.bit() | ra.bit()); |
1374 __ Addu(fp, sp, Operand(3 * kPointerSize)); | 1376 __ Addu(fp, sp, |
| 1377 Operand(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize)); |
1375 } | 1378 } |
1376 | 1379 |
1377 | 1380 |
1378 static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) { | 1381 static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) { |
1379 // ----------- S t a t e ------------- | 1382 // ----------- S t a t e ------------- |
1380 // -- v0 : result being passed through | 1383 // -- v0 : result being passed through |
1381 // ----------------------------------- | 1384 // ----------------------------------- |
1382 // Get the number of arguments passed (as a smi), tear down the frame and | 1385 // Get the number of arguments passed (as a smi), tear down the frame and |
1383 // then tear down the parameters. | 1386 // then tear down the parameters. |
1384 __ lw(a1, MemOperand(fp, -3 * kPointerSize)); | 1387 __ lw(a1, MemOperand(fp, -(StandardFrameConstants::kFixedFrameSizeFromFp + |
| 1388 kPointerSize))); |
1385 __ mov(sp, fp); | 1389 __ mov(sp, fp); |
1386 __ MultiPop(fp.bit() | ra.bit()); | 1390 __ MultiPop(fp.bit() | ra.bit()); |
1387 __ sll(t0, a1, kPointerSizeLog2 - kSmiTagSize); | 1391 __ sll(t0, a1, kPointerSizeLog2 - kSmiTagSize); |
1388 __ Addu(sp, sp, t0); | 1392 __ Addu(sp, sp, t0); |
1389 // Adjust for the receiver. | 1393 // Adjust for the receiver. |
1390 __ Addu(sp, sp, Operand(kPointerSize)); | 1394 __ Addu(sp, sp, Operand(kPointerSize)); |
1391 } | 1395 } |
1392 | 1396 |
1393 | 1397 |
1394 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 1398 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1472 __ Branch(USE_DELAY_SLOT, ©, ne, a0, Operand(t3)); | 1476 __ Branch(USE_DELAY_SLOT, ©, ne, a0, Operand(t3)); |
1473 __ sw(t0, MemOperand(sp)); // In the delay slot. | 1477 __ sw(t0, MemOperand(sp)); // In the delay slot. |
1474 | 1478 |
1475 // Fill the remaining expected arguments with undefined. | 1479 // Fill the remaining expected arguments with undefined. |
1476 // a1: function | 1480 // a1: function |
1477 // a2: expected number of arguments | 1481 // a2: expected number of arguments |
1478 // a3: code entry to call | 1482 // a3: code entry to call |
1479 __ LoadRoot(t0, Heap::kUndefinedValueRootIndex); | 1483 __ LoadRoot(t0, Heap::kUndefinedValueRootIndex); |
1480 __ sll(t2, a2, kPointerSizeLog2); | 1484 __ sll(t2, a2, kPointerSizeLog2); |
1481 __ Subu(a2, fp, Operand(t2)); | 1485 __ Subu(a2, fp, Operand(t2)); |
1482 __ Addu(a2, a2, Operand(-4 * kPointerSize)); // Adjust for frame. | 1486 // Adjust for frame. |
| 1487 __ Subu(a2, a2, Operand(StandardFrameConstants::kFixedFrameSizeFromFp + |
| 1488 2 * kPointerSize)); |
1483 | 1489 |
1484 Label fill; | 1490 Label fill; |
1485 __ bind(&fill); | 1491 __ bind(&fill); |
1486 __ Subu(sp, sp, kPointerSize); | 1492 __ Subu(sp, sp, kPointerSize); |
1487 __ Branch(USE_DELAY_SLOT, &fill, ne, sp, Operand(a2)); | 1493 __ Branch(USE_DELAY_SLOT, &fill, ne, sp, Operand(a2)); |
1488 __ sw(t0, MemOperand(sp)); | 1494 __ sw(t0, MemOperand(sp)); |
1489 } | 1495 } |
1490 | 1496 |
1491 // Call the entry point. | 1497 // Call the entry point. |
1492 __ bind(&invoke); | 1498 __ bind(&invoke); |
(...skipping 14 matching lines...) Expand all Loading... |
1507 __ bind(&dont_adapt_arguments); | 1513 __ bind(&dont_adapt_arguments); |
1508 __ Jump(a3); | 1514 __ Jump(a3); |
1509 } | 1515 } |
1510 | 1516 |
1511 | 1517 |
1512 #undef __ | 1518 #undef __ |
1513 | 1519 |
1514 } } // namespace v8::internal | 1520 } } // namespace v8::internal |
1515 | 1521 |
1516 #endif // V8_TARGET_ARCH_MIPS | 1522 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |