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

Side by Side Diff: src/arm/code-stubs-arm.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_ARM 7 #if V8_TARGET_ARCH_ARM
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 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after
1528 StubRuntimeCallHelper call_helper; 1528 StubRuntimeCallHelper call_helper;
1529 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper); 1529 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper);
1530 1530
1531 __ bind(&miss); 1531 __ bind(&miss);
1532 PropertyAccessCompiler::TailCallBuiltin( 1532 PropertyAccessCompiler::TailCallBuiltin(
1533 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); 1533 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC));
1534 } 1534 }
1535 1535
1536 1536
1537 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { 1537 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) {
1538 CHECK(!has_new_target());
1539 // The displacement is the offset of the last parameter (if any) 1538 // The displacement is the offset of the last parameter (if any)
1540 // relative to the frame pointer. 1539 // relative to the frame pointer.
1541 const int kDisplacement = 1540 const int kDisplacement =
1542 StandardFrameConstants::kCallerSPOffset - kPointerSize; 1541 StandardFrameConstants::kCallerSPOffset - kPointerSize;
1543 DCHECK(r1.is(ArgumentsAccessReadDescriptor::index())); 1542 DCHECK(r1.is(ArgumentsAccessReadDescriptor::index()));
1544 DCHECK(r0.is(ArgumentsAccessReadDescriptor::parameter_count())); 1543 DCHECK(r0.is(ArgumentsAccessReadDescriptor::parameter_count()));
1545 1544
1546 // Check that the key is a smi. 1545 // Check that the key is a smi.
1547 Label slow; 1546 Label slow;
1548 __ JumpIfNotSmi(r1, &slow); 1547 __ JumpIfNotSmi(r1, &slow);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1586 __ push(r1); 1585 __ push(r1);
1587 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); 1586 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1);
1588 } 1587 }
1589 1588
1590 1589
1591 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { 1590 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) {
1592 // sp[0] : number of parameters 1591 // sp[0] : number of parameters
1593 // sp[4] : receiver displacement 1592 // sp[4] : receiver displacement
1594 // sp[8] : function 1593 // sp[8] : function
1595 1594
1596 CHECK(!has_new_target());
1597
1598 // Check if the calling frame is an arguments adaptor frame. 1595 // Check if the calling frame is an arguments adaptor frame.
1599 Label runtime; 1596 Label runtime;
1600 __ ldr(r3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 1597 __ ldr(r3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
1601 __ ldr(r2, MemOperand(r3, StandardFrameConstants::kContextOffset)); 1598 __ ldr(r2, MemOperand(r3, StandardFrameConstants::kContextOffset));
1602 __ cmp(r2, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 1599 __ cmp(r2, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
1603 __ b(ne, &runtime); 1600 __ b(ne, &runtime);
1604 1601
1605 // Patch the arguments.length and the parameters pointer in the current frame. 1602 // Patch the arguments.length and the parameters pointer in the current frame.
1606 __ ldr(r2, MemOperand(r3, ArgumentsAdaptorFrameConstants::kLengthOffset)); 1603 __ ldr(r2, MemOperand(r3, ArgumentsAdaptorFrameConstants::kLengthOffset));
1607 __ str(r2, MemOperand(sp, 0 * kPointerSize)); 1604 __ str(r2, MemOperand(sp, 0 * kPointerSize));
1608 __ add(r3, r3, Operand(r2, LSL, 1)); 1605 __ add(r3, r3, Operand(r2, LSL, 1));
1609 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset)); 1606 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset));
1610 __ str(r3, MemOperand(sp, 1 * kPointerSize)); 1607 __ str(r3, MemOperand(sp, 1 * kPointerSize));
1611 1608
1612 __ bind(&runtime); 1609 __ bind(&runtime);
1613 __ TailCallRuntime(Runtime::kNewSloppyArguments, 3, 1); 1610 __ TailCallRuntime(Runtime::kNewSloppyArguments, 3, 1);
1614 } 1611 }
1615 1612
1616 1613
1617 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { 1614 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) {
1618 // Stack layout: 1615 // Stack layout:
1619 // sp[0] : number of parameters (tagged) 1616 // sp[0] : number of parameters (tagged)
1620 // sp[4] : address of receiver argument 1617 // sp[4] : address of receiver argument
1621 // sp[8] : function 1618 // sp[8] : function
1622 // Registers used over whole function: 1619 // Registers used over whole function:
1623 // r6 : allocated object (tagged) 1620 // r6 : allocated object (tagged)
1624 // r9 : mapped parameter count (tagged) 1621 // r9 : mapped parameter count (tagged)
1625 1622
1626 CHECK(!has_new_target());
1627
1628 __ ldr(r1, MemOperand(sp, 0 * kPointerSize)); 1623 __ ldr(r1, MemOperand(sp, 0 * kPointerSize));
1629 // r1 = parameter count (tagged) 1624 // r1 = parameter count (tagged)
1630 1625
1631 // Check if the calling frame is an arguments adaptor frame. 1626 // Check if the calling frame is an arguments adaptor frame.
1632 Label runtime; 1627 Label runtime;
1633 Label adaptor_frame, try_allocate; 1628 Label adaptor_frame, try_allocate;
1634 __ ldr(r3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 1629 __ ldr(r3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
1635 __ ldr(r2, MemOperand(r3, StandardFrameConstants::kContextOffset)); 1630 __ ldr(r2, MemOperand(r3, StandardFrameConstants::kContextOffset));
1636 __ cmp(r2, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 1631 __ cmp(r2, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
1637 __ b(eq, &adaptor_frame); 1632 __ b(eq, &adaptor_frame);
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 __ cmp(r3, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 1853 __ cmp(r3, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
1859 __ b(eq, &adaptor_frame); 1854 __ b(eq, &adaptor_frame);
1860 1855
1861 // Get the length from the frame. 1856 // Get the length from the frame.
1862 __ ldr(r1, MemOperand(sp, 0)); 1857 __ ldr(r1, MemOperand(sp, 0));
1863 __ b(&try_allocate); 1858 __ b(&try_allocate);
1864 1859
1865 // Patch the arguments.length and the parameters pointer. 1860 // Patch the arguments.length and the parameters pointer.
1866 __ bind(&adaptor_frame); 1861 __ bind(&adaptor_frame);
1867 __ ldr(r1, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset)); 1862 __ ldr(r1, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset));
1868 if (has_new_target()) {
1869 __ cmp(r1, Operand(Smi::FromInt(0)));
1870 Label skip_decrement;
1871 __ b(eq, &skip_decrement);
1872 // Subtract 1 from smi-tagged arguments count.
1873 __ sub(r1, r1, Operand(2));
1874 __ bind(&skip_decrement);
1875 }
1876 __ str(r1, MemOperand(sp, 0)); 1863 __ str(r1, MemOperand(sp, 0));
1877 __ add(r3, r2, Operand::PointerOffsetFromSmiKey(r1)); 1864 __ add(r3, r2, Operand::PointerOffsetFromSmiKey(r1));
1878 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset)); 1865 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset));
1879 __ str(r3, MemOperand(sp, 1 * kPointerSize)); 1866 __ str(r3, MemOperand(sp, 1 * kPointerSize));
1880 1867
1881 // Try the new space allocation. Start out with computing the size 1868 // Try the new space allocation. Start out with computing the size
1882 // of the arguments object and the elements array in words. 1869 // of the arguments object and the elements array in words.
1883 Label add_arguments_object; 1870 Label add_arguments_object;
1884 __ bind(&try_allocate); 1871 __ bind(&try_allocate);
1885 __ SmiUntag(r1, SetCC); 1872 __ SmiUntag(r1, SetCC);
(...skipping 3474 matching lines...) Expand 10 before | Expand all | Expand 10 after
5360 MemOperand(fp, 6 * kPointerSize), NULL); 5347 MemOperand(fp, 6 * kPointerSize), NULL);
5361 } 5348 }
5362 5349
5363 5350
5364 #undef __ 5351 #undef __
5365 5352
5366 } // namespace internal 5353 } // namespace internal
5367 } // namespace v8 5354 } // namespace v8
5368 5355
5369 #endif // V8_TARGET_ARCH_ARM 5356 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698