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

Issue 11360228: Simplify runtime type support. (Closed)

Created:
8 years, 1 month ago by karlklose
Modified:
8 years, 1 month ago
Reviewers:
ngeoffray
CC:
reviews_dartlang.org, floitsch, ahe, kasperl
Visibility:
Public.

Description

Simplify runtime type support. 1. Store the class name on the JS constructor and only attach runtime type information to objects that need information about their type arguments. 2. Generate the runtime type string at runtime. 3. Change the structure of runtime type information to an array and access type arguments by index. Committed: https://code.google.com/p/dart/source/detail?r=15255

Patch Set 1 #

Patch Set 2 : Fix bug and add regression test. #

Patch Set 3 : Adjust test expectations. #

Patch Set 4 : Remove test again. #

Total comments: 25

Patch Set 5 : Address review comments. #

Total comments: 6

Patch Set 6 : Add a comment. #

Patch Set 7 : #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+99 lines, -168 lines) Patch
M sdk/lib/_internal/compiler/implementation/js/nodes.dart View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/js_backend.dart View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/namer.dart View 1 2 3 4 5 6 2 chunks +0 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart View 1 2 3 4 5 6 2 chunks +28 lines, -91 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/interceptors.dart View 1 2 3 4 5 6 1 chunk +19 lines, -0 lines 2 comments Download
M sdk/lib/_internal/compiler/implementation/lib/js_array.dart View 1 2 3 4 5 6 1 chunk +1 line, -1 line 2 comments Download
M sdk/lib/_internal/compiler/implementation/lib/js_helper.dart View 1 2 3 4 5 6 2 chunks +19 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/js_number.dart View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/js_string.dart View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/builder.dart View 1 2 3 4 5 6 7 chunks +13 lines, -54 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/codegen.dart View 1 2 3 4 5 6 2 chunks +4 lines, -6 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/optimize.dart View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/ssa.dart View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M tests/co19/co19-dart2js.status View 1 2 3 4 5 6 2 chunks +0 lines, -3 lines 0 comments Download
M tests/language/first_class_types_literals_test.dart View 1 2 3 4 5 6 2 chunks +4 lines, -1 line 0 comments Download
M tests/language/language_dart2js.status View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
karlklose
8 years, 1 month ago (2012-11-14 12:40:33 UTC) #1
ngeoffray
I like the cleanup on generating the type info at runtime. https://codereview.chromium.org/11360228/diff/7001/sdk/lib/_internal/compiler/implementation/js/nodes.dart File sdk/lib/_internal/compiler/implementation/js/nodes.dart (right): ...
8 years, 1 month ago (2012-11-15 08:58:09 UTC) #2
karlklose
PTAL. https://codereview.chromium.org/11360228/diff/7001/sdk/lib/_internal/compiler/implementation/js/nodes.dart File sdk/lib/_internal/compiler/implementation/js/nodes.dart (right): https://codereview.chromium.org/11360228/diff/7001/sdk/lib/_internal/compiler/implementation/js/nodes.dart#newcode717 sdk/lib/_internal/compiler/implementation/js/nodes.dart:717: : selector = new LiteralString('$index'); i used LiteralNumber. ...
8 years, 1 month ago (2012-11-16 13:37:19 UTC) #3
ngeoffray
LGTM, but I'd like to know what others think about the builtin$cls added to the ...
8 years, 1 month ago (2012-11-16 13:47:34 UTC) #4
karlklose
Thanks for the review, Nicolas. https://codereview.chromium.org/11360228/diff/15001/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart File sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (right): https://codereview.chromium.org/11360228/diff/15001/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart#newcode173 sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart:173: constructor.builtin\$cls = cls; I ...
8 years, 1 month ago (2012-11-20 10:35:26 UTC) #5
ngeoffray
https://codereview.chromium.org/11360228/diff/20013/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart File sdk/lib/_internal/compiler/implementation/lib/interceptors.dart (right): https://codereview.chromium.org/11360228/diff/20013/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart#newcode58 sdk/lib/_internal/compiler/implementation/lib/interceptors.dart:58: get$runtimeType(receiver) { This is dead code now. https://codereview.chromium.org/11360228/diff/20013/sdk/lib/_internal/compiler/implementation/lib/js_array.dart File ...
8 years, 1 month ago (2012-11-22 17:09:38 UTC) #6
karlklose
8 years, 1 month ago (2012-11-23 08:47:45 UTC) #7
Message was sent while issue was closed.
Good catch, I created https://codereview.chromium.org/11348207/ to fix it.

https://codereview.chromium.org/11360228/diff/20013/sdk/lib/_internal/compile...
File sdk/lib/_internal/compiler/implementation/lib/interceptors.dart (right):

https://codereview.chromium.org/11360228/diff/20013/sdk/lib/_internal/compile...
sdk/lib/_internal/compiler/implementation/lib/interceptors.dart:58:
get$runtimeType(receiver) {
On 2012/11/22 17:09:39, ngeoffray wrote:
> This is dead code now.

Done.

https://codereview.chromium.org/11360228/diff/20013/sdk/lib/_internal/compile...
File sdk/lib/_internal/compiler/implementation/lib/js_array.dart (right):

https://codereview.chromium.org/11360228/diff/20013/sdk/lib/_internal/compile...
sdk/lib/_internal/compiler/implementation/lib/js_array.dart:170: Type get
runtimeType => List;
On 2012/11/22 17:09:39, ngeoffray wrote:
> You're missing the type parameters, and this is the method that will be called
> when [].runtimeType is in Dart code. Are you missing tests on runtimeType with
> parameterized lists?

Done.

Powered by Google App Engine
This is Rietveld 408576698