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; |
2186 const Register scratch = scratch1(); | 2187 const Register scratch = scratch1(); |
2187 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 2188 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
2188 __ Branch(instr->TrueLabel(chunk_), eq, scratch, | 2189 __ Branch(¬_simd, lt, at, Operand(FIRST_SIMD128_VALUE_TYPE)); |
2189 Operand(FLOAT32X4_TYPE)); | 2190 __ Branch(instr->TrueLabel(chunk_), le, scratch, |
| 2191 Operand(LAST_SIMD128_VALUE_TYPE)); |
| 2192 __ bind(¬_simd); |
2190 } | 2193 } |
2191 | 2194 |
2192 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2195 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
2193 // heap number -> false iff +0, -0, or NaN. | 2196 // heap number -> false iff +0, -0, or NaN. |
2194 DoubleRegister dbl_scratch = double_scratch0(); | 2197 DoubleRegister dbl_scratch = double_scratch0(); |
2195 Label not_heap_number; | 2198 Label not_heap_number; |
2196 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); | 2199 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
2197 __ Branch(¬_heap_number, ne, map, Operand(at)); | 2200 __ Branch(¬_heap_number, ne, map, Operand(at)); |
2198 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); | 2201 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); |
2199 __ BranchF(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), | 2202 __ BranchF(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), |
(...skipping 3542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5742 *cmp2 = Operand(zero_reg); | 5745 *cmp2 = Operand(zero_reg); |
5743 final_branch_condition = eq; | 5746 final_branch_condition = eq; |
5744 | 5747 |
5745 } else if (String::Equals(type_name, factory->float32x4_string())) { | 5748 } else if (String::Equals(type_name, factory->float32x4_string())) { |
5746 __ JumpIfSmi(input, false_label); | 5749 __ JumpIfSmi(input, false_label); |
5747 __ GetObjectType(input, input, scratch); | 5750 __ GetObjectType(input, input, scratch); |
5748 *cmp1 = scratch; | 5751 *cmp1 = scratch; |
5749 *cmp2 = Operand(FLOAT32X4_TYPE); | 5752 *cmp2 = Operand(FLOAT32X4_TYPE); |
5750 final_branch_condition = eq; | 5753 final_branch_condition = eq; |
5751 | 5754 |
| 5755 } else if (String::Equals(type_name, factory->int32x4_string())) { |
| 5756 __ JumpIfSmi(input, false_label); |
| 5757 __ GetObjectType(input, input, scratch); |
| 5758 *cmp1 = scratch; |
| 5759 *cmp2 = Operand(INT32X4_TYPE); |
| 5760 final_branch_condition = eq; |
| 5761 |
| 5762 } else if (String::Equals(type_name, factory->bool32x4_string())) { |
| 5763 __ JumpIfSmi(input, false_label); |
| 5764 __ GetObjectType(input, input, scratch); |
| 5765 *cmp1 = scratch; |
| 5766 *cmp2 = Operand(BOOL32X4_TYPE); |
| 5767 final_branch_condition = eq; |
| 5768 |
| 5769 } else if (String::Equals(type_name, factory->int16x8_string())) { |
| 5770 __ JumpIfSmi(input, false_label); |
| 5771 __ GetObjectType(input, input, scratch); |
| 5772 *cmp1 = scratch; |
| 5773 *cmp2 = Operand(INT16X8_TYPE); |
| 5774 final_branch_condition = eq; |
| 5775 |
| 5776 } else if (String::Equals(type_name, factory->bool16x8_string())) { |
| 5777 __ JumpIfSmi(input, false_label); |
| 5778 __ GetObjectType(input, input, scratch); |
| 5779 *cmp1 = scratch; |
| 5780 *cmp2 = Operand(BOOL16X8_TYPE); |
| 5781 final_branch_condition = eq; |
| 5782 |
| 5783 } else if (String::Equals(type_name, factory->int8x16_string())) { |
| 5784 __ JumpIfSmi(input, false_label); |
| 5785 __ GetObjectType(input, input, scratch); |
| 5786 *cmp1 = scratch; |
| 5787 *cmp2 = Operand(INT8X16_TYPE); |
| 5788 final_branch_condition = eq; |
| 5789 |
| 5790 } else if (String::Equals(type_name, factory->bool8x16_string())) { |
| 5791 __ JumpIfSmi(input, false_label); |
| 5792 __ GetObjectType(input, input, scratch); |
| 5793 *cmp1 = scratch; |
| 5794 *cmp2 = Operand(BOOL8X16_TYPE); |
| 5795 final_branch_condition = eq; |
| 5796 |
5752 } else { | 5797 } else { |
5753 *cmp1 = at; | 5798 *cmp1 = at; |
5754 *cmp2 = Operand(zero_reg); // Set to valid regs, to avoid caller assertion. | 5799 *cmp2 = Operand(zero_reg); // Set to valid regs, to avoid caller assertion. |
5755 __ Branch(false_label); | 5800 __ Branch(false_label); |
5756 } | 5801 } |
5757 | 5802 |
5758 return final_branch_condition; | 5803 return final_branch_condition; |
5759 } | 5804 } |
5760 | 5805 |
5761 | 5806 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6060 __ Push(at, ToRegister(instr->function())); | 6105 __ Push(at, ToRegister(instr->function())); |
6061 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6106 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6062 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6107 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6063 } | 6108 } |
6064 | 6109 |
6065 | 6110 |
6066 #undef __ | 6111 #undef __ |
6067 | 6112 |
6068 } // namespace internal | 6113 } // namespace internal |
6069 } // namespace v8 | 6114 } // namespace v8 |
OLD | NEW |