Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Issue 2023005: One element cache for localtime. (Closed)

Created:
10 years, 7 months ago by sandholm
Modified:
9 years, 7 months ago
Reviewers:
Lasse Reichstein
CC:
v8-dev
Visibility:
Public.

Description

One element cache for localtime. Committed: http://code.google.com/p/v8/source/detail?r=4628

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -1 line) Patch
M src/date.js View 1 2 chunks +10 lines, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
sandholm
Lasse, would you have a look? Thx, Anders
10 years, 7 months ago (2010-05-10 07:44:43 UTC) #1
Lasse Reichstein
LGTM.
10 years, 7 months ago (2010-05-10 08:40:20 UTC) #2
Lasse Reichstein
http://codereview.chromium.org/2023005/diff/1/2 File src/date.js (right): http://codereview.chromium.org/2023005/diff/1/2#newcode249 src/date.js:249: if (time == ltc.key) return ltc.val; On second thought, ...
10 years, 7 months ago (2010-05-10 09:06:28 UTC) #3
sandholm
10 years, 7 months ago (2010-05-10 09:27:09 UTC) #4
http://codereview.chromium.org/2023005/diff/1/2
File src/date.js (right):

http://codereview.chromium.org/2023005/diff/1/2#newcode249
src/date.js:249: if (time == ltc.key) return ltc.val;
On 2010/05/10 09:06:28, Lasse Reichstein wrote:
> On second thought, use
>  if (%_ObjectEquals(time, ltc.key)) return ltc.val;
> The comparison is faster, and should work just as well in this case.
> The key is likely to be a HeapNumber, and this cache only makes sense when you
> do several calls on the same Date object, and they will also have the same
> HeapNumber as time value.

Done.

Powered by Google App Engine
This is Rietveld 408576698