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 __ CompareInstanceType(map, scratch, FLOAT32X4_TYPE); | 1936 Label not_simd; |
1937 __ B(eq, true_label); | 1937 __ CompareInstanceType(map, scratch, FIRST_SIMD128_VALUE_TYPE); |
| 1938 __ B(lt, ¬_simd); |
| 1939 __ CompareInstanceType(map, scratch, LAST_SIMD128_VALUE_TYPE); |
| 1940 __ B(le, true_label); |
| 1941 __ Bind(¬_simd); |
1938 } | 1942 } |
1939 | 1943 |
1940 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 1944 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
1941 Label not_heap_number; | 1945 Label not_heap_number; |
1942 __ JumpIfNotRoot(map, Heap::kHeapNumberMapRootIndex, ¬_heap_number); | 1946 __ JumpIfNotRoot(map, Heap::kHeapNumberMapRootIndex, ¬_heap_number); |
1943 | 1947 |
1944 __ Ldr(double_scratch(), | 1948 __ Ldr(double_scratch(), |
1945 FieldMemOperand(value, HeapNumber::kValueOffset)); | 1949 FieldMemOperand(value, HeapNumber::kValueOffset)); |
1946 __ Fcmp(double_scratch(), 0.0); | 1950 __ Fcmp(double_scratch(), 0.0); |
1947 // If we got a NaN (overflow bit is set), jump to the false branch. | 1951 // If we got a NaN (overflow bit is set), jump to the false branch. |
(...skipping 4047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5995 | 5999 |
5996 } else if (String::Equals(type_name, factory->float32x4_string())) { | 6000 } else if (String::Equals(type_name, factory->float32x4_string())) { |
5997 DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); | 6001 DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); |
5998 Register map = ToRegister(instr->temp1()); | 6002 Register map = ToRegister(instr->temp1()); |
5999 Register scratch = ToRegister(instr->temp2()); | 6003 Register scratch = ToRegister(instr->temp2()); |
6000 | 6004 |
6001 __ JumpIfSmi(value, false_label); | 6005 __ JumpIfSmi(value, false_label); |
6002 __ CompareObjectType(value, map, scratch, FLOAT32X4_TYPE); | 6006 __ CompareObjectType(value, map, scratch, FLOAT32X4_TYPE); |
6003 EmitBranch(instr, eq); | 6007 EmitBranch(instr, eq); |
6004 | 6008 |
| 6009 } else if (String::Equals(type_name, factory->int32x4_string())) { |
| 6010 DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); |
| 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 |
6005 } else { | 6063 } else { |
6006 __ B(false_label); | 6064 __ B(false_label); |
6007 } | 6065 } |
6008 } | 6066 } |
6009 | 6067 |
6010 | 6068 |
6011 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { | 6069 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { |
6012 __ Ucvtf(ToDoubleRegister(instr->result()), ToRegister32(instr->value())); | 6070 __ Ucvtf(ToDoubleRegister(instr->result()), ToRegister32(instr->value())); |
6013 } | 6071 } |
6014 | 6072 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6156 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6214 Handle<ScopeInfo> scope_info = instr->scope_info(); |
6157 __ Push(scope_info); | 6215 __ Push(scope_info); |
6158 __ Push(ToRegister(instr->function())); | 6216 __ Push(ToRegister(instr->function())); |
6159 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6217 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6160 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6218 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6161 } | 6219 } |
6162 | 6220 |
6163 | 6221 |
6164 } // namespace internal | 6222 } // namespace internal |
6165 } // namespace v8 | 6223 } // namespace v8 |
OLD | NEW |