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

Issue 12207081: Add a type kind to TypedSelector. A typed selector can either be (Closed)

Created:
7 years, 10 months ago by ngeoffray
Modified:
7 years, 10 months ago
Reviewers:
karlklose, sra1, kasperl
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add a type kind to TypedSelector. A typed selector can either be - EXACT: it knows the exact type of the receiver (e.g. new Map()). - SUBCLASS: the type is in the subclass hierarchy (e.g. 'this') - INTERFACE: any type that implements the receiver type is a target. Committed: https://code.google.com/p/dart/source/detail?r=18311

Patch Set 1 : #

Patch Set 2 : #

Total comments: 1

Patch Set 3 : #

Total comments: 16

Patch Set 4 : #

Total comments: 8

Patch Set 5 : #

Total comments: 15

Patch Set 6 : #

Patch Set 7 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+397 lines, -188 lines) Patch
M sdk/lib/_internal/compiler/implementation/compiler.dart View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/enqueue.dart View 1 2 3 4 1 chunk +4 lines, -18 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/backend.dart View 1 2 3 4 5 6 2 chunks +3 lines, -4 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/builder.dart View 1 2 3 4 5 6 chunks +45 lines, -19 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/codegen.dart View 1 2 3 4 2 chunks +17 lines, -15 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/nodes.dart View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/optimize.dart View 1 2 3 2 chunks +3 lines, -4 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/types.dart View 1 2 3 4 21 chunks +189 lines, -76 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/universe/function_set.dart View 1 2 3 4 5 2 chunks +10 lines, -6 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/universe/partial_type_tree.dart View 1 2 3 3 chunks +2 lines, -7 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/universe/universe.dart View 1 2 3 4 11 chunks +70 lines, -25 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/world.dart View 1 2 3 4 5 3 chunks +10 lines, -4 lines 0 comments Download
M tests/compiler/dart2js/dart2js.status View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M tests/compiler/dart2js/dart_backend_test.dart View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M tests/compiler/dart2js/mock_compiler.dart View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M tests/compiler/dart2js/type_combination_test.dart View 1 2 3 4 5 6 1 chunk +6 lines, -6 lines 0 comments Download
A tests/language/mixin_this_use_test.dart View 1 2 3 1 chunk +28 lines, -0 lines 0 comments Download
M tests/utils/dummy_compiler_test.dart View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M tests/utils/recursive_import_test.dart View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
ngeoffray
7 years, 10 months ago (2013-02-08 15:27:13 UTC) #1
karlklose
Could you give an example where knowing the difference between implementing an interface and being ...
7 years, 10 months ago (2013-02-08 20:20:34 UTC) #2
ngeoffray
On 2013/02/08 20:20:34, karlklose wrote: > Could you give an example where knowing the difference ...
7 years, 10 months ago (2013-02-08 22:07:51 UTC) #3
ngeoffray
On 2013/02/08 22:07:51, ngeoffray wrote: > On 2013/02/08 20:20:34, karlklose wrote: > > Could you ...
7 years, 10 months ago (2013-02-08 22:10:35 UTC) #4
sra1
https://codereview.chromium.org/12207081/diff/9001/sdk/lib/_internal/compiler/implementation/universe/universe.dart File sdk/lib/_internal/compiler/implementation/universe/universe.dart (right): https://codereview.chromium.org/12207081/diff/9001/sdk/lib/_internal/compiler/implementation/universe/universe.dart#newcode430 sdk/lib/_internal/compiler/implementation/universe/universe.dart:430: if (receiverType != null) type = ', type=$receiverType'; Include ...
7 years, 10 months ago (2013-02-08 23:25:16 UTC) #5
kasperl
https://codereview.chromium.org/12207081/diff/11/sdk/lib/_internal/compiler/implementation/enqueue.dart File sdk/lib/_internal/compiler/implementation/enqueue.dart (right): https://codereview.chromium.org/12207081/diff/11/sdk/lib/_internal/compiler/implementation/enqueue.dart#newcode359 sdk/lib/_internal/compiler/implementation/enqueue.dart:359: new TypedSelector(type, TypedSelectorKind.SUBCLASS, getter), Wouldn't it be logical to ...
7 years, 10 months ago (2013-02-11 08:18:12 UTC) #6
ahe
DBC, I think this functionality should be tracked by the type system. This way, the ...
7 years, 10 months ago (2013-02-11 09:35:03 UTC) #7
ahe
DBC, I think this functionality should be tracked by the type system. This way, the ...
7 years, 10 months ago (2013-02-11 09:35:05 UTC) #8
ahe
DBC, I think this functionality should be tracked by the type system. This way, the ...
7 years, 10 months ago (2013-02-11 09:35:08 UTC) #9
ngeoffray
Thanks Kasper. PTAL https://codereview.chromium.org/12207081/diff/11/sdk/lib/_internal/compiler/implementation/enqueue.dart File sdk/lib/_internal/compiler/implementation/enqueue.dart (right): https://codereview.chromium.org/12207081/diff/11/sdk/lib/_internal/compiler/implementation/enqueue.dart#newcode359 sdk/lib/_internal/compiler/implementation/enqueue.dart:359: new TypedSelector(type, TypedSelectorKind.SUBCLASS, getter), On 2013/02/11 ...
7 years, 10 months ago (2013-02-11 10:20:55 UTC) #10
ngeoffray
On 2013/02/11 09:35:08, ahe wrote: > DBC, I think this functionality should be tracked by ...
7 years, 10 months ago (2013-02-11 10:24:26 UTC) #11
kasperl
https://codereview.chromium.org/12207081/diff/1014/sdk/lib/_internal/compiler/implementation/enqueue.dart File sdk/lib/_internal/compiler/implementation/enqueue.dart (right): https://codereview.chromium.org/12207081/diff/1014/sdk/lib/_internal/compiler/implementation/enqueue.dart#newcode359 sdk/lib/_internal/compiler/implementation/enqueue.dart:359: new TypedSelector.subclass(type, getter), Aren't we throwing away information at ...
7 years, 10 months ago (2013-02-11 13:11:50 UTC) #12
ngeoffray
PTAL https://codereview.chromium.org/12207081/diff/1014/sdk/lib/_internal/compiler/implementation/enqueue.dart File sdk/lib/_internal/compiler/implementation/enqueue.dart (right): https://codereview.chromium.org/12207081/diff/1014/sdk/lib/_internal/compiler/implementation/enqueue.dart#newcode359 sdk/lib/_internal/compiler/implementation/enqueue.dart:359: new TypedSelector.subclass(type, getter), On 2013/02/11 13:11:50, kasperl wrote: ...
7 years, 10 months ago (2013-02-11 14:20:29 UTC) #13
kasperl
LGTM. https://codereview.chromium.org/12207081/diff/13/sdk/lib/_internal/compiler/implementation/ssa/builder.dart File sdk/lib/_internal/compiler/implementation/ssa/builder.dart (right): https://codereview.chromium.org/12207081/diff/13/sdk/lib/_internal/compiler/implementation/ssa/builder.dart#newcode256 sdk/lib/_internal/compiler/implementation/ssa/builder.dart:256: if (compiler.world.isUsedAsMixin(cls)) { Add comment to explain why ...
7 years, 10 months ago (2013-02-11 14:30:34 UTC) #14
ngeoffray
7 years, 10 months ago (2013-02-11 14:53:29 UTC) #15
Thanks Kasper

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

https://codereview.chromium.org/12207081/diff/13/sdk/lib/_internal/compiler/i...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:256: if
(compiler.world.isUsedAsMixin(cls)) {
On 2013/02/11 14:30:34, kasperl wrote:
> Add comment to explain why this is done?

Done.

https://codereview.chromium.org/12207081/diff/13/sdk/lib/_internal/compiler/i...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:429: HType
cachedTypeOfThis;
On 2013/02/11 14:30:34, kasperl wrote:
> Could the cachedTypeOfThis reading/writing be moved to computeTypeOfThis
> instead?

Done.

https://codereview.chromium.org/12207081/diff/13/sdk/lib/_internal/compiler/i...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:4631:
compiler.mapLiteralClass.computeType(compiler), compiler);
On 2013/02/11 14:30:34, kasperl wrote:
> It's very common that you call computeType as part of calling one of the HType
> constructors? Maybe the constructors could do that for you instead? So instead
> of passing a DartType you would pass an element? Not sure if this is a good
idea
> or not.

Sometimes, you do have the DartType available and call new HType with it. So we
would need to add new constructors like: Htype.nonNullSubTypeWithElement(...).
I'd prefer not to.

https://codereview.chromium.org/12207081/diff/13/sdk/lib/_internal/compiler/i...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:4648: HType
mapNativeType(type) {
On 2013/02/11 14:30:34, kasperl wrote:
> What is the type of type?

It can be of different classes (DartType or ad-hoc types for JsObject and
JsArray), so I cannot type it. I hope this is temporary and a better type system
will fix it.

https://codereview.chromium.org/12207081/diff/13/sdk/lib/_internal/compiler/i...
File sdk/lib/_internal/compiler/implementation/universe/function_set.dart
(right):

https://codereview.chromium.org/12207081/diff/13/sdk/lib/_internal/compiler/i...
sdk/lib/_internal/compiler/implementation/universe/function_set.dart:50: //
TODO(kasperl): For now, we use a different implementation for
On 2013/02/11 14:30:34, kasperl wrote:
> Move the TODO comment to shouldVisitAll?

Done.

https://codereview.chromium.org/12207081/diff/13/sdk/lib/_internal/compiler/i...
sdk/lib/_internal/compiler/implementation/universe/function_set.dart:62: //
TODO(kasperl): For now, we use a different implementation for
On 2013/02/11 14:30:34, kasperl wrote:
> Ditto.

Done.

https://codereview.chromium.org/12207081/diff/13/sdk/lib/_internal/compiler/i...
File sdk/lib/_internal/compiler/implementation/world.dart (right):

https://codereview.chromium.org/12207081/diff/13/sdk/lib/_internal/compiler/i...
sdk/lib/_internal/compiler/implementation/world.dart:28: bool
isUsedAsMixin(ClassElement cls) {
On 2013/02/11 14:30:34, kasperl wrote:
> Move closer to registerMixinUse.

Done.

Powered by Google App Engine
This is Rietveld 408576698