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

Issue 11308175: Emit constants using ASTs (Closed)

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

Description

Emit constants using ASTs Cleans up inconsistency reported in Issue 6081. The main observable difference other than Issue 6081 is that properties in object literals are quoted more intelligently and minify slightly more. Committed: https://code.google.com/p/dart/source/detail?r=15435

Patch Set 1 : #

Patch Set 2 : #

Total comments: 10

Patch Set 3 : Address code-review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+295 lines, -214 lines) Patch
M sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart View 1 2 2 chunks +262 lines, -158 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart View 1 2 3 chunks +28 lines, -14 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/js_backend.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/namer.dart View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/codegen.dart View 1 2 1 chunk +4 lines, -37 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
sra1
8 years ago (2012-11-24 00:13:38 UTC) #1
ngeoffray
LGTM! This is very nice. Adding Erik for the minify comment and Florian as he ...
8 years ago (2012-11-27 09:26:28 UTC) #2
sra1
I re-submitted as https://codereview.chromium.org/11348270 after discovering that global '$' was shadowed by the local 'extraArgumentName'. ...
8 years ago (2012-11-28 03:59:44 UTC) #3
ngeoffray
https://codereview.chromium.org/11308175/diff/8001/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart File sdk/lib/_internal/compiler/implementation/js_backend/namer.dart (right): https://codereview.chromium.org/11308175/diff/8001/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart#newcode411 sdk/lib/_internal/compiler/implementation/js_backend/namer.dart:411: js.Expression isolatePropertiesAccessForConstant(String constantName) { On 2012/11/28 03:59:44, sra1 wrote: ...
8 years ago (2012-11-28 09:25:20 UTC) #4
floitsch
8 years ago (2012-11-28 10:04:31 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/11308175/diff/8001/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/js_backend/namer.dart (right):

https://codereview.chromium.org/11308175/diff/8001/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/js_backend/namer.dart:411:
js.Expression isolatePropertiesAccessForConstant(String constantName) {
On 2012/11/28 09:25:21, ngeoffray wrote:
> On 2012/11/28 03:59:44, sra1 wrote:
> > On 2012/11/27 09:26:28, ngeoffray wrote:
> > > I'd prefer not having this method here. The namer is pretty consistent in
> > > returning strings.
> > 
> > I might agree, but that leaves the question of where to put this method?
> > In this case I will fold it into ConstantReferenceEmitter.
> > 
> > isolateAccess will need to be converted to return an expression too, but it
is
> > called from 25 places in 6 files.  Better to have one place that knows how
to
> > 'index' the current isolate than 25.  Consider what happens if we wrap the
> code
> > in a function - 25 places to update expression from an access path to a
simple
> > local variable.
> 
> So maybe the isolateAccess, isolateBailoutAccess... methods that do property
> access on the isolate should really not be in the namer. We should get a
js.Ast
> builder class that helps for doing these operations.

I agree. And it should probably be the emitter anyways that should give that
information.

Powered by Google App Engine
This is Rietveld 408576698