| 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 2265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2276 } | 2276 } |
| 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 // SIMD 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_SIMD_VALUE_TYPE)); |
| 2290 Operand(FLOAT32X4_TYPE)); | 2291 __ Branch(instr->TrueLabel(chunk_), le, scratch, |
| 2292 Operand(LAST_SIMD_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 3574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5875 *cmp2 = Operand(SYMBOL_TYPE); | 5878 *cmp2 = Operand(SYMBOL_TYPE); |
| 5876 final_branch_condition = eq; | 5879 final_branch_condition = eq; |
| 5877 | 5880 |
| 5878 } else if (String::Equals(type_name, factory->float32x4_string())) { | 5881 } else if (String::Equals(type_name, factory->float32x4_string())) { |
| 5879 __ JumpIfSmi(input, false_label); | 5882 __ JumpIfSmi(input, false_label); |
| 5880 __ GetObjectType(input, input, scratch); | 5883 __ GetObjectType(input, input, scratch); |
| 5881 *cmp1 = scratch; | 5884 *cmp1 = scratch; |
| 5882 *cmp2 = Operand(FLOAT32X4_TYPE); | 5885 *cmp2 = Operand(FLOAT32X4_TYPE); |
| 5883 final_branch_condition = eq; | 5886 final_branch_condition = eq; |
| 5884 | 5887 |
| 5888 } else if (String::Equals(type_name, factory->int32x4_string())) { |
| 5889 __ JumpIfSmi(input, false_label); |
| 5890 __ GetObjectType(input, input, scratch); |
| 5891 *cmp1 = scratch; |
| 5892 *cmp2 = Operand(INT32X4_TYPE); |
| 5893 final_branch_condition = eq; |
| 5894 |
| 5895 } else if (String::Equals(type_name, factory->bool32x4_string())) { |
| 5896 __ JumpIfSmi(input, false_label); |
| 5897 __ GetObjectType(input, input, scratch); |
| 5898 *cmp1 = scratch; |
| 5899 *cmp2 = Operand(BOOL32X4_TYPE); |
| 5900 final_branch_condition = eq; |
| 5901 |
| 5902 } else if (String::Equals(type_name, factory->int16x8_string())) { |
| 5903 __ JumpIfSmi(input, false_label); |
| 5904 __ GetObjectType(input, input, scratch); |
| 5905 *cmp1 = scratch; |
| 5906 *cmp2 = Operand(INT16X8_TYPE); |
| 5907 final_branch_condition = eq; |
| 5908 |
| 5909 } else if (String::Equals(type_name, factory->bool16x8_string())) { |
| 5910 __ JumpIfSmi(input, false_label); |
| 5911 __ GetObjectType(input, input, scratch); |
| 5912 *cmp1 = scratch; |
| 5913 *cmp2 = Operand(BOOL16X8_TYPE); |
| 5914 final_branch_condition = eq; |
| 5915 |
| 5916 } else if (String::Equals(type_name, factory->int8x16_string())) { |
| 5917 __ JumpIfSmi(input, false_label); |
| 5918 __ GetObjectType(input, input, scratch); |
| 5919 *cmp1 = scratch; |
| 5920 *cmp2 = Operand(INT8X16_TYPE); |
| 5921 final_branch_condition = eq; |
| 5922 |
| 5923 } else if (String::Equals(type_name, factory->bool8x16_string())) { |
| 5924 __ JumpIfSmi(input, false_label); |
| 5925 __ GetObjectType(input, input, scratch); |
| 5926 *cmp1 = scratch; |
| 5927 *cmp2 = Operand(BOOL8X16_TYPE); |
| 5928 final_branch_condition = eq; |
| 5929 |
| 5885 } else if (String::Equals(type_name, factory->boolean_string())) { | 5930 } else if (String::Equals(type_name, factory->boolean_string())) { |
| 5886 __ LoadRoot(at, Heap::kTrueValueRootIndex); | 5931 __ LoadRoot(at, Heap::kTrueValueRootIndex); |
| 5887 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); | 5932 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); |
| 5888 __ LoadRoot(at, Heap::kFalseValueRootIndex); | 5933 __ LoadRoot(at, Heap::kFalseValueRootIndex); |
| 5889 *cmp1 = at; | 5934 *cmp1 = at; |
| 5890 *cmp2 = Operand(input); | 5935 *cmp2 = Operand(input); |
| 5891 final_branch_condition = eq; | 5936 final_branch_condition = eq; |
| 5892 | 5937 |
| 5893 } else if (String::Equals(type_name, factory->undefined_string())) { | 5938 } else if (String::Equals(type_name, factory->undefined_string())) { |
| 5894 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 5939 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6241 __ Push(at, ToRegister(instr->function())); | 6286 __ Push(at, ToRegister(instr->function())); |
| 6242 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6287 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6243 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6288 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6244 } | 6289 } |
| 6245 | 6290 |
| 6246 | 6291 |
| 6247 #undef __ | 6292 #undef __ |
| 6248 | 6293 |
| 6249 } // namespace internal | 6294 } // namespace internal |
| 6250 } // namespace v8 | 6295 } // namespace v8 |
| OLD | NEW |