Ignore:
Timestamp:
Apr 8, 2009, 4:08:28 PM (16 years ago)
Author:
[email protected]
Message:

Improve function.apply performance

Reviewed by Geoff Garen.

Jump through a few hoops to improve performance of function.apply in the general case.

In the case of zero or one arguments, or if there are only two arguments and the
second is an array literal we treat function.apply as function.call.

Otherwise we use the new opcodes op_load_varargs and op_call_varargs to do the .apply call
without re-entering the virtual machine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecode/Opcode.h

    r42065 r42337  
    141141        macro(op_call, 5) \
    142142        macro(op_call_eval, 5) \
     143        macro(op_call_varargs, 5) \
     144        macro(op_load_varargs, 3) \
    143145        macro(op_tear_off_activation, 2) \
    144146        macro(op_tear_off_arguments, 1) \
Note: See TracChangeset for help on using the changeset viewer.