Ignore:
Timestamp:
Apr 14, 2014, 3:05:44 PM (11 years ago)
Author:
[email protected]
Message:

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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h

    r167199 r167272  
    224224    macro(boundFunctionName) \
    225225    macro(boundFunctionParameters) \
     226    macro(boundThisValue) \
     227    macro(boundParameter) \
     228    macro(boundParameter1) \
     229    macro(boundParameter2) \
     230    macro(boundParameter3) \
     231    macro(boundParameters) \
     232    macro(boundOversizedCallThunk) \
    226233    macro(boundFunction) \
    227234    macro(boundFunctionLength) \
Note: See TracChangeset for help on using the changeset viewer.