| 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 5524 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 |