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 | 5 |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_MIPS | 9 #if V8_TARGET_ARCH_MIPS |
10 | 10 |
(...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 Generate_CheckStackOverflow(masm, kFunctionOffset, v0, kArgcIsSmiTagged); | 1492 Generate_CheckStackOverflow(masm, kFunctionOffset, v0, kArgcIsSmiTagged); |
1493 | 1493 |
1494 // Push current limit and index. | 1494 // Push current limit and index. |
1495 const int kIndexOffset = | 1495 const int kIndexOffset = |
1496 StandardFrameConstants::kExpressionsOffset - (2 * kPointerSize); | 1496 StandardFrameConstants::kExpressionsOffset - (2 * kPointerSize); |
1497 const int kLimitOffset = | 1497 const int kLimitOffset = |
1498 StandardFrameConstants::kExpressionsOffset - (1 * kPointerSize); | 1498 StandardFrameConstants::kExpressionsOffset - (1 * kPointerSize); |
1499 __ push(v0); // limit | 1499 __ push(v0); // limit |
1500 __ mov(a1, zero_reg); // initial index | 1500 __ mov(a1, zero_reg); // initial index |
1501 __ push(a1); | 1501 __ push(a1); |
1502 // Push newTarget and callee functions | 1502 // Push the constructor function as callee. |
1503 __ lw(a0, MemOperand(fp, kNewTargetOffset)); | |
1504 __ push(a0); | |
1505 __ lw(a0, MemOperand(fp, kFunctionOffset)); | 1503 __ lw(a0, MemOperand(fp, kFunctionOffset)); |
1506 __ push(a0); | 1504 __ push(a0); |
1507 | 1505 |
1508 // Copy all arguments from the array to the stack. | 1506 // Copy all arguments from the array to the stack. |
1509 Generate_PushAppliedArguments( | 1507 Generate_PushAppliedArguments( |
1510 masm, kArgumentsOffset, kIndexOffset, kLimitOffset); | 1508 masm, kArgumentsOffset, kIndexOffset, kLimitOffset); |
1511 | 1509 |
1512 // Use undefined feedback vector | 1510 // Use undefined feedback vector |
1513 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); | 1511 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); |
1514 __ lw(a1, MemOperand(fp, kFunctionOffset)); | 1512 __ lw(a1, MemOperand(fp, kFunctionOffset)); |
| 1513 __ lw(t0, MemOperand(fp, kNewTargetOffset)); |
1515 | 1514 |
1516 // Call the function. | 1515 // Call the function. |
1517 CallConstructStub stub(masm->isolate(), SUPER_CONSTRUCTOR_CALL); | 1516 CallConstructStub stub(masm->isolate(), SUPER_CONSTRUCTOR_CALL); |
1518 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 1517 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
1519 | 1518 |
1520 __ Drop(1); | |
1521 | |
1522 // Leave internal frame. | 1519 // Leave internal frame. |
1523 } | 1520 } |
1524 __ jr(ra); | 1521 __ jr(ra); |
1525 __ Addu(sp, sp, Operand(kStackSize * kPointerSize)); // In delay slot. | 1522 __ Addu(sp, sp, Operand(kStackSize * kPointerSize)); // In delay slot. |
1526 } | 1523 } |
1527 | 1524 |
1528 | 1525 |
1529 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { | 1526 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { |
1530 Generate_ApplyHelper(masm, false); | 1527 Generate_ApplyHelper(masm, false); |
1531 } | 1528 } |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1737 } | 1734 } |
1738 } | 1735 } |
1739 | 1736 |
1740 | 1737 |
1741 #undef __ | 1738 #undef __ |
1742 | 1739 |
1743 } // namespace internal | 1740 } // namespace internal |
1744 } // namespace v8 | 1741 } // namespace v8 |
1745 | 1742 |
1746 #endif // V8_TARGET_ARCH_MIPS | 1743 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |