Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 716f78dc1ba4d67d9250e13077e11747a45c4499..f2b195ec9843420a0e6c2011fa2ab043a3caa006 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -184,10 +184,13 @@ void FullCodeGenerator::Generate() { |
// Possibly allocate a local context. |
int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
if (heap_slots > 0) { |
- Comment cmnt(masm_, "[ Allocate local context"); |
- // Argument to NewContext is the function, which is in r1. |
+ // Argument to NewContext is the function, which is still in r1. |
+ Comment cmnt(masm_, "[ Allocate context"); |
__ push(r1); |
- if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
+ if (FLAG_harmony_scoping && info->scope()->is_global_scope()) { |
+ __ Push(info->scope()->GetScopeInfo()); |
+ __ CallRuntime(Runtime::kNewGlobalContext, 2); |
+ } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
FastNewContextStub stub(heap_slots); |
__ CallStub(&stub); |
} else { |