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

Unified Diff: src/runtime/runtime-generator.cc

Issue 1923253002: [generators] Create the fixed array holding the registers only once. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects-debug.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-generator.cc
diff --git a/src/runtime/runtime-generator.cc b/src/runtime/runtime-generator.cc
index 602b2c66cccbc0e21972a31baa09d8b482b2dc61..71d7059bf8bccf790fcdf346a7f4c8bea729cbef 100644
--- a/src/runtime/runtime-generator.cc
+++ b/src/runtime/runtime-generator.cc
@@ -19,12 +19,21 @@ RUNTIME_FUNCTION(Runtime_CreateJSGeneratorObject) {
CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 1);
RUNTIME_ASSERT(function->shared()->is_generator());
+ Handle<FixedArray> operand_stack;
+ if (FLAG_ignition && FLAG_ignition_generators) {
+ int size = function->shared()->bytecode_array()->register_count();
+ operand_stack = isolate->factory()->NewFixedArray(size);
+ } else {
+ DCHECK(!function->shared()->HasBytecodeArray());
+ operand_stack = handle(isolate->heap()->empty_fixed_array());
+ }
+
Handle<JSGeneratorObject> generator =
isolate->factory()->NewJSGeneratorObject(function);
generator->set_function(*function);
generator->set_context(isolate->context());
generator->set_receiver(*receiver);
- generator->set_operand_stack(isolate->heap()->empty_fixed_array());
+ generator->set_operand_stack(*operand_stack);
generator->set_continuation(JSGeneratorObject::kGeneratorExecuting);
return *generator;
}
« no previous file with comments | « src/objects-debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698