UNCONFIRMED41072
Remove the JSLock when JSC_MULTIPLE_THREADS is disabled
https://bugs.webkit.org/show_bug.cgi?id=41072
Summary Remove the JSLock when JSC_MULTIPLE_THREADS is disabled
Yi Shen
Reported 2010-06-23 08:14:56 PDT
For some platform like Symbian, on which the JSC_MULTIPLE_THREADS is disabled, the implementation of JSLock is empty. While the JSLock are used very often in JavaScriptcall, for example, void JSEventListener::handleEvent(...) { ... JSLock lock(SilenceAssertionsOnly); ... } We can remove this kind of useless JSLock by using macro like following, to improve the performance and battery life for the mobile device (especially for the webkit-based widget which may keep running javascript all the time). void JSEventListener::handleEvent(...) { ... #if ENABLE(JSC_MULTIPLE_THREADS) JSLock lock(SilenceAssertionsOnly); #endif ... }
Attachments
Mark Rowe (bdash)
Comment 1 2010-06-23 11:24:40 PDT
If’ing every use of JSLock would be incredibly ugly. If the implementation of JSLock when JSC_MULTIPLE_THREADS is not defined is empty and defined inline in a header any decent compiler will completely optimize this code away. That’s a much cleaner solution than touching every single place that JSlock is used.
Yi Shen
Comment 2 2010-06-23 11:40:35 PDT
Yes, I am totally agree with you Mark. But these empty JSLock functions are not defined inline in header file, right?
Mark Rowe (bdash)
Comment 3 2010-06-23 13:02:55 PDT
So instead of changing to code to inline the functions your proposal is to #if all of the callsites? Why not just inline the functions?!
Yi Shen
Comment 4 2010-06-23 14:26:05 PDT
Yes, I can change it to inline if you think it is necessary :)
Laszlo Gombos
Comment 5 2010-12-15 06:54:20 PST
Let's check the assembly generated by RVCT/GCC before we change the source.
Note You need to log in before you can comment on or make changes to this bug.