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

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

Issue 1298603002: [runtime] Unify and fix the strict equality comparison. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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
« src/api.cc ('K') | « src/x64/code-stubs-x64.cc ('k') | 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/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1598 __ ret(0); // rax, rdx were pushed 1598 __ ret(0); // rax, rdx were pushed
1599 } 1599 }
1600 __ bind(&runtime_call); 1600 __ bind(&runtime_call);
1601 1601
1602 // Push arguments below the return address. 1602 // Push arguments below the return address.
1603 __ pop(ecx); 1603 __ pop(ecx);
1604 __ push(edx); 1604 __ push(edx);
1605 __ push(eax); 1605 __ push(eax);
1606 1606
1607 // Figure out which native to call and setup the arguments. 1607 // Figure out which native to call and setup the arguments.
1608 Builtins::JavaScript builtin; 1608 if (cc == equal && strict()) {
1609 if (cc == equal) { 1609 __ push(ecx);
1610 builtin = strict() ? Builtins::STRICT_EQUALS : Builtins::EQUALS; 1610 __ TailCallRuntime(Runtime::kStrictEquals, 2, 1);
1611 } else { 1611 } else {
1612 builtin = 1612 Builtins::JavaScript builtin;
1613 is_strong(strength()) ? Builtins::COMPARE_STRONG : Builtins::COMPARE; 1613 if (cc == equal) {
1614 __ push(Immediate(Smi::FromInt(NegativeComparisonResult(cc)))); 1614 builtin = Builtins::EQUALS;
1615 } else {
1616 builtin =
1617 is_strong(strength()) ? Builtins::COMPARE_STRONG : Builtins::COMPARE;
1618 __ push(Immediate(Smi::FromInt(NegativeComparisonResult(cc))));
1619 }
1620
1621 // Restore return address on the stack.
1622 __ push(ecx);
1623
1624 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater)
1625 // tagged as a small integer.
1626 __ InvokeBuiltin(builtin, JUMP_FUNCTION);
1615 } 1627 }
1616 1628
1617 // Restore return address on the stack.
1618 __ push(ecx);
1619
1620 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater)
1621 // tagged as a small integer.
1622 __ InvokeBuiltin(builtin, JUMP_FUNCTION);
1623
1624 __ bind(&miss); 1629 __ bind(&miss);
1625 GenerateMiss(masm); 1630 GenerateMiss(masm);
1626 } 1631 }
1627 1632
1628 1633
1629 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub, 1634 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub,
1630 bool is_super) { 1635 bool is_super) {
1631 // eax : number of arguments to the construct function 1636 // eax : number of arguments to the construct function
1632 // ebx : feedback vector 1637 // ebx : feedback vector
1633 // edx : slot in feedback vector (Smi) 1638 // edx : slot in feedback vector (Smi)
(...skipping 3705 matching lines...) Expand 10 before | Expand all | Expand 10 after
5339 Operand(ebp, 7 * kPointerSize), NULL); 5344 Operand(ebp, 7 * kPointerSize), NULL);
5340 } 5345 }
5341 5346
5342 5347
5343 #undef __ 5348 #undef __
5344 5349
5345 } // namespace internal 5350 } // namespace internal
5346 } // namespace v8 5351 } // namespace v8
5347 5352
5348 #endif // V8_TARGET_ARCH_X87 5353 #endif // V8_TARGET_ARCH_X87
OLDNEW
« src/api.cc ('K') | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698