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

Side by Side Diff: src/ppc/code-stubs-ppc.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 7 #if V8_TARGET_ARCH_PPC
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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 StringHelper::GenerateFlatOneByteStringEquals(masm, lhs, rhs, r5, r6); 709 StringHelper::GenerateFlatOneByteStringEquals(masm, lhs, rhs, r5, r6);
710 } else { 710 } else {
711 StringHelper::GenerateCompareFlatOneByteStrings(masm, lhs, rhs, r5, r6, r7); 711 StringHelper::GenerateCompareFlatOneByteStrings(masm, lhs, rhs, r5, r6, r7);
712 } 712 }
713 // Never falls through to here. 713 // Never falls through to here.
714 714
715 __ bind(&slow); 715 __ bind(&slow);
716 716
717 __ Push(lhs, rhs); 717 __ Push(lhs, rhs);
718 // Figure out which native to call and setup the arguments. 718 // Figure out which native to call and setup the arguments.
719 Builtins::JavaScript native; 719 if (cc == eq && strict()) {
720 if (cc == eq) { 720 __ TailCallRuntime(Runtime::kStrictEquals, 2, 1);
721 native = strict() ? Builtins::STRICT_EQUALS : Builtins::EQUALS;
722 } else { 721 } else {
723 native = 722 Builtins::JavaScript native;
724 is_strong(strength()) ? Builtins::COMPARE_STRONG : Builtins::COMPARE; 723 if (cc == eq) {
725 int ncr; // NaN compare result 724 native = Builtins::EQUALS;
726 if (cc == lt || cc == le) {
727 ncr = GREATER;
728 } else { 725 } else {
729 DCHECK(cc == gt || cc == ge); // remaining cases 726 native =
730 ncr = LESS; 727 is_strong(strength()) ? Builtins::COMPARE_STRONG : Builtins::COMPARE;
728 int ncr; // NaN compare result
729 if (cc == lt || cc == le) {
730 ncr = GREATER;
731 } else {
732 DCHECK(cc == gt || cc == ge); // remaining cases
733 ncr = LESS;
734 }
735 __ LoadSmiLiteral(r3, Smi::FromInt(ncr));
736 __ push(r3);
731 } 737 }
732 __ LoadSmiLiteral(r3, Smi::FromInt(ncr)); 738
733 __ push(r3); 739 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater)
740 // tagged as a small integer.
741 __ InvokeBuiltin(native, JUMP_FUNCTION);
734 } 742 }
735 743
736 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater)
737 // tagged as a small integer.
738 __ InvokeBuiltin(native, JUMP_FUNCTION);
739
740 __ bind(&miss); 744 __ bind(&miss);
741 GenerateMiss(masm); 745 GenerateMiss(masm);
742 } 746 }
743 747
744 748
745 void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { 749 void StoreBufferOverflowStub::Generate(MacroAssembler* masm) {
746 // We don't allow a GC during a store buffer overflow so there is no need to 750 // We don't allow a GC during a store buffer overflow so there is no need to
747 // store the registers in any particular way, but we do have to store and 751 // store the registers in any particular way, but we do have to store and
748 // restore them. 752 // restore them.
749 __ mflr(r0); 753 __ mflr(r0);
(...skipping 5081 matching lines...) Expand 10 before | Expand all | Expand 10 after
5831 kStackUnwindSpace, NULL, 5835 kStackUnwindSpace, NULL,
5832 MemOperand(fp, 6 * kPointerSize), NULL); 5836 MemOperand(fp, 6 * kPointerSize), NULL);
5833 } 5837 }
5834 5838
5835 5839
5836 #undef __ 5840 #undef __
5837 } // namespace internal 5841 } // namespace internal
5838 } // namespace v8 5842 } // namespace v8
5839 5843
5840 #endif // V8_TARGET_ARCH_PPC 5844 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« src/api.cc ('K') | « src/objects-inl.h ('k') | src/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698