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

Issue 2187603004: [stubs] Using template magic to get the call interface descriptor type from callable. (Closed)

Created:
4 years, 4 months ago by Igor Sheludko
Modified:
4 years, 2 months ago
CC:
v8-reviews_googlegroups.com, oth, rmcilroy
Base URL:
https://chromium.googlesource.com/v8/v8.git@code-factory-cleanup
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[stubs] Using template magic to get the call interface descriptor type from callable. BUG=v8:5236

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+138 lines, -80 lines) Patch
M src/code-factory.h View 3 chunks +19 lines, -8 lines 0 comments Download
M src/code-factory.cc View 6 chunks +25 lines, -15 lines 0 comments Download
M src/compiler/js-generic-lowering.h View 1 chunk +4 lines, -2 lines 0 comments Download
M src/compiler/js-generic-lowering.cc View 12 chunks +35 lines, -18 lines 0 comments Download
M src/interpreter/interpreter.h View 4 chunks +8 lines, -2 lines 0 comments Download
M src/interpreter/interpreter.cc View 17 chunks +47 lines, -35 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 16 (12 generated)
Igor Sheludko
PTAL
4 years, 4 months ago (2016-07-27 12:49:39 UTC) #8
Michael Starzinger
Not a huge fan of this template magic. What is the overall goal that this ...
4 years, 4 months ago (2016-07-27 12:57:19 UTC) #11
Igor Sheludko
On 2016/07/27 12:57:19, Michael Starzinger wrote: > Not a huge fan of this template magic. ...
4 years, 4 months ago (2016-07-27 13:09:19 UTC) #14
Michael Starzinger
4 years, 4 months ago (2016-07-27 13:14:36 UTC) #15
On 2016/07/27 13:09:19, Igor Sheludko wrote:
> On 2016/07/27 12:57:19, Michael Starzinger wrote:
> > Not a huge fan of this template magic. What is the overall goal that this CL
> is
> > aiming at? Also, mvstanton@, WDYT?
> 
> The goal is to make sure that we always use the right call interface
descriptor
> type (and therefore parameter indices)
> which is defined in the stub. Whenever something is changed somewhere the C++
> compiler should show us an error.
> 
> We abstracted the code stubs by CodeFactory interface and clients do not have
> access to the right descriptor type anymore.
> So CallableD<> is a way to export this information from the CodeFactory.
> 
> I'm not sure about the names. Probably, in the end Callable should become
> CallableBase and CallableD<> - Callable<>.

IIUC then it still requires all call sites to be adapted in case the interface
is changed. So all that one gains is static checking from the C++ compiler.
Clients still need access to the actual CallInterfaceDescriptor. It is just that
the specific type of the CallInterfaceDescriptor can now be derived from the
signature of the various factory methods (instead of naming the type directly).
IMHO this is not worth the additional verbosity. Just my two cents.

Powered by Google App Engine
This is Rietveld 408576698