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 #include "src/arm64/lithium-codegen-arm64.h" | 7 #include "src/arm64/lithium-codegen-arm64.h" |
8 #include "src/arm64/lithium-gap-resolver-arm64.h" | 8 #include "src/arm64/lithium-gap-resolver-arm64.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 1915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1926 } | 1926 } |
1927 | 1927 |
1928 if (expected.Contains(ToBooleanStub::SYMBOL)) { | 1928 if (expected.Contains(ToBooleanStub::SYMBOL)) { |
1929 // Symbol value -> true. | 1929 // Symbol value -> true. |
1930 __ CompareInstanceType(map, scratch, SYMBOL_TYPE); | 1930 __ CompareInstanceType(map, scratch, SYMBOL_TYPE); |
1931 __ B(eq, true_label); | 1931 __ B(eq, true_label); |
1932 } | 1932 } |
1933 | 1933 |
1934 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { | 1934 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { |
1935 // SIMD value -> true. | 1935 // SIMD value -> true. |
1936 Label not_simd; | 1936 __ CompareInstanceType(map, scratch, SIMD128_VALUE_TYPE); |
1937 __ CompareInstanceType(map, scratch, FIRST_SIMD_VALUE_TYPE); | 1937 __ B(eq, true_label); |
1938 __ B(lt, ¬_simd); | |
1939 __ CompareInstanceType(map, scratch, LAST_SIMD_VALUE_TYPE); | |
1940 __ B(le, true_label); | |
1941 __ Bind(¬_simd); | |
1942 } | 1938 } |
1943 | 1939 |
1944 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 1940 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
1945 Label not_heap_number; | 1941 Label not_heap_number; |
1946 __ JumpIfNotRoot(map, Heap::kHeapNumberMapRootIndex, ¬_heap_number); | 1942 __ JumpIfNotRoot(map, Heap::kHeapNumberMapRootIndex, ¬_heap_number); |
1947 | 1943 |
1948 __ Ldr(double_scratch(), | 1944 __ Ldr(double_scratch(), |
1949 FieldMemOperand(value, HeapNumber::kValueOffset)); | 1945 FieldMemOperand(value, HeapNumber::kValueOffset)); |
1950 __ Fcmp(double_scratch(), 0.0); | 1946 __ Fcmp(double_scratch(), 0.0); |
1951 // If we got a NaN (overflow bit is set), jump to the false branch. | 1947 // If we got a NaN (overflow bit is set), jump to the false branch. |
(...skipping 4038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5990 __ JumpIfSmi(value, false_label); | 5986 __ JumpIfSmi(value, false_label); |
5991 __ JumpIfRoot(value, Heap::kNullValueRootIndex, true_label); | 5987 __ JumpIfRoot(value, Heap::kNullValueRootIndex, true_label); |
5992 __ JumpIfObjectType(value, map, scratch, | 5988 __ JumpIfObjectType(value, map, scratch, |
5993 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, false_label, lt); | 5989 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, false_label, lt); |
5994 __ CompareInstanceType(map, scratch, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5990 __ CompareInstanceType(map, scratch, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
5995 __ B(gt, false_label); | 5991 __ B(gt, false_label); |
5996 // Check for undetectable objects => false. | 5992 // Check for undetectable objects => false. |
5997 __ Ldrb(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); | 5993 __ Ldrb(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); |
5998 EmitTestAndBranch(instr, eq, scratch, 1 << Map::kIsUndetectable); | 5994 EmitTestAndBranch(instr, eq, scratch, 1 << Map::kIsUndetectable); |
5999 | 5995 |
6000 } else if (String::Equals(type_name, factory->float32x4_string())) { | 5996 // clang-format off |
6001 DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); | 5997 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
6002 Register map = ToRegister(instr->temp1()); | 5998 } else if (String::Equals(type_name, factory->type##_string())) { \ |
6003 Register scratch = ToRegister(instr->temp2()); | 5999 DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); \ |
6004 | 6000 Register map = ToRegister(instr->temp1()); \ |
6005 __ JumpIfSmi(value, false_label); | 6001 \ |
6006 __ CompareObjectType(value, map, scratch, FLOAT32X4_TYPE); | 6002 __ JumpIfSmi(value, false_label); \ |
| 6003 __ Ldr(map, FieldMemOperand(value, HeapObject::kMapOffset)); \ |
| 6004 __ CompareRoot(map, Heap::k##Type##MapRootIndex); \ |
6007 EmitBranch(instr, eq); | 6005 EmitBranch(instr, eq); |
6008 | 6006 SIMD128_TYPES(SIMD128_TYPE) |
6009 } else if (String::Equals(type_name, factory->int32x4_string())) { | 6007 #undef SIMD128_TYPE |
6010 DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); | 6008 // clang-format on |
6011 Register map = ToRegister(instr->temp1()); | |
6012 Register scratch = ToRegister(instr->temp2()); | |
6013 | |
6014 __ JumpIfSmi(value, false_label); | |
6015 __ CompareObjectType(value, map, scratch, INT32X4_TYPE); | |
6016 EmitBranch(instr, eq); | |
6017 | |
6018 } else if (String::Equals(type_name, factory->bool32x4_string())) { | |
6019 DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); | |
6020 Register map = ToRegister(instr->temp1()); | |
6021 Register scratch = ToRegister(instr->temp2()); | |
6022 | |
6023 __ JumpIfSmi(value, false_label); | |
6024 __ CompareObjectType(value, map, scratch, BOOL32X4_TYPE); | |
6025 EmitBranch(instr, eq); | |
6026 | |
6027 } else if (String::Equals(type_name, factory->int16x8_string())) { | |
6028 DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); | |
6029 Register map = ToRegister(instr->temp1()); | |
6030 Register scratch = ToRegister(instr->temp2()); | |
6031 | |
6032 __ JumpIfSmi(value, false_label); | |
6033 __ CompareObjectType(value, map, scratch, INT16X8_TYPE); | |
6034 EmitBranch(instr, eq); | |
6035 | |
6036 } else if (String::Equals(type_name, factory->bool16x8_string())) { | |
6037 DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); | |
6038 Register map = ToRegister(instr->temp1()); | |
6039 Register scratch = ToRegister(instr->temp2()); | |
6040 | |
6041 __ JumpIfSmi(value, false_label); | |
6042 __ CompareObjectType(value, map, scratch, BOOL16X8_TYPE); | |
6043 EmitBranch(instr, eq); | |
6044 | |
6045 } else if (String::Equals(type_name, factory->int8x16_string())) { | |
6046 DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); | |
6047 Register map = ToRegister(instr->temp1()); | |
6048 Register scratch = ToRegister(instr->temp2()); | |
6049 | |
6050 __ JumpIfSmi(value, false_label); | |
6051 __ CompareObjectType(value, map, scratch, INT8X16_TYPE); | |
6052 EmitBranch(instr, eq); | |
6053 | |
6054 } else if (String::Equals(type_name, factory->bool8x16_string())) { | |
6055 DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); | |
6056 Register map = ToRegister(instr->temp1()); | |
6057 Register scratch = ToRegister(instr->temp2()); | |
6058 | |
6059 __ JumpIfSmi(value, false_label); | |
6060 __ CompareObjectType(value, map, scratch, BOOL8X16_TYPE); | |
6061 EmitBranch(instr, eq); | |
6062 | 6009 |
6063 } else { | 6010 } else { |
6064 __ B(false_label); | 6011 __ B(false_label); |
6065 } | 6012 } |
6066 } | 6013 } |
6067 | 6014 |
6068 | 6015 |
6069 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { | 6016 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { |
6070 __ Ucvtf(ToDoubleRegister(instr->result()), ToRegister32(instr->value())); | 6017 __ Ucvtf(ToDoubleRegister(instr->result()), ToRegister32(instr->value())); |
6071 } | 6018 } |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6214 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6161 Handle<ScopeInfo> scope_info = instr->scope_info(); |
6215 __ Push(scope_info); | 6162 __ Push(scope_info); |
6216 __ Push(ToRegister(instr->function())); | 6163 __ Push(ToRegister(instr->function())); |
6217 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6164 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6218 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6165 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6219 } | 6166 } |
6220 | 6167 |
6221 | 6168 |
6222 } // namespace internal | 6169 } // namespace internal |
6223 } // namespace v8 | 6170 } // namespace v8 |
OLD | NEW |