Changeset 50708 in webkit for trunk/JavaScriptCore


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

Some manual inlining and constant propogation in Date code.

Reviewed by Sam Weinig.

SunSpider reports a 0.4% speedup on date-*, no overall speedup. Shark
says some previously evident stalls are now gone.

  • runtime/DateConstructor.cpp:

(JSC::callDate):

  • runtime/DateConversion.cpp:

(JSC::formatTime):
(JSC::formatTimeUTC): Split formatTime into UTC and non-UTC variants.

  • runtime/DateConversion.h:
  • runtime/DateInstance.cpp:

(JSC::DateInstance::calculateGregorianDateTime):
(JSC::DateInstance::calculateGregorianDateTimeUTC):

  • runtime/DateInstance.h:

(JSC::DateInstance::gregorianDateTime):
(JSC::DateInstance::gregorianDateTimeUTC): Split gregorianDateTime into
a UTC and non-UTC variant, and split each variant into a fast inline
case and a slow out-of-line case.

  • runtime/DatePrototype.cpp:

(JSC::formatLocaleDate):
(JSC::dateProtoFuncToString):
(JSC::dateProtoFuncToUTCString):
(JSC::dateProtoFuncToISOString):
(JSC::dateProtoFuncToDateString):
(JSC::dateProtoFuncToTimeString):
(JSC::dateProtoFuncGetFullYear):
(JSC::dateProtoFuncGetUTCFullYear):
(JSC::dateProtoFuncToGMTString):
(JSC::dateProtoFuncGetMonth):
(JSC::dateProtoFuncGetUTCMonth):
(JSC::dateProtoFuncGetDate):
(JSC::dateProtoFuncGetUTCDate):
(JSC::dateProtoFuncGetDay):
(JSC::dateProtoFuncGetUTCDay):
(JSC::dateProtoFuncGetHours):
(JSC::dateProtoFuncGetUTCHours):
(JSC::dateProtoFuncGetMinutes):
(JSC::dateProtoFuncGetUTCMinutes):
(JSC::dateProtoFuncGetSeconds):
(JSC::dateProtoFuncGetUTCSeconds):
(JSC::dateProtoFuncGetTimezoneOffset):
(JSC::setNewValueFromTimeArgs):
(JSC::setNewValueFromDateArgs):
(JSC::dateProtoFuncSetYear):
(JSC::dateProtoFuncGetYear): Updated for the gregorianDateTime change above.

Location:
trunk/JavaScriptCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r50706 r50708  
     12009-11-09  Geoffrey Garen  <[email protected]>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Some manual inlining and constant propogation in Date code.
     6       
     7        SunSpider reports a 0.4% speedup on date-*, no overall speedup. Shark
     8        says some previously evident stalls are now gone.
     9
     10        * runtime/DateConstructor.cpp:
     11        (JSC::callDate):
     12        * runtime/DateConversion.cpp:
     13        (JSC::formatTime):
     14        (JSC::formatTimeUTC): Split formatTime into UTC and non-UTC variants.
     15
     16        * runtime/DateConversion.h:
     17        * runtime/DateInstance.cpp:
     18        (JSC::DateInstance::calculateGregorianDateTime):
     19        (JSC::DateInstance::calculateGregorianDateTimeUTC):
     20        * runtime/DateInstance.h:
     21        (JSC::DateInstance::gregorianDateTime):
     22        (JSC::DateInstance::gregorianDateTimeUTC): Split gregorianDateTime into
     23        a UTC and non-UTC variant, and split each variant into a fast inline
     24        case and a slow out-of-line case.
     25
     26        * runtime/DatePrototype.cpp:
     27        (JSC::formatLocaleDate):
     28        (JSC::dateProtoFuncToString):
     29        (JSC::dateProtoFuncToUTCString):
     30        (JSC::dateProtoFuncToISOString):
     31        (JSC::dateProtoFuncToDateString):
     32        (JSC::dateProtoFuncToTimeString):
     33        (JSC::dateProtoFuncGetFullYear):
     34        (JSC::dateProtoFuncGetUTCFullYear):
     35        (JSC::dateProtoFuncToGMTString):
     36        (JSC::dateProtoFuncGetMonth):
     37        (JSC::dateProtoFuncGetUTCMonth):
     38        (JSC::dateProtoFuncGetDate):
     39        (JSC::dateProtoFuncGetUTCDate):
     40        (JSC::dateProtoFuncGetDay):
     41        (JSC::dateProtoFuncGetUTCDay):
     42        (JSC::dateProtoFuncGetHours):
     43        (JSC::dateProtoFuncGetUTCHours):
     44        (JSC::dateProtoFuncGetMinutes):
     45        (JSC::dateProtoFuncGetUTCMinutes):
     46        (JSC::dateProtoFuncGetSeconds):
     47        (JSC::dateProtoFuncGetUTCSeconds):
     48        (JSC::dateProtoFuncGetTimezoneOffset):
     49        (JSC::setNewValueFromTimeArgs):
     50        (JSC::setNewValueFromDateArgs):
     51        (JSC::dateProtoFuncSetYear):
     52        (JSC::dateProtoFuncGetYear): Updated for the gregorianDateTime change above.
     53
    1542009-11-09  Geoffrey Garen  <[email protected]>
    255
  • trunk/JavaScriptCore/runtime/DateConstructor.cpp

    r50608 r50708  
    134134    getLocalTime(&localTime, &localTM);
    135135    GregorianDateTime ts(exec, localTM);
    136     return jsNontrivialString(exec, formatDate(ts) + " " + formatTime(ts, false));
     136    return jsNontrivialString(exec, formatDate(ts) + " " + formatTime(ts));
    137137}
    138138
  • trunk/JavaScriptCore/runtime/DateConversion.cpp

    r50705 r50708  
    8181}
    8282
    83 UString formatTime(const GregorianDateTime &t, bool utc)
     83UString formatTime(const GregorianDateTime &t)
    8484{
    8585    char buffer[100];
    86     if (utc) {
    87         snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT", t.hour, t.minute, t.second);
     86    int offset = abs(gmtoffset(t));
     87    char timeZoneName[70];
     88    struct tm gtm = t;
     89    strftime(timeZoneName, sizeof(timeZoneName), "%Z", &gtm);
     90
     91    if (timeZoneName[0]) {
     92        snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT%c%02d%02d (%s)",
     93            t.hour, t.minute, t.second,
     94            gmtoffset(t) < 0 ? '-' : '+', offset / (60*60), (offset / 60) % 60, timeZoneName);
    8895    } else {
    89         int offset = abs(gmtoffset(t));
    90         char timeZoneName[70];
    91         struct tm gtm = t;
    92         strftime(timeZoneName, sizeof(timeZoneName), "%Z", &gtm);
    93 
    94         if (timeZoneName[0]) {
    95             snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT%c%02d%02d (%s)",
    96                 t.hour, t.minute, t.second,
    97                 gmtoffset(t) < 0 ? '-' : '+', offset / (60*60), (offset / 60) % 60, timeZoneName);
    98         } else {
    99             snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT%c%02d%02d",
    100                 t.hour, t.minute, t.second,
    101                 gmtoffset(t) < 0 ? '-' : '+', offset / (60*60), (offset / 60) % 60);
    102         }
     96        snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT%c%02d%02d",
     97            t.hour, t.minute, t.second,
     98            gmtoffset(t) < 0 ? '-' : '+', offset / (60*60), (offset / 60) % 60);
    10399    }
    104100    return UString(buffer);
    105101}
    106102
     103UString formatTimeUTC(const GregorianDateTime &t)
     104{
     105    char buffer[100];
     106    snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT", t.hour, t.minute, t.second);
     107    return UString(buffer);
     108}
     109
    107110} // namespace JSC
  • trunk/JavaScriptCore/runtime/DateConversion.h

    r50608 r50708  
    5252UString formatDate(const GregorianDateTime&);
    5353UString formatDateUTCVariant(const GregorianDateTime&);
    54 UString formatTime(const GregorianDateTime&, bool inputIsUTC);
     54UString formatTime(const GregorianDateTime&);
     55UString formatTimeUTC(const GregorianDateTime&);
    5556
    5657} // namespace JSC
  • trunk/JavaScriptCore/runtime/DateInstance.cpp

    r50608 r50708  
    4747}
    4848
    49 const GregorianDateTime* DateInstance::gregorianDateTime(ExecState* exec, bool outputIsUTC) const
     49const GregorianDateTime* DateInstance::calculateGregorianDateTime(ExecState* exec) const
    5050{
    5151    double milli = internalNumber();
     
    5656        m_data = exec->globalData().dateInstanceCache.add(milli);
    5757
    58     if (outputIsUTC) {
    59         if (m_data->m_gregorianDateTimeUTCCachedForMS != milli) {
    60             msToGregorianDateTime(exec, internalNumber(), true, m_data->m_cachedGregorianDateTimeUTC);
    61             m_data->m_gregorianDateTimeUTCCachedForMS = milli;
    62         }
    63         return &m_data->m_cachedGregorianDateTimeUTC;
    64     }
    65 
    6658    if (m_data->m_gregorianDateTimeCachedForMS != milli) {
    67         msToGregorianDateTime(exec, internalNumber(), false, m_data->m_cachedGregorianDateTime);
     59        msToGregorianDateTime(exec, milli, false, m_data->m_cachedGregorianDateTime);
    6860        m_data->m_gregorianDateTimeCachedForMS = milli;
    6961    }
     
    7163}
    7264
     65const GregorianDateTime* DateInstance::calculateGregorianDateTimeUTC(ExecState* exec) const
     66{
     67    double milli = internalNumber();
     68    if (isnan(milli))
     69        return 0;
     70
     71    if (!m_data)
     72        m_data = exec->globalData().dateInstanceCache.add(milli);
     73
     74    if (m_data->m_gregorianDateTimeUTCCachedForMS != milli) {
     75        msToGregorianDateTime(exec, milli, true, m_data->m_cachedGregorianDateTimeUTC);
     76        m_data->m_gregorianDateTimeUTCCachedForMS = milli;
     77    }
     78    return &m_data->m_cachedGregorianDateTimeUTC;
     79}
     80
    7381} // namespace JSC
  • trunk/JavaScriptCore/runtime/DateInstance.h

    r50608 r50708  
    3939        static JS_EXPORTDATA const ClassInfo info;
    4040
    41         const GregorianDateTime* gregorianDateTime(ExecState*, bool outputIsUTC) const;
     41        const GregorianDateTime* gregorianDateTime(ExecState* exec) const
     42        {
     43            if (m_data && m_data->m_gregorianDateTimeCachedForMS == internalNumber())
     44                return &m_data->m_cachedGregorianDateTime;
     45            return calculateGregorianDateTime(exec);
     46        }
     47       
     48        const GregorianDateTime* gregorianDateTimeUTC(ExecState* exec) const
     49        {
     50            if (m_data && m_data->m_gregorianDateTimeUTCCachedForMS == internalNumber())
     51                return &m_data->m_cachedGregorianDateTimeUTC;
     52            return calculateGregorianDateTimeUTC(exec);
     53        }
    4254
    4355        static PassRefPtr<Structure> createStructure(JSValue prototype)
     
    5062
    5163    private:
     64        const GregorianDateTime* calculateGregorianDateTime(ExecState*) const;
     65        const GregorianDateTime* calculateGregorianDateTimeUTC(ExecState*) const;
    5266        virtual const ClassInfo* classInfo() const { return &info; }
    5367
  • trunk/JavaScriptCore/runtime/DatePrototype.cpp

    r50608 r50708  
    254254static JSCell* formatLocaleDate(ExecState* exec, DateInstance* dateObject, double, LocaleDateTimeFormat format, const ArgList&)
    255255{
    256     const bool outputIsUTC = false;
    257     const GregorianDateTime* gregorianDateTime = dateObject->gregorianDateTime(exec, outputIsUTC);
     256    const GregorianDateTime* gregorianDateTime = dateObject->gregorianDateTime(exec);
    258257    if (!gregorianDateTime)
    259258        return jsNontrivialString(exec, "Invalid Date");
     
    421420        return throwError(exec, TypeError);
    422421
    423     const bool outputIsUTC = false;
    424 
    425     DateInstance* thisDateObj = asDateInstance(thisValue);
    426 
    427     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     422    DateInstance* thisDateObj = asDateInstance(thisValue);
     423
     424    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
    428425    if (!gregorianDateTime)
    429426        return jsNontrivialString(exec, "Invalid Date");
    430     return jsNontrivialString(exec, formatDate(*gregorianDateTime) + " " + formatTime(*gregorianDateTime, outputIsUTC));
     427    return jsNontrivialString(exec, formatDate(*gregorianDateTime) + " " + formatTime(*gregorianDateTime));
    431428}
    432429
     
    436433        return throwError(exec, TypeError);
    437434
    438     const bool outputIsUTC = true;
    439 
    440     DateInstance* thisDateObj = asDateInstance(thisValue);
    441 
    442     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     435    DateInstance* thisDateObj = asDateInstance(thisValue);
     436
     437    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
    443438    if (!gregorianDateTime)
    444439        return jsNontrivialString(exec, "Invalid Date");
    445     return jsNontrivialString(exec, formatDateUTCVariant(*gregorianDateTime) + " " + formatTime(*gregorianDateTime, outputIsUTC));
     440    return jsNontrivialString(exec, formatDateUTCVariant(*gregorianDateTime) + " " + formatTimeUTC(*gregorianDateTime));
    446441}
    447442
     
    451446        return throwError(exec, TypeError);
    452447   
    453     const bool outputIsUTC = true;
    454    
    455     DateInstance* thisDateObj = asDateInstance(thisValue);
    456    
    457     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     448    DateInstance* thisDateObj = asDateInstance(thisValue);
     449   
     450    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
    458451    if (!gregorianDateTime)
    459452        return jsNontrivialString(exec, "Invalid Date");
     
    471464        return throwError(exec, TypeError);
    472465
    473     const bool outputIsUTC = false;
    474 
    475     DateInstance* thisDateObj = asDateInstance(thisValue);
    476 
    477     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     466    DateInstance* thisDateObj = asDateInstance(thisValue);
     467
     468    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
    478469    if (!gregorianDateTime)
    479470        return jsNontrivialString(exec, "Invalid Date");
     
    486477        return throwError(exec, TypeError);
    487478
    488     const bool outputIsUTC = false;
    489 
    490     DateInstance* thisDateObj = asDateInstance(thisValue);
    491 
    492     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     479    DateInstance* thisDateObj = asDateInstance(thisValue);
     480
     481    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
    493482    if (!gregorianDateTime)
    494483        return jsNontrivialString(exec, "Invalid Date");
    495     return jsNontrivialString(exec, formatTime(*gregorianDateTime, outputIsUTC));
     484    return jsNontrivialString(exec, formatTime(*gregorianDateTime));
    496485}
    497486
     
    536525        return throwError(exec, TypeError);
    537526
    538     const bool outputIsUTC = false;
    539 
    540     DateInstance* thisDateObj = asDateInstance(thisValue);
    541 
    542     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     527    DateInstance* thisDateObj = asDateInstance(thisValue);
     528
     529    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
    543530    if (!gregorianDateTime)
    544531        return jsNaN(exec);
     
    551538        return throwError(exec, TypeError);
    552539
    553     const bool outputIsUTC = true;
    554 
    555     DateInstance* thisDateObj = asDateInstance(thisValue);
    556 
    557     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     540    DateInstance* thisDateObj = asDateInstance(thisValue);
     541
     542    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
    558543    if (!gregorianDateTime)
    559544        return jsNaN(exec);
     
    566551        return throwError(exec, TypeError);
    567552
    568     const bool outputIsUTC = true;
    569 
    570     DateInstance* thisDateObj = asDateInstance(thisValue);
    571 
    572     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     553    DateInstance* thisDateObj = asDateInstance(thisValue);
     554
     555    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
    573556    if (!gregorianDateTime)
    574557        return jsNontrivialString(exec, "Invalid Date");
    575     return jsNontrivialString(exec, formatDateUTCVariant(*gregorianDateTime) + " " + formatTime(*gregorianDateTime, outputIsUTC));
     558    return jsNontrivialString(exec, formatDateUTCVariant(*gregorianDateTime) + " " + formatTimeUTC(*gregorianDateTime));
    576559}
    577560
     
    581564        return throwError(exec, TypeError);
    582565
    583     const bool outputIsUTC = false;
    584 
    585     DateInstance* thisDateObj = asDateInstance(thisValue);
    586 
    587     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     566    DateInstance* thisDateObj = asDateInstance(thisValue);
     567
     568    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
    588569    if (!gregorianDateTime)
    589570        return jsNaN(exec);
     
    596577        return throwError(exec, TypeError);
    597578
    598     const bool outputIsUTC = true;
    599 
    600     DateInstance* thisDateObj = asDateInstance(thisValue);
    601 
    602     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     579    DateInstance* thisDateObj = asDateInstance(thisValue);
     580
     581    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
    603582    if (!gregorianDateTime)
    604583        return jsNaN(exec);
     
    611590        return throwError(exec, TypeError);
    612591
    613     const bool outputIsUTC = false;
    614 
    615     DateInstance* thisDateObj = asDateInstance(thisValue);
    616 
    617     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     592    DateInstance* thisDateObj = asDateInstance(thisValue);
     593
     594    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
    618595    if (!gregorianDateTime)
    619596        return jsNaN(exec);
     
    626603        return throwError(exec, TypeError);
    627604
    628     const bool outputIsUTC = true;
    629 
    630     DateInstance* thisDateObj = asDateInstance(thisValue);
    631 
    632     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     605    DateInstance* thisDateObj = asDateInstance(thisValue);
     606
     607    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
    633608    if (!gregorianDateTime)
    634609        return jsNaN(exec);
     
    641616        return throwError(exec, TypeError);
    642617
    643     const bool outputIsUTC = false;
    644 
    645     DateInstance* thisDateObj = asDateInstance(thisValue);
    646 
    647     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     618    DateInstance* thisDateObj = asDateInstance(thisValue);
     619
     620    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
    648621    if (!gregorianDateTime)
    649622        return jsNaN(exec);
     
    656629        return throwError(exec, TypeError);
    657630
    658     const bool outputIsUTC = true;
    659 
    660     DateInstance* thisDateObj = asDateInstance(thisValue);
    661 
    662     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     631    DateInstance* thisDateObj = asDateInstance(thisValue);
     632
     633    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
    663634    if (!gregorianDateTime)
    664635        return jsNaN(exec);
     
    671642        return throwError(exec, TypeError);
    672643
    673     const bool outputIsUTC = false;
    674 
    675     DateInstance* thisDateObj = asDateInstance(thisValue);
    676 
    677     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     644    DateInstance* thisDateObj = asDateInstance(thisValue);
     645
     646    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
    678647    if (!gregorianDateTime)
    679648        return jsNaN(exec);
     
    686655        return throwError(exec, TypeError);
    687656
    688     const bool outputIsUTC = true;
    689 
    690     DateInstance* thisDateObj = asDateInstance(thisValue);
    691 
    692     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     657    DateInstance* thisDateObj = asDateInstance(thisValue);
     658
     659    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
    693660    if (!gregorianDateTime)
    694661        return jsNaN(exec);
     
    701668        return throwError(exec, TypeError);
    702669
    703     const bool outputIsUTC = false;
    704 
    705     DateInstance* thisDateObj = asDateInstance(thisValue);
    706 
    707     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     670    DateInstance* thisDateObj = asDateInstance(thisValue);
     671
     672    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
    708673    if (!gregorianDateTime)
    709674        return jsNaN(exec);
     
    716681        return throwError(exec, TypeError);
    717682
    718     const bool outputIsUTC = true;
    719 
    720     DateInstance* thisDateObj = asDateInstance(thisValue);
    721 
    722     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     683    DateInstance* thisDateObj = asDateInstance(thisValue);
     684
     685    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
    723686    if (!gregorianDateTime)
    724687        return jsNaN(exec);
     
    731694        return throwError(exec, TypeError);
    732695
    733     const bool outputIsUTC = false;
    734 
    735     DateInstance* thisDateObj = asDateInstance(thisValue);
    736 
    737     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     696    DateInstance* thisDateObj = asDateInstance(thisValue);
     697
     698    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
    738699    if (!gregorianDateTime)
    739700        return jsNaN(exec);
     
    746707        return throwError(exec, TypeError);
    747708
    748     const bool outputIsUTC = true;
    749 
    750     DateInstance* thisDateObj = asDateInstance(thisValue);
    751 
    752     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     709    DateInstance* thisDateObj = asDateInstance(thisValue);
     710
     711    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
    753712    if (!gregorianDateTime)
    754713        return jsNaN(exec);
     
    791750        return throwError(exec, TypeError);
    792751
    793     const bool outputIsUTC = false;
    794 
    795     DateInstance* thisDateObj = asDateInstance(thisValue);
    796 
    797     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     752    DateInstance* thisDateObj = asDateInstance(thisValue);
     753
     754    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
    798755    if (!gregorianDateTime)
    799756        return jsNaN(exec);
     
    831788    double ms = milli - secs * msPerSecond;
    832789
    833     const GregorianDateTime* other = thisDateObj->gregorianDateTime(exec, inputIsUTC);
     790    const GregorianDateTime* other = inputIsUTC
     791        ? thisDateObj->gregorianDateTimeUTC(exec)
     792        : thisDateObj->gregorianDateTime(exec);
    834793    if (!other)
    835794        return jsNaN(exec);
     
    868827    else {
    869828        ms = milli - floor(milli / msPerSecond) * msPerSecond;
    870         const GregorianDateTime* other = thisDateObj->gregorianDateTime(exec, inputIsUTC);
     829        const GregorianDateTime* other = inputIsUTC
     830            ? thisDateObj->gregorianDateTimeUTC(exec)
     831            : thisDateObj->gregorianDateTime(exec);
    871832        if (!other)
    872833            return jsNaN(exec);
     
    974935        return throwError(exec, TypeError);
    975936
    976     const bool outputIsUTC = false;
    977 
    978937    DateInstance* thisDateObj = asDateInstance(thisValue);     
    979938    if (args.isEmpty()) {
     
    994953        double secs = floor(milli / msPerSecond);
    995954        ms = milli - secs * msPerSecond;
    996         if (const GregorianDateTime* other = thisDateObj->gregorianDateTime(exec, outputIsUTC))
     955        if (const GregorianDateTime* other = thisDateObj->gregorianDateTime(exec))
    997956            gregorianDateTime.copyFrom(*other);
    998957    }
     
    1007966           
    1008967    gregorianDateTime.year = (year > 99 || year < 0) ? year - 1900 : year;
    1009     JSValue result = jsNumber(exec, gregorianDateTimeToMS(exec, gregorianDateTime, ms, outputIsUTC));
     968    JSValue result = jsNumber(exec, gregorianDateTimeToMS(exec, gregorianDateTime, ms, false));
    1010969    thisDateObj->setInternalValue(result);
    1011970    return result;
     
    1017976        return throwError(exec, TypeError);
    1018977
    1019     const bool outputIsUTC = false;
    1020 
    1021     DateInstance* thisDateObj = asDateInstance(thisValue);
    1022 
    1023     const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec, outputIsUTC);
     978    DateInstance* thisDateObj = asDateInstance(thisValue);
     979
     980    const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
    1024981    if (!gregorianDateTime)
    1025982        return jsNaN(exec);
Note: See TracChangeset for help on using the changeset viewer.