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 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
8 | 8 |
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 2422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2433 } | 2433 } |
2434 | 2434 |
2435 if (expected.Contains(ToBooleanStub::SYMBOL)) { | 2435 if (expected.Contains(ToBooleanStub::SYMBOL)) { |
2436 // Symbol value -> true. | 2436 // Symbol value -> true. |
2437 __ CmpInstanceType(map, SYMBOL_TYPE); | 2437 __ CmpInstanceType(map, SYMBOL_TYPE); |
2438 __ j(equal, instr->TrueLabel(chunk_)); | 2438 __ j(equal, instr->TrueLabel(chunk_)); |
2439 } | 2439 } |
2440 | 2440 |
2441 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { | 2441 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { |
2442 // SIMD value -> true. | 2442 // SIMD value -> true. |
2443 __ CmpInstanceType(map, FLOAT32X4_TYPE); | 2443 Label not_simd; |
2444 __ j(equal, instr->TrueLabel(chunk_)); | 2444 __ CmpInstanceType(map, FIRST_SIMD128_VALUE_TYPE); |
| 2445 __ j(less, ¬_simd, Label::kNear); |
| 2446 __ CmpInstanceType(map, LAST_SIMD128_VALUE_TYPE); |
| 2447 __ j(less_equal, instr->TrueLabel(chunk_)); |
| 2448 __ bind(¬_simd); |
2445 } | 2449 } |
2446 | 2450 |
2447 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2451 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
2448 // heap number -> false iff +0, -0, or NaN. | 2452 // heap number -> false iff +0, -0, or NaN. |
2449 Label not_heap_number; | 2453 Label not_heap_number; |
2450 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), | 2454 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), |
2451 factory()->heap_number_map()); | 2455 factory()->heap_number_map()); |
2452 __ j(not_equal, ¬_heap_number, Label::kNear); | 2456 __ j(not_equal, ¬_heap_number, Label::kNear); |
2453 __ fldz(); | 2457 __ fldz(); |
2454 __ fld_d(FieldOperand(reg, HeapNumber::kValueOffset)); | 2458 __ fld_d(FieldOperand(reg, HeapNumber::kValueOffset)); |
(...skipping 3694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6149 // Check for undetectable objects => false. | 6153 // Check for undetectable objects => false. |
6150 __ test_b(FieldOperand(input, Map::kBitFieldOffset), | 6154 __ test_b(FieldOperand(input, Map::kBitFieldOffset), |
6151 1 << Map::kIsUndetectable); | 6155 1 << Map::kIsUndetectable); |
6152 final_branch_condition = zero; | 6156 final_branch_condition = zero; |
6153 | 6157 |
6154 } else if (String::Equals(type_name, factory()->float32x4_string())) { | 6158 } else if (String::Equals(type_name, factory()->float32x4_string())) { |
6155 __ JumpIfSmi(input, false_label, false_distance); | 6159 __ JumpIfSmi(input, false_label, false_distance); |
6156 __ CmpObjectType(input, FLOAT32X4_TYPE, input); | 6160 __ CmpObjectType(input, FLOAT32X4_TYPE, input); |
6157 final_branch_condition = equal; | 6161 final_branch_condition = equal; |
6158 | 6162 |
| 6163 } else if (String::Equals(type_name, factory()->int32x4_string())) { |
| 6164 __ JumpIfSmi(input, false_label, false_distance); |
| 6165 __ CmpObjectType(input, INT32X4_TYPE, input); |
| 6166 final_branch_condition = equal; |
| 6167 |
| 6168 } else if (String::Equals(type_name, factory()->bool32x4_string())) { |
| 6169 __ JumpIfSmi(input, false_label, false_distance); |
| 6170 __ CmpObjectType(input, BOOL32X4_TYPE, input); |
| 6171 final_branch_condition = equal; |
| 6172 |
| 6173 } else if (String::Equals(type_name, factory()->int16x8_string())) { |
| 6174 __ JumpIfSmi(input, false_label, false_distance); |
| 6175 __ CmpObjectType(input, INT16X8_TYPE, input); |
| 6176 final_branch_condition = equal; |
| 6177 |
| 6178 } else if (String::Equals(type_name, factory()->bool16x8_string())) { |
| 6179 __ JumpIfSmi(input, false_label, false_distance); |
| 6180 __ CmpObjectType(input, BOOL16X8_TYPE, input); |
| 6181 final_branch_condition = equal; |
| 6182 |
| 6183 } else if (String::Equals(type_name, factory()->int8x16_string())) { |
| 6184 __ JumpIfSmi(input, false_label, false_distance); |
| 6185 __ CmpObjectType(input, INT8X16_TYPE, input); |
| 6186 final_branch_condition = equal; |
| 6187 |
| 6188 } else if (String::Equals(type_name, factory()->bool8x16_string())) { |
| 6189 __ JumpIfSmi(input, false_label, false_distance); |
| 6190 __ CmpObjectType(input, BOOL8X16_TYPE, input); |
| 6191 final_branch_condition = equal; |
| 6192 |
6159 } else { | 6193 } else { |
6160 __ jmp(false_label, false_distance); | 6194 __ jmp(false_label, false_distance); |
6161 } | 6195 } |
6162 return final_branch_condition; | 6196 return final_branch_condition; |
6163 } | 6197 } |
6164 | 6198 |
6165 | 6199 |
6166 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | 6200 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
6167 Register temp = ToRegister(instr->temp()); | 6201 Register temp = ToRegister(instr->temp()); |
6168 | 6202 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6457 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6491 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6458 } | 6492 } |
6459 | 6493 |
6460 | 6494 |
6461 #undef __ | 6495 #undef __ |
6462 | 6496 |
6463 } // namespace internal | 6497 } // namespace internal |
6464 } // namespace v8 | 6498 } // namespace v8 |
6465 | 6499 |
6466 #endif // V8_TARGET_ARCH_X87 | 6500 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |