Ignore:
Timestamp:
Nov 9, 2009, 7:14:26 PM (16 years ago)
Author:
[email protected]
Message:

Added a tiny cache for Date parsing.

Reviewed by Sam "Home Wrecker" Weinig.

SunSpider says 1.2% faster.

  • runtime/DateConversion.cpp:

(JSC::parseDate): Try to reuse the last parsed Date, if present.

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::resetDateCache):

  • runtime/JSGlobalData.h: Added storage for last parsed Date. Refactored

this code to make resetting the date cache easier.

  • runtime/JSGlobalObject.h:

(JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Updated for
refactoring.

  • wtf/DateMath.cpp:

(JSC::parseDateFromNullTerminatedCharacters):

  • wtf/DateMath.h: Changed ExecState to be first parameter, as is the JSC custom.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/DateMath.cpp

    r50634 r50705  
    874874}
    875875
    876 double parseDateFromNullTerminatedCharacters(const char* dateString, ExecState* exec)
     876double parseDateFromNullTerminatedCharacters(ExecState* exec, const char* dateString)
    877877{
    878878    ASSERT(exec);
Note: See TracChangeset for help on using the changeset viewer.