Bug 952650 (part 17) - Remove JSVAL_IS_UNIVERSAL. r=till.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 28 Apr 2014 16:41:16 -0700
changeset 181307 2f2c7485b6a6b602952b4cb0d884aa756e3d15ef
parent 181306 697506d9c32459abcbf817fbf54fb793078d49d3
child 181308 51eaa71a1dfb92eb0677960ff82bd94c3a87da22
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewerstill
bugs952650
milestone32.0a1
Bug 952650 (part 17) - Remove JSVAL_IS_UNIVERSAL. r=till.
dom/workers/XMLHttpRequest.cpp
js/src/jsapi.h
--- a/dom/workers/XMLHttpRequest.cpp
+++ b/dom/workers/XMLHttpRequest.cpp
@@ -1155,17 +1155,17 @@ EventRunnable::PreDispatch(JSContext* aC
     if (mResponseText.IsVoid()) {
       mResponse = JSVAL_NULL;
     }
   }
   else {
     JS::Rooted<JS::Value> response(aCx);
     mResponseResult = xhr->GetResponse(aCx, &response);
     if (NS_SUCCEEDED(mResponseResult)) {
-      if (JSVAL_IS_UNIVERSAL(response)) {
+      if (!response.isGCThing()) {
         mResponse = response;
       }
       else {
         // Anything subject to GC must be cloned.
         JSStructuredCloneCallbacks* callbacks =
           aWorkerPrivate->IsChromeWorker() ?
           ChromeWorkerStructuredCloneCallbacks(true) :
           WorkerStructuredCloneCallbacks(true);
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -832,26 +832,16 @@ JS_StringHasBeenInterned(JSContext *cx, 
  * jsids by API clients.
  *
  * N.B. if a jsid is backed by a string which has not been interned, that
  * string must be appropriately rooted to avoid being collected by the GC.
  */
 JS_PUBLIC_API(jsid)
 INTERNED_STRING_TO_JSID(JSContext *cx, JSString *str);
 
-/*
- * Returns true iff the given jsval is immune to GC and can be used across
- * multiple JSRuntimes without requiring any conversion API.
- */
-static MOZ_ALWAYS_INLINE bool
-JSVAL_IS_UNIVERSAL(jsval v)
-{
-    return !v.isGCThing();
-}
-
 namespace JS {
 
 class AutoIdRooter : private AutoGCRooter
 {
   public:
     explicit AutoIdRooter(JSContext *cx, jsid aId = INT_TO_JSID(0)
                           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
       : AutoGCRooter(cx, ID), id_(aId)