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 |
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 3483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5704 __ j(equal, true_label, true_distance); | 5710 __ j(equal, true_label, true_distance); |
5705 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); | 5711 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); |
5706 __ j(below, false_label, false_distance); | 5712 __ j(below, false_label, false_distance); |
5707 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5713 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
5708 __ j(above, false_label, false_distance); | 5714 __ j(above, false_label, false_distance); |
5709 // Check for undetectable objects => false. | 5715 // Check for undetectable objects => false. |
5710 __ testb(FieldOperand(input, Map::kBitFieldOffset), | 5716 __ testb(FieldOperand(input, Map::kBitFieldOffset), |
5711 Immediate(1 << Map::kIsUndetectable)); | 5717 Immediate(1 << Map::kIsUndetectable)); |
5712 final_branch_condition = zero; | 5718 final_branch_condition = zero; |
5713 | 5719 |
| 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 |
5714 } else { | 5725 } else { |
5715 __ jmp(false_label, false_distance); | 5726 __ jmp(false_label, false_distance); |
5716 } | 5727 } |
5717 | 5728 |
5718 return final_branch_condition; | 5729 return final_branch_condition; |
5719 } | 5730 } |
5720 | 5731 |
5721 | 5732 |
5722 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | 5733 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
5723 Register temp = ToRegister(instr->temp()); | 5734 Register temp = ToRegister(instr->temp()); |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6008 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6019 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6009 } | 6020 } |
6010 | 6021 |
6011 | 6022 |
6012 #undef __ | 6023 #undef __ |
6013 | 6024 |
6014 } // namespace internal | 6025 } // namespace internal |
6015 } // namespace v8 | 6026 } // namespace v8 |
6016 | 6027 |
6017 #endif // V8_TARGET_ARCH_X64 | 6028 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |