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

Issue 9515011: Add support for malformed types and postpone some related errors from compile (Closed)

Created:
8 years, 9 months ago by regis
Modified:
8 years, 9 months ago
Reviewers:
srdjan, hausner
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add support for malformed types and postpone some related errors from compile time to execution time. Still to do (once spec is clarified): - properly handle generic type bounds errors - properly handle 'instance of' type checks involving malformed types - fix bad tests Committed: https://code.google.com/p/dart/source/detail?r=4732

Patch Set 1 #

Total comments: 16

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+482 lines, -257 lines) Patch
M runtime/lib/error.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M runtime/lib/error.cc View 1 2 7 chunks +56 lines, -18 lines 0 comments Download
M runtime/lib/error.dart View 1 2 3 chunks +8 lines, -3 lines 0 comments Download
M runtime/vm/bootstrap_natives.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/class_finalizer.h View 1 2 4 chunks +28 lines, -7 lines 0 comments Download
M runtime/vm/class_finalizer.cc View 1 2 38 chunks +130 lines, -87 lines 0 comments Download
M runtime/vm/code_generator_ia32.cc View 1 2 9 chunks +27 lines, -21 lines 0 comments Download
M runtime/vm/code_generator_x64.cc View 1 2 15 chunks +32 lines, -27 lines 0 comments Download
M runtime/vm/object.h View 1 2 4 chunks +8 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 2 5 chunks +40 lines, -3 lines 0 comments Download
M runtime/vm/parser.h View 1 2 5 chunks +14 lines, -13 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 35 chunks +111 lines, -57 lines 0 comments Download
M runtime/vm/raw_object.h View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M tests/co19/co19-runtime.status View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M tests/language/language.status View 1 2 3 chunks +13 lines, -9 lines 0 comments Download
M tests/language/src/Prefix22NegativeTest.dart View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M tests/language/src/Prefix23NegativeTest.dart View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M tests/language/src/TypeVariableBoundsTest.dart View 1 2 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
regis
8 years, 9 months ago (2012-02-28 22:58:39 UTC) #1
hausner
lgtm https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/vm/class_finalizer.h File runtime/vm/class_finalizer.h (right): https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/vm/class_finalizer.h#newcode50 runtime/vm/class_finalizer.h:50: kFinalizeWellFormed // Error-free resolution and finalization are required. ...
8 years, 9 months ago (2012-02-28 23:52:58 UTC) #2
regis
Thanks! https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/vm/class_finalizer.h File runtime/vm/class_finalizer.h (right): https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/vm/class_finalizer.h#newcode50 runtime/vm/class_finalizer.h:50: kFinalizeWellFormed // Error-free resolution and finalization are required. ...
8 years, 9 months ago (2012-02-29 00:05:23 UTC) #3
srdjan
https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/lib/error.dart File runtime/lib/error.dart (right): https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/lib/error.dart#newcode39 runtime/lib/error.dart:39: return "'$url': Failed type check: line $line pos $column: ...
8 years, 9 months ago (2012-02-29 00:15:54 UTC) #4
srdjan
And LGTM
8 years, 9 months ago (2012-02-29 00:16:50 UTC) #5
regis
8 years, 9 months ago (2012-02-29 02:10:01 UTC) #6
Thanks!

https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/lib/error.dart
File runtime/lib/error.dart (right):

https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/lib/error.dart#...
runtime/lib/error.dart:39: return "'$url': Failed type check: line $line pos
$column: " +
On 2012/02/29 00:15:54, srdjan wrote:
> no else is needed

Done.

https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/vm/class_finali...
File runtime/vm/class_finalizer.h (right):

https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/vm/class_finali...
runtime/vm/class_finalizer.h:44: enum TypeFinalization {
On 2012/02/29 00:15:54, srdjan wrote:
> Maybe FinalizationKind is a better name?

Renamed to FinalizationMode.

https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/vm/code_generat...
File runtime/vm/code_generator_ia32.cc (right):

https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/vm/code_generat...
runtime/vm/code_generator_ia32.cc:1483: __ PushObject(result);  // Make room for
the result of the runtime call.
On 2012/02/29 00:15:54, srdjan wrote:
> Is this precaution to push a dummy for result? MalformedTypeError is not
setting
> a result, is it?

Correct. No result is returned, but we always reserve space for the result
anyway out of precaution.

https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/vm/code_generat...
runtime/vm/code_generator_ia32.cc:1483: __ PushObject(result);  // Make room for
the result of the runtime call.
On 2012/02/29 00:15:54, srdjan wrote:
> __ PushObject(Object::ZoneHandle());

Done here and in other places.

https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/vm/code_generat...
File runtime/vm/code_generator_x64.cc (right):

https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/vm/code_generat...
runtime/vm/code_generator_x64.cc:1472: __ PushObject(result);  // Make room for
the result of the runtime call.
On 2012/02/29 00:15:54, srdjan wrote:
> ditto

Done.

https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/vm/parser.cc
File runtime/vm/parser.cc (right):

https://chromiumcodereview.appspot.com/9515011/diff/1/runtime/vm/parser.cc#ne...
runtime/vm/parser.cc:5486: if (type.IsMalformed()) {
On 2012/02/29 00:15:54, srdjan wrote:
> Could you factor this code out please.

Done.

https://chromiumcodereview.appspot.com/9515011/diff/1/tests/co19/co19-runtime...
File tests/co19/co19-runtime.status (right):

https://chromiumcodereview.appspot.com/9515011/diff/1/tests/co19/co19-runtime...
tests/co19/co19-runtime.status:178: Language/09_Generics/09_Generics_A04_t05:
Fail  # Should not expect a compile time error.
On 2012/02/29 00:15:54, srdjan wrote:
> Please file an issue with co19 and put the issue number here.

Issue co19 83 filed.
Earlier, in patch 2, I filed issue co19 82.

Powered by Google App Engine
This is Rietveld 408576698