| 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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 6 | 6 |
| 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.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 4593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4604 // Slow case: Call the runtime system to do the number allocation. | 4604 // Slow case: Call the runtime system to do the number allocation. |
| 4605 __ bind(&slow); | 4605 __ bind(&slow); |
| 4606 { | 4606 { |
| 4607 // TODO(3095996): Put a valid pointer value in the stack slot where the | 4607 // TODO(3095996): Put a valid pointer value in the stack slot where the |
| 4608 // result register is stored, as this register is in the pointer map, but | 4608 // result register is stored, as this register is in the pointer map, but |
| 4609 // contains an integer value. | 4609 // contains an integer value. |
| 4610 __ Move(reg, Immediate(0)); | 4610 __ Move(reg, Immediate(0)); |
| 4611 | 4611 |
| 4612 // Preserve the value of all registers. | 4612 // Preserve the value of all registers. |
| 4613 PushSafepointRegistersScope scope(this); | 4613 PushSafepointRegistersScope scope(this); |
| 4614 | 4614 // Reset the context register. |
| 4615 // NumberTagI and NumberTagD use the context from the frame, rather than | 4615 if (!reg.is(esi)) { |
| 4616 // the environment's HContext or HInlinedContext value. | 4616 __ Move(esi, Immediate(0)); |
| 4617 // They only call Runtime::kAllocateHeapNumber. | 4617 } |
| 4618 // The corresponding HChange instructions are added in a phase that does | |
| 4619 // not have easy access to the local context. | |
| 4620 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | |
| 4621 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); | 4618 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
| 4622 RecordSafepointWithRegisters( | 4619 RecordSafepointWithRegisters( |
| 4623 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); | 4620 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |
| 4624 __ StoreToSafepointRegisterSlot(reg, eax); | 4621 __ StoreToSafepointRegisterSlot(reg, eax); |
| 4625 } | 4622 } |
| 4626 | 4623 |
| 4627 __ bind(&done); | 4624 __ bind(&done); |
| 4628 __ fstp_d(FieldOperand(reg, HeapNumber::kValueOffset)); | 4625 __ fstp_d(FieldOperand(reg, HeapNumber::kValueOffset)); |
| 4629 } | 4626 } |
| 4630 | 4627 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4665 | 4662 |
| 4666 | 4663 |
| 4667 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { | 4664 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { |
| 4668 // TODO(3095996): Get rid of this. For now, we need to make the | 4665 // TODO(3095996): Get rid of this. For now, we need to make the |
| 4669 // result register contain a valid pointer because it is already | 4666 // result register contain a valid pointer because it is already |
| 4670 // contained in the register pointer map. | 4667 // contained in the register pointer map. |
| 4671 Register reg = ToRegister(instr->result()); | 4668 Register reg = ToRegister(instr->result()); |
| 4672 __ Move(reg, Immediate(0)); | 4669 __ Move(reg, Immediate(0)); |
| 4673 | 4670 |
| 4674 PushSafepointRegistersScope scope(this); | 4671 PushSafepointRegistersScope scope(this); |
| 4675 // NumberTagI and NumberTagD use the context from the frame, rather than | 4672 // Reset the context register. |
| 4676 // the environment's HContext or HInlinedContext value. | 4673 if (!reg.is(esi)) { |
| 4677 // They only call Runtime::kAllocateHeapNumber. | 4674 __ Move(esi, Immediate(0)); |
| 4678 // The corresponding HChange instructions are added in a phase that does | 4675 } |
| 4679 // not have easy access to the local context. | |
| 4680 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | |
| 4681 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); | 4676 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
| 4682 RecordSafepointWithRegisters( | 4677 RecordSafepointWithRegisters( |
| 4683 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); | 4678 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |
| 4684 __ StoreToSafepointRegisterSlot(reg, eax); | 4679 __ StoreToSafepointRegisterSlot(reg, eax); |
| 4685 } | 4680 } |
| 4686 | 4681 |
| 4687 | 4682 |
| 4688 void LCodeGen::DoSmiTag(LSmiTag* instr) { | 4683 void LCodeGen::DoSmiTag(LSmiTag* instr) { |
| 4689 HChange* hchange = instr->hydrogen(); | 4684 HChange* hchange = instr->hydrogen(); |
| 4690 Register input = ToRegister(instr->value()); | 4685 Register input = ToRegister(instr->value()); |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5779 __ bind(deferred->exit()); | 5774 __ bind(deferred->exit()); |
| 5780 __ bind(&done); | 5775 __ bind(&done); |
| 5781 } | 5776 } |
| 5782 | 5777 |
| 5783 #undef __ | 5778 #undef __ |
| 5784 | 5779 |
| 5785 } // namespace internal | 5780 } // namespace internal |
| 5786 } // namespace v8 | 5781 } // namespace v8 |
| 5787 | 5782 |
| 5788 #endif // V8_TARGET_ARCH_X87 | 5783 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |