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

Issue 3195: Use static type information from IDL to streamline the wrapping and unwrappin... (Closed)

Created:
12 years, 3 months ago by Feng Qian
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Use static type information from IDL to streamline the wrapping and unwrapping process between DOM nodes and JS objects. The basic idea is that, IDL files provide static type information. Certain types, such as subtypes of Node, only need 'NODE' has type for wrapping and unwrapping. So, intead of going through a gigatic switch statement, IDL compiler generates fast path for know types, the CL only does it for Node and subtypes. I have seen it improves DOM-peerable example by 5% when running standalone, and 35% when running with whole Dromaeo tests. I missed the another point of this CB. It removed expensive MaybeDOMWrapper checks in production code. It contributes a lot to the overhead. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=2490

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+521 lines, -380 lines) Patch
M webkit/port/DerivedSources.make View 1 chunk +1 line, -1 line 0 comments Download
M webkit/port/bindings/scripts/CodeGenerator.pm View 2 chunks +35 lines, -0 lines 2 comments Download
M webkit/port/bindings/scripts/CodeGeneratorV8.pm View 20 chunks +65 lines, -24 lines 0 comments Download
M webkit/port/bindings/scripts/IDLParser.pm View 4 chunks +27 lines, -0 lines 1 comment Download
M webkit/port/bindings/v8/v8_collection.h View 8 chunks +72 lines, -10 lines 0 comments Download
M webkit/port/bindings/v8/v8_custom.cpp View 106 chunks +173 lines, -199 lines 0 comments Download
M webkit/port/bindings/v8/v8_events.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M webkit/port/bindings/v8/v8_npobject.cpp View 2 chunks +4 lines, -4 lines 0 comments Download
M webkit/port/bindings/v8/v8_proxy.h View 7 chunks +37 lines, -36 lines 2 comments Download
M webkit/port/bindings/v8/v8_proxy.cpp View 25 chunks +105 lines, -104 lines 2 comments Download

Messages

Total messages: 4 (0 generated)
Feng Qian
12 years, 3 months ago (2008-09-22 21:33:37 UTC) #1
Mike Belshe
looks good; would be nice to see the generated code, but I think I get ...
12 years, 3 months ago (2008-09-23 00:36:13 UTC) #2
Mads Ager (chromium)
LGTM. Great simplifications. http://codereview.chromium.org/3195/diff/1/3 File webkit/port/bindings/scripts/IDLParser.pm (right): http://codereview.chromium.org/3195/diff/1/3#newcode60 Line 60: sub ParseInheritance Add a one ...
12 years, 3 months ago (2008-09-23 06:45:08 UTC) #3
Feng Qian
12 years, 3 months ago (2008-09-23 21:46:04 UTC) #4
http://codereview.chromium.org/3195/diff/1/5
File webkit/port/bindings/scripts/CodeGenerator.pm (right):

http://codereview.chromium.org/3195/diff/1/5#newcode284
Line 284: print "Scanning interface " . $interface . " in " . $directory . "\n"
if $verbose;
On 2008/09/23 00:36:13, mbelshe wrote:
> Do we want this print statement?  Or is this for debugging.

For debugging purpose, the condition variable $verbose is off by default.

http://codereview.chromium.org/3195/diff/1/9
File webkit/port/bindings/v8/v8_proxy.cpp (right):

http://codereview.chromium.org/3195/diff/1/9#newcode1916
Line 1916: NODE_WRAPPER_TYPES(MAKE_CASE)
Here I'd like to let it return NULL so the render will crash right after this
call. This shouldn't happen although.

I looked at the generated assembly, a jump table is used for the big switch
statement. So the runtime overhead isn't high.

On 2008/09/23 00:36:13, mbelshe wrote:
> I wonder if we shouldn't #ifndef NDEBUG these to avoid having a large switch
> statement here
> 
>

http://codereview.chromium.org/3195/diff/1/6
File webkit/port/bindings/v8/v8_proxy.h (right):

http://codereview.chromium.org/3195/diff/1/6#newcode444
Line 444: // use NODE as cptr_type. JS wrapper has store cptr_type and impl as
On 2008/09/23 06:45:09, Mads Ager wrote:
> JS wrapper has store -> JS wrappers store

Done.

Powered by Google App Engine
This is Rietveld 408576698