Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1159)

Side by Side Diff: src/mips/builtins-mips.cc

Issue 1022053002: MIPS: Fix 'MIPS: [es6] implement Reflect.apply() & Reflect.construct()' (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1425 __ push(a0); 1425 __ push(a0);
1426 __ lw(a0, MemOperand(fp, kArgumentsOffset)); // Get the args array. 1426 __ lw(a0, MemOperand(fp, kArgumentsOffset)); // Get the args array.
1427 __ push(a0); 1427 __ push(a0);
1428 // Returns (in v0) number of arguments to copy to stack as Smi. 1428 // Returns (in v0) number of arguments to copy to stack as Smi.
1429 if (targetIsArgument) { 1429 if (targetIsArgument) {
1430 __ InvokeBuiltin(Builtins::REFLECT_APPLY_PREPARE, CALL_FUNCTION); 1430 __ InvokeBuiltin(Builtins::REFLECT_APPLY_PREPARE, CALL_FUNCTION);
1431 } else { 1431 } else {
1432 __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION); 1432 __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION);
1433 } 1433 }
1434 1434
1435 // Returns the result in v0.
1435 Generate_CheckStackOverflow(masm, kFunctionOffset); 1436 Generate_CheckStackOverflow(masm, kFunctionOffset);
1436 1437
1437 // Push current limit and index. 1438 // Push current limit and index.
1438 const int kIndexOffset = 1439 const int kIndexOffset =
1439 StandardFrameConstants::kExpressionsOffset - (2 * kPointerSize); 1440 StandardFrameConstants::kExpressionsOffset - (2 * kPointerSize);
1440 const int kLimitOffset = 1441 const int kLimitOffset =
1441 StandardFrameConstants::kExpressionsOffset - (1 * kPointerSize); 1442 StandardFrameConstants::kExpressionsOffset - (1 * kPointerSize);
1442 __ mov(a1, zero_reg); 1443 __ mov(a1, zero_reg);
1443 __ Push(v0, a1); // Limit and initial index. 1444 __ Push(v0, a1); // Limit and initial index.
1444 1445
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1529 __ Ret(USE_DELAY_SLOT); 1530 __ Ret(USE_DELAY_SLOT);
1530 __ Addu(sp, sp, Operand(kStackSize * kPointerSize)); // In delay slot. 1531 __ Addu(sp, sp, Operand(kStackSize * kPointerSize)); // In delay slot.
1531 } 1532 }
1532 1533
1533 1534
1534 static void Generate_ConstructHelper(MacroAssembler* masm) { 1535 static void Generate_ConstructHelper(MacroAssembler* masm) {
1535 const int kFormalParameters = 3; 1536 const int kFormalParameters = 3;
1536 const int kStackSize = kFormalParameters + 1; 1537 const int kStackSize = kFormalParameters + 1;
1537 1538
1538 { 1539 {
1539 FrameAndConstantPoolScope frame_scope(masm, StackFrame::INTERNAL); 1540 FrameScope frame_scope(masm, StackFrame::INTERNAL);
1540 const int kNewTargetOffset = kFPOnStackSize + kPCOnStackSize; 1541 const int kNewTargetOffset = kFPOnStackSize + kPCOnStackSize;
1541 const int kArgumentsOffset = kNewTargetOffset + kPointerSize; 1542 const int kArgumentsOffset = kNewTargetOffset + kPointerSize;
1542 const int kFunctionOffset = kArgumentsOffset + kPointerSize; 1543 const int kFunctionOffset = kArgumentsOffset + kPointerSize;
1543 1544
1544 // If newTarget is not supplied, set it to constructor 1545 // If newTarget is not supplied, set it to constructor
1545 Label validate_arguments; 1546 Label validate_arguments;
1546 __ lw(a0, MemOperand(fp, kNewTargetOffset)); 1547 __ lw(a0, MemOperand(fp, kNewTargetOffset));
1547 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); 1548 __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
1548 __ Branch(&validate_arguments, ne, a0, Operand(at)); 1549 __ Branch(&validate_arguments, ne, a0, Operand(at));
1549 __ lw(a0, MemOperand(fp, kFunctionOffset)); 1550 __ lw(a0, MemOperand(fp, kFunctionOffset));
1550 __ sw(a0, MemOperand(fp, kNewTargetOffset)); 1551 __ sw(a0, MemOperand(fp, kNewTargetOffset));
1551 1552
1552 // Validate arguments 1553 // Validate arguments
1553 __ bind(&validate_arguments); 1554 __ bind(&validate_arguments);
1554 __ lw(a0, MemOperand(fp, kFunctionOffset)); // get the function 1555 __ lw(a0, MemOperand(fp, kFunctionOffset)); // get the function
1555 __ push(a0); 1556 __ push(a0);
1556 __ lw(a0, MemOperand(fp, kArgumentsOffset)); // get the args array 1557 __ lw(a0, MemOperand(fp, kArgumentsOffset)); // get the args array
1557 __ push(a0); 1558 __ push(a0);
1558 __ lw(a0, MemOperand(fp, kNewTargetOffset)); // get the new.target 1559 __ lw(a0, MemOperand(fp, kNewTargetOffset)); // get the new.target
1559 __ push(a0); 1560 __ push(a0);
1561 // Returns argument count in v0.
1560 __ InvokeBuiltin(Builtins::REFLECT_CONSTRUCT_PREPARE, CALL_FUNCTION); 1562 __ InvokeBuiltin(Builtins::REFLECT_CONSTRUCT_PREPARE, CALL_FUNCTION);
1561 1563
1564 // Returns result in v0.
1562 Generate_CheckStackOverflow(masm, kFunctionOffset); 1565 Generate_CheckStackOverflow(masm, kFunctionOffset);
1563 1566
1564 // Push current limit and index. 1567 // Push current limit and index.
1565 const int kIndexOffset = 1568 const int kIndexOffset =
1566 StandardFrameConstants::kExpressionsOffset - (2 * kPointerSize); 1569 StandardFrameConstants::kExpressionsOffset - (2 * kPointerSize);
1567 const int kLimitOffset = 1570 const int kLimitOffset =
1568 StandardFrameConstants::kExpressionsOffset - (1 * kPointerSize); 1571 StandardFrameConstants::kExpressionsOffset - (1 * kPointerSize);
1569 __ push(v0); // limit 1572 __ push(v0); // limit
1570 __ mov(a1, zero_reg); // initial index 1573 __ mov(a1, zero_reg); // initial index
1571 __ push(a1); 1574 __ push(a1);
(...skipping 12 matching lines...) Expand all
1584 __ lw(a1, MemOperand(fp, kFunctionOffset)); 1587 __ lw(a1, MemOperand(fp, kFunctionOffset));
1585 1588
1586 // Call the function. 1589 // Call the function.
1587 CallConstructStub stub(masm->isolate(), SUPER_CONSTRUCTOR_CALL); 1590 CallConstructStub stub(masm->isolate(), SUPER_CONSTRUCTOR_CALL);
1588 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); 1591 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL);
1589 1592
1590 __ Drop(1); 1593 __ Drop(1);
1591 1594
1592 // Leave internal frame. 1595 // Leave internal frame.
1593 } 1596 }
1594 __ Addu(sp, sp, Operand(kStackSize * kPointerSize)); 1597 __ jr(ra);
1595 __ Jump(ra); 1598 __ Addu(sp, sp, Operand(kStackSize * kPointerSize)); // In delay slot.
1596 } 1599 }
1597 1600
1598 1601
1599 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { 1602 void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
1600 Generate_ApplyHelper(masm, false); 1603 Generate_ApplyHelper(masm, false);
1601 } 1604 }
1602 1605
1603 1606
1604 void Builtins::Generate_ReflectApply(MacroAssembler* masm) { 1607 void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
1605 Generate_ApplyHelper(masm, true); 1608 Generate_ApplyHelper(masm, true);
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1785 __ break_(0xCC); 1788 __ break_(0xCC);
1786 } 1789 }
1787 } 1790 }
1788 1791
1789 1792
1790 #undef __ 1793 #undef __
1791 1794
1792 } } // namespace v8::internal 1795 } } // namespace v8::internal
1793 1796
1794 #endif // V8_TARGET_ARCH_MIPS 1797 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698