RESOLVED FIXED Bug 40435
[v8] Introduce single element caches for WebCore::String to v8::String conversions
https://bugs.webkit.org/show_bug.cgi?id=40435
Summary [v8] Introduce single element caches for WebCore::String to v8::String conver...
anton muhin
Reported 2010-06-10 11:43:51 PDT
[v8] Introduce single element caches for WebCore::String to v8::String conversions
Attachments
First version (4.81 KB, patch)
2010-06-10 11:47 PDT, anton muhin
no flags
Restore isMainThread assertion (4.48 KB, patch)
2010-06-11 11:09 PDT, anton muhin
no flags
Clean single element cache on major GCs which may invalidate handles (5.35 KB, patch)
2010-06-15 09:30 PDT, anton muhin
no flags
anton muhin
Comment 1 2010-06-10 11:47:26 PDT
Created attachment 58396 [details] First version
anton muhin
Comment 2 2010-06-10 11:48:54 PDT
Comment on attachment 58396 [details] First version I removed a check for WTF::MainThread() from getCache function. The idea is that in that case caching should be disabled and thus this function would always return an empty map. If you think this reasoning is too subtle, I'd be glad to revert this modification.
Adam Barth
Comment 3 2010-06-11 10:58:37 PDT
Comment on attachment 58396 [details] First version Cool. WebCore/bindings/v8/V8Binding.cpp:  + ASSERT(WTF::isMainThread()); I didn't quite understand the reasoning behind remove this assert. I'm not necessarily against it, I just don't understand. WebCore/bindings/v8/V8Binding.h:84 + // Note: RefPtr is a must as we cache by StringImpl* equality, not identity I don't quite understand the difference between equality and identity, but it makes sense to me why we need a RefPtr here.
anton muhin
Comment 4 2010-06-11 11:04:57 PDT
Thanks a lot, Adam. Difference between equality and identity: by identity I mean just an address of StringImpl, therefore there might be not identical, but equal string impls (if their contents is the same). If you could suggest better words, that'd be most appreciated. Regarding MainThread. I just speculative fetch the map in any thread. But I don't add anything into it if cache is not allowed (that is we're always on MainThread). Let me roll it back as it is too complicated.
anton muhin
Comment 5 2010-06-11 11:09:22 PDT
Created attachment 58488 [details] Restore isMainThread assertion
Adam Barth
Comment 6 2010-06-11 11:13:26 PDT
Comment on attachment 58488 [details] Restore isMainThread assertion > Regarding MainThread. I just speculative fetch the map in any thread. I see. I'd have to looking into it more carefully to see whether that's safe. If it doesn't have a big perf impact, it might be netter to leave the assert in so the code is easier to understand.
anton muhin
Comment 7 2010-06-11 11:15:33 PDT
(In reply to comment #6) > (From update of attachment 58488 [details]) > > Regarding MainThread. I just speculative fetch the map in any thread. > > I see. I'd have to looking into it more carefully to see whether that's safe. If it doesn't have a big perf impact, it might be netter to leave the assert in so the code is easier to understand. Agree. It shouldn't be big perf impact as it is a slow case anyway. Plus condition is perfectly predictable. Once again, thanks a lot for review, cq+'ing.
WebKit Commit Bot
Comment 8 2010-06-11 12:11:53 PDT
Comment on attachment 58488 [details] Restore isMainThread assertion Clearing flags on attachment: 58488 Committed r61031: <http://trac.webkit.org/changeset/61031>
WebKit Commit Bot
Comment 9 2010-06-11 12:12:00 PDT
All reviewed patches have been landed. Closing bug.
anton muhin
Comment 10 2010-06-15 09:30:30 PDT
Created attachment 58785 [details] Clean single element cache on major GCs which may invalidate handles
Nate Chapin
Comment 11 2010-06-15 10:09:56 PDT
Comment on attachment 58785 [details] Clean single element cache on major GCs which may invalidate handles Ok.
anton muhin
Comment 12 2010-06-15 10:17:18 PDT
As it got reverted
anton muhin
Comment 13 2010-06-16 05:43:22 PDT
Comment on attachment 58785 [details] Clean single element cache on major GCs which may invalidate handles Clearing flags on attachment: 58785 Committed r61252: <http://trac.webkit.org/changeset/61252>
anton muhin
Comment 14 2010-06-16 05:43:34 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.