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

Issue 657523002: Skip expensive hasInstance() type-checks in overloads (Closed)

Created:
6 years, 2 months ago by Jens Widell
Modified:
6 years, 1 month ago
Reviewers:
haraken, yunchao, bashi
CC:
blink-reviews, blink-reviews-bindings_chromium.org, arv+blink
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Skip expensive hasInstance() type-checks in overloads From overload resolution callbacks, pass the index of the argument that was type-checked (or -1 if no argument was strictly type-checked) to the actual overload's callback, to let it in turn skip its type-checks on that argument, if possible.

Patch Set 1 #

Total comments: 7

Patch Set 2 : minor updates #

Unified diffs Side-by-side diffs Delta from patch set Stats (+687 lines, -182 lines) Patch
M Source/bindings/scripts/v8_interface.py View 1 9 chunks +12 lines, -9 lines 0 comments Download
M Source/bindings/scripts/v8_methods.py View 1 3 chunks +17 lines, -10 lines 0 comments Download
M Source/bindings/templates/interface.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/bindings/templates/methods.cpp View 1 5 chunks +15 lines, -4 lines 0 comments Download
M Source/bindings/tests/idls/core/TestObject.idl View 1 chunk +14 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterface.cpp View 1 7 chunks +10 lines, -10 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp View 1 5 chunks +11 lines, -11 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp View 1 5 chunks +12 lines, -12 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp View 1 3 chunks +8 lines, -5 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestObject.cpp View 1 66 chunks +585 lines, -118 lines 0 comments Download
M Source/bindings/tests/results/modules/V8TestInterface5.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 20 (2 generated)
Jens Widell
This is an alternative approach to https://codereview.chromium.org/611953003/ that I wanted to explore, and see what ...
6 years, 2 months ago (2014-10-14 12:13:44 UTC) #2
haraken
https://codereview.chromium.org/657523002/diff/1/Source/bindings/scripts/v8_methods.py File Source/bindings/scripts/v8_methods.py (right): https://codereview.chromium.org/657523002/diff/1/Source/bindings/scripts/v8_methods.py#newcode211 Source/bindings/scripts/v8_methods.py:211: convert_v8_value_to_local_cpp_value_unsafe = v8_value_to_local_cpp_value( convert_v8_value_to_local_cpp_value_unsafe => convert_v8_value_to_local_cpp_value_without_type_check ? https://codereview.chromium.org/657523002/diff/1/Source/bindings/scripts/v8_methods.py#newcode212 Source/bindings/scripts/v8_methods.py:212: ...
6 years, 2 months ago (2014-10-14 13:54:07 UTC) #3
Jens Widell
https://codereview.chromium.org/657523002/diff/1/Source/bindings/templates/methods.cpp File Source/bindings/templates/methods.cpp (right): https://codereview.chromium.org/657523002/diff/1/Source/bindings/templates/methods.cpp#newcode181 Source/bindings/templates/methods.cpp:181: if (type_checked_argument_index == {{argument.index}}) On 2014/10/14 13:54:07, haraken wrote: ...
6 years, 2 months ago (2014-10-14 14:37:57 UTC) #4
haraken
On 2014/10/14 14:37:57, Jens Widell wrote: > https://codereview.chromium.org/657523002/diff/1/Source/bindings/templates/methods.cpp > File Source/bindings/templates/methods.cpp (right): > > https://codereview.chromium.org/657523002/diff/1/Source/bindings/templates/methods.cpp#newcode181 ...
6 years, 2 months ago (2014-10-14 15:18:22 UTC) #5
Jens Widell
On 2014/10/14 15:18:22, haraken wrote: > The final question is whether this optimization is worth ...
6 years, 2 months ago (2014-10-14 15:31:07 UTC) #6
haraken
+bashi-san Let's ask bashi-san about the union type support. Jens: Thanks for the numbers. The ...
6 years, 2 months ago (2014-10-14 15:33:25 UTC) #8
bashi
On 2014/10/14 15:33:25, haraken wrote: > +bashi-san > > Let's ask bashi-san about the union ...
6 years, 2 months ago (2014-10-15 00:01:59 UTC) #9
bashi
https://codereview.chromium.org/657523002/diff/1/Source/bindings/scripts/v8_interface.py File Source/bindings/scripts/v8_interface.py (right): https://codereview.chromium.org/657523002/diff/1/Source/bindings/scripts/v8_interface.py#newcode685 Source/bindings/scripts/v8_interface.py:685: [(test, method)] Could you update this comment?
6 years, 2 months ago (2014-10-15 00:02:12 UTC) #10
yunchao
On 2014/10/14 12:13:44, Jens Widell wrote: > This is an alternative approach to https://codereview.chromium.org/611953003/ > ...
6 years, 2 months ago (2014-10-15 06:24:28 UTC) #11
yunchao
On 2014/10/15 00:01:59, bashi1 wrote: > On 2014/10/14 15:33:25, haraken wrote: > > +bashi-san > ...
6 years, 2 months ago (2014-10-15 06:38:56 UTC) #12
Jens Widell
On 2014/10/15 06:24:28, yunchao wrote: > Hi, Jens, could you sumbit 2 patches as following: ...
6 years, 2 months ago (2014-10-15 06:52:40 UTC) #13
yunchao
On 2014/10/15 06:52:40, Jens Widell wrote: > On 2014/10/15 06:24:28, yunchao wrote: > > Hi, ...
6 years, 2 months ago (2014-10-15 07:25:20 UTC) #14
yunchao
On 2014/10/15 07:25:20, yunchao wrote: > On 2014/10/15 06:52:40, Jens Widell wrote: > > On ...
6 years, 2 months ago (2014-10-15 07:28:08 UTC) #15
yunchao
On 2014/10/15 07:28:08, yunchao wrote: > On 2014/10/15 07:25:20, yunchao wrote: > > On 2014/10/15 ...
6 years, 2 months ago (2014-10-15 07:31:04 UTC) #16
yunchao
On 2014/10/15 07:31:04, yunchao wrote: > On 2014/10/15 07:28:08, yunchao wrote: > > On 2014/10/15 ...
6 years, 2 months ago (2014-10-15 07:46:33 UTC) #17
Jens Widell
On 2014/10/15 07:25:20, yunchao wrote: > It doesn't matter. If you look into the impact, ...
6 years, 2 months ago (2014-10-15 07:53:08 UTC) #18
yunchao
On 2014/10/15 07:53:08, Jens Widell wrote: > On 2014/10/15 07:25:20, yunchao wrote: > > It ...
6 years, 2 months ago (2014-10-15 08:05:09 UTC) #19
Jens Widell
6 years, 1 month ago (2014-11-13 07:22:55 UTC) #20
Since https://codereview.chromium.org/703783004/ has landed, which solves the
overloading part of the hasInstance() issue for drawImage(), I'm closing this
CL. Was never very happy with it.

If we find another performance issue caused by redundant hasInstance()
type-checks in overloaded methods, we can revisit this.

Powered by Google App Engine
This is Rietveld 408576698