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); |