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