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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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 2152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2163 } | 2163 } |
2164 | 2164 |
2165 if (expected.Contains(ToBooleanStub::SYMBOL)) { | 2165 if (expected.Contains(ToBooleanStub::SYMBOL)) { |
2166 // Symbol value -> true. | 2166 // Symbol value -> true. |
2167 __ CmpInstanceType(map, SYMBOL_TYPE); | 2167 __ CmpInstanceType(map, SYMBOL_TYPE); |
2168 __ j(equal, instr->TrueLabel(chunk_)); | 2168 __ j(equal, instr->TrueLabel(chunk_)); |
2169 } | 2169 } |
2170 | 2170 |
2171 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { | 2171 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { |
2172 // SIMD value -> true. | 2172 // SIMD value -> true. |
2173 __ CmpInstanceType(map, FLOAT32X4_TYPE); | 2173 Label not_simd; |
2174 __ j(equal, instr->TrueLabel(chunk_)); | 2174 __ CmpInstanceType(map, FIRST_SIMD128_VALUE_TYPE); |
| 2175 __ j(less, ¬_simd, Label::kNear); |
| 2176 __ CmpInstanceType(map, LAST_SIMD128_VALUE_TYPE); |
| 2177 __ j(less_equal, instr->TrueLabel(chunk_)); |
| 2178 __ bind(¬_simd); |
2175 } | 2179 } |
2176 | 2180 |
2177 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2181 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
2178 // heap number -> false iff +0, -0, or NaN. | 2182 // heap number -> false iff +0, -0, or NaN. |
2179 Label not_heap_number; | 2183 Label not_heap_number; |
2180 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), | 2184 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), |
2181 factory()->heap_number_map()); | 2185 factory()->heap_number_map()); |
2182 __ j(not_equal, ¬_heap_number, Label::kNear); | 2186 __ j(not_equal, ¬_heap_number, Label::kNear); |
2183 XMMRegister xmm_scratch = double_scratch0(); | 2187 XMMRegister xmm_scratch = double_scratch0(); |
2184 __ xorps(xmm_scratch, xmm_scratch); | 2188 __ xorps(xmm_scratch, xmm_scratch); |
(...skipping 3353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5538 // Check for undetectable objects => false. | 5542 // Check for undetectable objects => false. |
5539 __ test_b(FieldOperand(input, Map::kBitFieldOffset), | 5543 __ test_b(FieldOperand(input, Map::kBitFieldOffset), |
5540 1 << Map::kIsUndetectable); | 5544 1 << Map::kIsUndetectable); |
5541 final_branch_condition = zero; | 5545 final_branch_condition = zero; |
5542 | 5546 |
5543 } else if (String::Equals(type_name, factory()->float32x4_string())) { | 5547 } else if (String::Equals(type_name, factory()->float32x4_string())) { |
5544 __ JumpIfSmi(input, false_label, false_distance); | 5548 __ JumpIfSmi(input, false_label, false_distance); |
5545 __ CmpObjectType(input, FLOAT32X4_TYPE, input); | 5549 __ CmpObjectType(input, FLOAT32X4_TYPE, input); |
5546 final_branch_condition = equal; | 5550 final_branch_condition = equal; |
5547 | 5551 |
| 5552 } else if (String::Equals(type_name, factory()->int32x4_string())) { |
| 5553 __ JumpIfSmi(input, false_label, false_distance); |
| 5554 __ CmpObjectType(input, INT32X4_TYPE, input); |
| 5555 final_branch_condition = equal; |
| 5556 |
| 5557 } else if (String::Equals(type_name, factory()->bool32x4_string())) { |
| 5558 __ JumpIfSmi(input, false_label, false_distance); |
| 5559 __ CmpObjectType(input, BOOL32X4_TYPE, input); |
| 5560 final_branch_condition = equal; |
| 5561 |
| 5562 } else if (String::Equals(type_name, factory()->int16x8_string())) { |
| 5563 __ JumpIfSmi(input, false_label, false_distance); |
| 5564 __ CmpObjectType(input, INT16X8_TYPE, input); |
| 5565 final_branch_condition = equal; |
| 5566 |
| 5567 } else if (String::Equals(type_name, factory()->bool16x8_string())) { |
| 5568 __ JumpIfSmi(input, false_label, false_distance); |
| 5569 __ CmpObjectType(input, BOOL16X8_TYPE, input); |
| 5570 final_branch_condition = equal; |
| 5571 |
| 5572 } else if (String::Equals(type_name, factory()->int8x16_string())) { |
| 5573 __ JumpIfSmi(input, false_label, false_distance); |
| 5574 __ CmpObjectType(input, INT8X16_TYPE, input); |
| 5575 final_branch_condition = equal; |
| 5576 |
| 5577 } else if (String::Equals(type_name, factory()->bool8x16_string())) { |
| 5578 __ JumpIfSmi(input, false_label, false_distance); |
| 5579 __ CmpObjectType(input, BOOL8X16_TYPE, input); |
| 5580 final_branch_condition = equal; |
| 5581 |
5548 } else { | 5582 } else { |
5549 __ jmp(false_label, false_distance); | 5583 __ jmp(false_label, false_distance); |
5550 } | 5584 } |
5551 return final_branch_condition; | 5585 return final_branch_condition; |
5552 } | 5586 } |
5553 | 5587 |
5554 | 5588 |
5555 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | 5589 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
5556 Register temp = ToRegister(instr->temp()); | 5590 Register temp = ToRegister(instr->temp()); |
5557 | 5591 |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5843 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5877 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5844 } | 5878 } |
5845 | 5879 |
5846 | 5880 |
5847 #undef __ | 5881 #undef __ |
5848 | 5882 |
5849 } // namespace internal | 5883 } // namespace internal |
5850 } // namespace v8 | 5884 } // namespace v8 |
5851 | 5885 |
5852 #endif // V8_TARGET_ARCH_IA32 | 5886 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |