OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/hydrogen-osr.h" | 9 #include "src/hydrogen-osr.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
(...skipping 4455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4466 DCHECK((shift_size == 3) || (shift_size == -29)); | 4466 DCHECK((shift_size == 3) || (shift_size == -29)); |
4467 if (shift_size == 3) { | 4467 if (shift_size == 3) { |
4468 __ dsll(at, ToRegister(instr->key()), 3); | 4468 __ dsll(at, ToRegister(instr->key()), 3); |
4469 } else if (shift_size == -29) { | 4469 } else if (shift_size == -29) { |
4470 __ dsra(at, ToRegister(instr->key()), 29); | 4470 __ dsra(at, ToRegister(instr->key()), 29); |
4471 } | 4471 } |
4472 __ Daddu(scratch, scratch, at); | 4472 __ Daddu(scratch, scratch, at); |
4473 } | 4473 } |
4474 | 4474 |
4475 if (instr->NeedsCanonicalization()) { | 4475 if (instr->NeedsCanonicalization()) { |
4476 Label is_nan; | 4476 __ FPUCanonicalizeNaN(double_scratch, value); |
4477 // Check for NaN. All NaNs must be canonicalized. | |
4478 __ BranchF(NULL, &is_nan, eq, value, value); | |
4479 __ Branch(¬_nan); | |
4480 | |
4481 // Only load canonical NaN if the comparison above set the overflow. | |
4482 __ bind(&is_nan); | |
4483 __ LoadRoot(at, Heap::kNanValueRootIndex); | |
4484 __ ldc1(double_scratch, FieldMemOperand(at, HeapNumber::kValueOffset)); | |
4485 __ sdc1(double_scratch, MemOperand(scratch, 0)); | 4477 __ sdc1(double_scratch, MemOperand(scratch, 0)); |
4486 __ Branch(&done); | 4478 } else { |
| 4479 __ sdc1(value, MemOperand(scratch, 0)); |
4487 } | 4480 } |
4488 | |
4489 __ bind(¬_nan); | |
4490 __ sdc1(value, MemOperand(scratch, 0)); | |
4491 __ bind(&done); | |
4492 } | 4481 } |
4493 | 4482 |
4494 | 4483 |
4495 void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { | 4484 void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { |
4496 Register value = ToRegister(instr->value()); | 4485 Register value = ToRegister(instr->value()); |
4497 Register elements = ToRegister(instr->elements()); | 4486 Register elements = ToRegister(instr->elements()); |
4498 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) | 4487 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) |
4499 : no_reg; | 4488 : no_reg; |
4500 Register scratch = scratch0(); | 4489 Register scratch = scratch0(); |
4501 Register store_base = scratch; | 4490 Register store_base = scratch; |
(...skipping 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6057 __ li(at, scope_info); | 6046 __ li(at, scope_info); |
6058 __ Push(at, ToRegister(instr->function())); | 6047 __ Push(at, ToRegister(instr->function())); |
6059 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6048 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6060 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6049 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6061 } | 6050 } |
6062 | 6051 |
6063 | 6052 |
6064 #undef __ | 6053 #undef __ |
6065 | 6054 |
6066 } } // namespace v8::internal | 6055 } } // namespace v8::internal |
OLD | NEW |