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

Issue 661366: Rewrite MakeDay function from JS to C++. (Closed)

Created:
10 years, 9 months ago by Oleg Eterevsky
Modified:
9 years, 5 months ago
CC:
v8-dev
Visibility:
Public.

Description

Rewrite MakeDay function from JS to C++. Committed: http://code.google.com/p/v8/source/detail?r=3997

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -18 lines) Patch
M src/date-delay.js View 3 chunks +12 lines, -18 lines 2 comments Download
M src/macros.py View 1 chunk +10 lines, -0 lines 0 comments Download
M src/runtime.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/runtime.cc View 1 chunk +32 lines, -0 lines 2 comments Download

Messages

Total messages: 3 (0 generated)
Oleg Eterevsky
10 years, 9 months ago (2010-03-02 12:47:09 UTC) #1
Mads Ager (chromium)
LGTM with a couple of comments. http://codereview.chromium.org/661366/diff/1/3 File src/date-delay.js (right): http://codereview.chromium.org/661366/diff/1/3#newcode368 src/date-delay.js:368: // Now we ...
10 years, 9 months ago (2010-03-02 13:04:08 UTC) #2
Oleg Eterevsky
10 years, 9 months ago (2010-03-02 13:28:23 UTC) #3
http://codereview.chromium.org/661366/diff/1/3
File src/date-delay.js (right):

http://codereview.chromium.org/661366/diff/1/3#newcode368
src/date-delay.js:368: // Now we presume that year, month and date are actually
SMIs.
On 2010/03/02 13:04:08, Mads Ager wrote:
> Since the runtime function probably relies on year, month and date being Smis,
> we have to be 100% sure that they are.  Could you update the comment
explaining
> why they have to be Smis?

Done.

http://codereview.chromium.org/661366/diff/1/4
File src/runtime.cc (right):

http://codereview.chromium.org/661366/diff/1/4#newcode4955
src/runtime.cc:4955: int day_from_year = 365*year + (year - 1)/4 - (year -
1)/100 + (year - 1)/400 - base_day;
I tried to reformat it to make it more readable, avoiding extra parentheses.
Hope, it's ok now.

On 2010/03/02 13:04:08, Mads Ager wrote:
> Line too long, please reformat.  Also, please have a space around arithmetic
> operations and use parenthesis to make the precedence explicit.

Powered by Google App Engine
This is Rietveld 408576698