Fix generator suspend and resume on ARM

This CL fixes a number of rookie mistakes in
FullCodeGenerator::VisitYield and
FullCodeGenerator::EmitGeneratorResume, and re-enables the
generators-iteration test on ARM.

R=mstarzinger@chromium.org
BUG=v8:2355
TEST=mjsunit/harmony/generators-iteration

Review URL: https://codereview.chromium.org/13843022

Patch from Andy Wingo <wingo@igalia.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14424 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
mstarzinger@chromium.org 2013-04-24 16:07:44 +00:00
parent e7c1f322a4
commit 338f11850a
2 changed files with 6 additions and 8 deletions

View File

@ -2002,12 +2002,12 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator,
__ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
__ ldr(r3,
FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset));
__ Move(r2, isolate()->factory()->the_hole_value());
__ LoadRoot(r2, Heap::kTheHoleValueRootIndex);
Label push_argument_holes;
__ bind(&push_argument_holes);
__ push(r2);
__ sub(r3, r3, Operand(1));
__ b(vc, &push_argument_holes);
__ sub(r3, r3, Operand(1), SetCC);
__ b(pl, &push_argument_holes);
// Enter a new JavaScript frame, and initialize its slots as they were when
// the generator was suspended.
@ -2016,6 +2016,7 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator,
__ bl(&resume_frame);
__ jmp(&done);
__ bind(&resume_frame);
__ push(lr); // Return address.
__ push(fp); // Caller's frame pointer.
__ mov(fp, sp);
__ push(cp); // Callee's context.
@ -2046,8 +2047,8 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator,
// up the stack and the handlers.
Label push_operand_holes, call_resume;
__ bind(&push_operand_holes);
__ sub(r3, r3, Operand(1));
__ b(vs, &call_resume);
__ sub(r3, r3, Operand(1), SetCC);
__ b(mi, &call_resume);
__ push(r2);
__ b(&push_operand_holes);
__ bind(&call_resume);

View File

@ -37,9 +37,6 @@ regress/regress-1119: FAIL
# TODO(wingo): Currently fails in no-snapshot mode, hence disabled for now.
harmony/generators-objects: SKIP
# TODO(wingo): Resuming of iterators currently crashes in ARM.
harmony/generators-iteration: SKIP if ($arch == arm || $arch == android_arm)
# Issue 1719: Slow to collect arrays over several contexts.
regress/regress-524: SKIP
# When that bug is fixed, revert the expectation to: