Ok, going well, but the end of an initialization block wants the receiver of
the initialization block
on the stack, so it can be put back in fast mode. Could the end of the
initialization block be an explicit
node, that puts the receiver on the stack? Here is the offending code,
which is broken once SetValue pops the reference and marks the reference
invalid:
} else {
CodeForSourcePosition(node->position());
if (node->op() == Token::INIT_CONST) {
// Dynamic constant initializations must use the function context
// and initialize the actual constant declared. Dynamic variable
// initializations are simply assignments and use SetValue.
target.SetValue(CONST_INIT);
} else {
target.SetValue(NOT_CONST_INIT);
}
if (node->ends_initialization_block()) {
ASSERT(target.type() == Reference::NAMED ||
target.type() == Reference::KEYED);
// End of initialization block. Revert to fast case. The
// argument to the runtime call is the receiver, which is the
// first value pushed as part of the reference, which is below
// the lhs value.
frame_->PushElementAt(target.size());
Result ignored = frame_->CallRuntime(Runtime::kToFastProperties, 1);
}
}
On Fri, Dec 11, 2009 at 1:50 AM, <[email protected]> wrote:
> 1. I don't know how well two different constructors will work because you
> have
> to conditionally select them. Probably simplest to pass a flag to the
> single
> constructor. You'll ideally just have something like this in
> VisitAssignment:
>
> Reference ref(this, node->is_compound_assignment());
> ...
>
> 2. For now (before ICs are rewritten) we should not regress performance.
> So,
> GetValue should (a) work just like before for a 'compound assignment'
> reference
> or (b) call the IC and then drop the receiver/key from the stack otherwise.
> Consider invalidating the reference in case (b).
>
> SetValue should only work for references that haven't been invalidated, and
> should call the IC then drop the receiver/key from the stack (invalidating
> the
> reference).
>
> The destructor can just check that the reference has been invalidated.
>
>
> http://codereview.chromium.org/487017
>
--
William Hesse
Software Engineer
[email protected]
Google Denmark ApS
Frederiksborggade 20B, 1 sal
1360 København K
Denmark
CVR nr. 28 86 69 84
If you received this communication by mistake, please don't forward it to
anyone else (it may contain confidential or privileged information), please
erase all copies of it, including all attachments, and please let the sender
know it went to the wrong person. Thanks.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev