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

Unified Diff: src/runtime.cc

Issue 173793002: Check and clear date cache in DateCurrentTime, DateLocalTimezone and getTimezoneOffset. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix caching of offset Created 6 years, 9 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/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 754f743f8cbeead5db1fe1e4e3db42b3949ef4ea..d7fa120cf835e052f7721cdd389f8481baf21592 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -9620,6 +9620,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DateCurrentTime) {
// time is milliseconds. Therefore, we floor the result of getting
// the OS time.
double millis = std::floor(OS::TimeCurrentMillis());
+ isolate->date_cache()->CheckTimezone();
return isolate->heap()->NumberFromDouble(millis);
}
@@ -9666,6 +9667,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DateLocalTimezone) {
ASSERT(args.length() == 1);
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
+ isolate->date_cache()->CheckTimezone();
int64_t time = isolate->date_cache()->EquivalentTime(static_cast<int64_t>(x));
const char* zone = OS::LocalTimezone(static_cast<double>(time));
return isolate->heap()->AllocateStringFromUtf8(CStrVector(zone));
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698