[Webkit-unassigned] [Bug 119277] Reduce JSC API static value setter/getter overhead

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 31 14:40:58 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=119277





--- Comment #11 from Yi Shen <max.hong.shen at gmail.com>  2013-07-31 14:40:43 PST ---
Thanks for reviewing :)

The setters call "OpaqueJSString::create()" only if there is a setProperty function defined in the callee JSClass (OpaqueJSClass::setProperty). In this case, the property name is undetermined until the setters was invoked (Actually, user can pass any value as a property name and client's code will determine whether it is valid). One solution to avoid to create OpaqueJSString every time in this case is to use a Map structure, but it will cause memory overhead.

For JSClass that doesn't have a setProperty function, the setters search the static values table by property name and call the set function only if it can find. My patch only focus on this case, and has updated setters to match the static value getters. Please check the changes for JSCallbackObject<Parent>::put() and JSCallbackObject<Parent>::putByIndex. 

(In reply to comment #10)
> (From update of attachment 207866 [details])
> This looks good, but it leaves the code in a bit of a confused state, because now getters build in a propertyNameRef, but setters still call "propertyNameRef = OpaqueJSString::create(name);", and it's not clear why. Can you update setters to match getters as well?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list