| 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 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 6 | 6 |
| 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" | 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/builtins/builtins-constructor.h" | 10 #include "src/builtins/builtins-constructor.h" |
| (...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1920 __ jmp(instr->FalseLabel(chunk_)); | 1920 __ jmp(instr->FalseLabel(chunk_)); |
| 1921 __ bind(¬_string); | 1921 __ bind(¬_string); |
| 1922 } | 1922 } |
| 1923 | 1923 |
| 1924 if (expected & ToBooleanHint::kSymbol) { | 1924 if (expected & ToBooleanHint::kSymbol) { |
| 1925 // Symbol value -> true. | 1925 // Symbol value -> true. |
| 1926 __ CmpInstanceType(map, SYMBOL_TYPE); | 1926 __ CmpInstanceType(map, SYMBOL_TYPE); |
| 1927 __ j(equal, instr->TrueLabel(chunk_)); | 1927 __ j(equal, instr->TrueLabel(chunk_)); |
| 1928 } | 1928 } |
| 1929 | 1929 |
| 1930 if (expected & ToBooleanHint::kSimdValue) { | |
| 1931 // SIMD value -> true. | |
| 1932 __ CmpInstanceType(map, SIMD128_VALUE_TYPE); | |
| 1933 __ j(equal, instr->TrueLabel(chunk_)); | |
| 1934 } | |
| 1935 | |
| 1936 if (expected & ToBooleanHint::kHeapNumber) { | 1930 if (expected & ToBooleanHint::kHeapNumber) { |
| 1937 // heap number -> false iff +0, -0, or NaN. | 1931 // heap number -> false iff +0, -0, or NaN. |
| 1938 Label not_heap_number; | 1932 Label not_heap_number; |
| 1939 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), | 1933 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), |
| 1940 factory()->heap_number_map()); | 1934 factory()->heap_number_map()); |
| 1941 __ j(not_equal, ¬_heap_number, Label::kNear); | 1935 __ j(not_equal, ¬_heap_number, Label::kNear); |
| 1942 XMMRegister xmm_scratch = double_scratch0(); | 1936 XMMRegister xmm_scratch = double_scratch0(); |
| 1943 __ xorps(xmm_scratch, xmm_scratch); | 1937 __ xorps(xmm_scratch, xmm_scratch); |
| 1944 __ ucomisd(xmm_scratch, FieldOperand(reg, HeapNumber::kValueOffset)); | 1938 __ ucomisd(xmm_scratch, FieldOperand(reg, HeapNumber::kValueOffset)); |
| 1945 __ j(zero, instr->FalseLabel(chunk_)); | 1939 __ j(zero, instr->FalseLabel(chunk_)); |
| (...skipping 2960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4906 __ JumpIfSmi(input, false_label, false_distance); | 4900 __ JumpIfSmi(input, false_label, false_distance); |
| 4907 __ cmp(input, factory()->null_value()); | 4901 __ cmp(input, factory()->null_value()); |
| 4908 __ j(equal, true_label, true_distance); | 4902 __ j(equal, true_label, true_distance); |
| 4909 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 4903 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
| 4910 __ CmpObjectType(input, FIRST_JS_RECEIVER_TYPE, input); | 4904 __ CmpObjectType(input, FIRST_JS_RECEIVER_TYPE, input); |
| 4911 __ j(below, false_label, false_distance); | 4905 __ j(below, false_label, false_distance); |
| 4912 // Check for callable or undetectable objects => false. | 4906 // Check for callable or undetectable objects => false. |
| 4913 __ test_b(FieldOperand(input, Map::kBitFieldOffset), | 4907 __ test_b(FieldOperand(input, Map::kBitFieldOffset), |
| 4914 Immediate((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); | 4908 Immediate((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
| 4915 final_branch_condition = zero; | 4909 final_branch_condition = zero; |
| 4916 | |
| 4917 // clang-format off | |
| 4918 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ | |
| 4919 } else if (String::Equals(type_name, factory()->type##_string())) { \ | |
| 4920 __ JumpIfSmi(input, false_label, false_distance); \ | |
| 4921 __ cmp(FieldOperand(input, HeapObject::kMapOffset), \ | |
| 4922 factory()->type##_map()); \ | |
| 4923 final_branch_condition = equal; | |
| 4924 SIMD128_TYPES(SIMD128_TYPE) | |
| 4925 #undef SIMD128_TYPE | |
| 4926 // clang-format on | |
| 4927 | |
| 4928 } else { | 4910 } else { |
| 4929 __ jmp(false_label, false_distance); | 4911 __ jmp(false_label, false_distance); |
| 4930 } | 4912 } |
| 4931 return final_branch_condition; | 4913 return final_branch_condition; |
| 4932 } | 4914 } |
| 4933 | 4915 |
| 4934 | 4916 |
| 4935 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { | 4917 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { |
| 4936 if (info()->ShouldEnsureSpaceForLazyDeopt()) { | 4918 if (info()->ShouldEnsureSpaceForLazyDeopt()) { |
| 4937 // Ensure that we have enough space after the previous lazy-bailout | 4919 // Ensure that we have enough space after the previous lazy-bailout |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5171 __ bind(deferred->exit()); | 5153 __ bind(deferred->exit()); |
| 5172 __ bind(&done); | 5154 __ bind(&done); |
| 5173 } | 5155 } |
| 5174 | 5156 |
| 5175 #undef __ | 5157 #undef __ |
| 5176 | 5158 |
| 5177 } // namespace internal | 5159 } // namespace internal |
| 5178 } // namespace v8 | 5160 } // namespace v8 |
| 5179 | 5161 |
| 5180 #endif // V8_TARGET_ARCH_IA32 | 5162 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |