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

Issue 45143003: Implement JS_INTERCEPTOR_CONSTANT (Closed)

Created:
7 years, 1 month ago by sra1
Modified:
7 years, 1 month ago
Reviewers:
ahe, ngeoffray
CC:
reviews_dartlang.org, karlklose, ngeoffray
Visibility:
Public.

Description

JS_INTERCEPTOR_CONSTANT(Type) generates a constant interceptor in Dart code. Use JS_INTERCEPTOR_CONSTANT(KeyboardEvent) in dart:html to avoid creating a lookup table. R=ahe@google.com Committed: https://code.google.com/p/dart/source/detail?r=29474

Patch Set 1 : #

Total comments: 7

Patch Set 2 : #

Total comments: 4

Patch Set 3 : #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -13 lines) Patch
sdk/lib/_internal/compiler/implementation/resolution/members.dart View 1 3 chunks +38 lines, -5 lines 0 comments Download
sdk/lib/_internal/compiler/implementation/ssa/builder.dart View 1 2 2 chunks +25 lines, -0 lines 0 comments Download
sdk/lib/_internal/compiler/implementation/warnings.dart View 1 1 chunk +4 lines, -0 lines 0 comments Download
sdk/lib/_internal/lib/foreign_helper.dart View 1 chunk +8 lines, -0 lines 0 comments Download
sdk/lib/_internal/lib/interceptors.dart View 2 chunks +2 lines, -2 lines 0 comments Download
sdk/lib/html/dart2js/html_dart2js.dart View 1 3 chunks +3 lines, -3 lines 0 comments Download
tools/dom/src/dart2js_KeyEvent.dart View 1 chunk +1 line, -1 line 0 comments Download
tools/dom/templates/html/dart2js/html_dart2js.darttemplate View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
sra1
https://codereview.chromium.org/45143003/diff/30001/sdk/lib/html/dartium/html_dartium.dart File sdk/lib/html/dartium/html_dartium.dart (left): https://codereview.chromium.org/45143003/diff/30001/sdk/lib/html/dartium/html_dartium.dart#oldcode25493 sdk/lib/html/dartium/html_dartium.dart:25493: - if ((blob_OR_source_OR_stream is MediaStream || blob_OR_source_OR_stream == null)) ...
7 years, 1 month ago (2013-10-26 00:29:49 UTC) #1
sra1
ping
7 years, 1 month ago (2013-10-29 00:30:57 UTC) #2
ahe
LGTM, but are you sure you want to remove SendPort? https://chromiumcodereview.appspot.com/45143003/diff/30001/sdk/lib/_internal/compiler/implementation/ssa/builder.dart File sdk/lib/_internal/compiler/implementation/ssa/builder.dart (right): https://chromiumcodereview.appspot.com/45143003/diff/30001/sdk/lib/_internal/compiler/implementation/ssa/builder.dart#newcode3189 ...
7 years, 1 month ago (2013-10-29 15:23:06 UTC) #3
ahe
7 years, 1 month ago (2013-10-29 15:23:23 UTC) #4
sra1
https://chromiumcodereview.appspot.com/45143003/diff/30001/sdk/lib/_internal/compiler/implementation/warnings.dart File sdk/lib/_internal/compiler/implementation/warnings.dart (right): https://chromiumcodereview.appspot.com/45143003/diff/30001/sdk/lib/_internal/compiler/implementation/warnings.dart#newcode1455 sdk/lib/_internal/compiler/implementation/warnings.dart:1455: static const MessageKind WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT = On 2013/10/29 15:23:07, ahe ...
7 years, 1 month ago (2013-10-29 18:00:46 UTC) #5
sra1
Committed patchset #4 manually as r29474 (presubmit successful).
7 years, 1 month ago (2013-10-29 18:26:57 UTC) #6
ngeoffray
I like the change, but: https://chromiumcodereview.appspot.com/45143003/diff/120001/sdk/lib/_internal/compiler/implementation/resolution/members.dart File sdk/lib/_internal/compiler/implementation/resolution/members.dart (right): https://chromiumcodereview.appspot.com/45143003/diff/120001/sdk/lib/_internal/compiler/implementation/resolution/members.dart#newcode1933 sdk/lib/_internal/compiler/implementation/resolution/members.dart:1933: Set<Node> argumentsToJsInterceptorConstant = null; ...
7 years, 1 month ago (2013-10-29 20:30:17 UTC) #7
sra1
7 years, 1 month ago (2013-10-30 17:18:17 UTC) #8
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/45143003/diff/120001/sdk/lib/_internal...
File sdk/lib/_internal/compiler/implementation/resolution/members.dart (right):

https://chromiumcodereview.appspot.com/45143003/diff/120001/sdk/lib/_internal...
sdk/lib/_internal/compiler/implementation/resolution/members.dart:1933:
Set<Node> argumentsToJsInterceptorConstant = null;
On 2013/10/29 20:30:18, ngeoffray wrote:
> This does not look very resolver related... why not doing it as a
> post-processing action on the AST?

Because it causes more classes to be instantiated, which adds their methods to
the resolver queue, so it has to be during resolution.

> 
> Also, I always feel nervous about adding state to the resolver.

Me too.

The resolver is a set of actions that happen when the arguments are ready.
What makes it hard is that some of the actions are done by control flow
(visitors) and others by ad-hoc implementations of the RETE algorithm
(http://en.wikipedia.org/wiki/Rete_algorithm).

This action needs to be deferred since the arguments can't be forced into the
'ready' state by control flow.

What bothers me about this piece of state is not that there is state or too much
state, but that there is not enough state - implicit is that all dependencies of
the argument expression need to be resolved in order to evaluate the constant. 
There is no representation of the readiness of the resolution state.

It would be tedious and probably memory-hungry to convert all steps to actions
that happen when the inputs are ready, but that might be possible efficiently if
resolution was coded in a language that directly supported both demand-driven
and data-driven computation.

https://chromiumcodereview.appspot.com/45143003/diff/120001/sdk/lib/_internal...
sdk/lib/_internal/compiler/implementation/resolution/members.dart:2637: if
(argumentsToJsInterceptorConstant == null)
On 2013/10/29 20:30:18, ngeoffray wrote:
> Please use braces.

I will sneak this into another CL.

Powered by Google App Engine
This is Rietveld 408576698