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/crankshaft/arm64/lithium-codegen-arm64.h" | 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1858 __ B(true_label); | 1858 __ B(true_label); |
1859 __ Bind(¬_string); | 1859 __ Bind(¬_string); |
1860 } | 1860 } |
1861 | 1861 |
1862 if (expected & ToBooleanHint::kSymbol) { | 1862 if (expected & ToBooleanHint::kSymbol) { |
1863 // Symbol value -> true. | 1863 // Symbol value -> true. |
1864 __ CompareInstanceType(map, scratch, SYMBOL_TYPE); | 1864 __ CompareInstanceType(map, scratch, SYMBOL_TYPE); |
1865 __ B(eq, true_label); | 1865 __ B(eq, true_label); |
1866 } | 1866 } |
1867 | 1867 |
1868 if (expected & ToBooleanHint::kSimdValue) { | |
1869 // SIMD value -> true. | |
1870 __ CompareInstanceType(map, scratch, SIMD128_VALUE_TYPE); | |
1871 __ B(eq, true_label); | |
1872 } | |
1873 | |
1874 if (expected & ToBooleanHint::kHeapNumber) { | 1868 if (expected & ToBooleanHint::kHeapNumber) { |
1875 Label not_heap_number; | 1869 Label not_heap_number; |
1876 __ JumpIfNotRoot(map, Heap::kHeapNumberMapRootIndex, ¬_heap_number); | 1870 __ JumpIfNotRoot(map, Heap::kHeapNumberMapRootIndex, ¬_heap_number); |
1877 | 1871 |
1878 __ Ldr(double_scratch(), | 1872 __ Ldr(double_scratch(), |
1879 FieldMemOperand(value, HeapNumber::kValueOffset)); | 1873 FieldMemOperand(value, HeapNumber::kValueOffset)); |
1880 __ Fcmp(double_scratch(), 0.0); | 1874 __ Fcmp(double_scratch(), 0.0); |
1881 // If we got a NaN (overflow bit is set), jump to the false branch. | 1875 // If we got a NaN (overflow bit is set), jump to the false branch. |
1882 __ B(vs, false_label); | 1876 __ B(vs, false_label); |
1883 __ B(eq, false_label); | 1877 __ B(eq, false_label); |
(...skipping 3561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5445 __ JumpIfSmi(value, false_label); | 5439 __ JumpIfSmi(value, false_label); |
5446 __ JumpIfRoot(value, Heap::kNullValueRootIndex, true_label); | 5440 __ JumpIfRoot(value, Heap::kNullValueRootIndex, true_label); |
5447 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 5441 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
5448 __ JumpIfObjectType(value, map, scratch, FIRST_JS_RECEIVER_TYPE, | 5442 __ JumpIfObjectType(value, map, scratch, FIRST_JS_RECEIVER_TYPE, |
5449 false_label, lt); | 5443 false_label, lt); |
5450 // Check for callable or undetectable objects => false. | 5444 // Check for callable or undetectable objects => false. |
5451 __ Ldrb(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); | 5445 __ Ldrb(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); |
5452 EmitTestAndBranch(instr, eq, scratch, | 5446 EmitTestAndBranch(instr, eq, scratch, |
5453 (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)); | 5447 (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)); |
5454 | 5448 |
5455 // clang-format off | |
5456 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ | |
5457 } else if (String::Equals(type_name, factory->type##_string())) { \ | |
5458 DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); \ | |
5459 Register map = ToRegister(instr->temp1()); \ | |
5460 \ | |
5461 __ JumpIfSmi(value, false_label); \ | |
5462 __ Ldr(map, FieldMemOperand(value, HeapObject::kMapOffset)); \ | |
5463 __ CompareRoot(map, Heap::k##Type##MapRootIndex); \ | |
5464 EmitBranch(instr, eq); | |
5465 SIMD128_TYPES(SIMD128_TYPE) | |
5466 #undef SIMD128_TYPE | |
5467 // clang-format on | |
5468 | |
5469 } else { | 5449 } else { |
5470 __ B(false_label); | 5450 __ B(false_label); |
5471 } | 5451 } |
5472 } | 5452 } |
5473 | 5453 |
5474 | 5454 |
5475 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { | 5455 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { |
5476 __ Ucvtf(ToDoubleRegister(instr->result()), ToRegister32(instr->value())); | 5456 __ Ucvtf(ToDoubleRegister(instr->result()), ToRegister32(instr->value())); |
5477 } | 5457 } |
5478 | 5458 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5604 // Index is equal to negated out of object property index plus 1. | 5584 // Index is equal to negated out of object property index plus 1. |
5605 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5585 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
5606 __ Ldr(result, FieldMemOperand(result, | 5586 __ Ldr(result, FieldMemOperand(result, |
5607 FixedArray::kHeaderSize - kPointerSize)); | 5587 FixedArray::kHeaderSize - kPointerSize)); |
5608 __ Bind(deferred->exit()); | 5588 __ Bind(deferred->exit()); |
5609 __ Bind(&done); | 5589 __ Bind(&done); |
5610 } | 5590 } |
5611 | 5591 |
5612 } // namespace internal | 5592 } // namespace internal |
5613 } // namespace v8 | 5593 } // namespace v8 |
OLD | NEW |