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/crankshaft/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.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/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
(...skipping 4723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4734 // Slow case: Call the runtime system to do the number allocation. | 4734 // Slow case: Call the runtime system to do the number allocation. |
4735 __ bind(&slow); | 4735 __ bind(&slow); |
4736 { | 4736 { |
4737 // TODO(3095996): Put a valid pointer value in the stack slot where the | 4737 // TODO(3095996): Put a valid pointer value in the stack slot where the |
4738 // result register is stored, as this register is in the pointer map, but | 4738 // result register is stored, as this register is in the pointer map, but |
4739 // contains an integer value. | 4739 // contains an integer value. |
4740 __ li(dst, Operand::Zero()); | 4740 __ li(dst, Operand::Zero()); |
4741 | 4741 |
4742 // Preserve the value of all registers. | 4742 // Preserve the value of all registers. |
4743 PushSafepointRegistersScope scope(this); | 4743 PushSafepointRegistersScope scope(this); |
4744 | 4744 // Reset the context register. |
4745 // NumberTagI and NumberTagD use the context from the frame, rather than | 4745 if (!dst.is(cp)) { |
4746 // the environment's HContext or HInlinedContext value. | 4746 __ li(cp, Operand::Zero()); |
4747 // They only call Runtime::kAllocateHeapNumber. | 4747 } |
4748 // The corresponding HChange instructions are added in a phase that does | |
4749 // not have easy access to the local context. | |
4750 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
4751 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); | 4748 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
4752 RecordSafepointWithRegisters(instr->pointer_map(), 0, | 4749 RecordSafepointWithRegisters(instr->pointer_map(), 0, |
4753 Safepoint::kNoLazyDeopt); | 4750 Safepoint::kNoLazyDeopt); |
4754 __ StoreToSafepointRegisterSlot(r3, dst); | 4751 __ StoreToSafepointRegisterSlot(r3, dst); |
4755 } | 4752 } |
4756 | 4753 |
4757 // Done. Put the value in dbl_scratch into the value of the allocated heap | 4754 // Done. Put the value in dbl_scratch into the value of the allocated heap |
4758 // number. | 4755 // number. |
4759 __ bind(&done); | 4756 __ bind(&done); |
4760 __ stfd(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); | 4757 __ stfd(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4792 | 4789 |
4793 | 4790 |
4794 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { | 4791 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { |
4795 // TODO(3095996): Get rid of this. For now, we need to make the | 4792 // TODO(3095996): Get rid of this. For now, we need to make the |
4796 // result register contain a valid pointer because it is already | 4793 // result register contain a valid pointer because it is already |
4797 // contained in the register pointer map. | 4794 // contained in the register pointer map. |
4798 Register reg = ToRegister(instr->result()); | 4795 Register reg = ToRegister(instr->result()); |
4799 __ li(reg, Operand::Zero()); | 4796 __ li(reg, Operand::Zero()); |
4800 | 4797 |
4801 PushSafepointRegistersScope scope(this); | 4798 PushSafepointRegistersScope scope(this); |
4802 // NumberTagI and NumberTagD use the context from the frame, rather than | 4799 // Reset the context register. |
4803 // the environment's HContext or HInlinedContext value. | 4800 if (!reg.is(cp)) { |
4804 // They only call Runtime::kAllocateHeapNumber. | 4801 __ li(cp, Operand::Zero()); |
4805 // The corresponding HChange instructions are added in a phase that does | 4802 } |
4806 // not have easy access to the local context. | |
4807 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
4808 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); | 4803 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
4809 RecordSafepointWithRegisters(instr->pointer_map(), 0, | 4804 RecordSafepointWithRegisters(instr->pointer_map(), 0, |
4810 Safepoint::kNoLazyDeopt); | 4805 Safepoint::kNoLazyDeopt); |
4811 __ StoreToSafepointRegisterSlot(r3, reg); | 4806 __ StoreToSafepointRegisterSlot(r3, reg); |
4812 } | 4807 } |
4813 | 4808 |
4814 | 4809 |
4815 void LCodeGen::DoSmiTag(LSmiTag* instr) { | 4810 void LCodeGen::DoSmiTag(LSmiTag* instr) { |
4816 HChange* hchange = instr->hydrogen(); | 4811 HChange* hchange = instr->hydrogen(); |
4817 Register input = ToRegister(instr->value()); | 4812 Register input = ToRegister(instr->value()); |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5789 __ LoadP(result, | 5784 __ LoadP(result, |
5790 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5785 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
5791 __ bind(deferred->exit()); | 5786 __ bind(deferred->exit()); |
5792 __ bind(&done); | 5787 __ bind(&done); |
5793 } | 5788 } |
5794 | 5789 |
5795 #undef __ | 5790 #undef __ |
5796 | 5791 |
5797 } // namespace internal | 5792 } // namespace internal |
5798 } // namespace v8 | 5793 } // namespace v8 |
OLD | NEW |