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/JSGlobalObject.h

    r36821 r36851  
    5757            JSGlobalObjectData(JSGlobalObject* globalObject, JSObject* thisValue)
    5858                : JSVariableObjectData(&symbolTable, 0)
     59                , registerArraySize(0)
    5960                , globalScopeChain(globalObject, thisValue)
    6061                , regExpConstructor(0)
     
    8283            }
    8384
     85            size_t registerArraySize;
     86
    8487            JSGlobalObject* next;
    8588            JSGlobalObject* prev;
     
    270273        void reset(JSValue* prototype);
    271274
     275        void setRegisters(Register* registers, Register* registerArray, size_t count);
     276
    272277        void* operator new(size_t); // can only be allocated with JSGlobalData
    273278    };
     279
     280    inline void JSGlobalObject::setRegisters(Register* registers, Register* registerArray, size_t count)
     281    {
     282        JSVariableObject::setRegisters(registers, registerArray);
     283        d()->registerArraySize = count;
     284    }
    274285
    275286    inline void JSGlobalObject::addStaticGlobals(GlobalPropertyInfo* globals, int count)
     
    324335    }
    325336
     337
    326338} // namespace JSC
    327339
Note: See TracChangeset for help on using the changeset viewer.