Index: src/x87/lithium-codegen-x87.cc |
diff --git a/src/x87/lithium-codegen-x87.cc b/src/x87/lithium-codegen-x87.cc |
index bd2e0844081ea4dd078b7c360d115b91e4df3da2..3c2471627e66286bb8bd9f7cc63012885037c9ae 100644 |
--- a/src/x87/lithium-codegen-x87.cc |
+++ b/src/x87/lithium-codegen-x87.cc |
@@ -215,16 +215,27 @@ bool LCodeGen::GeneratePrologue() { |
} |
} |
} |
+ return !is_aborted(); |
+} |
+ |
+ |
+void LCodeGen::DoPrologue(LPrologue* instr) { |
+ Comment(";;; Prologue begin"); |
// Possibly allocate a local context. |
- 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 still in edi. |
- DCHECK(!info()->scope()->is_script_scope()); |
- if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
- FastNewContextStub stub(isolate(), heap_slots); |
+ int slots = info_->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
+ Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; |
+ if (info()->scope()->is_script_scope()) { |
+ __ push(edi); |
+ __ Push(info()->scope()->GetScopeInfo(info()->isolate())); |
+ __ 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; |
@@ -232,7 +243,8 @@ bool LCodeGen::GeneratePrologue() { |
__ push(edi); |
__ CallRuntime(Runtime::kNewFunctionContext, 1); |
} |
- RecordSafepoint(Safepoint::kNoLazyDeopt); |
+ RecordSafepoint(deopt_mode); |
+ |
// Context is returned in eax. It replaces the context passed to us. |
// It's saved in the stack and kept live in esi. |
__ mov(esi, eax); |
@@ -268,13 +280,8 @@ bool LCodeGen::GeneratePrologue() { |
// Initailize FPU state. |
__ fninit(); |
- // Trace the call. |
- if (FLAG_trace && info()->IsOptimizing()) { |
- // We have not executed any compiled code yet, so esi still holds the |
- // incoming context. |
- __ CallRuntime(Runtime::kTraceEnter, 0); |
- } |
- return !is_aborted(); |
+ |
+ Comment(";;; Prologue end"); |
} |