On 2015/05/06 13:54:27, wingo wrote:
WDYT Erik? Also is the "scope_uses_super_property" thing actually
needed? I
could remove that too.
scope_uses_super_property is needed. The reason is that when we use a
super.property in a method we need to install the [[HomeObject]] on the
function
instance when we create it. In the case of lazy parsing, we need to store
this
in the preparse data so that we can recreate this information from the
scopes
https://github.com/v8/v8-git-mirror/blob/master/src/preparse-data.h#L87
https://github.com/v8/v8-git-mirror/blob/master/src/parser.cc#L4284-L4285
However, we do not need the "inner" version of this. We can just walk up the
scope chain until we find a non eval/arrow scope and set the "uses" bit
there.
[[HomeObject]] could be lexically bound now that we removed toMethod in ES6
but
it would require that we add an extra scope around object literals.
Today:
let o = {
m() { super.toString }
};
becomes something like:
let o = {
m() { LookupSuperProperty(this, o.m.[[HomeObject]], 'toString') }
};
o.m.[[HomeObject]] = o;
Which we could change to:
let o;
{
let home_object;
o = {
m() { LookupSuperProperty(this, home_object, 'toString') }
}
home_object = o;
}
I'll file a bug about this too...
Regarding MayUseThis: I initially wanted to walk the scope chain until I
got
to
one with has_this_declaration() and then grab the receiver() but scopes
deserialized from ScopeInfo don't get receiver_ set. So, LookupThis()
instead.
I guess I could instead ensure that receiver_ gets set and replace
LookupThis()
with this_declaration_scope(); wdyt?
I like LookupThis better. Is there a performance benefit to setting
receiver_
instead?
https://codereview.chromium.org/1129823002/
--
--
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/d/optout.