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