Make @Array(size) a bytecode intrinsic
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Aug 2016 17:17:41 +0000 (17:17 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Aug 2016 17:17:41 +0000 (17:17 +0000)
commitcfc92800b9eac9207a5b0830f047f6ee26445ba2
treeb96a23269b9b6f599634303fe2886c56e593e64d
parent03e239bba1929d6cd64ac210e311d9104c267660
Make @Array(size) a bytecode intrinsic
https://bugs.webkit.org/show_bug.cgi?id=160867

Reviewed by Mark Lam.

There were a few places in the code where we were emitting `@Array(size)`
or `new @Array(size)`. Since we have a bytecode operation that already
represents this, called new_array_with_size, it's faster to just make a
bytecode intrinsic for the this operation. This patch does that and
the intrinsic is called `@newArrayWithSize`. This might be around a
1% speedup on ES6 sample bench, but it's within the noise. This is just
a good bytecode operation to have because it's common enough to
create arrays and it's good to make that fast in all tiers.

* builtins/ArrayConstructor.js:
(of):
(from):
* builtins/ArrayPrototype.js:
(filter):
(map):
(sort.stringSort):
(sort):
(concatSlowPath):
* bytecode/BytecodeIntrinsicRegistry.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::BytecodeIntrinsicNode::emit_intrinsic_isObject):
(JSC::BytecodeIntrinsicNode::emit_intrinsic_newArrayWithSize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204597 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/builtins/ArrayConstructor.js
Source/JavaScriptCore/builtins/ArrayPrototype.js
Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.h
Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp