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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 Register exp_mask_reg = t5; | 284 Register exp_mask_reg = t5; |
285 | 285 |
286 __ Branch(¬_identical, ne, a0, Operand(a1)); | 286 __ Branch(¬_identical, ne, a0, Operand(a1)); |
287 | 287 |
288 __ li(exp_mask_reg, Operand(HeapNumber::kExponentMask)); | 288 __ li(exp_mask_reg, Operand(HeapNumber::kExponentMask)); |
289 | 289 |
290 // Test for NaN. Sadly, we can't just compare to Factory::nan_value(), | 290 // Test for NaN. Sadly, we can't just compare to Factory::nan_value(), |
291 // so we do the second best thing - test it ourselves. | 291 // so we do the second best thing - test it ourselves. |
292 // They are both equal and they are not both Smis so both of them are not | 292 // They are both equal and they are not both Smis so both of them are not |
293 // Smis. If it's not a heap number, then return equal. | 293 // Smis. If it's not a heap number, then return equal. |
| 294 __ GetObjectType(a0, t4, t4); |
294 if (cc == less || cc == greater) { | 295 if (cc == less || cc == greater) { |
295 __ GetObjectType(a0, t4, t4); | |
296 __ Branch(slow, greater, t4, Operand(FIRST_SPEC_OBJECT_TYPE)); | 296 __ Branch(slow, greater, t4, Operand(FIRST_SPEC_OBJECT_TYPE)); |
297 __ Branch(slow, eq, t4, Operand(SYMBOL_TYPE)); | 297 __ Branch(slow, eq, t4, Operand(SYMBOL_TYPE)); |
298 } else { | 298 } else { |
299 __ GetObjectType(a0, t4, t4); | |
300 __ Branch(&heap_number, eq, t4, Operand(HEAP_NUMBER_TYPE)); | 299 __ Branch(&heap_number, eq, t4, Operand(HEAP_NUMBER_TYPE)); |
301 // Comparing JS objects with <=, >= is complicated. | 300 // Comparing JS objects with <=, >= is complicated. |
302 if (cc != eq) { | 301 if (cc != eq) { |
303 __ Branch(slow, greater, t4, Operand(FIRST_SPEC_OBJECT_TYPE)); | 302 __ Branch(slow, greater, t4, Operand(FIRST_SPEC_OBJECT_TYPE)); |
| 303 __ Branch(slow, eq, t4, Operand(SYMBOL_TYPE)); |
304 // Normally here we fall through to return_equal, but undefined is | 304 // Normally here we fall through to return_equal, but undefined is |
305 // special: (undefined == undefined) == true, but | 305 // special: (undefined == undefined) == true, but |
306 // (undefined <= undefined) == false! See ECMAScript 11.8.5. | 306 // (undefined <= undefined) == false! See ECMAScript 11.8.5. |
307 if (cc == less_equal || cc == greater_equal) { | 307 if (cc == less_equal || cc == greater_equal) { |
308 __ Branch(&return_equal, ne, t4, Operand(ODDBALL_TYPE)); | 308 __ Branch(&return_equal, ne, t4, Operand(ODDBALL_TYPE)); |
309 __ LoadRoot(t2, Heap::kUndefinedValueRootIndex); | 309 __ LoadRoot(t2, Heap::kUndefinedValueRootIndex); |
310 __ Branch(&return_equal, ne, a0, Operand(t2)); | 310 __ Branch(&return_equal, ne, a0, Operand(t2)); |
311 DCHECK(is_int16(GREATER) && is_int16(LESS)); | 311 DCHECK(is_int16(GREATER) && is_int16(LESS)); |
312 __ Ret(USE_DELAY_SLOT); | 312 __ Ret(USE_DELAY_SLOT); |
313 if (cc == le) { | 313 if (cc == le) { |
(...skipping 5185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5499 kStackUnwindSpace, kInvalidStackOffset, | 5499 kStackUnwindSpace, kInvalidStackOffset, |
5500 MemOperand(fp, 6 * kPointerSize), NULL); | 5500 MemOperand(fp, 6 * kPointerSize), NULL); |
5501 } | 5501 } |
5502 | 5502 |
5503 | 5503 |
5504 #undef __ | 5504 #undef __ |
5505 | 5505 |
5506 } } // namespace v8::internal | 5506 } } // namespace v8::internal |
5507 | 5507 |
5508 #endif // V8_TARGET_ARCH_MIPS | 5508 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |