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

Issue 9967001: Fix bug where constants were not correctly canonicalized. (Closed)

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

Description

Fix bug where constants were not correctly canonicalized. Committed: https://code.google.com/p/dart/source/detail?r=6056

Patch Set 1 #

Total comments: 4

Patch Set 2 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -32 lines) Patch
M lib/compiler/implementation/compile_time_constants.dart View 1 17 chunks +29 lines, -28 lines 0 comments Download
M lib/compiler/implementation/emitter.dart View 1 1 chunk +3 lines, -2 lines 0 comments Download
M lib/compiler/implementation/ssa/codegen.dart View 1 1 chunk +2 lines, -2 lines 0 comments Download
A tests/language/src/CompileTimeConstantMTest.dart View 1 chunk +17 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
floitsch
8 years, 8 months ago (2012-03-30 05:20:20 UTC) #1
ngeoffray
LGTM https://chromiumcodereview.appspot.com/9967001/diff/1/lib/compiler/implementation/compile_time_constants.dart File lib/compiler/implementation/compile_time_constants.dart (right): https://chromiumcodereview.appspot.com/9967001/diff/1/lib/compiler/implementation/compile_time_constants.dart#newcode616 lib/compiler/implementation/compile_time_constants.dart:616: StringBuffer writeCanonicalizedJsCode(StringBuffer buffer, Constant value) { How about ...
8 years, 8 months ago (2012-03-30 08:28:32 UTC) #2
floitsch
8 years, 8 months ago (2012-03-30 18:11:49 UTC) #3
https://chromiumcodereview.appspot.com/9967001/diff/1/lib/compiler/implementa...
File lib/compiler/implementation/compile_time_constants.dart (right):

https://chromiumcodereview.appspot.com/9967001/diff/1/lib/compiler/implementa...
lib/compiler/implementation/compile_time_constants.dart:616: StringBuffer
writeCanonicalizedJsCode(StringBuffer buffer, Constant value) {
On 2012/03/30 08:28:32, ngeoffray wrote:
> How about using this as the only entry point for writing a constant? So
> everything outside this file would do:
> 
> compiler.constantHandler.writeConstant(value, buffer).
> 
> Then this method would dispatch to constant.writeCanonicalizedJsCode. 
> 
> Also, how about making writeJsCode and writeCanonicalizedJsCode on the
Constant
> classes private? Even if that file is not a library, it will be a strong
> indication that it should not be used directly.

Done.

https://chromiumcodereview.appspot.com/9967001/diff/1/lib/compiler/implementa...
File lib/compiler/implementation/ssa/codegen.dart (right):

https://chromiumcodereview.appspot.com/9967001/diff/1/lib/compiler/implementa...
lib/compiler/implementation/ssa/codegen.dart:831:
node.constant.writeJsCode(buffer, handler);
On 2012/03/30 08:28:32, ngeoffray wrote:
> How about this one? Being a num helps you know it's not needed, but that's
> something a user of CTC does not have to think about, so please consider my
> suggestion of a single entry-point for writing a constant.

Done.

Powered by Google App Engine
This is Rietveld 408576698