OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 7 #if V8_TARGET_ARCH_PPC |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1621 StubRuntimeCallHelper call_helper; | 1621 StubRuntimeCallHelper call_helper; |
1622 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper); | 1622 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper); |
1623 | 1623 |
1624 __ bind(&miss); | 1624 __ bind(&miss); |
1625 PropertyAccessCompiler::TailCallBuiltin( | 1625 PropertyAccessCompiler::TailCallBuiltin( |
1626 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); | 1626 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); |
1627 } | 1627 } |
1628 | 1628 |
1629 | 1629 |
1630 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { | 1630 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { |
1631 CHECK(!has_new_target()); | |
1632 // The displacement is the offset of the last parameter (if any) | 1631 // The displacement is the offset of the last parameter (if any) |
1633 // relative to the frame pointer. | 1632 // relative to the frame pointer. |
1634 const int kDisplacement = | 1633 const int kDisplacement = |
1635 StandardFrameConstants::kCallerSPOffset - kPointerSize; | 1634 StandardFrameConstants::kCallerSPOffset - kPointerSize; |
1636 DCHECK(r4.is(ArgumentsAccessReadDescriptor::index())); | 1635 DCHECK(r4.is(ArgumentsAccessReadDescriptor::index())); |
1637 DCHECK(r3.is(ArgumentsAccessReadDescriptor::parameter_count())); | 1636 DCHECK(r3.is(ArgumentsAccessReadDescriptor::parameter_count())); |
1638 | 1637 |
1639 // Check that the key is a smi. | 1638 // Check that the key is a smi. |
1640 Label slow; | 1639 Label slow; |
1641 __ JumpIfNotSmi(r4, &slow); | 1640 __ JumpIfNotSmi(r4, &slow); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1682 __ push(r4); | 1681 __ push(r4); |
1683 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); | 1682 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); |
1684 } | 1683 } |
1685 | 1684 |
1686 | 1685 |
1687 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { | 1686 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { |
1688 // sp[0] : number of parameters | 1687 // sp[0] : number of parameters |
1689 // sp[1] : receiver displacement | 1688 // sp[1] : receiver displacement |
1690 // sp[2] : function | 1689 // sp[2] : function |
1691 | 1690 |
1692 CHECK(!has_new_target()); | |
1693 | |
1694 // Check if the calling frame is an arguments adaptor frame. | 1691 // Check if the calling frame is an arguments adaptor frame. |
1695 Label runtime; | 1692 Label runtime; |
1696 __ LoadP(r6, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 1693 __ LoadP(r6, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
1697 __ LoadP(r5, MemOperand(r6, StandardFrameConstants::kContextOffset)); | 1694 __ LoadP(r5, MemOperand(r6, StandardFrameConstants::kContextOffset)); |
1698 STATIC_ASSERT(StackFrame::ARGUMENTS_ADAPTOR < 0x3fffu); | 1695 STATIC_ASSERT(StackFrame::ARGUMENTS_ADAPTOR < 0x3fffu); |
1699 __ CmpSmiLiteral(r5, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); | 1696 __ CmpSmiLiteral(r5, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); |
1700 __ bne(&runtime); | 1697 __ bne(&runtime); |
1701 | 1698 |
1702 // Patch the arguments.length and the parameters pointer in the current frame. | 1699 // Patch the arguments.length and the parameters pointer in the current frame. |
1703 __ LoadP(r5, MemOperand(r6, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 1700 __ LoadP(r5, MemOperand(r6, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
(...skipping 10 matching lines...) Expand all Loading... |
1714 | 1711 |
1715 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { | 1712 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { |
1716 // Stack layout: | 1713 // Stack layout: |
1717 // sp[0] : number of parameters (tagged) | 1714 // sp[0] : number of parameters (tagged) |
1718 // sp[1] : address of receiver argument | 1715 // sp[1] : address of receiver argument |
1719 // sp[2] : function | 1716 // sp[2] : function |
1720 // Registers used over whole function: | 1717 // Registers used over whole function: |
1721 // r9 : allocated object (tagged) | 1718 // r9 : allocated object (tagged) |
1722 // r11 : mapped parameter count (tagged) | 1719 // r11 : mapped parameter count (tagged) |
1723 | 1720 |
1724 CHECK(!has_new_target()); | |
1725 | |
1726 __ LoadP(r4, MemOperand(sp, 0 * kPointerSize)); | 1721 __ LoadP(r4, MemOperand(sp, 0 * kPointerSize)); |
1727 // r4 = parameter count (tagged) | 1722 // r4 = parameter count (tagged) |
1728 | 1723 |
1729 // Check if the calling frame is an arguments adaptor frame. | 1724 // Check if the calling frame is an arguments adaptor frame. |
1730 Label runtime; | 1725 Label runtime; |
1731 Label adaptor_frame, try_allocate; | 1726 Label adaptor_frame, try_allocate; |
1732 __ LoadP(r6, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 1727 __ LoadP(r6, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
1733 __ LoadP(r5, MemOperand(r6, StandardFrameConstants::kContextOffset)); | 1728 __ LoadP(r5, MemOperand(r6, StandardFrameConstants::kContextOffset)); |
1734 STATIC_ASSERT(StackFrame::ARGUMENTS_ADAPTOR < 0x3fffu); | 1729 STATIC_ASSERT(StackFrame::ARGUMENTS_ADAPTOR < 0x3fffu); |
1735 __ CmpSmiLiteral(r5, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); | 1730 __ CmpSmiLiteral(r5, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1998 __ CmpSmiLiteral(r6, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); | 1993 __ CmpSmiLiteral(r6, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); |
1999 __ beq(&adaptor_frame); | 1994 __ beq(&adaptor_frame); |
2000 | 1995 |
2001 // Get the length from the frame. | 1996 // Get the length from the frame. |
2002 __ LoadP(r4, MemOperand(sp, 0)); | 1997 __ LoadP(r4, MemOperand(sp, 0)); |
2003 __ b(&try_allocate); | 1998 __ b(&try_allocate); |
2004 | 1999 |
2005 // Patch the arguments.length and the parameters pointer. | 2000 // Patch the arguments.length and the parameters pointer. |
2006 __ bind(&adaptor_frame); | 2001 __ bind(&adaptor_frame); |
2007 __ LoadP(r4, MemOperand(r5, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 2002 __ LoadP(r4, MemOperand(r5, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
2008 if (has_new_target()) { | |
2009 __ CmpSmiLiteral(r4, Smi::FromInt(0), r0); | |
2010 Label skip_decrement; | |
2011 __ beq(&skip_decrement); | |
2012 // Subtract 1 from smi-tagged arguments count. | |
2013 __ SubSmiLiteral(r4, r4, Smi::FromInt(1), r0); | |
2014 __ bind(&skip_decrement); | |
2015 } | |
2016 __ StoreP(r4, MemOperand(sp, 0)); | 2003 __ StoreP(r4, MemOperand(sp, 0)); |
2017 __ SmiToPtrArrayOffset(r6, r4); | 2004 __ SmiToPtrArrayOffset(r6, r4); |
2018 __ add(r6, r5, r6); | 2005 __ add(r6, r5, r6); |
2019 __ addi(r6, r6, Operand(StandardFrameConstants::kCallerSPOffset)); | 2006 __ addi(r6, r6, Operand(StandardFrameConstants::kCallerSPOffset)); |
2020 __ StoreP(r6, MemOperand(sp, 1 * kPointerSize)); | 2007 __ StoreP(r6, MemOperand(sp, 1 * kPointerSize)); |
2021 | 2008 |
2022 // Try the new space allocation. Start out with computing the size | 2009 // Try the new space allocation. Start out with computing the size |
2023 // of the arguments object and the elements array in words. | 2010 // of the arguments object and the elements array in words. |
2024 Label add_arguments_object; | 2011 Label add_arguments_object; |
2025 __ bind(&try_allocate); | 2012 __ bind(&try_allocate); |
(...skipping 3639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5665 kStackUnwindSpace, NULL, | 5652 kStackUnwindSpace, NULL, |
5666 MemOperand(fp, 6 * kPointerSize), NULL); | 5653 MemOperand(fp, 6 * kPointerSize), NULL); |
5667 } | 5654 } |
5668 | 5655 |
5669 | 5656 |
5670 #undef __ | 5657 #undef __ |
5671 } // namespace internal | 5658 } // namespace internal |
5672 } // namespace v8 | 5659 } // namespace v8 |
5673 | 5660 |
5674 #endif // V8_TARGET_ARCH_PPC | 5661 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |