Ignore:
Timestamp:
Jun 30, 2008, 10:45:21 PM (17 years ago)
Author:
[email protected]
Message:

2008-06-30 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.


Removed the "registerBase" abstraction. Since the register file never
reallocates, we can keep direct pointers into it, instead of
<registerBase, offset> tuples.


SunSpider says 0.8% faster.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSGlobalObject.h

    r34886 r34906  
    7575        struct JSGlobalObjectData : public JSVariableObjectData {
    7676            JSGlobalObjectData(JSGlobalObject* globalObject, JSObject* thisValue)
    77                 : JSVariableObjectData(&symbolTable, 0, 0)
     77                : JSVariableObjectData(&symbolTable, 0)
    7878                , globalScopeChain(globalObject, thisValue)
    7979            {
     
    259259    inline void JSGlobalObject::addStaticGlobals(GlobalPropertyInfo* globals, int count)
    260260    {
    261         int numGlobals = d()->registerOffset;
    262         Register* registerArray = static_cast<Register*>(fastMalloc((numGlobals + count) * sizeof(Register)));
     261        size_t registerArraySize = d()->registerArraySize;
     262        Register* registerArray = static_cast<Register*>(fastMalloc((registerArraySize + count) * sizeof(Register)));
    263263        if (d()->registerArray)
    264             memcpy(registerArray + count, d()->registerArray, numGlobals * sizeof(Register));
    265         setRegisterArray(registerArray, numGlobals + count);
    266 
    267         for (int i = 0, index = -numGlobals - 1; i < count; ++i, --index) {
     264            memcpy(registerArray + count, d()->registerArray.get(), registerArraySize * sizeof(Register));
     265        setRegisterArray(registerArray, registerArraySize + count);
     266
     267        for (int i = 0, index = -registerArraySize - 1; i < count; ++i, --index) {
    268268            GlobalPropertyInfo& global = globals[i];
    269269            ASSERT(global.attributes & DontDelete);
Note: See TracChangeset for help on using the changeset viewer.