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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 2289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2300 } | 2300 } |
2301 | 2301 |
2302 if (expected.Contains(ToBooleanStub::SYMBOL)) { | 2302 if (expected.Contains(ToBooleanStub::SYMBOL)) { |
2303 // Symbol value -> true. | 2303 // Symbol value -> true. |
2304 __ CompareInstanceType(map, ip, SYMBOL_TYPE); | 2304 __ CompareInstanceType(map, ip, SYMBOL_TYPE); |
2305 __ beq(instr->TrueLabel(chunk_)); | 2305 __ beq(instr->TrueLabel(chunk_)); |
2306 } | 2306 } |
2307 | 2307 |
2308 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { | 2308 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { |
2309 // SIMD value -> true. | 2309 // SIMD value -> true. |
2310 __ CompareInstanceType(map, ip, FLOAT32X4_TYPE); | 2310 Label not_simd; |
2311 __ beq(instr->TrueLabel(chunk_)); | 2311 __ CompareInstanceType(map, ip, FIRST_SIMD_VALUE_TYPE); |
| 2312 __ blt(¬_simd); |
| 2313 __ CompareInstanceType(map, ip, LAST_SIMD_VALUE_TYPE); |
| 2314 __ ble(instr->TrueLabel(chunk_)); |
| 2315 __ bind(¬_simd); |
2312 } | 2316 } |
2313 | 2317 |
2314 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2318 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
2315 // heap number -> false iff +0, -0, or NaN. | 2319 // heap number -> false iff +0, -0, or NaN. |
2316 Label not_heap_number; | 2320 Label not_heap_number; |
2317 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); | 2321 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); |
2318 __ bne(¬_heap_number); | 2322 __ bne(¬_heap_number); |
2319 __ lfd(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); | 2323 __ lfd(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); |
2320 // Test the double value. Zero and NaN are false. | 2324 // Test the double value. Zero and NaN are false. |
2321 __ fcmpu(dbl_scratch, kDoubleRegZero, cr7); | 2325 __ fcmpu(dbl_scratch, kDoubleRegZero, cr7); |
(...skipping 3663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5985 __ lbz(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); | 5989 __ lbz(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); |
5986 __ ExtractBit(r0, scratch, Map::kIsUndetectable); | 5990 __ ExtractBit(r0, scratch, Map::kIsUndetectable); |
5987 __ cmpi(r0, Operand::Zero()); | 5991 __ cmpi(r0, Operand::Zero()); |
5988 final_branch_condition = eq; | 5992 final_branch_condition = eq; |
5989 | 5993 |
5990 } else if (String::Equals(type_name, factory->float32x4_string())) { | 5994 } else if (String::Equals(type_name, factory->float32x4_string())) { |
5991 __ JumpIfSmi(input, false_label); | 5995 __ JumpIfSmi(input, false_label); |
5992 __ CompareObjectType(input, scratch, no_reg, FLOAT32X4_TYPE); | 5996 __ CompareObjectType(input, scratch, no_reg, FLOAT32X4_TYPE); |
5993 final_branch_condition = eq; | 5997 final_branch_condition = eq; |
5994 | 5998 |
| 5999 } else if (String::Equals(type_name, factory->int32x4_string())) { |
| 6000 __ JumpIfSmi(input, false_label); |
| 6001 __ CompareObjectType(input, scratch, no_reg, INT32X4_TYPE); |
| 6002 final_branch_condition = eq; |
| 6003 |
| 6004 } else if (String::Equals(type_name, factory->bool32x4_string())) { |
| 6005 __ JumpIfSmi(input, false_label); |
| 6006 __ CompareObjectType(input, scratch, no_reg, BOOL32X4_TYPE); |
| 6007 final_branch_condition = eq; |
| 6008 |
| 6009 } else if (String::Equals(type_name, factory->int16x8_string())) { |
| 6010 __ JumpIfSmi(input, false_label); |
| 6011 __ CompareObjectType(input, scratch, no_reg, INT16X8_TYPE); |
| 6012 final_branch_condition = eq; |
| 6013 |
| 6014 } else if (String::Equals(type_name, factory->bool16x8_string())) { |
| 6015 __ JumpIfSmi(input, false_label); |
| 6016 __ CompareObjectType(input, scratch, no_reg, BOOL16X8_TYPE); |
| 6017 final_branch_condition = eq; |
| 6018 |
| 6019 } else if (String::Equals(type_name, factory->int8x16_string())) { |
| 6020 __ JumpIfSmi(input, false_label); |
| 6021 __ CompareObjectType(input, scratch, no_reg, INT8X16_TYPE); |
| 6022 final_branch_condition = eq; |
| 6023 |
| 6024 } else if (String::Equals(type_name, factory->bool8x16_string())) { |
| 6025 __ JumpIfSmi(input, false_label); |
| 6026 __ CompareObjectType(input, scratch, no_reg, BOOL8X16_TYPE); |
| 6027 final_branch_condition = eq; |
| 6028 |
5995 } else { | 6029 } else { |
5996 __ b(false_label); | 6030 __ b(false_label); |
5997 } | 6031 } |
5998 | 6032 |
5999 return final_branch_condition; | 6033 return final_branch_condition; |
6000 } | 6034 } |
6001 | 6035 |
6002 | 6036 |
6003 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | 6037 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
6004 Register temp1 = ToRegister(instr->temp()); | 6038 Register temp1 = ToRegister(instr->temp()); |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6292 __ Push(scope_info); | 6326 __ Push(scope_info); |
6293 __ push(ToRegister(instr->function())); | 6327 __ push(ToRegister(instr->function())); |
6294 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6328 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6295 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6329 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6296 } | 6330 } |
6297 | 6331 |
6298 | 6332 |
6299 #undef __ | 6333 #undef __ |
6300 } // namespace internal | 6334 } // namespace internal |
6301 } // namespace v8 | 6335 } // namespace v8 |
OLD | NEW |