Descriptionbindings: Fixes perf regression by crrev.com/646523004.
Window has custom toV8 function, and Window inherits from EventTarget.
So, EventTarget also has custom toV8 because an EventTarget can be a
Window.
crrev.com/646523004 made Node to call EventTarget-version of
v8SetReturnValueForMainWorld because Node inherits from EventTarget,
and it calls toV8 function every time. It caused a perf regression.
This CL adds a new version of v8SetReturnValueForMainWorld for Node
and its subclasses so that they can use the fastest path.
class hierarchy:
ScriptWrappable <-- EventTarget <--+-- Node <-- ...
+-- Window
overloads:
v8SetReturnValueForMainWorld(ScriptWrappable*)
Optimized and very fast.
v8SetReturnValueForMainWorld(EventTarget*)
Uses custom toV8 function and slow.
v8SetReturnValueForMainWorld(Node*) <----------- NEW!!
Optimized and very fast.
v8SetReturnValueForMainWorld(Window*)
Uses custom toV8 function and slow.
Before this CL:
Element matches EventTarget version of
v8SetReturnValueForMainWorld, and it's very slow.
After this CL:
Element matches Node version of
v8SetReturnValueForMainWorld, and it's very fast.
BUG=428707, 235436
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=184860
Patch Set 1 #
Total comments: 2
Patch Set 2 : Synced. #Patch Set 3 : Synced. #Patch Set 4 : Totally changed the approach. Added v8SetReturnValueForMainWorld(Node*). #Patch Set 5 : Added a comment. #Messages
Total messages: 16 (6 generated)
|