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

Issue 11365170: Start new design for interceptors and implement String.charCodeAt with it. (Closed)

Created:
8 years, 1 month ago by ngeoffray
Modified:
8 years, 1 month ago
Reviewers:
ahe, floitsch, karlklose
CC:
reviews_dartlang.org, kasperl, floitsch, Lasse Reichstein Nielsen, Johnni Winther, erikcorry
Visibility:
Public.

Description

Start new design for interceptors and implement String.charCodeAt with it. Committed: https://code.google.com/p/dart/source/detail?r=14845

Patch Set 1 : #

Total comments: 58

Patch Set 2 : #

Total comments: 8

Patch Set 3 : #

Total comments: 18

Patch Set 4 : #

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+371 lines, -57 lines) Patch
M sdk/lib/_internal/compiler/implementation/compile_time_constants.dart View 1 2 3 4 4 chunks +12 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/compiler.dart View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/enqueue.dart View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/backend.dart View 1 2 3 4 4 chunks +63 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart View 1 2 3 4 11 chunks +88 lines, -11 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart View 1 1 chunk +14 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/interceptors.dart View 1 2 3 4 2 chunks +35 lines, -11 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/resolution/members.dart View 1 3 chunks +4 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/builder.dart View 1 2 3 4 5 chunks +69 lines, -19 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/codegen.dart View 1 3 chunks +23 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/nodes.dart View 1 2 chunks +1 line, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart View 1 5 chunks +24 lines, -9 lines 0 comments Download
M tests/compiler/dart2js/dart_backend_test.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
A tests/language/interceptor_test.dart View 1 1 chunk +33 lines, -0 lines 0 comments Download
M tests/language/language.status View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
ngeoffray
8 years, 1 month ago (2012-11-09 12:46:54 UTC) #1
ahe
Could we go through this in person? I'm not sure I understand everything. https://codereview.chromium.org/11365170/diff/4001/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart File ...
8 years, 1 month ago (2012-11-09 13:45:28 UTC) #2
floitsch
First impression: I like it. Looking forward to discussing this in person.
8 years, 1 month ago (2012-11-09 20:23:02 UTC) #3
ahe
Really nice. LGTM. Lots of review comments, mostly about adding comments to the code. https://codereview.chromium.org/11365170/diff/4001/sdk/lib/_internal/compiler/implementation/enqueue.dart ...
8 years, 1 month ago (2012-11-12 13:24:11 UTC) #4
ngeoffray
Thanks Peter https://codereview.chromium.org/11365170/diff/4001/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart File sdk/lib/_internal/compiler/implementation/compile_time_constants.dart (right): https://codereview.chromium.org/11365170/diff/4001/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart#newcode354 sdk/lib/_internal/compiler/implementation/compile_time_constants.dart:354: compiler.jsStringClass); On 2012/11/09 13:45:29, ahe wrote: > ...
8 years, 1 month ago (2012-11-13 11:45:16 UTC) #5
karlklose
LGTM. https://codereview.chromium.org/11365170/diff/11001/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart File sdk/lib/_internal/compiler/implementation/js_backend/backend.dart (right): https://codereview.chromium.org/11365170/diff/11001/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart#newcode733 sdk/lib/_internal/compiler/implementation/js_backend/backend.dart:733: if (jsStringClass == null) { This is a ...
8 years, 1 month ago (2012-11-13 12:25:29 UTC) #6
ahe
LGTM https://codereview.chromium.org/11365170/diff/8002/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart File sdk/lib/_internal/compiler/implementation/compile_time_constants.dart (right): https://codereview.chromium.org/11365170/diff/8002/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart#newcode352 sdk/lib/_internal/compiler/implementation/compile_time_constants.dart:352: void enqueue(ClassElement element) { How about renaming this ...
8 years, 1 month ago (2012-11-13 12:42:41 UTC) #7
ngeoffray
8 years, 1 month ago (2012-11-13 12:51:50 UTC) #8
Thanks Karl and Peter.

https://codereview.chromium.org/11365170/diff/11001/sdk/lib/_internal/compile...
File sdk/lib/_internal/compiler/implementation/js_backend/backend.dart (right):

https://codereview.chromium.org/11365170/diff/11001/sdk/lib/_internal/compile...
sdk/lib/_internal/compiler/implementation/js_backend/backend.dart:733: if
(jsStringClass == null) {
On 2012/11/13 12:25:30, karlklose wrote:
> This is a general case, move it outside the if?

I think I will define objectInterceptorclass and getInterceptorMethod somewhere
else. Let me wait for the next CL to move those around.

https://codereview.chromium.org/11365170/diff/11001/sdk/lib/_internal/compile...
File sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (right):

https://codereview.chromium.org/11365170/diff/11001/sdk/lib/_internal/compile...
sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart:50: * A
closure is dynamically bound to the instance used when closurization.
On 2012/11/13 12:25:30, karlklose wrote:
> closurization -> closurized.

Done.

https://codereview.chromium.org/11365170/diff/11001/sdk/lib/_internal/compile...
sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart:56: * of
interceptors. Such closure is dynmically bound to the
On 2012/11/13 12:25:30, karlklose wrote:
> 'Such' -> 'Such a', or change to use 'These'.

Done.

https://codereview.chromium.org/11365170/diff/11001/sdk/lib/_internal/compile...
sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart:906: " return
receiver.$name($parameters); }");
On 2012/11/13 12:25:30, karlklose wrote:
> Use two spaces for indentation?

No, the string is just one line.

https://codereview.chromium.org/11365170/diff/8002/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
(right):

https://codereview.chromium.org/11365170/diff/8002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/compile_time_constants.dart:352: void
enqueue(ClassElement element) {
On 2012/11/13 12:42:41, ahe wrote:
> How about renaming this to registerInstantiatedClass?

Done.

https://codereview.chromium.org/11365170/diff/8002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/compile_time_constants.dart:356: void
enqueueStringClass() {
On 2012/11/13 12:42:41, ahe wrote:
> registerStringInstance()?

Done.

https://codereview.chromium.org/11365170/diff/8002/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/enqueue.dart (right):

https://codereview.chromium.org/11365170/diff/8002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/enqueue.dart:142: if
(cls.isAbstract(compiler)) {
On 2012/11/13 12:42:41, ahe wrote:
> How about turning all this into a method call on the backend?

Done.

https://codereview.chromium.org/11365170/diff/8002/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/js_backend/backend.dart (right):

https://codereview.chromium.org/11365170/diff/8002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/js_backend/backend.dart:686: final
Map<SourceString, List<Element>> interceptedElements;
On 2012/11/13 12:42:41, ahe wrote:
> What is this mapping from and to?  member names to members?

Done.

https://codereview.chromium.org/11365170/diff/8002/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (right):

https://codereview.chromium.org/11365170/diff/8002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart:57: *
interceptor instance, and the actuall receiver of the method.
On 2012/11/13 12:42:41, ahe wrote:
> actuall -> actual.

Done.

https://codereview.chromium.org/11365170/diff/8002/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/lib/interceptors.dart (right):

https://codereview.chromium.org/11365170/diff/8002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/lib/interceptors.dart:39:
getInterceptor(obj) {
On 2012/11/13 12:42:41, ahe wrote:
> obj -> object?

Done.

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

https://codereview.chromium.org/11365170/diff/8002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:49: // Check if we
have an interceptor implemented with classes.
On 2012/11/13 12:42:41, ahe wrote:
> How about:
> 
> // Check if we have an interceptor method implemented with interceptor
classes.

Done.

https://codereview.chromium.org/11365170/diff/8002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:2291: // interceptor
method and then the actuall dynamic call on the
On 2012/11/13 12:42:41, ahe wrote:
> actuall -> actual

Done.

https://codereview.chromium.org/11365170/diff/8002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:2639: //
TODO(ngeoffray): This is currently the case, but should be
On 2012/11/13 12:42:41, ahe wrote:
> What does "This" mean here?

The assertion. Comment added.

Powered by Google App Engine
This is Rietveld 408576698