OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/base/bits.h" | 5 #include "src/base/bits.h" |
6 #include "src/code-factory.h" | 6 #include "src/code-factory.h" |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/cpu-profiler.h" | 8 #include "src/cpu-profiler.h" |
9 #include "src/hydrogen-osr.h" | 9 #include "src/hydrogen-osr.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
(...skipping 2288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2299 | 2299 |
2300 if (expected.Contains(ToBooleanStub::SYMBOL)) { | 2300 if (expected.Contains(ToBooleanStub::SYMBOL)) { |
2301 // Symbol value -> true. | 2301 // Symbol value -> true. |
2302 __ CompareInstanceType(map, ip, SYMBOL_TYPE); | 2302 __ CompareInstanceType(map, ip, SYMBOL_TYPE); |
2303 __ beq(instr->TrueLabel(chunk_)); | 2303 __ beq(instr->TrueLabel(chunk_)); |
2304 } | 2304 } |
2305 | 2305 |
2306 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { | 2306 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { |
2307 // SIMD value -> true. | 2307 // SIMD value -> true. |
2308 Label not_simd; | 2308 Label not_simd; |
2309 __ CompareInstanceType(map, ip, FIRST_SIMD_VALUE_TYPE); | 2309 __ CompareInstanceType(map, ip, SIMD128_VALUE_TYPE); |
2310 __ blt(¬_simd); | 2310 __ beq(instr->TrueLabel(chunk_)); |
2311 __ CompareInstanceType(map, ip, LAST_SIMD_VALUE_TYPE); | |
2312 __ ble(instr->TrueLabel(chunk_)); | |
2313 __ bind(¬_simd); | |
2314 } | 2311 } |
2315 | 2312 |
2316 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2313 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
2317 // heap number -> false iff +0, -0, or NaN. | 2314 // heap number -> false iff +0, -0, or NaN. |
2318 Label not_heap_number; | 2315 Label not_heap_number; |
2319 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); | 2316 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); |
2320 __ bne(¬_heap_number); | 2317 __ bne(¬_heap_number); |
2321 __ lfd(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); | 2318 __ lfd(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); |
2322 // Test the double value. Zero and NaN are false. | 2319 // Test the double value. Zero and NaN are false. |
2323 __ fcmpu(dbl_scratch, kDoubleRegZero, cr7); | 2320 __ fcmpu(dbl_scratch, kDoubleRegZero, cr7); |
(...skipping 3622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5946 __ CompareRoot(input, Heap::kNullValueRootIndex); | 5943 __ CompareRoot(input, Heap::kNullValueRootIndex); |
5947 __ beq(true_label); | 5944 __ beq(true_label); |
5948 __ CheckObjectTypeRange(input, map, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, | 5945 __ CheckObjectTypeRange(input, map, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, |
5949 LAST_NONCALLABLE_SPEC_OBJECT_TYPE, false_label); | 5946 LAST_NONCALLABLE_SPEC_OBJECT_TYPE, false_label); |
5950 // Check for undetectable objects => false. | 5947 // Check for undetectable objects => false. |
5951 __ lbz(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); | 5948 __ lbz(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); |
5952 __ ExtractBit(r0, scratch, Map::kIsUndetectable); | 5949 __ ExtractBit(r0, scratch, Map::kIsUndetectable); |
5953 __ cmpi(r0, Operand::Zero()); | 5950 __ cmpi(r0, Operand::Zero()); |
5954 final_branch_condition = eq; | 5951 final_branch_condition = eq; |
5955 | 5952 |
5956 } else if (String::Equals(type_name, factory->float32x4_string())) { | 5953 // clang-format off |
5957 __ JumpIfSmi(input, false_label); | 5954 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
5958 __ CompareObjectType(input, scratch, no_reg, FLOAT32X4_TYPE); | 5955 } else if (String::Equals(type_name, factory->type##_string())) { \ |
| 5956 __ JumpIfSmi(input, false_label); \ |
| 5957 __ LoadP(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); \ |
| 5958 __ CompareRoot(scratch, Heap::k##Type##MapRootIndex); \ |
5959 final_branch_condition = eq; | 5959 final_branch_condition = eq; |
5960 | 5960 SIMD128_TYPES(SIMD128_TYPE) |
5961 } else if (String::Equals(type_name, factory->int32x4_string())) { | 5961 #undef SIMD128_TYPE |
5962 __ JumpIfSmi(input, false_label); | 5962 // clang-format on |
5963 __ CompareObjectType(input, scratch, no_reg, INT32X4_TYPE); | |
5964 final_branch_condition = eq; | |
5965 | |
5966 } else if (String::Equals(type_name, factory->bool32x4_string())) { | |
5967 __ JumpIfSmi(input, false_label); | |
5968 __ CompareObjectType(input, scratch, no_reg, BOOL32X4_TYPE); | |
5969 final_branch_condition = eq; | |
5970 | |
5971 } else if (String::Equals(type_name, factory->int16x8_string())) { | |
5972 __ JumpIfSmi(input, false_label); | |
5973 __ CompareObjectType(input, scratch, no_reg, INT16X8_TYPE); | |
5974 final_branch_condition = eq; | |
5975 | |
5976 } else if (String::Equals(type_name, factory->bool16x8_string())) { | |
5977 __ JumpIfSmi(input, false_label); | |
5978 __ CompareObjectType(input, scratch, no_reg, BOOL16X8_TYPE); | |
5979 final_branch_condition = eq; | |
5980 | |
5981 } else if (String::Equals(type_name, factory->int8x16_string())) { | |
5982 __ JumpIfSmi(input, false_label); | |
5983 __ CompareObjectType(input, scratch, no_reg, INT8X16_TYPE); | |
5984 final_branch_condition = eq; | |
5985 | |
5986 } else if (String::Equals(type_name, factory->bool8x16_string())) { | |
5987 __ JumpIfSmi(input, false_label); | |
5988 __ CompareObjectType(input, scratch, no_reg, BOOL8X16_TYPE); | |
5989 final_branch_condition = eq; | |
5990 | 5963 |
5991 } else { | 5964 } else { |
5992 __ b(false_label); | 5965 __ b(false_label); |
5993 } | 5966 } |
5994 | 5967 |
5995 return final_branch_condition; | 5968 return final_branch_condition; |
5996 } | 5969 } |
5997 | 5970 |
5998 | 5971 |
5999 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | 5972 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6288 __ Push(scope_info); | 6261 __ Push(scope_info); |
6289 __ push(ToRegister(instr->function())); | 6262 __ push(ToRegister(instr->function())); |
6290 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6263 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6291 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6264 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6292 } | 6265 } |
6293 | 6266 |
6294 | 6267 |
6295 #undef __ | 6268 #undef __ |
6296 } // namespace internal | 6269 } // namespace internal |
6297 } // namespace v8 | 6270 } // namespace v8 |
OLD | NEW |