<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>30681</bug_id>
          
          <creation_ts>2009-10-22 10:42:05 -0700</creation_ts>
          <short_desc>[Symbian] JS Date operations very slow due to flaky POSIX date/time implementation</short_desc>
          <delta_ts>2010-05-05 09:32:06 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>S60 Hardware</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>LATER</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>27065</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Siddharth Mathur">s.mathur</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>darin</cc>
    
    <cc>eric</cc>
    
    <cc>hausmann</cc>
    
    <cc>koivisto</cc>
    
    <cc>koshuin</cc>
    
    <cc>laszlo.gombos</cc>
    
    <cc>mjs</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>156923</commentid>
    <comment_count>0</comment_count>
    <who name="Siddharth Mathur">s.mathur</who>
    <bug_when>2009-10-22 10:42:05 -0700</bug_when>
    <thetext>Bypass use of POSIX APIs in Date related operation and use Symbian OS APIs directly. 

I am preparing a small patch for getUTCOffset() and getDSTOffset() in JavascriptCore/WTF/DateMath.cpp that only affects Symbian platform. The current implementation of the above functions uses Symbian&apos;s PIPS (standard C implementation) which works too slowly when arbitrary date/time are given to it (due to parsing of historical TimeZone databases and more) . 

Patch follows soon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156979</commentid>
    <comment_count>1</comment_count>
    <who name="Janne Koskinen">koshuin</who>
    <bug_when>2009-10-22 12:51:49 -0700</bug_when>
    <thetext>Hold this a bit. I&apos;ll check tomorrow, but I have a gut feeling that we changed the time functions In Qt not to use Open C but use Symbian APIs instead. We have the ECMA/Date tests disabled for Embedded Linux and Symbian as HW targets will fail due to slow execution time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156983</commentid>
    <comment_count>2</comment_count>
    <who name="Siddharth Mathur">s.mathur</who>
    <bug_when>2009-10-22 13:03:07 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Hold this a bit. I&apos;ll check tomorrow, but I have a gut feeling that we changed
&gt; the time functions In Qt not to use Open C but use Symbian APIs instead. We
&gt; have the ECMA/Date tests disabled for Embedded Linux and Symbian as HW targets
&gt; will fail due to slow execution time.

Yes, I was also told that QDateTime and friends are being fixed up. :) But 
Javascript/WTF/DateMath.cpp is not using Qt at all for its Date/Time manipulation and goes straight to the POSIX APIs. You can check this yourself if you see who calls gregorianDateTimeToMS() and msToGregorianDateTime() in DateMath.cpp.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156986</commentid>
    <comment_count>3</comment_count>
      <attachid>41679</attachid>
    <who name="Siddharth Mathur">s.mathur</who>
    <bug_when>2009-10-22 13:08:52 -0700</bug_when>
    <thetext>Created attachment 41679
proposed patch

Attaching patch. Two functions in DateMap.cpp use Symbian OS APIs directly for estimating Daylight savings correction. 
- Verified that ECMAscript Date tests all pass in Symbian emulator.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>157121</commentid>
    <comment_count>4</comment_count>
    <who name="Janne Koskinen">koshuin</who>
    <bug_when>2009-10-23 01:36:16 -0700</bug_when>
    <thetext>Looks good for me. I checked and there is no overlap, infact we will change some of the functions to be more in line with this patch :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>157162</commentid>
    <comment_count>5</comment_count>
    <who name="Siddharth Mathur">s.mathur</who>
    <bug_when>2009-10-23 08:09:35 -0700</bug_when>
    <thetext>Performance improvement:  Sunspider date-totfe completes in 642ms with the above patch on an N97 vs. 12834ms previously using openC/PIPS implementation

(the latter time is particularly bad because looking up timezone databases leads to lots of file I/O and client-server IPC on Symbian OS)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>157185</commentid>
    <comment_count>6</comment_count>
    <who name="Siddharth Mathur">s.mathur</who>
    <bug_when>2009-10-23 11:00:24 -0700</bug_when>
    <thetext>Corrected numbers: 5111ms for both date tests in Sunspider after the patch, 26682ms before. So about 5x faster.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>157636</commentid>
    <comment_count>7</comment_count>
      <attachid>41679</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-10-25 16:31:55 -0700</bug_when>
    <thetext>Comment on attachment 41679
proposed patch

I don&apos;t see how this could be right. I&apos;ll try to review later when I have more time, but this seems obviously wrong on my first reading.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>158006</commentid>
    <comment_count>8</comment_count>
      <attachid>41679</attachid>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2009-10-26 16:17:09 -0700</bug_when>
    <thetext>Comment on attachment 41679
proposed patch

Right, seems that this would trivially break getUTCOffset() by making it include DST correction. Not all callpaths automatically add the DST offset later.

If Qt has better implementation, you could just switch to those (from the posix ones, with appropriate ifdefs).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>158054</commentid>
    <comment_count>9</comment_count>
    <who name="Siddharth Mathur">s.mathur</who>
    <bug_when>2009-10-26 18:19:34 -0700</bug_when>
    <thetext>Antti, thanks for your time and review comments. My clarifications are below: 

(In reply to comment #8)
&gt; (From update of attachment 41679 [details])
&gt; Right, seems that this would trivially break getUTCOffset() by making it
&gt; include DST correction. Not all callpaths automatically add the DST offset
&gt; later.

a) getUTCOffset() is only called from two functions in the same file: gregorianDateTimeToMS() and its inverse gregorianDateTimeToMS(). It is called from nowhere else for any port. In both places it is added to getDSTOffset(). I have changed both, so that their sum is consistent. 

b) The reason getUTCOffset() and getDSTOffset() always go together is because of the ECMAscript spec being written that way. The code mirrors the spec very nicely. 
http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf
Section 15.9.1.9 describes the only place in the EMCA spec where LocalTZA and DaylightSavingsTA are used. They are added to each other. DaylightSavingsTA == getDSTOffset() , and LocalTZA == getDSTOffset(). 

&gt; If Qt has better implementation, you could just switch to those (from the posix
&gt; ones, with appropriate ifdefs).

c) I am hesitent to add Qt dependecy to Javascript/WTF/* because this code is entirely Qt-unware. It also use C/C++ primitive types like double all over the place, so any work to introduce something like qreal and other Qt baggage would be quite intrusive and might make the code less readable for other ports. 

Thanks again for your time and help!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>158639</commentid>
    <comment_count>10</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2009-10-28 11:00:00 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; a) getUTCOffset() is only called from two functions in the same file:
&gt; gregorianDateTimeToMS() and its inverse gregorianDateTimeToMS(). It is called
&gt; from nowhere else for any port. In both places it is added to getDSTOffset(). I
&gt; have changed both, so that their sum is consistent. 

At least a GregorianDateTime constructor in DateMath.h calls getUTCOffset() and expects it not have DST included. Anyone could add mode code that relies on getting the correct values from these functions.

If there truly is no valid reason to get UTC and DST offsets separately then there probably should be only one function for returning the combined value.

&gt; c) I am hesitent to add Qt dependecy to Javascript/WTF/* because this code is
&gt; entirely Qt-unware. It also use C/C++ primitive types like double all over the
&gt; place, so any work to introduce something like qreal and other Qt baggage would
&gt; be quite intrusive and might make the code less readable for other ports. 
&gt; 
&gt; Thanks again for your time and help!

You could probably put all Qt calls to a single file that does not expose Qt to the rest of the JSC. But you are right that avoiding the dependency is probably good idea if it does not exist already.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>159459</commentid>
    <comment_count>11</comment_count>
    <who name="Siddharth Mathur">s.mathur</who>
    <bug_when>2009-10-30 14:42:24 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; At least a GregorianDateTime constructor in DateMath.h calls getUTCOffset() and
&gt; expects it not have DST included. Anyone could add mode code that relies on
&gt; getting the correct values from these functions.
&gt; If there truly is no valid reason to get UTC and DST offsets separately then
&gt; there probably should be only one function for returning the combined value.

My bad, I missed DateMath.h. That GregorianDateTime c&apos;tor is also adding a presumed DST offset of 1 hour there too, so I think I will make a patch that will prevent getUTCOffset() from being called by itself and wrap it all cleanly. 

Thanks Antti!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>159718</commentid>
    <comment_count>12</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2009-11-01 19:52:20 -0800</bug_when>
    <thetext>(In reply to comment #9)
&gt; &gt; If Qt has better implementation, you could just switch to those (from the posix
&gt; &gt; ones, with appropriate ifdefs).
&gt; 
&gt; c) I am hesitent to add Qt dependecy to Javascript/WTF/* because this code is
&gt; entirely Qt-unware. It also use C/C++ primitive types like double all over the
&gt; place, so any work to introduce something like qreal and other Qt baggage would
&gt; be quite intrusive and might make the code less readable for other ports. 

I don&apos;t think there&apos;s a problem using Qt functions in JavaScriptCore/WTF, we&apos;re doing that all over the place already.

On the other hand your patch is realtively simple, too :)

If it makes the patch easier and of course the code faster I&apos;d say don&apos;t hesitate with using Qt functions there. It might also help to get more consistent behaviour across all Qt ports.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>168379</commentid>
    <comment_count>13</comment_count>
      <attachid>44235</attachid>
    <who name="Janne Koskinen">koshuin</who>
    <bug_when>2009-12-03 05:53:27 -0800</bug_when>
    <thetext>Created attachment 44235
another fix

Added version that accounts for DST changes. DST is checked from timezone server on Symbian.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>168451</commentid>
    <comment_count>14</comment_count>
    <who name="Siddharth Mathur">s.mathur</who>
    <bug_when>2009-12-03 10:33:27 -0800</bug_when>
    <thetext>(In reply to comment #13)
&gt; Created an attachment (id=44235) [details]
&gt; another fix
&gt; 
&gt; Added version that accounts for DST changes. DST is checked from timezone
&gt; server on Symbian.

Janne, 

I am sorry but this is not good performance-wise. As you probably know client&lt;-&gt;server communication in Symbian is a very slow process that requires a context-switch for each API call. And that&apos;s just part of the problem, since the concerete implementations of Connect(), DoWork(), Close() are time consuming by themselves [1].  So use of 2 Connect(), 2 Close() , and 2 TZ server API calls is not acceptable in speed critical code like JSC&apos;s Date/time implementation. Did you get the chance to time this on an N97 using Sunpsider date tests? 

On a related front, I previously noticed in reading the ECMAscript spec [Comment #9] that it&apos;s flexible about how an implementation does DST isolation. My understanding is that as long as the (functional) compliance tests pass, some liberties can be taken. If anyone disagrees, please comment.  

Therefore, another plan of attack _might_ be ..

Patch 1: Remove the use of getUTCOffset() in the c&apos;tor in DateMath.h and also makes sure that the affected member variable isn&apos;t incorrectly used later on/has invalid data. IIRC, only some ports use that member variable. 

Patch 2: Follow the suggestion in Comment #10 about &quot;one function that returns a combined (sum) value&quot; of getUTCOffset() + getDSTOffset(). Then it would be easy to make that wrapper function use either a new flag HAVE_WEAKDSTISOLATION, or PLATFORM(SYMBIAN), or both to return the value returned by User::UTCoffset(). 

The advantage of the above approach is that it requires zero Symbian server API usage and hence will be as efficient as a port&apos;s Date code ought to be. The disadvantage is that the UTC offset is for the current time, not an arbitrary time in the past or future. But if the ECMAscript functional compliance tests pass, the latter shouldn&apos;t be a problem, IMHO. 

[1] Page 14-19 : http://www.symbianresources.com/tutorials/advanced/clientserver/Client-ServerFramework.pdf</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>168469</commentid>
    <comment_count>15</comment_count>
    <who name="Janne Koskinen">koshuin</who>
    <bug_when>2009-12-03 11:10:27 -0800</bug_when>
    <thetext>&gt; context-switch for each API call. And that&apos;s just part of the problem, since
&gt; the concerete implementations of Connect(), DoWork(), Close() are time
&gt; consuming by themselves [1].  So use of 2 Connect(), 2 Close() , and 2 TZ
&gt; server API calls is not acceptable in speed critical code like JSC&apos;s Date/time
&gt; implementation. Did you get the chance to time this on an N97 using Sunpsider
&gt; date tests? 

Results from 5800 express music:
date-format-tofte + format-xparb = date total

Before 5543ms + 24228ms = 29772ms
After 2386ms + 2534ms = 4921ms

Have you actually checked Context Switch times on newer devices ? it is minimal.
Here is context switch time from my E71:
Inter-thread context switch: 6.270000 us / round-trip (100000 round trips in total)
Inter-process context switch: 6.860000 us / round-trip (100000 round trips in total)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>168510</commentid>
    <comment_count>16</comment_count>
    <who name="Siddharth Mathur">s.mathur</who>
    <bug_when>2009-12-03 12:53:35 -0800</bug_when>
    <thetext>(In reply to comment #15)
&gt; Results from 5800 express music:
&gt; date-format-tofte + format-xparb = date total
&gt; 
&gt; Before 5543ms + 24228ms = 29772ms
&gt; After 2386ms + 2534ms = 4921ms
&gt; 
Wow, in that case I eat my words. (Yes, I see FTC trace of .Connect(), Close() and server API calls almost every day and they are really slow). 

I will make a phone build using the patch, try it out and report back. 

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>168546</commentid>
    <comment_count>17</comment_count>
    <who name="Janne Koskinen">koshuin</who>
    <bug_when>2009-12-03 14:22:25 -0800</bug_when>
    <thetext>&gt; Wow, in that case I eat my words. (Yes, I see FTC trace of .Connect(), Close()
&gt; and server API calls almost every day and they are really slow). 
&gt; 
&gt; I will make a phone build using the patch, try it out and report back. 
&gt; 

Slow is relative, we are talking about seconds here :) FTC resolution is insane, I&apos;m amazed by the tool. .Connect() would be really slow in case where server is not running and having to start the server process. I would assume TZ to be always running, could be wrong. Problem is that there really aren&apos;t other alternatives when using pure Symbian APIs. There is one call that could be made in TLocale but that is said to be deprecated in the header. And for Open C , I don&apos;t have their source code so I can&apos;t say what they are doing to spend so much time on those functions. Best alternative after all would be to fix Open C and leave datemath.cpp as is.

Try it out and see what numbers you get.

---
Measuring just the context switch doesn&apos;t really bare any meaning.. here is some more interesting numbers for this case. Notice the huge difference, this is what I was referring to. These numbers haven&apos;t been measured with FTC so they have some extra time from instrumentation.

Nokia E61:
Synchronous IPC function with one argument and result: 143,550000 us / call (20000 calls in total)
Synchronous IPC function with buffer[32] argument read: 161,900000 us / call (20000 calls in total)
Nokia E71:
Synchronous IPC function with one argument and result: 7,550000 us / call (20000 calls in total)
Synchronous IPC function with buffer[32] argument read: 13,250000 us / call (20000 calls in total)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>170665</commentid>
    <comment_count>18</comment_count>
    <who name="Siddharth Mathur">s.mathur</who>
    <bug_when>2009-12-11 03:09:12 -0800</bug_when>
    <thetext>(In reply to comment #17)

&gt; Slow is relative, we are talking about seconds here :) 

Indeed , _seconds_ . On a 434MhZ ARM11. ;) 

Anyways, I was able to verify that with your patch, the number on N97 was dramatically better than with the existing openC/PIPS release. Please feel free to open the patch for review when you are ready.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>171138</commentid>
    <comment_count>19</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2009-12-12 16:16:02 -0800</bug_when>
    <thetext>(In reply to comment #13)
&gt; Created an attachment (id=44235) [details]
&gt; another fix
&gt; 
&gt; Added version that accounts for DST changes. DST is checked from timezone
&gt; server on Symbian.

Janne, the patch looks like it should be marked for review :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>171308</commentid>
    <comment_count>20</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2009-12-14 00:06:38 -0800</bug_when>
    <thetext>style-queue ran check-webkit-style on attachment 44235 without any errors.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>171499</commentid>
    <comment_count>21</comment_count>
      <attachid>44235</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-12-14 12:20:32 -0800</bug_when>
    <thetext>Comment on attachment 44235
another fix

It&apos;s unfortunate that this is abstracted via #ifdefs instead of functions.  If we used functions then we could at some later date move those functions to another file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>175448</commentid>
    <comment_count>22</comment_count>
      <attachid>44235</attachid>
    <who name="Janne Koskinen">koshuin</who>
    <bug_when>2009-12-28 23:37:18 -0800</bug_when>
    <thetext>Comment on attachment 44235
another fix

Killed the patch. I&apos;ve found out when doing making the same patch for Qt that 3.1/3.2/5.0 all have major differences in API for timezone server and would cause this patch to fail to compile on 3.1.
Problem is that 3.1 version of the API cannot be used like this to get DST at all. Build variant for 3.1/3.2/5.0/future needs to be added if the code will stay on webkit side. I think datemath needs to call datetime as already suggested in the comments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>175457</commentid>
    <comment_count>23</comment_count>
    <who name="Janne Koskinen">koshuin</who>
    <bug_when>2009-12-28 23:50:32 -0800</bug_when>
    <thetext>I&apos;ve also contacted Open C guys who promised to take a look at their performance of their posix time functions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184156</commentid>
    <comment_count>24</comment_count>
    <who name="Janne Koskinen">koshuin</who>
    <bug_when>2010-01-24 22:06:22 -0800</bug_when>
    <thetext>(In reply to comment #23)
&gt; I&apos;ve also contacted Open C guys who promised to take a look at their
&gt; performance of their posix time functions.

Got a patch from Open C guys and testing it out. If it works out fine I guess we could close this issue. Problem is that the fix won&apos;t make it into their next release and I have no idea when newer release will be coming out.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>187341</commentid>
    <comment_count>25</comment_count>
    <who name="Janne Koskinen">koshuin</who>
    <bug_when>2010-02-03 06:51:33 -0800</bug_when>
    <thetext>I finally managed to run the tests on patched Open C (got several non-working version of it). My testsuite that I built explicitly to be the reference for this patch didn&apos;t start after the patched Open C which isn&apos;t such nice thing as now I don&apos;t have real baseline to go with.

tofte + xbarb 2933ms + 10567ms = 13500ms which is half the original time, but still lacks from my patch. To fix the patch will make the time taken to skyrocket in that or something more drastic changes is required for Symbian.

Using Qt is no option here as QDateTime doesn&apos;t offer API to get DST. Maybe if QDateTime API would be changed. And the same bug is there too..</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>214514</commentid>
    <comment_count>26</comment_count>
    <who name="Janne Koskinen">koshuin</who>
    <bug_when>2010-04-20 00:40:54 -0700</bug_when>
    <thetext>Open C fixes have been tested and speed is at acceptable level. I&apos;ll close the issue for now and check back on once we have new Open C version released.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>221145</commentid>
    <comment_count>27</comment_count>
    <who name="Siddharth Mathur">s.mathur</who>
    <bug_when>2010-05-05 09:32:06 -0700</bug_when>
    <thetext>(In reply to comment #26)
&gt; Open C fixes have been tested and speed is at acceptable level. I&apos;ll close the
&gt; issue for now and check back on once we have new Open C version released.

For record keeping only: Internal OpenC bug for this fix is TSW VPOL-7WS7P2. (Janne, please correct if necessary)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>41679</attachid>
            <date>2009-10-22 13:08:52 -0700</date>
            <delta_ts>2009-12-03 06:41:20 -0800</delta_ts>
            <desc>proposed patch</desc>
            <filename>30681.patch</filename>
            <type>text/plain</type>
            <size>2883</size>
            <attacher name="Siddharth Mathur">s.mathur</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL0NoYW5nZUxvZw0KPT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KLS0tIEphdmFTY3Jp
cHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gNDk5NTApCisrKyBKYXZhU2NyaXB0Q29yZS9DaGFu
Z2VMb2cJKHdvcmtpbmcgY29weSkKQEAgLTEsMyArMSwxNCBAQAorMjAwOS0xMC0yMiAgU2lkZGhh
cnRoIE1hdGh1ciAgPHNpZGRoYXJ0aC5tYXRodXJAbm9raWEuY29tPgorCisgICAgICAgIFJldmll
d2VkIGJ5IE5PQk9EWS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ENPZmZzZXQoKSBhbHJlYWR5IGhh
cyBkYXlsaWdodCBzYXZpbmdzIAorICAgIHJldHVybiAwLjA7IAorI2VuZGlmCiB9CiAKIGRvdWJs
ZSBncmVnb3JpYW5EYXRlVGltZVRvTVMoY29uc3QgR3JlZ29yaWFuRGF0ZVRpbWUmIHQsIGRvdWJs
ZSBtaWxsaVNlY29uZHMsIGJvb2wgaW5wdXRJc1VUQykK
</data>
<flag name="review"
          id="23169"
          type_id="1"
          status="-"
          setter="koivisto"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>44235</attachid>
            <date>2009-12-03 05:53:27 -0800</date>
            <delta_ts>2009-12-28 23:37:18 -0800</delta_ts>
            <desc>another fix</desc>
            <filename>jsdate.diff</filename>
            <type>text/plain</type>
            <size>2880</size>
            <attacher name="Janne Koskinen">koshuin</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZyBiL0phdmFTY3JpcHRDb3JlL0No
YW5nZUxvZwppbmRleCBhNTBjZjIyLi45ZjFjNjZiIDEwMDY0NAotLS0gYS9KYXZhU2NyaXB0Q29y
ZS9DaGFuZ2VMb2cKKysrIGIvSmF2YVNjcmlwdENvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTgg
QEAKKzIwMDktMTItMDMgIEphbm5lIEtvc2tpbmVuICA8amFubmUucC5rb3NraW5lbkBkaWdpYS5j
b20+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgVXNl
IFN5bWJpYW4ncyB0aW1lIGZ1bmN0aW9ucyBpbiBEYXRlTWF0aAorICAgICAgICBodHRwczovL2J1
Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MzA2ODEKKworICAgICAgICBPcGVuIEMncyBQ
b3NpeC90aW1lIGZ1bmN0aW9ucyBhcmUgcmVhbGx5IHNsb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Gl6ZURhdGVzKCkK
</data>

          </attachment>
      

    </bug>

</bugzilla>