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

Issue 2933363003: Add ClosureRepresentationInfo, the new public face of ClosureClassMap (Closed)

Created:
3 years, 6 months ago by Emily Fortuna
Modified:
3 years, 6 months ago
CC:
reviews_dartlang.org, Siggi Cherem (dart-lang)
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add ClosureRepresentationInfo, the new public face of ClosureClassMap (removal of methods exposing ClosureClassMap coming in follow up CL). BUG= R=johnniwinther@google.com Committed: https://github.com/dart-lang/sdk/commit/a27ebd0c949a37a43069445d26c195989adab9e8

Patch Set 1 : . #

Total comments: 13

Patch Set 2 : . #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+251 lines, -173 lines) Patch
M pkg/compiler/lib/src/closure.dart View 1 10 chunks +136 lines, -28 lines 4 comments Download
M pkg/compiler/lib/src/dump_info.dart View 1 3 chunks +7 lines, -6 lines 0 comments Download
M pkg/compiler/lib/src/inferrer/builder.dart View 1 3 chunks +5 lines, -5 lines 0 comments Download
M pkg/compiler/lib/src/inferrer/builder_kernel.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart View 2 chunks +5 lines, -5 lines 0 comments Download
M pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart View 1 2 chunks +12 lines, -14 lines 0 comments Download
M pkg/compiler/lib/src/ssa/builder.dart View 1 4 chunks +21 lines, -29 lines 0 comments Download
M pkg/compiler/lib/src/ssa/builder_kernel.dart View 1 3 chunks +19 lines, -28 lines 0 comments Download
M pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart View 1 1 chunk +4 lines, -4 lines 0 comments Download
M pkg/compiler/lib/src/ssa/locals_handler.dart View 8 chunks +13 lines, -16 lines 0 comments Download
M tests/compiler/dart2js/equivalence/check_helpers.dart View 3 chunks +2 lines, -3 lines 0 comments Download
M tests/compiler/dart2js/serialization/model_test_helper.dart View 1 1 chunk +25 lines, -33 lines 0 comments Download

Messages

Total messages: 10 (5 generated)
Emily Fortuna
3 years, 6 months ago (2017-06-14 00:54:54 UTC) #4
Johnni Winther
lgtm https://codereview.chromium.org/2933363003/diff/40001/pkg/compiler/lib/src/closure.dart File pkg/compiler/lib/src/closure.dart (right): https://codereview.chromium.org/2933363003/diff/40001/pkg/compiler/lib/src/closure.dart#newcode31 pkg/compiler/lib/src/closure.dart:31: ClosureClassMap getMemberMap(MemberEntity member); Do we still need these? ...
3 years, 6 months ago (2017-06-14 09:22:30 UTC) #5
Emily Fortuna
Committed patchset #2 (id:60001) manually as a27ebd0c949a37a43069445d26c195989adab9e8 (presubmit successful).
3 years, 6 months ago (2017-06-14 18:15:14 UTC) #7
Siggi Cherem (dart-lang)
lgtm, nice! https://codereview.chromium.org/2933363003/diff/60001/pkg/compiler/lib/src/closure.dart File pkg/compiler/lib/src/closure.dart (right): https://codereview.chromium.org/2933363003/diff/60001/pkg/compiler/lib/src/closure.dart#newcode101 pkg/compiler/lib/src/closure.dart:101: /// Class that describes the actual mechanics ...
3 years, 6 months ago (2017-06-14 22:56:36 UTC) #9
Emily Fortuna
3 years, 6 months ago (2017-06-15 00:11:22 UTC) #10
Message was sent while issue was closed.
https://codereview.chromium.org/2933363003/diff/40001/pkg/compiler/lib/src/cl...
File pkg/compiler/lib/src/closure.dart (right):

https://codereview.chromium.org/2933363003/diff/40001/pkg/compiler/lib/src/cl...
pkg/compiler/lib/src/closure.dart:31: ClosureClassMap getMemberMap(MemberEntity
member);
On 2017/06/14 09:22:30, Johnni Winther wrote:
> Do we still need these?

no, but I was going to delete them in a follow-up CL.

but I went ahead and did it here.

https://codereview.chromium.org/2933363003/diff/40001/pkg/compiler/lib/src/cl...
pkg/compiler/lib/src/closure.dart:36: ClosureRepresentationInfo
getClosureRepresentationInfo(Entity member);
On 2017/06/14 09:22:30, Johnni Winther wrote:
> Add a TODO for me to split this into members and local functions (like
> getMemberMap/getLocalFunctionMap)

Done.

https://codereview.chromium.org/2933363003/diff/40001/pkg/compiler/lib/src/cl...
pkg/compiler/lib/src/closure.dart:125: /// I expect this interface to get
simpler in subsequent refactorings.
On 2017/06/14 09:22:30, Johnni Winther wrote:
> Maybe turn the last line into a TODO?

Done.

https://codereview.chromium.org/2933363003/diff/40001/pkg/compiler/lib/src/cl...
pkg/compiler/lib/src/closure.dart:134: /// Closures are rewritten in the form of
classes that
On 2017/06/14 09:22:30, Johnni Winther wrote:
> Weird line break

Done.

https://codereview.chromium.org/2933363003/diff/40001/pkg/compiler/lib/src/cl...
pkg/compiler/lib/src/closure.dart:143: FunctionEntity get callEntity => null;
On 2017/06/14 09:22:30, Johnni Winther wrote:
> Maybe rename to [callMethod]?

Done.

https://codereview.chromium.org/2933363003/diff/40001/pkg/compiler/lib/src/cl...
pkg/compiler/lib/src/closure.dart:183: void forEachFreeVariable(f(Local
variable, FieldEntity field)) {}
On 2017/06/14 09:22:30, Johnni Winther wrote:
> Add docs

Done.

https://codereview.chromium.org/2933363003/diff/60001/pkg/compiler/lib/src/cl...
File pkg/compiler/lib/src/closure.dart (right):

https://codereview.chromium.org/2933363003/diff/60001/pkg/compiler/lib/src/cl...
pkg/compiler/lib/src/closure.dart:101: /// Class that describes the actual
mechanics of how the converted, rewritten
On 2017/06/14 22:56:36, Siggi Cherem (dart-lang) wrote:
> brainstorming here: in a way I think "convertion/rewriting" is the
> implementation :), so I wonder about what noun we should use to refer to the
> rewritten closure. I'm not opposed to keep it as "rewritten closure " like you
> have it, just thinking of ideas. For example, other ideas:
> - emitter representation of Dart closures
> - JavaScript representation of a Dart closure
> - closure's implementation representation.
> 
> If we change the terminology, I'd consider updating the docs, for example,
this
> sentence here could be:
> 
> Class that describes the actual mechanics of how closures are implemented.
This
> includes information about how the closure is represented in the emitted
> JavaScript in terms of classes and fields. ....

"Closure Conversion" is the standard term used to describe the process, so I'm
inclined to keep it. Can discuss more, tho.

https://codereview.chromium.org/2933363003/diff/60001/pkg/compiler/lib/src/cl...
pkg/compiler/lib/src/closure.dart:133: /// Closures are rewritten in the form of
classes that have fields to control
On 2017/06/14 22:56:36, Siggi Cherem (dart-lang) wrote:
> minor nit: consider moving up the sentence that just describes what this
> property is (since there is context already in the class comment), and then
add
> more details. For example:
> 
> /// The entity for the class used to represent the closure in the emitted
> JavaScript.
> ///
> /// Closures are represented as a class, where each field represents a
captured
> variable.
> /// **A capture variable is a variable declared in an scope outside the
closure
> and used in an 
> /// scope within the closure.
> 
> ** - I'd probably not include the definition of captured varaibles here, but
> move it to the class comment and other methods below that use the term.

Cool. I updated the docs in this CL: https://codereview.chromium.org/2937143002

Powered by Google App Engine
This is Rietveld 408576698