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

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

Powered by Google App Engine
This is Rietveld 408576698