Revision: 14442
Author: [email protected]
Date: Thu Apr 25 19:07:42 2013
Log: MIPS: Capture receiver in generator object
Port r14434 (04f254d1)
Original commit message:
Previously there has been no reason to context-allocate the receiver, so
access to the receiver always goes through the stack. This was failing
with generators, which assumed that forcing context allocation would
relieve the need of storing anything but the context and the function on
the stack.
This CL adds a slot in generator objects to capture the receiver, and
restores it when resuming a generator.
BUG=v8:2355
TEST=mjsunit/harmony/generators-iteration
Review URL: https://codereview.chromium.org/14195033
http://code.google.com/p/v8/source/detail?r=14442
Modified:
/branches/bleeding_edge/src/mips/full-codegen-mips.cc
=======================================
--- /branches/bleeding_edge/src/mips/full-codegen-mips.cc Wed Apr 24
16:11:48 2013
+++ /branches/bleeding_edge/src/mips/full-codegen-mips.cc Thu Apr 25
19:07:42 2013
@@ -2001,20 +2001,25 @@
__ lw(cp, FieldMemOperand(a1, JSGeneratorObject::kContextOffset));
__ lw(t0, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset));
- // Push holes for arguments to generator function.
+ // Load receiver and store as the first argument.
+ __ lw(a2, FieldMemOperand(a1, JSGeneratorObject::kReceiverOffset));
+ __ push(a2);
+
+ // Push holes for the rest of the arguments to the generator function.
__ lw(a3, FieldMemOperand(t0, JSFunction::kSharedFunctionInfoOffset));
__ lw(a3,
FieldMemOperand(a3,
SharedFunctionInfo::kFormalParameterCountOffset));
__ LoadRoot(a2, Heap::kTheHoleValueRootIndex);
- Label push_argument_holes;
+ Label push_argument_holes, push_frame;
__ bind(&push_argument_holes);
+ __ Subu(a3, a3, Operand(1));
+ __ Branch(&push_frame, lt, a3, Operand(zero_reg));
__ push(a2);
- __ Subu(a3, a3, Operand(1));
- __ Branch(&push_argument_holes, ge, a3, Operand(zero_reg));
+ __ jmp(&push_argument_holes);
// Enter a new JavaScript frame, and initialize its slots as they were
when
// the generator was suspended.
- Label push_frame, resume_frame;
+ Label resume_frame;
__ bind(&push_frame);
__ Call(&resume_frame);
__ jmp(&done);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.