RESOLVED FIXED 27372
[v8] switch to faster methods to obtain and set implementation
https://bugs.webkit.org/show_bug.cgi?id=27372
Summary [v8] switch to faster methods to obtain and set implementation
anton muhin
Reported 2009-07-17 08:16:47 PDT
Recently new methods to access internal fields were introduced which should be faster. Switch to them plus refactor a bit the code to pass v8::Handle<v8::Object> (instead of <v8::Value>) into the methods fetching implementation from the wrapper. Please, note, this change should not be landed before http://codereview.chromium.org/159003 is submitted.
Attachments
Initial version (23.58 KB, patch)
2009-07-17 08:20 PDT, anton muhin
abarth: review+
anton muhin
Comment 1 2009-07-17 08:20:03 PDT
Created attachment 32942 [details] Initial version
Mads Ager
Comment 2 2009-07-17 14:26:37 PDT
This looks fine to me. I have landed the change in chromium that this change depends on, so it is safe to land this change once it gets the r+.
Adam Barth
Comment 3 2009-07-17 22:55:51 PDT
Comment on attachment 32942 [details] Initial version Thanks for the patch. This looks great. One question, how do we know this is safe: + node = V8DOMWrapper::convertDOMWrapperToNode<Node>(v8::Handle<v8::Object>::Cast(args[0])); or + contextNode = V8DOMWrapper::convertDOMWrapperToNode<Node>(v8::Handle<v8::Object>::Cast(args[1])); Why can't the page pass a value as the argument?
anton muhin
Comment 4 2009-07-20 04:29:08 PDT
(In reply to comment #2) > This looks fine to me. > > I have landed the change in chromium that this change depends on, so it is safe > to land this change once it gets the r+. Thanks a lot, Mads.
anton muhin
Comment 5 2009-07-20 04:30:25 PDT
(In reply to comment #3) > (From update of attachment 32942 [details]) > Thanks for the patch. This looks great. One question, how do we know this is > safe: > > + node = > V8DOMWrapper::convertDOMWrapperToNode<Node>(v8::Handle<v8::Object>::Cast(args[0])); > > or > > + contextNode = > V8DOMWrapper::convertDOMWrapperToNode<Node>(v8::Handle<v8::Object>::Cast(args[1])); > > Why can't the page pass a value as the argument? Adam, could you double check, but we did this cast unconditionally in DOMWrapper::convertToNativeObject anyway. I just moved cast into callers, not callee not to penalize callers which already have an object
Adam Barth
Comment 6 2009-07-20 12:40:45 PDT
Comment on attachment 32942 [details] Initial version Awesome. Thanks for explain this patch to me. Yes, I see now that the callers all have branches guarding the caste (and that we've retained the assert that's keeping us honest).
Adam Barth
Comment 7 2009-07-20 18:50:13 PDT
Will land.
Adam Barth
Comment 8 2009-07-20 19:19:49 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebCore/ChangeLog M WebCore/bindings/scripts/CodeGeneratorV8.pm M WebCore/bindings/v8/V8DOMWrapper.cpp M WebCore/bindings/v8/V8DOMWrapper.h M WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp M WebCore/bindings/v8/custom/V8ClipboardCustom.cpp M WebCore/bindings/v8/custom/V8DocumentCustom.cpp M WebCore/bindings/v8/custom/V8ElementCustom.cpp M WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp M WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp M WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp M WebCore/bindings/v8/custom/V8InspectorControllerCustom.cpp M WebCore/bindings/v8/custom/V8NodeCustom.cpp M WebCore/bindings/v8/custom/V8XSLTProcessorCustom.cpp Committed r46145 M WebCore/ChangeLog M WebCore/bindings/scripts/CodeGeneratorV8.pm M WebCore/bindings/v8/V8DOMWrapper.cpp M WebCore/bindings/v8/V8DOMWrapper.h M WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp M WebCore/bindings/v8/custom/V8DocumentCustom.cpp M WebCore/bindings/v8/custom/V8NodeCustom.cpp M WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp M WebCore/bindings/v8/custom/V8InspectorControllerCustom.cpp M WebCore/bindings/v8/custom/V8ElementCustom.cpp M WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp M WebCore/bindings/v8/custom/V8ClipboardCustom.cpp M WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp M WebCore/bindings/v8/custom/V8XSLTProcessorCustom.cpp r46145 = b8d7bc3aef4a0028123fa2cd9ca298b39e32e9dd (trunk) No changes between current HEAD and refs/remotes/trunk Resetting to the latest refs/remotes/trunk http://trac.webkit.org/changeset/46145
Note You need to log in before you can comment on or make changes to this bug.