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

Side by Side Diff: src/x64/full-codegen-x64.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
« no previous file with comments | « src/v8globals.h ('k') | test/mjsunit/harmony/generators-instantiation.js » ('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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 FrameScope frame_scope(masm_, StackFrame::MANUAL); 153 FrameScope frame_scope(masm_, StackFrame::MANUAL);
154 154
155 info->set_prologue_offset(masm_->pc_offset()); 155 info->set_prologue_offset(masm_->pc_offset());
156 __ push(rbp); // Caller's frame pointer. 156 __ push(rbp); // Caller's frame pointer.
157 __ movq(rbp, rsp); 157 __ movq(rbp, rsp);
158 __ push(rsi); // Callee's context. 158 __ push(rsi); // Callee's context.
159 __ push(rdi); // Callee's JS Function. 159 __ push(rdi); // Callee's JS Function.
160 160
161 { Comment cmnt(masm_, "[ Allocate locals"); 161 { Comment cmnt(masm_, "[ Allocate locals");
162 int locals_count = info->scope()->num_stack_slots(); 162 int locals_count = info->scope()->num_stack_slots();
163 // Generators allocate locals, if any, in context slots.
164 ASSERT(!info->function()->is_generator() || locals_count == 0);
163 if (locals_count == 1) { 165 if (locals_count == 1) {
164 __ PushRoot(Heap::kUndefinedValueRootIndex); 166 __ PushRoot(Heap::kUndefinedValueRootIndex);
165 } else if (locals_count > 1) { 167 } else if (locals_count > 1) {
166 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex); 168 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex);
167 for (int i = 0; i < locals_count; i++) { 169 for (int i = 0; i < locals_count; i++) {
168 __ push(rdx); 170 __ push(rdx);
169 } 171 }
170 } 172 }
171 } 173 }
172 174
(...skipping 4378 matching lines...) Expand 10 before | Expand all | Expand 10 after
4551 *context_length = 0; 4553 *context_length = 0;
4552 return previous_; 4554 return previous_;
4553 } 4555 }
4554 4556
4555 4557
4556 #undef __ 4558 #undef __
4557 4559
4558 } } // namespace v8::internal 4560 } } // namespace v8::internal
4559 4561
4560 #endif // V8_TARGET_ARCH_X64 4562 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/v8globals.h ('k') | test/mjsunit/harmony/generators-instantiation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698