Index: src/arm64/lithium-codegen-arm64.cc |
diff --git a/src/arm64/lithium-codegen-arm64.cc b/src/arm64/lithium-codegen-arm64.cc |
index 7ed95ed9abe8db06fbd158813f963cdbd4329b3f..b317900a79e059c3538335d592f28cb745628757 100644 |
--- a/src/arm64/lithium-codegen-arm64.cc |
+++ b/src/arm64/lithium-codegen-arm64.cc |
@@ -665,16 +665,27 @@ bool LCodeGen::GeneratePrologue() { |
if (info()->saves_caller_doubles()) { |
SaveCallerDoubles(); |
} |
+ return !is_aborted(); |
+} |
+ |
+ |
+void LCodeGen::DoPrologue(LPrologue* instr) { |
+ Comment(";;; Prologue begin"); |
// Allocate a local context if needed. |
- int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
- if (heap_slots > 0) { |
+ if (info()->num_heap_slots() > 0) { |
Comment(";;; Allocate local context"); |
bool need_write_barrier = true; |
// Argument to NewContext is the function, which is in x1. |
- DCHECK(!info()->scope()->is_script_scope()); |
- if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
- FastNewContextStub stub(isolate(), heap_slots); |
+ int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
+ Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; |
+ if (info()->scope()->is_script_scope()) { |
+ __ Mov(x10, Operand(info()->scope()->GetScopeInfo(info()->isolate()))); |
+ __ Push(x1, x10); |
+ __ CallRuntime(Runtime::kNewScriptContext, 2); |
+ deopt_mode = Safepoint::kLazyDeopt; |
+ } else if (slots <= FastNewContextStub::kMaximumSlots) { |
+ FastNewContextStub stub(isolate(), slots); |
__ CallStub(&stub); |
// Result of FastNewContextStub is always in new space. |
need_write_barrier = false; |
@@ -682,7 +693,7 @@ bool LCodeGen::GeneratePrologue() { |
__ Push(x1); |
__ CallRuntime(Runtime::kNewFunctionContext, 1); |
} |
- RecordSafepoint(Safepoint::kNoLazyDeopt); |
+ RecordSafepoint(deopt_mode); |
// Context is returned in x0. It replaces the context passed to us. It's |
// saved in the stack and kept live in cp. |
__ Mov(cp, x0); |
@@ -719,14 +730,7 @@ bool LCodeGen::GeneratePrologue() { |
Comment(";;; End allocate local context"); |
} |
- // Trace the call. |
- if (FLAG_trace && info()->IsOptimizing()) { |
- // We have not executed any compiled code yet, so cp still holds the |
- // incoming context. |
- __ CallRuntime(Runtime::kTraceEnter, 0); |
- } |
- |
- return !is_aborted(); |
+ Comment(";;; Prologue end"); |
} |