Ignore:
Timestamp:
Sep 24, 2008, 10:02:14 AM (17 years ago)
Author:
Darin Adler
Message:

2008-09-24 Darin Adler <Darin Adler>

Reviewed by Sam Weinig.

About 1% on v8-raytrace.

  • kjs/JSActivation.cpp: Moved copyRegisters to the header to make it inline.
  • kjs/JSActivation.h: (JSC::JSActivation::copyRegisters): Moved here. Also removed the registerArraySize argument to setRegisters, since the object doesn't need to store the number of registers.
  • kjs/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset): Removed unnecessary clearing left over from when we used this on objects that weren't brand new. These days, this function is really just part of the constructor.
  • kjs/JSGlobalObject.h: Added registerArraySize to JSGlobalObjectData, since JSVariableObjectData no longer needs it. Added a setRegisters override here that handles storing the size.
  • kjs/JSStaticScopeObject.h: Removed code to set registerArraySize, since it no longer exists.
  • kjs/JSVariableObject.cpp: Moved copyRegisterArray and setRegisters to the header to make them inline.
  • kjs/JSVariableObject.h: Removed registerArraySize from JSVariableObjectData, since it was only used for the global object. (JSC::JSVariableObject::copyRegisterArray): Moved here ot make it inline. (JSC::JSVariableObject::setRegisters): Moved here to make it inline. Also removed the code to set registerArraySize and changed an if statement into an assert to save an unnnecessary branch.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSActivation.cpp

    r36821 r36851  
    3131
    3232#include "Arguments.h"
    33 #include "CodeBlock.h"
    3433#include "Machine.h"
    35 #include "Register.h"
    3634#include "JSFunction.h"
    3735
     
    8482            r.mark();
    8583    }
    86 }
    87 
    88 void JSActivation::copyRegisters()
    89 {
    90     ASSERT(!d()->registerArray);
    91     ASSERT(!d()->registerArraySize);
    92 
    93     size_t numParametersMinusThis = d()->functionBody->generatedByteCode().numParameters - 1;
    94     size_t numVars = d()->functionBody->generatedByteCode().numVars;
    95     size_t numLocals = numVars + numParametersMinusThis;
    96 
    97     if (!numLocals)
    98         return;
    99 
    100     int registerOffset = numParametersMinusThis + RegisterFile::CallFrameHeaderSize;
    101     size_t registerArraySize = numLocals + RegisterFile::CallFrameHeaderSize;
    102 
    103     Register* registerArray = copyRegisterArray(d()->registers - registerOffset, registerArraySize);
    104     setRegisters(registerArray + registerOffset, registerArray, registerArraySize);
    10584}
    10685
Note: See TracChangeset for help on using the changeset viewer.