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

Issue 668733002: C++ overload resolution in bindings layer (Closed)

Created:
6 years, 2 months ago by Leaf
Modified:
6 years, 2 months ago
Reviewers:
vsm, terry, siva
CC:
reviews+dom_dartlang.org
Visibility:
Public.

Description

C++ overload resolution in bindings layer This CL adds generation of C++ overload resolution functions to the bindings generation scripts. The overload resolution code was pulled over from the V8 scripts and templates and modified for Dart. The resolver generation was modified so that resolver strings are not mangled with type names, and all of the resolvers for overloaded methods target the C++ overload dispatcher. BUG= R=vsm@google.com Committed: https://src.chromium.org/viewvc/blink/branches/dart/dartium?view=rev&revision=184118

Patch Set 1 #

Patch Set 2 : Resolver string changes #

Patch Set 3 : Rebase #

Patch Set 4 : Rebase fixups #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+703 lines, -232 lines) Patch
M Source/bindings/core/dart/DartExceptionState.cpp View 1 chunk +1 line, -5 lines 0 comments Download
M Source/bindings/core/dart/DartUtilities.h View 1 2 chunks +7 lines, -0 lines 0 comments Download
M Source/bindings/core/dart/DartUtilities.cpp View 1 2 chunks +27 lines, -0 lines 6 comments Download
M Source/bindings/dart/scripts/dart_attributes.py View 1 2 3 1 chunk +2 lines, -4 lines 0 comments Download
M Source/bindings/dart/scripts/dart_interface.py View 1 2 8 chunks +488 lines, -194 lines 6 comments Download
M Source/bindings/dart/scripts/dart_utilities.py View 1 2 chunks +2 lines, -11 lines 0 comments Download
M Source/bindings/dart/scripts/templates/interface_base_cpp.template View 1 2 chunks +5 lines, -1 line 0 comments Download
M Source/bindings/dart/scripts/templates/interface_cpp.template View 1 1 chunk +64 lines, -0 lines 0 comments Download
M Source/bindings/dart/scripts/templates/interface_h.template View 1 chunk +5 lines, -0 lines 0 comments Download
M Source/bindings/dart/scripts/templates/methods_cpp.template View 1 8 chunks +102 lines, -17 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
Leaf
6 years, 2 months ago (2014-10-21 17:08:13 UTC) #2
Leaf
Example dispatcher here: static void texImage2DCallbackDispatcher(Dart_NativeArguments args) { Dart_Handle exception = 0; const int argOffset ...
6 years, 2 months ago (2014-10-21 17:08:25 UTC) #3
vsm
lgtm How much does the overload logic mirror V8? Is there a possibility of reusing ...
6 years, 2 months ago (2014-10-21 19:49:19 UTC) #4
Leaf
It mirrors it pretty closely, mostly differing just in the specifics of how the instance ...
6 years, 2 months ago (2014-10-21 20:07:45 UTC) #5
Leaf
Committed patchset #4 (id:60001) manually as 184118 (presubmit successful).
6 years, 2 months ago (2014-10-21 20:41:33 UTC) #6
terry
lgtm just minor suggestions. https://codereview.chromium.org/668733002/diff/60001/Source/bindings/dart/scripts/dart_interface.py File Source/bindings/dart/scripts/dart_interface.py (right): https://codereview.chromium.org/668733002/diff/60001/Source/bindings/dart/scripts/dart_interface.py#newcode717 Source/bindings/dart/scripts/dart_interface.py:717: def compute_method_overloads_context(methods): methods => method_contexts ...
6 years, 2 months ago (2014-10-21 21:26:12 UTC) #7
siva
DBC https://codereview.chromium.org/668733002/diff/60001/Source/bindings/core/dart/DartUtilities.cpp File Source/bindings/core/dart/DartUtilities.cpp (right): https://codereview.chromium.org/668733002/diff/60001/Source/bindings/core/dart/DartUtilities.cpp#newcode987 Source/bindings/core/dart/DartUtilities.cpp:987: return Dart_GetTypeOfTypedData(object) == Dart_TypedData_kUint8Clamped; Ditto question about kExternalTypedDataUint8ClampedArrayCid ...
6 years, 2 months ago (2014-10-22 01:13:03 UTC) #9
Leaf
6 years, 2 months ago (2014-10-22 16:31:19 UTC) #10
Message was sent while issue was closed.
https://codereview.chromium.org/668733002/diff/60001/Source/bindings/core/dar...
File Source/bindings/core/dart/DartUtilities.cpp (right):

https://codereview.chromium.org/668733002/diff/60001/Source/bindings/core/dar...
Source/bindings/core/dart/DartUtilities.cpp:987: return
Dart_GetTypeOfTypedData(object) == Dart_TypedData_kUint8Clamped;
Sorry, what was the question?

On 2014/10/22 01:13:03, siva wrote:
> Ditto question about 
> 
> kExternalTypedDataUint8ClampedArrayCid
> kTypedDataUint8ClampedArrayViewCid

https://codereview.chromium.org/668733002/diff/60001/Source/bindings/core/dar...
Source/bindings/core/dart/DartUtilities.cpp:1327: Dart_Handle errorClass =
Dart_GetType(coreLib, stringToDart(className), 0, 0);
Great thanks, will change in followup.

On 2014/10/22 01:13:03, siva wrote:
> You could use domData->coreLibrary() here instead of looking up coreLib again.

https://codereview.chromium.org/668733002/diff/60001/Source/bindings/core/dar...
Source/bindings/core/dart/DartUtilities.cpp:1329: Dart_Handle error =
Dart_New(errorClass, Dart_NewStringFromCString(""), 1, &dartMessage);
On 2014/10/22 01:13:03, siva wrote:
> Dart_EmptyString() instead of creating another new string

Acknowledged.

https://codereview.chromium.org/668733002/diff/60001/Source/bindings/dart/scr...
File Source/bindings/dart/scripts/dart_interface.py (right):

https://codereview.chromium.org/668733002/diff/60001/Source/bindings/dart/scr...
Source/bindings/dart/scripts/dart_interface.py:717: def
compute_method_overloads_context(methods):
Kind of trying to minimize text changes vs v8 to make porting changes easier,
but don't mind if we want to change this.

On 2014/10/21 21:26:11, terry wrote:
> methods => method_contexts ?
> 
> We use method(s) as both context(s) and method(s) which seems confusing.  I've
> tried to change other mechanisms to context when context is used and vice
versa.
>  I can also do that after this checkin when I cleanup dart_interface w/
> v8_interface.

https://codereview.chromium.org/668733002/diff/60001/Source/bindings/dart/scr...
Source/bindings/dart/scripts/dart_interface.py:803: def
effective_overload_set(F):
I think the odd capitalization and typography in this method are intended to
follow the Web IDL overload resolution text as closely as possible: 
http://heycam.github.io/webidl/#dfn-effective-overload-set .

On 2014/10/21 21:26:12, terry wrote:
> F or f, used f for function in below methods.

Powered by Google App Engine
This is Rietveld 408576698