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

Issue 11358217: Add a getter interceptor to the new interceptor scheme. Also cleanup the "this" that turns into a r… (Closed)

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

Description

Add a getter interceptor to the new interceptor scheme. Also cleanup the "this" that turns into a receiver hack, so that a method in an intercepted class can call another method of itself. Committed: https://code.google.com/p/dart/source/detail?r=14876

Patch Set 1 #

Total comments: 8

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+99 lines, -86 lines) Patch
M sdk/lib/_internal/compiler/implementation/js_backend/backend.dart View 1 2 chunks +9 lines, -4 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/interceptors.dart View 1 3 2 chunks +8 lines, -10 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/builder.dart View 1 2 8 chunks +70 lines, -52 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/codegen.dart View 1 5 chunks +9 lines, -6 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart View 1 3 chunks +3 lines, -14 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
ngeoffray
8 years, 1 month ago (2012-11-13 16:20:36 UTC) #1
floitsch
LGTM. https://codereview.chromium.org/11358217/diff/1/sdk/lib/_internal/compiler/implementation/ssa/builder.dart File sdk/lib/_internal/compiler/implementation/ssa/builder.dart (right): https://codereview.chromium.org/11358217/diff/1/sdk/lib/_internal/compiler/implementation/ssa/builder.dart#newcode2297 sdk/lib/_internal/compiler/implementation/ssa/builder.dart:2297: if (interceptor == backend.getInterceptorMethod && interceptor != null) ...
8 years, 1 month ago (2012-11-13 18:12:24 UTC) #2
ngeoffray
8 years, 1 month ago (2012-11-14 08:44:58 UTC) #3
Thanks Florian

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

https://codereview.chromium.org/11358217/diff/1/sdk/lib/_internal/compiler/im...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:2297: if (interceptor
== backend.getInterceptorMethod && interceptor != null) {
On 2012/11/13 18:12:24, floitsch wrote:
> remove "&& interceptor != null".

No, I want to make sure we don't have to have getInterceptor (for eg unit
tests). Long term, I think I'll just change getStaticInterceptor into
"isIntercepted".

https://codereview.chromium.org/11358217/diff/1/sdk/lib/_internal/compiler/im...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:2302: if
(backend.isInterceptorClass(currentElement.getEnclosingClass())) {
On 2012/11/13 18:12:24, floitsch wrote:
> don't you need to verify that the receiver is of the same class as 'this' ?

Yes, very good catch. I need to check that the receiver is the extra parameter.

https://codereview.chromium.org/11358217/diff/1/sdk/lib/_internal/compiler/im...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:2656:
inputs.add(thisInstruction);
On 2012/11/13 18:12:24, floitsch wrote:
> ditto:
> - don't you need to verify that the node's receiver is the same type as this.
> Also visiting the receiver might have a side-effect.

In this situation there is no receiver.

Powered by Google App Engine
This is Rietveld 408576698