OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2176 | 2176 |
2177 if (expected.Contains(ToBooleanStub::SYMBOL)) { | 2177 if (expected.Contains(ToBooleanStub::SYMBOL)) { |
2178 // Symbol value -> true. | 2178 // Symbol value -> true. |
2179 const Register scratch = scratch1(); | 2179 const Register scratch = scratch1(); |
2180 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 2180 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
2181 __ Branch(instr->TrueLabel(chunk_), eq, scratch, Operand(SYMBOL_TYPE)); | 2181 __ Branch(instr->TrueLabel(chunk_), eq, scratch, Operand(SYMBOL_TYPE)); |
2182 } | 2182 } |
2183 | 2183 |
2184 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { | 2184 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { |
2185 // SIMD value -> true. | 2185 // SIMD value -> true. |
2186 Label not_simd; | |
2187 const Register scratch = scratch1(); | 2186 const Register scratch = scratch1(); |
2188 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 2187 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
2189 __ Branch(¬_simd, lt, scratch, Operand(FIRST_SIMD_VALUE_TYPE)); | 2188 __ Branch(instr->TrueLabel(chunk_), eq, scratch, |
2190 __ Branch(instr->TrueLabel(chunk_), le, scratch, | 2189 Operand(SIMD128_VALUE_TYPE)); |
2191 Operand(LAST_SIMD_VALUE_TYPE)); | |
2192 __ bind(¬_simd); | |
2193 } | 2190 } |
2194 | 2191 |
2195 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2192 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
2196 // heap number -> false iff +0, -0, or NaN. | 2193 // heap number -> false iff +0, -0, or NaN. |
2197 DoubleRegister dbl_scratch = double_scratch0(); | 2194 DoubleRegister dbl_scratch = double_scratch0(); |
2198 Label not_heap_number; | 2195 Label not_heap_number; |
2199 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); | 2196 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
2200 __ Branch(¬_heap_number, ne, map, Operand(at)); | 2197 __ Branch(¬_heap_number, ne, map, Operand(at)); |
2201 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); | 2198 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); |
2202 __ BranchF(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), | 2199 __ BranchF(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), |
(...skipping 3534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5737 __ Branch(USE_DELAY_SLOT, false_label, | 5734 __ Branch(USE_DELAY_SLOT, false_label, |
5738 gt, scratch, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 5735 gt, scratch, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
5739 // map is still valid, so the BitField can be loaded in delay slot. | 5736 // map is still valid, so the BitField can be loaded in delay slot. |
5740 // Check for undetectable objects => false. | 5737 // Check for undetectable objects => false. |
5741 __ lbu(at, FieldMemOperand(map, Map::kBitFieldOffset)); | 5738 __ lbu(at, FieldMemOperand(map, Map::kBitFieldOffset)); |
5742 __ And(at, at, 1 << Map::kIsUndetectable); | 5739 __ And(at, at, 1 << Map::kIsUndetectable); |
5743 *cmp1 = at; | 5740 *cmp1 = at; |
5744 *cmp2 = Operand(zero_reg); | 5741 *cmp2 = Operand(zero_reg); |
5745 final_branch_condition = eq; | 5742 final_branch_condition = eq; |
5746 | 5743 |
5747 } else if (String::Equals(type_name, factory->float32x4_string())) { | 5744 // clang-format off |
5748 __ JumpIfSmi(input, false_label); | 5745 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
5749 __ GetObjectType(input, input, scratch); | 5746 } else if (String::Equals(type_name, factory->type##_string())) { \ |
5750 *cmp1 = scratch; | 5747 __ JumpIfSmi(input, false_label); \ |
5751 *cmp2 = Operand(FLOAT32X4_TYPE); | 5748 __ lw(input, FieldMemOperand(input, HeapObject::kMapOffset)); \ |
| 5749 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \ |
| 5750 *cmp1 = input; \ |
| 5751 *cmp2 = Operand(at); \ |
5752 final_branch_condition = eq; | 5752 final_branch_condition = eq; |
5753 | 5753 SIMD128_TYPES(SIMD128_TYPE) |
5754 } else if (String::Equals(type_name, factory->int32x4_string())) { | 5754 #undef SIMD128_TYPE |
5755 __ JumpIfSmi(input, false_label); | 5755 // clang-format on |
5756 __ GetObjectType(input, input, scratch); | |
5757 *cmp1 = scratch; | |
5758 *cmp2 = Operand(INT32X4_TYPE); | |
5759 final_branch_condition = eq; | |
5760 | |
5761 } else if (String::Equals(type_name, factory->bool32x4_string())) { | |
5762 __ JumpIfSmi(input, false_label); | |
5763 __ GetObjectType(input, input, scratch); | |
5764 *cmp1 = scratch; | |
5765 *cmp2 = Operand(BOOL32X4_TYPE); | |
5766 final_branch_condition = eq; | |
5767 | |
5768 } else if (String::Equals(type_name, factory->int16x8_string())) { | |
5769 __ JumpIfSmi(input, false_label); | |
5770 __ GetObjectType(input, input, scratch); | |
5771 *cmp1 = scratch; | |
5772 *cmp2 = Operand(INT16X8_TYPE); | |
5773 final_branch_condition = eq; | |
5774 | |
5775 } else if (String::Equals(type_name, factory->bool16x8_string())) { | |
5776 __ JumpIfSmi(input, false_label); | |
5777 __ GetObjectType(input, input, scratch); | |
5778 *cmp1 = scratch; | |
5779 *cmp2 = Operand(BOOL16X8_TYPE); | |
5780 final_branch_condition = eq; | |
5781 | |
5782 } else if (String::Equals(type_name, factory->int8x16_string())) { | |
5783 __ JumpIfSmi(input, false_label); | |
5784 __ GetObjectType(input, input, scratch); | |
5785 *cmp1 = scratch; | |
5786 *cmp2 = Operand(INT8X16_TYPE); | |
5787 final_branch_condition = eq; | |
5788 | |
5789 } else if (String::Equals(type_name, factory->bool8x16_string())) { | |
5790 __ JumpIfSmi(input, false_label); | |
5791 __ GetObjectType(input, input, scratch); | |
5792 *cmp1 = scratch; | |
5793 *cmp2 = Operand(BOOL8X16_TYPE); | |
5794 final_branch_condition = eq; | |
5795 | 5756 |
5796 } else { | 5757 } else { |
5797 *cmp1 = at; | 5758 *cmp1 = at; |
5798 *cmp2 = Operand(zero_reg); // Set to valid regs, to avoid caller assertion. | 5759 *cmp2 = Operand(zero_reg); // Set to valid regs, to avoid caller assertion. |
5799 __ Branch(false_label); | 5760 __ Branch(false_label); |
5800 } | 5761 } |
5801 | 5762 |
5802 return final_branch_condition; | 5763 return final_branch_condition; |
5803 } | 5764 } |
5804 | 5765 |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6104 __ Push(at, ToRegister(instr->function())); | 6065 __ Push(at, ToRegister(instr->function())); |
6105 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6066 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6106 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6067 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6107 } | 6068 } |
6108 | 6069 |
6109 | 6070 |
6110 #undef __ | 6071 #undef __ |
6111 | 6072 |
6112 } // namespace internal | 6073 } // namespace internal |
6113 } // namespace v8 | 6074 } // namespace v8 |
OLD | NEW |