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