Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1010)

Side by Side Diff: src/crankshaft/s390/lithium-codegen-s390.cc

Issue 2122953002: [crankshaft] do not restore rsi in stub for deferred number conversions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixing wrong registers Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 4646 matching lines...) Expand 10 before | Expand all | Expand 10 after
4657 // Slow case: Call the runtime system to do the number allocation. 4657 // Slow case: Call the runtime system to do the number allocation.
4658 __ bind(&slow); 4658 __ bind(&slow);
4659 { 4659 {
4660 // TODO(3095996): Put a valid pointer value in the stack slot where the 4660 // TODO(3095996): Put a valid pointer value in the stack slot where the
4661 // result register is stored, as this register is in the pointer map, but 4661 // result register is stored, as this register is in the pointer map, but
4662 // contains an integer value. 4662 // contains an integer value.
4663 __ LoadImmP(dst, Operand::Zero()); 4663 __ LoadImmP(dst, Operand::Zero());
4664 4664
4665 // Preserve the value of all registers. 4665 // Preserve the value of all registers.
4666 PushSafepointRegistersScope scope(this); 4666 PushSafepointRegistersScope scope(this);
4667 4667 // Reset the context register.
4668 // NumberTagI and NumberTagD use the context from the frame, rather than 4668 if (!dst.is(cp)) {
4669 // the environment's HContext or HInlinedContext value. 4669 __ LoadImmP(cp, Operand::Zero());
4670 // They only call Runtime::kAllocateHeapNumber. 4670 }
4671 // The corresponding HChange instructions are added in a phase that does
4672 // not have easy access to the local context.
4673 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
4674 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); 4671 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
4675 RecordSafepointWithRegisters(instr->pointer_map(), 0, 4672 RecordSafepointWithRegisters(instr->pointer_map(), 0,
4676 Safepoint::kNoLazyDeopt); 4673 Safepoint::kNoLazyDeopt);
4677 __ StoreToSafepointRegisterSlot(r2, dst); 4674 __ StoreToSafepointRegisterSlot(r2, dst);
4678 } 4675 }
4679 4676
4680 // Done. Put the value in dbl_scratch into the value of the allocated heap 4677 // Done. Put the value in dbl_scratch into the value of the allocated heap
4681 // number. 4678 // number.
4682 __ bind(&done); 4679 __ bind(&done);
4683 __ StoreDouble(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); 4680 __ StoreDouble(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset));
(...skipping 29 matching lines...) Expand all
4713 } 4710 }
4714 4711
4715 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { 4712 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) {
4716 // TODO(3095996): Get rid of this. For now, we need to make the 4713 // TODO(3095996): Get rid of this. For now, we need to make the
4717 // result register contain a valid pointer because it is already 4714 // result register contain a valid pointer because it is already
4718 // contained in the register pointer map. 4715 // contained in the register pointer map.
4719 Register reg = ToRegister(instr->result()); 4716 Register reg = ToRegister(instr->result());
4720 __ LoadImmP(reg, Operand::Zero()); 4717 __ LoadImmP(reg, Operand::Zero());
4721 4718
4722 PushSafepointRegistersScope scope(this); 4719 PushSafepointRegistersScope scope(this);
4723 // NumberTagI and NumberTagD use the context from the frame, rather than 4720 // Reset the context register.
4724 // the environment's HContext or HInlinedContext value. 4721 if (!reg.is(cp)) {
4725 // They only call Runtime::kAllocateHeapNumber. 4722 __ LoadImmP(cp, Operand::Zero());
4726 // The corresponding HChange instructions are added in a phase that does 4723 }
4727 // not have easy access to the local context.
4728 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
4729 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); 4724 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
4730 RecordSafepointWithRegisters(instr->pointer_map(), 0, 4725 RecordSafepointWithRegisters(instr->pointer_map(), 0,
4731 Safepoint::kNoLazyDeopt); 4726 Safepoint::kNoLazyDeopt);
4732 __ StoreToSafepointRegisterSlot(r2, reg); 4727 __ StoreToSafepointRegisterSlot(r2, reg);
4733 } 4728 }
4734 4729
4735 void LCodeGen::DoSmiTag(LSmiTag* instr) { 4730 void LCodeGen::DoSmiTag(LSmiTag* instr) {
4736 HChange* hchange = instr->hydrogen(); 4731 HChange* hchange = instr->hydrogen();
4737 Register input = ToRegister(instr->value()); 4732 Register input = ToRegister(instr->value());
4738 Register output = ToRegister(instr->result()); 4733 Register output = ToRegister(instr->result());
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
5673 __ LoadP(result, 5668 __ LoadP(result,
5674 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); 5669 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize));
5675 __ bind(deferred->exit()); 5670 __ bind(deferred->exit());
5676 __ bind(&done); 5671 __ bind(&done);
5677 } 5672 }
5678 5673
5679 #undef __ 5674 #undef __
5680 5675
5681 } // namespace internal 5676 } // namespace internal
5682 } // namespace v8 5677 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698