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

Unified Diff: src/date.js

Issue 9117034: New class for Date objects: caches individual date components. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add constant for index of first barrier-free slot. Created 8 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/bootstrapper.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/date.js
diff --git a/src/date.js b/src/date.js
index 999009e8639089bef4ef59493ebda191d2d29ebb..28a83dccf66ad24bb7e0009c7d75ddc94fcc8a5b 100644
--- a/src/date.js
+++ b/src/date.js
@@ -452,7 +452,7 @@ var Date_cache = {
var time = MakeTime(hours, minutes, seconds, ms);
value = TimeClip(UTC(MakeDate(day, time)));
}
- %_SetValueOf(this, value);
+ SET_DATE_VALUE(this, value);
});
@@ -565,7 +565,7 @@ function DateUTC(year, month, date, hours, minutes, seconds, ms) {
TO_INTEGER(year) <= 99) ? 1900 + TO_INTEGER(year) : year;
var day = MakeDay(year, month, date);
var time = MakeTime(hours, minutes, seconds, ms);
- return %_SetValueOf(this, TimeClip(MakeDate(day, time)));
+ return TimeClip(MakeDate(day, time));
}
@@ -774,7 +774,7 @@ function DateGetTimezoneOffset() {
// ECMA 262 - 15.9.5.27
function DateSetTime(ms) {
if (!IS_DATE(this)) ThrowDateTypeError();
- return %_SetValueOf(this, TimeClip(ToNumber(ms)));
+ return SET_DATE_VALUE(this, TimeClip(ToNumber(ms)));
}
@@ -786,7 +786,7 @@ function DateSetMilliseconds(ms) {
MIN_FROM_TIME(t),
SEC_FROM_TIME(t),
ms);
- return %_SetValueOf(this, TimeClip(UTC(MakeDate(DAY(t), time))));
+ return SET_DATE_VALUE(this, TimeClip(UTC(MakeDate(DAY(t), time))));
}
@@ -798,7 +798,7 @@ function DateSetUTCMilliseconds(ms) {
MIN_FROM_TIME(t),
SEC_FROM_TIME(t),
ms);
- return %_SetValueOf(this, TimeClip(MakeDate(DAY(t), time)));
+ return SET_DATE_VALUE(this, TimeClip(MakeDate(DAY(t), time)));
}
@@ -808,7 +808,7 @@ function DateSetSeconds(sec, ms) {
sec = ToNumber(sec);
ms = %_ArgumentsLength() < 2 ? NAN_OR_MS_FROM_TIME(t) : ToNumber(ms);
var time = MakeTime(HOUR_FROM_TIME(t), MIN_FROM_TIME(t), sec, ms);
- return %_SetValueOf(this, TimeClip(UTC(MakeDate(DAY(t), time))));
+ return SET_DATE_VALUE(this, TimeClip(UTC(MakeDate(DAY(t), time))));
}
@@ -818,7 +818,7 @@ function DateSetUTCSeconds(sec, ms) {
sec = ToNumber(sec);
ms = %_ArgumentsLength() < 2 ? NAN_OR_MS_FROM_TIME(t) : ToNumber(ms);
var time = MakeTime(HOUR_FROM_TIME(t), MIN_FROM_TIME(t), sec, ms);
- return %_SetValueOf(this, TimeClip(MakeDate(DAY(t), time)));
+ return SET_DATE_VALUE(this, TimeClip(MakeDate(DAY(t), time)));
}
@@ -830,7 +830,7 @@ function DateSetMinutes(min, sec, ms) {
sec = argc < 2 ? NAN_OR_SEC_FROM_TIME(t) : ToNumber(sec);
ms = argc < 3 ? NAN_OR_MS_FROM_TIME(t) : ToNumber(ms);
var time = MakeTime(HOUR_FROM_TIME(t), min, sec, ms);
- return %_SetValueOf(this, TimeClip(UTC(MakeDate(DAY(t), time))));
+ return SET_DATE_VALUE(this, TimeClip(UTC(MakeDate(DAY(t), time))));
}
@@ -842,7 +842,7 @@ function DateSetUTCMinutes(min, sec, ms) {
sec = argc < 2 ? NAN_OR_SEC_FROM_TIME(t) : ToNumber(sec);
ms = argc < 3 ? NAN_OR_MS_FROM_TIME(t) : ToNumber(ms);
var time = MakeTime(HOUR_FROM_TIME(t), min, sec, ms);
- return %_SetValueOf(this, TimeClip(MakeDate(DAY(t), time)));
+ return SET_DATE_VALUE(this, TimeClip(MakeDate(DAY(t), time)));
}
@@ -855,7 +855,7 @@ function DateSetHours(hour, min, sec, ms) {
sec = argc < 3 ? NAN_OR_SEC_FROM_TIME(t) : ToNumber(sec);
ms = argc < 4 ? NAN_OR_MS_FROM_TIME(t) : ToNumber(ms);
var time = MakeTime(hour, min, sec, ms);
- return %_SetValueOf(this, TimeClip(UTC(MakeDate(DAY(t), time))));
+ return SET_DATE_VALUE(this, TimeClip(UTC(MakeDate(DAY(t), time))));
}
@@ -868,7 +868,7 @@ function DateSetUTCHours(hour, min, sec, ms) {
sec = argc < 3 ? NAN_OR_SEC_FROM_TIME(t) : ToNumber(sec);
ms = argc < 4 ? NAN_OR_MS_FROM_TIME(t) : ToNumber(ms);
var time = MakeTime(hour, min, sec, ms);
- return %_SetValueOf(this, TimeClip(MakeDate(DAY(t), time)));
+ return SET_DATE_VALUE(this, TimeClip(MakeDate(DAY(t), time)));
}
@@ -877,7 +877,7 @@ function DateSetDate(date) {
var t = LocalTime(DATE_VALUE(this));
date = ToNumber(date);
var day = MakeDay(YearFromTime(t), MonthFromTime(t), date);
- return %_SetValueOf(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
+ return SET_DATE_VALUE(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
}
@@ -886,7 +886,7 @@ function DateSetUTCDate(date) {
var t = DATE_VALUE(this);
date = ToNumber(date);
var day = MakeDay(YearFromTime(t), MonthFromTime(t), date);
- return %_SetValueOf(this, TimeClip(MakeDate(day, TimeWithinDay(t))));
+ return SET_DATE_VALUE(this, TimeClip(MakeDate(day, TimeWithinDay(t))));
}
@@ -896,7 +896,7 @@ function DateSetMonth(month, date) {
month = ToNumber(month);
date = %_ArgumentsLength() < 2 ? NAN_OR_DATE_FROM_TIME(t) : ToNumber(date);
var day = MakeDay(YearFromTime(t), month, date);
- return %_SetValueOf(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
+ return SET_DATE_VALUE(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
}
@@ -906,7 +906,7 @@ function DateSetUTCMonth(month, date) {
month = ToNumber(month);
date = %_ArgumentsLength() < 2 ? NAN_OR_DATE_FROM_TIME(t) : ToNumber(date);
var day = MakeDay(YearFromTime(t), month, date);
- return %_SetValueOf(this, TimeClip(MakeDate(day, TimeWithinDay(t))));
+ return SET_DATE_VALUE(this, TimeClip(MakeDate(day, TimeWithinDay(t))));
}
@@ -919,7 +919,7 @@ function DateSetFullYear(year, month, date) {
month = argc < 2 ? MonthFromTime(t) : ToNumber(month);
date = argc < 3 ? DateFromTime(t) : ToNumber(date);
var day = MakeDay(year, month, date);
- return %_SetValueOf(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
+ return SET_DATE_VALUE(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
}
@@ -932,7 +932,7 @@ function DateSetUTCFullYear(year, month, date) {
month = argc < 2 ? MonthFromTime(t) : ToNumber(month);
date = argc < 3 ? DateFromTime(t) : ToNumber(date);
var day = MakeDay(year, month, date);
- return %_SetValueOf(this, TimeClip(MakeDate(day, TimeWithinDay(t))));
+ return SET_DATE_VALUE(this, TimeClip(MakeDate(day, TimeWithinDay(t))));
}
@@ -962,11 +962,11 @@ function DateSetYear(year) {
var t = LocalTime(DATE_VALUE(this));
if (NUMBER_IS_NAN(t)) t = 0;
year = ToNumber(year);
- if (NUMBER_IS_NAN(year)) return %_SetValueOf(this, $NaN);
+ if (NUMBER_IS_NAN(year)) return SET_DATE_VALUE(this, $NaN);
year = (0 <= TO_INTEGER(year) && TO_INTEGER(year) <= 99)
? 1900 + TO_INTEGER(year) : year;
var day = MakeDay(year, MonthFromTime(t), DateFromTime(t));
- return %_SetValueOf(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
+ return SET_DATE_VALUE(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
}
« no previous file with comments | « src/bootstrapper.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698