Index: src/mips/full-codegen-mips.cc |
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc |
index 14d98e395b2b9b6e4c1023bbea667b93f4545080..b78c78332eb5370df91969b841df1dfd18eb45ed 100644 |
--- a/src/mips/full-codegen-mips.cc |
+++ b/src/mips/full-codegen-mips.cc |
@@ -192,10 +192,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 a1. |
+ Comment cmnt(masm_, "[ Allocate context"); |
+ // Argument to NewContext is the function, which is still in a1. |
__ push(a1); |
- 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 { |