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

Side by Side Diff: src/mips/code-stubs-mips.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
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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 StringHelper::GenerateCompareFlatOneByteStrings(masm, lhs, rhs, a2, a3, t0, 721 StringHelper::GenerateCompareFlatOneByteStrings(masm, lhs, rhs, a2, a3, t0,
722 t1); 722 t1);
723 } 723 }
724 // Never falls through to here. 724 // Never falls through to here.
725 725
726 __ bind(&slow); 726 __ bind(&slow);
727 // Prepare for call to builtin. Push object pointers, a0 (lhs) first, 727 // Prepare for call to builtin. Push object pointers, a0 (lhs) first,
728 // a1 (rhs) second. 728 // a1 (rhs) second.
729 __ Push(lhs, rhs); 729 __ Push(lhs, rhs);
730 // Figure out which native to call and setup the arguments. 730 // Figure out which native to call and setup the arguments.
731 Builtins::JavaScript native; 731 if (cc == eq && strict()) {
732 if (cc == eq) { 732 __ TailCallRuntime(Runtime::kStrictEquals, 2, 1);
733 native = strict() ? Builtins::STRICT_EQUALS : Builtins::EQUALS;
734 } else { 733 } else {
735 native = 734 Builtins::JavaScript native;
736 is_strong(strength()) ? Builtins::COMPARE_STRONG : Builtins::COMPARE; 735 if (cc == eq) {
737 int ncr; // NaN compare result. 736 native = Builtins::EQUALS;
738 if (cc == lt || cc == le) {
739 ncr = GREATER;
740 } else { 737 } else {
741 DCHECK(cc == gt || cc == ge); // Remaining cases. 738 native =
742 ncr = LESS; 739 is_strong(strength()) ? Builtins::COMPARE_STRONG : Builtins::COMPARE;
740 int ncr; // NaN compare result.
741 if (cc == lt || cc == le) {
742 ncr = GREATER;
743 } else {
744 DCHECK(cc == gt || cc == ge); // Remaining cases.
745 ncr = LESS;
746 }
747 __ li(a0, Operand(Smi::FromInt(ncr)));
748 __ push(a0);
743 } 749 }
744 __ li(a0, Operand(Smi::FromInt(ncr))); 750
745 __ push(a0); 751 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater)
752 // tagged as a small integer.
753 __ InvokeBuiltin(native, JUMP_FUNCTION);
746 } 754 }
747 755
748 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater)
749 // tagged as a small integer.
750 __ InvokeBuiltin(native, JUMP_FUNCTION);
751
752 __ bind(&miss); 756 __ bind(&miss);
753 GenerateMiss(masm); 757 GenerateMiss(masm);
754 } 758 }
755 759
756 760
757 void StoreRegistersStateStub::Generate(MacroAssembler* masm) { 761 void StoreRegistersStateStub::Generate(MacroAssembler* masm) {
758 __ mov(t9, ra); 762 __ mov(t9, ra);
759 __ pop(ra); 763 __ pop(ra);
760 __ PushSafepointRegisters(); 764 __ PushSafepointRegisters();
761 __ Jump(t9); 765 __ Jump(t9);
(...skipping 4958 matching lines...) Expand 10 before | Expand all | Expand 10 after
5720 MemOperand(fp, 6 * kPointerSize), NULL); 5724 MemOperand(fp, 6 * kPointerSize), NULL);
5721 } 5725 }
5722 5726
5723 5727
5724 #undef __ 5728 #undef __
5725 5729
5726 } // namespace internal 5730 } // namespace internal
5727 } // namespace v8 5731 } // namespace v8
5728 5732
5729 #endif // V8_TARGET_ARCH_MIPS 5733 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« src/api.cc ('K') | « src/ia32/code-stubs-ia32.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698