DescriptionOptimize testing for an index's existence in packed Arrays
This patch introduces a new inline runtime function,
%_HasFastPackedElements(), and uses it both in the implementation
of the 'in' operator and in the array builtins to speed
up testing for the existence of an index in an array.
In testing with the microbenchmark on the attached bug,
for example, the runtime goes from 326ms to 66ms.
A reviewer might ask whether the HAS_INDEX macro is worthwhile,
and I tried the same example without it, which pushed the
microbenchmark up to 157ms. So it seems it's worth it to
avoid the function call to IN() if we know we're dealing
with arrays and numbers.
BUG=v8:3701
LOG=n
Patch Set 1 #Patch Set 2 : Made it work better #Patch Set 3 : Slightly fixed #Patch Set 4 : Added lots of full codegen #Patch Set 5 : Remove non-core architectures from patch #Patch Set 6 : Ready for review #Patch Set 7 : All fixed #
Total comments: 2
Patch Set 8 : Revert full codegen, make it an INLINE_OPTIMIZED_FUNCTION #Patch Set 9 : Add smi check and no side effects scope #Patch Set 10 : Rebased for landing #
Messages
Total messages: 14 (5 generated)
|