Bug 793076 (part 1) - Remove unnecessary |cx| parameters. r=jwalden.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 20 Sep 2012 21:41:49 -0700
changeset 115892 167c2ac56d02cc60fec4419c748af7aea34fec1e
parent 115891 7abf134ad3409ca01c6600e0dc3fe4053d4dc3e8
child 115893 c11ad1bccb45e9aa71bab0eeb6fec3b44de16898
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [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 1) - Remove unnecessary |cx| parameters. r=jwalden.
dom/devicestorage/nsDeviceStorage.cpp
dom/indexedDB/Key.cpp
dom/sms/src/SmsFilter.cpp
dom/sms/src/SmsMessage.cpp
dom/time/TimeManager.cpp
js/src/jsclone.cpp
js/src/jsdate.cpp
js/src/jsdate.h
js/src/jsfriendapi.h
js/src/prmjtime.cpp
js/src/prmjtime.h
storage/src/mozStoragePrivateHelpers.cpp
--- a/dom/devicestorage/nsDeviceStorage.cpp
+++ b/dom/devicestorage/nsDeviceStorage.cpp
@@ -2000,18 +2000,18 @@ static PRTime
 ExtractDateFromOptions(JSContext* aCx, const JS::Value& aOptions)
 {
   PRTime result = 0;
   DeviceStorageEnumerationParameters params;
   if (!JSVAL_IS_VOID(aOptions) && !aOptions.isNull()) {
     nsresult rv = params.Init(aCx, &aOptions);
     if (NS_SUCCEEDED(rv) && !JSVAL_IS_VOID(params.since) && !params.since.isNull() && params.since.isObject()) {
       JSObject* obj = JSVAL_TO_OBJECT(params.since);
-      if (JS_ObjectIsDate(aCx, obj) && js_DateIsValid(aCx, obj)) {
-        result = js_DateGetMsecSinceEpoch(aCx, obj);
+      if (JS_ObjectIsDate(aCx, obj) && js_DateIsValid(obj)) {
+        result = js_DateGetMsecSinceEpoch(obj);
       }
     }
   }
   return result;
 }
 
 nsresult
 nsDOMDeviceStorage::EnumerateInternal(const JS::Value & aName,
--- a/dom/indexedDB/Key.cpp
+++ b/dom/indexedDB/Key.cpp
@@ -165,20 +165,20 @@ Key::EncodeJSValInternal(JSContext* aCx,
       }
 
       mBuffer.Append(eTerminator + aTypeOffset);
 
       return NS_OK;
     }
 
     if (JS_ObjectIsDate(aCx, obj)) {
-      if (!js_DateIsValid(aCx, obj))  {
+      if (!js_DateIsValid(obj))  {
         return NS_ERROR_DOM_INDEXEDDB_DATA_ERR;
       }
-      EncodeNumber(js_DateGetMsecSinceEpoch(aCx, obj), eDate + aTypeOffset);
+      EncodeNumber(js_DateGetMsecSinceEpoch(obj), eDate + aTypeOffset);
       return NS_OK;
     }
   }
 
   return NS_ERROR_DOM_INDEXEDDB_DATA_ERR;
 }
 
 // static
--- a/dom/sms/src/SmsFilter.cpp
+++ b/dom/sms/src/SmsFilter.cpp
@@ -75,17 +75,17 @@ SmsFilter::SetStartDate(JSContext* aCx, 
     return NS_ERROR_INVALID_ARG;
   }
 
   JSObject& obj = aStartDate.toObject();
   if (!JS_ObjectIsDate(aCx, &obj)) {
     return NS_ERROR_INVALID_ARG;
   }
 
-  mData.startDate() = js_DateGetMsecSinceEpoch(aCx, &obj);
+  mData.startDate() = js_DateGetMsecSinceEpoch(&obj);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 SmsFilter::GetEndDate(JSContext* aCx, jsval* aEndDate)
 {
   if (mData.endDate() == 0) {
     *aEndDate = JSVAL_NULL;
@@ -110,17 +110,17 @@ SmsFilter::SetEndDate(JSContext* aCx, co
     return NS_ERROR_INVALID_ARG;
   }
 
   JSObject& obj = aEndDate.toObject();
   if (!JS_ObjectIsDate(aCx, &obj)) {
     return NS_ERROR_INVALID_ARG;
   }
 
-  mData.endDate() = js_DateGetMsecSinceEpoch(aCx, &obj);
+  mData.endDate() = js_DateGetMsecSinceEpoch(&obj);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 SmsFilter::GetNumbers(JSContext* aCx, jsval* aNumbers)
 {
   uint32_t length = mData.numbers().Length();
 
--- a/dom/sms/src/SmsMessage.cpp
+++ b/dom/sms/src/SmsMessage.cpp
@@ -67,17 +67,17 @@ SmsMessage::Create(int32_t aId,
   }
 
   // We support both a Date object and a millisecond timestamp as a number.
   if (aTimestamp.isObject()) {
     JSObject& obj = aTimestamp.toObject();
     if (!JS_ObjectIsDate(aCx, &obj)) {
       return NS_ERROR_INVALID_ARG;
     }
-    data.timestamp() = js_DateGetMsecSinceEpoch(aCx, &obj);
+    data.timestamp() = js_DateGetMsecSinceEpoch(&obj);
   } else {
     if (!aTimestamp.isNumber()) {
       return NS_ERROR_INVALID_ARG;
     }
     double number = aTimestamp.toNumber();
     if (static_cast<uint64_t>(number) != number) {
       return NS_ERROR_INVALID_ARG;
     }
--- a/dom/time/TimeManager.cpp
+++ b/dom/time/TimeManager.cpp
@@ -24,22 +24,22 @@ NS_IMPL_RELEASE(TimeManager)
 
 nsresult
 TimeManager::Set(const JS::Value& date, JSContext* ctx) {
   double dateMSec;
 
   if (date.isObject()) {
     JSObject* dateObj = JSVAL_TO_OBJECT(date);
 
-    if (JS_ObjectIsDate(ctx, dateObj) && js_DateIsValid(ctx, dateObj)) {
-      dateMSec = js_DateGetMsecSinceEpoch(ctx, dateObj);
+    if (JS_ObjectIsDate(ctx, dateObj) && js_DateIsValid(dateObj)) {
+      dateMSec = js_DateGetMsecSinceEpoch(dateObj);
     }
     else {
       NS_WARN_IF_FALSE(JS_ObjectIsDate(ctx, dateObj), "This is not a Date object");
-      NS_WARN_IF_FALSE(js_DateIsValid(ctx, dateObj), "Date is not valid");
+      NS_WARN_IF_FALSE(js_DateIsValid(dateObj), "Date is not valid");
       return NS_ERROR_INVALID_ARG;
     }
   } else if (date.isNumber()) {
     dateMSec = date.toNumber();
   } else {
     return NS_ERROR_INVALID_ARG;
   }
 
--- a/js/src/jsclone.cpp
+++ b/js/src/jsclone.cpp
@@ -681,17 +681,17 @@ JSStructuredCloneWriter::startWrite(cons
         if (backref)
             return true;
 
         if (obj->isRegExp()) {
             RegExpObject &reobj = obj->asRegExp();
             return out.writePair(SCTAG_REGEXP_OBJECT, reobj.getFlags()) &&
                    writeString(SCTAG_STRING, reobj.getSource());
         } else if (obj->isDate()) {
-            double d = js_DateGetMsecSinceEpoch(context(), obj);
+            double d = js_DateGetMsecSinceEpoch(obj);
             return out.writePair(SCTAG_DATE_OBJECT, 0) && out.writeDouble(d);
         } else if (obj->isTypedArray()) {
             return writeTypedArray(obj);
         } else if (obj->isArrayBuffer() && obj->asArrayBuffer().hasData()) {
             return writeArrayBuffer(obj);
         } else if (obj->isObject() || obj->isArray()) {
             return traverseObject(obj);
         } else if (obj->isBoolean()) {
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -432,17 +432,17 @@ DaylightSavingTA(double t, JSContext *cx
      */
     if (t < 0.0 || t > 2145916800000.0) {
         int year = EquivalentYearForDST(int(YearFromTime(t)));
         double day = MakeDay(year, MonthFromTime(t), DateFromTime(t));
         t = MakeDate(day, TimeWithinDay(t));
     }
 
     int64_t timeMilliseconds = static_cast<int64_t>(t);
-    int64_t offsetMilliseconds = cx->dstOffsetCache.getDSTOffsetMilliseconds(timeMilliseconds, cx);
+    int64_t offsetMilliseconds = cx->dstOffsetCache.getDSTOffsetMilliseconds(timeMilliseconds);
     return static_cast<double>(offsetMilliseconds);
 }
 
 static double
 AdjustTime(double date, JSContext *cx)
 {
     double t = DaylightSavingTA(date, cx) + LocalTZA;
     t = (LocalTZA >= 0) ? fmod(t, msPerDay) : -fmod(msPerDay - t, msPerDay);
@@ -1260,37 +1260,36 @@ date_now(JSContext *cx, unsigned argc, V
     vp->setDouble(NowAsMillis());
     return JS_TRUE;
 }
 
 /*
  * Set UTC time to a given time and invalidate cached local time.
  */
 static JSBool
-SetUTCTime(JSContext *cx, JSObject *obj, double t, Value *vp = NULL)
+SetUTCTime(JSObject *obj, double t, Value *vp = NULL)
 {
     JS_ASSERT(obj->isDate());
 
     for (size_t ind = JSObject::JSSLOT_DATE_COMPONENTS_START;
          ind < JSObject::DATE_CLASS_RESERVED_SLOTS;
          ind++) {
         obj->setSlot(ind, UndefinedValue());
     }
 
     obj->setDateUTCTime(DoubleValue(t));
     if (vp)
         vp->setDouble(t);
     return true;
 }
 
 static void
-SetDateToNaN(JSContext *cx, JSObject *obj, Value *vp = NULL)
+SetDateToNaN(JSObject *obj, Value *vp = NULL)
 {
-    double NaN = cx->runtime->NaNValue.getDoubleRef();
-    SetUTCTime(cx, obj, NaN, vp);
+    SetUTCTime(obj, js_NaN, vp);
 }
 
 /*
  * Cache the local time, year, month, and so forth of the object.
  * If UTC time is not finite (e.g., NaN), the local time
  * slots will be set to the UTC time without conversion.
  */
 static bool
@@ -1804,25 +1803,25 @@ date_getTimezoneOffset(JSContext *cx, un
 
 JS_ALWAYS_INLINE bool
 date_setTime_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
     Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
     if (args.length() == 0) {
-        SetDateToNaN(cx, thisObj, args.rval().address());
+        SetDateToNaN(thisObj, args.rval().address());
         return true;
     }
 
     double result;
     if (!ToNumber(cx, args[0], &result))
         return false;
 
-    return SetUTCTime(cx, thisObj, TimeClip(result), args.rval().address());
+    return SetUTCTime(thisObj, TimeClip(result), args.rval().address());
 }
 
 static JSBool
 date_setTime(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_setTime_impl>(cx, args);
 }
@@ -1873,17 +1872,17 @@ date_setMilliseconds_impl(JSContext *cx,
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &milli))
         return false;
     double time = MakeTime(HourFromTime(t), MinFromTime(t), SecFromTime(t), milli);
 
     /* Step 3. */
     double u = TimeClip(UTC(MakeDate(Day(t), time), cx));
 
     /* Steps 4-5. */
-    return SetUTCTime(cx, thisObj, u, args.rval().address());
+    return SetUTCTime(thisObj, u, args.rval().address());
 }
 
 static JSBool
 date_setMilliseconds(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_setMilliseconds_impl>(cx, args);
 }
@@ -1904,17 +1903,17 @@ date_setUTCMilliseconds_impl(JSContext *
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &milli))
         return false;
     double time = MakeTime(HourFromTime(t), MinFromTime(t), SecFromTime(t), milli);
 
     /* Step 3. */
     double v = TimeClip(MakeDate(Day(t), time));
 
     /* Steps 4-5. */
-    return SetUTCTime(cx, thisObj, v, args.rval().address());
+    return SetUTCTime(thisObj, v, args.rval().address());
 }
 
 static JSBool
 date_setUTCMilliseconds(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_setUTCMilliseconds_impl>(cx, args);
 }
@@ -1942,17 +1941,17 @@ date_setSeconds_impl(JSContext *cx, Call
 
     /* Step 4. */
     double date = MakeDate(Day(t), MakeTime(HourFromTime(t), MinFromTime(t), s, milli));
 
     /* Step 5. */
     double u = TimeClip(UTC(date, cx));
 
     /* Steps 6-7. */
-    return SetUTCTime(cx, thisObj, u, args.rval().address());
+    return SetUTCTime(thisObj, u, args.rval().address());
 }
 
 /* ES5 15.9.5.31. */
 static JSBool
 date_setSeconds(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_setSeconds_impl>(cx, args);
@@ -1980,17 +1979,17 @@ date_setUTCSeconds_impl(JSContext *cx, C
 
     /* Step 4. */
     double date = MakeDate(Day(t), MakeTime(HourFromTime(t), MinFromTime(t), s, milli));
 
     /* Step 5. */
     double v = TimeClip(date);
 
     /* Steps 6-7. */
-    return SetUTCTime(cx, thisObj, v, args.rval().address());
+    return SetUTCTime(thisObj, v, args.rval().address());
 }
 
 /* ES5 15.9.5.32. */
 static JSBool
 date_setUTCSeconds(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_setUTCSeconds_impl>(cx, args);
@@ -2023,17 +2022,17 @@ date_setMinutes_impl(JSContext *cx, Call
 
     /* Step 5. */
     double date = MakeDate(Day(t), MakeTime(HourFromTime(t), m, s, milli));
 
     /* Step 6. */
     double u = TimeClip(UTC(date, cx));
 
     /* Steps 7-8. */
-    return SetUTCTime(cx, thisObj, u, args.rval().address());
+    return SetUTCTime(thisObj, u, args.rval().address());
 }
 
 /* ES5 15.9.5.33. */
 static JSBool
 date_setMinutes(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_setMinutes_impl>(cx, args);
@@ -2066,17 +2065,17 @@ date_setUTCMinutes_impl(JSContext *cx, C
 
     /* Step 5. */
     double date = MakeDate(Day(t), MakeTime(HourFromTime(t), m, s, milli));
 
     /* Step 6. */
     double v = TimeClip(date);
 
     /* Steps 7-8. */
-    return SetUTCTime(cx, thisObj, v, args.rval().address());
+    return SetUTCTime(thisObj, v, args.rval().address());
 }
 
 /* ES5 15.9.5.34. */
 static JSBool
 date_setUTCMinutes(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_setUTCMinutes_impl>(cx, args);
@@ -2114,17 +2113,17 @@ date_setHours_impl(JSContext *cx, CallAr
 
     /* Step 6. */
     double date = MakeDate(Day(t), MakeTime(h, m, s, milli));
 
     /* Step 6. */
     double u = TimeClip(UTC(date, cx));
 
     /* Steps 7-8. */
-    return SetUTCTime(cx, thisObj, u, args.rval().address());
+    return SetUTCTime(thisObj, u, args.rval().address());
 }
 
 /* ES5 15.9.5.35. */
 static JSBool
 date_setHours(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_setHours_impl>(cx, args);
@@ -2162,17 +2161,17 @@ date_setUTCHours_impl(JSContext *cx, Cal
 
     /* Step 6. */
     double newDate = MakeDate(Day(t), MakeTime(h, m, s, milli));
 
     /* Step 7. */
     double v = TimeClip(newDate);
 
     /* Steps 8-9. */
-    return SetUTCTime(cx, thisObj, v, args.rval().address());
+    return SetUTCTime(thisObj, v, args.rval().address());
 }
 
 /* ES5 15.9.5.36. */
 static JSBool
 date_setUTCHours(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_setUTCHours_impl>(cx, args);
@@ -2195,17 +2194,17 @@ date_setDate_impl(JSContext *cx, CallArg
 
     /* Step 3. */
     double newDate = MakeDate(MakeDay(YearFromTime(t), MonthFromTime(t), dt), TimeWithinDay(t));
 
     /* Step 4. */
     double u = TimeClip(UTC(newDate, cx));
 
     /* Steps 5-6. */
-    return SetUTCTime(cx, thisObj, u, args.rval().address());
+    return SetUTCTime(thisObj, u, args.rval().address());
 }
 
 /* ES5 15.9.5.37. */
 static JSBool
 date_setDate(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_setDate_impl>(cx, args);
@@ -2228,17 +2227,17 @@ date_setUTCDate_impl(JSContext *cx, Call
 
     /* Step 3. */
     double newDate = MakeDate(MakeDay(YearFromTime(t), MonthFromTime(t), dt), TimeWithinDay(t));
 
     /* Step 4. */
     double v = TimeClip(newDate);
 
     /* Steps 5-6. */
-    return SetUTCTime(cx, thisObj, v, args.rval().address());
+    return SetUTCTime(thisObj, v, args.rval().address());
 }
 
 static JSBool
 date_setUTCDate(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_setUTCDate_impl>(cx, args);
 }
@@ -2286,17 +2285,17 @@ date_setMonth_impl(JSContext *cx, CallAr
 
     /* Step 4. */
     double newDate = MakeDate(MakeDay(YearFromTime(t), m, dt), TimeWithinDay(t));
 
     /* Step 5. */
     double u = TimeClip(UTC(newDate, cx));
 
     /* Steps 6-7. */
-    return SetUTCTime(cx, thisObj, u, args.rval().address());
+    return SetUTCTime(thisObj, u, args.rval().address());
 }
 
 static JSBool
 date_setMonth(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_setMonth_impl>(cx, args);
 }
@@ -2324,17 +2323,17 @@ date_setUTCMonth_impl(JSContext *cx, Cal
 
     /* Step 4. */
     double newDate = MakeDate(MakeDay(YearFromTime(t), m, dt), TimeWithinDay(t));
 
     /* Step 5. */
     double v = TimeClip(newDate);
 
     /* Steps 6-7. */
-    return SetUTCTime(cx, thisObj, v, args.rval().address());
+    return SetUTCTime(thisObj, v, args.rval().address());
 }
 
 static JSBool
 date_setUTCMonth(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_setUTCMonth_impl>(cx, args);
 }
@@ -2383,17 +2382,17 @@ date_setFullYear_impl(JSContext *cx, Cal
 
     /* Step 5. */
     double newDate = MakeDate(MakeDay(y, m, dt), TimeWithinDay(t));
 
     /* Step 6. */
     double u = TimeClip(UTC(newDate, cx));
 
     /* Steps 7-8. */
-    return SetUTCTime(cx, thisObj, u, args.rval().address());
+    return SetUTCTime(thisObj, u, args.rval().address());
 }
 
 static JSBool
 date_setFullYear(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_setFullYear_impl>(cx, args);
 }
@@ -2426,17 +2425,17 @@ date_setUTCFullYear_impl(JSContext *cx, 
 
     /* Step 5. */
     double newDate = MakeDate(MakeDay(y, m, dt), TimeWithinDay(t));
 
     /* Step 6. */
     double v = TimeClip(newDate);
 
     /* Steps 7-8. */
-    return SetUTCTime(cx, thisObj, v, args.rval().address());
+    return SetUTCTime(thisObj, v, args.rval().address());
 }
 
 static JSBool
 date_setUTCFullYear(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_setUTCFullYear_impl>(cx, args);
 }
@@ -2454,33 +2453,33 @@ date_setYear_impl(JSContext *cx, CallArg
 
     /* Step 2. */
     double y;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &y))
         return false;
 
     /* Step 3. */
     if (MOZ_DOUBLE_IS_NaN(y)) {
-        SetDateToNaN(cx, thisObj, args.rval().address());
+        SetDateToNaN(thisObj, args.rval().address());
         return true;
     }
 
     /* Step 4. */
     double yint = ToInteger(y);
     if (0 <= yint && yint <= 99)
         yint += 1900;
 
     /* Step 5. */
     double day = MakeDay(yint, MonthFromTime(t), DateFromTime(t));
 
     /* Step 6. */
     double u = UTC(MakeDate(day, TimeWithinDay(t)), cx);
 
     /* Steps 7-8. */
-    return SetUTCTime(cx, thisObj, TimeClip(u), args.rval().address());
+    return SetUTCTime(thisObj, TimeClip(u), args.rval().address());
 }
 
 static JSBool
 date_setYear(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_setYear_impl>(cx, args);
 }
@@ -3153,17 +3152,17 @@ js_InitDateClass(JSContext *cx, HandleOb
 
     UpdateLocalTZA();
 
     Rooted<GlobalObject*> global(cx, &obj->asGlobal());
 
     RootedObject dateProto(cx, global->createBlankPrototype(cx, &DateClass));
     if (!dateProto)
         return NULL;
-    SetDateToNaN(cx, dateProto);
+    SetDateToNaN(dateProto);
 
     RootedFunction ctor(cx);
     ctor = global->createConstructor(cx, js_Date, cx->names().Date, MAXARGS);
     if (!ctor)
         return NULL;
 
     if (!LinkConstructorAndPrototype(cx, ctor, dateProto))
         return NULL;
@@ -3195,17 +3194,17 @@ js_InitDateClass(JSContext *cx, HandleOb
 }
 
 JS_FRIEND_API(JSObject *)
 js_NewDateObjectMsec(JSContext *cx, double msec_time)
 {
     JSObject *obj = NewBuiltinClassInstance(cx, &DateClass);
     if (!obj)
         return NULL;
-    if (!SetUTCTime(cx, obj, msec_time))
+    if (!SetUTCTime(obj, msec_time))
         return NULL;
     return obj;
 }
 
 JS_FRIEND_API(JSObject *)
 js_NewDateObject(JSContext* cx, int year, int mon, int mday,
                  int hour, int min, int sec)
 {
@@ -3220,17 +3219,17 @@ js_NewDateObject(JSContext* cx, int year
 
 void
 js_ClearDateCaches()
 {
     UpdateLocalTZA();
 }
 
 JS_FRIEND_API(JSBool)
-js_DateIsValid(JSContext *cx, JSObject* obj)
+js_DateIsValid(JSObject* obj)
 {
     return obj->isDate() && !MOZ_DOUBLE_IS_NaN(obj->getDateUTCTime().toNumber());
 }
 
 JS_FRIEND_API(int)
 js_DateGetYear(JSContext *cx, JSObject* obj)
 {
     double localtime;
@@ -3282,25 +3281,25 @@ js_DateGetMinutes(JSContext *cx, JSObjec
 
     if (!GetCachedLocalTime(cx, obj, &localtime) || MOZ_DOUBLE_IS_NaN(localtime))
         return 0;
 
     return (int) MinFromTime(localtime);
 }
 
 JS_FRIEND_API(int)
-js_DateGetSeconds(JSContext *cx, JSObject* obj)
+js_DateGetSeconds(JSObject* obj)
 {
     if (!obj->isDate())
         return 0;
 
     double utctime = obj->getDateUTCTime().toNumber();
     if (MOZ_DOUBLE_IS_NaN(utctime))
         return 0;
     return (int) SecFromTime(utctime);
 }
 
 JS_FRIEND_API(double)
-js_DateGetMsecSinceEpoch(JSContext *cx, RawObject obj)
+js_DateGetMsecSinceEpoch(RawObject obj)
 {
     return obj->isDate() ? obj->getDateUTCTime().toNumber() : 0;
 }
 
--- a/js/src/jsdate.h
+++ b/js/src/jsdate.h
@@ -79,15 +79,15 @@ js_DateGetDate(JSContext *cx, JSObject* 
 
 extern JS_FRIEND_API(int)
 js_DateGetHours(JSContext *cx, JSObject* obj);
 
 extern JS_FRIEND_API(int)
 js_DateGetMinutes(JSContext *cx, JSObject* obj);
 
 extern JS_FRIEND_API(int)
-js_DateGetSeconds(JSContext *cx, JSObject* obj);
+js_DateGetSeconds(JSObject* obj);
 
 /* Date constructor native. Exposed only so the JIT can know its address. */
 JSBool
 js_Date(JSContext *cx, unsigned argc, js::Value *vp);
 
 #endif /* jsdate_h___ */
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -968,20 +968,20 @@ uint32_t GetListBaseExpandoSlot();
 
 /* Implemented in jsdate.cpp. */
 
 /*
  * Detect whether the internal date value is NaN.  (Because failure is
  * out-of-band for js_DateGet*)
  */
 extern JS_FRIEND_API(JSBool)
-js_DateIsValid(JSContext *cx, JSObject* obj);
+js_DateIsValid(JSObject* obj);
 
 extern JS_FRIEND_API(double)
-js_DateGetMsecSinceEpoch(JSContext *cx, JSRawObject obj);
+js_DateGetMsecSinceEpoch(JSRawObject obj);
 
 /* Implemented in jscntxt.cpp. */
 
 /*
  * Report an exception, which is currently realized as a printf-style format
  * string and its arguments.
  */
 typedef enum JSErrNum {
--- a/js/src/prmjtime.cpp
+++ b/js/src/prmjtime.cpp
@@ -633,17 +633,17 @@ DSTOffsetCache::computeDSTOffsetMillisec
 
     if (diff < 0)
         diff += SECONDS_PER_DAY;
 
     return diff * MILLISECONDS_PER_SECOND;
 }
 
 int64_t
-DSTOffsetCache::getDSTOffsetMilliseconds(int64_t localTimeMilliseconds, JSContext *cx)
+DSTOffsetCache::getDSTOffsetMilliseconds(int64_t localTimeMilliseconds)
 {
     sanityCheck();
 
     int64_t localTimeSeconds = localTimeMilliseconds / MILLISECONDS_PER_SECOND;
 
     if (localTimeSeconds > MAX_UNIX_TIMET) {
         localTimeSeconds = MAX_UNIX_TIMET;
     } else if (localTimeSeconds < 0) {
--- a/js/src/prmjtime.h
+++ b/js/src/prmjtime.h
@@ -53,17 +53,17 @@ struct JSContext;
  * a balance between these two that tries to optimize for the calendar month at
  * a time that a site might display.  (One could imagine an adaptive duration
  * that accommodates near-DST-change dates better; we don't believe the
  * potential win from better caching offsets the loss from extra complexity.)
  */
 class DSTOffsetCache {
   public:
     inline DSTOffsetCache();
-    int64_t getDSTOffsetMilliseconds(int64_t localTimeMilliseconds, JSContext *cx);
+    int64_t getDSTOffsetMilliseconds(int64_t localTimeMilliseconds);
 
     inline void purge();
 
   private:
     int64_t computeDSTOffsetMilliseconds(int64_t localTimeSeconds);
 
     int64_t offsetMilliseconds;
     int64_t rangeStartSeconds, rangeEndSeconds;
--- a/storage/src/mozStoragePrivateHelpers.cpp
+++ b/storage/src/mozStoragePrivateHelpers.cpp
@@ -132,20 +132,20 @@ convertJSValToVariant(
     return new IntegerVariant(aValue.isTrue() ? 1 : 0);
 
   if (aValue.isNull())
     return new NullVariant();
 
   if (aValue.isObject()) {
     JSObject* obj = &aValue.toObject();
     // We only support Date instances, all others fail.
-    if (!::js_DateIsValid(aCtx, obj))
+    if (!::js_DateIsValid(obj))
       return nullptr;
 
-    double msecd = ::js_DateGetMsecSinceEpoch(aCtx, obj);
+    double msecd = ::js_DateGetMsecSinceEpoch(obj);
     msecd *= 1000.0;
     int64_t msec;
     LL_D2L(msec, msecd);
 
     return new IntegerVariant(msec);
   }
 
   return nullptr;