Part of the larger process of de-virtualizing JSCell.
Created attachment 108761 [details] Patch
Created attachment 108766 [details] Patch
Created attachment 108770 [details] Patch
Comment on attachment 108770 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=108770&action=review > Source/JavaScriptCore/runtime/JSCell.cpp:135 > -bool JSCell::getPrimitiveNumber(ExecState*, double&, JSValue&) > +bool JSCell::getPrimitiveNumber(ExecState* exec, double& number, JSValue& value) const > { > - ASSERT_NOT_REACHED(); > - return false; > + if (isString()) > + return static_cast<const JSString*>(this)->getPrimitiveNumber(exec, number, value); > + return static_cast<const JSObject*>(this)->getPrimitiveNumber(exec, number, value); > } This turns a single virtual function call into two levels of non-virtual function call. Did you do speed testing? Does this function need to be inlined in JSString.h?
Created attachment 108866 [details] Benchmark results (without inlining)
Created attachment 108882 [details] Benchmark results (with inlining)
Overall, negligible difference between inlining and not inlining, so I think we should stick with JSCell::getPrimitiveNumber remaining in JSCell.cpp.
Committed r96143: <http://trac.webkit.org/changeset/96143>