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