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

Unified Diff: src/date.cc

Issue 1556333002: [runtime] Migrate several Date builtins to C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/date.h ('k') | src/execution.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/date.cc
diff --git a/src/date.cc b/src/date.cc
index 3106b1622b3c1735bd8c53196e424588e860f8d1..8cbf5a602ae1ea888939e6ade8b6228cdb855e37 100644
--- a/src/date.cc
+++ b/src/date.cc
@@ -175,6 +175,20 @@ int DateCache::DaysFromYearMonth(int year, int month) {
}
+void DateCache::BreakDownTime(int64_t time_ms, int* year, int* month, int* day,
+ int* weekday, int* hour, int* min, int* sec,
+ int* ms) {
+ int const days = DaysFromTime(time_ms);
+ int const time_in_day_ms = TimeInDay(time_ms, days);
+ YearMonthDayFromDays(days, year, month, day);
+ *weekday = Weekday(days);
+ *hour = time_in_day_ms / (60 * 60 * 1000);
+ *min = (time_in_day_ms / (60 * 1000)) % 60;
+ *sec = (time_in_day_ms / 1000) % 60;
+ *ms = time_in_day_ms % 1000;
+}
+
+
void DateCache::ExtendTheAfterSegment(int time_sec, int offset_ms) {
if (after_->offset_ms == offset_ms &&
after_->start_sec <= time_sec + kDefaultDSTDeltaInSec &&
« no previous file with comments | « src/date.h ('k') | src/execution.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698