| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 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 2190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2201 __ jmp(instr->FalseLabel(chunk_)); | 2201 __ jmp(instr->FalseLabel(chunk_)); |
| 2202 __ bind(¬_string); | 2202 __ bind(¬_string); |
| 2203 } | 2203 } |
| 2204 | 2204 |
| 2205 if (expected.Contains(ToBooleanStub::SYMBOL)) { | 2205 if (expected.Contains(ToBooleanStub::SYMBOL)) { |
| 2206 // Symbol value -> true. | 2206 // Symbol value -> true. |
| 2207 __ CmpInstanceType(map, SYMBOL_TYPE); | 2207 __ CmpInstanceType(map, SYMBOL_TYPE); |
| 2208 __ j(equal, instr->TrueLabel(chunk_)); | 2208 __ j(equal, instr->TrueLabel(chunk_)); |
| 2209 } | 2209 } |
| 2210 | 2210 |
| 2211 if (expected.Contains(ToBooleanStub::SIMD_TYPE)) { |
| 2212 // SIMD value -> true. |
| 2213 __ CmpInstanceType(map, FLOAT32X4_TYPE); |
| 2214 __ j(equal, instr->TrueLabel(chunk_)); |
| 2215 } |
| 2216 |
| 2211 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2217 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
| 2212 // heap number -> false iff +0, -0, or NaN. | 2218 // heap number -> false iff +0, -0, or NaN. |
| 2213 Label not_heap_number; | 2219 Label not_heap_number; |
| 2214 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); | 2220 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); |
| 2215 __ j(not_equal, ¬_heap_number, Label::kNear); | 2221 __ j(not_equal, ¬_heap_number, Label::kNear); |
| 2216 XMMRegister xmm_scratch = double_scratch0(); | 2222 XMMRegister xmm_scratch = double_scratch0(); |
| 2217 __ xorps(xmm_scratch, xmm_scratch); | 2223 __ xorps(xmm_scratch, xmm_scratch); |
| 2218 __ ucomisd(xmm_scratch, FieldOperand(reg, HeapNumber::kValueOffset)); | 2224 __ ucomisd(xmm_scratch, FieldOperand(reg, HeapNumber::kValueOffset)); |
| 2219 __ j(zero, instr->FalseLabel(chunk_)); | 2225 __ j(zero, instr->FalseLabel(chunk_)); |
| 2220 __ jmp(instr->TrueLabel(chunk_)); | 2226 __ jmp(instr->TrueLabel(chunk_)); |
| (...skipping 3481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5702 __ j(equal, true_label, true_distance); | 5708 __ j(equal, true_label, true_distance); |
| 5703 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); | 5709 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); |
| 5704 __ j(below, false_label, false_distance); | 5710 __ j(below, false_label, false_distance); |
| 5705 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5711 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
| 5706 __ j(above, false_label, false_distance); | 5712 __ j(above, false_label, false_distance); |
| 5707 // Check for undetectable objects => false. | 5713 // Check for undetectable objects => false. |
| 5708 __ testb(FieldOperand(input, Map::kBitFieldOffset), | 5714 __ testb(FieldOperand(input, Map::kBitFieldOffset), |
| 5709 Immediate(1 << Map::kIsUndetectable)); | 5715 Immediate(1 << Map::kIsUndetectable)); |
| 5710 final_branch_condition = zero; | 5716 final_branch_condition = zero; |
| 5711 | 5717 |
| 5718 } else if (String::Equals(type_name, factory->float32x4_string())) { |
| 5719 __ JumpIfSmi(input, false_label, false_distance); |
| 5720 __ CmpObjectType(input, FLOAT32X4_TYPE, input); |
| 5721 final_branch_condition = equal; |
| 5722 |
| 5712 } else { | 5723 } else { |
| 5713 __ jmp(false_label, false_distance); | 5724 __ jmp(false_label, false_distance); |
| 5714 } | 5725 } |
| 5715 | 5726 |
| 5716 return final_branch_condition; | 5727 return final_branch_condition; |
| 5717 } | 5728 } |
| 5718 | 5729 |
| 5719 | 5730 |
| 5720 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | 5731 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
| 5721 Register temp = ToRegister(instr->temp()); | 5732 Register temp = ToRegister(instr->temp()); |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6006 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6017 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6007 } | 6018 } |
| 6008 | 6019 |
| 6009 | 6020 |
| 6010 #undef __ | 6021 #undef __ |
| 6011 | 6022 |
| 6012 } // namespace internal | 6023 } // namespace internal |
| 6013 } // namespace v8 | 6024 } // namespace v8 |
| 6014 | 6025 |
| 6015 #endif // V8_TARGET_ARCH_X64 | 6026 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |