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 2162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2173 __ bind(¬_string); | 2173 __ bind(¬_string); |
2174 } | 2174 } |
2175 | 2175 |
2176 if (expected.Contains(ToBooleanStub::SYMBOL)) { | 2176 if (expected.Contains(ToBooleanStub::SYMBOL)) { |
2177 // Symbol value -> true. | 2177 // Symbol value -> true. |
2178 const Register scratch = scratch1(); | 2178 const Register scratch = scratch1(); |
2179 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 2179 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
2180 __ Branch(instr->TrueLabel(chunk_), eq, scratch, Operand(SYMBOL_TYPE)); | 2180 __ Branch(instr->TrueLabel(chunk_), eq, scratch, Operand(SYMBOL_TYPE)); |
2181 } | 2181 } |
2182 | 2182 |
| 2183 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { |
| 2184 // SIMD value -> true. |
| 2185 const Register scratch = scratch1(); |
| 2186 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 2187 __ Branch(instr->TrueLabel(chunk_), eq, scratch, |
| 2188 Operand(FLOAT32X4_TYPE)); |
| 2189 } |
| 2190 |
2183 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2191 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
2184 // heap number -> false iff +0, -0, or NaN. | 2192 // heap number -> false iff +0, -0, or NaN. |
2185 DoubleRegister dbl_scratch = double_scratch0(); | 2193 DoubleRegister dbl_scratch = double_scratch0(); |
2186 Label not_heap_number; | 2194 Label not_heap_number; |
2187 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); | 2195 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
2188 __ Branch(¬_heap_number, ne, map, Operand(at)); | 2196 __ Branch(¬_heap_number, ne, map, Operand(at)); |
2189 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); | 2197 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); |
2190 __ BranchF(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), | 2198 __ BranchF(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), |
2191 ne, dbl_scratch, kDoubleRegZero); | 2199 ne, dbl_scratch, kDoubleRegZero); |
2192 // Falls through if dbl_scratch == 0. | 2200 // Falls through if dbl_scratch == 0. |
(...skipping 3515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5708 __ Branch(USE_DELAY_SLOT, false_label, | 5716 __ Branch(USE_DELAY_SLOT, false_label, |
5709 gt, scratch, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 5717 gt, scratch, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
5710 // map is still valid, so the BitField can be loaded in delay slot. | 5718 // map is still valid, so the BitField can be loaded in delay slot. |
5711 // Check for undetectable objects => false. | 5719 // Check for undetectable objects => false. |
5712 __ lbu(at, FieldMemOperand(map, Map::kBitFieldOffset)); | 5720 __ lbu(at, FieldMemOperand(map, Map::kBitFieldOffset)); |
5713 __ And(at, at, 1 << Map::kIsUndetectable); | 5721 __ And(at, at, 1 << Map::kIsUndetectable); |
5714 *cmp1 = at; | 5722 *cmp1 = at; |
5715 *cmp2 = Operand(zero_reg); | 5723 *cmp2 = Operand(zero_reg); |
5716 final_branch_condition = eq; | 5724 final_branch_condition = eq; |
5717 | 5725 |
| 5726 } else if (String::Equals(type_name, factory->float32x4_string())) { |
| 5727 __ JumpIfSmi(input, false_label); |
| 5728 __ GetObjectType(input, input, scratch); |
| 5729 *cmp1 = scratch; |
| 5730 *cmp2 = Operand(FLOAT32X4_TYPE); |
| 5731 final_branch_condition = eq; |
| 5732 |
5718 } else { | 5733 } else { |
5719 *cmp1 = at; | 5734 *cmp1 = at; |
5720 *cmp2 = Operand(zero_reg); // Set to valid regs, to avoid caller assertion. | 5735 *cmp2 = Operand(zero_reg); // Set to valid regs, to avoid caller assertion. |
5721 __ Branch(false_label); | 5736 __ Branch(false_label); |
5722 } | 5737 } |
5723 | 5738 |
5724 return final_branch_condition; | 5739 return final_branch_condition; |
5725 } | 5740 } |
5726 | 5741 |
5727 | 5742 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6026 __ Push(at, ToRegister(instr->function())); | 6041 __ Push(at, ToRegister(instr->function())); |
6027 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6042 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6028 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6043 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6029 } | 6044 } |
6030 | 6045 |
6031 | 6046 |
6032 #undef __ | 6047 #undef __ |
6033 | 6048 |
6034 } // namespace internal | 6049 } // namespace internal |
6035 } // namespace v8 | 6050 } // namespace v8 |
OLD | NEW |