| 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 #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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 Label not_identical; | 253 Label not_identical; |
| 254 Label heap_number, return_equal; | 254 Label heap_number, return_equal; |
| 255 __ cmp(r3, r4); | 255 __ cmp(r3, r4); |
| 256 __ bne(¬_identical); | 256 __ bne(¬_identical); |
| 257 | 257 |
| 258 // Test for NaN. Sadly, we can't just compare to Factory::nan_value(), | 258 // Test for NaN. Sadly, we can't just compare to Factory::nan_value(), |
| 259 // so we do the second best thing - test it ourselves. | 259 // so we do the second best thing - test it ourselves. |
| 260 // They are both equal and they are not both Smis so both of them are not | 260 // They are both equal and they are not both Smis so both of them are not |
| 261 // Smis. If it's not a heap number, then return equal. | 261 // Smis. If it's not a heap number, then return equal. |
| 262 if (cond == lt || cond == gt) { | 262 if (cond == lt || cond == gt) { |
| 263 Label not_simd; |
| 263 // Call runtime on identical JSObjects. | 264 // Call runtime on identical JSObjects. |
| 264 __ CompareObjectType(r3, r7, r7, FIRST_SPEC_OBJECT_TYPE); | 265 __ CompareObjectType(r3, r7, r7, FIRST_SPEC_OBJECT_TYPE); |
| 265 __ bge(slow); | 266 __ bge(slow); |
| 266 // Call runtime on identical symbols since we need to throw a TypeError. | 267 // Call runtime on identical symbols since we need to throw a TypeError. |
| 267 __ cmpi(r7, Operand(SYMBOL_TYPE)); | 268 __ cmpi(r7, Operand(SYMBOL_TYPE)); |
| 268 __ beq(slow); | 269 __ beq(slow); |
| 269 // Call runtime on identical SIMD values since we must throw a TypeError. | 270 // Call runtime on identical SIMD values since we must throw a TypeError. |
| 270 __ cmpi(r7, Operand(FLOAT32X4_TYPE)); | 271 __ cmpi(r7, Operand(FIRST_SIMD_VALUE_TYPE)); |
| 271 __ beq(slow); | 272 __ blt(¬_simd); |
| 273 __ cmpi(r7, Operand(LAST_SIMD_VALUE_TYPE)); |
| 274 __ ble(slow); |
| 275 __ bind(¬_simd); |
| 272 if (is_strong(strength)) { | 276 if (is_strong(strength)) { |
| 273 // Call the runtime on anything that is converted in the semantics, since | 277 // Call the runtime on anything that is converted in the semantics, since |
| 274 // we need to throw a TypeError. Smis have already been ruled out. | 278 // we need to throw a TypeError. Smis have already been ruled out. |
| 275 __ cmpi(r7, Operand(HEAP_NUMBER_TYPE)); | 279 __ cmpi(r7, Operand(HEAP_NUMBER_TYPE)); |
| 276 __ beq(&return_equal); | 280 __ beq(&return_equal); |
| 277 __ andi(r0, r7, Operand(kIsNotStringMask)); | 281 __ andi(r0, r7, Operand(kIsNotStringMask)); |
| 278 __ bne(slow, cr0); | 282 __ bne(slow, cr0); |
| 279 } | 283 } |
| 280 } else { | 284 } else { |
| 281 __ CompareObjectType(r3, r7, r7, HEAP_NUMBER_TYPE); | 285 __ CompareObjectType(r3, r7, r7, HEAP_NUMBER_TYPE); |
| 282 __ beq(&heap_number); | 286 __ beq(&heap_number); |
| 283 // Comparing JS objects with <=, >= is complicated. | 287 // Comparing JS objects with <=, >= is complicated. |
| 284 if (cond != eq) { | 288 if (cond != eq) { |
| 289 Label not_simd; |
| 285 __ cmpi(r7, Operand(FIRST_SPEC_OBJECT_TYPE)); | 290 __ cmpi(r7, Operand(FIRST_SPEC_OBJECT_TYPE)); |
| 286 __ bge(slow); | 291 __ bge(slow); |
| 287 // Call runtime on identical symbols since we need to throw a TypeError. | 292 // Call runtime on identical symbols since we need to throw a TypeError. |
| 288 __ cmpi(r7, Operand(SYMBOL_TYPE)); | 293 __ cmpi(r7, Operand(SYMBOL_TYPE)); |
| 289 __ beq(slow); | 294 __ beq(slow); |
| 290 // Call runtime on identical SIMD values since we must throw a TypeError. | 295 // Call runtime on identical SIMD values since we must throw a TypeError. |
| 291 __ cmpi(r7, Operand(FLOAT32X4_TYPE)); | 296 __ cmpi(r7, Operand(FIRST_SIMD_VALUE_TYPE)); |
| 292 __ beq(slow); | 297 __ blt(¬_simd); |
| 298 __ cmpi(r7, Operand(LAST_SIMD_VALUE_TYPE)); |
| 299 __ ble(slow); |
| 300 __ bind(¬_simd); |
| 293 if (is_strong(strength)) { | 301 if (is_strong(strength)) { |
| 294 // Call the runtime on anything that is converted in the semantics, | 302 // Call the runtime on anything that is converted in the semantics, |
| 295 // since we need to throw a TypeError. Smis and heap numbers have | 303 // since we need to throw a TypeError. Smis and heap numbers have |
| 296 // already been ruled out. | 304 // already been ruled out. |
| 297 __ andi(r0, r7, Operand(kIsNotStringMask)); | 305 __ andi(r0, r7, Operand(kIsNotStringMask)); |
| 298 __ bne(slow, cr0); | 306 __ bne(slow, cr0); |
| 299 } | 307 } |
| 300 // Normally here we fall through to return_equal, but undefined is | 308 // Normally here we fall through to return_equal, but undefined is |
| 301 // special: (undefined == undefined) == true, but | 309 // special: (undefined == undefined) == true, but |
| 302 // (undefined <= undefined) == false! See ECMAScript 11.8.5. | 310 // (undefined <= undefined) == false! See ECMAScript 11.8.5. |
| (...skipping 5525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5828 kStackUnwindSpace, NULL, | 5836 kStackUnwindSpace, NULL, |
| 5829 MemOperand(fp, 6 * kPointerSize), NULL); | 5837 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5830 } | 5838 } |
| 5831 | 5839 |
| 5832 | 5840 |
| 5833 #undef __ | 5841 #undef __ |
| 5834 } // namespace internal | 5842 } // namespace internal |
| 5835 } // namespace v8 | 5843 } // namespace v8 |
| 5836 | 5844 |
| 5837 #endif // V8_TARGET_ARCH_PPC | 5845 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |