The formal parameter count was always being treated as an untagged
integer, but it is actually a Smi on ia32 and arm.
R=mstarzinger@chromium.org
BUG=v8:2355
TEST=mjsunit/harmony/generators-iteration
Review URL: https://codereview.chromium.org/
17485002
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15230
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
__ LoadRoot(r2, Heap::kTheHoleValueRootIndex);
Label push_argument_holes, push_frame;
__ bind(&push_argument_holes);
- __ sub(r3, r3, Operand(1), SetCC);
+ __ sub(r3, r3, Operand(Smi::FromInt(1)), SetCC);
__ b(mi, &push_frame);
__ push(r2);
__ jmp(&push_argument_holes);
__ mov(ecx, isolate()->factory()->the_hole_value());
Label push_argument_holes, push_frame;
__ bind(&push_argument_holes);
- __ sub(edx, Immediate(1));
+ __ sub(edx, Immediate(Smi::FromInt(1)));
__ j(carry, &push_frame);
__ push(ecx);
__ jmp(&push_argument_holes);
"foo",
[3, undefined]);
+// Access to this with formal arguments.
+TestGenerator(
+ function () {
+ return ({ x: 42, g: function* (a) { yield this.x } }).g(0);
+ },
+ [42, undefined],
+ "foo",
+ [42, undefined]);
+
// Test that yield* re-yields received results without re-boxing.
function TestDelegatingYield() {
function results(results) {