Ignore:
Timestamp:
Mar 28, 2006, 4:09:20 PM (19 years ago)
Author:
darin
Message:

Reviewed by Geoff.

  • change some code that resulted in init routines on Mac OS X -- if the framework has init routines it will use memory and slow down applications that link with WebKit even in cases where those applications don't use WebKit
  • kjs/date_object.cpp: Changed constants that were derived by multiplying other constants to use immediate numbers instead. Apparently, double constant expressions of the type we had here are evaluated at load time.
  • kjs/list.cpp: Can't use OwnArrayPtr in ListImp because of the global instances of ListImp, so go back to using a plain old pointer. (KJS::List::List): Set overflow to 0 when initializing ListImp. (KJS::List::release): Replace a clear call with a delete and explicit set to 0. (KJS::List::append): Use raw pointers, and do a delete [] instead of finessing it with a swap of OwnArrayPtr. (KJS::List::copyFrom): Remove now-unneeded get(). (KJS::List::copyTail): Ditto.
  • kjs/ustring.cpp: Changed UString::Rep::empty initializer a bit so that it doesn't get a static initializer routine. Had to get rid of one level of constant to get the compiler to understand it could initialize without any code.
  • added a build step that checks for init routines
  • JavaScriptCore.xcodeproj/project.pbxproj: Deleted now-unused custom build rule that was replaced by the generate-derived-sources script a while back. Added a custom build phase that invokes the check-for-global-initializers script.
File:
1 edited

Legend:

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

    r13365 r13541  
    137137// Hack here to avoid a global with a constructor; point to an unsigned short instead of a UChar.
    138138static unsigned short almostUChar;
    139 static UChar *const nonNullUCharPointer = reinterpret_cast<UChar *>(&almostUChar);
    140139UString::Rep UString::Rep::null = { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
    141 UString::Rep UString::Rep::empty = { 0, 0, 1, 0, 0, 0, nonNullUCharPointer, 0, 0, 0, 0 };
     140UString::Rep UString::Rep::empty = { 0, 0, 1, 0, 0, 0, reinterpret_cast<UChar*>(&almostUChar), 0, 0, 0, 0 };
    142141const int normalStatBufferSize = 4096;
    143142static char *statBuffer = 0;
Note: See TracChangeset for help on using the changeset viewer.