| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 Label not_identical; | 251 Label not_identical; |
| 252 Label heap_number, return_equal; | 252 Label heap_number, return_equal; |
| 253 __ cmp(r3, r4); | 253 __ cmp(r3, r4); |
| 254 __ bne(¬_identical); | 254 __ bne(¬_identical); |
| 255 | 255 |
| 256 // Test for NaN. Sadly, we can't just compare to Factory::nan_value(), | 256 // Test for NaN. Sadly, we can't just compare to Factory::nan_value(), |
| 257 // so we do the second best thing - test it ourselves. | 257 // so we do the second best thing - test it ourselves. |
| 258 // They are both equal and they are not both Smis so both of them are not | 258 // They are both equal and they are not both Smis so both of them are not |
| 259 // Smis. If it's not a heap number, then return equal. | 259 // Smis. If it's not a heap number, then return equal. |
| 260 if (cond == lt || cond == gt) { | 260 if (cond == lt || cond == gt) { |
| 261 Label not_simd; | |
| 262 // Call runtime on identical JSObjects. | 261 // Call runtime on identical JSObjects. |
| 263 __ CompareObjectType(r3, r7, r7, FIRST_SPEC_OBJECT_TYPE); | 262 __ CompareObjectType(r3, r7, r7, FIRST_SPEC_OBJECT_TYPE); |
| 264 __ bge(slow); | 263 __ bge(slow); |
| 265 // Call runtime on identical symbols since we need to throw a TypeError. | 264 // Call runtime on identical symbols since we need to throw a TypeError. |
| 266 __ cmpi(r7, Operand(SYMBOL_TYPE)); | 265 __ cmpi(r7, Operand(SYMBOL_TYPE)); |
| 267 __ beq(slow); | 266 __ beq(slow); |
| 268 // Call runtime on identical SIMD values since we must throw a TypeError. | 267 // Call runtime on identical SIMD values since we must throw a TypeError. |
| 269 __ cmpi(r7, Operand(FIRST_SIMD_VALUE_TYPE)); | 268 __ cmpi(r7, Operand(SIMD128_VALUE_TYPE)); |
| 270 __ blt(¬_simd); | 269 __ beq(slow); |
| 271 __ cmpi(r7, Operand(LAST_SIMD_VALUE_TYPE)); | |
| 272 __ ble(slow); | |
| 273 __ bind(¬_simd); | |
| 274 if (is_strong(strength)) { | 270 if (is_strong(strength)) { |
| 275 // Call the runtime on anything that is converted in the semantics, since | 271 // Call the runtime on anything that is converted in the semantics, since |
| 276 // we need to throw a TypeError. Smis have already been ruled out. | 272 // we need to throw a TypeError. Smis have already been ruled out. |
| 277 __ cmpi(r7, Operand(HEAP_NUMBER_TYPE)); | 273 __ cmpi(r7, Operand(HEAP_NUMBER_TYPE)); |
| 278 __ beq(&return_equal); | 274 __ beq(&return_equal); |
| 279 __ andi(r0, r7, Operand(kIsNotStringMask)); | 275 __ andi(r0, r7, Operand(kIsNotStringMask)); |
| 280 __ bne(slow, cr0); | 276 __ bne(slow, cr0); |
| 281 } | 277 } |
| 282 } else { | 278 } else { |
| 283 __ CompareObjectType(r3, r7, r7, HEAP_NUMBER_TYPE); | 279 __ CompareObjectType(r3, r7, r7, HEAP_NUMBER_TYPE); |
| 284 __ beq(&heap_number); | 280 __ beq(&heap_number); |
| 285 // Comparing JS objects with <=, >= is complicated. | 281 // Comparing JS objects with <=, >= is complicated. |
| 286 if (cond != eq) { | 282 if (cond != eq) { |
| 287 Label not_simd; | |
| 288 __ cmpi(r7, Operand(FIRST_SPEC_OBJECT_TYPE)); | 283 __ cmpi(r7, Operand(FIRST_SPEC_OBJECT_TYPE)); |
| 289 __ bge(slow); | 284 __ bge(slow); |
| 290 // Call runtime on identical symbols since we need to throw a TypeError. | 285 // Call runtime on identical symbols since we need to throw a TypeError. |
| 291 __ cmpi(r7, Operand(SYMBOL_TYPE)); | 286 __ cmpi(r7, Operand(SYMBOL_TYPE)); |
| 292 __ beq(slow); | 287 __ beq(slow); |
| 293 // Call runtime on identical SIMD values since we must throw a TypeError. | 288 // Call runtime on identical SIMD values since we must throw a TypeError. |
| 294 __ cmpi(r7, Operand(FIRST_SIMD_VALUE_TYPE)); | 289 __ cmpi(r7, Operand(SIMD128_VALUE_TYPE)); |
| 295 __ blt(¬_simd); | 290 __ beq(slow); |
| 296 __ cmpi(r7, Operand(LAST_SIMD_VALUE_TYPE)); | |
| 297 __ ble(slow); | |
| 298 __ bind(¬_simd); | |
| 299 if (is_strong(strength)) { | 291 if (is_strong(strength)) { |
| 300 // Call the runtime on anything that is converted in the semantics, | 292 // Call the runtime on anything that is converted in the semantics, |
| 301 // since we need to throw a TypeError. Smis and heap numbers have | 293 // since we need to throw a TypeError. Smis and heap numbers have |
| 302 // already been ruled out. | 294 // already been ruled out. |
| 303 __ andi(r0, r7, Operand(kIsNotStringMask)); | 295 __ andi(r0, r7, Operand(kIsNotStringMask)); |
| 304 __ bne(slow, cr0); | 296 __ bne(slow, cr0); |
| 305 } | 297 } |
| 306 // Normally here we fall through to return_equal, but undefined is | 298 // Normally here we fall through to return_equal, but undefined is |
| 307 // special: (undefined == undefined) == true, but | 299 // special: (undefined == undefined) == true, but |
| 308 // (undefined <= undefined) == false! See ECMAScript 11.8.5. | 300 // (undefined <= undefined) == false! See ECMAScript 11.8.5. |
| (...skipping 4464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4773 __ bne(¬_array); | 4765 __ bne(¬_array); |
| 4774 HandleArrayCases(masm, receiver, name, vector, slot, feedback, receiver_map, | 4766 HandleArrayCases(masm, receiver, name, vector, slot, feedback, receiver_map, |
| 4775 scratch1, r10, true, &miss); | 4767 scratch1, r10, true, &miss); |
| 4776 | 4768 |
| 4777 __ bind(¬_array); | 4769 __ bind(¬_array); |
| 4778 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex); | 4770 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex); |
| 4779 __ bne(&miss); | 4771 __ bne(&miss); |
| 4780 Code::Flags code_flags = Code::RemoveTypeAndHolderFromFlags( | 4772 Code::Flags code_flags = Code::RemoveTypeAndHolderFromFlags( |
| 4781 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 4773 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
| 4782 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::LOAD_IC, code_flags, | 4774 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::LOAD_IC, code_flags, |
| 4783 false, receiver, name, feedback, | 4775 receiver, name, feedback, |
| 4784 receiver_map, scratch1, r10); | 4776 receiver_map, scratch1, r10); |
| 4785 | 4777 |
| 4786 __ bind(&miss); | 4778 __ bind(&miss); |
| 4787 LoadIC::GenerateMiss(masm); | 4779 LoadIC::GenerateMiss(masm); |
| 4788 | 4780 |
| 4789 __ bind(&load_smi_map); | 4781 __ bind(&load_smi_map); |
| 4790 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); | 4782 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); |
| 4791 __ b(&compare_map); | 4783 __ b(&compare_map); |
| 4792 } | 4784 } |
| 4793 | 4785 |
| (...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5833 kStackUnwindSpace, NULL, | 5825 kStackUnwindSpace, NULL, |
| 5834 MemOperand(fp, 6 * kPointerSize), NULL); | 5826 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5835 } | 5827 } |
| 5836 | 5828 |
| 5837 | 5829 |
| 5838 #undef __ | 5830 #undef __ |
| 5839 } // namespace internal | 5831 } // namespace internal |
| 5840 } // namespace v8 | 5832 } // namespace v8 |
| 5841 | 5833 |
| 5842 #endif // V8_TARGET_ARCH_PPC | 5834 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |