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

Unified Diff: src/crankshaft/arm64/lithium-codegen-arm64.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 register overlap on arm64 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/crankshaft/arm/lithium-codegen-arm.cc ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/arm64/lithium-codegen-arm64.cc
diff --git a/src/crankshaft/arm64/lithium-codegen-arm64.cc b/src/crankshaft/arm64/lithium-codegen-arm64.cc
index e6a5949deaf6ae95e5c2d69ae93868d00d6e4b04..3e074952af4a17b5f03921c82f18bd993dddd051 100644
--- a/src/crankshaft/arm64/lithium-codegen-arm64.cc
+++ b/src/crankshaft/arm64/lithium-codegen-arm64.cc
@@ -438,7 +438,7 @@ void LCodeGen::CallRuntimeFromDeferred(Runtime::FunctionId id,
int argc,
LInstruction* instr,
LOperand* context) {
- LoadContextFromDeferred(context);
+ if (context != nullptr) LoadContextFromDeferred(context);
__ CallRuntimeSaveDoubles(id);
RecordSafepointWithRegisters(
instr->pointer_map(), argc, Safepoint::kNoLazyDeopt);
@@ -1455,6 +1455,7 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
__ Mov(ToRegister(instr->result()), Smi::FromInt(0));
PushSafepointRegistersScope scope(this);
+ LoadContextFromDeferred(instr->context());
// We're in a SafepointRegistersScope so we can use any scratch registers.
Register size = x0;
if (instr->size()->IsConstantOperand()) {
@@ -1473,8 +1474,7 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
__ Mov(x10, Smi::FromInt(flags));
__ Push(size, x10);
- CallRuntimeFromDeferred(
- Runtime::kAllocateInTargetSpace, 2, instr, instr->context());
+ CallRuntimeFromDeferred(Runtime::kAllocateInTargetSpace, 2, instr, nullptr);
__ StoreToSafepointRegisterSlot(x0, ToRegister(instr->result()));
if (instr->hydrogen()->IsAllocationFoldingDominator()) {
@@ -4195,12 +4195,10 @@ void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) {
__ Mov(result, 0);
PushSafepointRegistersScope scope(this);
- // NumberTagU and NumberTagD use the context from the frame, rather than
- // the environment's HContext or HInlinedContext value.
- // They only call Runtime::kAllocateHeapNumber.
- // The corresponding HChange instructions are added in a phase that does
- // not have easy access to the local context.
- __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
+ // Reset the context register.
+ if (!result.is(cp)) {
+ __ Mov(cp, 0);
+ }
__ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
RecordSafepointWithRegisters(
instr->pointer_map(), 0, Safepoint::kNoLazyDeopt);
@@ -4260,13 +4258,10 @@ void LCodeGen::DoDeferredNumberTagU(LInstruction* instr,
{
// Preserve the value of all registers.
PushSafepointRegistersScope scope(this);
-
- // NumberTagU and NumberTagD use the context from the frame, rather than
- // the environment's HContext or HInlinedContext value.
- // They only call Runtime::kAllocateHeapNumber.
- // The corresponding HChange instructions are added in a phase that does
- // not have easy access to the local context.
- __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
+ // Reset the context register.
+ if (!dst.is(cp)) {
+ __ Mov(cp, 0);
+ }
__ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
RecordSafepointWithRegisters(
instr->pointer_map(), 0, Safepoint::kNoLazyDeopt);
« no previous file with comments | « src/crankshaft/arm/lithium-codegen-arm.cc ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698