| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
| (...skipping 2286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2297 __ b(instr->FalseLabel(chunk_)); | 2297 __ b(instr->FalseLabel(chunk_)); |
| 2298 __ bind(¬_string); | 2298 __ bind(¬_string); |
| 2299 } | 2299 } |
| 2300 | 2300 |
| 2301 if (expected.Contains(ToBooleanStub::SYMBOL)) { | 2301 if (expected.Contains(ToBooleanStub::SYMBOL)) { |
| 2302 // Symbol value -> true. | 2302 // Symbol value -> true. |
| 2303 __ CompareInstanceType(map, ip, SYMBOL_TYPE); | 2303 __ CompareInstanceType(map, ip, SYMBOL_TYPE); |
| 2304 __ beq(instr->TrueLabel(chunk_)); | 2304 __ beq(instr->TrueLabel(chunk_)); |
| 2305 } | 2305 } |
| 2306 | 2306 |
| 2307 if (expected.Contains(ToBooleanStub::SIMD_TYPE)) { |
| 2308 // SIMD value -> true. |
| 2309 __ CompareInstanceType(map, ip, FLOAT32X4_TYPE); |
| 2310 __ beq(instr->TrueLabel(chunk_)); |
| 2311 } |
| 2312 |
| 2307 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2313 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
| 2308 // heap number -> false iff +0, -0, or NaN. | 2314 // heap number -> false iff +0, -0, or NaN. |
| 2309 Label not_heap_number; | 2315 Label not_heap_number; |
| 2310 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); | 2316 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); |
| 2311 __ bne(¬_heap_number); | 2317 __ bne(¬_heap_number); |
| 2312 __ lfd(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); | 2318 __ lfd(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); |
| 2313 // Test the double value. Zero and NaN are false. | 2319 // Test the double value. Zero and NaN are false. |
| 2314 __ fcmpu(dbl_scratch, kDoubleRegZero, cr7); | 2320 __ fcmpu(dbl_scratch, kDoubleRegZero, cr7); |
| 2315 __ mfcr(r0); | 2321 __ mfcr(r0); |
| 2316 __ andi(r0, r0, Operand(crZOrNaNBits)); | 2322 __ andi(r0, r0, Operand(crZOrNaNBits)); |
| (...skipping 3632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5949 __ CompareRoot(input, Heap::kNullValueRootIndex); | 5955 __ CompareRoot(input, Heap::kNullValueRootIndex); |
| 5950 __ beq(true_label); | 5956 __ beq(true_label); |
| 5951 __ CheckObjectTypeRange(input, map, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, | 5957 __ CheckObjectTypeRange(input, map, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, |
| 5952 LAST_NONCALLABLE_SPEC_OBJECT_TYPE, false_label); | 5958 LAST_NONCALLABLE_SPEC_OBJECT_TYPE, false_label); |
| 5953 // Check for undetectable objects => false. | 5959 // Check for undetectable objects => false. |
| 5954 __ lbz(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); | 5960 __ lbz(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); |
| 5955 __ ExtractBit(r0, scratch, Map::kIsUndetectable); | 5961 __ ExtractBit(r0, scratch, Map::kIsUndetectable); |
| 5956 __ cmpi(r0, Operand::Zero()); | 5962 __ cmpi(r0, Operand::Zero()); |
| 5957 final_branch_condition = eq; | 5963 final_branch_condition = eq; |
| 5958 | 5964 |
| 5965 } else if (String::Equals(type_name, factory->float32x4_string())) { |
| 5966 __ JumpIfSmi(input, false_label); |
| 5967 __ CompareObjectType(input, scratch, no_reg, FLOAT32X4_TYPE); |
| 5968 final_branch_condition = eq; |
| 5969 |
| 5959 } else { | 5970 } else { |
| 5960 __ b(false_label); | 5971 __ b(false_label); |
| 5961 } | 5972 } |
| 5962 | 5973 |
| 5963 return final_branch_condition; | 5974 return final_branch_condition; |
| 5964 } | 5975 } |
| 5965 | 5976 |
| 5966 | 5977 |
| 5967 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | 5978 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
| 5968 Register temp1 = ToRegister(instr->temp()); | 5979 Register temp1 = ToRegister(instr->temp()); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6256 __ Push(scope_info); | 6267 __ Push(scope_info); |
| 6257 __ push(ToRegister(instr->function())); | 6268 __ push(ToRegister(instr->function())); |
| 6258 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6269 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6259 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6270 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6260 } | 6271 } |
| 6261 | 6272 |
| 6262 | 6273 |
| 6263 #undef __ | 6274 #undef __ |
| 6264 } // namespace internal | 6275 } // namespace internal |
| 6265 } // namespace v8 | 6276 } // namespace v8 |
| OLD | NEW |