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..d513bfb6623811934456056ce75498e9e716d8bf 100644 |
--- a/src/mips/full-codegen-mips.cc |
+++ b/src/mips/full-codegen-mips.cc |
@@ -192,14 +192,22 @@ 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. |
- __ push(a1); |
- if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
- FastNewContextStub stub(heap_slots); |
- __ CallStub(&stub); |
+ if (info->scope()->is_global_scope()) { |
+ Comment cmnt(masm_, "[ Allocate global context"); |
+ // Argument to NewContext is the function, which is still in edi. |
Sven Panne
2012/08/27 06:24:54
copy-n-paste typo: should be a1. Consider moving t
rossberg
2012/08/27 09:07:16
Done.
|
+ __ push(a1); |
+ __ Push(info->scope()->GetScopeInfo()); |
+ __ CallRuntime(Runtime::kNewGlobalContext, 2); |
} else { |
- __ CallRuntime(Runtime::kNewFunctionContext, 1); |
+ Comment cmnt(masm_, "[ Allocate function context"); |
+ // Argument to NewContext is the function, which is still in edi. |
+ __ push(a1); |
+ if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
+ FastNewContextStub stub(heap_slots); |
+ __ CallStub(&stub); |
+ } else { |
+ __ CallRuntime(Runtime::kNewFunctionContext, 1); |
+ } |
} |
function_in_register = false; |
// Context is returned in both v0 and cp. It replaces the context |