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 | |
2157 if (expected & ToBooleanHint::kHeapNumber) { | 2149 if (expected & ToBooleanHint::kHeapNumber) { |
2158 // heap number -> false iff +0, -0, or NaN. | 2150 // heap number -> false iff +0, -0, or NaN. |
2159 DoubleRegister dbl_scratch = double_scratch0(); | 2151 DoubleRegister dbl_scratch = double_scratch0(); |
2160 Label not_heap_number; | 2152 Label not_heap_number; |
2161 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); | 2153 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
2162 __ Branch(¬_heap_number, ne, map, Operand(at)); | 2154 __ Branch(¬_heap_number, ne, map, Operand(at)); |
2163 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); | 2155 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); |
2164 __ BranchF(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), | 2156 __ BranchF(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), |
2165 ne, dbl_scratch, kDoubleRegZero); | 2157 ne, dbl_scratch, kDoubleRegZero); |
2166 // Falls through if dbl_scratch == 0. | 2158 // Falls through if dbl_scratch == 0. |
(...skipping 3189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5356 __ GetObjectType(input, scratch, scratch1()); | 5348 __ GetObjectType(input, scratch, scratch1()); |
5357 __ Branch(false_label, lt, scratch1(), Operand(FIRST_JS_RECEIVER_TYPE)); | 5349 __ Branch(false_label, lt, scratch1(), Operand(FIRST_JS_RECEIVER_TYPE)); |
5358 // Check for callable or undetectable objects => false. | 5350 // Check for callable or undetectable objects => false. |
5359 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); | 5351 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
5360 __ And(at, scratch, | 5352 __ And(at, scratch, |
5361 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); | 5353 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
5362 *cmp1 = at; | 5354 *cmp1 = at; |
5363 *cmp2 = Operand(zero_reg); | 5355 *cmp2 = Operand(zero_reg); |
5364 final_branch_condition = eq; | 5356 final_branch_condition = eq; |
5365 | 5357 |
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 | |
5380 } else { | 5358 } else { |
5381 *cmp1 = at; | 5359 *cmp1 = at; |
5382 *cmp2 = Operand(zero_reg); // Set to valid regs, to avoid caller assertion. | 5360 *cmp2 = Operand(zero_reg); // Set to valid regs, to avoid caller assertion. |
5383 __ Branch(false_label); | 5361 __ Branch(false_label); |
5384 } | 5362 } |
5385 | 5363 |
5386 return final_branch_condition; | 5364 return final_branch_condition; |
5387 } | 5365 } |
5388 | 5366 |
5389 | 5367 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5630 __ ld(result, FieldMemOperand(scratch, | 5608 __ ld(result, FieldMemOperand(scratch, |
5631 FixedArray::kHeaderSize - kPointerSize)); | 5609 FixedArray::kHeaderSize - kPointerSize)); |
5632 __ bind(deferred->exit()); | 5610 __ bind(deferred->exit()); |
5633 __ bind(&done); | 5611 __ bind(&done); |
5634 } | 5612 } |
5635 | 5613 |
5636 #undef __ | 5614 #undef __ |
5637 | 5615 |
5638 } // namespace internal | 5616 } // namespace internal |
5639 } // namespace v8 | 5617 } // namespace v8 |
OLD | NEW |