Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: src/arm/full-codegen-arm.cc

Issue 10876067: Introduce global contexts to represent lexical global scope(s). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8.h ('k') | src/contexts.h » ('j') | src/heap.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5cb8899c4a6f8c06a40e2506185bc72710242bd2 100644
--- a/src/arm/full-codegen-arm.cc
+++ b/src/arm/full-codegen-arm.cc
@@ -184,14 +184,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 r1.
- __ push(r1);
- 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 r1. Consider moving t
rossberg 2012/08/27 09:07:16 Done.
+ __ push(r1);
+ __ 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(r1);
+ 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 r0 and cp. It replaces the context
« no previous file with comments | « include/v8.h ('k') | src/contexts.h » ('j') | src/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698