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

Issue 10310060: Generate getters and setters dynamically. (Closed)

Created:
8 years, 7 months ago by floitsch
Modified:
8 years, 7 months ago
Reviewers:
sra1, kasperl, ngeoffray
CC:
reviews_dartlang.org, ngeoffray
Visibility:
Public.

Description

Generate getters and setters dynamically. Committed: https://code.google.com/p/dart/source/detail?r=7460

Patch Set 1 #

Patch Set 2 : Minor cosmetic changes. #

Patch Set 3 : Rebase #

Total comments: 25

Patch Set 4 : Encode requirement into name. #

Patch Set 5 : Address most comments. #

Patch Set 6 : Rely on a getter/setter convention. #

Patch Set 7 : Simplify by using a bool. #

Total comments: 6

Patch Set 8 : Address comments and cosmetic changes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+181 lines, -64 lines) Patch
M lib/compiler/implementation/emitter.dart View 1 2 3 4 5 6 7 7 chunks +134 lines, -60 lines 0 comments Download
M lib/compiler/implementation/namer.dart View 1 2 3 4 5 1 chunk +6 lines, -2 lines 0 comments Download
M lib/compiler/implementation/native_emitter.dart View 1 2 3 4 5 6 7 2 chunks +6 lines, -2 lines 0 comments Download
A tests/language/naming3_test.dart View 1 2 3 4 5 1 chunk +35 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
floitsch
8 years, 7 months ago (2012-05-08 16:14:23 UTC) #1
sra1
https://chromiumcodereview.appspot.com/10310060/diff/2002/lib/compiler/implementation/emitter.dart File lib/compiler/implementation/emitter.dart (right): https://chromiumcodereview.appspot.com/10310060/diff/2002/lib/compiler/implementation/emitter.dart#newcode103 lib/compiler/implementation/emitter.dart:103: constructor = eval(str); Should this new new Function too?
8 years, 7 months ago (2012-05-08 17:59:42 UTC) #2
kasperl
First round. Looks pretty good, but I'd like your take on encoding the need for ...
8 years, 7 months ago (2012-05-09 07:53:15 UTC) #3
ngeoffray
http://codereview.chromium.org/10310060/diff/2002/lib/compiler/implementation/emitter.dart File lib/compiler/implementation/emitter.dart (right): http://codereview.chromium.org/10310060/diff/2002/lib/compiler/implementation/emitter.dart#newcode72 lib/compiler/implementation/emitter.dart:72: function(cls, superclass, fields, fieldBitSet, prototype) { Not sure we ...
8 years, 7 months ago (2012-05-09 08:50:27 UTC) #4
floitsch
PTAL. As suggested by Kasper I have now encoded the requirement into the field-name. Getters ...
8 years, 7 months ago (2012-05-09 13:58:35 UTC) #5
kasperl
LGTM. https://chromiumcodereview.appspot.com/10310060/diff/9004/lib/compiler/implementation/emitter.dart File lib/compiler/implementation/emitter.dart (right): https://chromiumcodereview.appspot.com/10310060/diff/9004/lib/compiler/implementation/emitter.dart#newcode89 lib/compiler/implementation/emitter.dart:89: case '$GETTER_SUFFIX': needsGetter = true; break; Indent cases. ...
8 years, 7 months ago (2012-05-09 14:07:49 UTC) #6
floitsch
8 years, 7 months ago (2012-05-09 14:11:19 UTC) #7
https://chromiumcodereview.appspot.com/10310060/diff/9004/lib/compiler/implem...
File lib/compiler/implementation/emitter.dart (right):

https://chromiumcodereview.appspot.com/10310060/diff/9004/lib/compiler/implem...
lib/compiler/implementation/emitter.dart:89: case '$GETTER_SUFFIX': needsGetter
= true; break;
On 2012/05/09 14:07:49, kasperl wrote:
> Indent cases.

Done.

https://chromiumcodereview.appspot.com/10310060/diff/9004/lib/compiler/implem...
lib/compiler/implementation/emitter.dart:90: case '$GETTER_SETTER_SUFFIX':
needsGetter = true; // fallthrough.
On 2012/05/09 14:07:49, kasperl wrote:
> fallthrough -> Fall-through

Done.

https://chromiumcodereview.appspot.com/10310060/diff/9004/lib/compiler/implem...
lib/compiler/implementation/emitter.dart:395: // Getters and setters for non
native members are generated dynamically.
On 2012/05/09 14:07:49, kasperl wrote:
> non-native

forgot to upload latest cosmetic changes patchset.
This line is gone. (The bool has a sufficiently explanatory name).

Powered by Google App Engine
This is Rietveld 408576698