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

Issue 1409803003: dart2js cps: More interceptor optimizations and fixes. (Closed)

Created:
5 years, 2 months ago by asgerf
Modified:
5 years, 1 month ago
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

dart2js cps: More interceptor optimizations and fixes. When the result of getInterceptor is either null or a known constant, it is compiled to `x && const` or `x == null ? x : const` depending on whether there are any other falsy values for that type. This required some changes to share_interceptors so it can share/hoist the constant subexpression separately from the whole expression. The Interceptor root class is removed from the intercepted classes of getInterceptor when it is "shadowed" by all the other intercepted classes. E.g. if the input is a number or a string, there is no need to intercept for {JSNumber, JSString, Interceptor}, because JSNumber and JSString collectively shadow Interceptor. R=sra@google.com Committed: https://github.com/dart-lang/sdk/commit/f712e08e949f39f72fe7a446995f5b7dbf6f590d

Patch Set 1 #

Total comments: 8

Patch Set 2 : Fix exactness check #

Patch Set 3 : Merge #

Total comments: 1

Patch Set 4 : Optimize for single class again, and fix hoisting bug #

Patch Set 5 : Blank line fix #

Patch Set 6 : Merge #

Patch Set 7 : Do not intercept for compile-time classes #

Patch Set 8 : Remove unused getter again #

Total comments: 8

Patch Set 9 : Comments #

Patch Set 10 : Merge #

Patch Set 11 : Fix indentation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+418 lines, -140 lines) Patch
M pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart View 1 4 5 6 7 1 chunk +74 lines, -11 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -8 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/share_interceptors.dart View 1 2 3 4 5 6 7 8 5 chunks +169 lines, -90 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/type_mask_system.dart View 1 2 3 chunks +25 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/type_propagation.dart View 1 2 3 4 5 6 7 8 9 2 chunks +121 lines, -28 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/backend.dart View 1 2 3 4 5 6 7 8 9 10 3 chunks +21 lines, -1 line 0 comments Download
M pkg/compiler/lib/src/js_backend/codegen/task.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/compiler/dart2js_extra/dart2js_extra.status View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 10 (1 generated)
asgerf
5 years, 2 months ago (2015-10-20 18:13:48 UTC) #2
sra1
lgtm https://chromiumcodereview.appspot.com/1409803003/diff/1/pkg/compiler/lib/src/cps_ir/share_interceptors.dart File pkg/compiler/lib/src/cps_ir/share_interceptors.dart (right): https://chromiumcodereview.appspot.com/1409803003/diff/1/pkg/compiler/lib/src/cps_ir/share_interceptors.dart#newcode85 pkg/compiler/lib/src/cps_ir/share_interceptors.dart:85: // There might exist self-intercepting subclasses of native ...
5 years, 2 months ago (2015-10-21 00:46:25 UTC) #3
sra1
No longer lgtm. This is a bug (in swarm): if (J.getInterceptor(receiver).$isBodyElement) contextElement = $.Element__parseDocument.body; --> ...
5 years, 2 months ago (2015-10-21 01:29:39 UTC) #4
asgerf
Thanks for catching, PTAL. I had misunderstood how the intercepted class set was used in ...
5 years, 2 months ago (2015-10-21 11:52:47 UTC) #5
sra1
https://chromiumcodereview.appspot.com/1409803003/diff/1/pkg/compiler/lib/src/cps_ir/share_interceptors.dart File pkg/compiler/lib/src/cps_ir/share_interceptors.dart (right): https://chromiumcodereview.appspot.com/1409803003/diff/1/pkg/compiler/lib/src/cps_ir/share_interceptors.dart#newcode85 pkg/compiler/lib/src/cps_ir/share_interceptors.dart:85: // There might exist self-intercepting subclasses of native classes. ...
5 years, 2 months ago (2015-10-21 21:46:56 UTC) #6
asgerf
Sorry for all the bugs and the messy patch history. This time I really think ...
5 years, 2 months ago (2015-10-23 15:29:24 UTC) #7
sra1
lgtm https://codereview.chromium.org/1409803003/diff/140001/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart File pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart (right): https://codereview.chromium.org/1409803003/diff/140001/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart#newcode329 pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart:329: "${node.interceptedClasses})"; use single quotes unless string contains single ...
5 years, 1 month ago (2015-10-28 02:31:53 UTC) #8
asgerf
https://codereview.chromium.org/1409803003/diff/140001/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart File pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart (right): https://codereview.chromium.org/1409803003/diff/140001/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart#newcode329 pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart:329: "${node.interceptedClasses})"; On 2015/10/28 02:31:52, sra1 wrote: > use single ...
5 years, 1 month ago (2015-10-28 10:06:31 UTC) #9
asgerf
5 years, 1 month ago (2015-10-28 11:56:26 UTC) #10
Message was sent while issue was closed.
Committed patchset #11 (id:200001) manually as
f712e08e949f39f72fe7a446995f5b7dbf6f590d (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698