OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/crankshaft/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/builtins/builtins-constructor.h" | 8 #include "src/builtins/builtins-constructor.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2199 __ b(instr->FalseLabel(chunk_)); | 2199 __ b(instr->FalseLabel(chunk_)); |
2200 __ bind(¬_string); | 2200 __ bind(¬_string); |
2201 } | 2201 } |
2202 | 2202 |
2203 if (expected & ToBooleanHint::kSymbol) { | 2203 if (expected & ToBooleanHint::kSymbol) { |
2204 // Symbol value -> true. | 2204 // Symbol value -> true. |
2205 __ CompareInstanceType(map, ip, SYMBOL_TYPE); | 2205 __ CompareInstanceType(map, ip, SYMBOL_TYPE); |
2206 __ beq(instr->TrueLabel(chunk_)); | 2206 __ beq(instr->TrueLabel(chunk_)); |
2207 } | 2207 } |
2208 | 2208 |
2209 if (expected & ToBooleanHint::kSimdValue) { | |
2210 // SIMD value -> true. | |
2211 Label not_simd; | |
2212 __ CompareInstanceType(map, ip, SIMD128_VALUE_TYPE); | |
2213 __ beq(instr->TrueLabel(chunk_)); | |
2214 } | |
2215 | |
2216 if (expected & ToBooleanHint::kHeapNumber) { | 2209 if (expected & ToBooleanHint::kHeapNumber) { |
2217 // heap number -> false iff +0, -0, or NaN. | 2210 // heap number -> false iff +0, -0, or NaN. |
2218 Label not_heap_number; | 2211 Label not_heap_number; |
2219 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); | 2212 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); |
2220 __ bne(¬_heap_number); | 2213 __ bne(¬_heap_number); |
2221 __ lfd(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); | 2214 __ lfd(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); |
2222 // Test the double value. Zero and NaN are false. | 2215 // Test the double value. Zero and NaN are false. |
2223 __ fcmpu(dbl_scratch, kDoubleRegZero, cr7); | 2216 __ fcmpu(dbl_scratch, kDoubleRegZero, cr7); |
2224 __ mfcr(r0); | 2217 __ mfcr(r0); |
2225 __ andi(r0, r0, Operand(crZOrNaNBits)); | 2218 __ andi(r0, r0, Operand(crZOrNaNBits)); |
(...skipping 3200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5426 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 5419 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
5427 __ CompareObjectType(input, scratch, ip, FIRST_JS_RECEIVER_TYPE); | 5420 __ CompareObjectType(input, scratch, ip, FIRST_JS_RECEIVER_TYPE); |
5428 __ blt(false_label); | 5421 __ blt(false_label); |
5429 // Check for callable or undetectable objects => false. | 5422 // Check for callable or undetectable objects => false. |
5430 __ lbz(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); | 5423 __ lbz(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
5431 __ andi(r0, scratch, | 5424 __ andi(r0, scratch, |
5432 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); | 5425 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
5433 __ cmpi(r0, Operand::Zero()); | 5426 __ cmpi(r0, Operand::Zero()); |
5434 final_branch_condition = eq; | 5427 final_branch_condition = eq; |
5435 | 5428 |
5436 // clang-format off | |
5437 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ | |
5438 } else if (String::Equals(type_name, factory->type##_string())) { \ | |
5439 __ JumpIfSmi(input, false_label); \ | |
5440 __ LoadP(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); \ | |
5441 __ CompareRoot(scratch, Heap::k##Type##MapRootIndex); \ | |
5442 final_branch_condition = eq; | |
5443 SIMD128_TYPES(SIMD128_TYPE) | |
5444 #undef SIMD128_TYPE | |
5445 // clang-format on | |
5446 | |
5447 } else { | 5429 } else { |
5448 __ b(false_label); | 5430 __ b(false_label); |
5449 } | 5431 } |
5450 | 5432 |
5451 return final_branch_condition; | 5433 return final_branch_condition; |
5452 } | 5434 } |
5453 | 5435 |
5454 | 5436 |
5455 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { | 5437 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { |
5456 if (info()->ShouldEnsureSpaceForLazyDeopt()) { | 5438 if (info()->ShouldEnsureSpaceForLazyDeopt()) { |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5688 __ LoadP(result, | 5670 __ LoadP(result, |
5689 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5671 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
5690 __ bind(deferred->exit()); | 5672 __ bind(deferred->exit()); |
5691 __ bind(&done); | 5673 __ bind(&done); |
5692 } | 5674 } |
5693 | 5675 |
5694 #undef __ | 5676 #undef __ |
5695 | 5677 |
5696 } // namespace internal | 5678 } // namespace internal |
5697 } // namespace v8 | 5679 } // namespace v8 |
OLD | NEW |