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

Issue 9703074: Call the compile-time constant handler inside bodies. (Closed)

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

Description

Call the compile-time constant handler inside bodies. Don't transform a const instantiation into a 'new'. Committed: https://code.google.com/p/dart/source/detail?r=5706

Patch Set 1 #

Patch Set 2 : Update status files. #

Total comments: 7

Patch Set 3 : Address comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -28 lines) Patch
M frog/leg/compile_time_constants.dart View 1 2 2 chunks +21 lines, -15 lines 0 comments Download
M frog/leg/ssa/builder.dart View 1 2 1 chunk +9 lines, -1 line 0 comments Download
M tests/co19/co19-leg.status View 1 2 6 chunks +4 lines, -10 lines 0 comments Download
M tests/language/language-leg.status View 1 2 3 chunks +1 line, -2 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
floitsch
8 years, 9 months ago (2012-03-20 05:01:13 UTC) #1
ngeoffray
LGTM https://chromiumcodereview.appspot.com/9703074/diff/2001/frog/leg/compile_time_constants.dart File frog/leg/compile_time_constants.dart (right): https://chromiumcodereview.appspot.com/9703074/diff/2001/frog/leg/compile_time_constants.dart#newcode512 frog/leg/compile_time_constants.dart:512: Why is this one not measuring anymore? Even ...
8 years, 9 months ago (2012-03-20 08:26:07 UTC) #2
ahe
LGTM https://chromiumcodereview.appspot.com/9703074/diff/2001/frog/leg/compile_time_constants.dart File frog/leg/compile_time_constants.dart (right): https://chromiumcodereview.appspot.com/9703074/diff/2001/frog/leg/compile_time_constants.dart#newcode517 frog/leg/compile_time_constants.dart:517: new CompileTimeConstantError(kind, const [])); While trying to make ...
8 years, 9 months ago (2012-03-20 08:28:40 UTC) #3
ngeoffray
https://chromiumcodereview.appspot.com/9703074/diff/2001/frog/leg/compile_time_constants.dart File frog/leg/compile_time_constants.dart (right): https://chromiumcodereview.appspot.com/9703074/diff/2001/frog/leg/compile_time_constants.dart#newcode517 frog/leg/compile_time_constants.dart:517: new CompileTimeConstantError(kind, const [])); On 2012/03/20 08:28:40, ahe wrote: ...
8 years, 9 months ago (2012-03-20 08:30:52 UTC) #4
floitsch
https://chromiumcodereview.appspot.com/9703074/diff/2001/frog/leg/compile_time_constants.dart File frog/leg/compile_time_constants.dart (right): https://chromiumcodereview.appspot.com/9703074/diff/2001/frog/leg/compile_time_constants.dart#newcode512 frog/leg/compile_time_constants.dart:512: On 2012/03/20 08:26:07, ngeoffray wrote: > Why is this ...
8 years, 9 months ago (2012-03-21 07:14:24 UTC) #5
ngeoffray
https://chromiumcodereview.appspot.com/9703074/diff/2001/frog/leg/compile_time_constants.dart File frog/leg/compile_time_constants.dart (right): https://chromiumcodereview.appspot.com/9703074/diff/2001/frog/leg/compile_time_constants.dart#newcode517 frog/leg/compile_time_constants.dart:517: new CompileTimeConstantError(kind, const [])); On 2012/03/21 07:14:24, floitsch wrote: ...
8 years, 9 months ago (2012-03-21 07:41:11 UTC) #6
ahe
8 years, 9 months ago (2012-03-21 10:13:37 UTC) #7
https://chromiumcodereview.appspot.com/9703074/diff/2001/frog/leg/compile_tim...
File frog/leg/compile_time_constants.dart (right):

https://chromiumcodereview.appspot.com/9703074/diff/2001/frog/leg/compile_tim...
frog/leg/compile_time_constants.dart:517: new CompileTimeConstantError(kind,
const []));
On 2012/03/21 07:14:24, floitsch wrote:
> On 2012/03/20 08:30:52, ngeoffray wrote:
> > On 2012/03/20 08:28:40, ahe wrote:
> > > While trying to make our errors non-fatal, I noticed this would lead to a
> > stack
> > > overflow. Would it make sense to return "new NullConstant()"?
> > 
> > IMO, I don't see any trouble in returning something here.
> 
> It could lead to another cryptic error right afterwards.

Which is definitely an improvement over the same error message repeated until
you get a stack overflow :-)

One proven technique is to return an erroneous element that shuts up the other
parts of the evaluator. I think returning a NullConstant is a good short-term
solution, possibly with a TODO.

Powered by Google App Engine
This is Rietveld 408576698