Ignore:
Timestamp:
Apr 29, 2003, 11:26:29 AM (22 years ago)
Author:
darin
Message:

Reviewed by John.

  • fixed 2959353 -- eliminate globally initialized objects from JavaScriptCore
  • JavaScriptCore.pbproj/project.pbxproj: Added fpconst.cpp.
  • kjs/fpconst.cpp: Added. Defines KJS::NaN and KJS::Inf in a way that does not require a framework init routine.
  • kjs/identifier.h: Use a new KJS_IDENTIFIER_EACH_GLOBAL macro so we can do things to the entire set of identifiers easily. Also added an init function that sets up these globals in a way that does not require a framework init routine.
  • kjs/identifier.cpp: (Identifier::init): Initialize the property ane globals in a way that does not require a framework init routine.
  • kjs/internal.cpp: (InterpreterImp::initGlobalObject): Call Identifier::init.
  • kjs/ustring.h: Remove UChar::null and UString::null, and add UString::null(). We can't have a global object of a class that has a constructor if we want to avoid framework init routines, and luckily very little code relies on these.
  • kjs/ustring.cpp: (UCharReference::ref): Use our own global specific to this function rather than returning UChar::null when past the end of the string. This is dangerous because if the caller modifies it, that affects what all subsequent callers will see. (UString::Rep::create): Added assertions. (UString::UString): Got rid of code here that used to set up UString::null. (UString::null): Added. Returns a global null string, and can be used in some of the places where we used to use the UString::null global. (UString::operator[]): Fixed case where this used to return UChar::null to return '\0' instead.
  • kjs/regexp.cpp: (RegExp::match): Change uses of UString::null to UString::null().
File:
1 edited

Legend:

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

    r4087 r4206  
    5555using namespace KJS;
    5656
     57#if !APPLE_CHANGES
     58
    5759namespace KJS {
    5860#ifdef WORDS_BIGENDIAN
     
    7072  const double Inf = *(const double*) Inf_Bytes;
    7173};
     74
     75#endif // APPLE_CHANGES
    7276
    7377static pthread_once_t interpreterLockOnce = PTHREAD_ONCE_INIT;
     
    548552void InterpreterImp::initGlobalObject()
    549553{
     554  Identifier::init();
     555 
    550556  // Contructor prototype objects (Object.prototype, Array.prototype etc)
    551557
Note: See TracChangeset for help on using the changeset viewer.