| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 #include "src/crankshaft/s390/lithium-codegen-s390.h" | 6 #include "src/crankshaft/s390/lithium-codegen-s390.h" |
| 7 | 7 |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 4648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4659 // Slow case: Call the runtime system to do the number allocation. | 4659 // Slow case: Call the runtime system to do the number allocation. |
| 4660 __ bind(&slow); | 4660 __ bind(&slow); |
| 4661 { | 4661 { |
| 4662 // TODO(3095996): Put a valid pointer value in the stack slot where the | 4662 // TODO(3095996): Put a valid pointer value in the stack slot where the |
| 4663 // result register is stored, as this register is in the pointer map, but | 4663 // result register is stored, as this register is in the pointer map, but |
| 4664 // contains an integer value. | 4664 // contains an integer value. |
| 4665 __ LoadImmP(dst, Operand::Zero()); | 4665 __ LoadImmP(dst, Operand::Zero()); |
| 4666 | 4666 |
| 4667 // Preserve the value of all registers. | 4667 // Preserve the value of all registers. |
| 4668 PushSafepointRegistersScope scope(this); | 4668 PushSafepointRegistersScope scope(this); |
| 4669 | 4669 // Reset the context register. |
| 4670 // NumberTagI and NumberTagD use the context from the frame, rather than | 4670 if (!dst.is(cp)) { |
| 4671 // the environment's HContext or HInlinedContext value. | 4671 __ LoadImmP(cp, Operand::Zero()); |
| 4672 // They only call Runtime::kAllocateHeapNumber. | 4672 } |
| 4673 // The corresponding HChange instructions are added in a phase that does | |
| 4674 // not have easy access to the local context. | |
| 4675 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
| 4676 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); | 4673 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
| 4677 RecordSafepointWithRegisters(instr->pointer_map(), 0, | 4674 RecordSafepointWithRegisters(instr->pointer_map(), 0, |
| 4678 Safepoint::kNoLazyDeopt); | 4675 Safepoint::kNoLazyDeopt); |
| 4679 __ StoreToSafepointRegisterSlot(r2, dst); | 4676 __ StoreToSafepointRegisterSlot(r2, dst); |
| 4680 } | 4677 } |
| 4681 | 4678 |
| 4682 // Done. Put the value in dbl_scratch into the value of the allocated heap | 4679 // Done. Put the value in dbl_scratch into the value of the allocated heap |
| 4683 // number. | 4680 // number. |
| 4684 __ bind(&done); | 4681 __ bind(&done); |
| 4685 __ StoreDouble(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); | 4682 __ StoreDouble(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 4715 } | 4712 } |
| 4716 | 4713 |
| 4717 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { | 4714 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { |
| 4718 // TODO(3095996): Get rid of this. For now, we need to make the | 4715 // TODO(3095996): Get rid of this. For now, we need to make the |
| 4719 // result register contain a valid pointer because it is already | 4716 // result register contain a valid pointer because it is already |
| 4720 // contained in the register pointer map. | 4717 // contained in the register pointer map. |
| 4721 Register reg = ToRegister(instr->result()); | 4718 Register reg = ToRegister(instr->result()); |
| 4722 __ LoadImmP(reg, Operand::Zero()); | 4719 __ LoadImmP(reg, Operand::Zero()); |
| 4723 | 4720 |
| 4724 PushSafepointRegistersScope scope(this); | 4721 PushSafepointRegistersScope scope(this); |
| 4725 // NumberTagI and NumberTagD use the context from the frame, rather than | 4722 // Reset the context register. |
| 4726 // the environment's HContext or HInlinedContext value. | 4723 if (!reg.is(cp)) { |
| 4727 // They only call Runtime::kAllocateHeapNumber. | 4724 __ LoadImmP(cp, Operand::Zero()); |
| 4728 // The corresponding HChange instructions are added in a phase that does | 4725 } |
| 4729 // not have easy access to the local context. | |
| 4730 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
| 4731 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); | 4726 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
| 4732 RecordSafepointWithRegisters(instr->pointer_map(), 0, | 4727 RecordSafepointWithRegisters(instr->pointer_map(), 0, |
| 4733 Safepoint::kNoLazyDeopt); | 4728 Safepoint::kNoLazyDeopt); |
| 4734 __ StoreToSafepointRegisterSlot(r2, reg); | 4729 __ StoreToSafepointRegisterSlot(r2, reg); |
| 4735 } | 4730 } |
| 4736 | 4731 |
| 4737 void LCodeGen::DoSmiTag(LSmiTag* instr) { | 4732 void LCodeGen::DoSmiTag(LSmiTag* instr) { |
| 4738 HChange* hchange = instr->hydrogen(); | 4733 HChange* hchange = instr->hydrogen(); |
| 4739 Register input = ToRegister(instr->value()); | 4734 Register input = ToRegister(instr->value()); |
| 4740 Register output = ToRegister(instr->result()); | 4735 Register output = ToRegister(instr->result()); |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5675 __ LoadP(result, | 5670 __ LoadP(result, |
| 5676 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5671 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
| 5677 __ bind(deferred->exit()); | 5672 __ bind(deferred->exit()); |
| 5678 __ bind(&done); | 5673 __ bind(&done); |
| 5679 } | 5674 } |
| 5680 | 5675 |
| 5681 #undef __ | 5676 #undef __ |
| 5682 | 5677 |
| 5683 } // namespace internal | 5678 } // namespace internal |
| 5684 } // namespace v8 | 5679 } // namespace v8 |
| OLD | NEW |