| 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 | 214 |
| 215 __ Cmp(right, left); | 215 __ Cmp(right, left); |
| 216 __ B(ne, ¬_identical); | 216 __ B(ne, ¬_identical); |
| 217 | 217 |
| 218 // Test for NaN. Sadly, we can't just compare to factory::nan_value(), | 218 // Test for NaN. Sadly, we can't just compare to factory::nan_value(), |
| 219 // so we do the second best thing - test it ourselves. | 219 // so we do the second best thing - test it ourselves. |
| 220 // They are both equal and they are not both Smis so both of them are not | 220 // They are both equal and they are not both Smis so both of them are not |
| 221 // Smis. If it's not a heap number, then return equal. | 221 // Smis. If it's not a heap number, then return equal. |
| 222 Register right_type = scratch; | 222 Register right_type = scratch; |
| 223 if ((cond == lt) || (cond == gt)) { | 223 if ((cond == lt) || (cond == gt)) { |
| 224 Label not_simd; | |
| 225 // Call runtime on identical JSObjects. Otherwise return equal. | 224 // Call runtime on identical JSObjects. Otherwise return equal. |
| 226 __ JumpIfObjectType(right, right_type, right_type, FIRST_SPEC_OBJECT_TYPE, | 225 __ JumpIfObjectType(right, right_type, right_type, FIRST_SPEC_OBJECT_TYPE, |
| 227 slow, ge); | 226 slow, ge); |
| 228 // Call runtime on identical symbols since we need to throw a TypeError. | 227 // Call runtime on identical symbols since we need to throw a TypeError. |
| 229 __ Cmp(right_type, SYMBOL_TYPE); | 228 __ Cmp(right_type, SYMBOL_TYPE); |
| 230 __ B(eq, slow); | 229 __ B(eq, slow); |
| 231 // Call runtime on identical SIMD values since we must throw a TypeError. | 230 // Call runtime on identical SIMD values since we must throw a TypeError. |
| 232 __ Cmp(right_type, FIRST_SIMD_VALUE_TYPE); | 231 __ Cmp(right_type, SIMD128_VALUE_TYPE); |
| 233 __ B(lt, ¬_simd); | 232 __ B(eq, slow); |
| 234 __ Cmp(right_type, LAST_SIMD_VALUE_TYPE); | |
| 235 __ B(le, slow); | |
| 236 __ Bind(¬_simd); | |
| 237 if (is_strong(strength)) { | 233 if (is_strong(strength)) { |
| 238 // Call the runtime on anything that is converted in the semantics, since | 234 // Call the runtime on anything that is converted in the semantics, since |
| 239 // we need to throw a TypeError. Smis have already been ruled out. | 235 // we need to throw a TypeError. Smis have already been ruled out. |
| 240 __ Cmp(right_type, Operand(HEAP_NUMBER_TYPE)); | 236 __ Cmp(right_type, Operand(HEAP_NUMBER_TYPE)); |
| 241 __ B(eq, &return_equal); | 237 __ B(eq, &return_equal); |
| 242 __ Tst(right_type, Operand(kIsNotStringMask)); | 238 __ Tst(right_type, Operand(kIsNotStringMask)); |
| 243 __ B(ne, slow); | 239 __ B(ne, slow); |
| 244 } | 240 } |
| 245 } else if (cond == eq) { | 241 } else if (cond == eq) { |
| 246 __ JumpIfHeapNumber(right, &heap_number); | 242 __ JumpIfHeapNumber(right, &heap_number); |
| 247 } else { | 243 } else { |
| 248 Label not_simd; | |
| 249 __ JumpIfObjectType(right, right_type, right_type, HEAP_NUMBER_TYPE, | 244 __ JumpIfObjectType(right, right_type, right_type, HEAP_NUMBER_TYPE, |
| 250 &heap_number); | 245 &heap_number); |
| 251 // Comparing JS objects with <=, >= is complicated. | 246 // Comparing JS objects with <=, >= is complicated. |
| 252 __ Cmp(right_type, FIRST_SPEC_OBJECT_TYPE); | 247 __ Cmp(right_type, FIRST_SPEC_OBJECT_TYPE); |
| 253 __ B(ge, slow); | 248 __ B(ge, slow); |
| 254 // Call runtime on identical symbols since we need to throw a TypeError. | 249 // Call runtime on identical symbols since we need to throw a TypeError. |
| 255 __ Cmp(right_type, SYMBOL_TYPE); | 250 __ Cmp(right_type, SYMBOL_TYPE); |
| 256 __ B(eq, slow); | 251 __ B(eq, slow); |
| 257 // Call runtime on identical SIMD values since we must throw a TypeError. | 252 // Call runtime on identical SIMD values since we must throw a TypeError. |
| 258 __ Cmp(right_type, FIRST_SIMD_VALUE_TYPE); | 253 __ Cmp(right_type, SIMD128_VALUE_TYPE); |
| 259 __ B(lt, ¬_simd); | 254 __ B(eq, slow); |
| 260 __ Cmp(right_type, LAST_SIMD_VALUE_TYPE); | |
| 261 __ B(le, slow); | |
| 262 __ Bind(¬_simd); | |
| 263 if (is_strong(strength)) { | 255 if (is_strong(strength)) { |
| 264 // Call the runtime on anything that is converted in the semantics, | 256 // Call the runtime on anything that is converted in the semantics, |
| 265 // since we need to throw a TypeError. Smis and heap numbers have | 257 // since we need to throw a TypeError. Smis and heap numbers have |
| 266 // already been ruled out. | 258 // already been ruled out. |
| 267 __ Tst(right_type, Operand(kIsNotStringMask)); | 259 __ Tst(right_type, Operand(kIsNotStringMask)); |
| 268 __ B(ne, slow); | 260 __ B(ne, slow); |
| 269 } | 261 } |
| 270 // Normally here we fall through to return_equal, but undefined is | 262 // Normally here we fall through to return_equal, but undefined is |
| 271 // special: (undefined == undefined) == true, but | 263 // special: (undefined == undefined) == true, but |
| 272 // (undefined <= undefined) == false! See ECMAScript 11.8.5. | 264 // (undefined <= undefined) == false! See ECMAScript 11.8.5. |
| (...skipping 5724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5997 MemOperand(fp, 6 * kPointerSize), NULL); | 5989 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5998 } | 5990 } |
| 5999 | 5991 |
| 6000 | 5992 |
| 6001 #undef __ | 5993 #undef __ |
| 6002 | 5994 |
| 6003 } // namespace internal | 5995 } // namespace internal |
| 6004 } // namespace v8 | 5996 } // namespace v8 |
| 6005 | 5997 |
| 6006 #endif // V8_TARGET_ARCH_ARM64 | 5998 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |