| 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 2416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2427 __ jmp(instr->FalseLabel(chunk_)); | 2427 __ jmp(instr->FalseLabel(chunk_)); |
| 2428 __ bind(¬_string); | 2428 __ bind(¬_string); |
| 2429 } | 2429 } |
| 2430 | 2430 |
| 2431 if (expected.Contains(ToBooleanStub::SYMBOL)) { | 2431 if (expected.Contains(ToBooleanStub::SYMBOL)) { |
| 2432 // Symbol value -> true. | 2432 // Symbol value -> true. |
| 2433 __ CmpInstanceType(map, SYMBOL_TYPE); | 2433 __ CmpInstanceType(map, SYMBOL_TYPE); |
| 2434 __ j(equal, instr->TrueLabel(chunk_)); | 2434 __ j(equal, instr->TrueLabel(chunk_)); |
| 2435 } | 2435 } |
| 2436 | 2436 |
| 2437 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { | |
| 2438 // SIMD value -> true. | |
| 2439 __ CmpInstanceType(map, FLOAT32X4_TYPE); | |
| 2440 __ j(equal, instr->TrueLabel(chunk_)); | |
| 2441 } | |
| 2442 | |
| 2443 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2437 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
| 2444 // heap number -> false iff +0, -0, or NaN. | 2438 // heap number -> false iff +0, -0, or NaN. |
| 2445 Label not_heap_number; | 2439 Label not_heap_number; |
| 2446 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), | 2440 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), |
| 2447 factory()->heap_number_map()); | 2441 factory()->heap_number_map()); |
| 2448 __ j(not_equal, ¬_heap_number, Label::kNear); | 2442 __ j(not_equal, ¬_heap_number, Label::kNear); |
| 2449 __ fldz(); | 2443 __ fldz(); |
| 2450 __ fld_d(FieldOperand(reg, HeapNumber::kValueOffset)); | 2444 __ fld_d(FieldOperand(reg, HeapNumber::kValueOffset)); |
| 2451 __ FCmp(); | 2445 __ FCmp(); |
| 2452 __ j(zero, instr->FalseLabel(chunk_)); | 2446 __ j(zero, instr->FalseLabel(chunk_)); |
| (...skipping 3667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6120 __ j(equal, true_label, true_distance); | 6114 __ j(equal, true_label, true_distance); |
| 6121 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); | 6115 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); |
| 6122 __ j(below, false_label, false_distance); | 6116 __ j(below, false_label, false_distance); |
| 6123 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 6117 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
| 6124 __ j(above, false_label, false_distance); | 6118 __ j(above, false_label, false_distance); |
| 6125 // Check for undetectable objects => false. | 6119 // Check for undetectable objects => false. |
| 6126 __ test_b(FieldOperand(input, Map::kBitFieldOffset), | 6120 __ test_b(FieldOperand(input, Map::kBitFieldOffset), |
| 6127 1 << Map::kIsUndetectable); | 6121 1 << Map::kIsUndetectable); |
| 6128 final_branch_condition = zero; | 6122 final_branch_condition = zero; |
| 6129 | 6123 |
| 6130 } else if (String::Equals(type_name, factory()->float32x4_string())) { | |
| 6131 __ JumpIfSmi(input, false_label, false_distance); | |
| 6132 __ CmpObjectType(input, FLOAT32X4_TYPE, input); | |
| 6133 final_branch_condition = equal; | |
| 6134 | |
| 6135 } else { | 6124 } else { |
| 6136 __ jmp(false_label, false_distance); | 6125 __ jmp(false_label, false_distance); |
| 6137 } | 6126 } |
| 6138 return final_branch_condition; | 6127 return final_branch_condition; |
| 6139 } | 6128 } |
| 6140 | 6129 |
| 6141 | 6130 |
| 6142 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | 6131 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
| 6143 Register temp = ToRegister(instr->temp()); | 6132 Register temp = ToRegister(instr->temp()); |
| 6144 | 6133 |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6433 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6422 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6434 } | 6423 } |
| 6435 | 6424 |
| 6436 | 6425 |
| 6437 #undef __ | 6426 #undef __ |
| 6438 | 6427 |
| 6439 } // namespace internal | 6428 } // namespace internal |
| 6440 } // namespace v8 | 6429 } // namespace v8 |
| 6441 | 6430 |
| 6442 #endif // V8_TARGET_ARCH_X87 | 6431 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |