OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/crankshaft/x64/lithium-codegen-x64.h" | 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 4538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4549 // Slow case: Call the runtime system to do the number allocation. | 4549 // Slow case: Call the runtime system to do the number allocation. |
4550 __ bind(&slow); | 4550 __ bind(&slow); |
4551 { | 4551 { |
4552 // Put a valid pointer value in the stack slot where the result | 4552 // Put a valid pointer value in the stack slot where the result |
4553 // register is stored, as this register is in the pointer map, but contains | 4553 // register is stored, as this register is in the pointer map, but contains |
4554 // an integer value. | 4554 // an integer value. |
4555 __ Set(reg, 0); | 4555 __ Set(reg, 0); |
4556 | 4556 |
4557 // Preserve the value of all registers. | 4557 // Preserve the value of all registers. |
4558 PushSafepointRegistersScope scope(this); | 4558 PushSafepointRegistersScope scope(this); |
4559 | 4559 // Reset the context register. |
4560 // NumberTagIU uses the context from the frame, rather than | 4560 if (!reg.is(rsi)) { |
4561 // the environment's HContext or HInlinedContext value. | 4561 __ Set(rsi, 0); |
4562 // They only call Runtime::kAllocateHeapNumber. | 4562 } |
4563 // The corresponding HChange instructions are added in a phase that does | |
4564 // not have easy access to the local context. | |
4565 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | |
4566 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); | 4563 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
4567 RecordSafepointWithRegisters( | 4564 RecordSafepointWithRegisters( |
4568 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); | 4565 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |
4569 __ StoreToSafepointRegisterSlot(reg, rax); | 4566 __ StoreToSafepointRegisterSlot(reg, rax); |
4570 } | 4567 } |
4571 | 4568 |
4572 // Done. Put the value in temp_xmm into the value of the allocated heap | 4569 // Done. Put the value in temp_xmm into the value of the allocated heap |
4573 // number. | 4570 // number. |
4574 __ bind(&done); | 4571 __ bind(&done); |
4575 __ Movsd(FieldOperand(reg, HeapNumber::kValueOffset), temp_xmm); | 4572 __ Movsd(FieldOperand(reg, HeapNumber::kValueOffset), temp_xmm); |
(...skipping 29 matching lines...) Expand all Loading... |
4605 | 4602 |
4606 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { | 4603 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { |
4607 // TODO(3095996): Get rid of this. For now, we need to make the | 4604 // TODO(3095996): Get rid of this. For now, we need to make the |
4608 // result register contain a valid pointer because it is already | 4605 // result register contain a valid pointer because it is already |
4609 // contained in the register pointer map. | 4606 // contained in the register pointer map. |
4610 Register reg = ToRegister(instr->result()); | 4607 Register reg = ToRegister(instr->result()); |
4611 __ Move(reg, Smi::FromInt(0)); | 4608 __ Move(reg, Smi::FromInt(0)); |
4612 | 4609 |
4613 { | 4610 { |
4614 PushSafepointRegistersScope scope(this); | 4611 PushSafepointRegistersScope scope(this); |
4615 // NumberTagD uses the context from the frame, rather than | 4612 // Reset the context register. |
4616 // the environment's HContext or HInlinedContext value. | 4613 if (!reg.is(rsi)) { |
4617 // They only call Runtime::kAllocateHeapNumber. | 4614 __ Move(rsi, 0); |
4618 // The corresponding HChange instructions are added in a phase that does | 4615 } |
4619 // not have easy access to the local context. | |
4620 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | |
4621 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); | 4616 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
4622 RecordSafepointWithRegisters( | 4617 RecordSafepointWithRegisters( |
4623 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); | 4618 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |
4624 __ movp(kScratchRegister, rax); | 4619 __ movp(kScratchRegister, rax); |
4625 } | 4620 } |
4626 __ movp(reg, kScratchRegister); | 4621 __ movp(reg, kScratchRegister); |
4627 } | 4622 } |
4628 | 4623 |
4629 | 4624 |
4630 void LCodeGen::DoSmiTag(LSmiTag* instr) { | 4625 void LCodeGen::DoSmiTag(LSmiTag* instr) { |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5574 __ bind(deferred->exit()); | 5569 __ bind(deferred->exit()); |
5575 __ bind(&done); | 5570 __ bind(&done); |
5576 } | 5571 } |
5577 | 5572 |
5578 #undef __ | 5573 #undef __ |
5579 | 5574 |
5580 } // namespace internal | 5575 } // namespace internal |
5581 } // namespace v8 | 5576 } // namespace v8 |
5582 | 5577 |
5583 #endif // V8_TARGET_ARCH_X64 | 5578 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |