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