| 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_TYPE)) { |
| 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 3324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5501 __ j(equal, true_label, true_distance); | 5507 __ j(equal, true_label, true_distance); |
| 5502 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); | 5508 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); |
| 5503 __ j(below, false_label, false_distance); | 5509 __ j(below, false_label, false_distance); |
| 5504 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5510 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
| 5505 __ j(above, false_label, false_distance); | 5511 __ j(above, false_label, false_distance); |
| 5506 // Check for undetectable objects => false. | 5512 // Check for undetectable objects => false. |
| 5507 __ test_b(FieldOperand(input, Map::kBitFieldOffset), | 5513 __ test_b(FieldOperand(input, Map::kBitFieldOffset), |
| 5508 1 << Map::kIsUndetectable); | 5514 1 << Map::kIsUndetectable); |
| 5509 final_branch_condition = zero; | 5515 final_branch_condition = zero; |
| 5510 | 5516 |
| 5517 } else if (String::Equals(type_name, factory()->float32x4_string())) { |
| 5518 __ JumpIfSmi(input, false_label, false_distance); |
| 5519 __ CmpObjectType(input, FLOAT32X4_TYPE, input); |
| 5520 final_branch_condition = equal; |
| 5521 |
| 5511 } else { | 5522 } else { |
| 5512 __ jmp(false_label, false_distance); | 5523 __ jmp(false_label, false_distance); |
| 5513 } | 5524 } |
| 5514 return final_branch_condition; | 5525 return final_branch_condition; |
| 5515 } | 5526 } |
| 5516 | 5527 |
| 5517 | 5528 |
| 5518 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | 5529 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
| 5519 Register temp = ToRegister(instr->temp()); | 5530 Register temp = ToRegister(instr->temp()); |
| 5520 | 5531 |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5806 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5817 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5807 } | 5818 } |
| 5808 | 5819 |
| 5809 | 5820 |
| 5810 #undef __ | 5821 #undef __ |
| 5811 | 5822 |
| 5812 } // namespace internal | 5823 } // namespace internal |
| 5813 } // namespace v8 | 5824 } // namespace v8 |
| 5814 | 5825 |
| 5815 #endif // V8_TARGET_ARCH_IA32 | 5826 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |