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_ARM | 7 #if V8_TARGET_ARCH_ARM |
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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 Label not_identical; | 242 Label not_identical; |
243 Label heap_number, return_equal; | 243 Label heap_number, return_equal; |
244 __ cmp(r0, r1); | 244 __ cmp(r0, r1); |
245 __ b(ne, ¬_identical); | 245 __ b(ne, ¬_identical); |
246 | 246 |
247 // Test for NaN. Sadly, we can't just compare to Factory::nan_value(), | 247 // Test for NaN. Sadly, we can't just compare to Factory::nan_value(), |
248 // so we do the second best thing - test it ourselves. | 248 // so we do the second best thing - test it ourselves. |
249 // They are both equal and they are not both Smis so both of them are not | 249 // They are both equal and they are not both Smis so both of them are not |
250 // Smis. If it's not a heap number, then return equal. | 250 // Smis. If it's not a heap number, then return equal. |
251 if (cond == lt || cond == gt) { | 251 if (cond == lt || cond == gt) { |
252 Label not_simd; | |
253 // Call runtime on identical JSObjects. | 252 // Call runtime on identical JSObjects. |
254 __ CompareObjectType(r0, r4, r4, FIRST_SPEC_OBJECT_TYPE); | 253 __ CompareObjectType(r0, r4, r4, FIRST_SPEC_OBJECT_TYPE); |
255 __ b(ge, slow); | 254 __ b(ge, slow); |
256 // Call runtime on identical symbols since we need to throw a TypeError. | 255 // Call runtime on identical symbols since we need to throw a TypeError. |
257 __ cmp(r4, Operand(SYMBOL_TYPE)); | 256 __ cmp(r4, Operand(SYMBOL_TYPE)); |
258 __ b(eq, slow); | 257 __ b(eq, slow); |
259 // Call runtime on identical SIMD values since we must throw a TypeError. | 258 // Call runtime on identical SIMD values since we must throw a TypeError. |
260 __ cmp(r4, Operand(FIRST_SIMD_VALUE_TYPE)); | 259 __ cmp(r4, Operand(SIMD128_VALUE_TYPE)); |
261 __ b(lt, ¬_simd); | 260 __ b(eq, slow); |
262 __ cmp(r4, Operand(LAST_SIMD_VALUE_TYPE)); | |
263 __ b(le, slow); | |
264 __ bind(¬_simd); | |
265 if (is_strong(strength)) { | 261 if (is_strong(strength)) { |
266 // Call the runtime on anything that is converted in the semantics, since | 262 // Call the runtime on anything that is converted in the semantics, since |
267 // we need to throw a TypeError. Smis have already been ruled out. | 263 // we need to throw a TypeError. Smis have already been ruled out. |
268 __ cmp(r4, Operand(HEAP_NUMBER_TYPE)); | 264 __ cmp(r4, Operand(HEAP_NUMBER_TYPE)); |
269 __ b(eq, &return_equal); | 265 __ b(eq, &return_equal); |
270 __ tst(r4, Operand(kIsNotStringMask)); | 266 __ tst(r4, Operand(kIsNotStringMask)); |
271 __ b(ne, slow); | 267 __ b(ne, slow); |
272 } | 268 } |
273 } else { | 269 } else { |
274 __ CompareObjectType(r0, r4, r4, HEAP_NUMBER_TYPE); | 270 __ CompareObjectType(r0, r4, r4, HEAP_NUMBER_TYPE); |
275 __ b(eq, &heap_number); | 271 __ b(eq, &heap_number); |
276 // Comparing JS objects with <=, >= is complicated. | 272 // Comparing JS objects with <=, >= is complicated. |
277 if (cond != eq) { | 273 if (cond != eq) { |
278 Label not_simd; | |
279 __ cmp(r4, Operand(FIRST_SPEC_OBJECT_TYPE)); | 274 __ cmp(r4, Operand(FIRST_SPEC_OBJECT_TYPE)); |
280 __ b(ge, slow); | 275 __ b(ge, slow); |
281 // Call runtime on identical symbols since we need to throw a TypeError. | 276 // Call runtime on identical symbols since we need to throw a TypeError. |
282 __ cmp(r4, Operand(SYMBOL_TYPE)); | 277 __ cmp(r4, Operand(SYMBOL_TYPE)); |
283 __ b(eq, slow); | 278 __ b(eq, slow); |
284 // Call runtime on identical SIMD values since we must throw a TypeError. | 279 // Call runtime on identical SIMD values since we must throw a TypeError. |
285 __ cmp(r4, Operand(FIRST_SIMD_VALUE_TYPE)); | 280 __ cmp(r4, Operand(SIMD128_VALUE_TYPE)); |
286 __ b(lt, ¬_simd); | 281 __ b(eq, slow); |
287 __ cmp(r4, Operand(LAST_SIMD_VALUE_TYPE)); | |
288 __ b(le, slow); | |
289 __ bind(¬_simd); | |
290 if (is_strong(strength)) { | 282 if (is_strong(strength)) { |
291 // Call the runtime on anything that is converted in the semantics, | 283 // Call the runtime on anything that is converted in the semantics, |
292 // since we need to throw a TypeError. Smis and heap numbers have | 284 // since we need to throw a TypeError. Smis and heap numbers have |
293 // already been ruled out. | 285 // already been ruled out. |
294 __ tst(r4, Operand(kIsNotStringMask)); | 286 __ tst(r4, Operand(kIsNotStringMask)); |
295 __ b(ne, slow); | 287 __ b(ne, slow); |
296 } | 288 } |
297 // Normally here we fall through to return_equal, but undefined is | 289 // Normally here we fall through to return_equal, but undefined is |
298 // special: (undefined == undefined) == true, but | 290 // special: (undefined == undefined) == true, but |
299 // (undefined <= undefined) == false! See ECMAScript 11.8.5. | 291 // (undefined <= undefined) == false! See ECMAScript 11.8.5. |
(...skipping 5234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5534 MemOperand(fp, 6 * kPointerSize), NULL); | 5526 MemOperand(fp, 6 * kPointerSize), NULL); |
5535 } | 5527 } |
5536 | 5528 |
5537 | 5529 |
5538 #undef __ | 5530 #undef __ |
5539 | 5531 |
5540 } // namespace internal | 5532 } // namespace internal |
5541 } // namespace v8 | 5533 } // namespace v8 |
5542 | 5534 |
5543 #endif // V8_TARGET_ARCH_ARM | 5535 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |