Changeset 37678 in webkit


Ignore:
Timestamp:
Oct 18, 2008 2:44:50 AM (15 years ago)
Author:
cwzwarich@webkit.org
Message:

2008-10-18 Cameron Zwarich <zwarich@apple.com>

Reviewed by Oliver Hunt.

Bug 21702: Special op_create_activation for the case where there are no named parameters
<https://bugs.webkit.org/show_bug.cgi?id=21702>

This is a 2.5% speedup on the V8 Raytrace benchmark and a 1.1% speedup
on the V8 Earley-Boyer benchmark.

  • VM/CTI.cpp: (JSC::CTI::privateCompileMainPass):
  • VM/Machine.cpp: (JSC::Machine::cti_op_create_arguments_no_params):
  • VM/Machine.h:
  • kjs/Arguments.h: (JSC::Arguments::): (JSC::Arguments::Arguments):
Location:
trunk/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r37674 r37678  
     12008-10-18  Cameron Zwarich  <zwarich@apple.com>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        Bug 21702: Special op_create_activation for the case where there are no named parameters
     6        <https://bugs.webkit.org/show_bug.cgi?id=21702>
     7
     8        This is a 2.5% speedup on the V8 Raytrace benchmark and a 1.1% speedup
     9        on the V8 Earley-Boyer benchmark.
     10
     11        * VM/CTI.cpp:
     12        (JSC::CTI::privateCompileMainPass):
     13        * VM/Machine.cpp:
     14        (JSC::Machine::cti_op_create_arguments_no_params):
     15        * VM/Machine.h:
     16        * kjs/Arguments.h:
     17        (JSC::Arguments::):
     18        (JSC::Arguments::Arguments):
     19
    1202008-10-17  Maciej Stachowiak  <mjs@apple.com>
    221
  • trunk/JavaScriptCore/VM/CTI.cpp

    r37670 r37678  
    20852085        }
    20862086        case op_create_arguments: {
    2087             emitCTICall(i, Machine::cti_op_create_arguments);
     2087            emitCTICall(i, (m_codeBlock->numParameters == 1) ? Machine::cti_op_create_arguments_no_params : Machine::cti_op_create_arguments);
    20882088            i += 1;
    20892089            break;
  • trunk/JavaScriptCore/VM/Machine.cpp

    r37674 r37678  
    47764776}
    47774777
     4778void Machine::cti_op_create_arguments_no_params(CTI_ARGS)
     4779{
     4780    Arguments* arguments = new (ARG_globalData) Arguments(ARG_callFrame, Arguments::ArgumentsNoParameters);
     4781    ARG_callFrame->setCalleeArguments(arguments);
     4782    ARG_callFrame[RegisterFile::ArgumentsRegister] = arguments;
     4783}
     4784
    47784785void Machine::cti_op_tear_off_activation(CTI_ARGS)
    47794786{
  • trunk/JavaScriptCore/VM/Machine.h

    r37670 r37678  
    187187        static JSValue* SFX_CALL cti_op_call_NotJSFunction(CTI_ARGS);
    188188        static void SFX_CALL cti_op_create_arguments(CTI_ARGS);
     189        static void SFX_CALL cti_op_create_arguments_no_params(CTI_ARGS);
    189190        static void SFX_CALL cti_op_tear_off_activation(CTI_ARGS);
    190191        static void SFX_CALL cti_op_tear_off_arguments(CTI_ARGS);
  • trunk/JavaScriptCore/kjs/Arguments.h

    r37576 r37678  
    5454    class Arguments : public JSObject {
    5555    public:
     56        enum ArgumentsParameters {
     57            ArgumentsNoParameters
     58        };
     59
    5660        Arguments(CallFrame*);
     61        Arguments(CallFrame*, enum ArgumentsParameters);
    5762        virtual ~Arguments();
    5863
     
    141146    }
    142147
     148    inline Arguments::Arguments(CallFrame* callFrame, enum ArgumentsParameters)
     149        : JSObject(callFrame->lexicalGlobalObject()->argumentsStructure())
     150        , d(new ArgumentsData)
     151    {
     152        unsigned numArguments = callFrame->argumentCount() - 1;
     153
     154        d->numParameters = 0;
     155        d->numArguments = numArguments;
     156        d->activation = 0;
     157
     158        Register* extraArguments;
     159        if (numArguments > sizeof(d->extraArgumentsFixedBuffer) / sizeof(Register))
     160            extraArguments = new Register[numArguments];
     161        else
     162            extraArguments = d->extraArgumentsFixedBuffer;
     163
     164        Register* argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numArguments - 1;
     165        for (unsigned i = 0; i < numArguments; ++i)
     166            extraArguments[i] = argv[i];
     167
     168        d->extraArguments = extraArguments;
     169
     170        d->callee = callFrame->callee();
     171        d->overrodeLength = false;
     172        d->overrodeCallee = false;
     173    }
     174
    143175    inline void Arguments::copyRegisters()
    144176    {
Note: See TracChangeset for help on using the changeset viewer.