Review Request 108946: kjs: Extend PropertySlot like JSC does, introduce new GetValueNumberFunc

Bernd Buschinski b.buschinski at
Wed Feb 13 20:19:05 GMT 2013

This is an automatically generated e-mail. To reply, visit:

Review request for kdelibs.


kjs: Extend PropertySlot like JSC does, introduce new GetValueNumberFunc to
avoid doing unneeded Identifier::from(unsigned) if we already know its an unsigned.
Before we used to do something like:
store unsigned -> Identifier::from(unsigned) ->  call -> Identifier.toArrayIndex to get the unsigned again -> use unsigned
store unsigned -> call -> use unsigned.
The pure Identifier/"String" case is unchanged.

Also (like JSC too) add function to directly store the Value, this avoids extra function call.
Now we no longer need to create a static GetValueFunc for getting a tiny value. (less code, more fun)

This overall improves the performance for kjs:

with SunSpider 1.0-svn, (less is better, 3*10 runs)
before: 2887.5ms, 2836.9ms, 2865.4ms
after: 2748.5ms, 2756.4ms, 2747.3ms

octane benchmark (more is better)
before score: 225
after score: 272

and most important not a single testcase got slower.

For typed-arrays, my extra bloated worstcase bubble sort testcase (less is better)
before: ~44sec
after: ~18sec


  khtml/ecma/kjs_arraybufferview.h PRE-CREATION 
  khtml/ecma/kjs_binding.h b967744 
  kjs/property_slot.h d59d0a6 
  kjs/string_object.h 3158d2f 
  kjs/string_object.cpp 0d10e53 




Bernd Buschinski

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the kde-core-devel mailing list