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

Issue 6538045: Callback: Replumb the type-inference. (Closed)

Created:
9 years, 10 months ago by awong
Modified:
9 years, 7 months ago
CC:
chromium-reviews, brettw-cc_chromium.org, akalin, darin (slow to review), brettw, Paweł Hajdan Jr.
Visibility:
Public.

Description

Callbacks: Replumb the type-inference. In preparation for attempting to support __stdcall, __fastcall, etc., break apart the templates so that instead of having one set of InvokerNs per type of function pointer, only have one per syntactic method of invocation. This lets the number of template specializations scale better. Previously, for each type of function pointer, we needed sum(1...arity) InvokerN specializations. There were 3 types (function, method, const method). The Windows calling conventions would have added another 2. in this method, we have 2 sets of InvokerN templates, and 1 set of FunctionTraits templates for each type. We only need (arity) number of FunctionTraits templates, so this is a net win. For our 6-arity system, it should go from 5 types * (1+2+3+4+5+6) InvokerNs = 105 specializations to 5 types * 6 FunctionTraits + 2 calling_syntaxes * (1+2+3+4+5+6) InvokerNs = 72 specializations This puts a bit more work on the compiler, but...hey, better it than the reader of the code. BUG=35223 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=75482

Patch Set 1 #

Patch Set 2 : rebased #

Total comments: 12

Patch Set 3 : hihi #

Patch Set 4 : rebased for realz #

Patch Set 5 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+407 lines, -644 lines) Patch
M base/bind_internal.h View 1 2 3 79 chunks +298 lines, -581 lines 0 comments Download
M base/bind_internal.h.pump View 1 2 3 8 chunks +96 lines, -52 lines 0 comments Download
M base/callback.h View 1 2 3 8 chunks +8 lines, -7 lines 0 comments Download
M base/callback.h.pump View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M base/callback_unittest.cc View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
awong
and....back to will...
9 years, 10 months ago (2011-02-18 03:27:28 UTC) #1
willchan no longer on Chromium
LGTM http://codereview.chromium.org/6538045/diff/2001/base/bind_internal.h File base/bind_internal.h (right): http://codereview.chromium.org/6538045/diff/2001/base/bind_internal.h#newcode24 base/bind_internal.h:24: // 1) The type of function (normal, or ...
9 years, 10 months ago (2011-02-18 06:39:48 UTC) #2
awong
9 years, 10 months ago (2011-02-18 22:46:54 UTC) #3
http://codereview.chromium.org/6538045/diff/2001/base/bind_internal.h
File base/bind_internal.h (right):

http://codereview.chromium.org/6538045/diff/2001/base/bind_internal.h#newcode24
base/bind_internal.h:24: //   1) The type of function (normal, or method).
On 2011/02/18 06:39:49, willchan wrote:
> no comma

Blah.

http://en.wikipedia.org/wiki/Serial_comma

But removed anyways.

http://codereview.chromium.org/6538045/diff/2001/base/bind_internal.h#newcode39
base/bind_internal.h:39: 
On 2011/02/18 06:39:49, willchan wrote:
> Unnecessary extra newline.

Done.

http://codereview.chromium.org/6538045/diff/2001/base/bind_internal.h#newcode47
base/bind_internal.h:47: // other is invoked (*obj_->methd_ptr(arg1)).
On 2011/02/18 06:39:49, willchan wrote:
> methd_ptr=>method_ptr

Done.

http://codereview.chromium.org/6538045/diff/2001/base/bind_internal.h#newcode55
base/bind_internal.h:55: // Having a NoramlizedSignature signature, reduces the
combinatoric
On 2011/02/18 06:39:49, willchan wrote:
> NormalizedSignature

Done.

http://codereview.chromium.org/6538045/diff/2001/base/bind_internal.h#newcode57
base/bind_internal.h:57: // only 2 syntactic variantions on invoking a function,
without
On 2011/02/18 06:39:49, willchan wrote:
> variations

Done.

http://codereview.chromium.org/6538045/diff/2001/base/bind_internal.h#newcode58
base/bind_internal.h:58: // normalizing the signature, there would need to be on
specialization of
On 2011/02/18 06:39:49, willchan wrote:
> on=>one

Done.

Powered by Google App Engine
This is Rietveld 408576698