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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1578 | 1578 |
1579 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, a4, | 1579 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, a4, |
1580 a5, &miss); | 1580 a5, &miss); |
1581 __ bind(&miss); | 1581 __ bind(&miss); |
1582 PropertyAccessCompiler::TailCallBuiltin( | 1582 PropertyAccessCompiler::TailCallBuiltin( |
1583 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); | 1583 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); |
1584 } | 1584 } |
1585 | 1585 |
1586 | 1586 |
1587 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { | 1587 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { |
| 1588 CHECK(!has_new_target()); |
1588 // The displacement is the offset of the last parameter (if any) | 1589 // The displacement is the offset of the last parameter (if any) |
1589 // relative to the frame pointer. | 1590 // relative to the frame pointer. |
1590 const int kDisplacement = | 1591 const int kDisplacement = |
1591 StandardFrameConstants::kCallerSPOffset - kPointerSize; | 1592 StandardFrameConstants::kCallerSPOffset - kPointerSize; |
1592 DCHECK(a1.is(ArgumentsAccessReadDescriptor::index())); | 1593 DCHECK(a1.is(ArgumentsAccessReadDescriptor::index())); |
1593 DCHECK(a0.is(ArgumentsAccessReadDescriptor::parameter_count())); | 1594 DCHECK(a0.is(ArgumentsAccessReadDescriptor::parameter_count())); |
1594 | 1595 |
1595 // Check that the key is a smiGenerateReadElement. | 1596 // Check that the key is a smiGenerateReadElement. |
1596 Label slow; | 1597 Label slow; |
1597 __ JumpIfNotSmi(a1, &slow); | 1598 __ JumpIfNotSmi(a1, &slow); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1636 __ bind(&slow); | 1637 __ bind(&slow); |
1637 __ push(a1); | 1638 __ push(a1); |
1638 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); | 1639 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); |
1639 } | 1640 } |
1640 | 1641 |
1641 | 1642 |
1642 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { | 1643 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { |
1643 // sp[0] : number of parameters | 1644 // sp[0] : number of parameters |
1644 // sp[4] : receiver displacement | 1645 // sp[4] : receiver displacement |
1645 // sp[8] : function | 1646 // sp[8] : function |
| 1647 |
| 1648 CHECK(!has_new_target()); |
| 1649 |
1646 // Check if the calling frame is an arguments adaptor frame. | 1650 // Check if the calling frame is an arguments adaptor frame. |
1647 Label runtime; | 1651 Label runtime; |
1648 __ ld(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 1652 __ ld(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
1649 __ ld(a2, MemOperand(a3, StandardFrameConstants::kContextOffset)); | 1653 __ ld(a2, MemOperand(a3, StandardFrameConstants::kContextOffset)); |
1650 __ Branch(&runtime, | 1654 __ Branch(&runtime, |
1651 ne, | 1655 ne, |
1652 a2, | 1656 a2, |
1653 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 1657 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
1654 | 1658 |
1655 // Patch the arguments.length and the parameters pointer in the current frame. | 1659 // Patch the arguments.length and the parameters pointer in the current frame. |
(...skipping 11 matching lines...) Expand all Loading... |
1667 | 1671 |
1668 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { | 1672 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { |
1669 // Stack layout: | 1673 // Stack layout: |
1670 // sp[0] : number of parameters (tagged) | 1674 // sp[0] : number of parameters (tagged) |
1671 // sp[4] : address of receiver argument | 1675 // sp[4] : address of receiver argument |
1672 // sp[8] : function | 1676 // sp[8] : function |
1673 // Registers used over whole function: | 1677 // Registers used over whole function: |
1674 // a6 : allocated object (tagged) | 1678 // a6 : allocated object (tagged) |
1675 // t1 : mapped parameter count (tagged) | 1679 // t1 : mapped parameter count (tagged) |
1676 | 1680 |
| 1681 CHECK(!has_new_target()); |
| 1682 |
1677 __ ld(a1, MemOperand(sp, 0 * kPointerSize)); | 1683 __ ld(a1, MemOperand(sp, 0 * kPointerSize)); |
1678 // a1 = parameter count (tagged) | 1684 // a1 = parameter count (tagged) |
1679 | 1685 |
1680 // Check if the calling frame is an arguments adaptor frame. | 1686 // Check if the calling frame is an arguments adaptor frame. |
1681 Label runtime; | 1687 Label runtime; |
1682 Label adaptor_frame, try_allocate; | 1688 Label adaptor_frame, try_allocate; |
1683 __ ld(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 1689 __ ld(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
1684 __ ld(a2, MemOperand(a3, StandardFrameConstants::kContextOffset)); | 1690 __ ld(a2, MemOperand(a3, StandardFrameConstants::kContextOffset)); |
1685 __ Branch(&adaptor_frame, | 1691 __ Branch(&adaptor_frame, |
1686 eq, | 1692 eq, |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1923 a3, | 1929 a3, |
1924 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 1930 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
1925 | 1931 |
1926 // Get the length from the frame. | 1932 // Get the length from the frame. |
1927 __ ld(a1, MemOperand(sp, 0)); | 1933 __ ld(a1, MemOperand(sp, 0)); |
1928 __ Branch(&try_allocate); | 1934 __ Branch(&try_allocate); |
1929 | 1935 |
1930 // Patch the arguments.length and the parameters pointer. | 1936 // Patch the arguments.length and the parameters pointer. |
1931 __ bind(&adaptor_frame); | 1937 __ bind(&adaptor_frame); |
1932 __ ld(a1, MemOperand(a2, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 1938 __ ld(a1, MemOperand(a2, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 1939 if (has_new_target()) { |
| 1940 // Subtract 1 from smi-tagged arguments count. |
| 1941 __ SmiUntag(a1); |
| 1942 __ Daddu(a1, a1, Operand(-1)); |
| 1943 __ SmiTag(a1); |
| 1944 } |
1933 __ sd(a1, MemOperand(sp, 0)); | 1945 __ sd(a1, MemOperand(sp, 0)); |
1934 __ SmiScale(at, a1, kPointerSizeLog2); | 1946 __ SmiScale(at, a1, kPointerSizeLog2); |
1935 | 1947 |
1936 __ Daddu(a3, a2, Operand(at)); | 1948 __ Daddu(a3, a2, Operand(at)); |
1937 | 1949 |
1938 __ Daddu(a3, a3, Operand(StandardFrameConstants::kCallerSPOffset)); | 1950 __ Daddu(a3, a3, Operand(StandardFrameConstants::kCallerSPOffset)); |
1939 __ sd(a3, MemOperand(sp, 1 * kPointerSize)); | 1951 __ sd(a3, MemOperand(sp, 1 * kPointerSize)); |
1940 | 1952 |
1941 // Try the new space allocation. Start out with computing the size | 1953 // Try the new space allocation. Start out with computing the size |
1942 // of the arguments object and the elements array in words. | 1954 // of the arguments object and the elements array in words. |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2733 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); | 2745 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); |
2734 __ Branch(&feedback_register_initialized, eq, a5, Operand(at)); | 2746 __ Branch(&feedback_register_initialized, eq, a5, Operand(at)); |
2735 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); | 2747 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); |
2736 __ bind(&feedback_register_initialized); | 2748 __ bind(&feedback_register_initialized); |
2737 } | 2749 } |
2738 | 2750 |
2739 __ AssertUndefinedOrAllocationSite(a2, a5); | 2751 __ AssertUndefinedOrAllocationSite(a2, a5); |
2740 } | 2752 } |
2741 | 2753 |
2742 // Pass function as original constructor. | 2754 // Pass function as original constructor. |
2743 __ mov(a3, a1); | 2755 if (IsSuperConstructorCall()) { |
| 2756 __ li(a4, Operand(1 * kPointerSize)); |
| 2757 __ dsll(at, a0, kPointerSizeLog2); |
| 2758 __ daddu(a4, a4, at); |
| 2759 __ daddu(at, sp, a4); |
| 2760 __ ld(a3, MemOperand(at, 0)); |
| 2761 } else { |
| 2762 __ mov(a3, a1); |
| 2763 } |
2744 | 2764 |
2745 // Jump to the function-specific construct stub. | 2765 // Jump to the function-specific construct stub. |
2746 Register jmp_reg = a4; | 2766 Register jmp_reg = a4; |
2747 __ ld(jmp_reg, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 2767 __ ld(jmp_reg, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
2748 __ ld(jmp_reg, FieldMemOperand(jmp_reg, | 2768 __ ld(jmp_reg, FieldMemOperand(jmp_reg, |
2749 SharedFunctionInfo::kConstructStubOffset)); | 2769 SharedFunctionInfo::kConstructStubOffset)); |
2750 __ Daddu(at, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); | 2770 __ Daddu(at, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); |
2751 __ Jump(at); | 2771 __ Jump(at); |
2752 | 2772 |
2753 // a0: number of arguments | 2773 // a0: number of arguments |
(...skipping 2455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5209 kStackUnwindSpace, kInvalidStackOffset, | 5229 kStackUnwindSpace, kInvalidStackOffset, |
5210 MemOperand(fp, 6 * kPointerSize), NULL); | 5230 MemOperand(fp, 6 * kPointerSize), NULL); |
5211 } | 5231 } |
5212 | 5232 |
5213 | 5233 |
5214 #undef __ | 5234 #undef __ |
5215 | 5235 |
5216 } } // namespace v8::internal | 5236 } } // namespace v8::internal |
5217 | 5237 |
5218 #endif // V8_TARGET_ARCH_MIPS64 | 5238 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |