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

Side by Side Diff: src/ia32/full-codegen-ia32.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: Addressed Sven's comments. Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap.cc ('k') | src/mips/full-codegen-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 __ push(eax); 171 __ push(eax);
172 } 172 }
173 } 173 }
174 } 174 }
175 175
176 bool function_in_register = true; 176 bool function_in_register = true;
177 177
178 // Possibly allocate a local context. 178 // Possibly allocate a local context.
179 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 179 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
180 if (heap_slots > 0) { 180 if (heap_slots > 0) {
181 Comment cmnt(masm_, "[ Allocate local context"); 181 Comment cmnt(masm_, "[ Allocate context");
182 // Argument to NewContext is the function, which is still in edi. 182 // Argument to NewContext is the function, which is still in edi.
183 __ push(edi); 183 __ push(edi);
184 if (heap_slots <= FastNewContextStub::kMaximumSlots) { 184 if (FLAG_harmony_scoping && info->scope()->is_global_scope()) {
185 __ Push(info->scope()->GetScopeInfo());
186 __ CallRuntime(Runtime::kNewGlobalContext, 2);
187 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) {
185 FastNewContextStub stub(heap_slots); 188 FastNewContextStub stub(heap_slots);
186 __ CallStub(&stub); 189 __ CallStub(&stub);
187 } else { 190 } else {
188 __ CallRuntime(Runtime::kNewFunctionContext, 1); 191 __ CallRuntime(Runtime::kNewFunctionContext, 1);
189 } 192 }
190 function_in_register = false; 193 function_in_register = false;
191 // Context is returned in both eax and esi. It replaces the context 194 // Context is returned in both eax and esi. It replaces the context
192 // passed to us. It's saved in the stack and kept live in esi. 195 // passed to us. It's saved in the stack and kept live in esi.
193 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi); 196 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi);
194 197
(...skipping 4348 matching lines...) Expand 10 before | Expand all | Expand 10 after
4543 *stack_depth = 0; 4546 *stack_depth = 0;
4544 *context_length = 0; 4547 *context_length = 0;
4545 return previous_; 4548 return previous_;
4546 } 4549 }
4547 4550
4548 #undef __ 4551 #undef __
4549 4552
4550 } } // namespace v8::internal 4553 } } // namespace v8::internal
4551 4554
4552 #endif // V8_TARGET_ARCH_IA32 4555 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698