| OLD | NEW |
| 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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 r6); | 691 r6); |
| 692 if (cc == eq) { | 692 if (cc == eq) { |
| 693 StringHelper::GenerateFlatOneByteStringEquals(masm, lhs, rhs, r5, r6); | 693 StringHelper::GenerateFlatOneByteStringEquals(masm, lhs, rhs, r5, r6); |
| 694 } else { | 694 } else { |
| 695 StringHelper::GenerateCompareFlatOneByteStrings(masm, lhs, rhs, r5, r6, r7); | 695 StringHelper::GenerateCompareFlatOneByteStrings(masm, lhs, rhs, r5, r6, r7); |
| 696 } | 696 } |
| 697 // Never falls through to here. | 697 // Never falls through to here. |
| 698 | 698 |
| 699 __ bind(&slow); | 699 __ bind(&slow); |
| 700 | 700 |
| 701 __ Push(lhs, rhs); |
| 702 // Figure out which native to call and setup the arguments. |
| 701 if (cc == eq) { | 703 if (cc == eq) { |
| 702 { | 704 __ TailCallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals); |
| 703 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | |
| 704 __ Push(lhs, rhs); | |
| 705 __ CallRuntime(strict() ? Runtime::kStrictEqual : Runtime::kEqual); | |
| 706 } | |
| 707 // Turn true into 0 and false into some non-zero value. | |
| 708 STATIC_ASSERT(EQUAL == 0); | |
| 709 __ LoadRoot(r4, Heap::kTrueValueRootIndex); | |
| 710 __ sub(r3, r3, r4); | |
| 711 __ Ret(); | |
| 712 } else { | 705 } else { |
| 713 __ Push(lhs, rhs); | |
| 714 int ncr; // NaN compare result | 706 int ncr; // NaN compare result |
| 715 if (cc == lt || cc == le) { | 707 if (cc == lt || cc == le) { |
| 716 ncr = GREATER; | 708 ncr = GREATER; |
| 717 } else { | 709 } else { |
| 718 DCHECK(cc == gt || cc == ge); // remaining cases | 710 DCHECK(cc == gt || cc == ge); // remaining cases |
| 719 ncr = LESS; | 711 ncr = LESS; |
| 720 } | 712 } |
| 721 __ LoadSmiLiteral(r3, Smi::FromInt(ncr)); | 713 __ LoadSmiLiteral(r3, Smi::FromInt(ncr)); |
| 722 __ push(r3); | 714 __ push(r3); |
| 723 | 715 |
| (...skipping 5139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5863 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5855 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
| 5864 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5856 kStackUnwindSpace, NULL, return_value_operand, NULL); |
| 5865 } | 5857 } |
| 5866 | 5858 |
| 5867 | 5859 |
| 5868 #undef __ | 5860 #undef __ |
| 5869 } // namespace internal | 5861 } // namespace internal |
| 5870 } // namespace v8 | 5862 } // namespace v8 |
| 5871 | 5863 |
| 5872 #endif // V8_TARGET_ARCH_PPC | 5864 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |