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

Unified Diff: src/date-delay.js

Issue 6441: - Added fast case for extending the JSObject properties storage.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 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/builtins.cc ('k') | src/handles.cc » ('j') | src/ic.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/date-delay.js
===================================================================
--- src/date-delay.js (revision 415)
+++ src/date-delay.js (working copy)
@@ -36,7 +36,6 @@
// changes to these properties.
const $Date = global.Date;
-
// ECMA 262 - 15.9.1.2
function Day(time) {
return $floor(time/msPerDay);
@@ -127,17 +126,6 @@
return TimeClip(MakeDate(day, TimeWithinDay(t)));
}
-
-var local_time_offset;
-
-function LocalTimeOffset() {
- if (IS_UNDEFINED(local_time_offset)) {
- local_time_offset = %DateLocalTimeOffset();
- }
- return local_time_offset;
-}
-
-
var daylight_cache_time = $NaN;
var daylight_cache_offset;
@@ -170,16 +158,17 @@
return Modulo(Day(time) + 4, 7);
}
+var local_time_offset = %DateLocalTimeOffset();
function LocalTime(time) {
if ($isNaN(time)) return time;
- return time + LocalTimeOffset() + DaylightSavingsOffset(time);
+ return time + local_time_offset + DaylightSavingsOffset(time);
}
function UTC(time) {
if ($isNaN(time)) return time;
- var tmp = time - LocalTimeOffset();
+ var tmp = time - local_time_offset;
return tmp - DaylightSavingsOffset(tmp);
}
@@ -530,7 +519,7 @@
function LocalTimezoneString(time) {
- var timezoneOffset = (LocalTimeOffset() + DaylightSavingsOffset(time)) / msPerMinute;
+ var timezoneOffset = (local_time_offset + DaylightSavingsOffset(time)) / msPerMinute;
var sign = (timezoneOffset >= 0) ? 1 : -1;
var hours = $floor((sign * timezoneOffset)/60);
var min = $floor((sign * timezoneOffset)%60);
« no previous file with comments | « src/builtins.cc ('k') | src/handles.cc » ('j') | src/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698