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

Issue 10387170: New dispatch from dom into native code. (Closed)

Created:
8 years, 7 months ago by sra1
Modified:
8 years, 7 months ago
Reviewers:
Anton Muhin, podivilov
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Dispatch changes to be more like V8. Overloads are tested in turn, and overloads that differ only by optional arguments are grouped into one native method where possible. Committed: https://code.google.com/p/dart/source/detail?r=7974

Patch Set 1 : #

Total comments: 12

Patch Set 2 : rebase #

Patch Set 3 : validate RequireCppParameter #

Patch Set 4 : rebase #

Patch Set 5 : Avoid unimplemented types in combined overloads #

Patch Set 6 : rebase #

Total comments: 14

Patch Set 7 : rebase #

Patch Set 8 : rebase #

Patch Set 9 : rebase #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+141 lines, -99 lines) Patch
M lib/dom/scripts/systemnative.py View 1 2 3 4 5 6 3 chunks +141 lines, -99 lines 11 comments Download

Messages

Total messages: 6 (0 generated)
sra1
I have not tested this yet - I have leave early for the day. The ...
8 years, 7 months ago (2012-05-17 23:52:58 UTC) #1
Anton Muhin
[+Pavel] I like overall approach and thanks a lot for working on it. I really ...
8 years, 7 months ago (2012-05-18 11:33:40 UTC) #2
sra1
PTAL I had to work around an issue with incomplete code (see new Issue 3177) ...
8 years, 7 months ago (2012-05-23 00:30:39 UTC) #3
Anton Muhin
https://chromiumcodereview.appspot.com/10387170/diff/10002/lib/dom/scripts/systemnative.py File lib/dom/scripts/systemnative.py (right): https://chromiumcodereview.appspot.com/10387170/diff/10002/lib/dom/scripts/systemnative.py#newcode843 lib/dom/scripts/systemnative.py:843: if info.name in ['createObjectStore']: why? https://chromiumcodereview.appspot.com/10387170/diff/10002/lib/dom/scripts/systemnative.py#newcode851 lib/dom/scripts/systemnative.py:851: def CombineOverloads(self, ...
8 years, 7 months ago (2012-05-23 14:43:33 UTC) #4
sra1
https://chromiumcodereview.appspot.com/10387170/diff/10002/lib/dom/scripts/systemnative.py File lib/dom/scripts/systemnative.py (right): https://chromiumcodereview.appspot.com/10387170/diff/10002/lib/dom/scripts/systemnative.py#newcode843 lib/dom/scripts/systemnative.py:843: if info.name in ['createObjectStore']: On 2012/05/23 14:43:33, antonmuhin wrote: ...
8 years, 7 months ago (2012-05-25 01:40:05 UTC) #5
Anton Muhin
8 years, 7 months ago (2012-05-25 10:46:34 UTC) #6
https://chromiumcodereview.appspot.com/10387170/diff/13002/lib/dom/scripts/sy...
File lib/dom/scripts/systemnative.py (right):

https://chromiumcodereview.appspot.com/10387170/diff/13002/lib/dom/scripts/sy...
lib/dom/scripts/systemnative.py:884: if len(seed.arguments) > 0 and
seed.arguments[-1].is_optional:
when this condition fires?

https://chromiumcodereview.appspot.com/10387170/diff/13002/lib/dom/scripts/sy...
lib/dom/scripts/systemnative.py:897: if probe.arguments[:-1] != prev.arguments:
that should cover the condition above, no?  as we cannot have two no args
methods following?

https://chromiumcodereview.appspot.com/10387170/diff/13002/lib/dom/scripts/sy...
lib/dom/scripts/systemnative.py:901: # See Issue 3177.  This test against known
implemented types is to
Stephen, I don't think we need this code, we should support nulls in
conversions.

https://chromiumcodereview.appspot.com/10387170/diff/13002/lib/dom/scripts/sy...
lib/dom/scripts/systemnative.py:965: if len(matches) != len(rematches):
okay, but here 

if not all(IsRequiredCppParameter, op.arguments[-len(matches)]):

looks more idiomatic, no?

https://chromiumcodereview.appspot.com/10387170/diff/13002/lib/dom/scripts/sy...
lib/dom/scripts/systemnative.py:1006: if dart_type == param.dart_type:
won't it be more straightforward to check param.default_value is None?  maybe
adding a corresponding helper method to ParamInfo?

https://chromiumcodereview.appspot.com/10387170/diff/13002/lib/dom/scripts/sy...
lib/dom/scripts/systemnative.py:1014: test = TypeCheck(param.name, dart_type)
we have single call site for TypeCheck/NullCheck, shouldn't they get inlined?

https://chromiumcodereview.appspot.com/10387170/diff/13002/lib/dom/scripts/sy...
lib/dom/scripts/systemnative.py:1016: test = '(%s || %s)' %
(NullCheck(param.name), test)
any chances it might be incorrect in the following weird declaration:

foo([Optional] X x, [Optional] Y y);
foo([Optional] X x, [Optional] Z z);

here for x you'll have None as test, correct?

https://chromiumcodereview.appspot.com/10387170/diff/13002/lib/dom/scripts/sy...
lib/dom/scripts/systemnative.py:1019: if test:
why this check, cannot you populate tests just in place?

https://chromiumcodereview.appspot.com/10387170/diff/13002/lib/dom/scripts/sy...
lib/dom/scripts/systemnative.py:1021: if tests:
Please, add a blank line

https://chromiumcodereview.appspot.com/10387170/diff/13002/lib/dom/scripts/sy...
lib/dom/scripts/systemnative.py:1023: if len(cond) + len(indent) + 7 > 80:
I wouldn't complicate this logic to keep 80 constraint in generated files.

https://chromiumcodereview.appspot.com/10387170/diff/13002/lib/dom/scripts/sy...
lib/dom/scripts/systemnative.py:1034: fallthrough = False
you probably want to return from here, correct, maybe throw exception if there
are overloads to resolve?  overall, do we need fallthrough local?

Powered by Google App Engine
This is Rietveld 408576698