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

Side by Side Diff: src/ia32/full-codegen-ia32.cc

Issue 13408005: Force context allocation for variables in generator scopes. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 8 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
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 FrameScope frame_scope(masm_, StackFrame::MANUAL); 157 FrameScope frame_scope(masm_, StackFrame::MANUAL);
158 158
159 info->set_prologue_offset(masm_->pc_offset()); 159 info->set_prologue_offset(masm_->pc_offset());
160 __ push(ebp); // Caller's frame pointer. 160 __ push(ebp); // Caller's frame pointer.
161 __ mov(ebp, esp); 161 __ mov(ebp, esp);
162 __ push(esi); // Callee's context. 162 __ push(esi); // Callee's context.
163 __ push(edi); // Callee's JS Function. 163 __ push(edi); // Callee's JS Function.
164 164
165 { Comment cmnt(masm_, "[ Allocate locals"); 165 { Comment cmnt(masm_, "[ Allocate locals");
166 int locals_count = info->scope()->num_stack_slots(); 166 int locals_count = info->scope()->num_stack_slots();
167 // Generators allocate locals, if any, in context slots.
168 ASSERT(!(info->function()->is_generator() && locals_count));
Michael Starzinger 2013/04/05 11:38:42 nit: Can we rewrite this as "!info->function()->is
wingo 2013/04/05 12:25:06 Done.
167 if (locals_count == 1) { 169 if (locals_count == 1) {
168 __ push(Immediate(isolate()->factory()->undefined_value())); 170 __ push(Immediate(isolate()->factory()->undefined_value()));
169 } else if (locals_count > 1) { 171 } else if (locals_count > 1) {
170 __ mov(eax, Immediate(isolate()->factory()->undefined_value())); 172 __ mov(eax, Immediate(isolate()->factory()->undefined_value()));
171 for (int i = 0; i < locals_count; i++) { 173 for (int i = 0; i < locals_count; i++) {
172 __ push(eax); 174 __ push(eax);
173 } 175 }
174 } 176 }
175 } 177 }
176 178
(...skipping 4373 matching lines...) Expand 10 before | Expand all | Expand 10 after
4550 *stack_depth = 0; 4552 *stack_depth = 0;
4551 *context_length = 0; 4553 *context_length = 0;
4552 return previous_; 4554 return previous_;
4553 } 4555 }
4554 4556
4555 #undef __ 4557 #undef __
4556 4558
4557 } } // namespace v8::internal 4559 } } // namespace v8::internal
4558 4560
4559 #endif // V8_TARGET_ARCH_IA32 4561 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698