OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 Label not_identical, return_equal, heap_number; | 214 Label not_identical, return_equal, heap_number; |
215 Register result = x0; | 215 Register result = x0; |
216 | 216 |
217 __ Cmp(right, left); | 217 __ Cmp(right, left); |
218 __ B(ne, ¬_identical); | 218 __ B(ne, ¬_identical); |
219 | 219 |
220 // Test for NaN. Sadly, we can't just compare to factory::nan_value(), | 220 // Test for NaN. Sadly, we can't just compare to factory::nan_value(), |
221 // so we do the second best thing - test it ourselves. | 221 // so we do the second best thing - test it ourselves. |
222 // They are both equal and they are not both Smis so both of them are not | 222 // They are both equal and they are not both Smis so both of them are not |
223 // Smis. If it's not a heap number, then return equal. | 223 // Smis. If it's not a heap number, then return equal. |
| 224 Register right_type = scratch; |
224 if ((cond == lt) || (cond == gt)) { | 225 if ((cond == lt) || (cond == gt)) { |
225 __ JumpIfObjectType(right, scratch, scratch, FIRST_SPEC_OBJECT_TYPE, slow, | 226 __ JumpIfObjectType(right, right_type, right_type, FIRST_SPEC_OBJECT_TYPE, |
226 ge); | 227 slow, ge); |
227 __ JumpIfObjectType(right, scratch, scratch, SYMBOL_TYPE, slow, eq); | 228 __ Cmp(right_type, SYMBOL_TYPE); |
| 229 __ B(eq, slow); |
228 } else if (cond == eq) { | 230 } else if (cond == eq) { |
229 __ JumpIfHeapNumber(right, &heap_number); | 231 __ JumpIfHeapNumber(right, &heap_number); |
230 } else { | 232 } else { |
231 Register right_type = scratch; | |
232 __ JumpIfObjectType(right, right_type, right_type, HEAP_NUMBER_TYPE, | 233 __ JumpIfObjectType(right, right_type, right_type, HEAP_NUMBER_TYPE, |
233 &heap_number); | 234 &heap_number); |
234 // Comparing JS objects with <=, >= is complicated. | 235 // Comparing JS objects with <=, >= is complicated. |
235 __ Cmp(right_type, FIRST_SPEC_OBJECT_TYPE); | 236 __ Cmp(right_type, FIRST_SPEC_OBJECT_TYPE); |
236 __ B(ge, slow); | 237 __ B(ge, slow); |
| 238 __ Cmp(right_type, SYMBOL_TYPE); |
| 239 __ B(eq, slow); |
237 // Normally here we fall through to return_equal, but undefined is | 240 // Normally here we fall through to return_equal, but undefined is |
238 // special: (undefined == undefined) == true, but | 241 // special: (undefined == undefined) == true, but |
239 // (undefined <= undefined) == false! See ECMAScript 11.8.5. | 242 // (undefined <= undefined) == false! See ECMAScript 11.8.5. |
240 if ((cond == le) || (cond == ge)) { | 243 if ((cond == le) || (cond == ge)) { |
241 __ Cmp(right_type, ODDBALL_TYPE); | 244 __ Cmp(right_type, ODDBALL_TYPE); |
242 __ B(ne, &return_equal); | 245 __ B(ne, &return_equal); |
243 __ JumpIfNotRoot(right, Heap::kUndefinedValueRootIndex, &return_equal); | 246 __ JumpIfNotRoot(right, Heap::kUndefinedValueRootIndex, &return_equal); |
244 if (cond == le) { | 247 if (cond == le) { |
245 // undefined <= undefined should fail. | 248 // undefined <= undefined should fail. |
246 __ Mov(result, GREATER); | 249 __ Mov(result, GREATER); |
(...skipping 5510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5757 kStackUnwindSpace, NULL, spill_offset, | 5760 kStackUnwindSpace, NULL, spill_offset, |
5758 MemOperand(fp, 6 * kPointerSize), NULL); | 5761 MemOperand(fp, 6 * kPointerSize), NULL); |
5759 } | 5762 } |
5760 | 5763 |
5761 | 5764 |
5762 #undef __ | 5765 #undef __ |
5763 | 5766 |
5764 } } // namespace v8::internal | 5767 } } // namespace v8::internal |
5765 | 5768 |
5766 #endif // V8_TARGET_ARCH_ARM64 | 5769 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |