DescriptionRemove unused 'receiver' field from generators
V8 previously handled the receiver ('this') specially with respect to
scoping, but it now handles it similarly to other local variables in
most contexts.
Generators had some code in them to restore the receiver on generator
resume, but this support is redundant with the way that contexts already
will restore the receiver. Further, async arrow functions cannot have
redundant reads and writes of the receiver as it would trigger a TDZ
error in some cases.
This patch eliminates the unnecesary saving of the receiver. To preserve
the calling convention, the hole value is restored as the receiver in
ResumeGeneratorTrampoline, similarly to how arguments are restored as
the hole, however it is expected that this value will never be seen by
user code because of the forced context allocation, which impacts the
receiver just like the arguments.
This patch fixes an async/await test in the unsubmitted draft code which
failed previously due to an unnecessary read of 'this' in a subclass
constructor when it was in TDZ.
R=neis,bmeurer
BUG=v8:4483
Patch Set 1 #Patch Set 2 : bytecode expectations #Patch Set 3 : Fix test which checked for second parameter #Patch Set 4 : weaken dcheck #
Dependent Patchsets: Messages
Total messages: 20 (9 generated)
|