Function.bind itself is too slow
https://bugs.webkit.org/show_bug.cgi?id=131636
Reviewed by Geoffrey Garen.
Source/JavaScriptCore:
Rather than forcing creation of an activation, we now store
bound function properties directly on the returned closure.
This is necessary to deal with code that creates many function
bindings, but does not call them very often.
This is a 60% speed up in the included js/regress test.
- builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createBuiltinExecutable):
- builtins/Function.prototype.js:
(bind.bindingFunction):
(bind.else.switch.case.1.bindingFunction.bindingFunction.bindingFunction.boundOversizedCallThunk):
(bind.else.switch.case.1.bindingFunction):
(bind.else.switch.case.2.bindingFunction.bindingFunction.bindingFunction.boundOversizedCallThunk):
(bind.else.switch.case.2.bindingFunction):
(bind.else.switch.case.3.bindingFunction.bindingFunction.bindingFunction.boundOversizedCallThunk):
(bind.else.switch.case.3.bindingFunction):
(bind.else.switch.bindingFunction):
(bind):
(bind.else.switch.case.1.bindingFunction.oversizedCall): Deleted.
(bind.else.switch.case.2.bindingFunction.oversizedCall): Deleted.
(bind.else.switch.case.3.bindingFunction.oversizedCall): Deleted.
- runtime/CommonIdentifiers.h:
LayoutTests:
New test, and fix bogus log in old one
- js/regress/function-bind-create-expected.html: Added.
- js/regress/function-bind-create.html: Added.
- js/regress/script-tests/function-bind-create.js: Added.
(test):
- js/regress/script-tests/function-bind.js: