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

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

Issue 1856683002: Fix resuming generator marked for optimization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « no previous file | test/mjsunit/regress/regress-crbug-513471.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 f7be0eb60b75ad963ac6d3db3c2622f4f50c1261..1d07b2e261d4835f61bf48d3814d38ac913f2f89 100644
--- a/src/runtime/runtime-generator.cc
+++ b/src/runtime/runtime-generator.cc
@@ -43,6 +43,8 @@ RUNTIME_FUNCTION(Runtime_SuspendJSGeneratorObject) {
JavaScriptFrame* frame = stack_iterator.frame();
RUNTIME_ASSERT(frame->function()->shared()->is_generator());
DCHECK_EQ(frame->function(), generator_object->function());
+ DCHECK(frame->function()->shared()->is_compiled());
+ DCHECK(!frame->function()->IsOptimized());
// The caller should have saved the context and continuation already.
DCHECK_EQ(generator_object->context(), Context::cast(frame->context()));
@@ -88,18 +90,18 @@ RUNTIME_FUNCTION(Runtime_ResumeJSGeneratorObject) {
JavaScriptFrame* frame = stack_iterator.frame();
DCHECK_EQ(frame->function(), generator_object->function());
- DCHECK(frame->function()->is_compiled());
+ DCHECK(frame->function()->shared()->is_compiled());
+ DCHECK(!frame->function()->IsOptimized());
STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting < 0);
STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed == 0);
- Address pc = generator_object->function()->code()->instruction_start();
+ Code* code = generator_object->function()->shared()->code();
int offset = generator_object->continuation();
- DCHECK(offset > 0);
- frame->set_pc(pc + offset);
+ DCHECK_GT(offset, 0);
+ frame->set_pc(code->instruction_start() + offset);
if (FLAG_enable_embedded_constant_pool) {
- frame->set_constant_pool(
- generator_object->function()->code()->constant_pool());
+ frame->set_constant_pool(code->constant_pool());
}
generator_object->set_continuation(JSGeneratorObject::kGeneratorExecuting);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-513471.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698