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

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 1196193014: Do not add extra argument for new.target (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment added Created 5 years, 6 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
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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_MIPS 7 #if V8_TARGET_ARCH_MIPS
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 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 1616
1617 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, t0, 1617 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, t0,
1618 t1, &miss); 1618 t1, &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
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 __ lw(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 1687 __ lw(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
1691 __ lw(a2, MemOperand(a3, StandardFrameConstants::kContextOffset)); 1688 __ lw(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
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 // t2 : allocated object (tagged) 1713 // t2 : allocated object (tagged)
1717 // t5 : mapped parameter count (tagged) 1714 // t5 : mapped parameter count (tagged)
1718 1715
1719 CHECK(!has_new_target());
1720
1721 __ lw(a1, MemOperand(sp, 0 * kPointerSize)); 1716 __ lw(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 __ lw(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 1722 __ lw(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
1728 __ lw(a2, MemOperand(a3, StandardFrameConstants::kContextOffset)); 1723 __ lw(a2, MemOperand(a3, StandardFrameConstants::kContextOffset));
1729 __ Branch(&adaptor_frame, 1724 __ Branch(&adaptor_frame,
1730 eq, 1725 eq,
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1968 a3, 1963 a3,
1969 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 1964 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
1970 1965
1971 // Get the length from the frame. 1966 // Get the length from the frame.
1972 __ lw(a1, MemOperand(sp, 0)); 1967 __ lw(a1, MemOperand(sp, 0));
1973 __ Branch(&try_allocate); 1968 __ Branch(&try_allocate);
1974 1969
1975 // Patch the arguments.length and the parameters pointer. 1970 // Patch the arguments.length and the parameters pointer.
1976 __ bind(&adaptor_frame); 1971 __ bind(&adaptor_frame);
1977 __ lw(a1, MemOperand(a2, ArgumentsAdaptorFrameConstants::kLengthOffset)); 1972 __ lw(a1, MemOperand(a2, ArgumentsAdaptorFrameConstants::kLengthOffset));
1978 if (has_new_target()) {
1979 Label skip_decrement;
1980 __ Branch(&skip_decrement, eq, a1, Operand(Smi::FromInt(0)));
1981 // Subtract 1 from smi-tagged arguments count.
1982 __ Subu(a1, a1, Operand(2));
1983 __ bind(&skip_decrement);
1984 }
1985 __ sw(a1, MemOperand(sp, 0)); 1973 __ sw(a1, MemOperand(sp, 0));
1986 __ sll(at, a1, kPointerSizeLog2 - kSmiTagSize); 1974 __ sll(at, a1, kPointerSizeLog2 - kSmiTagSize);
1987 __ Addu(a3, a2, Operand(at)); 1975 __ Addu(a3, a2, Operand(at));
1988 1976
1989 __ Addu(a3, a3, Operand(StandardFrameConstants::kCallerSPOffset)); 1977 __ Addu(a3, a3, Operand(StandardFrameConstants::kCallerSPOffset));
1990 __ sw(a3, MemOperand(sp, 1 * kPointerSize)); 1978 __ sw(a3, MemOperand(sp, 1 * kPointerSize));
1991 1979
1992 // Try the new space allocation. Start out with computing the size 1980 // Try the new space allocation. Start out with computing the size
1993 // of the arguments object and the elements array in words. 1981 // of the arguments object and the elements array in words.
1994 Label add_arguments_object; 1982 Label add_arguments_object;
(...skipping 3571 matching lines...) Expand 10 before | Expand all | Expand 10 after
5566 MemOperand(fp, 6 * kPointerSize), NULL); 5554 MemOperand(fp, 6 * kPointerSize), NULL);
5567 } 5555 }
5568 5556
5569 5557
5570 #undef __ 5558 #undef __
5571 5559
5572 } // namespace internal 5560 } // namespace internal
5573 } // namespace v8 5561 } // namespace v8
5574 5562
5575 #endif // V8_TARGET_ARCH_MIPS 5563 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698