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

Issue 1682173008: ‘Yield* e' should not access e.current eagerly (Closed)

Created:
4 years, 10 months ago by hausner
Modified:
4 years, 10 months ago
Reviewers:
regis, floitsch, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org, floitsch
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

‘Yield* e' should not access e.current eagerly Match the implementation of dart2js. BUG= R=floitsch@google.com Committed: https://github.com/dart-lang/sdk/commit/761ee7ec042670e11742e6e1b99c1973c1ce750c

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -5 lines) Patch
M runtime/lib/core_patch.dart View 1 3 chunks +8 lines, -4 lines 3 comments Download
M runtime/vm/parser.cc View 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/symbols.h View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 12 (5 generated)
hausner
4 years, 10 months ago (2016-02-12 20:58:39 UTC) #3
floitsch
LGTM. https://codereview.chromium.org/1682173008/diff/1/runtime/lib/core_patch.dart File runtime/lib/core_patch.dart (right): https://codereview.chromium.org/1682173008/diff/1/runtime/lib/core_patch.dart#newcode72 runtime/lib/core_patch.dart:72: yieldEachIterator = (_current as Iterable).iterator; You could GC ...
4 years, 10 months ago (2016-02-12 21:01:54 UTC) #5
hausner
Thank you. https://codereview.chromium.org/1682173008/diff/1/runtime/lib/core_patch.dart File runtime/lib/core_patch.dart (right): https://codereview.chromium.org/1682173008/diff/1/runtime/lib/core_patch.dart#newcode72 runtime/lib/core_patch.dart:72: yieldEachIterator = (_current as Iterable).iterator; On 2016/02/12 ...
4 years, 10 months ago (2016-02-12 21:27:16 UTC) #6
hausner
Committed patchset #2 (id:20001) manually as 761ee7ec042670e11742e6e1b99c1973c1ce750c (presubmit successful).
4 years, 10 months ago (2016-02-12 21:28:21 UTC) #8
Ivan Posva
https://codereview.chromium.org/1682173008/diff/20001/runtime/lib/core_patch.dart File runtime/lib/core_patch.dart (right): https://codereview.chromium.org/1682173008/diff/20001/runtime/lib/core_patch.dart#newcode69 runtime/lib/core_patch.dart:69: if (isYieldEach) { Can you please explain in a ...
4 years, 10 months ago (2016-02-13 07:03:03 UTC) #10
hausner
https://codereview.chromium.org/1682173008/diff/20001/runtime/lib/core_patch.dart File runtime/lib/core_patch.dart (right): https://codereview.chromium.org/1682173008/diff/20001/runtime/lib/core_patch.dart#newcode69 runtime/lib/core_patch.dart:69: if (isYieldEach) { On 2016/02/13 07:03:03, Ivan Posva wrote: ...
4 years, 10 months ago (2016-02-13 07:13:06 UTC) #11
Ivan Posva
4 years, 10 months ago (2016-02-13 07:27:09 UTC) #12
Message was sent while issue was closed.
Thanks for the clarification. Should I add the suggested comment?

-Ivan

https://codereview.chromium.org/1682173008/diff/20001/runtime/lib/core_patch....
File runtime/lib/core_patch.dart (right):

https://codereview.chromium.org/1682173008/diff/20001/runtime/lib/core_patch....
runtime/lib/core_patch.dart:69: if (isYieldEach) {
On 2016/02/13 07:13:06, hausner wrote:
> On 2016/02/13 07:03:03, Ivan Posva wrote:
> > Can you please explain in a comment how this code here is ever reached?
Unless
> > of course the moveNextFn updates the isYieldEach value of this iterator when
> it
> > is being called, but such a side-effect should definitely be pointed out.
> > 
> > Thanks!
> 
> Yes, the generator sets this value when it reaches a yield* statement. See
> comment in line 41.

I understood the above comment as the field being set once on construction,
which apparently is not the case.

How about a comment like this before line 64:
// The moveNextFn will update the values of the isYieldEach and _current fields.

Note on the side: Why are we publicly exposing the internal fields of this
implementation class?

Powered by Google App Engine
This is Rietveld 408576698