Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Issue 14416011: Fix yield inside with (Closed)

Created:
7 years, 8 months ago by wingo
Modified:
7 years, 7 months ago
Reviewers:
Michael Starzinger
CC:
rossberg
Base URL:
git://github.com/v8/v8.git@master
Visibility:
Public.

Description

Fix yield inside with This patch makes it so that suspending generators always saves the context. Previously we erroneously assumed that if the operand stack was empty, that the context would be unchanged, but that is not the case with "with". Fixing this brought out an interesting bug in the variable allocator. Yield inside with will reference a context-allocated temporary holding the generator object. Before the fix, this object was looked up in the with context instead of the function context, because with contexts were not being simulated during full-codegen. Previously this was OK as all variables would be given LOOKUP allocation instead of CONTEXT, but the context-allocated temporary invalidated this assumption. The fix is to simulate the context chain more accurately in full-codegen. R=mstarzinger@chromium.org BUG=v8:2355 TEST=mjsunit/harmony/generators-iteration Committed: http://code.google.com/p/v8/source/detail?r=14454

Patch Set 1 #

Total comments: 1

Patch Set 2 : Add assertion #

Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -10 lines) Patch
M src/ast.h View 2 chunks +9 lines, -4 lines 0 comments Download
M src/full-codegen.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M src/parser.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/runtime.cc View 1 chunk +6 lines, -4 lines 0 comments Download
M src/scopes.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M test/mjsunit/harmony/generators-iteration.js View 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
wingo
Please take a look. I hope you are as amused about the variable allocation bug ...
7 years, 8 months ago (2013-04-25 09:58:25 UTC) #1
Michael Starzinger
LGTM. Nice catch. I only have one suggestion. https://codereview.chromium.org/14416011/diff/1/src/scopes.cc File src/scopes.cc (right): https://codereview.chromium.org/14416011/diff/1/src/scopes.cc#newcode729 src/scopes.cc:729: if ...
7 years, 7 months ago (2013-04-26 11:31:10 UTC) #2
wingo
Updated patch adds assertion. Thanks for the review.
7 years, 7 months ago (2013-04-26 11:39:24 UTC) #3
Michael Starzinger
7 years, 7 months ago (2013-04-26 11:55:30 UTC) #4
Message was sent while issue was closed.
Committed patchset #2 manually as r14454 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698