Bug 956553 - Remove js::IdToJsval in favour of js::IdToValue; r=luke
authorMs2ger <ms2ger@gmail.com>
Mon, 20 Jan 2014 08:58:27 +0100
changeset 180258 99fcc73aad53fd3f81e6c44c44047ae6467ce67e
parent 180257 61875c765ea1c0129a4e166e47a919c867381ec8
child 180259 f2d8bb102e05b307d7cb85eaae66ebdab84119ad
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs956553
milestone29.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 956553 - Remove js::IdToJsval in favour of js::IdToValue; r=luke
js/src/builtin/TypedObject.cpp
js/src/jsapi.cpp
js/src/jsfriendapi.h
js/src/vm/OldDebugAPI.cpp
js/xpconnect/src/XPCQuickStubs.h
--- a/js/src/builtin/TypedObject.cpp
+++ b/js/src/builtin/TypedObject.cpp
@@ -893,17 +893,17 @@ StructType::layout(JSContext *cx, Handle
     RootedValue fieldTypeVal(cx);
     RootedId id(cx);
     for (unsigned int i = 0; i < ids.length(); i++) {
         id = ids[i];
 
         // Check that all the property names are non-numeric strings.
         uint32_t unused;
         if (!JSID_IS_ATOM(id) || JSID_TO_ATOM(id)->isIndex(&unused)) {
-            RootedValue idValue(cx, IdToJsval(id));
+            RootedValue idValue(cx, IdToValue(id));
             ReportCannotConvertTo(cx, idValue, "StructType field name");
             return false;
         }
 
         if (!fieldNames.append(JSID_TO_ATOM(id)->asPropertyName())) {
             js_ReportOutOfMemory(cx);
             return false;
         }
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -2234,17 +2234,17 @@ JS_ValueToId(JSContext *cx, jsval valueA
     return ValueToId<CanGC>(cx, value, idp);
 }
 
 JS_PUBLIC_API(bool)
 JS_IdToValue(JSContext *cx, jsid id, MutableHandleValue vp)
 {
     AssertHeapIsIdle(cx);
     CHECK_REQUEST(cx);
-    vp.set(IdToJsval(id));
+    vp.set(IdToValue(id));
     assertSameCompartment(cx, vp);
     return true;
 }
 
 JS_PUBLIC_API(bool)
 JS_DefaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp)
 {
     AssertHeapIsIdle(cx);
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -1761,22 +1761,16 @@ IdToValue(jsid id)
     if (JS_LIKELY(JSID_IS_INT(id)))
         return JS::Int32Value(JSID_TO_INT(id));
     if (JS_LIKELY(JSID_IS_OBJECT(id)))
         return JS::ObjectValue(*JSID_TO_OBJECT(id));
     JS_ASSERT(JSID_IS_VOID(id));
     return JS::UndefinedValue();
 }
 
-static JS_ALWAYS_INLINE jsval
-IdToJsval(jsid id)
-{
-    return IdToValue(id);
-}
-
 extern JS_FRIEND_API(bool)
 IsReadOnlyDateMethod(JS::IsAcceptableThis test, JS::NativeImpl method);
 
 extern JS_FRIEND_API(bool)
 IsTypedArrayThisCheck(JS::IsAcceptableThis test);
 
 /*
  * If the embedder has registered a default JSContext callback, returns the
--- a/js/src/vm/OldDebugAPI.cpp
+++ b/js/src/vm/OldDebugAPI.cpp
@@ -622,17 +622,17 @@ JS_SetDestroyScriptHook(JSRuntime *rt, J
 /***************************************************************************/
 
 /* This all should be reworked to avoid requiring JSScopeProperty types. */
 
 static bool
 GetPropertyDesc(JSContext *cx, JSObject *obj_, HandleShape shape, JSPropertyDesc *pd)
 {
     assertSameCompartment(cx, obj_);
-    pd->id = IdToJsval(shape->propid());
+    pd->id = IdToValue(shape->propid());
 
     RootedObject obj(cx, obj_);
 
     bool wasThrowing = cx->isExceptionPending();
     RootedValue lastException(cx, UndefinedValue());
     if (wasThrowing) {
         if (!cx->getPendingException(&lastException))
             return false;
--- a/js/xpconnect/src/XPCQuickStubs.h
+++ b/js/xpconnect/src/XPCQuickStubs.h
@@ -638,13 +638,13 @@ GeneratePropertyOp(JSContext *cx, JS::Ha
         return nullptr;
     Op *popp = new Op;
     if (!popp)
         return nullptr;
     *popp = pop;
     JS_SetPrivate(ptrobj, popp);
 
     js::SetFunctionNativeReserved(funobj, 0, OBJECT_TO_JSVAL(ptrobj));
-    js::SetFunctionNativeReserved(funobj, 1, js::IdToJsval(id));
+    js::SetFunctionNativeReserved(funobj, 1, js::IdToValue(id));
     return funobj;
 }
 
 #endif /* xpcquickstubs_h___ */