| 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 3301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5478 __ j(equal, true_label, true_distance); | 5484 __ j(equal, true_label, true_distance); |
| 5479 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); | 5485 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); |
| 5480 __ j(below, false_label, false_distance); | 5486 __ j(below, false_label, false_distance); |
| 5481 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5487 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
| 5482 __ j(above, false_label, false_distance); | 5488 __ j(above, false_label, false_distance); |
| 5483 // Check for undetectable objects => false. | 5489 // Check for undetectable objects => false. |
| 5484 __ test_b(FieldOperand(input, Map::kBitFieldOffset), | 5490 __ test_b(FieldOperand(input, Map::kBitFieldOffset), |
| 5485 1 << Map::kIsUndetectable); | 5491 1 << Map::kIsUndetectable); |
| 5486 final_branch_condition = zero; | 5492 final_branch_condition = zero; |
| 5487 | 5493 |
| 5494 } else if (String::Equals(type_name, factory()->float32x4_string())) { |
| 5495 __ JumpIfSmi(input, false_label, false_distance); |
| 5496 __ CmpObjectType(input, FLOAT32X4_TYPE, input); |
| 5497 final_branch_condition = equal; |
| 5498 |
| 5488 } else { | 5499 } else { |
| 5489 __ jmp(false_label, false_distance); | 5500 __ jmp(false_label, false_distance); |
| 5490 } | 5501 } |
| 5491 return final_branch_condition; | 5502 return final_branch_condition; |
| 5492 } | 5503 } |
| 5493 | 5504 |
| 5494 | 5505 |
| 5495 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | 5506 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
| 5496 Register temp = ToRegister(instr->temp()); | 5507 Register temp = ToRegister(instr->temp()); |
| 5497 | 5508 |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5783 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5794 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5784 } | 5795 } |
| 5785 | 5796 |
| 5786 | 5797 |
| 5787 #undef __ | 5798 #undef __ |
| 5788 | 5799 |
| 5789 } // namespace internal | 5800 } // namespace internal |
| 5790 } // namespace v8 | 5801 } // namespace v8 |
| 5791 | 5802 |
| 5792 #endif // V8_TARGET_ARCH_IA32 | 5803 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |