| 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 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2208 } | 2208 } |
| 2209 | 2209 |
| 2210 if (expected.Contains(ToBooleanStub::SYMBOL)) { | 2210 if (expected.Contains(ToBooleanStub::SYMBOL)) { |
| 2211 // Symbol value -> true. | 2211 // Symbol value -> true. |
| 2212 __ CmpInstanceType(map, SYMBOL_TYPE); | 2212 __ CmpInstanceType(map, SYMBOL_TYPE); |
| 2213 __ j(equal, instr->TrueLabel(chunk_)); | 2213 __ j(equal, instr->TrueLabel(chunk_)); |
| 2214 } | 2214 } |
| 2215 | 2215 |
| 2216 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { | 2216 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { |
| 2217 // SIMD value -> true. | 2217 // SIMD value -> true. |
| 2218 __ CmpInstanceType(map, FLOAT32X4_TYPE); | 2218 Label not_simd; |
| 2219 __ j(equal, instr->TrueLabel(chunk_)); | 2219 __ CmpInstanceType(map, FIRST_SIMD128_VALUE_TYPE); |
| 2220 __ j(less, ¬_simd, Label::kNear); |
| 2221 __ CmpInstanceType(map, LAST_SIMD128_VALUE_TYPE); |
| 2222 __ j(less_equal, instr->TrueLabel(chunk_)); |
| 2223 __ bind(¬_simd); |
| 2220 } | 2224 } |
| 2221 | 2225 |
| 2222 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2226 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
| 2223 // heap number -> false iff +0, -0, or NaN. | 2227 // heap number -> false iff +0, -0, or NaN. |
| 2224 Label not_heap_number; | 2228 Label not_heap_number; |
| 2225 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); | 2229 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); |
| 2226 __ j(not_equal, ¬_heap_number, Label::kNear); | 2230 __ j(not_equal, ¬_heap_number, Label::kNear); |
| 2227 XMMRegister xmm_scratch = double_scratch0(); | 2231 XMMRegister xmm_scratch = double_scratch0(); |
| 2228 __ xorps(xmm_scratch, xmm_scratch); | 2232 __ xorps(xmm_scratch, xmm_scratch); |
| 2229 __ ucomisd(xmm_scratch, FieldOperand(reg, HeapNumber::kValueOffset)); | 2233 __ ucomisd(xmm_scratch, FieldOperand(reg, HeapNumber::kValueOffset)); |
| (...skipping 3513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5743 // Check for undetectable objects => false. | 5747 // Check for undetectable objects => false. |
| 5744 __ testb(FieldOperand(input, Map::kBitFieldOffset), | 5748 __ testb(FieldOperand(input, Map::kBitFieldOffset), |
| 5745 Immediate(1 << Map::kIsUndetectable)); | 5749 Immediate(1 << Map::kIsUndetectable)); |
| 5746 final_branch_condition = zero; | 5750 final_branch_condition = zero; |
| 5747 | 5751 |
| 5748 } else if (String::Equals(type_name, factory->float32x4_string())) { | 5752 } else if (String::Equals(type_name, factory->float32x4_string())) { |
| 5749 __ JumpIfSmi(input, false_label, false_distance); | 5753 __ JumpIfSmi(input, false_label, false_distance); |
| 5750 __ CmpObjectType(input, FLOAT32X4_TYPE, input); | 5754 __ CmpObjectType(input, FLOAT32X4_TYPE, input); |
| 5751 final_branch_condition = equal; | 5755 final_branch_condition = equal; |
| 5752 | 5756 |
| 5757 } else if (String::Equals(type_name, factory->int32x4_string())) { |
| 5758 __ JumpIfSmi(input, false_label, false_distance); |
| 5759 __ CmpObjectType(input, INT32X4_TYPE, input); |
| 5760 final_branch_condition = equal; |
| 5761 |
| 5762 } else if (String::Equals(type_name, factory->bool32x4_string())) { |
| 5763 __ JumpIfSmi(input, false_label, false_distance); |
| 5764 __ CmpObjectType(input, BOOL32X4_TYPE, input); |
| 5765 final_branch_condition = equal; |
| 5766 |
| 5767 } else if (String::Equals(type_name, factory->int16x8_string())) { |
| 5768 __ JumpIfSmi(input, false_label, false_distance); |
| 5769 __ CmpObjectType(input, INT16X8_TYPE, input); |
| 5770 final_branch_condition = equal; |
| 5771 |
| 5772 } else if (String::Equals(type_name, factory->bool16x8_string())) { |
| 5773 __ JumpIfSmi(input, false_label, false_distance); |
| 5774 __ CmpObjectType(input, BOOL16X8_TYPE, input); |
| 5775 final_branch_condition = equal; |
| 5776 |
| 5777 } else if (String::Equals(type_name, factory->int8x16_string())) { |
| 5778 __ JumpIfSmi(input, false_label, false_distance); |
| 5779 __ CmpObjectType(input, INT8X16_TYPE, input); |
| 5780 final_branch_condition = equal; |
| 5781 |
| 5782 } else if (String::Equals(type_name, factory->bool8x16_string())) { |
| 5783 __ JumpIfSmi(input, false_label, false_distance); |
| 5784 __ CmpObjectType(input, BOOL8X16_TYPE, input); |
| 5785 final_branch_condition = equal; |
| 5786 |
| 5753 } else { | 5787 } else { |
| 5754 __ jmp(false_label, false_distance); | 5788 __ jmp(false_label, false_distance); |
| 5755 } | 5789 } |
| 5756 | 5790 |
| 5757 return final_branch_condition; | 5791 return final_branch_condition; |
| 5758 } | 5792 } |
| 5759 | 5793 |
| 5760 | 5794 |
| 5761 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | 5795 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
| 5762 Register temp = ToRegister(instr->temp()); | 5796 Register temp = ToRegister(instr->temp()); |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6047 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6081 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6048 } | 6082 } |
| 6049 | 6083 |
| 6050 | 6084 |
| 6051 #undef __ | 6085 #undef __ |
| 6052 | 6086 |
| 6053 } // namespace internal | 6087 } // namespace internal |
| 6054 } // namespace v8 | 6088 } // namespace v8 |
| 6055 | 6089 |
| 6056 #endif // V8_TARGET_ARCH_X64 | 6090 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |