Bug 1079231: Use templated CallNonGenericMethod whenever possible; r=jorendorff
☠☠ backed out by 62491e20145f ☠ ☠
authorBenjamin Bouvier <benj@benj.me>
Mon, 13 Oct 2014 17:24:55 +0200
changeset 210180 b8b6fa54fc1a4985df204c936ffbe2e3efb0d685
parent 210179 f7ccff28c96f0d3f9e39fded1319d65e5cf6c826
child 210181 4b8b34a91096b9048b7dfd27eb16ff6be07b32fa
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjorendorff
bugs1079231
milestone35.0a1
Bug 1079231: Use templated CallNonGenericMethod whenever possible; r=jorendorff
js/src/builtin/MapObject.cpp
js/src/builtin/RegExp.cpp
js/src/vm/SharedTypedArrayObject.cpp
--- a/js/src/builtin/MapObject.cpp
+++ b/js/src/builtin/MapObject.cpp
@@ -996,17 +996,17 @@ MapIteratorObject::next_impl(JSContext *
 
     return true;
 }
 
 bool
 MapIteratorObject::next(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    return CallNonGenericMethod(cx, is, next_impl, args);
+    return CallNonGenericMethod<MapIteratorObject::is, MapIteratorObject::next_impl>(cx, args);
 }
 
 
 /*** Map *****************************************************************************************/
 
 const Class MapObject::class_ = {
     "Map",
     JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
@@ -1427,43 +1427,43 @@ MapObject::keys_impl(JSContext *cx, Call
 {
     return iterator_impl(cx, args, Keys);
 }
 
 bool
 MapObject::keys(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    return CallNonGenericMethod(cx, is, keys_impl, args);
+    return CallNonGenericMethod<MapObject::is, MapObject::keys_impl>(cx, args);
 }
 
 bool
 MapObject::values_impl(JSContext *cx, CallArgs args)
 {
     return iterator_impl(cx, args, Values);
 }
 
 bool
 MapObject::values(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    return CallNonGenericMethod(cx, is, values_impl, args);
+    return CallNonGenericMethod<MapObject::is, MapObject::values_impl>(cx, args);
 }
 
 bool
 MapObject::entries_impl(JSContext *cx, CallArgs args)
 {
     return iterator_impl(cx, args, Entries);
 }
 
 bool
 MapObject::entries(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    return CallNonGenericMethod(cx, is, entries_impl, args);
+    return CallNonGenericMethod<MapObject::is, MapObject::entries_impl>(cx, args);
 }
 
 bool
 MapObject::clear_impl(JSContext *cx, CallArgs args)
 {
     Rooted<MapObject*> mapobj(cx, &args.thisv().toObject().as<MapObject>());
     if (!mapobj->getData()->clear()) {
         js_ReportOutOfMemory(cx);
@@ -1472,17 +1472,17 @@ MapObject::clear_impl(JSContext *cx, Cal
     args.rval().setUndefined();
     return true;
 }
 
 bool
 MapObject::clear(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    return CallNonGenericMethod(cx, is, clear_impl, args);
+    return CallNonGenericMethod<MapObject::is, MapObject::clear_impl>(cx, args);
 }
 
 JSObject *
 js_InitMapClass(JSContext *cx, HandleObject obj)
 {
     return MapObject::initClass(cx, obj);
 }
 
@@ -1641,17 +1641,17 @@ SetIteratorObject::next_impl(JSContext *
 
     return true;
 }
 
 bool
 SetIteratorObject::next(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    return CallNonGenericMethod(cx, is, next_impl, args);
+    return CallNonGenericMethod<SetIteratorObject::is, SetIteratorObject::next_impl>(cx, args);
 }
 
 
 /*** Set *****************************************************************************************/
 
 const Class SetObject::class_ = {
     "Set",
     JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
@@ -1925,30 +1925,30 @@ SetObject::values_impl(JSContext *cx, Ca
 {
     return iterator_impl(cx, args, Values);
 }
 
 bool
 SetObject::values(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    return CallNonGenericMethod(cx, is, values_impl, args);
+    return CallNonGenericMethod<SetObject::is, SetObject::values_impl>(cx, args);
 }
 
 bool
 SetObject::entries_impl(JSContext *cx, CallArgs args)
 {
     return iterator_impl(cx, args, Entries);
 }
 
 bool
 SetObject::entries(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    return CallNonGenericMethod(cx, is, entries_impl, args);
+    return CallNonGenericMethod<SetObject::is, SetObject::entries_impl>(cx, args);
 }
 
 bool
 SetObject::clear_impl(JSContext *cx, CallArgs args)
 {
     Rooted<SetObject*> setobj(cx, &args.thisv().toObject().as<SetObject>());
     if (!setobj->getData()->clear()) {
         js_ReportOutOfMemory(cx);
@@ -1957,17 +1957,17 @@ SetObject::clear_impl(JSContext *cx, Cal
     args.rval().setUndefined();
     return true;
 }
 
 bool
 SetObject::clear(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    return CallNonGenericMethod(cx, is, clear_impl, args);
+    return CallNonGenericMethod<SetObject::is, SetObject::clear_impl>(cx, args);
 }
 
 JSObject *
 js_InitSetClass(JSContext *cx, HandleObject obj)
 {
     return SetObject::initClass(cx, obj);
 }
 
--- a/js/src/builtin/RegExp.cpp
+++ b/js/src/builtin/RegExp.cpp
@@ -665,17 +665,17 @@ regexp_exec_impl(JSContext *cx, CallArgs
 
     return regexp_exec_impl(cx, regexp, string, UpdateRegExpStatics, args.rval());
 }
 
 bool
 js::regexp_exec(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    return CallNonGenericMethod(cx, IsRegExp, regexp_exec_impl, args);
+    return CallNonGenericMethod<IsRegExp, regexp_exec_impl>(cx, args);
 }
 
 /* Separate interface for use by IonMonkey. */
 bool
 js::regexp_exec_raw(JSContext *cx, HandleObject regexp, HandleString input,
                     MatchPairs *maybeMatches, MutableHandleValue output)
 {
     // The MatchPairs will always be passed in, but RegExp execution was
@@ -716,17 +716,17 @@ js::regexp_test_raw(JSContext *cx, Handl
     *result = (status == RegExpRunStatus_Success);
     return status != RegExpRunStatus_Error;
 }
 
 bool
 js::regexp_test(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    return CallNonGenericMethod(cx, IsRegExp, regexp_test_impl, args);
+    return CallNonGenericMethod<IsRegExp, regexp_test_impl>(cx, args);
 }
 
 bool
 js::regexp_test_no_statics(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     MOZ_ASSERT(args.length() == 2);
     MOZ_ASSERT(IsRegExp(args[0]));
--- a/js/src/vm/SharedTypedArrayObject.cpp
+++ b/js/src/vm/SharedTypedArrayObject.cpp
@@ -334,17 +334,17 @@ class SharedTypedArrayObjectTemplate : p
         args.rval().set(bufferValue(tarray));
         return true;
     }
 
     static bool
     BufferGetter(JSContext *cx, unsigned argc, Value *vp)
     {
         CallArgs args = CallArgsFromVp(argc, vp);
-        return CallNonGenericMethod(cx, is, BufferGetterImpl, args);
+        return CallNonGenericMethod<is, BufferGetterImpl>(cx, args);
     }
 
     // Define an accessor for a read-only property that invokes a native getter
     static bool
     DefineGetter(JSContext *cx, HandleNativeObject proto, PropertyName *name, Native native)
     {
         RootedId id(cx, NameToId(name));
         unsigned attrs = JSPROP_SHARED | JSPROP_GETTER;