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 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" | 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" |
6 | 6 |
7 #include "src/builtins/builtins-constructor.h" | 7 #include "src/builtins/builtins-constructor.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
(...skipping 2128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2139 __ bind(¬_string); | 2139 __ bind(¬_string); |
2140 } | 2140 } |
2141 | 2141 |
2142 if (expected & ToBooleanHint::kSymbol) { | 2142 if (expected & ToBooleanHint::kSymbol) { |
2143 // Symbol value -> true. | 2143 // Symbol value -> true. |
2144 const Register scratch = scratch1(); | 2144 const Register scratch = scratch1(); |
2145 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 2145 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
2146 __ Branch(instr->TrueLabel(chunk_), eq, scratch, Operand(SYMBOL_TYPE)); | 2146 __ Branch(instr->TrueLabel(chunk_), eq, scratch, Operand(SYMBOL_TYPE)); |
2147 } | 2147 } |
2148 | 2148 |
| 2149 if (expected & ToBooleanHint::kSimdValue) { |
| 2150 // SIMD value -> true. |
| 2151 const Register scratch = scratch1(); |
| 2152 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 2153 __ Branch(instr->TrueLabel(chunk_), eq, scratch, |
| 2154 Operand(SIMD128_VALUE_TYPE)); |
| 2155 } |
| 2156 |
2149 if (expected & ToBooleanHint::kHeapNumber) { | 2157 if (expected & ToBooleanHint::kHeapNumber) { |
2150 // heap number -> false iff +0, -0, or NaN. | 2158 // heap number -> false iff +0, -0, or NaN. |
2151 DoubleRegister dbl_scratch = double_scratch0(); | 2159 DoubleRegister dbl_scratch = double_scratch0(); |
2152 Label not_heap_number; | 2160 Label not_heap_number; |
2153 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); | 2161 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
2154 __ Branch(¬_heap_number, ne, map, Operand(at)); | 2162 __ Branch(¬_heap_number, ne, map, Operand(at)); |
2155 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); | 2163 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); |
2156 __ BranchF(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), | 2164 __ BranchF(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), |
2157 ne, dbl_scratch, kDoubleRegZero); | 2165 ne, dbl_scratch, kDoubleRegZero); |
2158 // Falls through if dbl_scratch == 0. | 2166 // Falls through if dbl_scratch == 0. |
(...skipping 3189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5348 __ GetObjectType(input, scratch, scratch1()); | 5356 __ GetObjectType(input, scratch, scratch1()); |
5349 __ Branch(false_label, lt, scratch1(), Operand(FIRST_JS_RECEIVER_TYPE)); | 5357 __ Branch(false_label, lt, scratch1(), Operand(FIRST_JS_RECEIVER_TYPE)); |
5350 // Check for callable or undetectable objects => false. | 5358 // Check for callable or undetectable objects => false. |
5351 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); | 5359 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
5352 __ And(at, scratch, | 5360 __ And(at, scratch, |
5353 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); | 5361 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
5354 *cmp1 = at; | 5362 *cmp1 = at; |
5355 *cmp2 = Operand(zero_reg); | 5363 *cmp2 = Operand(zero_reg); |
5356 final_branch_condition = eq; | 5364 final_branch_condition = eq; |
5357 | 5365 |
| 5366 // clang-format off |
| 5367 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
| 5368 } else if (String::Equals(type_name, factory->type##_string())) { \ |
| 5369 __ JumpIfSmi(input, false_label); \ |
| 5370 __ ld(input, FieldMemOperand(input, HeapObject::kMapOffset)); \ |
| 5371 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \ |
| 5372 *cmp1 = input; \ |
| 5373 *cmp2 = Operand(at); \ |
| 5374 final_branch_condition = eq; |
| 5375 SIMD128_TYPES(SIMD128_TYPE) |
| 5376 #undef SIMD128_TYPE |
| 5377 // clang-format on |
| 5378 |
| 5379 |
5358 } else { | 5380 } else { |
5359 *cmp1 = at; | 5381 *cmp1 = at; |
5360 *cmp2 = Operand(zero_reg); // Set to valid regs, to avoid caller assertion. | 5382 *cmp2 = Operand(zero_reg); // Set to valid regs, to avoid caller assertion. |
5361 __ Branch(false_label); | 5383 __ Branch(false_label); |
5362 } | 5384 } |
5363 | 5385 |
5364 return final_branch_condition; | 5386 return final_branch_condition; |
5365 } | 5387 } |
5366 | 5388 |
5367 | 5389 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5608 __ ld(result, FieldMemOperand(scratch, | 5630 __ ld(result, FieldMemOperand(scratch, |
5609 FixedArray::kHeaderSize - kPointerSize)); | 5631 FixedArray::kHeaderSize - kPointerSize)); |
5610 __ bind(deferred->exit()); | 5632 __ bind(deferred->exit()); |
5611 __ bind(&done); | 5633 __ bind(&done); |
5612 } | 5634 } |
5613 | 5635 |
5614 #undef __ | 5636 #undef __ |
5615 | 5637 |
5616 } // namespace internal | 5638 } // namespace internal |
5617 } // namespace v8 | 5639 } // namespace v8 |
OLD | NEW |