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

Issue 10544026: Simplify generated code for string interpolation by delaying the constant folding. (Closed)

Created:
8 years, 6 months ago by kasperl
Modified:
8 years, 6 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Simplify generated code for string interpolation by delaying the constant folding. Try to fix http://dartbug.com/3389 and http://dartbug.com/3240 by using getTypeNameOf to improve browser compatibility. R=lrn@google.com,floitsch@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=8332

Patch Set 1 #

Total comments: 10

Patch Set 2 : Move is-empty checks to codegen. #

Patch Set 3 : Add tracer support. #

Patch Set 4 : Merge. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+95 lines, -115 lines) Patch
M lib/compiler/implementation/lib/js_helper.dart View 2 chunks +5 lines, -13 lines 1 comment Download
M lib/compiler/implementation/ssa/builder.dart View 1 2 3 6 chunks +13 lines, -102 lines 0 comments Download
M lib/compiler/implementation/ssa/codegen.dart View 1 2 3 1 chunk +44 lines, -0 lines 0 comments Download
M lib/compiler/implementation/ssa/nodes.dart View 1 2 3 3 chunks +14 lines, -0 lines 0 comments Download
M lib/compiler/implementation/ssa/optimize.dart View 1 1 chunk +13 lines, -0 lines 0 comments Download
M lib/compiler/implementation/ssa/tracer.dart View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
kasperl
8 years, 6 months ago (2012-06-06 11:31:42 UTC) #1
Lasse Reichstein Nielsen
LvGTM. https://chromiumcodereview.appspot.com/10544026/diff/1/lib/compiler/implementation/lib/js_helper.dart File lib/compiler/implementation/lib/js_helper.dart (right): https://chromiumcodereview.appspot.com/10544026/diff/1/lib/compiler/implementation/lib/js_helper.dart#newcode379 lib/compiler/implementation/lib/js_helper.dart:379: String S(value) { Or use a German scharf-S ...
8 years, 6 months ago (2012-06-06 12:11:40 UTC) #2
floitsch
LGTM. please adapt the tracer for the new HNode. Add tests for the fixed bugs. ...
8 years, 6 months ago (2012-06-06 12:13:34 UTC) #3
kasperl
https://chromiumcodereview.appspot.com/10544026/diff/1/lib/compiler/implementation/ssa/builder.dart File lib/compiler/implementation/ssa/builder.dart (right): https://chromiumcodereview.appspot.com/10544026/diff/1/lib/compiler/implementation/ssa/builder.dart#newcode3293 lib/compiler/implementation/ssa/builder.dart:3293: HInstruction prefix = null; On 2012/06/06 12:13:34, floitsch wrote: ...
8 years, 6 months ago (2012-06-06 13:31:03 UTC) #4
sra1
8 years, 6 months ago (2012-06-06 18:07:06 UTC) #5
https://chromiumcodereview.appspot.com/10544026/diff/7/lib/compiler/implement...
File lib/compiler/implementation/lib/js_helper.dart (right):

https://chromiumcodereview.appspot.com/10544026/diff/7/lib/compiler/implement...
lib/compiler/implementation/lib/js_helper.dart:413: String name =
getTypeNameOf(object);
I think you should use getTypeNameOf only if the object.constructor.name is not
a string.

Regular Dart objects will have a constructor name - the one you arranged for.

The principal purpose of getTypeNameOf is to extract a tag from the object
somehow for native dispatch.
We make it lie for browser compat reasons.
It was never intended to work for general objects, and making it do so will
complicate the native dispatch.
For example, we rename 'Window' to 'DOMWindow', but you may also have another
pure Dart class called Window, and that would get renamed by mistake.

Perhaps we should rename getTypeNameOf to getDispatchTagForNativeClass.

Powered by Google App Engine
This is Rietveld 408576698