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

Issue 11448009: Represent runtime type information as nested lists. (Closed)

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

Description

Represent runtime type information as nested lists. The class of a type is represented either by its Javascript constructor or, if it is a native JavaScript type, by a string. A type without type arguments uses its class' representation. A types with type arguments is represented by a list, where the first element is the representation of the class and the rest are the representation of the arguments. Committed: https://code.google.com/p/dart/source/detail?r=15838

Patch Set 1 #

Patch Set 2 : Minor edits. #

Total comments: 26

Patch Set 3 : Address comments. #

Total comments: 20
Unified diffs Side-by-side diffs Delta from patch set Stats (+234 lines, -150 lines) Patch
M sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart View 1 chunk +3 lines, -9 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart View 1 2 1 chunk +63 lines, -28 lines 6 comments Download
M sdk/lib/_internal/compiler/implementation/lib/js_helper.dart View 1 2 1 chunk +50 lines, -10 lines 4 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/builder.dart View 1 2 6 chunks +102 lines, -73 lines 10 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/codegen.dart View 1 2 1 chunk +4 lines, -19 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/nodes.dart View 1 2 1 chunk +8 lines, -6 lines 0 comments Download
M tests/co19/co19-dart2js.status View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M tests/language/generic_creation_test.dart View 2 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
karlklose
8 years ago (2012-12-05 12:58:19 UTC) #1
kasperl
LGTM. https://codereview.chromium.org/11448009/diff/1011/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart File sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart (right): https://codereview.chromium.org/11448009/diff/1011/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart#newcode32 sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart:32: String getJsName(Element element) { I wonder if this ...
8 years ago (2012-12-06 09:51:04 UTC) #2
karlklose
Thanks, Kasper! https://codereview.chromium.org/11448009/diff/1011/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart File sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart (right): https://codereview.chromium.org/11448009/diff/1011/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart#newcode32 sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart:32: String getJsName(Element element) { The problem is ...
8 years ago (2012-12-06 13:30:03 UTC) #3
ngeoffray
LGTM https://codereview.chromium.org/11448009/diff/3002/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart File sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart (right): https://codereview.chromium.org/11448009/diff/3002/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart#newcode23 sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart:23: /// Return the unique name for the element ...
8 years ago (2012-12-06 23:21:45 UTC) #4
karlklose
8 years ago (2012-12-07 07:46:34 UTC) #5
Thanks Nicolas!

https://codereview.chromium.org/11448009/diff/3002/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
(right):

https://codereview.chromium.org/11448009/diff/3002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart:23: ///
Return the unique name for the element as an unqoted string.
On 2012/12/06 23:21:45, ngeoffray wrote:
> unqoted -> unquoted

Done.

https://codereview.chromium.org/11448009/diff/3002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart:26:
Namer namer = backend.namer;
Done, removed.

https://codereview.chromium.org/11448009/diff/3002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart:65:
ClassElement cls = element;
I changed it to use a string representation (like for the natives) for
uninstantiated classes for now.

https://codereview.chromium.org/11448009/diff/3002/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/lib/js_helper.dart (right):

https://codereview.chromium.org/11448009/diff/3002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/lib/js_helper.dart:1636: if
(runtimeType.length = 1) return className;
Argh, this is bad. Good catch.

https://codereview.chromium.org/11448009/diff/3002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/lib/js_helper.dart:1681: // a function
is$s[0] on t[0] and call it with substitutes type arguments.
On 2012/12/06 23:21:45, ngeoffray wrote:
> Please don't use JS in this method. The compiler knows or will know it's an
> array.

Done.

https://codereview.chromium.org/11448009/diff/3002/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/ssa/builder.dart (right):

https://codereview.chromium.org/11448009/diff/3002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:2636:
createForeign(String code, String type, List<HInstruction> inputs) {
On 2012/12/06 23:21:45, ngeoffray wrote:
> HForeign createForeign

Done.

https://codereview.chromium.org/11448009/diff/3002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:2647: //
TODO(karlklose): change construction of the representations to be GVN'able.
On 2012/12/06 23:21:45, ngeoffray wrote:
> You can also reference the bug number.

Done.

https://codereview.chromium.org/11448009/diff/3002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:2650: return
createForeign(code, 'JSArray', inputs);
I changed it to '=List'.

https://codereview.chromium.org/11448009/diff/3002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:2743:
type.element.isTypeVariable()) {
You are right, this is a left-over from trying to handle both in this CL.
Removed.

https://codereview.chromium.org/11448009/diff/3002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:2746: //
optimizations?
I will remove the comment. Let's chat about dartbug.com/7182 next week.

Powered by Google App Engine
This is Rietveld 408576698