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

Side by Side Diff: src/x87/builtins-x87.cc

Issue 1139913007: X87: [strong] Check arity of functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_X87 7 #if V8_TARGET_ARCH_X87
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 __ inc(edi); 1570 __ inc(edi);
1571 __ push(Operand(eax, 0)); 1571 __ push(Operand(eax, 0));
1572 __ sub(eax, Immediate(kPointerSize)); 1572 __ sub(eax, Immediate(kPointerSize));
1573 __ cmp(edi, ebx); 1573 __ cmp(edi, ebx);
1574 __ j(less, &copy); 1574 __ j(less, &copy);
1575 __ jmp(&invoke); 1575 __ jmp(&invoke);
1576 } 1576 }
1577 1577
1578 { // Too few parameters: Actual < expected. 1578 { // Too few parameters: Actual < expected.
1579 __ bind(&too_few); 1579 __ bind(&too_few);
1580
1581 // If the function is strong we need to throw an error.
1582 Label weak_function;
1583 __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
1584 __ test_b(FieldOperand(ecx, SharedFunctionInfo::kStrongModeByteOffset),
1585 1 << SharedFunctionInfo::kStrongModeBitWithinByte);
1586 __ j(equal, &weak_function, Label::kNear);
1587
1588 {
1589 FrameScope frame(masm, StackFrame::MANUAL);
1590 EnterArgumentsAdaptorFrame(masm);
1591 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0);
1592 }
1593
1594 __ bind(&weak_function);
1580 EnterArgumentsAdaptorFrame(masm); 1595 EnterArgumentsAdaptorFrame(masm);
1581 1596
1582 // Copy receiver and all actual arguments. 1597 // Copy receiver and all actual arguments.
1583 const int offset = StandardFrameConstants::kCallerSPOffset; 1598 const int offset = StandardFrameConstants::kCallerSPOffset;
1584 __ lea(edi, Operand(ebp, eax, times_4, offset)); 1599 __ lea(edi, Operand(ebp, eax, times_4, offset));
1585 // ebx = expected - actual. 1600 // ebx = expected - actual.
1586 __ sub(ebx, eax); 1601 __ sub(ebx, eax);
1587 // eax = -actual - 1 1602 // eax = -actual - 1
1588 __ neg(eax); 1603 __ neg(eax);
1589 __ sub(eax, Immediate(1)); 1604 __ sub(eax, Immediate(1));
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
1687 1702
1688 __ bind(&ok); 1703 __ bind(&ok);
1689 __ ret(0); 1704 __ ret(0);
1690 } 1705 }
1691 1706
1692 #undef __ 1707 #undef __
1693 } 1708 }
1694 } // namespace v8::internal 1709 } // namespace v8::internal
1695 1710
1696 #endif // V8_TARGET_ARCH_X87 1711 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698