Changeset 52978 in webkit


Ignore:
Timestamp:
Jan 8, 2010 12:51:35 AM (14 years ago)
Author:
Simon Hausmann
Message:

RVCT compiler with "-Otime -O3" optimization tries to optimize out
inline new'ed pointers that are passed as arguments.
Proposed patch assigns new'ed pointer explicitly outside function call.

Patch by Norbert Leser <norbert.leser@nokia.com> on 2010-01-08
Reviewed by Darin Adler.

https://bugs.webkit.org/show_bug.cgi?id=33084

  • API/JSClassRef.cpp:

(OpaqueJSClass::OpaqueJSClass):
(OpaqueJSClassContextData::OpaqueJSClassContextData):

Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSClassRef.cpp

    r52762 r52978  
    6262        m_staticValues = new OpaqueJSClassStaticValuesTable();
    6363        while (staticValue->name) {
    64             m_staticValues->add(UString::createFromUTF8(staticValue->name).rep()->ref(),
    65                               new StaticValueEntry(staticValue->getProperty, staticValue->setProperty, staticValue->attributes));
     64            // Use a local variable here to sidestep an RVCT compiler bug.
     65            StaticValueEntry* entry = new StaticValueEntry(staticValue->getProperty, staticValue->setProperty, staticValue->attributes);
     66            m_staticValues->add(UString::createFromUTF8(staticValue->name).rep()->ref(), entry);
    6667            ++staticValue;
    6768        }
     
    7172        m_staticFunctions = new OpaqueJSClassStaticFunctionsTable();
    7273        while (staticFunction->name) {
    73             m_staticFunctions->add(UString::createFromUTF8(staticFunction->name).rep()->ref(),
    74                                  new StaticFunctionEntry(staticFunction->callAsFunction, staticFunction->attributes));
     74            // Use a local variable here to sidestep an RVCT compiler bug.
     75            StaticFunctionEntry* entry = new StaticFunctionEntry(staticFunction->callAsFunction, staticFunction->attributes);
     76            m_staticFunctions->add(UString::createFromUTF8(staticFunction->name).rep()->ref(), entry);
    7577            ++staticFunction;
    7678        }
     
    149151        for (OpaqueJSClassStaticValuesTable::const_iterator it = jsClass->m_staticValues->begin(); it != end; ++it) {
    150152            ASSERT(!it->first->isIdentifier());
    151             staticValues->add(UString::Rep::createCopying(it->first->data(), it->first->size()),
    152                               new StaticValueEntry(it->second->getProperty, it->second->setProperty, it->second->attributes));
     153            // Use a local variable here to sidestep an RVCT compiler bug.
     154            StaticValueEntry* entry = new StaticValueEntry(it->second->getProperty, it->second->setProperty, it->second->attributes);
     155            staticValues->add(UString::Rep::createCopying(it->first->data(), it->first->size()), entry);
     156
    153157        }
    154158           
     
    162166        for (OpaqueJSClassStaticFunctionsTable::const_iterator it = jsClass->m_staticFunctions->begin(); it != end; ++it) {
    163167            ASSERT(!it->first->isIdentifier());
    164             staticFunctions->add(UString::Rep::createCopying(it->first->data(), it->first->size()),
    165                               new StaticFunctionEntry(it->second->callAsFunction, it->second->attributes));
     168            // Use a local variable here to sidestep an RVCT compiler bug.
     169            StaticFunctionEntry* entry = new StaticFunctionEntry(it->second->callAsFunction, it->second->attributes);
     170            staticFunctions->add(UString::Rep::createCopying(it->first->data(), it->first->size()), entry);
    166171        }
    167172           
  • trunk/JavaScriptCore/ChangeLog

    r52977 r52978  
     12010-01-08  Norbert Leser  <norbert.leser@nokia.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        RVCT compiler with "-Otime -O3" optimization tries to optimize out
     6        inline new'ed pointers that are passed as arguments.
     7        Proposed patch assigns new'ed pointer explicitly outside function call.
     8
     9        https://bugs.webkit.org/show_bug.cgi?id=33084
     10
     11        * API/JSClassRef.cpp:
     12        (OpaqueJSClass::OpaqueJSClass):
     13        (OpaqueJSClassContextData::OpaqueJSClassContextData):
     14
    1152010-01-08  Gabor Loki  <loki@webkit.org>
    216
Note: See TracChangeset for help on using the changeset viewer.