| 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 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1616 | 1616 |
| 1617 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, a4, | 1617 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, a4, |
| 1618 a5, &miss); | 1618 a5, &miss); |
| 1619 __ bind(&miss); | 1619 __ bind(&miss); |
| 1620 PropertyAccessCompiler::TailCallBuiltin( | 1620 PropertyAccessCompiler::TailCallBuiltin( |
| 1621 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); | 1621 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); |
| 1622 } | 1622 } |
| 1623 | 1623 |
| 1624 | 1624 |
| 1625 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { | 1625 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { |
| 1626 CHECK(!has_new_target()); | |
| 1627 // The displacement is the offset of the last parameter (if any) | 1626 // The displacement is the offset of the last parameter (if any) |
| 1628 // relative to the frame pointer. | 1627 // relative to the frame pointer. |
| 1629 const int kDisplacement = | 1628 const int kDisplacement = |
| 1630 StandardFrameConstants::kCallerSPOffset - kPointerSize; | 1629 StandardFrameConstants::kCallerSPOffset - kPointerSize; |
| 1631 DCHECK(a1.is(ArgumentsAccessReadDescriptor::index())); | 1630 DCHECK(a1.is(ArgumentsAccessReadDescriptor::index())); |
| 1632 DCHECK(a0.is(ArgumentsAccessReadDescriptor::parameter_count())); | 1631 DCHECK(a0.is(ArgumentsAccessReadDescriptor::parameter_count())); |
| 1633 | 1632 |
| 1634 // Check that the key is a smiGenerateReadElement. | 1633 // Check that the key is a smiGenerateReadElement. |
| 1635 Label slow; | 1634 Label slow; |
| 1636 __ JumpIfNotSmi(a1, &slow); | 1635 __ JumpIfNotSmi(a1, &slow); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1676 __ push(a1); | 1675 __ push(a1); |
| 1677 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); | 1676 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); |
| 1678 } | 1677 } |
| 1679 | 1678 |
| 1680 | 1679 |
| 1681 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { | 1680 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { |
| 1682 // sp[0] : number of parameters | 1681 // sp[0] : number of parameters |
| 1683 // sp[4] : receiver displacement | 1682 // sp[4] : receiver displacement |
| 1684 // sp[8] : function | 1683 // sp[8] : function |
| 1685 | 1684 |
| 1686 CHECK(!has_new_target()); | |
| 1687 | |
| 1688 // Check if the calling frame is an arguments adaptor frame. | 1685 // Check if the calling frame is an arguments adaptor frame. |
| 1689 Label runtime; | 1686 Label runtime; |
| 1690 __ ld(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 1687 __ ld(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 1691 __ ld(a2, MemOperand(a3, StandardFrameConstants::kContextOffset)); | 1688 __ ld(a2, MemOperand(a3, StandardFrameConstants::kContextOffset)); |
| 1692 __ Branch(&runtime, | 1689 __ Branch(&runtime, |
| 1693 ne, | 1690 ne, |
| 1694 a2, | 1691 a2, |
| 1695 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 1692 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 1696 | 1693 |
| 1697 // Patch the arguments.length and the parameters pointer in the current frame. | 1694 // Patch the arguments.length and the parameters pointer in the current frame. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1709 | 1706 |
| 1710 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { | 1707 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { |
| 1711 // Stack layout: | 1708 // Stack layout: |
| 1712 // sp[0] : number of parameters (tagged) | 1709 // sp[0] : number of parameters (tagged) |
| 1713 // sp[4] : address of receiver argument | 1710 // sp[4] : address of receiver argument |
| 1714 // sp[8] : function | 1711 // sp[8] : function |
| 1715 // Registers used over whole function: | 1712 // Registers used over whole function: |
| 1716 // a6 : allocated object (tagged) | 1713 // a6 : allocated object (tagged) |
| 1717 // t1 : mapped parameter count (tagged) | 1714 // t1 : mapped parameter count (tagged) |
| 1718 | 1715 |
| 1719 CHECK(!has_new_target()); | |
| 1720 | |
| 1721 __ ld(a1, MemOperand(sp, 0 * kPointerSize)); | 1716 __ ld(a1, MemOperand(sp, 0 * kPointerSize)); |
| 1722 // a1 = parameter count (tagged) | 1717 // a1 = parameter count (tagged) |
| 1723 | 1718 |
| 1724 // Check if the calling frame is an arguments adaptor frame. | 1719 // Check if the calling frame is an arguments adaptor frame. |
| 1725 Label runtime; | 1720 Label runtime; |
| 1726 Label adaptor_frame, try_allocate; | 1721 Label adaptor_frame, try_allocate; |
| 1727 __ ld(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 1722 __ ld(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 1728 __ ld(a2, MemOperand(a3, StandardFrameConstants::kContextOffset)); | 1723 __ ld(a2, MemOperand(a3, StandardFrameConstants::kContextOffset)); |
| 1729 __ Branch(&adaptor_frame, | 1724 __ Branch(&adaptor_frame, |
| 1730 eq, | 1725 eq, |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1967 a3, | 1962 a3, |
| 1968 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 1963 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 1969 | 1964 |
| 1970 // Get the length from the frame. | 1965 // Get the length from the frame. |
| 1971 __ ld(a1, MemOperand(sp, 0)); | 1966 __ ld(a1, MemOperand(sp, 0)); |
| 1972 __ Branch(&try_allocate); | 1967 __ Branch(&try_allocate); |
| 1973 | 1968 |
| 1974 // Patch the arguments.length and the parameters pointer. | 1969 // Patch the arguments.length and the parameters pointer. |
| 1975 __ bind(&adaptor_frame); | 1970 __ bind(&adaptor_frame); |
| 1976 __ ld(a1, MemOperand(a2, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 1971 __ ld(a1, MemOperand(a2, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 1977 if (has_new_target()) { | |
| 1978 Label skip_decrement; | |
| 1979 __ Branch(&skip_decrement, eq, a1, Operand(Smi::FromInt(0))); | |
| 1980 // Subtract 1 from smi-tagged arguments count. | |
| 1981 __ SmiUntag(a1); | |
| 1982 __ Daddu(a1, a1, Operand(-1)); | |
| 1983 __ SmiTag(a1); | |
| 1984 __ bind(&skip_decrement); | |
| 1985 } | |
| 1986 __ sd(a1, MemOperand(sp, 0)); | 1972 __ sd(a1, MemOperand(sp, 0)); |
| 1987 __ SmiScale(at, a1, kPointerSizeLog2); | 1973 __ SmiScale(at, a1, kPointerSizeLog2); |
| 1988 | 1974 |
| 1989 __ Daddu(a3, a2, Operand(at)); | 1975 __ Daddu(a3, a2, Operand(at)); |
| 1990 | 1976 |
| 1991 __ Daddu(a3, a3, Operand(StandardFrameConstants::kCallerSPOffset)); | 1977 __ Daddu(a3, a3, Operand(StandardFrameConstants::kCallerSPOffset)); |
| 1992 __ sd(a3, MemOperand(sp, 1 * kPointerSize)); | 1978 __ sd(a3, MemOperand(sp, 1 * kPointerSize)); |
| 1993 | 1979 |
| 1994 // Try the new space allocation. Start out with computing the size | 1980 // Try the new space allocation. Start out with computing the size |
| 1995 // of the arguments object and the elements array in words. | 1981 // of the arguments object and the elements array in words. |
| (...skipping 3613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5609 MemOperand(fp, 6 * kPointerSize), NULL); | 5595 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5610 } | 5596 } |
| 5611 | 5597 |
| 5612 | 5598 |
| 5613 #undef __ | 5599 #undef __ |
| 5614 | 5600 |
| 5615 } // namespace internal | 5601 } // namespace internal |
| 5616 } // namespace v8 | 5602 } // namespace v8 |
| 5617 | 5603 |
| 5618 #endif // V8_TARGET_ARCH_MIPS64 | 5604 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |