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 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 2266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2277 | 2277 |
2278 if (expected.Contains(ToBooleanStub::SYMBOL)) { | 2278 if (expected.Contains(ToBooleanStub::SYMBOL)) { |
2279 // Symbol value -> true. | 2279 // Symbol value -> true. |
2280 const Register scratch = scratch1(); | 2280 const Register scratch = scratch1(); |
2281 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 2281 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
2282 __ Branch(instr->TrueLabel(chunk_), eq, scratch, Operand(SYMBOL_TYPE)); | 2282 __ Branch(instr->TrueLabel(chunk_), eq, scratch, Operand(SYMBOL_TYPE)); |
2283 } | 2283 } |
2284 | 2284 |
2285 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { | 2285 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { |
2286 // Symbol value -> true. | 2286 // Symbol value -> true. |
| 2287 Label not_simd; |
2287 const Register scratch = scratch1(); | 2288 const Register scratch = scratch1(); |
2288 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 2289 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
2289 __ Branch(instr->TrueLabel(chunk_), eq, scratch, | 2290 __ Branch(¬_simd, lt, at, Operand(FIRST_SIMD128_VALUE_TYPE)); |
2290 Operand(FLOAT32X4_TYPE)); | 2291 __ Branch(instr->TrueLabel(chunk_), le, scratch, |
| 2292 Operand(LAST_SIMD128_VALUE_TYPE)); |
| 2293 __ bind(¬_simd); |
2291 } | 2294 } |
2292 | 2295 |
2293 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2296 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
2294 // heap number -> false iff +0, -0, or NaN. | 2297 // heap number -> false iff +0, -0, or NaN. |
2295 DoubleRegister dbl_scratch = double_scratch0(); | 2298 DoubleRegister dbl_scratch = double_scratch0(); |
2296 Label not_heap_number; | 2299 Label not_heap_number; |
2297 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); | 2300 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
2298 __ Branch(¬_heap_number, ne, map, Operand(at)); | 2301 __ Branch(¬_heap_number, ne, map, Operand(at)); |
2299 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); | 2302 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); |
2300 __ BranchF(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), | 2303 __ BranchF(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), |
(...skipping 3575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5876 *cmp2 = Operand(SYMBOL_TYPE); | 5879 *cmp2 = Operand(SYMBOL_TYPE); |
5877 final_branch_condition = eq; | 5880 final_branch_condition = eq; |
5878 | 5881 |
5879 } else if (String::Equals(type_name, factory->float32x4_string())) { | 5882 } else if (String::Equals(type_name, factory->float32x4_string())) { |
5880 __ JumpIfSmi(input, false_label); | 5883 __ JumpIfSmi(input, false_label); |
5881 __ GetObjectType(input, input, scratch); | 5884 __ GetObjectType(input, input, scratch); |
5882 *cmp1 = scratch; | 5885 *cmp1 = scratch; |
5883 *cmp2 = Operand(FLOAT32X4_TYPE); | 5886 *cmp2 = Operand(FLOAT32X4_TYPE); |
5884 final_branch_condition = eq; | 5887 final_branch_condition = eq; |
5885 | 5888 |
| 5889 } else if (String::Equals(type_name, factory->int32x4_string())) { |
| 5890 __ JumpIfSmi(input, false_label); |
| 5891 __ GetObjectType(input, input, scratch); |
| 5892 *cmp1 = scratch; |
| 5893 *cmp2 = Operand(INT32X4_TYPE); |
| 5894 final_branch_condition = eq; |
| 5895 |
| 5896 } else if (String::Equals(type_name, factory->bool32x4_string())) { |
| 5897 __ JumpIfSmi(input, false_label); |
| 5898 __ GetObjectType(input, input, scratch); |
| 5899 *cmp1 = scratch; |
| 5900 *cmp2 = Operand(BOOL32X4_TYPE); |
| 5901 final_branch_condition = eq; |
| 5902 |
| 5903 } else if (String::Equals(type_name, factory->int16x8_string())) { |
| 5904 __ JumpIfSmi(input, false_label); |
| 5905 __ GetObjectType(input, input, scratch); |
| 5906 *cmp1 = scratch; |
| 5907 *cmp2 = Operand(INT16X8_TYPE); |
| 5908 final_branch_condition = eq; |
| 5909 |
| 5910 } else if (String::Equals(type_name, factory->bool16x8_string())) { |
| 5911 __ JumpIfSmi(input, false_label); |
| 5912 __ GetObjectType(input, input, scratch); |
| 5913 *cmp1 = scratch; |
| 5914 *cmp2 = Operand(BOOL16X8_TYPE); |
| 5915 final_branch_condition = eq; |
| 5916 |
| 5917 } else if (String::Equals(type_name, factory->int8x16_string())) { |
| 5918 __ JumpIfSmi(input, false_label); |
| 5919 __ GetObjectType(input, input, scratch); |
| 5920 *cmp1 = scratch; |
| 5921 *cmp2 = Operand(INT8X16_TYPE); |
| 5922 final_branch_condition = eq; |
| 5923 |
| 5924 } else if (String::Equals(type_name, factory->bool8x16_string())) { |
| 5925 __ JumpIfSmi(input, false_label); |
| 5926 __ GetObjectType(input, input, scratch); |
| 5927 *cmp1 = scratch; |
| 5928 *cmp2 = Operand(BOOL8X16_TYPE); |
| 5929 final_branch_condition = eq; |
| 5930 |
5886 } else if (String::Equals(type_name, factory->boolean_string())) { | 5931 } else if (String::Equals(type_name, factory->boolean_string())) { |
5887 __ LoadRoot(at, Heap::kTrueValueRootIndex); | 5932 __ LoadRoot(at, Heap::kTrueValueRootIndex); |
5888 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); | 5933 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); |
5889 __ LoadRoot(at, Heap::kFalseValueRootIndex); | 5934 __ LoadRoot(at, Heap::kFalseValueRootIndex); |
5890 *cmp1 = at; | 5935 *cmp1 = at; |
5891 *cmp2 = Operand(input); | 5936 *cmp2 = Operand(input); |
5892 final_branch_condition = eq; | 5937 final_branch_condition = eq; |
5893 | 5938 |
5894 } else if (String::Equals(type_name, factory->undefined_string())) { | 5939 } else if (String::Equals(type_name, factory->undefined_string())) { |
5895 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 5940 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6242 __ Push(at, ToRegister(instr->function())); | 6287 __ Push(at, ToRegister(instr->function())); |
6243 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6288 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6244 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6289 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6245 } | 6290 } |
6246 | 6291 |
6247 | 6292 |
6248 #undef __ | 6293 #undef __ |
6249 | 6294 |
6250 } // namespace internal | 6295 } // namespace internal |
6251 } // namespace v8 | 6296 } // namespace v8 |
OLD | NEW |