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

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

Issue 2052873002: [generators] Make runtime functions more robust. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | test/mjsunit/regress/regress-618657.js » ('j') | 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 2b55d68be3091df9c53228cf9f79c2f9276ea095..19f57d79231dda4759eb184380bbddf99016a95a 100644
--- a/src/runtime/runtime-generator.cc
+++ b/src/runtime/runtime-generator.cc
@@ -21,11 +21,12 @@ RUNTIME_FUNCTION(Runtime_CreateJSGeneratorObject) {
CHECK(function->shared()->is_resumable());
Handle<FixedArray> operand_stack;
- if (FLAG_ignition && FLAG_ignition_generators) {
+ if (function->shared()->HasBytecodeArray()) {
+ // New-style generators.
int size = function->shared()->bytecode_array()->register_count();
operand_stack = isolate->factory()->NewFixedArray(size);
} else {
- DCHECK(!function->shared()->HasBytecodeArray());
+ // Old-style generators.
operand_stack = handle(isolate->heap()->empty_fixed_array());
}
@@ -148,9 +149,8 @@ RUNTIME_FUNCTION(Runtime_GeneratorGetSourcePosition) {
if (!generator->is_suspended()) return isolate->heap()->undefined_value();
- if (FLAG_ignition && FLAG_ignition_generators) UNIMPLEMENTED();
+ if (generator->function()->shared()->HasBytecodeArray()) UNIMPLEMENTED();
- DCHECK(!generator->function()->shared()->HasBytecodeArray());
Handle<Code> code(generator->function()->code(), isolate);
int offset = generator->continuation();
CHECK(0 <= offset && offset < code->instruction_size());
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-618657.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698