From: rmcilroy@chromium.org Date: Mon, 17 Mar 2014 17:29:03 +0000 (+0000) Subject: Update constant pool correctly when resuming a generator X-Git-Tag: upstream/4.7.83~10213 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4268685a3bf4056b89d99c5153c1c91a700e5c7a;p=platform%2Fupstream%2Fv8.git Update constant pool correctly when resuming a generator This CL depends on the following CLs landing first: https://codereview.chromium.org/188063002/ https://codereview.chromium.org/190793002/ R=ulan@chromium.org Review URL: https://codereview.chromium.org/190823002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20012 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc index 2f4d900..7a2fb6d 100644 --- a/src/arm/full-codegen-arm.cc +++ b/src/arm/full-codegen-arm.cc @@ -2188,12 +2188,21 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator, __ cmp(r3, Operand(0)); __ b(ne, &slow_resume); __ ldr(r3, FieldMemOperand(r4, JSFunction::kCodeEntryOffset)); - __ ldr(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); - __ SmiUntag(r2); - __ add(r3, r3, r2); - __ mov(r2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); - __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); - __ Jump(r3); + + { ConstantPoolUnavailableScope constant_pool_unavailable(masm_); + if (FLAG_enable_ool_constant_pool) { + // Load the new code object's constant pool pointer. + __ ldr(pp, + MemOperand(r3, Code::kConstantPoolOffset - Code::kHeaderSize)); + } + + __ ldr(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); + __ SmiUntag(r2); + __ add(r3, r3, r2); + __ mov(r2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); + __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); + __ Jump(r3); + } __ bind(&slow_resume); } diff --git a/src/runtime.cc b/src/runtime.cc index 1f1813f..75b9f2f 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -3089,6 +3089,10 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ResumeJSGeneratorObject) { int offset = generator_object->continuation(); ASSERT(offset > 0); frame->set_pc(pc + offset); + if (FLAG_enable_ool_constant_pool) { + frame->set_constant_pool( + generator_object->function()->code()->constant_pool()); + } generator_object->set_continuation(JSGeneratorObject::kGeneratorExecuting); FixedArray* operand_stack = generator_object->operand_stack();