Changeset 13541 in webkit for trunk/JavaScriptCore/kjs
- Timestamp:
- Mar 28, 2006, 4:09:20 PM (19 years ago)
- Location:
- trunk/JavaScriptCore/kjs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/date_object.cpp
r13318 r13541 131 131 const double secondsPerMinute = 60; 132 132 const double msPerSecond = 1000; 133 const double msPerMinute = msPerSecond * secondsPerMinute; 134 const double msPerHour = msPerMinute * minutesPerHour; 135 const double msPerDay = msPerHour * hoursPerDay; 133 const double msPerMinute = 60 * 1000; 134 const double msPerHour = 60 * 60 * 1000; 135 const double msPerDay = 24 * 60 * 60 * 1000; 136 136 137 static const char * const weekdayName[7] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" }; 137 138 static const char * const monthName[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; 138 139 139 140 static double makeTime(tm *, double ms, bool utc); 140 141 static double parseDate(const UString &); -
trunk/JavaScriptCore/kjs/list.cpp
r12523 r13541 25 25 #include "internal.h" 26 26 #include <algorithm> 27 #include <kxmlcore/OwnArrayPtr.h>28 27 29 28 #define DUMP_STATISTICS 0 … … 43 42 ListImpState state; 44 43 int capacity; 45 OwnArrayPtr<JSValue*>overflow;44 JSValue** overflow; 46 45 47 46 union { … … 172 171 imp->valueRefCount = 1; 173 172 imp->capacity = 0; 173 imp->overflow = 0; 174 174 175 #if DUMP_STATISTICS 175 176 if (++numLists > numListsHighWaterMark) … … 186 187 imp->valueRefCount = !needsMarking; 187 188 imp->capacity = 0; 189 imp->overflow = 0; 188 190 189 191 #if DUMP_STATISTICS … … 211 213 #endif 212 214 213 imp->overflow.clear(); 215 delete [] imp->overflow; 216 imp->overflow = 0; 214 217 215 218 if (imp->state == usedInPool) { … … 272 275 if (i >= imp->capacity) { 273 276 int newCapacity = i * 2; 274 OwnArrayPtr<JSValue*> newOverflow(new JSValue* [newCapacity - inlineValuesSize]);275 JSValue** oldOverflow = imp->overflow .get();277 JSValue** newOverflow = new JSValue* [newCapacity - inlineValuesSize]; 278 JSValue** oldOverflow = imp->overflow; 276 279 int oldOverflowSize = i - inlineValuesSize; 277 280 for (int j = 0; j != oldOverflowSize; j++) 278 281 newOverflow[j] = oldOverflow[j]; 279 imp->overflow.swap(newOverflow); 282 delete [] oldOverflow; 283 imp->overflow = newOverflow; 280 284 imp->capacity = newCapacity; 281 285 } … … 301 305 append(imp->values[i]); 302 306 303 JSValue** overflow = imp->overflow .get();307 JSValue** overflow = imp->overflow; 304 308 int overflowSize = size - inlineSize; 305 309 for (int i = 0; i != overflowSize; ++i) … … 320 324 copy.append(imp->values[i]); 321 325 322 JSValue** overflow = imp->overflow .get();326 JSValue** overflow = imp->overflow; 323 327 int overflowSize = size - inlineSize; 324 328 for (int i = 0; i < overflowSize; ++i) -
trunk/JavaScriptCore/kjs/ustring.cpp
r13365 r13541 137 137 // Hack here to avoid a global with a constructor; point to an unsigned short instead of a UChar. 138 138 static unsigned short almostUChar; 139 static UChar *const nonNullUCharPointer = reinterpret_cast<UChar *>(&almostUChar);140 139 UString::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 };140 UString::Rep UString::Rep::empty = { 0, 0, 1, 0, 0, 0, reinterpret_cast<UChar*>(&almostUChar), 0, 0, 0, 0 }; 142 141 const int normalStatBufferSize = 4096; 143 142 static char *statBuffer = 0;
Note:
See TracChangeset
for help on using the changeset viewer.