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

Issue 11412105: - Move length getter and setter interceptors to the new interceptor scheme. (Closed)

Created:
8 years, 1 month ago by ngeoffray
Modified:
8 years, 1 month ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

- Move length getter and setter interceptors to the new interceptor scheme. - Remove obsolete HInvokeInterceptor instruction - Transform an intercepted length getter on string/array to a HFieldGet. Committed: https://code.google.com/p/dart/source/detail?r=15192

Patch Set 1 #

Total comments: 5

Patch Set 2 : #

Patch Set 3 : #

Total comments: 18
Unified diffs Side-by-side diffs Delta from patch set Stats (+187 lines, -306 lines) Patch
M sdk/lib/_internal/compiler/implementation/js_backend/backend.dart View 1 2 3 chunks +12 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/interceptors.dart View 1 2 1 chunk +0 lines, -20 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/js_array.dart View 1 2 1 chunk +9 lines, -0 lines 2 comments Download
M sdk/lib/_internal/compiler/implementation/lib/js_string.dart View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/builder.dart View 1 2 7 chunks +38 lines, -37 lines 8 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/codegen.dart View 1 2 7 chunks +23 lines, -79 lines 4 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/nodes.dart View 1 2 7 chunks +15 lines, -82 lines 4 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/optimize.dart View 1 2 7 chunks +60 lines, -56 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/tracer.dart View 1 2 1 chunk +0 lines, -3 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart View 1 2 1 chunk +8 lines, -11 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart View 1 2 1 chunk +5 lines, -5 lines 0 comments Download
M tests/compiler/dart2js/array_static_intercept_test.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tests/compiler/dart2js/builtin_interceptor_test.dart View 1 2 3 chunks +6 lines, -3 lines 0 comments Download
M tests/compiler/dart2js/mock_compiler.dart View 1 2 1 chunk +7 lines, -7 lines 0 comments Download
M tests/compiler/dart2js/value_range_test.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8 (0 generated)
ngeoffray
I filed bug http://code.google.com/p/dart/issues/detail?id=6829 to make sure we port back the old optimizations we were ...
8 years, 1 month ago (2012-11-20 15:09:09 UTC) #1
karlklose
LGTM. https://codereview.chromium.org/11412105/diff/1/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart File sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (right): https://codereview.chromium.org/11412105/diff/1/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart#newcode1324 sdk/lib/_internal/compiler/implementation/ssa/nodes.dart:1324: // We know it's a selector call if ...
8 years, 1 month ago (2012-11-20 16:40:35 UTC) #2
Johnni Winther
lgtm
8 years, 1 month ago (2012-11-21 08:20:29 UTC) #3
karlklose
https://codereview.chromium.org/11412105/diff/1/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart File sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (right): https://codereview.chromium.org/11412105/diff/1/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart#newcode1324 sdk/lib/_internal/compiler/implementation/ssa/nodes.dart:1324: // We know it's a selector call if it ...
8 years, 1 month ago (2012-11-21 08:34:55 UTC) #4
ngeoffray
Thanks Karl and Johnni. PTAL, I had to do some change to not regress on ...
8 years, 1 month ago (2012-11-21 09:43:41 UTC) #5
Johnni Winther
lgtm
8 years, 1 month ago (2012-11-21 11:22:05 UTC) #6
ahe
LGTM https://codereview.chromium.org/11412105/diff/4017/sdk/lib/_internal/compiler/implementation/lib/js_array.dart File sdk/lib/_internal/compiler/implementation/lib/js_array.dart (right): https://codereview.chromium.org/11412105/diff/4017/sdk/lib/_internal/compiler/implementation/lib/js_array.dart#newcode172 sdk/lib/_internal/compiler/implementation/lib/js_array.dart:172: int get length => JS('int', r'#.length', this); Is ...
8 years, 1 month ago (2012-11-23 06:51:22 UTC) #7
ngeoffray
8 years, 1 month ago (2012-11-23 12:01:16 UTC) #8
Message was sent while issue was closed.
Thanks Peter, comments addressed in: https://codereview.chromium.org/11411147/.

https://codereview.chromium.org/11412105/diff/4017/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/lib/js_array.dart (right):

https://codereview.chromium.org/11412105/diff/4017/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/lib/js_array.dart:172: int get length
=> JS('int', r'#.length', this);
On 2012/11/23 06:51:23, ahe wrote:
> Is the compiler smart enough to elide the return type check in checked mode?

Yes. I have just double checked.

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

https://codereview.chromium.org/11412105/diff/4017/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:2511: // interceptor
method and then the actual dynamic call on the
On 2012/11/23 06:51:23, ahe wrote:
> interceptor method -> "getInterceptor" method

Done.

https://codereview.chromium.org/11412105/diff/4017/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:2514: if
(backend.isInterceptorClass(currentElement.getEnclosingClass())
On 2012/11/23 06:51:23, ahe wrote:
> Shouldn't this be part of pushInvokeInterceptor?

Done.

https://codereview.chromium.org/11412105/diff/4017/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:2807:
pushInvokeInterceptor(interceptor, receiver);
On 2012/11/23 06:51:23, ahe wrote:
> Why don't you need to reuse this here?  Is it because an implicit this send
> would end in a different visit method?

Not sure I understand. The handling of an implicit this send is done line 2802.

https://codereview.chromium.org/11412105/diff/4017/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:3871: if (element ==
null) {
On 2012/11/23 06:51:23, ahe wrote:
> When can this happen?

In unit tests.

https://codereview.chromium.org/11412105/diff/4017/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (right):

https://codereview.chromium.org/11412105/diff/4017/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/codegen.dart:1714:
visitFieldGet(HFieldGet node) {
On 2012/11/23 06:51:23, ahe wrote:
> What is a HFieldGet? Is that when we know that we can access a field directly?

Yes.

https://codereview.chromium.org/11412105/diff/4017/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/codegen.dart:1718: push(new
js.PropertyAccess.field(pop(), 'length'), node);
On 2012/11/23 06:51:23, ahe wrote:
> Please add a comment explaining why this name shouldn't be mangled.

Done.

https://codereview.chromium.org/11412105/diff/4017/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (right):

https://codereview.chromium.org/11412105/diff/4017/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/nodes.dart:1321: accept(HVisitor
visitor);
On 2012/11/23 06:51:23, ahe wrote:
> Remove this method?  I believe it was only there to make this class implicitly
> abstract (it is already defined in HInstruction).

Done.

https://codereview.chromium.org/11412105/diff/4017/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/nodes.dart:1352: accept(HVisitor
visitor);
On 2012/11/23 06:51:23, ahe wrote:
> Remove this method?

Done.

Powered by Google App Engine
This is Rietveld 408576698