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

Issue 11602016: Emit classes using ASTs (Closed)

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

Description

Emit more stuff via ASTs - Block CodeBuffer.toString() to prevent accidental loss of sourcemap info. - keep compiled code as ASTs rather than CodeBuffers. - class members are collected in a ClassBuilder and emitted as a js.ObjectInitializer. - Use double quotes for JS strings more uniformly. Unminified code is 5% larger due to corrected indentation. This does not affect minified code. Committed: https://code.google.com/p/dart/source/detail?r=16646

Patch Set 1 : #

Patch Set 2 : #

Total comments: 9

Patch Set 3 : #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+300 lines, -310 lines) Patch
M sdk/lib/_internal/compiler/implementation/code_buffer.dart View 2 chunks +5 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/compiler.dart View 1 1 chunk +2 lines, -2 lines 2 comments Download
M sdk/lib/_internal/compiler/implementation/dart2jslib.dart View 1 1 chunk +1 line, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/enqueue.dart View 1 chunk +0 lines, -10 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js/nodes.dart View 1 2 chunks +5 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/js/printer.dart View 1 2 4 chunks +29 lines, -8 lines 2 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/backend.dart View 1 1 chunk +4 lines, -4 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart View 1 36 chunks +144 lines, -154 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart View 1 2 chunks +9 lines, -14 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart View 1 8 chunks +81 lines, -94 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/codegen.dart View 1 6 chunks +11 lines, -14 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/universe/universe.dart View 1 4 chunks +9 lines, -8 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
sra1
7 years, 11 months ago (2013-01-03 04:14:58 UTC) #1
floitsch
LGTM. https://codereview.chromium.org/11602016/diff/12013/sdk/lib/_internal/compiler/implementation/code_buffer.dart File sdk/lib/_internal/compiler/implementation/code_buffer.dart (right): https://codereview.chromium.org/11602016/diff/12013/sdk/lib/_internal/compiler/implementation/code_buffer.dart#newcode70 sdk/lib/_internal/compiler/implementation/code_buffer.dart:70: throw "Don't use CodeBuffer.toString() since it drops sourcemap ...
7 years, 11 months ago (2013-01-04 10:31:03 UTC) #2
sra1
https://chromiumcodereview.appspot.com/11602016/diff/12013/sdk/lib/_internal/compiler/implementation/code_buffer.dart File sdk/lib/_internal/compiler/implementation/code_buffer.dart (right): https://chromiumcodereview.appspot.com/11602016/diff/12013/sdk/lib/_internal/compiler/implementation/code_buffer.dart#newcode70 sdk/lib/_internal/compiler/implementation/code_buffer.dart:70: throw "Don't use CodeBuffer.toString() since it drops sourcemap data."; ...
7 years, 11 months ago (2013-01-04 23:47:52 UTC) #3
floitsch
https://chromiumcodereview.appspot.com/11602016/diff/12013/sdk/lib/_internal/compiler/implementation/js/printer.dart File sdk/lib/_internal/compiler/implementation/js/printer.dart (right): https://chromiumcodereview.appspot.com/11602016/diff/12013/sdk/lib/_internal/compiler/implementation/js/printer.dart#newcode783 sdk/lib/_internal/compiler/implementation/js/printer.dart:783: newLine(); On 2013/01/04 23:47:52, sra1 wrote: > On 2013/01/04 ...
7 years, 11 months ago (2013-01-04 23:58:20 UTC) #4
ngeoffray
https://chromiumcodereview.appspot.com/11602016/diff/19001/sdk/lib/_internal/compiler/implementation/compiler.dart File sdk/lib/_internal/compiler/implementation/compiler.dart (right): https://chromiumcodereview.appspot.com/11602016/diff/19001/sdk/lib/_internal/compiler/implementation/compiler.dart#newcode54 sdk/lib/_internal/compiler/implementation/compiler.dart:54: js.Expression code = world.universe.generatedCode[element]; Did you measure the memory ...
7 years, 11 months ago (2013-01-10 10:40:07 UTC) #5
sra1
7 years, 11 months ago (2013-01-10 16:32:42 UTC) #6
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/11602016/diff/19001/sdk/lib/_internal/...
File sdk/lib/_internal/compiler/implementation/compiler.dart (right):

https://chromiumcodereview.appspot.com/11602016/diff/19001/sdk/lib/_internal/...
sdk/lib/_internal/compiler/implementation/compiler.dart:54: js.Expression code =
world.universe.generatedCode[element];
On 2013/01/10 10:40:07, ngeoffray wrote:
> Did you measure the memory impact of this change?

Is there a convenient way to do this?

https://chromiumcodereview.appspot.com/11602016/diff/19001/sdk/lib/_internal/...
File sdk/lib/_internal/compiler/implementation/js/printer.dart (right):

https://chromiumcodereview.appspot.com/11602016/diff/19001/sdk/lib/_internal/...
sdk/lib/_internal/compiler/implementation/js/printer.dart:684: if (field ==
'"super"') return false;
On 2013/01/10 10:40:07, ngeoffray wrote:
> Using super breaks android AFAIR. Why did you need to change this?

Without this line, we get
  super: "X",
with the line, we get
  "super": "X",

It was not a problem before because super was simply printed in quotes.

Powered by Google App Engine
This is Rietveld 408576698