Bug 793076 (part 3) - In jsdate.cpp, convert Rooted<JSObject*> pointers to RootedObject. r=jwalden.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 20 Sep 2012 23:23:18 -0700
changeset 109596 11868442cc39ca566113da4fd4d7c6d420563ce1
parent 109595 c11ad1bccb45e9aa71bab0eeb6fec3b44de16898
child 109597 8381c97c65d685b4b55264e162ab711584e4fc5b
push id23636
push usergsharp@mozilla.com
push dateMon, 08 Oct 2012 08:08:19 +0000
treeherdermozilla-central@24cf40690042 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs793076
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 793076 (part 3) - In jsdate.cpp, convert Rooted<JSObject*> pointers to RootedObject. r=jwalden.
js/src/jsdate.cpp
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -1463,17 +1463,17 @@ date_getTime(JSContext *cx, unsigned arg
     return CallNonGenericMethod<IsDate, date_getTime_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_getYear_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
     if (!CacheLocalTime(&cx->dstOffsetCache, thisObj))
         return false;
 
     Value yearVal = thisObj->getSlot(JSObject::JSSLOT_DATE_LOCAL_YEAR);
     if (yearVal.isInt32()) {
         /* Follow ECMA-262 to the letter, contrary to IE JScript. */
         int year = yearVal.toInt32() - 1900;
         args.rval().setInt32(year);
@@ -1491,17 +1491,17 @@ date_getYear(JSContext *cx, unsigned arg
     return CallNonGenericMethod<IsDate, date_getYear_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_getFullYear_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
     if (!CacheLocalTime(&cx->dstOffsetCache, thisObj))
         return false;
 
     args.rval().set(thisObj->getSlot(JSObject::JSSLOT_DATE_LOCAL_YEAR));
     return true;
 }
 
 static JSBool
@@ -1531,17 +1531,17 @@ date_getUTCFullYear(JSContext *cx, unsig
     return CallNonGenericMethod<IsDate, date_getUTCFullYear_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_getMonth_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
     if (!CacheLocalTime(&cx->dstOffsetCache, thisObj))
         return false;
 
     args.rval().set(thisObj->getSlot(JSObject::JSSLOT_DATE_LOCAL_MONTH));
     return true;
 }
 
 static JSBool
@@ -1568,17 +1568,17 @@ date_getUTCMonth(JSContext *cx, unsigned
     return CallNonGenericMethod<IsDate, date_getUTCMonth_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_getDate_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
     if (!CacheLocalTime(&cx->dstOffsetCache, thisObj))
         return false;
 
     args.rval().set(thisObj->getSlot(JSObject::JSSLOT_DATE_LOCAL_DATE));
     return true;
 }
 
 static JSBool
@@ -1608,17 +1608,17 @@ date_getUTCDate(JSContext *cx, unsigned 
     return CallNonGenericMethod<IsDate, date_getUTCDate_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_getDay_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
     if (!CacheLocalTime(&cx->dstOffsetCache, thisObj))
         return false;
 
     args.rval().set(thisObj->getSlot(JSObject::JSSLOT_DATE_LOCAL_DAY));
     return true;
 }
 
 static JSBool
@@ -1648,17 +1648,17 @@ date_getUTCDay(JSContext *cx, unsigned a
     return CallNonGenericMethod<IsDate, date_getUTCDay_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_getHours_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
     if (!CacheLocalTime(&cx->dstOffsetCache, thisObj))
         return false;
 
     args.rval().set(thisObj->getSlot(JSObject::JSSLOT_DATE_LOCAL_HOURS));
     return true;
 }
 
 static JSBool
@@ -1688,17 +1688,17 @@ date_getUTCHours(JSContext *cx, unsigned
     return CallNonGenericMethod<IsDate, date_getUTCHours_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_getMinutes_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
     if (!CacheLocalTime(&cx->dstOffsetCache, thisObj))
         return false;
 
     args.rval().set(thisObj->getSlot(JSObject::JSSLOT_DATE_LOCAL_MINUTES));
     return true;
 }
 
 static JSBool
@@ -1730,17 +1730,17 @@ date_getUTCMinutes(JSContext *cx, unsign
 
 /* Date.getSeconds is mapped to getUTCSeconds */
 
 JS_ALWAYS_INLINE bool
 date_getUTCSeconds_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
     if (!CacheLocalTime(&cx->dstOffsetCache, thisObj))
         return false;
 
     args.rval().set(thisObj->getSlot(JSObject::JSSLOT_DATE_LOCAL_SECONDS));
     return true;
 }
 
 static JSBool
@@ -1772,17 +1772,17 @@ date_getUTCMilliseconds(JSContext *cx, u
     return CallNonGenericMethod<IsDate, date_getUTCMilliseconds_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_getTimezoneOffset_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
     double utctime = thisObj->getDateUTCTime().toNumber();
 
     double localtime;
     if (!GetCachedLocalTime(&cx->dstOffsetCache, thisObj, &localtime))
         return false;
 
     /*
      * Return the time zone offset in minutes for the current locale that is
@@ -1801,17 +1801,17 @@ date_getTimezoneOffset(JSContext *cx, un
     return CallNonGenericMethod<IsDate, date_getTimezoneOffset_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_setTime_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
     if (args.length() == 0) {
         SetDateToNaN(thisObj, args.rval().address());
         return true;
     }
 
     double result;
     if (!ToNumber(cx, args[0], &result))
         return false;
@@ -1857,17 +1857,17 @@ GetMinsOrDefault(JSContext *cx, const Ca
 }
 
 /* ES5 15.9.5.28. */
 JS_ALWAYS_INLINE bool
 date_setMilliseconds_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     /* Step 1. */
     double t = LocalTime(thisObj->getDateUTCTime().toNumber(), &cx->dstOffsetCache);
 
     /* Step 2. */
     double milli;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &milli))
         return false;
@@ -1888,17 +1888,17 @@ date_setMilliseconds(JSContext *cx, unsi
 }
 
 /* ES5 15.9.5.29. */
 JS_ALWAYS_INLINE bool
 date_setUTCMilliseconds_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     /* Step 1. */
     double t = thisObj->getDateUTCTime().toNumber();
 
     /* Step 2. */
     double milli;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &milli))
         return false;
@@ -1919,17 +1919,17 @@ date_setUTCMilliseconds(JSContext *cx, u
 }
 
 /* ES5 15.9.5.30. */
 JS_ALWAYS_INLINE bool
 date_setSeconds_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     /* Step 1. */
     double t = LocalTime(thisObj->getDateUTCTime().toNumber(), &cx->dstOffsetCache);
 
     /* Step 2. */
     double s;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &s))
         return false;
@@ -1957,17 +1957,17 @@ date_setSeconds(JSContext *cx, unsigned 
     return CallNonGenericMethod<IsDate, date_setSeconds_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_setUTCSeconds_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     /* Step 1. */
     double t = thisObj->getDateUTCTime().toNumber();
 
     /* Step 2. */
     double s;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &s))
         return false;
@@ -1995,17 +1995,17 @@ date_setUTCSeconds(JSContext *cx, unsign
     return CallNonGenericMethod<IsDate, date_setUTCSeconds_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_setMinutes_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     /* Step 1. */
     double t = LocalTime(thisObj->getDateUTCTime().toNumber(), &cx->dstOffsetCache);
 
     /* Step 2. */
     double m;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &m))
         return false;
@@ -2038,17 +2038,17 @@ date_setMinutes(JSContext *cx, unsigned 
     return CallNonGenericMethod<IsDate, date_setMinutes_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_setUTCMinutes_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     /* Step 1. */
     double t = thisObj->getDateUTCTime().toNumber();
 
     /* Step 2. */
     double m;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &m))
         return false;
@@ -2081,17 +2081,17 @@ date_setUTCMinutes(JSContext *cx, unsign
     return CallNonGenericMethod<IsDate, date_setUTCMinutes_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_setHours_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     /* Step 1. */
     double t = LocalTime(thisObj->getDateUTCTime().toNumber(), &cx->dstOffsetCache);
 
     /* Step 2. */
     double h;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &h))
         return false;
@@ -2129,17 +2129,17 @@ date_setHours(JSContext *cx, unsigned ar
     return CallNonGenericMethod<IsDate, date_setHours_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_setUTCHours_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     /* Step 1. */
     double t = thisObj->getDateUTCTime().toNumber();
 
     /* Step 2. */
     double h;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &h))
         return false;
@@ -2177,17 +2177,17 @@ date_setUTCHours(JSContext *cx, unsigned
     return CallNonGenericMethod<IsDate, date_setUTCHours_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_setDate_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     /* Step 1. */
     double t = LocalTime(thisObj->getDateUTCTime().toNumber(), &cx->dstOffsetCache);
 
     /* Step 2. */
     double dt;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &dt))
         return false;
@@ -2210,17 +2210,17 @@ date_setDate(JSContext *cx, unsigned arg
     return CallNonGenericMethod<IsDate, date_setDate_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_setUTCDate_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     /* Step 1. */
     double t = thisObj->getDateUTCTime().toNumber();
 
     /* Step 2. */
     double dt;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &dt))
         return false;
@@ -2263,17 +2263,17 @@ GetMonthOrDefault(JSContext *cx, const C
 }
 
 /* ES5 15.9.5.38. */
 JS_ALWAYS_INLINE bool
 date_setMonth_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     /* Step 1. */
     double t = LocalTime(thisObj->getDateUTCTime().toNumber(), &cx->dstOffsetCache);
 
     /* Step 2. */
     double m;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &m))
         return false;
@@ -2301,17 +2301,17 @@ date_setMonth(JSContext *cx, unsigned ar
 }
 
 /* ES5 15.9.5.39. */
 JS_ALWAYS_INLINE bool
 date_setUTCMonth_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     /* Step 1. */
     double t = thisObj->getDateUTCTime().toNumber();
 
     /* Step 2. */
     double m;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &m))
         return false;
@@ -2355,17 +2355,17 @@ ThisUTCTimeOrZero(Handle<JSObject*> date
 }
 
 /* ES5 15.9.5.40. */
 JS_ALWAYS_INLINE bool
 date_setFullYear_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     /* Step 1. */
     double t = ThisLocalTimeOrZero(thisObj, &cx->dstOffsetCache);
 
     /* Step 2. */
     double y;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &y))
         return false;
@@ -2398,17 +2398,17 @@ date_setFullYear(JSContext *cx, unsigned
 }
 
 /* ES5 15.9.5.41. */
 JS_ALWAYS_INLINE bool
 date_setUTCFullYear_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     /* Step 1. */
     double t = ThisUTCTimeOrZero(thisObj);
 
     /* Step 2. */
     double y;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &y))
         return false;
@@ -2441,17 +2441,17 @@ date_setUTCFullYear(JSContext *cx, unsig
 }
 
 /* ES5 Annex B.2.5. */
 JS_ALWAYS_INLINE bool
 date_setYear_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     /* Step 1. */
     double t = ThisLocalTimeOrZero(thisObj, &cx->dstOffsetCache);
 
     /* Step 2. */
     double y;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &y))
         return false;
@@ -2837,17 +2837,17 @@ ToLocaleStringHelper(JSContext *cx, Call
 }
 
 /* ES5 15.9.5.5. */
 JS_ALWAYS_INLINE bool
 date_toLocaleString_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
     return ToLocaleStringHelper(cx, args, thisObj);
 }
 
 static JSBool
 date_toLocaleString(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_toLocaleString_impl>(cx, args);
@@ -2866,50 +2866,50 @@ date_toLocaleDateString_impl(JSContext *
     static const char format[] =
 #if defined(_WIN32) && !defined(__MWERKS__)
                                    "%#x"
 #else
                                    "%x"
 #endif
                                    ;
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
     return ToLocaleHelper(cx, args, thisObj, format);
 }
 
 static JSBool
 date_toLocaleDateString(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_toLocaleDateString_impl>(cx, args);
 }
 
 /* ES5 15.9.5.7. */
 JS_ALWAYS_INLINE bool
 date_toLocaleTimeString_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
     return ToLocaleHelper(cx, args, thisObj, "%X");
 }
 
 static JSBool
 date_toLocaleTimeString(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_toLocaleTimeString_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_toLocaleFormat_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     if (args.length() == 0)
         return ToLocaleStringHelper(cx, args, thisObj);
 
     JSString *fmt = ToString(cx, args[0]);
     if (!fmt)
         return false;
 
@@ -3006,17 +3006,17 @@ date_toString(JSContext *cx, unsigned ar
     return CallNonGenericMethod<IsDate, date_toString_impl>(cx, args);
 }
 
 JS_ALWAYS_INLINE bool
 date_valueOf_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
-    Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
+    RootedObject thisObj(cx, &args.thisv().toObject());
 
     args.rval().set(thisObj->getDateUTCTime());
     return true;
 }
 
 static JSBool
 date_valueOf(JSContext *cx, unsigned argc, Value *vp)
 {