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 2146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2157 __ jmp(instr->FalseLabel(chunk_)); | 2157 __ jmp(instr->FalseLabel(chunk_)); |
2158 __ bind(¬_string); | 2158 __ bind(¬_string); |
2159 } | 2159 } |
2160 | 2160 |
2161 if (expected.Contains(ToBooleanStub::SYMBOL)) { | 2161 if (expected.Contains(ToBooleanStub::SYMBOL)) { |
2162 // Symbol value -> true. | 2162 // Symbol value -> true. |
2163 __ CmpInstanceType(map, SYMBOL_TYPE); | 2163 __ CmpInstanceType(map, SYMBOL_TYPE); |
2164 __ j(equal, instr->TrueLabel(chunk_)); | 2164 __ j(equal, instr->TrueLabel(chunk_)); |
2165 } | 2165 } |
2166 | 2166 |
| 2167 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { |
| 2168 // SIMD value -> true. |
| 2169 __ CmpInstanceType(map, FLOAT32X4_TYPE); |
| 2170 __ j(equal, instr->TrueLabel(chunk_)); |
| 2171 } |
| 2172 |
2167 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2173 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
2168 // heap number -> false iff +0, -0, or NaN. | 2174 // heap number -> false iff +0, -0, or NaN. |
2169 Label not_heap_number; | 2175 Label not_heap_number; |
2170 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), | 2176 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), |
2171 factory()->heap_number_map()); | 2177 factory()->heap_number_map()); |
2172 __ j(not_equal, ¬_heap_number, Label::kNear); | 2178 __ j(not_equal, ¬_heap_number, Label::kNear); |
2173 XMMRegister xmm_scratch = double_scratch0(); | 2179 XMMRegister xmm_scratch = double_scratch0(); |
2174 __ xorps(xmm_scratch, xmm_scratch); | 2180 __ xorps(xmm_scratch, xmm_scratch); |
2175 __ ucomisd(xmm_scratch, FieldOperand(reg, HeapNumber::kValueOffset)); | 2181 __ ucomisd(xmm_scratch, FieldOperand(reg, HeapNumber::kValueOffset)); |
2176 __ j(zero, instr->FalseLabel(chunk_)); | 2182 __ j(zero, instr->FalseLabel(chunk_)); |
(...skipping 3326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5503 __ j(equal, true_label, true_distance); | 5509 __ j(equal, true_label, true_distance); |
5504 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); | 5510 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); |
5505 __ j(below, false_label, false_distance); | 5511 __ j(below, false_label, false_distance); |
5506 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5512 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
5507 __ j(above, false_label, false_distance); | 5513 __ j(above, false_label, false_distance); |
5508 // Check for undetectable objects => false. | 5514 // Check for undetectable objects => false. |
5509 __ test_b(FieldOperand(input, Map::kBitFieldOffset), | 5515 __ test_b(FieldOperand(input, Map::kBitFieldOffset), |
5510 1 << Map::kIsUndetectable); | 5516 1 << Map::kIsUndetectable); |
5511 final_branch_condition = zero; | 5517 final_branch_condition = zero; |
5512 | 5518 |
| 5519 } else if (String::Equals(type_name, factory()->float32x4_string())) { |
| 5520 __ JumpIfSmi(input, false_label, false_distance); |
| 5521 __ CmpObjectType(input, FLOAT32X4_TYPE, input); |
| 5522 final_branch_condition = equal; |
| 5523 |
5513 } else { | 5524 } else { |
5514 __ jmp(false_label, false_distance); | 5525 __ jmp(false_label, false_distance); |
5515 } | 5526 } |
5516 return final_branch_condition; | 5527 return final_branch_condition; |
5517 } | 5528 } |
5518 | 5529 |
5519 | 5530 |
5520 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | 5531 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
5521 Register temp = ToRegister(instr->temp()); | 5532 Register temp = ToRegister(instr->temp()); |
5522 | 5533 |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5808 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5819 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5809 } | 5820 } |
5810 | 5821 |
5811 | 5822 |
5812 #undef __ | 5823 #undef __ |
5813 | 5824 |
5814 } // namespace internal | 5825 } // namespace internal |
5815 } // namespace v8 | 5826 } // namespace v8 |
5816 | 5827 |
5817 #endif // V8_TARGET_ARCH_IA32 | 5828 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |