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
parent e7c1f322
...@@ -2002,12 +2002,12 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator, ...@@ -2002,12 +2002,12 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator,
__ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); __ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
__ ldr(r3, __ ldr(r3,
FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset)); FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset));
__ Move(r2, isolate()->factory()->the_hole_value()); __ LoadRoot(r2, Heap::kTheHoleValueRootIndex);
Label push_argument_holes; Label push_argument_holes;
__ bind(&push_argument_holes); __ bind(&push_argument_holes);
__ push(r2); __ push(r2);
__ sub(r3, r3, Operand(1)); __ sub(r3, r3, Operand(1), SetCC);
__ b(vc, &push_argument_holes); __ b(pl, &push_argument_holes);
// Enter a new JavaScript frame, and initialize its slots as they were when // Enter a new JavaScript frame, and initialize its slots as they were when
// the generator was suspended. // the generator was suspended.
...@@ -2016,6 +2016,7 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator, ...@@ -2016,6 +2016,7 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator,
__ bl(&resume_frame); __ bl(&resume_frame);
__ jmp(&done); __ jmp(&done);
__ bind(&resume_frame); __ bind(&resume_frame);
__ push(lr); // Return address.
__ push(fp); // Caller's frame pointer. __ push(fp); // Caller's frame pointer.
__ mov(fp, sp); __ mov(fp, sp);
__ push(cp); // Callee's context. __ push(cp); // Callee's context.
...@@ -2046,8 +2047,8 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator, ...@@ -2046,8 +2047,8 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator,
// up the stack and the handlers. // up the stack and the handlers.
Label push_operand_holes, call_resume; Label push_operand_holes, call_resume;
__ bind(&push_operand_holes); __ bind(&push_operand_holes);
__ sub(r3, r3, Operand(1)); __ sub(r3, r3, Operand(1), SetCC);
__ b(vs, &call_resume); __ b(mi, &call_resume);
__ push(r2); __ push(r2);
__ b(&push_operand_holes); __ b(&push_operand_holes);
__ bind(&call_resume); __ bind(&call_resume);
......
...@@ -37,9 +37,6 @@ regress/regress-1119: FAIL ...@@ -37,9 +37,6 @@ regress/regress-1119: FAIL
# TODO(wingo): Currently fails in no-snapshot mode, hence disabled for now. # TODO(wingo): Currently fails in no-snapshot mode, hence disabled for now.
harmony/generators-objects: SKIP 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. # Issue 1719: Slow to collect arrays over several contexts.
regress/regress-524: SKIP regress/regress-524: SKIP
# When that bug is fixed, revert the expectation to: # When that bug is fixed, revert the expectation to:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment