| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
| 8 | 8 |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 __ Branch(¬_identical, ne, a0, Operand(a1)); | 280 __ Branch(¬_identical, ne, a0, Operand(a1)); |
| 281 | 281 |
| 282 __ li(exp_mask_reg, Operand(HeapNumber::kExponentMask)); | 282 __ li(exp_mask_reg, Operand(HeapNumber::kExponentMask)); |
| 283 | 283 |
| 284 // Test for NaN. Sadly, we can't just compare to Factory::nan_value(), | 284 // Test for NaN. Sadly, we can't just compare to Factory::nan_value(), |
| 285 // so we do the second best thing - test it ourselves. | 285 // so we do the second best thing - test it ourselves. |
| 286 // They are both equal and they are not both Smis so both of them are not | 286 // They are both equal and they are not both Smis so both of them are not |
| 287 // Smis. If it's not a heap number, then return equal. | 287 // Smis. If it's not a heap number, then return equal. |
| 288 __ GetObjectType(a0, t0, t0); | 288 __ GetObjectType(a0, t0, t0); |
| 289 if (cc == less || cc == greater) { | 289 if (cc == less || cc == greater) { |
| 290 Label not_simd; |
| 290 // Call runtime on identical JSObjects. | 291 // Call runtime on identical JSObjects. |
| 291 __ Branch(slow, greater, t0, Operand(FIRST_SPEC_OBJECT_TYPE)); | 292 __ Branch(slow, greater, t0, Operand(FIRST_SPEC_OBJECT_TYPE)); |
| 292 // Call runtime on identical symbols since we need to throw a TypeError. | 293 // Call runtime on identical symbols since we need to throw a TypeError. |
| 293 __ Branch(slow, eq, t0, Operand(SYMBOL_TYPE)); | 294 __ Branch(slow, eq, t0, Operand(SYMBOL_TYPE)); |
| 294 // 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. |
| 295 __ Branch(slow, eq, t0, Operand(FLOAT32X4_TYPE)); | 296 __ Branch(¬_simd, lt, t0, Operand(FIRST_SIMD_VALUE_TYPE)); |
| 297 __ Branch(slow, le, t0, Operand(LAST_SIMD_VALUE_TYPE)); |
| 298 __ bind(¬_simd); |
| 296 if (is_strong(strength)) { | 299 if (is_strong(strength)) { |
| 297 // Call the runtime on anything that is converted in the semantics, since | 300 // Call the runtime on anything that is converted in the semantics, since |
| 298 // we need to throw a TypeError. Smis have already been ruled out. | 301 // we need to throw a TypeError. Smis have already been ruled out. |
| 299 __ Branch(&return_equal, eq, t0, Operand(HEAP_NUMBER_TYPE)); | 302 __ Branch(&return_equal, eq, t0, Operand(HEAP_NUMBER_TYPE)); |
| 300 __ And(t0, t0, Operand(kIsNotStringMask)); | 303 __ And(t0, t0, Operand(kIsNotStringMask)); |
| 301 __ Branch(slow, ne, t0, Operand(zero_reg)); | 304 __ Branch(slow, ne, t0, Operand(zero_reg)); |
| 302 } | 305 } |
| 303 } else { | 306 } else { |
| 304 __ Branch(&heap_number, eq, t0, Operand(HEAP_NUMBER_TYPE)); | 307 __ Branch(&heap_number, eq, t0, Operand(HEAP_NUMBER_TYPE)); |
| 305 // Comparing JS objects with <=, >= is complicated. | 308 // Comparing JS objects with <=, >= is complicated. |
| 306 if (cc != eq) { | 309 if (cc != eq) { |
| 307 __ Branch(slow, greater, t0, Operand(FIRST_SPEC_OBJECT_TYPE)); | 310 Label not_simd; |
| 308 // Call runtime on identical symbols since we need to throw a TypeError. | 311 __ Branch(slow, greater, t0, Operand(FIRST_SPEC_OBJECT_TYPE)); |
| 309 __ Branch(slow, eq, t0, Operand(SYMBOL_TYPE)); | 312 // Call runtime on identical symbols since we need to throw a TypeError. |
| 310 // Call runtime on identical SIMD values since we must throw a TypeError. | 313 __ Branch(slow, eq, t0, Operand(SYMBOL_TYPE)); |
| 311 __ Branch(slow, eq, t0, Operand(FLOAT32X4_TYPE)); | 314 // Call runtime on identical SIMD values since we must throw a TypeError. |
| 312 if (is_strong(strength)) { | 315 __ Branch(¬_simd, lt, t0, Operand(FIRST_SIMD_VALUE_TYPE)); |
| 313 // Call the runtime on anything that is converted in the semantics, | 316 __ Branch(slow, le, t0, Operand(LAST_SIMD_VALUE_TYPE)); |
| 314 // since we need to throw a TypeError. Smis and heap numbers have | 317 __ bind(¬_simd); |
| 315 // already been ruled out. | 318 if (is_strong(strength)) { |
| 316 __ And(t0, t0, Operand(kIsNotStringMask)); | 319 // Call the runtime on anything that is converted in the semantics, |
| 317 __ Branch(slow, ne, t0, Operand(zero_reg)); | 320 // since we need to throw a TypeError. Smis and heap numbers have |
| 318 } | 321 // already been ruled out. |
| 322 __ And(t0, t0, Operand(kIsNotStringMask)); |
| 323 __ Branch(slow, ne, t0, Operand(zero_reg)); |
| 324 } |
| 319 // Normally here we fall through to return_equal, but undefined is | 325 // Normally here we fall through to return_equal, but undefined is |
| 320 // special: (undefined == undefined) == true, but | 326 // special: (undefined == undefined) == true, but |
| 321 // (undefined <= undefined) == false! See ECMAScript 11.8.5. | 327 // (undefined <= undefined) == false! See ECMAScript 11.8.5. |
| 322 if (cc == less_equal || cc == greater_equal) { | 328 if (cc == less_equal || cc == greater_equal) { |
| 323 __ Branch(&return_equal, ne, t0, Operand(ODDBALL_TYPE)); | 329 __ Branch(&return_equal, ne, t0, Operand(ODDBALL_TYPE)); |
| 324 __ LoadRoot(a6, Heap::kUndefinedValueRootIndex); | 330 __ LoadRoot(a6, Heap::kUndefinedValueRootIndex); |
| 325 __ Branch(&return_equal, ne, a0, Operand(a6)); | 331 __ Branch(&return_equal, ne, a0, Operand(a6)); |
| 326 DCHECK(is_int16(GREATER) && is_int16(LESS)); | 332 DCHECK(is_int16(GREATER) && is_int16(LESS)); |
| 327 __ Ret(USE_DELAY_SLOT); | 333 __ Ret(USE_DELAY_SLOT); |
| 328 if (cc == le) { | 334 if (cc == le) { |
| (...skipping 5423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5752 MemOperand(fp, 6 * kPointerSize), NULL); | 5758 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5753 } | 5759 } |
| 5754 | 5760 |
| 5755 | 5761 |
| 5756 #undef __ | 5762 #undef __ |
| 5757 | 5763 |
| 5758 } // namespace internal | 5764 } // namespace internal |
| 5759 } // namespace v8 | 5765 } // namespace v8 |
| 5760 | 5766 |
| 5761 #endif // V8_TARGET_ARCH_MIPS64 | 5767 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |