Bug 684526 - Remove Jsvalify/Valueify (r=waldo)
authorLuke Wagner <luke@mozilla.com>
Tue, 20 Sep 2011 11:40:24 -0700
changeset 77787 5c29c2e922251dd88637360643cbc78b9b7c3888
parent 77786 4f9a7183a1973cde3e1804168272729ed4390537
child 77789 bc1b738b8a07b4894111f6a0579bb0b2b5fe5c53
push idunknown
push userunknown
push dateunknown
reviewerswaldo
bugs684526
milestone9.0a1
Bug 684526 - Remove Jsvalify/Valueify (r=waldo)
dom/src/json/nsJSON.cpp
js/ipc/ObjectWrapperParent.cpp
js/ipc/ObjectWrapperParent.h
js/src/Makefile.in
js/src/ctypes/CTypes.cpp
js/src/jsapi-tests/testArgumentsObject.cpp
js/src/jsapi-tests/testCustomIterator.cpp
js/src/jsapi-tests/testExtendedEq.cpp
js/src/jsapi.cpp
js/src/jsapi.h
js/src/jsarray.cpp
js/src/jsatom.h
js/src/jsbool.cpp
js/src/jsbuiltins.h
js/src/jsclass.h
js/src/jsclone.h
js/src/jscntxt.h
js/src/jscntxtinlines.h
js/src/jsdate.cpp
js/src/jsdbgapi.cpp
js/src/jsexn.cpp
js/src/jsfun.cpp
js/src/jsfun.h
js/src/jsgc.cpp
js/src/jsinfer.h
js/src/jsinterp.cpp
js/src/jsinterp.h
js/src/jsiter.cpp
js/src/jsmath.cpp
js/src/jsnum.cpp
js/src/jsnum.h
js/src/jsobj.cpp
js/src/jsobj.h
js/src/jsobjinlines.h
js/src/json.cpp
js/src/json.h
js/src/jsonparser.cpp
js/src/jsonparser.h
js/src/jsopcode.cpp
js/src/jsopcode.h
js/src/jsparse.cpp
js/src/jsproxy.cpp
js/src/jsprvtd.h
js/src/jsreflect.cpp
js/src/jsregexp.cpp
js/src/jsregexpinlines.h
js/src/jsscope.cpp
js/src/jsscope.h
js/src/jsscopeinlines.h
js/src/jsscript.cpp
js/src/jsstr.cpp
js/src/jsstr.h
js/src/jstracer.cpp
js/src/jstypedarray.cpp
js/src/jstypedarray.h
js/src/jstypedarrayinlines.h
js/src/jsvalue.h
js/src/jswatchpoint.cpp
js/src/jswatchpoint.h
js/src/jsweakmap.cpp
js/src/jswrapper.cpp
js/src/jsxml.cpp
js/src/methodjit/Compiler.cpp
js/src/methodjit/FrameEntry.h
js/src/methodjit/FrameState-inl.h
js/src/methodjit/FrameState.cpp
js/src/methodjit/InvokeHelpers.cpp
js/src/methodjit/PolyIC.cpp
js/src/methodjit/RematInfo.h
js/src/methodjit/StubCalls.cpp
js/src/shell/js.cpp
js/src/shell/jsheaptools.cpp
js/src/shell/jsworkers.cpp
js/src/vm/Debugger.cpp
js/src/vm/Debugger.h
js/src/vm/GlobalObject.cpp
js/src/vm/GlobalObject.h
js/src/xpconnect/src/qsgen.py
js/src/xpconnect/src/xpcprivate.h
js/src/xpconnect/src/xpcwrappednative.cpp
js/src/xpconnect/src/xpcwrappednativeinfo.cpp
js/src/xpconnect/src/xpcwrappednativejsops.cpp
js/src/xpconnect/src/xpcwrappednativescope.cpp
js/src/xpconnect/wrappers/CrossOriginWrapper.cpp
js/src/xpconnect/wrappers/WrapperFactory.cpp
js/src/xpconnect/wrappers/XrayWrapper.cpp
--- a/dom/src/json/nsJSON.cpp
+++ b/dom/src/json/nsJSON.cpp
@@ -589,17 +589,17 @@ nsJSON::LegacyDecodeFromStream(nsIInputS
 
 NS_IMETHODIMP
 nsJSON::LegacyDecodeToJSVal(const nsAString &str, JSContext *cx, jsval *result)
 {
   JSAutoRequest ar(cx);
 
   if (!js::ParseJSONWithReviver(cx, (jschar*)PromiseFlatString(str).get(),
                                 (uint32)str.Length(), js::NullValue(),
-                                js::Valueify(result), LEGACY)) {
+                                result, LEGACY)) {
     return NS_ERROR_UNEXPECTED;
   }
 
   return NS_OK;
 }
 
 nsresult
 NS_NewJSON(nsISupports* aOuter, REFNSIID aIID, void** aResult)
@@ -657,17 +657,17 @@ nsJSONListener::OnStopRequest(nsIRequest
     // Just consume mSniffBuffer
     rv = ProcessBytes(nsnull, 0);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   const jschar* chars = reinterpret_cast<const jschar*>(mBufferedChars.Elements());
   JSBool ok = js::ParseJSONWithReviver(mCx, chars,
                                        (uint32) mBufferedChars.Length(),
-                                       js::NullValue(), js::Valueify(mRootVal),
+                                       js::NullValue(), mRootVal,
                                        mDecodingMode);
   mBufferedChars.TruncateLength(0);
   return ok ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 nsJSONListener::OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext,
                                 nsIInputStream *aStream,
--- a/js/ipc/ObjectWrapperParent.cpp
+++ b/js/ipc/ObjectWrapperParent.cpp
@@ -169,33 +169,33 @@ with_error(JSContext* cx,
         JS_ReportError(cx, error ? error : "Unspecified CPOW error");
     return rval;
 }
 
 const js::Class ObjectWrapperParent::sCPOW_JSClass = {
       "CrossProcessObjectWrapper",
       JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE |
       JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(sNumSlots),
-      JS_VALUEIFY(js::PropertyOp, ObjectWrapperParent::CPOW_AddProperty),
-      JS_VALUEIFY(js::PropertyOp, ObjectWrapperParent::CPOW_DelProperty),
-      JS_VALUEIFY(js::PropertyOp, ObjectWrapperParent::CPOW_GetProperty),
-      JS_VALUEIFY(js::StrictPropertyOp, ObjectWrapperParent::CPOW_SetProperty),
+      ObjectWrapperParent::CPOW_AddProperty,
+      ObjectWrapperParent::CPOW_DelProperty,
+      ObjectWrapperParent::CPOW_GetProperty,
+      ObjectWrapperParent::CPOW_SetProperty,
       (JSEnumerateOp) ObjectWrapperParent::CPOW_NewEnumerate,
       (JSResolveOp) ObjectWrapperParent::CPOW_NewResolve,
-      JS_VALUEIFY(js::ConvertOp, ObjectWrapperParent::CPOW_Convert),
+      ObjectWrapperParent::CPOW_Convert,
       ObjectWrapperParent::CPOW_Finalize,
       nsnull, // reserved1
       nsnull, // checkAccess
-      JS_VALUEIFY(js::CallOp, ObjectWrapperParent::CPOW_Call),
-      JS_VALUEIFY(js::CallOp, ObjectWrapperParent::CPOW_Construct),
+      ObjectWrapperParent::CPOW_Call,
+      ObjectWrapperParent::CPOW_Construct,
       nsnull, // xdrObject
-      JS_VALUEIFY(js::HasInstanceOp, ObjectWrapperParent::CPOW_HasInstance),
+      ObjectWrapperParent::CPOW_HasInstance,
       nsnull, // mark
       {
-          JS_VALUEIFY(js::EqualityOp, ObjectWrapperParent::CPOW_Equality),
+          ObjectWrapperParent::CPOW_Equality,
           nsnull, // outerObject
           nsnull, // innerObject
           nsnull, // iteratorObject
           nsnull, // wrappedObject
     }
 };
 
 void
--- a/js/ipc/ObjectWrapperParent.h
+++ b/js/ipc/ObjectWrapperParent.h
@@ -38,17 +38,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef mozilla_jsipc_ObjectWrapperParent_h__
 #define mozilla_jsipc_ObjectWrapperParent_h__
 
 #include "mozilla/jsipc/PObjectWrapperParent.h"
 #include "jsapi.h"
-#include "jsvalue.h"
+#include "jsclass.h"
 #include "nsAutoJSValHolder.h"
 
 namespace mozilla {
 namespace jsipc {
 
 class ContextWrapperParent;
 
 class OperationChecker {
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -172,16 +172,17 @@ INSTALLED_HEADERS = \
 		jsautocfg.h \
 		$(CURDIR)/jsautokw.h \
 		js.msg \
 		jsalloc.h \
 		jsapi.h \
 		jsarena.h \
 		jsatom.h \
 		jsbit.h \
+		jsclass.h \
 		jsclist.h \
 		jsclone.h \
 		jscntxt.h \
 		jscompat.h \
 		jscrashreport.h \
 		jsdate.h \
 		jsdbgapi.h \
 		jsdhash.h \
@@ -226,17 +227,16 @@ INSTALLED_HEADERS = \
 		jsutil.h \
 		jsvector.h \
 		jstl.h \
 		jshashtable.h \
 		jsversion.h \
 		jswrapper.h \
 		jsxdrapi.h \
 		jsval.h \
-		jsvalue.h \
 		prmjtime.h \
 		$(NULL)
 
 ######################################################
 # BEGIN include sources for the engine subdirectories
 #
 VPATH		+= \
 		$(srcdir)/vm \
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -2775,39 +2775,39 @@ CType::FinalizeProtoClass(JSContext* cx,
   JS_SetContextThread(closureCx);
   JS_DestroyContextNoGC(closureCx);
 }
 
 void
 CType::Trace(JSTracer* trc, JSObject* obj)
 {
   // Make sure our TypeCode slot is legit. If it's not, bail.
-  jsval slot = js::Jsvalify(obj->getSlot(SLOT_TYPECODE));
+  jsval slot = obj->getSlot(SLOT_TYPECODE);
   if (JSVAL_IS_VOID(slot))
     return;
 
   // The contents of our slots depends on what kind of type we are.
   switch (TypeCode(JSVAL_TO_INT(slot))) {
   case TYPE_struct: {
-    slot = Jsvalify(obj->getReservedSlot(SLOT_FIELDINFO));
+    slot = obj->getReservedSlot(SLOT_FIELDINFO);
     if (JSVAL_IS_VOID(slot))
       return;
 
     FieldInfoHash* fields =
       static_cast<FieldInfoHash*>(JSVAL_TO_PRIVATE(slot));
     for (FieldInfoHash::Range r = fields->all(); !r.empty(); r.popFront()) {
       JS_CALL_TRACER(trc, r.front().key, JSTRACE_STRING, "fieldName");
       JS_CALL_TRACER(trc, r.front().value.mType, JSTRACE_OBJECT, "fieldType");
     }
 
     break;
   }
   case TYPE_function: {
     // Check if we have a FunctionInfo.
-    slot = Jsvalify(obj->getReservedSlot(SLOT_FNINFO));
+    slot = obj->getReservedSlot(SLOT_FNINFO);
     if (JSVAL_IS_VOID(slot))
       return;
 
     FunctionInfo* fninfo = static_cast<FunctionInfo*>(JSVAL_TO_PRIVATE(slot));
     JS_ASSERT(fninfo);
 
     // Identify our objects to the tracer.
     JS_CALL_TRACER(trc, fninfo->mABI, JSTRACE_OBJECT, "abi");
--- a/js/src/jsapi-tests/testArgumentsObject.cpp
+++ b/js/src/jsapi-tests/testArgumentsObject.cpp
@@ -90,18 +90,18 @@ ExhaustiveTest(const char funcode[])
 
     Value elems[MAX_ELEMS];
 
     for (size_t i = 0; i <= ArgCount; i++) {
         for (size_t j = 0; j <= ArgCount - i; j++) {
             ClearElements(elems);
             CHECK(argsobj->getElements(i, j, elems));
             for (size_t k = 0; k < j; k++)
-                CHECK_SAME(Jsvalify(elems[k]), INT_TO_JSVAL(i + k));
+                CHECK_SAME(elems[k], INT_TO_JSVAL(i + k));
             for (size_t k = j; k < MAX_ELEMS - 1; k++)
-                CHECK_SAME(Jsvalify(elems[k]), JSVAL_NULL);
-            CHECK_SAME(Jsvalify(elems[MAX_ELEMS - 1]), INT_TO_JSVAL(42));
+                CHECK_SAME(elems[k], JSVAL_NULL);
+            CHECK_SAME(elems[MAX_ELEMS - 1], INT_TO_JSVAL(42));
         }
     }
 
     return true;
 }
 END_TEST(testArgumentsObject)
--- a/js/src/jsapi-tests/testCustomIterator.cpp
+++ b/js/src/jsapi-tests/testCustomIterator.cpp
@@ -1,11 +1,11 @@
 #include "tests.h"
 
-#include "jsvalue.h"
+#include "jsclass.h"
 
 int count = 0;
 
 static JSBool
 IterNext(JSContext *cx, uintN argc, jsval *vp)
 {
     if (count++ == 100)
         return JS_ThrowStopIteration(cx);
@@ -22,23 +22,23 @@ IterHook(JSContext *cx, JSObject *obj, J
     if (!JS_DefineFunction(cx, iterObj, "next", IterNext, 0, 0))
         return NULL;
     return iterObj;
 }
 
 js::Class HasCustomIterClass = {
     "HasCustomIter",
     0,
-    js::PropertyStub,
-    js::PropertyStub,
-    js::PropertyStub,
-    js::StrictPropertyStub,
-    js::EnumerateStub,
-    js::ResolveStub,
-    js::ConvertStub,
+    JS_PropertyStub,
+    JS_PropertyStub,
+    JS_PropertyStub,
+    JS_StrictPropertyStub,
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
     NULL,
     NULL, /* reserved0 */
     NULL, /* checkAccess */
     NULL, /* call */
     NULL, /* construct */
     NULL, /* xdrObject */
     NULL, /* hasInstance */
     NULL, /* mark */
--- a/js/src/jsapi-tests/testExtendedEq.cpp
+++ b/js/src/jsapi-tests/testExtendedEq.cpp
@@ -13,37 +13,37 @@ my_Equality(JSContext *cx, JSObject *obj
 {
     *bp = JS_TRUE;
     return JS_TRUE;
 }
 
 js::Class TestExtendedEq_JSClass = {
     "TestExtendedEq",
     0,
-    js::PropertyStub,       /* addProperty */
-    js::PropertyStub,       /* delProperty */
-    js::PropertyStub,       /* getProperty */
-    js::StrictPropertyStub, /* setProperty */
+    JS_PropertyStub,       /* addProperty */
+    JS_PropertyStub,       /* delProperty */
+    JS_PropertyStub,       /* getProperty */
+    JS_StrictPropertyStub, /* setProperty */
     JS_EnumerateStub,
     JS_ResolveStub,
-    NULL,           /* convert */
-    NULL,           /* finalize */
-    NULL,           /* reserved0   */
-    NULL,           /* checkAccess */
-    NULL,           /* call        */
-    NULL,           /* construct   */
-    NULL,           /* xdrObject   */
-    NULL,           /* hasInstance */
-    NULL,           /* mark        */
+    NULL,                  /* convert */
+    NULL,                  /* finalize */
+    NULL,                  /* reserved0   */
+    NULL,                  /* checkAccess */
+    NULL,                  /* call        */
+    NULL,                  /* construct   */
+    NULL,                  /* xdrObject   */
+    NULL,                  /* hasInstance */
+    NULL,                  /* mark        */
     {
-        js::Valueify(my_Equality),
-        NULL, /* outerObject    */
-        NULL, /* innerObject    */
-        NULL, /* iteratorObject */
-        NULL, /* wrappedObject  */
+        my_Equality,
+        NULL,              /* outerObject    */
+        NULL,              /* innerObject    */
+        NULL,              /* iteratorObject */
+        NULL,              /* wrappedObject  */
     }
 };
 
 BEGIN_TEST(testExtendedEq_bug530489)
 {
     JSClass *clasp = (JSClass *) &TestExtendedEq_JSClass;
 
     CHECK(JS_InitClass(cx, global, global, clasp, NULL, 0, NULL, NULL, NULL, NULL));
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -188,29 +188,29 @@ JS_PUBLIC_API(int64)
 JS_Now()
 {
     return PRMJ_Now();
 }
 
 JS_PUBLIC_API(jsval)
 JS_GetNaNValue(JSContext *cx)
 {
-    return Jsvalify(cx->runtime->NaNValue);
+    return cx->runtime->NaNValue;
 }
 
 JS_PUBLIC_API(jsval)
 JS_GetNegativeInfinityValue(JSContext *cx)
 {
-    return Jsvalify(cx->runtime->negativeInfinityValue);
+    return cx->runtime->negativeInfinityValue;
 }
 
 JS_PUBLIC_API(jsval)
 JS_GetPositiveInfinityValue(JSContext *cx)
 {
-    return Jsvalify(cx->runtime->positiveInfinityValue);
+    return cx->runtime->positiveInfinityValue;
 }
 
 JS_PUBLIC_API(jsval)
 JS_GetEmptyStringValue(JSContext *cx)
 {
     return STRING_TO_JSVAL(cx->runtime->emptyString);
 }
 
@@ -269,33 +269,33 @@ JS_ConvertArgumentsVA(JSContext *cx, uin
         if (isspace(c))
             continue;
         if (c == '/') {
             required = JS_FALSE;
             continue;
         }
         if (sp == argv + argc) {
             if (required) {
-                fun = js_ValueToFunction(cx, Valueify(&argv[-2]), 0);
+                fun = js_ValueToFunction(cx, &argv[-2], 0);
                 if (fun) {
                     char numBuf[12];
                     JS_snprintf(numBuf, sizeof numBuf, "%u", argc);
                     JSAutoByteString funNameBytes;
                     if (const char *name = GetFunctionNameBytes(cx, fun, &funNameBytes)) {
                         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_MORE_ARGS_NEEDED,
                                              name, numBuf, (argc == 1) ? "" : "s");
                     }
                 }
                 return JS_FALSE;
             }
             break;
         }
         switch (c) {
           case 'b':
-            *va_arg(ap, JSBool *) = js_ValueToBoolean(Valueify(*sp));
+            *va_arg(ap, JSBool *) = js_ValueToBoolean(*sp);
             break;
           case 'c':
             if (!JS_ValueToUint16(cx, *sp, va_arg(ap, uint16 *)))
                 return JS_FALSE;
             break;
           case 'i':
             if (!JS_ValueToECMAInt32(cx, *sp, va_arg(ap, int32 *)))
                 return JS_FALSE;
@@ -314,37 +314,37 @@ JS_ConvertArgumentsVA(JSContext *cx, uin
             break;
           case 'I':
             if (!JS_ValueToNumber(cx, *sp, &d))
                 return JS_FALSE;
             *va_arg(ap, jsdouble *) = js_DoubleToInteger(d);
             break;
           case 'S':
           case 'W':
-            str = js_ValueToString(cx, Valueify(*sp));
+            str = js_ValueToString(cx, *sp);
             if (!str)
                 return JS_FALSE;
             *sp = STRING_TO_JSVAL(str);
             if (c == 'W') {
                 JSFixedString *fixed = str->ensureFixed(cx);
                 if (!fixed)
                     return JS_FALSE;
                 *va_arg(ap, const jschar **) = fixed->chars();
             } else {
                 *va_arg(ap, JSString **) = str;
             }
             break;
           case 'o':
-            if (!js_ValueToObjectOrNull(cx, Valueify(*sp), &obj))
+            if (!js_ValueToObjectOrNull(cx, *sp, &obj))
                 return JS_FALSE;
             *sp = OBJECT_TO_JSVAL(obj);
             *va_arg(ap, JSObject **) = obj;
             break;
           case 'f':
-            obj = js_ValueToFunctionObject(cx, Valueify(sp), 0);
+            obj = js_ValueToFunctionObject(cx, sp, 0);
             if (!obj)
                 return JS_FALSE;
             *sp = OBJECT_TO_JSVAL(obj);
             *va_arg(ap, JSFunction **) = obj->getFunctionPrivate();
             break;
           case 'v':
             *va_arg(ap, jsval *) = *sp;
             break;
@@ -421,38 +421,38 @@ JS_ConvertValue(JSContext *cx, jsval v, 
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
     switch (type) {
       case JSTYPE_VOID:
         *vp = JSVAL_VOID;
         ok = JS_TRUE;
         break;
       case JSTYPE_OBJECT:
-        ok = js_ValueToObjectOrNull(cx, Valueify(v), &obj);
+        ok = js_ValueToObjectOrNull(cx, v, &obj);
         if (ok)
             *vp = OBJECT_TO_JSVAL(obj);
         break;
       case JSTYPE_FUNCTION:
         *vp = v;
-        obj = js_ValueToFunctionObject(cx, Valueify(vp), JSV2F_SEARCH_STACK);
+        obj = js_ValueToFunctionObject(cx, vp, JSV2F_SEARCH_STACK);
         ok = (obj != NULL);
         break;
       case JSTYPE_STRING:
-        str = js_ValueToString(cx, Valueify(v));
+        str = js_ValueToString(cx, v);
         ok = (str != NULL);
         if (ok)
             *vp = STRING_TO_JSVAL(str);
         break;
       case JSTYPE_NUMBER:
         ok = JS_ValueToNumber(cx, v, &d);
         if (ok)
             *vp = DOUBLE_TO_JSVAL(d);
         break;
       case JSTYPE_BOOLEAN:
-        *vp = BOOLEAN_TO_JSVAL(js_ValueToBoolean(Valueify(v)));
+        *vp = BOOLEAN_TO_JSVAL(js_ValueToBoolean(v));
         return JS_TRUE;
       default: {
         char numBuf[12];
         JS_snprintf(numBuf, sizeof numBuf, "%d", (int)type);
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_BAD_TYPE, numBuf);
         ok = JS_FALSE;
         break;
       }
@@ -460,58 +460,58 @@ JS_ConvertValue(JSContext *cx, jsval v, 
     return ok;
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ValueToObject(JSContext *cx, jsval v, JSObject **objp)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
-    return js_ValueToObjectOrNull(cx, Valueify(v), objp);
+    return js_ValueToObjectOrNull(cx, v, objp);
 }
 
 JS_PUBLIC_API(JSFunction *)
 JS_ValueToFunction(JSContext *cx, jsval v)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
-    return js_ValueToFunction(cx, Valueify(&v), JSV2F_SEARCH_STACK);
+    return js_ValueToFunction(cx, &v, JSV2F_SEARCH_STACK);
 }
 
 JS_PUBLIC_API(JSFunction *)
 JS_ValueToConstructor(JSContext *cx, jsval v)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
-    return js_ValueToFunction(cx, Valueify(&v), JSV2F_SEARCH_STACK);
+    return js_ValueToFunction(cx, &v, JSV2F_SEARCH_STACK);
 }
 
 JS_PUBLIC_API(JSString *)
 JS_ValueToString(JSContext *cx, jsval v)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
-    return js_ValueToString(cx, Valueify(v));
+    return js_ValueToString(cx, v);
 }
 
 JS_PUBLIC_API(JSString *)
 JS_ValueToSource(JSContext *cx, jsval v)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
-    return js_ValueToSource(cx, Valueify(v));
+    return js_ValueToSource(cx, v);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ValueToNumber(JSContext *cx, jsval v, jsdouble *dp)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
 
-    AutoValueRooter tvr(cx, Valueify(v));
+    AutoValueRooter tvr(cx, v);
     return ToNumber(cx, tvr.value(), dp);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_DoubleIsInt32(jsdouble d, jsint *ip)
 {
     return JSDOUBLE_IS_INT32(d, (int32_t *)ip);
 }
@@ -529,94 +529,94 @@ JS_DoubleToUint32(jsdouble d)
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ValueToECMAInt32(JSContext *cx, jsval v, int32 *ip)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
 
-    AutoValueRooter tvr(cx, Valueify(v));
+    AutoValueRooter tvr(cx, v);
     return ValueToECMAInt32(cx, tvr.value(), (int32_t *)ip);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ValueToECMAUint32(JSContext *cx, jsval v, uint32 *ip)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
 
-    AutoValueRooter tvr(cx, Valueify(v));
+    AutoValueRooter tvr(cx, v);
     return ValueToECMAUint32(cx, tvr.value(), (uint32_t *)ip);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ValueToInt32(JSContext *cx, jsval v, int32 *ip)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
 
-    AutoValueRooter tvr(cx, Valueify(v));
+    AutoValueRooter tvr(cx, v);
     return ValueToInt32(cx, tvr.value(), (int32_t *)ip);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ValueToUint16(JSContext *cx, jsval v, uint16 *ip)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
 
-    AutoValueRooter tvr(cx, Valueify(v));
+    AutoValueRooter tvr(cx, v);
     return ValueToUint16(cx, tvr.value(), (uint16_t *)ip);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ValueToBoolean(JSContext *cx, jsval v, JSBool *bp)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
-    *bp = js_ValueToBoolean(Valueify(v));
+    *bp = js_ValueToBoolean(v);
     return JS_TRUE;
 }
 
 JS_PUBLIC_API(JSType)
 JS_TypeOfValue(JSContext *cx, jsval v)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
-    return TypeOfValue(cx, Valueify(v));
+    return TypeOfValue(cx, v);
 }
 
 JS_PUBLIC_API(const char *)
 JS_GetTypeName(JSContext *cx, JSType type)
 {
     if ((uintN)type >= (uintN)JSTYPE_LIMIT)
         return NULL;
     return JS_TYPE_STR(type);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_StrictlyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal)
 {
     assertSameCompartment(cx, v1, v2);
-    return StrictlyEqual(cx, Valueify(v1), Valueify(v2), equal);
+    return StrictlyEqual(cx, v1, v2, equal);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_LooselyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal)
 {
     assertSameCompartment(cx, v1, v2);
-    return LooselyEqual(cx, Valueify(v1), Valueify(v2), equal);
+    return LooselyEqual(cx, v1, v2, equal);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_SameValue(JSContext *cx, jsval v1, jsval v2, JSBool *same)
 {
     assertSameCompartment(cx, v1, v2);
-    return SameValue(cx, Valueify(v1), Valueify(v2), same);
+    return SameValue(cx, v1, v2, same);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_IsBuiltinEvalFunction(JSFunction *fun)
 {
     return IsAnyBuiltinEval(fun);
 }
 
@@ -1216,18 +1216,17 @@ JS_EnterCrossCompartmentCallScript(JSCon
     return JS_EnterCrossCompartmentCall(cx, scriptObject);
 }
 
 JS_PUBLIC_API(JSCrossCompartmentCall *)
 JS_EnterCrossCompartmentCallStackFrame(JSContext *cx, JSStackFrame *target)
 {
     CHECK_REQUEST(cx);
 
-    StackFrame *frame = Valueify(target);
-    return JS_EnterCrossCompartmentCall(cx, frame->scopeChain().getGlobal());
+    return JS_EnterCrossCompartmentCall(cx, Valueify(target)->scopeChain().getGlobal());
 }
 
 JS_PUBLIC_API(void)
 JS_LeaveCrossCompartmentCall(JSCrossCompartmentCall *call)
 {
     AutoCompartment *realcall = reinterpret_cast<AutoCompartment *>(call);
     CHECK_REQUEST(realcall->context);
     realcall->leave();
@@ -1265,18 +1264,17 @@ AutoEnterScriptCompartment::enter(JSCont
     call = JS_EnterCrossCompartmentCallScript(cx, target);
     return call != NULL;
 }
 
 bool
 AutoEnterFrameCompartment::enter(JSContext *cx, JSStackFrame *target)
 {
     JS_ASSERT(!call);
-    js::StackFrame *fp = Valueify(target);
-    if (cx->compartment == fp->scopeChain().compartment()) {
+    if (cx->compartment == Valueify(target)->scopeChain().compartment()) {
         call = reinterpret_cast<JSCrossCompartmentCall*>(1);
         return true;
     }
     call = JS_EnterCrossCompartmentCallStackFrame(cx, target);
     return call != NULL;
 }
 
 } /* namespace JS */
@@ -1303,17 +1301,17 @@ JS_WrapObject(JSContext *cx, JSObject **
     CHECK_REQUEST(cx);
     return cx->compartment->wrap(cx, objp);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_WrapValue(JSContext *cx, jsval *vp)
 {
     CHECK_REQUEST(cx);
-    return cx->compartment->wrap(cx, Valueify(vp));
+    return cx->compartment->wrap(cx, vp);
 }
 
 JS_PUBLIC_API(JSObject *)
 JS_TransplantObject(JSContext *cx, JSObject *origobj, JSObject *target)
 {
      // This function is called when an object moves between two
      // different compartments. In that case, we need to "move" the
      // window from origobj's compartment to target's compartment.
@@ -1712,17 +1710,17 @@ JS_ResolveStandardClass(JSContext *cx, J
 
     idstr = JSID_TO_STRING(id);
 
     /* Check whether we're resolving 'undefined', and define it if so. */
     atom = rt->atomState.typeAtoms[JSTYPE_VOID];
     if (idstr == atom) {
         *resolved = JS_TRUE;
         return obj->defineProperty(cx, ATOM_TO_JSID(atom), UndefinedValue(),
-                                   PropertyStub, StrictPropertyStub,
+                                   JS_PropertyStub, JS_StrictPropertyStub,
                                    JSPROP_PERMANENT | JSPROP_READONLY);
     }
 
     /* Try for class constructors/prototypes named by well-known atoms. */
     stdnm = NULL;
     for (i = 0; standard_class_atoms[i].init; i++) {
         JS_ASSERT(standard_class_atoms[i].clasp);
         atom = OFFSET_TO_ATOM(rt, standard_class_atoms[i].atomOffset);
@@ -1796,17 +1794,17 @@ JS_EnumerateStandardClasses(JSContext *c
 
     /*
      * Check whether we need to bind 'undefined' and define it if so.
      * Since ES5 15.1.1.3 undefined can't be deleted.
      */
     atom = rt->atomState.typeAtoms[JSTYPE_VOID];
     if (!obj->nativeContains(cx, ATOM_TO_JSID(atom)) &&
         !obj->defineProperty(cx, ATOM_TO_JSID(atom), UndefinedValue(),
-                             PropertyStub, StrictPropertyStub,
+                             JS_PropertyStub, JS_StrictPropertyStub,
                              JSPROP_PERMANENT | JSPROP_READONLY)) {
         return JS_FALSE;
     }
 
     /* Initialize any classes that have not been initialized yet. */
     for (i = 0; standard_class_atoms[i].init; i++) {
         if (!js::IsStandardClassResolved(obj, standard_class_atoms[i].clasp) &&
             !standard_class_atoms[i].init(cx, obj))
@@ -1976,20 +1974,20 @@ JS_GetGlobalForScopeChain(JSContext *cx)
     CHECK_REQUEST(cx);
     return GetGlobalForScopeChain(cx);
 }
 
 JS_PUBLIC_API(jsval)
 JS_ComputeThis(JSContext *cx, jsval *vp)
 {
     assertSameCompartment(cx, JSValueArray(vp, 2));
-    CallReceiver call = CallReceiverFromVp(Valueify(vp));
+    CallReceiver call = CallReceiverFromVp(vp);
     if (!BoxNonStrictThis(cx, call))
         return JSVAL_NULL;
-    return Jsvalify(call.thisv());
+    return call.thisv();
 }
 
 JS_PUBLIC_API(void *)
 JS_malloc(JSContext *cx, size_t nbytes)
 {
     return cx->malloc_(nbytes);
 }
 
@@ -2023,27 +2021,27 @@ JS_strdup(JSContext *cx, const char *s)
         return NULL;
     return (char *)memcpy(p, s, n);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_NewNumberValue(JSContext *cx, jsdouble d, jsval *rval)
 {
     d = JS_CANONICALIZE_NAN(d);
-    Valueify(rval)->setNumber(d);
+    rval->setNumber(d);
     return JS_TRUE;
 }
 
 #undef JS_AddRoot
 
 JS_PUBLIC_API(JSBool)
 JS_AddValueRoot(JSContext *cx, jsval *vp)
 {
     CHECK_REQUEST(cx);
-    return js_AddRoot(cx, Valueify(vp), NULL);
+    return js_AddRoot(cx, vp, NULL);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_AddStringRoot(JSContext *cx, JSString **rp)
 {
     CHECK_REQUEST(cx);
     return js_AddGCThingRoot(cx, (void **)rp, NULL);
 }
@@ -2061,17 +2059,17 @@ JS_AddGCThingRoot(JSContext *cx, void **
     CHECK_REQUEST(cx);
     return js_AddGCThingRoot(cx, (void **)rp, NULL);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_AddNamedValueRoot(JSContext *cx, jsval *vp, const char *name)
 {
     CHECK_REQUEST(cx);
-    return js_AddRoot(cx, Valueify(vp), name);
+    return js_AddRoot(cx, vp, name);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_AddNamedStringRoot(JSContext *cx, JSString **rp, const char *name)
 {
     CHECK_REQUEST(cx);
     return js_AddGCThingRoot(cx, (void **)rp, name);
 }
@@ -2824,17 +2822,17 @@ JS_DestroyIdArray(JSContext *cx, JSIdArr
     cx->free_(ida);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ValueToId(JSContext *cx, jsval v, jsid *idp)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
-    return ValueToId(cx, Valueify(v), idp);
+    return ValueToId(cx, v, idp);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_IdToValue(JSContext *cx, jsid id, jsval *vp)
 {
     CHECK_REQUEST(cx);
     *vp = IdToJsval(id);
     assertSameCompartment(cx, *vp);
@@ -2865,73 +2863,72 @@ JS_ResolveStub(JSContext *cx, JSObject *
     return JS_TRUE;
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ConvertStub(JSContext *cx, JSObject *obj, JSType type, jsval *vp)
 {
     JS_ASSERT(type != JSTYPE_OBJECT && type != JSTYPE_FUNCTION);
     JS_ASSERT(obj);
-    return DefaultValue(cx, obj, type, Valueify(vp));
+    return DefaultValue(cx, obj, type, vp);
 }
 
 JS_PUBLIC_API(void)
 JS_FinalizeStub(JSContext *cx, JSObject *obj)
 {}
 
 JS_PUBLIC_API(JSObject *)
 JS_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto,
              JSClass *clasp, JSNative constructor, uintN nargs,
              JSPropertySpec *ps, JSFunctionSpec *fs,
              JSPropertySpec *static_ps, JSFunctionSpec *static_fs)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, parent_proto);
-    return js_InitClass(cx, obj, parent_proto, Valueify(clasp),
-                        Valueify(constructor), nargs,
-                        ps, fs, static_ps, static_fs);
+    return js_InitClass(cx, obj, parent_proto, Valueify(clasp), constructor,
+                        nargs, ps, fs, static_ps, static_fs);
 }
 
 #ifdef JS_THREADSAFE
 JS_PUBLIC_API(JSClass *)
 JS_GetClass(JSContext *cx, JSObject *obj)
 {
-    return Jsvalify(obj->getClass());
+    return obj->getJSClass();
 }
 #else
 JS_PUBLIC_API(JSClass *)
 JS_GetClass(JSObject *obj)
 {
-    return Jsvalify(obj->getClass());
+    return obj->getJSClass();
 }
 #endif
 
 JS_PUBLIC_API(JSBool)
 JS_InstanceOf(JSContext *cx, JSObject *obj, JSClass *clasp, jsval *argv)
 {
     CHECK_REQUEST(cx);
 #ifdef DEBUG
     if (argv) {
         assertSameCompartment(cx, obj);
         assertSameCompartment(cx, JSValueArray(argv - 2, 2));
     }
 #endif
     if (!obj || obj->getJSClass() != clasp) {
         if (argv)
-            ReportIncompatibleMethod(cx, Valueify(argv - 2), Valueify(clasp));
+            ReportIncompatibleMethod(cx, argv - 2, Valueify(clasp));
         return false;
     }
     return true;
 }
 
 JS_PUBLIC_API(JSBool)
 JS_HasInstance(JSContext *cx, JSObject *obj, jsval v, JSBool *bp)
 {
     assertSameCompartment(cx, obj, v);
-    return HasInstance(cx, obj, Valueify(&v), bp);
+    return HasInstance(cx, obj, &v, bp);
 }
 
 JS_PUBLIC_API(void *)
 JS_GetPrivate(JSContext *cx, JSObject *obj)
 {
     return obj->getPrivate();
 }
 
@@ -3186,17 +3183,17 @@ JS_PUBLIC_API(JSObject *)
 JS_ConstructObjectWithArguments(JSContext *cx, JSClass *jsclasp, JSObject *proto,
                                 JSObject *parent, uintN argc, jsval *argv)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, proto, parent, JSValueArray(argv, argc));
     Class *clasp = Valueify(jsclasp);
     if (!clasp)
         clasp = &ObjectClass;    /* default class is Object */
-    return js_ConstructObject(cx, clasp, proto, parent, argc, Valueify(argv));
+    return js_ConstructObject(cx, clasp, proto, parent, argc, argv);
 }
 
 static JSBool
 LookupPropertyById(JSContext *cx, JSObject *obj, jsid id, uintN flags,
                    JSObject **objp, JSProperty **propp)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, id);
@@ -3251,17 +3248,17 @@ LookupResult(JSContext *cx, JSObject *ob
 }
 
 JS_PUBLIC_API(JSBool)
 JS_LookupPropertyById(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
 {
     JSObject *obj2;
     JSProperty *prop;
     return LookupPropertyById(cx, obj, id, JSRESOLVE_QUALIFIED, &obj2, &prop) &&
-           LookupResult(cx, obj, obj2, id, prop, Valueify(vp));
+           LookupResult(cx, obj, obj2, id, prop, vp);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_LookupElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp)
 {
     CHECK_REQUEST(cx);
     jsid id;
     if (!IndexToId(cx, index, &id))
@@ -3290,17 +3287,17 @@ JS_LookupPropertyWithFlagsById(JSContext
     JSBool ok;
     JSProperty *prop;
 
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, id);
     ok = obj->isNative()
          ? LookupPropertyWithFlags(cx, obj, id, flags, objp, &prop)
          : obj->lookupProperty(cx, id, objp, &prop);
-    return ok && LookupResult(cx, obj, *objp, id, prop, Valueify(vp));
+    return ok && LookupResult(cx, obj, *objp, id, prop, vp);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_LookupPropertyWithFlags(JSContext *cx, JSObject *obj, const char *name, uintN flags, jsval *vp)
 {
     JSObject *obj2;
     JSAtom *atom = js_Atomize(cx, name, strlen(name));
     return atom && JS_LookupPropertyWithFlagsById(cx, obj, ATOM_TO_JSID(atom), flags, &obj2, vp);
@@ -3409,30 +3406,28 @@ DefinePropertyById(JSContext *cx, JSObje
     }
     return obj->defineProperty(cx, id, value, getter, setter, attrs);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value,
                       JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
 {
-    return DefinePropertyById(cx, obj, id, Valueify(value), Valueify(getter),
-                              Valueify(setter), attrs, 0, 0);
+    return DefinePropertyById(cx, obj, id, value, getter, setter, attrs, 0, 0);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_DefineElement(JSContext *cx, JSObject *obj, uint32 index, jsval value,
                  JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
 {
     CHECK_REQUEST(cx);
     jsid id;
     if (!IndexToId(cx, index, &id))
         return false;
-    return DefinePropertyById(cx, obj, id, Valueify(value),
-                              Valueify(getter), Valueify(setter), attrs, 0, 0);
+    return DefinePropertyById(cx, obj, id, value, getter, setter, attrs, 0, 0);
 }
 
 static JSBool
 DefineProperty(JSContext *cx, JSObject *obj, const char *name, const Value &value,
                PropertyOp getter, StrictPropertyOp setter, uintN attrs,
                uintN flags, intN tinyid)
 {
     jsid id;
@@ -3448,82 +3443,79 @@ DefineProperty(JSContext *cx, JSObject *
             return JS_FALSE;
         id = ATOM_TO_JSID(atom);
     }
 
     if (attrs & JSPROP_NATIVE_ACCESSORS) {
         JS_ASSERT(!(attrs & (JSPROP_GETTER | JSPROP_SETTER)));
         attrs &= ~JSPROP_NATIVE_ACCESSORS;
         if (getter) {
-            JSObject *getobj = JS_NewFunction(cx, (JSNative) getter, 0, 0, obj->getGlobal(), NULL);
+            JSObject *getobj = JS_NewFunction(cx, (Native) getter, 0, 0, obj->getGlobal(), NULL);
             if (!getobj)
                 return false;
             getter = JS_DATA_TO_FUNC_PTR(PropertyOp, getobj);
             attrs |= JSPROP_GETTER;
         }
         if (setter) {
-            JSObject *setobj = JS_NewFunction(cx, (JSNative) setter, 1, 0, obj->getGlobal(), NULL);
+            JSObject *setobj = JS_NewFunction(cx, (Native) setter, 1, 0, obj->getGlobal(), NULL);
             if (!setobj)
                 return false;
             setter = JS_DATA_TO_FUNC_PTR(StrictPropertyOp, setobj);
             attrs |= JSPROP_SETTER;
         }
     }
     return DefinePropertyById(cx, obj, id, value, getter, setter, attrs, flags, tinyid);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_DefineProperty(JSContext *cx, JSObject *obj, const char *name, jsval value,
-                  JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
-{
-    return DefineProperty(cx, obj, name, Valueify(value), Valueify(getter),
-                          Valueify(setter), attrs, 0, 0);
+                  PropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
+{
+    return DefineProperty(cx, obj, name, value, getter, setter, attrs, 0, 0);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_DefinePropertyWithTinyId(JSContext *cx, JSObject *obj, const char *name, int8 tinyid,
-                            jsval value, JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
-{
-    return DefineProperty(cx, obj, name, Valueify(value), Valueify(getter),
-                          Valueify(setter), attrs, Shape::HAS_SHORTID, tinyid);
+                            jsval value, PropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
+{
+    return DefineProperty(cx, obj, name, value, getter, setter, attrs, Shape::HAS_SHORTID, tinyid);
 }
 
 static JSBool
 DefineUCProperty(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen,
                  const Value &value, PropertyOp getter, StrictPropertyOp setter, uintN attrs,
                  uintN flags, intN tinyid)
 {
     JSAtom *atom = js_AtomizeChars(cx, name, AUTO_NAMELEN(name, namelen));
     return atom && DefinePropertyById(cx, obj, ATOM_TO_JSID(atom), value, getter, setter, attrs,
                                       flags, tinyid);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_DefineUCProperty(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen,
                     jsval value, JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
 {
-    return DefineUCProperty(cx, obj, name, namelen, Valueify(value),
-                            Valueify(getter), Valueify(setter), attrs, 0, 0);
+    return DefineUCProperty(cx, obj, name, namelen, value, getter, setter, attrs, 0, 0);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen,
                               int8 tinyid, jsval value,
                               JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
 {
-    return DefineUCProperty(cx, obj, name, namelen, Valueify(value), Valueify(getter),
-                            Valueify(setter), attrs, Shape::HAS_SHORTID, tinyid);
+    return DefineUCProperty(cx, obj, name, namelen, value, getter, setter, attrs,
+                            Shape::HAS_SHORTID, tinyid);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id, jsval descriptor, JSBool *bp)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, id, descriptor);
-    return js_DefineOwnProperty(cx, obj, id, Valueify(descriptor), bp);
+    return js_DefineOwnProperty(cx, obj, id, descriptor, bp);
 }
 
 JS_PUBLIC_API(JSObject *)
 JS_DefineObject(JSContext *cx, JSObject *obj, const char *name, JSClass *jsclasp,
                 JSObject *proto, uintN attrs)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, proto);
@@ -3564,18 +3556,17 @@ JS_DefineConstDoubles(JSContext *cx, JSO
 }
 
 JS_PUBLIC_API(JSBool)
 JS_DefineProperties(JSContext *cx, JSObject *obj, JSPropertySpec *ps)
 {
     JSBool ok;
 
     for (ok = true; ps->name; ps++) {
-        ok = DefineProperty(cx, obj, ps->name, UndefinedValue(),
-                            Valueify(ps->getter), Valueify(ps->setter),
+        ok = DefineProperty(cx, obj, ps->name, UndefinedValue(), ps->getter, ps->setter,
                             ps->flags, Shape::HAS_SHORTID, ps->tinyid);
         if (!ok)
             break;
     }
     return ok;
 }
 
 static JSBool
@@ -3598,18 +3589,18 @@ GetPropertyDescriptorById(JSContext *cx,
     }
 
     desc->obj = obj2;
     if (obj2->isNative()) {
         Shape *shape = (Shape *) prop;
         desc->attrs = shape->attributes();
 
         if (shape->isMethod()) {
-            desc->getter = PropertyStub;
-            desc->setter = StrictPropertyStub;
+            desc->getter = JS_PropertyStub;
+            desc->setter = JS_StrictPropertyStub;
             desc->value.setObject(shape->methodObject());
         } else {
             desc->getter = shape->getter();
             desc->setter = shape->setter();
             if (obj2->containsSlot(shape->slot))
                 desc->value = obj2->nativeGetSlot(shape->slot);
             else
                 desc->value.setUndefined();
@@ -3629,34 +3620,34 @@ GetPropertyDescriptorById(JSContext *cx,
     }
     return true;
 }
 
 JS_PUBLIC_API(JSBool)
 JS_GetPropertyDescriptorById(JSContext *cx, JSObject *obj, jsid id, uintN flags,
                              JSPropertyDescriptor *desc)
 {
-    return GetPropertyDescriptorById(cx, obj, id, flags, JS_FALSE, Valueify(desc));
+    return GetPropertyDescriptorById(cx, obj, id, flags, JS_FALSE, desc);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_GetPropertyAttrsGetterAndSetterById(JSContext *cx, JSObject *obj, jsid id,
                                        uintN *attrsp, JSBool *foundp,
                                        JSPropertyOp *getterp, JSStrictPropertyOp *setterp)
 {
     PropertyDescriptor desc;
     if (!GetPropertyDescriptorById(cx, obj, id, JSRESOLVE_QUALIFIED, JS_FALSE, &desc))
         return false;
 
     *attrsp = desc.attrs;
     *foundp = (desc.obj != NULL);
     if (getterp)
-        *getterp = Jsvalify(desc.getter);
+        *getterp = desc.getter;
     if (setterp)
-        *setterp = Jsvalify(desc.setter);
+        *setterp = desc.setter;
     return true;
 }
 
 JS_PUBLIC_API(JSBool)
 JS_GetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name,
                          uintN *attrsp, JSBool *foundp)
 {
     JSAtom *atom = js_Atomize(cx, name, strlen(name));
@@ -3693,17 +3684,17 @@ JS_GetUCPropertyAttrsGetterAndSetter(JSC
     return atom && JS_GetPropertyAttrsGetterAndSetterById(cx, obj, ATOM_TO_JSID(atom),
                                                           attrsp, foundp, getterp, setterp);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_GetOwnPropertyDescriptor(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
 {
     CHECK_REQUEST(cx);
-    return GetOwnPropertyDescriptor(cx, obj, id, Valueify(vp));
+    return GetOwnPropertyDescriptor(cx, obj, id, vp);
 }
 
 static JSBool
 SetPropertyAttributesById(JSContext *cx, JSObject *obj, jsid id, uintN attrs, JSBool *foundp)
 {
     JSObject *obj2;
     JSProperty *prop;
 
@@ -3738,23 +3729,23 @@ JS_SetUCPropertyAttributes(JSContext *cx
 }
 
 JS_PUBLIC_API(JSBool)
 JS_GetPropertyById(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, id);
     JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED);
-    return obj->getProperty(cx, id, Valueify(vp));
+    return obj->getProperty(cx, id, vp);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_GetPropertyByIdDefault(JSContext *cx, JSObject *obj, jsid id, jsval def, jsval *vp)
 {
-    return GetPropertyDefault(cx, obj, id, Valueify(def), Valueify(vp));
+    return GetPropertyDefault(cx, obj, id, def, vp);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_GetElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp)
 {
     CHECK_REQUEST(cx);
     jsid id;
     if (!IndexToId(cx, index, &id))
@@ -3783,17 +3774,17 @@ JS_GetUCProperty(JSContext *cx, JSObject
     return atom && JS_GetPropertyById(cx, obj, ATOM_TO_JSID(atom), vp);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_GetMethodById(JSContext *cx, JSObject *obj, jsid id, JSObject **objp, jsval *vp)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, id);
-    if (!js_GetMethod(cx, obj, id, JSGET_METHOD_BARRIER, Valueify(vp)))
+    if (!js_GetMethod(cx, obj, id, JSGET_METHOD_BARRIER, vp))
         return JS_FALSE;
     if (objp)
         *objp = obj;
     return JS_TRUE;
 }
 
 JS_PUBLIC_API(JSBool)
 JS_GetMethod(JSContext *cx, JSObject *obj, const char *name, JSObject **objp, jsval *vp)
@@ -3803,17 +3794,17 @@ JS_GetMethod(JSContext *cx, JSObject *ob
 }
 
 JS_PUBLIC_API(JSBool)
 JS_SetPropertyById(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, id);
     JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED | JSRESOLVE_ASSIGNING);
-    return obj->setProperty(cx, id, Valueify(vp), false);
+    return obj->setProperty(cx, id, vp, false);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_SetElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp)
 {
     CHECK_REQUEST(cx);
     jsid id;
     if (!IndexToId(cx, index, &id))
@@ -3836,17 +3827,17 @@ JS_SetUCProperty(JSContext *cx, JSObject
 }
 
 JS_PUBLIC_API(JSBool)
 JS_DeletePropertyById2(JSContext *cx, JSObject *obj, jsid id, jsval *rval)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, id);
     JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED);
-    return obj->deleteProperty(cx, id, Valueify(rval), false);
+    return obj->deleteProperty(cx, id, rval, false);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_DeleteElement2(JSContext *cx, JSObject *obj, uint32 index, jsval *rval)
 {
     CHECK_REQUEST(cx);
     jsid id;
     if (!IndexToId(cx, index, &id))
@@ -3962,23 +3953,23 @@ prop_iter_trace(JSTracer *trc, JSObject 
         JSIdArray *ida = (JSIdArray *) pdata;
         MarkIdRange(trc, ida->length, ida->vector, "prop iter");
     }
 }
 
 static Class prop_iter_class = {
     "PropertyIterator",
     JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(1),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
     prop_iter_finalize,
     NULL,           /* reserved0   */
     NULL,           /* checkAccess */
     NULL,           /* call        */
     NULL,           /* construct   */
     NULL,           /* xdrObject   */
     NULL,           /* hasInstance */
     prop_iter_trace
@@ -4063,35 +4054,35 @@ JS_NextProperty(JSContext *cx, JSObject 
     return JS_TRUE;
 }
 
 JS_PUBLIC_API(JSBool)
 JS_GetReservedSlot(JSContext *cx, JSObject *obj, uint32 index, jsval *vp)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj);
-    return js_GetReservedSlot(cx, obj, index, Valueify(vp));
+    return js_GetReservedSlot(cx, obj, index, vp);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_SetReservedSlot(JSContext *cx, JSObject *obj, uint32 index, jsval v)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, v);
-    return js_SetReservedSlot(cx, obj, index, Valueify(v));
+    return js_SetReservedSlot(cx, obj, index, v);
 }
 
 JS_PUBLIC_API(JSObject *)
 JS_NewArrayObject(JSContext *cx, jsint length, jsval *vector)
 {
     JS_THREADSAFE_ASSERT(cx->compartment != cx->runtime->atomsCompartment);
     CHECK_REQUEST(cx);
     /* NB: jsuint cast does ToUint32. */
     assertSameCompartment(cx, JSValueArray(vector, vector ? (jsuint)length : 0));
-    return NewDenseCopiedArray(cx, (jsuint)length, Valueify(vector));
+    return NewDenseCopiedArray(cx, (jsuint)length, vector);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_IsArrayObject(JSContext *cx, JSObject *obj)
 {
     assertSameCompartment(cx, obj);
     return obj->isArray() ||
            (obj->isWrapper() && obj->unwrap()->isArray());
@@ -4114,17 +4105,17 @@ JS_SetArrayLength(JSContext *cx, JSObjec
 }
 
 JS_PUBLIC_API(JSBool)
 JS_CheckAccess(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode,
                jsval *vp, uintN *attrsp)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, id);
-    return CheckAccess(cx, obj, id, mode, Valueify(vp), attrsp);
+    return CheckAccess(cx, obj, id, mode, vp, attrsp);
 }
 
 #ifdef JS_THREADSAFE
 JS_PUBLIC_API(jsrefcount)
 JS_HoldPrincipals(JSContext *cx, JSPrincipals *principals)
 {
     return JS_ATOMIC_INCREMENT(&principals->refcount);
 }
@@ -4191,30 +4182,29 @@ JS_NewFunction(JSContext *cx, JSNative n
 
     if (!name) {
         atom = NULL;
     } else {
         atom = js_Atomize(cx, name, strlen(name));
         if (!atom)
             return NULL;
     }
-    return js_NewFunction(cx, NULL, Valueify(native), nargs, flags, parent, atom);
+    return js_NewFunction(cx, NULL, native, nargs, flags, parent, atom);
 }
 
 JS_PUBLIC_API(JSFunction *)
 JS_NewFunctionById(JSContext *cx, JSNative native, uintN nargs, uintN flags, JSObject *parent,
                    jsid id)
 {
     JS_ASSERT(JSID_IS_STRING(id));
     JS_THREADSAFE_ASSERT(cx->compartment != cx->runtime->atomsCompartment);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, parent);
 
-    return js_NewFunction(cx, NULL, Valueify(native), nargs, flags, parent,
-                          JSID_TO_ATOM(id));
+    return js_NewFunction(cx, NULL, native, nargs, flags, parent, JSID_TO_ATOM(id));
 }
 
 JS_PUBLIC_API(JSObject *)
 JS_CloneFunctionObject(JSContext *cx, JSObject *funobj, JSObject *parent)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, parent);  // XXX no funobj for now
     if (!parent) {
@@ -4348,17 +4338,17 @@ js_generic_native_method_dispatcher(JSCo
     vp[2 + --argc].setUndefined();
 
     Native native =
 #ifdef JS_TRACER
                     (fs->flags & JSFUN_TRCINFO)
                     ? JS_FUNC_TO_DATA_PTR(JSNativeTraceInfo *, fs->call)->native
                     :
 #endif
-                      Valueify(fs->call);
+                      fs->call;
     return native(cx, argc, vp);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_DefineFunctions(JSContext *cx, JSObject *obj, JSFunctionSpec *fs)
 {
     JS_THREADSAFE_ASSERT(cx->compartment != cx->runtime->atomsCompartment);
     uintN flags;
@@ -4398,58 +4388,58 @@ JS_DefineFunctions(JSContext *cx, JSObje
              * As jsapi.h notes, fs must point to storage that lives as long
              * as fun->object lives.
              */
             Value priv = PrivateValue(fs);
             if (!js_SetReservedSlot(cx, fun, 0, priv))
                 return JS_FALSE;
         }
 
-        fun = js_DefineFunction(cx, obj, ATOM_TO_JSID(atom), Valueify(fs->call), fs->nargs, flags);
+        fun = js_DefineFunction(cx, obj, ATOM_TO_JSID(atom), fs->call, fs->nargs, flags);
         if (!fun)
             return JS_FALSE;
     }
     return JS_TRUE;
 }
 
 JS_PUBLIC_API(JSFunction *)
 JS_DefineFunction(JSContext *cx, JSObject *obj, const char *name, JSNative call,
                   uintN nargs, uintN attrs)
 {
     JS_THREADSAFE_ASSERT(cx->compartment != cx->runtime->atomsCompartment);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj);
     JSAtom *atom = js_Atomize(cx, name, strlen(name));
     if (!atom)
         return NULL;
-    return js_DefineFunction(cx, obj, ATOM_TO_JSID(atom), Valueify(call), nargs, attrs);
+    return js_DefineFunction(cx, obj, ATOM_TO_JSID(atom), call, nargs, attrs);
 }
 
 JS_PUBLIC_API(JSFunction *)
 JS_DefineUCFunction(JSContext *cx, JSObject *obj,
                     const jschar *name, size_t namelen, JSNative call,
                     uintN nargs, uintN attrs)
 {
     JS_THREADSAFE_ASSERT(cx->compartment != cx->runtime->atomsCompartment);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj);
     JSAtom *atom = js_AtomizeChars(cx, name, AUTO_NAMELEN(name, namelen));
     if (!atom)
         return NULL;
-    return js_DefineFunction(cx, obj, ATOM_TO_JSID(atom), Valueify(call), nargs, attrs);
+    return js_DefineFunction(cx, obj, ATOM_TO_JSID(atom), call, nargs, attrs);
 }
 
 extern JS_PUBLIC_API(JSFunction *)
 JS_DefineFunctionById(JSContext *cx, JSObject *obj, jsid id, JSNative call,
                     uintN nargs, uintN attrs)
 {
     JS_THREADSAFE_ASSERT(cx->compartment != cx->runtime->atomsCompartment);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj);
-    return js_DefineFunction(cx, obj, id, Valueify(call), nargs, attrs);
+    return js_DefineFunction(cx, obj, id, call, nargs, attrs);
 }
 
 struct AutoLastFrameCheck {
     AutoLastFrameCheck(JSContext *cx JS_GUARD_OBJECT_NOTIFIER_PARAM)
       : cx(cx) {
         JS_ASSERT(cx);
         JS_GUARD_OBJECT_NOTIFIER_INIT;
     }
@@ -4893,17 +4883,17 @@ JS_DecompileFunctionBody(JSContext *cx, 
 JS_PUBLIC_API(JSBool)
 JS_ExecuteScript(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval)
 {
     JS_THREADSAFE_ASSERT(cx->compartment != cx->runtime->atomsCompartment);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, script);
     AutoLastFrameCheck lfc(cx);
 
-    return Execute(cx, script, *obj, Valueify(rval));
+    return Execute(cx, script, *obj, rval);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ExecuteScriptVersion(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval,
                         JSVersion version)
 {
     AutoVersionAPI ava(cx, version);
     return JS_ExecuteScript(cx, obj, script, rval);
@@ -4926,17 +4916,17 @@ EvaluateUCScriptForPrincipalsCommon(JSCo
     AutoLastFrameCheck lfc(cx);
     JSScript *script = Compiler::compileScript(cx, obj, NULL, principals, flags,
                                                chars, length, filename, lineno, compileVersion);
     if (!script)
         return false;
 
     JS_ASSERT(script->getVersion() == compileVersion);
 
-    return Execute(cx, script, *obj, Valueify(rval));
+    return Execute(cx, script, *obj, rval);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_EvaluateUCScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,
                                         JSPrincipals *principals,
                                         const jschar *chars, uintN length,
                                         const char *filename, uintN lineno,
                                         jsval *rval, JSVersion version)
@@ -5004,59 +4994,57 @@ JS_PUBLIC_API(JSBool)
 JS_CallFunction(JSContext *cx, JSObject *obj, JSFunction *fun, uintN argc, jsval *argv,
                 jsval *rval)
 {
     JS_THREADSAFE_ASSERT(cx->compartment != cx->runtime->atomsCompartment);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, fun, JSValueArray(argv, argc));
     AutoLastFrameCheck lfc(cx);
 
-    return Invoke(cx, ObjectOrNullValue(obj), ObjectValue(*fun), argc, Valueify(argv),
-                  Valueify(rval));
+    return Invoke(cx, ObjectOrNullValue(obj), ObjectValue(*fun), argc, argv, rval);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_CallFunctionName(JSContext *cx, JSObject *obj, const char *name, uintN argc, jsval *argv,
                     jsval *rval)
 {
     JS_THREADSAFE_ASSERT(cx->compartment != cx->runtime->atomsCompartment);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, JSValueArray(argv, argc));
     AutoLastFrameCheck lfc(cx);
 
     Value v;
     JSAtom *atom = js_Atomize(cx, name, strlen(name));
     return atom &&
            js_GetMethod(cx, obj, ATOM_TO_JSID(atom), JSGET_NO_METHOD_BARRIER, &v) &&
-           Invoke(cx, ObjectOrNullValue(obj), v, argc, Valueify(argv), Valueify(rval));
+           Invoke(cx, ObjectOrNullValue(obj), v, argc, argv, rval);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_CallFunctionValue(JSContext *cx, JSObject *obj, jsval fval, uintN argc, jsval *argv,
                      jsval *rval)
 {
     JS_THREADSAFE_ASSERT(cx->compartment != cx->runtime->atomsCompartment);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, fval, JSValueArray(argv, argc));
     AutoLastFrameCheck lfc(cx);
 
-    return Invoke(cx, ObjectOrNullValue(obj), Valueify(fval), argc, Valueify(argv),
-                  Valueify(rval));
+    return Invoke(cx, ObjectOrNullValue(obj), fval, argc, argv, rval);
 }
 
 namespace JS {
 
 JS_PUBLIC_API(bool)
 Call(JSContext *cx, jsval thisv, jsval fval, uintN argc, jsval *argv, jsval *rval)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, thisv, fval, JSValueArray(argv, argc));
     AutoLastFrameCheck lfc(cx);
 
-    return Invoke(cx, Valueify(thisv), Valueify(fval), argc, Valueify(argv), Valueify(rval));
+    return Invoke(cx, thisv, fval, argc, argv, rval);
 }
 
 } // namespace JS
 
 JS_PUBLIC_API(JSObject *)
 JS_New(JSContext *cx, JSObject *ctor, uintN argc, jsval *argv)
 {
     CHECK_REQUEST(cx);
@@ -5482,70 +5470,68 @@ JS_EncodeStringToBuffer(JSString *str, c
 
 JS_PUBLIC_API(JSBool)
 JS_Stringify(JSContext *cx, jsval *vp, JSObject *replacer, jsval space,
              JSONWriteCallback callback, void *data)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, replacer, space);
     StringBuffer sb(cx);
-    Value spacev = Valueify(space);
-    if (!js_Stringify(cx, Valueify(vp), replacer, spacev, sb))
+    if (!js_Stringify(cx, vp, replacer, space, sb))
         return false;
     if (sb.empty()) {
         JSAtom *nullAtom = cx->runtime->atomState.nullAtom;
         return callback(nullAtom->chars(), nullAtom->length(), data);
     }
     return callback(sb.begin(), sb.length(), data);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ParseJSON(JSContext *cx, const jschar *chars, uint32 len, jsval *vp)
 {
     CHECK_REQUEST(cx);
 
-    return ParseJSONWithReviver(cx, chars, len, NullValue(), Valueify(vp));
+    return ParseJSONWithReviver(cx, chars, len, NullValue(), vp);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ParseJSONWithReviver(JSContext *cx, const jschar *chars, uint32 len, jsval reviver, jsval *vp)
 {
     CHECK_REQUEST(cx);
 
-    return ParseJSONWithReviver(cx, chars, len, Valueify(reviver), Valueify(vp));
+    return ParseJSONWithReviver(cx, chars, len, reviver, vp);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ReadStructuredClone(JSContext *cx, const uint64 *buf, size_t nbytes,
                        uint32 version, jsval *vp,
                        const JSStructuredCloneCallbacks *optionalCallbacks,
                        void *closure)
 {
     if (version > JS_STRUCTURED_CLONE_VERSION) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_BAD_CLONE_VERSION);
         return false;
     }
     const JSStructuredCloneCallbacks *callbacks =
         optionalCallbacks ?
         optionalCallbacks :
         cx->runtime->structuredCloneCallbacks;
-    return ReadStructuredClone(cx, buf, nbytes, Valueify(vp), callbacks, closure);
+    return ReadStructuredClone(cx, buf, nbytes, vp, callbacks, closure);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_WriteStructuredClone(JSContext *cx, jsval v, uint64 **bufp, size_t *nbytesp,
                         const JSStructuredCloneCallbacks *optionalCallbacks,
                         void *closure)
 {
     const JSStructuredCloneCallbacks *callbacks =
         optionalCallbacks ?
         optionalCallbacks :
         cx->runtime->structuredCloneCallbacks;
-    return WriteStructuredClone(cx, Valueify(v), (uint64_t **) bufp, nbytesp,
-                                callbacks, closure);
+    return WriteStructuredClone(cx, v, (uint64_t **) bufp, nbytesp, callbacks, closure);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_StructuredClone(JSContext *cx, jsval v, jsval *vp,
                    const JSStructuredCloneCallbacks *optionalCallbacks,
                    void *closure)
 {
     const JSStructuredCloneCallbacks *callbacks =
@@ -5882,18 +5868,17 @@ JS_ExecuteRegExp(JSContext *cx, JSObject
     RegExp *re = RegExp::extractFrom(reobj);
     if (!re)
         return false;
 
     JSString *str = js_NewStringCopyN(cx, chars, length);
     if (!str)
         return false;
 
-    return re->execute(cx, RegExpStatics::extractFrom(obj->asGlobal()), str, indexp, test,
-                       Valueify(rval));
+    return re->execute(cx, RegExpStatics::extractFrom(obj->asGlobal()), str, indexp, test, rval);
 }
 
 JS_PUBLIC_API(JSObject *)
 JS_NewRegExpObjectNoStatics(JSContext *cx, char *bytes, size_t length, uintN flags)
 {
     CHECK_REQUEST(cx);
     jschar *chars = InflateString(cx, bytes, &length);
     if (!chars)
@@ -5919,17 +5904,17 @@ JS_ExecuteRegExpNoStatics(JSContext *cx,
     RegExp *re = RegExp::extractFrom(obj);
     if (!re)
         return false;
 
     JSString *str = js_NewStringCopyN(cx, chars, length);
     if (!str)
         return false;
 
-    return re->executeNoStatics(cx, str, indexp, test, Valueify(rval));
+    return re->executeNoStatics(cx, str, indexp, test, rval);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ObjectIsRegExp(JSContext *cx, JSObject *obj)
 {
     JS_ASSERT(obj);
     return obj->isRegExp();
 }
@@ -5975,27 +5960,27 @@ JS_IsExceptionPending(JSContext *cx)
 }
 
 JS_PUBLIC_API(JSBool)
 JS_GetPendingException(JSContext *cx, jsval *vp)
 {
     CHECK_REQUEST(cx);
     if (!cx->isExceptionPending())
         return JS_FALSE;
-    Valueify(*vp) = cx->getPendingException();
+    *vp = cx->getPendingException();
     assertSameCompartment(cx, *vp);
     return JS_TRUE;
 }
 
 JS_PUBLIC_API(void)
 JS_SetPendingException(JSContext *cx, jsval v)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
-    cx->setPendingException(Valueify(v));
+    cx->setPendingException(v);
 }
 
 JS_PUBLIC_API(void)
 JS_ClearPendingException(JSContext *cx)
 {
     cx->clearPendingException();
 }
 
@@ -6030,17 +6015,17 @@ JS_SaveExceptionState(JSContext *cx)
 {
     JSExceptionState *state;
 
     CHECK_REQUEST(cx);
     state = (JSExceptionState *) cx->malloc_(sizeof(JSExceptionState));
     if (state) {
         state->throwing = JS_GetPendingException(cx, &state->exception);
         if (state->throwing && JSVAL_IS_GCTHING(state->exception))
-            js_AddRoot(cx, Valueify(&state->exception), "JSExceptionState.exception");
+            js_AddRoot(cx, &state->exception, "JSExceptionState.exception");
     }
     return state;
 }
 
 JS_PUBLIC_API(void)
 JS_RestoreExceptionState(JSContext *cx, JSExceptionState *state)
 {
     CHECK_REQUEST(cx);
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -849,17 +849,17 @@ IMPL_TO_JSVAL(jsval_layout l)
 }
 
 #endif  /* defined(__cplusplus) */
 
 JS_STATIC_ASSERT(sizeof(jsval_layout) == sizeof(jsval));
 
 /************************************************************************/
 
-/* JSClass (and ObjectOps where appropriate) function pointer typedefs. */
+/* JSClass operation signatures. */
 
 /*
  * Add, delete, or get a property named by id in obj.  Note the jsid id
  * type -- id may be a string (Unicode property identifier) or an int (element
  * index).  The *vp out parameter, on success, is the new property value after
  * an add or get.  After a successful delete, *vp is JSVAL_FALSE iff
  * obj[id] can't be deleted (because it's permanent).
  */
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -972,17 +972,17 @@ js_PrototypeHasIndexedProperties(JSConte
     return JS_FALSE;
 }
 
 namespace js {
 
 /* non-static for direct definition of array elements within the engine */
 JSBool
 array_defineProperty(JSContext *cx, JSObject *obj, jsid id, const Value *value,
-                     PropertyOp getter, StrictPropertyOp setter, uintN attrs)
+                     JSPropertyOp getter, StrictPropertyOp setter, uintN attrs)
 {
     if (JSID_IS_ATOM(id, cx->runtime->atomState.lengthAtom))
         return JS_TRUE;
 
     if (!obj->isDenseArray())
         return js_DefineProperty(cx, obj, id, value, getter, setter, attrs);
 
     do {
@@ -1153,23 +1153,23 @@ array_fix(JSContext *cx, JSObject *obj, 
 
     *success = true;
     return true;
 }
 
 Class js::ArrayClass = {
     "Array",
     Class::NON_NATIVE | JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_Array),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
     NULL,
     NULL,           /* reserved0   */
     NULL,           /* checkAccess */
     NULL,           /* call        */
     NULL,           /* construct   */
     NULL,           /* xdrObject   */
     NULL,           /* hasInstance */
     array_trace,    /* trace       */
@@ -1197,22 +1197,22 @@ Class js::ArrayClass = {
     }
 };
 
 Class js::SlowArrayClass = {
     "Array",
     JSCLASS_HAS_PRIVATE |
     JSCLASS_HAS_CACHED_PROTO(JSProto_Array),
     slowarray_addProperty,
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub
 };
 
 static bool
 AddLengthProperty(JSContext *cx, JSObject *obj)
 {
     const jsid lengthId = ATOM_TO_JSID(cx->runtime->atomState.lengthAtom);
     JS_ASSERT(!obj->nativeLookup(cx, lengthId));
 
@@ -3525,17 +3525,17 @@ NewSlowEmptyArray(JSContext *cx)
 #ifdef DEBUG
 JSBool
 js_ArrayInfo(JSContext *cx, uintN argc, jsval *vp)
 {
     uintN i;
     JSObject *array;
 
     for (i = 0; i < argc; i++) {
-        Value arg = Valueify(JS_ARGV(cx, vp)[i]);
+        Value arg = JS_ARGV(cx, vp)[i];
 
         char *bytes = DecompileValueGenerator(cx, JSDVG_SEARCH_STACK, arg, NULL);
         if (!bytes)
             return JS_FALSE;
         if (arg.isPrimitive() ||
             !(array = arg.toObjectOrNull())->isArray()) {
             fprintf(stderr, "%s: not array\n", bytes);
             cx->free_(bytes);
--- a/js/src/jsatom.h
+++ b/js/src/jsatom.h
@@ -43,17 +43,16 @@
 #include <stddef.h>
 #include "jsversion.h"
 #include "jsapi.h"
 #include "jsprvtd.h"
 #include "jshashtable.h"
 #include "jspubtd.h"
 #include "jsstr.h"
 #include "jslock.h"
-#include "jsvalue.h"
 
 #include "vm/String.h"
 
 /* Engine-internal extensions of jsid */
 
 static JS_ALWAYS_INLINE jsid
 JSID_FROM_BITS(size_t bits)
 {
@@ -122,17 +121,17 @@ IdToValue(jsid id)
         return ObjectValue(*JSID_TO_OBJECT(id));
     JS_ASSERT(JSID_IS_DEFAULT_XML_NAMESPACE(id) || JSID_IS_VOID(id));
     return UndefinedValue();
 }
 
 static JS_ALWAYS_INLINE jsval
 IdToJsval(jsid id)
 {
-    return Jsvalify(IdToValue(id));
+    return IdToValue(id);
 }
 
 template<>
 struct DefaultHasher<jsid>
 {
     typedef jsid Lookup;
     static HashNumber hash(const Lookup &l) {
         JS_ASSERT(l == js_CheckForStringIndex(l));
--- a/js/src/jsbool.cpp
+++ b/js/src/jsbool.cpp
@@ -62,23 +62,23 @@
 
 using namespace js;
 using namespace js::types;
 
 Class js::BooleanClass = {
     "Boolean",
     JSCLASS_HAS_RESERVED_SLOTS(1) |
     JSCLASS_HAS_CACHED_PROTO(JSProto_Boolean),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub
 };
 
 #if JS_HAS_TOSOURCE
 #include "jsprf.h"
 
 static JSBool
 bool_toSource(JSContext *cx, uintN argc, Value *vp)
 {
--- a/js/src/jsbuiltins.h
+++ b/js/src/jsbuiltins.h
@@ -40,18 +40,17 @@
 #ifndef jsbuiltins_h___
 #define jsbuiltins_h___
 
 #ifdef JS_TRACER
 
 // nanojit.h includes windows.h, so undo the obnoxious #defines, if needed
 #include "nanojit/nanojit.h"
 #include "jswin.h"
-
-#include "jsvalue.h"
+#include "jsprvtd.h"
 
 enum JSTNErrType { INFALLIBLE, FAIL_STATUS, FAIL_NULL, FAIL_NEG, FAIL_NEITHER };
 enum { 
     JSTN_ERRTYPE_MASK        = 0x07,
     JSTN_UNBOX_AFTER         = 0x08,
     JSTN_MORE                = 0x10,
     JSTN_CONSTRUCTOR         = 0x20,
     JSTN_RETURN_NULLABLE_STR = 0x40,
@@ -247,16 +246,36 @@ struct ClosureVarInfo;
  *    const js::Value &v = js::ValueArgToConstRef(arg);
  */
 #if JS_BITS_PER_WORD == 32
 # define _JS_CTYPE_VALUE            _JS_CTYPE(js::ValueArgType,       _JS_PTR, "","v", INFALLIBLE)
 #elif JS_BITS_PER_WORD == 64
 # define _JS_CTYPE_VALUE            _JS_CTYPE(js::ValueArgType,       _JS_U64, "","v", INFALLIBLE)
 #endif
 
+namespace js {
+#if JS_BITS_PER_WORD == 32
+typedef const js::Value *ValueArgType;
+
+static JS_ALWAYS_INLINE const js::Value &
+ValueArgToConstRef(const js::Value *arg)
+{
+    return *arg;
+}
+#elif JS_BITS_PER_WORD == 64
+typedef js::Value        ValueArgType;
+
+static JS_ALWAYS_INLINE const Value &
+ValueArgToConstRef(const Value &v)
+{
+    return v;
+}
+#endif
+}  /* namespace js */
+
 #define _JS_EXPAND(tokens)  tokens
 
 #define _JS_CTYPE_TYPE2(t,s,p,a,f)      t
 #define _JS_CTYPE_TYPE(tyname)          _JS_EXPAND(_JS_CTYPE_TYPE2    _JS_CTYPE_##tyname)
 #define _JS_CTYPE_RETTYPE2(t,s,p,a,f)   s##_RETTYPE
 #define _JS_CTYPE_RETTYPE(tyname)       _JS_EXPAND(_JS_CTYPE_RETTYPE2 _JS_CTYPE_##tyname)
 #define _JS_CTYPE_ARGTYPE2(t,s,p,a,f)   s##_ARGTYPE
 #define _JS_CTYPE_ARGTYPE(tyname)       _JS_EXPAND(_JS_CTYPE_ARGTYPE2 _JS_CTYPE_##tyname)
@@ -503,50 +522,50 @@ struct ClosureVarInfo;
         _JS_CTYPE_ACH(at3) _JS_CTYPE_ACH(at2) _JS_CTYPE_ACH(at1) _JS_CTYPE_ACH(at0),              \
     _JS_CTYPE_FLAGS(rt)
 
 #define JS_DEFINE_TRCINFO_1(name, tn0)                                                            \
     _JS_DEFINE_CALLINFO_n tn0                                                                     \
     JSSpecializedNative name##_sns[] = {                                                          \
         { _JS_TN_INIT_HELPER_n tn0 }                                                              \
     };                                                                                            \
-    JSNativeTraceInfo name##_trcinfo = { JS_VALUEIFY_NATIVE(name), name##_sns };
+    JSNativeTraceInfo name##_trcinfo = { name, name##_sns };
 
 #define JS_DEFINE_TRCINFO_2(name, tn0, tn1)                                                       \
     _JS_DEFINE_CALLINFO_n tn0                                                                     \
     _JS_DEFINE_CALLINFO_n tn1                                                                     \
     JSSpecializedNative name##_sns[] = {                                                          \
         { _JS_TN_INIT_HELPER_n tn0 | JSTN_MORE },                                                 \
         { _JS_TN_INIT_HELPER_n tn1 }                                                              \
     };                                                                                            \
-    JSNativeTraceInfo name##_trcinfo = { JS_VALUEIFY_NATIVE(name), name##_sns };
+    JSNativeTraceInfo name##_trcinfo = { name, name##_sns };
 
 #define JS_DEFINE_TRCINFO_3(name, tn0, tn1, tn2)                                                  \
     _JS_DEFINE_CALLINFO_n tn0                                                                     \
     _JS_DEFINE_CALLINFO_n tn1                                                                     \
     _JS_DEFINE_CALLINFO_n tn2                                                                     \
     JSSpecializedNative name##_sns[] = {                                                          \
         { _JS_TN_INIT_HELPER_n tn0 | JSTN_MORE },                                                 \
         { _JS_TN_INIT_HELPER_n tn1 | JSTN_MORE },                                                 \
         { _JS_TN_INIT_HELPER_n tn2 }                                                              \
     };                                                                                            \
-    JSNativeTraceInfo name##_trcinfo = { JS_VALUEIFY_NATIVE(name), name##_sns };
+    JSNativeTraceInfo name##_trcinfo = { name, name##_sns };
 
 #define JS_DEFINE_TRCINFO_4(name, tn0, tn1, tn2, tn3)                                             \
     _JS_DEFINE_CALLINFO_n tn0                                                                     \
     _JS_DEFINE_CALLINFO_n tn1                                                                     \
     _JS_DEFINE_CALLINFO_n tn2                                                                     \
     _JS_DEFINE_CALLINFO_n tn3                                                                     \
     JSSpecializedNative name##_sns[] = {                                                          \
         { _JS_TN_INIT_HELPER_n tn0 | JSTN_MORE },                                                 \
         { _JS_TN_INIT_HELPER_n tn1 | JSTN_MORE },                                                 \
         { _JS_TN_INIT_HELPER_n tn2 | JSTN_MORE },                                                 \
         { _JS_TN_INIT_HELPER_n tn3 }                                                              \
     };                                                                                            \
-    JSNativeTraceInfo name##_trcinfo = { JS_VALUEIFY_NATIVE(name), name##_sns };
+    JSNativeTraceInfo name##_trcinfo = { name, name##_sns };
 
 #define _JS_DEFINE_CALLINFO_n(n, args)  JS_DEFINE_CALLINFO_##n args
 
 jsdouble FASTCALL
 js_StringToNumber(JSContext* cx, JSString* str, JSBool *ok);
 
 /* Extern version of SetBuiltinError. */
 extern JS_FRIEND_API(void)
new file mode 100644
--- /dev/null
+++ b/js/src/jsclass.h
@@ -0,0 +1,228 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=4 sw=4 et tw=79 ft=cpp:
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is SpiderMonkey JavaScript engine.
+ *
+ * The Initial Developer of the Original Code is
+ * Mozilla Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 2009
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#ifndef jsclass_h__
+#define jsclass_h__
+/*
+ * A JSClass acts as a vtable for JS objects that allows JSAPI clients to
+ * control various aspects of the behavior of an object like property lookup.
+ * js::Class is an engine-private extension that allows more control over
+ * object behavior and, e.g., allows custom slow layout.
+ */
+#include "jsapi.h"
+#include "jsprvtd.h"
+
+namespace js {
+
+class AutoIdVector;
+
+/* js::Class operation signatures. */
+
+typedef JSBool
+(* LookupPropOp)(JSContext *cx, JSObject *obj, jsid id, JSObject **objp,
+                 JSProperty **propp);
+typedef JSBool
+(* LookupElementOp)(JSContext *cx, JSObject *obj, uint32 index, JSObject **objp,
+                    JSProperty **propp);
+typedef JSBool
+(* DefinePropOp)(JSContext *cx, JSObject *obj, jsid id, const Value *value,
+                 PropertyOp getter, StrictPropertyOp setter, uintN attrs);
+typedef JSBool
+(* DefineElementOp)(JSContext *cx, JSObject *obj, uint32 index, const Value *value,
+                    PropertyOp getter, StrictPropertyOp setter, uintN attrs);
+typedef JSBool
+(* PropertyIdOp)(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp);
+typedef JSBool
+(* ElementIdOp)(JSContext *cx, JSObject *obj, JSObject *receiver, uint32 index, Value *vp);
+typedef JSBool
+(* StrictPropertyIdOp)(JSContext *cx, JSObject *obj, jsid id, Value *vp, JSBool strict);
+typedef JSBool
+(* StrictElementIdOp)(JSContext *cx, JSObject *obj, uint32 index, Value *vp, JSBool strict);
+typedef JSBool
+(* AttributesOp)(JSContext *cx, JSObject *obj, jsid id, uintN *attrsp);
+typedef JSBool
+(* ElementAttributesOp)(JSContext *cx, JSObject *obj, uint32 index, uintN *attrsp);
+typedef JSBool
+(* DeleteIdOp)(JSContext *cx, JSObject *obj, jsid id, Value *vp, JSBool strict);
+typedef JSBool
+(* DeleteElementOp)(JSContext *cx, JSObject *obj, uint32 index, Value *vp, JSBool strict);
+typedef JSType
+(* TypeOfOp)(JSContext *cx, JSObject *obj);
+
+/*
+ * Prepare to make |obj| non-extensible; in particular, fully resolve its properties.
+ * On error, return false.
+ * If |obj| is now ready to become non-extensible, set |*fixed| to true and return true.
+ * If |obj| refuses to become non-extensible, set |*fixed| to false and return true; the
+ * caller will throw an appropriate error.
+ */
+typedef JSBool
+(* FixOp)(JSContext *cx, JSObject *obj, bool *fixed, AutoIdVector *props);
+
+typedef JSObject *
+(* ObjectOp)(JSContext *cx, JSObject *obj);
+typedef void
+(* FinalizeOp)(JSContext *cx, JSObject *obj);
+
+#define JS_CLASS_MEMBERS                                                      \
+    const char          *name;                                                \
+    uint32              flags;                                                \
+                                                                              \
+    /* Mandatory non-null function pointer members. */                        \
+    JSPropertyOp        addProperty;                                          \
+    JSPropertyOp        delProperty;                                          \
+    JSPropertyOp        getProperty;                                          \
+    JSStrictPropertyOp  setProperty;                                          \
+    JSEnumerateOp       enumerate;                                            \
+    JSResolveOp         resolve;                                              \
+    JSConvertOp         convert;                                              \
+    JSFinalizeOp        finalize;                                             \
+                                                                              \
+    /* Optionally non-null members start here. */                             \
+    JSClassInternal     reserved0;                                            \
+    JSCheckAccessOp     checkAccess;                                          \
+    JSNative            call;                                                 \
+    JSNative            construct;                                            \
+    JSXDRObjectOp       xdrObject;                                            \
+    JSHasInstanceOp     hasInstance;                                          \
+    JSTraceOp           trace
+
+/*
+ * The helper struct to measure the size of JS_CLASS_MEMBERS to know how much
+ * we have to padd js::Class to match the size of JSClass;
+ */
+struct ClassSizeMeasurement
+{
+    JS_CLASS_MEMBERS;
+};
+
+struct ClassExtension
+{
+    JSEqualityOp        equality;
+    JSObjectOp          outerObject;
+    JSObjectOp          innerObject;
+    JSIteratorOp        iteratorObject;
+    void               *unused;
+
+    /*
+     * isWrappedNative is true only if the class is an XPCWrappedNative.
+     * WeakMaps use this to override the wrapper disposal optimization.
+     */
+    bool                isWrappedNative;
+};
+
+#define JS_NULL_CLASS_EXT   {NULL,NULL,NULL,NULL,NULL,false}
+
+struct ObjectOps
+{
+    LookupPropOp        lookupProperty;
+    LookupElementOp     lookupElement;
+    DefinePropOp        defineProperty;
+    DefineElementOp     defineElement;
+    PropertyIdOp        getProperty;
+    ElementIdOp         getElement;
+    StrictPropertyIdOp  setProperty;
+    StrictElementIdOp   setElement;
+    AttributesOp        getAttributes;
+    ElementAttributesOp getElementAttributes;
+    AttributesOp        setAttributes;
+    ElementAttributesOp setElementAttributes;
+    DeleteIdOp          deleteProperty;
+    DeleteElementOp     deleteElement;
+
+    JSNewEnumerateOp    enumerate;
+    TypeOfOp            typeOf;
+    FixOp               fix;
+    ObjectOp            thisObject;
+    FinalizeOp          clear;
+};
+
+#define JS_NULL_OBJECT_OPS                                                    \
+    {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,   \
+     NULL,NULL,NULL,NULL,NULL}
+
+struct Class
+{
+    JS_CLASS_MEMBERS;
+    ClassExtension      ext;
+    ObjectOps           ops;
+    uint8               pad[sizeof(JSClass) - sizeof(ClassSizeMeasurement) -
+                            sizeof(ClassExtension) - sizeof(ObjectOps)];
+
+    /* Class is not native and its map is not a scope. */
+    static const uint32 NON_NATIVE = JSCLASS_INTERNAL_FLAG2;
+
+    bool isNative() const {
+        return !(flags & NON_NATIVE);
+    }
+};
+
+JS_STATIC_ASSERT(offsetof(JSClass, name) == offsetof(Class, name));
+JS_STATIC_ASSERT(offsetof(JSClass, flags) == offsetof(Class, flags));
+JS_STATIC_ASSERT(offsetof(JSClass, addProperty) == offsetof(Class, addProperty));
+JS_STATIC_ASSERT(offsetof(JSClass, delProperty) == offsetof(Class, delProperty));
+JS_STATIC_ASSERT(offsetof(JSClass, getProperty) == offsetof(Class, getProperty));
+JS_STATIC_ASSERT(offsetof(JSClass, setProperty) == offsetof(Class, setProperty));
+JS_STATIC_ASSERT(offsetof(JSClass, enumerate) == offsetof(Class, enumerate));
+JS_STATIC_ASSERT(offsetof(JSClass, resolve) == offsetof(Class, resolve));
+JS_STATIC_ASSERT(offsetof(JSClass, convert) == offsetof(Class, convert));
+JS_STATIC_ASSERT(offsetof(JSClass, finalize) == offsetof(Class, finalize));
+JS_STATIC_ASSERT(offsetof(JSClass, reserved0) == offsetof(Class, reserved0));
+JS_STATIC_ASSERT(offsetof(JSClass, checkAccess) == offsetof(Class, checkAccess));
+JS_STATIC_ASSERT(offsetof(JSClass, call) == offsetof(Class, call));
+JS_STATIC_ASSERT(offsetof(JSClass, construct) == offsetof(Class, construct));
+JS_STATIC_ASSERT(offsetof(JSClass, xdrObject) == offsetof(Class, xdrObject));
+JS_STATIC_ASSERT(offsetof(JSClass, hasInstance) == offsetof(Class, hasInstance));
+JS_STATIC_ASSERT(offsetof(JSClass, trace) == offsetof(Class, trace));
+JS_STATIC_ASSERT(sizeof(JSClass) == sizeof(Class));
+
+static JS_ALWAYS_INLINE JSClass *
+Jsvalify(Class *c)
+{
+    return (JSClass *)c;
+}
+
+static JS_ALWAYS_INLINE Class *
+Valueify(JSClass *c)
+{
+    return (Class *)c;
+}
+
+}  /* namespace js */
+#endif  /* jsclass_h__ */
--- a/js/src/jsclone.h
+++ b/js/src/jsclone.h
@@ -39,17 +39,16 @@
 #ifndef jsclone_h___
 #define jsclone_h___
 
 #include "jsapi.h"
 #include "jscntxt.h"
 #include "jshashtable.h"
 #include "jsstdint.h"
 #include "jsvector.h"
-#include "jsvalue.h"
 
 JS_FRIEND_API(uint64_t)
 js_GetSCOffset(JSStructuredCloneWriter* writer);
 
 namespace js {
 
 bool
 WriteStructuredClone(JSContext *cx, const Value &v, uint64_t **bufp, size_t *nbytesp,
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -1537,22 +1537,22 @@ class AutoValueRooter : private AutoGCRo
 
     Value *addr() {
         JS_ASSERT(tag == JSVAL);
         return &val;
     }
 
     const jsval &jsval_value() const {
         JS_ASSERT(tag == JSVAL);
-        return Jsvalify(val);
+        return val;
     }
 
     jsval *jsval_addr() {
         JS_ASSERT(tag == JSVAL);
-        return Jsvalify(&val);
+        return &val;
     }
 
     friend void AutoGCRooter::trace(JSTracer *trc);
     friend void MarkRuntime(JSTracer *trc);
 
   private:
     Value val;
     JS_DECL_USE_GUARD_OBJECT_NOTIFIER
@@ -2449,21 +2449,21 @@ class AutoValueVector : public AutoVecto
   public:
     explicit AutoValueVector(JSContext *cx
                              JS_GUARD_OBJECT_NOTIFIER_PARAM)
         : AutoVectorRooter<Value>(cx, VALVECTOR)
     {
         JS_GUARD_OBJECT_NOTIFIER_INIT;
     }
 
-    const jsval *jsval_begin() const { return Jsvalify(begin()); }
-    jsval *jsval_begin() { return Jsvalify(begin()); }
-
-    const jsval *jsval_end() const { return Jsvalify(end()); }
-    jsval *jsval_end() { return Jsvalify(end()); }
+    const jsval *jsval_begin() const { return begin(); }
+    jsval *jsval_begin() { return begin(); }
+
+    const jsval *jsval_end() const { return end(); }
+    jsval *jsval_end() { return end(); }
 
     JS_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 class AutoObjectVector : public AutoVectorRooter<JSObject *>
 {
   public:
     explicit AutoObjectVector(JSContext *cx
--- a/js/src/jscntxtinlines.h
+++ b/js/src/jscntxtinlines.h
@@ -282,17 +282,17 @@ assertSameCompartment(JSContext *cx, T1 
     c.check(t5);
 #endif
 }
 
 #undef START_ASSERT_SAME_COMPARTMENT
 
 STATIC_PRECONDITION_ASSUME(ubound(args.argv_) >= argc)
 JS_ALWAYS_INLINE bool
-CallJSNative(JSContext *cx, js::Native native, const CallArgs &args)
+CallJSNative(JSContext *cx, Native native, const CallArgs &args)
 {
 #ifdef DEBUG
     JSBool alreadyThrowing = cx->isExceptionPending();
 #endif
     assertSameCompartment(cx, args);
     JSBool ok = native(cx, args.argc(), args.base());
     if (ok) {
         assertSameCompartment(cx, args.rval());
@@ -300,17 +300,17 @@ CallJSNative(JSContext *cx, js::Native n
     }
     return ok;
 }
 
 extern JSBool CallOrConstructBoundFunction(JSContext *, uintN, js::Value *);
 
 STATIC_PRECONDITION(ubound(args.argv_) >= argc)
 JS_ALWAYS_INLINE bool
-CallJSNativeConstructor(JSContext *cx, js::Native native, const CallArgs &args)
+CallJSNativeConstructor(JSContext *cx, Native native, const CallArgs &args)
 {
 #ifdef DEBUG
     JSObject &callee = args.callee();
 #endif
 
     JS_ASSERT(args.thisv().isMagic());
     if (!CallJSNative(cx, native, args))
         return false;
@@ -335,36 +335,36 @@ CallJSNativeConstructor(JSContext *cx, j
                  native != js::CallOrConstructBoundFunction &&
                  (!callee.isFunction() || callee.getFunctionPrivate()->u.n.clasp != &ObjectClass),
                  !args.rval().isPrimitive() && callee != args.rval().toObject());
 
     return true;
 }
 
 JS_ALWAYS_INLINE bool
-CallJSPropertyOp(JSContext *cx, js::PropertyOp op, JSObject *receiver, jsid id, js::Value *vp)
+CallJSPropertyOp(JSContext *cx, PropertyOp op, JSObject *receiver, jsid id, Value *vp)
 {
     assertSameCompartment(cx, receiver, id, *vp);
     JSBool ok = op(cx, receiver, id, vp);
     if (ok)
         assertSameCompartment(cx, receiver, *vp);
     return ok;
 }
 
 JS_ALWAYS_INLINE bool
-CallJSPropertyOpSetter(JSContext *cx, js::StrictPropertyOp op, JSObject *obj, jsid id,
-                       JSBool strict, js::Value *vp)
+CallJSPropertyOpSetter(JSContext *cx, StrictPropertyOp op, JSObject *obj, jsid id,
+                       JSBool strict, Value *vp)
 {
     assertSameCompartment(cx, obj, id, *vp);
     return op(cx, obj, id, strict, vp);
 }
 
 inline bool
-CallSetter(JSContext *cx, JSObject *obj, jsid id, js::StrictPropertyOp op, uintN attrs,
-           uintN shortid, JSBool strict, js::Value *vp)
+CallSetter(JSContext *cx, JSObject *obj, jsid id, StrictPropertyOp op, uintN attrs,
+           uintN shortid, JSBool strict, Value *vp)
 {
     if (attrs & JSPROP_SETTER)
         return InvokeGetterOrSetter(cx, obj, CastAsObjectJsval(op), 1, vp, vp);
 
     if (attrs & JSPROP_GETTER)
         return js_ReportGetterOnlyAssignment(cx);
 
     if (attrs & JSPROP_SHORTID)
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -502,22 +502,22 @@ date_convert(JSContext *cx, JSObject *ob
 /*
  * Other Support routines and definitions
  */
 
 Class js::DateClass = {
     js_Date_str,
     JSCLASS_HAS_RESERVED_SLOTS(JSObject::DATE_CLASS_RESERVED_SLOTS) |
     JSCLASS_HAS_CACHED_PROTO(JSProto_Date),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
     date_convert
 };
 
 /* for use by date_parse */
 
 static const char* wtb[] = {
     "am", "pm",
     "monday", "tuesday", "wednesday", "thursday", "friday",
@@ -2307,17 +2307,17 @@ date_toLocaleHelper(JSContext *cx, JSObj
               isdigit(buf[2]) && isdigit(buf[3]))) {
             JS_snprintf(buf + (result_len - 2), (sizeof buf) - (result_len - 2),
                         "%d", js_DateGetYear(cx, obj));
         }
 
     }
 
     if (cx->localeCallbacks && cx->localeCallbacks->localeToUnicode)
-        return cx->localeCallbacks->localeToUnicode(cx, buf, Jsvalify(vp));
+        return cx->localeCallbacks->localeToUnicode(cx, buf, vp);
 
     str = JS_NewStringCopyZ(cx, buf);
     if (!str)
         return false;
     vp->setString(str);
     return true;
 }
 
@@ -2623,17 +2623,17 @@ js_InitDateClass(JSContext *cx, JSObject
      *   object that is the initial value of
      *   Date.prototype.toUTCString.
      */
     AutoValueRooter toUTCStringFun(cx);
     jsid toUTCStringId = ATOM_TO_JSID(cx->runtime->atomState.toUTCStringAtom);
     jsid toGMTStringId = ATOM_TO_JSID(cx->runtime->atomState.toGMTStringAtom);
     if (!js_GetProperty(cx, proto, toUTCStringId, toUTCStringFun.addr()) ||
         !js_DefineProperty(cx, proto, toGMTStringId, toUTCStringFun.addr(),
-                           PropertyStub, StrictPropertyStub, 0)) {
+                           JS_PropertyStub, JS_StrictPropertyStub, 0)) {
         return NULL;
     }
 
     return proto;
 }
 
 JS_FRIEND_API(JSObject *)
 js_NewDateObjectMsec(JSContext *cx, jsdouble msec_time)
--- a/js/src/jsdbgapi.cpp
+++ b/js/src/jsdbgapi.cpp
@@ -210,33 +210,33 @@ JS_PUBLIC_API(JSBool)
 JS_SetTrap(JSContext *cx, JSScript *script, jsbytecode *pc, JSTrapHandler handler, jsval closure)
 {
     if (!CheckDebugMode(cx))
         return false;
 
     BreakpointSite *site = script->compartment()->getOrCreateBreakpointSite(cx, script, pc, NULL);
     if (!site)
         return false;
-    site->setTrap(cx, handler, Valueify(closure));
+    site->setTrap(cx, handler, closure);
     return true;
 }
 
 JS_PUBLIC_API(JSOp)
 JS_GetTrapOpcode(JSContext *cx, JSScript *script, jsbytecode *pc)
 {
     BreakpointSite *site = script->compartment()->getBreakpointSite(pc);
     return site ? site->realOpcode : JSOp(*pc);
 }
 
 JS_PUBLIC_API(void)
 JS_ClearTrap(JSContext *cx, JSScript *script, jsbytecode *pc,
              JSTrapHandler *handlerp, jsval *closurep)
 {
     if (BreakpointSite *site = script->compartment()->getBreakpointSite(pc)) {
-        site->clearTrap(cx, NULL, handlerp, Valueify(closurep));
+        site->clearTrap(cx, NULL, handlerp, closurep);
     } else {
         if (handlerp)
             *handlerp = NULL;
         if (closurep)
             *closurep = JSVAL_VOID;
     }
 }
 
@@ -520,17 +520,17 @@ JS_PUBLIC_API(JSScript *)
 JS_GetFunctionScript(JSContext *cx, JSFunction *fun)
 {
     return fun->maybeScript();
 }
 
 JS_PUBLIC_API(JSNative)
 JS_GetFunctionNative(JSContext *cx, JSFunction *fun)
 {
-    return Jsvalify(fun->maybeNative());
+    return fun->maybeNative();
 }
 
 JS_PUBLIC_API(JSPrincipals *)
 JS_GetScriptPrincipals(JSContext *cx, JSScript *script)
 {
     return script->principals;
 }
 
@@ -659,17 +659,17 @@ JS_GetFrameThis(JSContext *cx, JSStackFr
         return false;
 
     js::AutoCompartment ac(cx, &fp->scopeChain());
     if (!ac.enter())
         return false;
 
     if (!ComputeThis(cx, fp))
         return false;
-    *thisv = Jsvalify(fp->thisValue());
+    *thisv = fp->thisValue();
     return true;
 }
 
 JS_PUBLIC_API(JSFunction *)
 JS_GetFrameFunction(JSContext *cx, JSStackFrame *fp)
 {
     return Valueify(fp)->maybeFun();
 }
@@ -700,18 +700,18 @@ JS_GetFrameCalleeObject(JSContext *cx, J
 
 JS_PUBLIC_API(JSBool)
 JS_GetValidFrameCalleeObject(JSContext *cx, JSStackFrame *fp, jsval *vp)
 {
     Value v;
 
     if (!Valueify(fp)->getValidCalleeObject(cx, &v))
         return false;
-    *vp = v.isObject() ? Jsvalify(v) : JSVAL_VOID;
-    *vp = Jsvalify(v);
+    *vp = v.isObject() ? v : JSVAL_VOID;
+    *vp = v;
     return true;
 }
 
 JS_PUBLIC_API(JSBool)
 JS_IsDebuggerFrame(JSContext *cx, JSStackFrame *fp)
 {
     return Valueify(fp)->isDebuggerFrame();
 }
@@ -720,28 +720,28 @@ JS_PUBLIC_API(JSBool)
 JS_IsGlobalFrame(JSContext *cx, JSStackFrame *fp)
 {
     return Valueify(fp)->isGlobalFrame();
 }
 
 JS_PUBLIC_API(jsval)
 JS_GetFrameReturnValue(JSContext *cx, JSStackFrame *fp)
 {
-    return Jsvalify(Valueify(fp)->returnValue());
+    return Valueify(fp)->returnValue();
 }
 
 JS_PUBLIC_API(void)
 JS_SetFrameReturnValue(JSContext *cx, JSStackFrame *fpArg, jsval rval)
 {
     StackFrame *fp = Valueify(fpArg);
 #ifdef JS_METHODJIT
     JS_ASSERT_IF(fp->isScriptFrame(), fp->script()->debugMode);
 #endif
     assertSameCompartment(cx, fp, rval);
-    fp->setReturnValue(Valueify(rval));
+    fp->setReturnValue(rval);
 }
 
 /************************************************************************/
 
 JS_PUBLIC_API(const char *)
 JS_GetScriptFilename(JSContext *cx, JSScript *script)
 {
     return script->filename;
@@ -805,17 +805,17 @@ JS_EvaluateUCInStackFrame(JSContext *cx,
     if (!scobj)
         return false;
 
     js::AutoCompartment ac(cx, scobj);
     if (!ac.enter())
         return false;
 
     StackFrame *fp = Valueify(fpArg);
-    return EvaluateInScope(cx, scobj, fp, chars, length, filename, lineno, Valueify(rval));
+    return EvaluateInScope(cx, scobj, fp, chars, length, filename, lineno, rval);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_EvaluateInStackFrame(JSContext *cx, JSStackFrame *fp,
                         const char *bytes, uintN length,
                         const char *filename, uintN lineno,
                         jsval *rval)
 {
@@ -870,23 +870,23 @@ JS_GetPropertyDesc(JSContext *cx, JSObje
     pd->id = IdToJsval(shape->propid);
 
     JSBool wasThrowing = cx->isExceptionPending();
     Value lastException = UndefinedValue();
     if (wasThrowing)
         lastException = cx->getPendingException();
     cx->clearPendingException();
 
-    if (!js_GetProperty(cx, obj, shape->propid, Valueify(&pd->value))) {
+    if (!js_GetProperty(cx, obj, shape->propid, &pd->value)) {
         if (!cx->isExceptionPending()) {
             pd->flags = JSPD_ERROR;
             pd->value = JSVAL_VOID;
         } else {
             pd->flags = JSPD_EXCEPTION;
-            pd->value = Jsvalify(cx->getPendingException());
+            pd->value = cx->getPendingException();
         }
     } else {
         pd->flags = 0;
     }
 
     if (wasThrowing)
         cx->setPendingException(lastException);
 
@@ -938,24 +938,24 @@ JS_GetPropertyDescArray(JSContext *cx, J
     }
 
     uint32 n = obj->propertyCount();
     JSPropertyDesc *pd = (JSPropertyDesc *) cx->malloc_(size_t(n) * sizeof(JSPropertyDesc));
     if (!pd)
         return JS_FALSE;
     uint32 i = 0;
     for (Shape::Range r = obj->lastProperty()->all(); !r.empty(); r.popFront()) {
-        if (!js_AddRoot(cx, Valueify(&pd[i].id), NULL))
+        if (!js_AddRoot(cx, &pd[i].id, NULL))
             goto bad;
-        if (!js_AddRoot(cx, Valueify(&pd[i].value), NULL))
+        if (!js_AddRoot(cx, &pd[i].value, NULL))
             goto bad;
         Shape *shape = const_cast<Shape *>(&r.front());
         if (!JS_GetPropertyDesc(cx, obj, reinterpret_cast<JSScopeProperty *>(shape), &pd[i]))
             goto bad;
-        if ((pd[i].flags & JSPD_ALIAS) && !js_AddRoot(cx, Valueify(&pd[i].alias), NULL))
+        if ((pd[i].flags & JSPD_ALIAS) && !js_AddRoot(cx, &pd[i].alias, NULL))
             goto bad;
         if (++i == n)
             break;
     }
     pda->length = i;
     pda->array = pd;
     return JS_TRUE;
 
--- a/js/src/jsexn.cpp
+++ b/js/src/jsexn.cpp
@@ -88,23 +88,23 @@ exn_finalize(JSContext *cx, JSObject *ob
 static JSBool
 exn_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags,
             JSObject **objp);
 
 Class js::ErrorClass = {
     js_Error_str,
     JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE |
     JSCLASS_HAS_CACHED_PROTO(JSProto_Error),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
     (JSResolveOp)exn_resolve,
-    ConvertStub,
+    JS_ConvertStub,
     exn_finalize,
     NULL,                 /* reserved0   */
     NULL,                 /* checkAccess */
     NULL,                 /* call        */
     NULL,                 /* construct   */
     NULL,                 /* xdrObject   */
     NULL,                 /* hasInstance */
     exn_trace
@@ -293,19 +293,17 @@ struct AppendArg {
 static bool
 InitExnPrivate(JSContext *cx, JSObject *exnObject, JSString *message,
                JSString *filename, uintN lineno, JSErrorReport *report, intN exnType)
 {
     JS_ASSERT(exnObject->isError());
     JS_ASSERT(!exnObject->getPrivate());
 
     JSSecurityCallbacks *callbacks = JS_GetSecurityCallbacks(cx);
-    CheckAccessOp checkAccess = callbacks
-                                ? Valueify(callbacks->checkObjectAccess)
-                                : NULL;
+    JSCheckAccessOp checkAccess = callbacks ? callbacks->checkObjectAccess : NULL;
 
     Vector<JSStackTraceElem> frames(cx);
     Vector<Value> values(cx);
     {
         SuppressErrorsGuard seg(cx);
         for (FrameRegsIter i(cx); !i.done(); ++i) {
             /*
              * An exception object stores stack values from 'fp' which may be
@@ -376,17 +374,17 @@ InitExnPrivate(JSContext *cx, JSObject *
     priv->message = message;
     priv->filename = filename;
     priv->lineno = lineno;
     priv->stackDepth = frames.length();
     priv->exnType = exnType;
 
     JSStackTraceElem *framesDest = priv->stackElems;
     Value *valuesDest = reinterpret_cast<Value *>(framesDest + frames.length());
-    JS_ASSERT(valuesDest == Valueify(GetStackTraceValueBuffer(priv)));
+    JS_ASSERT(valuesDest == GetStackTraceValueBuffer(priv));
 
     PodCopy(framesDest, frames.begin(), frames.length());
     PodCopy(valuesDest, values.begin(), values.length());
 
     exnObject->setPrivate(priv);
     return true;
 }
 
@@ -634,17 +632,17 @@ StackTraceToString(JSContext *cx, JSExnP
     elem = priv->stackElems;
     for (endElem = elem + priv->stackDepth; elem != endElem; elem++) {
         if (elem->funName) {
             APPEND_STRING_TO_STACK(elem->funName);
             APPEND_CHAR_TO_STACK('(');
             for (i = 0; i != elem->argc; i++, values++) {
                 if (i > 0)
                     APPEND_CHAR_TO_STACK(',');
-                str = ValueToShortSource(cx, Valueify(*values));
+                str = ValueToShortSource(cx, *values);
                 if (!str)
                     goto bad;
                 APPEND_STRING_TO_STACK(str);
             }
             APPEND_CHAR_TO_STACK(')');
         }
         APPEND_CHAR_TO_STACK('@');
         if (elem->filename) {
@@ -790,17 +788,17 @@ exn_toString(JSContext *cx, uintN argc, 
     jsval v;
     JSString *name, *message, *result;
     jschar *chars, *cp;
     size_t name_length, message_length, length;
 
     JSObject *obj = ToObject(cx, &vp[1]);
     if (!obj)
         return JS_FALSE;
-    if (!obj->getProperty(cx, ATOM_TO_JSID(cx->runtime->atomState.nameAtom), Valueify(&v)))
+    if (!obj->getProperty(cx, ATOM_TO_JSID(cx->runtime->atomState.nameAtom), &v))
         return JS_FALSE;
     name = JSVAL_IS_STRING(v) ? JSVAL_TO_STRING(v) : cx->runtime->emptyString;
     vp->setString(name);
 
     if (!JS_GetProperty(cx, obj, js_message_str, &v))
         return JS_FALSE;
     message = JSVAL_IS_STRING(v) ? JSVAL_TO_STRING(v)
                                  : cx->runtime->emptyString;
@@ -859,41 +857,41 @@ exn_toSource(JSContext *cx, uintN argc, 
     if (!obj->getProperty(cx, ATOM_TO_JSID(cx->runtime->atomState.nameAtom), vp))
         return false;
     name = js_ValueToString(cx, *vp);
     if (!name)
         return false;
     vp->setString(name);
 
     {
-        AutoArrayRooter tvr(cx, JS_ARRAY_LENGTH(localroots), Valueify(localroots));
+        AutoArrayRooter tvr(cx, JS_ARRAY_LENGTH(localroots), localroots);
 
 #ifdef __GNUC__
         message = filename = NULL;
 #endif
         if (!JS_GetProperty(cx, obj, js_message_str, &localroots[0]) ||
-            !(message = js_ValueToSource(cx, Valueify(localroots[0])))) {
+            !(message = js_ValueToSource(cx, localroots[0]))) {
             return false;
         }
         localroots[0] = STRING_TO_JSVAL(message);
 
         if (!JS_GetProperty(cx, obj, js_fileName_str, &localroots[1]) ||
-            !(filename = js_ValueToSource(cx, Valueify(localroots[1])))) {
+            !(filename = js_ValueToSource(cx, localroots[1]))) {
             return false;
         }
         localroots[1] = STRING_TO_JSVAL(filename);
 
         if (!JS_GetProperty(cx, obj, js_lineNumber_str, &localroots[2]))
             return false;
         uint32_t lineno;
-        if (!ValueToECMAUint32(cx, Valueify(localroots[2]), &lineno))
+        if (!ValueToECMAUint32(cx, localroots[2], &lineno))
             return false;
 
         if (lineno != 0) {
-            lineno_as_str = js_ValueToString(cx, Valueify(localroots[2]));
+            lineno_as_str = js_ValueToString(cx, localroots[2]);
             if (!lineno_as_str)
                 return false;
             lineno_length = lineno_as_str->length();
         } else {
             lineno_as_str = NULL;
             lineno_length = 0;
         }
 
@@ -1015,23 +1013,23 @@ InitErrorClass(JSContext *cx, GlobalObje
         return NULL;
 
     Value empty = StringValue(cx->runtime->emptyString);
     jsid nameId = ATOM_TO_JSID(cx->runtime->atomState.nameAtom);
     jsid messageId = ATOM_TO_JSID(cx->runtime->atomState.messageAtom);
     jsid fileNameId = ATOM_TO_JSID(cx->runtime->atomState.fileNameAtom);
     jsid lineNumberId = ATOM_TO_JSID(cx->runtime->atomState.lineNumberAtom);
     if (!DefineNativeProperty(cx, errorProto, nameId, StringValue(name),
-                              PropertyStub, StrictPropertyStub, 0, 0, 0) ||
+                              JS_PropertyStub, JS_StrictPropertyStub, 0, 0, 0) ||
         !DefineNativeProperty(cx, errorProto, messageId, empty,
-                              PropertyStub, StrictPropertyStub, 0, 0, 0) ||
+                              JS_PropertyStub, JS_StrictPropertyStub, 0, 0, 0) ||
         !DefineNativeProperty(cx, errorProto, fileNameId, empty,
-                              PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE, 0, 0) ||
+                              JS_PropertyStub, JS_StrictPropertyStub, JSPROP_ENUMERATE, 0, 0) ||
         !DefineNativeProperty(cx, errorProto, lineNumberId, Int32Value(0),
-                              PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE, 0, 0))
+                              JS_PropertyStub, JS_StrictPropertyStub, JSPROP_ENUMERATE, 0, 0))
     {
         return NULL;
     }
 
     /* Create the corresponding constructor. */
     JSFunction *ctor = global->createConstructor(cx, Exception, &ErrorClass, name, 1);
     if (!ctor)
         return NULL;
@@ -1154,17 +1152,17 @@ js_ErrorToException(JSContext *cx, const
     if (cx->generatingError)
         return JS_FALSE;
 
     MUST_FLOW_THROUGH("out");
     cx->generatingError = JS_TRUE;
 
     /* Protect the newly-created strings below from nesting GCs. */
     PodArrayZero(tv);
-    AutoArrayRooter tvr(cx, JS_ARRAY_LENGTH(tv), Valueify(tv));
+    AutoArrayRooter tvr(cx, JS_ARRAY_LENGTH(tv), tv);
 
     /*
      * Try to get an appropriate prototype by looking up the corresponding
      * exception constructor name in the scope chain of the current context's
      * top stack frame, or in the global object if no frame is active.
      */
     ok = js_GetClassPrototype(cx, NULL, GetExceptionProtoKey(exn), &errProto);
     if (!ok)
@@ -1219,17 +1217,17 @@ js_ReportUncaughtException(JSContext *cx
 
     if (!JS_IsExceptionPending(cx))
         return true;
 
     if (!JS_GetPendingException(cx, &exn))
         return false;
 
     PodArrayZero(roots);
-    AutoArrayRooter tvr(cx, JS_ARRAY_LENGTH(roots), Valueify(roots));
+    AutoArrayRooter tvr(cx, JS_ARRAY_LENGTH(roots), roots);
 
     /*
      * Because js_ValueToString below could error and an exception object
      * could become unrooted, we must root exnObject.  Later, if exnObject is
      * non-null, we need to root other intermediates, so allocate an operand
      * stack segment to protect all of these values.
      */
     if (JSVAL_IS_PRIMITIVE(exn)) {
@@ -1238,17 +1236,17 @@ js_ReportUncaughtException(JSContext *cx
         exnObject = JSVAL_TO_OBJECT(exn);
         roots[0] = exn;
     }
 
     JS_ClearPendingException(cx);
     reportp = js_ErrorFromException(cx, exn);
 
     /* XXX L10N angels cry once again (see also jsemit.c, /L10N gaffes/) */
-    str = js_ValueToString(cx, Valueify(exn));
+    str = js_ValueToString(cx, exn);
     JSAutoByteString bytesStorage;
     if (!str) {
         bytes = "unknown (can't convert to string)";
     } else {
         roots[1] = STRING_TO_JSVAL(str);
         if (!bytesStorage.encode(cx, str))
             return false;
         bytes = bytesStorage.ptr();
@@ -1262,24 +1260,24 @@ js_ReportUncaughtException(JSContext *cx
             bytesStorage.clear();
             if (!bytesStorage.encode(cx, str))
                 return false;
             bytes = bytesStorage.ptr();
         }
 
         if (!JS_GetProperty(cx, exnObject, js_fileName_str, &roots[3]))
             return false;
-        str = js_ValueToString(cx, Valueify(roots[3]));
+        str = js_ValueToString(cx, roots[3]);
         if (!str || !filename.encode(cx, str))
             return false;
 
         if (!JS_GetProperty(cx, exnObject, js_lineNumber_str, &roots[4]))
             return false;
         uint32_t lineno;
-        if (!ValueToECMAUint32(cx, Valueify(roots[4]), &lineno))
+        if (!ValueToECMAUint32(cx, roots[4], &lineno))
             return false;
 
         reportp = &report;
         PodZero(&report);
         report.filename = filename.ptr();
         report.lineno = (uintN) lineno;
         if (JSVAL_IS_STRING(roots[2])) {
             JSFixedString *fixed = JSVAL_TO_STRING(roots[2])->ensureFixed(cx);
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -693,74 +693,74 @@ args_trace(JSTracer *trc, JSObject *obj)
  * StackFrame with their corresponding property values in the frame's
  * arguments object.
  */
 Class js::NormalArgumentsObjectClass = {
     "Arguments",
     JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE |
     JSCLASS_HAS_RESERVED_SLOTS(NormalArgumentsObject::RESERVED_SLOTS) |
     JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
-    PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* addProperty */
     args_delProperty,
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
     args_enumerate,
     reinterpret_cast<JSResolveOp>(args_resolve),
-    ConvertStub,
-    args_finalize,        /* finalize   */
-    NULL,                 /* reserved0   */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call        */
-    NULL,                 /* construct   */
-    NULL,                 /* xdrObject   */
-    NULL,                 /* hasInstance */
+    JS_ConvertStub,
+    args_finalize,           /* finalize   */
+    NULL,                    /* reserved0   */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call        */
+    NULL,                    /* construct   */
+    NULL,                    /* xdrObject   */
+    NULL,                    /* hasInstance */
     args_trace
 };
 
 /*
  * Strict mode arguments is significantly less magical than non-strict mode
  * arguments, so it is represented by a different class while sharing some
  * functionality.
  */
 Class js::StrictArgumentsObjectClass = {
     "Arguments",
     JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE |
     JSCLASS_HAS_RESERVED_SLOTS(StrictArgumentsObject::RESERVED_SLOTS) |
     JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
-    PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* addProperty */
     args_delProperty,
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
     strictargs_enumerate,
     reinterpret_cast<JSResolveOp>(strictargs_resolve),
-    ConvertStub,
-    args_finalize,        /* finalize   */
-    NULL,                 /* reserved0   */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call        */
-    NULL,                 /* construct   */
-    NULL,                 /* xdrObject   */
-    NULL,                 /* hasInstance */
+    JS_ConvertStub,
+    args_finalize,           /* finalize   */
+    NULL,                    /* reserved0   */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call        */
+    NULL,                    /* construct   */
+    NULL,                    /* xdrObject   */
+    NULL,                    /* hasInstance */
     args_trace
 };
 
 /*
  * A Declarative Environment object stores its active StackFrame pointer in
  * its private slot, just as Call and Arguments objects do.
  */
 Class js::DeclEnvClass = {
     js_Object_str,
     JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub
 };
 
 static inline JSObject *
 NewDeclEnvObject(JSContext *cx, StackFrame *fp)
 {
     JSObject *envobj = js_NewGCObject(cx, FINALIZE_OBJECT2);
     if (!envobj)
         return NULL;
@@ -1150,30 +1150,30 @@ call_trace(JSTracer *trc, JSObject *obj)
     MaybeMarkGenerator(trc, obj);
 }
 
 JS_PUBLIC_DATA(Class) js::CallClass = {
     "Call",
     JSCLASS_HAS_PRIVATE |
     JSCLASS_HAS_RESERVED_SLOTS(CallObject::RESERVED_SLOTS) |
     JSCLASS_NEW_RESOLVE | JSCLASS_IS_ANONYMOUS,
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
     JS_EnumerateStub,
     (JSResolveOp)call_resolve,
-    NULL,                 /* convert: Leave it NULL so we notice if calls ever escape */
-    NULL,                 /* finalize */
-    NULL,                 /* reserved0   */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call        */
-    NULL,                 /* construct   */
-    NULL,                 /* xdrObject   */
-    NULL,                 /* hasInstance */
+    NULL,                    /* convert: Leave it NULL so we notice if calls ever escape */
+    NULL,                    /* finalize */
+    NULL,                    /* reserved0   */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call        */
+    NULL,                    /* construct   */
+    NULL,                    /* xdrObject   */
+    NULL,                    /* hasInstance */
     call_trace
 };
 
 bool
 StackFrame::getValidCalleeObject(JSContext *cx, Value *vp)
 {
     if (!isFunctionFrame()) {
         vp->setNull();
@@ -1446,20 +1446,20 @@ ResolveInterpretedFunctionPrototype(JSCo
 
     /*
      * Per ES5 15.3.5.2 a user-defined function's .prototype property is
      * initially non-configurable, non-enumerable, and writable.  Per ES5 13.2
      * the prototype's .constructor property is configurable, non-enumerable,
      * and writable.
      */
     if (!obj->defineProperty(cx, ATOM_TO_JSID(cx->runtime->atomState.classPrototypeAtom),
-                             ObjectValue(*proto), PropertyStub, StrictPropertyStub,
+                             ObjectValue(*proto), JS_PropertyStub, JS_StrictPropertyStub,
                              JSPROP_PERMANENT) ||
         !proto->defineProperty(cx, ATOM_TO_JSID(cx->runtime->atomState.constructorAtom),
-                               ObjectValue(*obj), PropertyStub, StrictPropertyStub, 0))
+                               ObjectValue(*obj), JS_PropertyStub, JS_StrictPropertyStub, 0))
     {
        return NULL;
     }
 
     return proto;
 }
 
 static JSBool
@@ -1498,17 +1498,17 @@ fun_resolve(JSContext *cx, JSObject *obj
         JS_ASSERT(!IsInternalFunctionObject(obj));
 
         Value v;
         if (JSID_IS_ATOM(id, cx->runtime->atomState.lengthAtom))
             v.setInt32(fun->nargs);
         else
             v.setString(fun->atom ? fun->atom : cx->runtime->emptyString);
         
-        if (!DefineNativeProperty(cx, obj, id, v, PropertyStub, StrictPropertyStub,
+        if (!DefineNativeProperty(cx, obj, id, v, JS_PropertyStub, JS_StrictPropertyStub,
                                   JSPROP_PERMANENT | JSPROP_READONLY, 0, 0)) {
             return false;
         }
         *objp = obj;
         return true;
     }
 
     for (uintN i = 0; i < JS_ARRAY_LENGTH(poisonPillProps); i++) {
@@ -1523,17 +1523,17 @@ fun_resolve(JSContext *cx, JSObject *obj
             if (fun->isInterpreted() ? fun->inStrictMode() : obj->isBoundFunction()) {
                 JSObject *throwTypeError = obj->getThrowTypeError();
 
                 getter = CastAsPropertyOp(throwTypeError);
                 setter = CastAsStrictPropertyOp(throwTypeError);
                 attrs |= JSPROP_GETTER | JSPROP_SETTER;
             } else {
                 getter = fun_getProperty;
-                setter = StrictPropertyStub;
+                setter = JS_StrictPropertyStub;
             }
 
             if (!DefineNativeProperty(cx, obj, id, UndefinedValue(), getter, setter,
                                       attrs, 0, 0)) {
                 return false;
             }
             *objp = obj;
             return true;
@@ -1693,28 +1693,28 @@ fun_finalize(JSContext *cx, JSObject *ob
  * and those on which ad-hoc properties are defined.
  */
 JS_PUBLIC_DATA(Class) js::FunctionClass = {
     js_Function_str,
     JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE |
     JSCLASS_HAS_RESERVED_SLOTS(JSFunction::CLASS_RESERVED_SLOTS) |
     JSCLASS_HAS_CACHED_PROTO(JSProto_Function) |
     JSCLASS_CONCURRENT_FINALIZER,
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
     fun_enumerate,
     (JSResolveOp)fun_resolve,
-    ConvertStub,
+    JS_ConvertStub,
     fun_finalize,
-    NULL,                 /* reserved0   */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call        */
-    NULL,                 /* construct   */
+    NULL,                    /* reserved0   */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call        */
+    NULL,                    /* construct   */
     NULL,
     fun_hasInstance,
     fun_trace
 };
 
 JSString *
 fun_toStringHelper(JSContext *cx, JSObject *obj, uintN indent)
 {
@@ -2356,17 +2356,17 @@ js_NewFunction(JSContext *cx, JSObject *
         fun->u.i.skipmin = 0;
         fun->u.i.script = NULL;
     } else {
         fun->u.n.clasp = NULL;
         if (flags & JSFUN_TRCINFO) {
 #ifdef JS_TRACER
             JSNativeTraceInfo *trcinfo =
                 JS_FUNC_TO_DATA_PTR(JSNativeTraceInfo *, native);
-            fun->u.n.native = (js::Native) trcinfo->native;
+            fun->u.n.native = (Native) trcinfo->native;
             fun->u.n.trcinfo = trcinfo;
 #else
             fun->u.n.trcinfo = NULL;
 #endif
         } else {
             fun->u.n.native = native;
             fun->u.n.trcinfo = NULL;
         }
@@ -2524,18 +2524,18 @@ js_DefineFunction(JSContext *cx, JSObjec
     if (attrs & JSFUN_STUB_GSOPS) {
         /*
          * JSFUN_STUB_GSOPS is a request flag only, not stored in fun->flags or
          * the defined property's attributes. This allows us to encode another,
          * internal flag using the same bit, JSFUN_EXPR_CLOSURE -- see jsfun.h
          * for more on this.
          */
         attrs &= ~JSFUN_STUB_GSOPS;
-        gop = PropertyStub;
-        sop = StrictPropertyStub;
+        gop = JS_PropertyStub;
+        sop = JS_StrictPropertyStub;
     } else {
         gop = NULL;
         sop = NULL;
     }
 
     /*
      * Historically, all objects have had a parent member as intrinsic scope
      * chain link. We want to move away from this universal parent, but JS
--- a/js/src/jsfun.h
+++ b/js/src/jsfun.h
@@ -199,22 +199,22 @@ struct JSFunction : public JSObject_Slot
         JS_ASSERT(isInterpreted());
         return u.i.script;
     }
 
     JSScript * maybeScript() const {
         return isInterpreted() ? script() : NULL;
     }
 
-    js::Native native() const {
+    JSNative native() const {
         JS_ASSERT(isNative());
         return u.n.native;
     }
 
-    js::Native maybeNative() const {
+    JSNative maybeNative() const {
         return isInterpreted() ? NULL : native();
     }
 
     static uintN offsetOfNativeOrScript() {
         JS_STATIC_ASSERT(offsetof(U, n.native) == offsetof(U, i.script));
         JS_STATIC_ASSERT(offsetof(U, n.native) == offsetof(U, nativeOrScript));
         return offsetof(JSFunction, u.nativeOrScript);
     }
@@ -301,32 +301,32 @@ IsNativeFunction(const js::Value &v)
 
 static JS_ALWAYS_INLINE bool
 IsNativeFunction(const js::Value &v, JSFunction **fun)
 {
     return IsFunctionObject(v, fun) && (*fun)->isNative();
 }
 
 static JS_ALWAYS_INLINE bool
-IsNativeFunction(const js::Value &v, Native native)
+IsNativeFunction(const js::Value &v, JSNative native)
 {
     JSFunction *fun;
     return IsFunctionObject(v, &fun) && fun->maybeNative() == native;
 }
 
 /*
  * When we have an object of a builtin class, we don't quite know what its
  * valueOf/toString methods are, since these methods may have been overwritten
  * or shadowed. However, we can still do better than the general case by
  * hard-coding the necessary properties for us to find the native we expect.
  *
  * TODO: a per-thread shape-based cache would be faster and simpler.
  */
 static JS_ALWAYS_INLINE bool
-ClassMethodIsNative(JSContext *cx, JSObject *obj, Class *clasp, jsid methodid, Native native)
+ClassMethodIsNative(JSContext *cx, JSObject *obj, Class *clasp, jsid methodid, JSNative native)
 {
     JS_ASSERT(obj->getClass() == clasp);
 
     Value v;
     if (!HasDataProperty(cx, obj, methodid, &v)) {
         JSObject *proto = obj->getProto();
         if (!proto || proto->getClass() != clasp || !HasDataProperty(cx, proto, methodid, &v))
             return false;
@@ -422,17 +422,17 @@ const Shape *
 LookupInterpretedFunctionPrototype(JSContext *cx, JSObject *funobj);
 
 } /* namespace js */
 
 extern JSString *
 fun_toStringHelper(JSContext *cx, JSObject *obj, uintN indent);
 
 extern JSFunction *
-js_NewFunction(JSContext *cx, JSObject *funobj, js::Native native, uintN nargs,
+js_NewFunction(JSContext *cx, JSObject *funobj, JSNative native, uintN nargs,
                uintN flags, JSObject *parent, JSAtom *atom);
 
 extern void
 js_FinalizeFunction(JSContext *cx, JSFunction *fun);
 
 extern JSObject * JS_FASTCALL
 js_CloneFunctionObject(JSContext *cx, JSFunction *fun, JSObject *parent,
                        JSObject *proto);
@@ -482,17 +482,17 @@ CloneFunctionObject(JSContext *cx, JSFun
 
 extern JSObject * JS_FASTCALL
 js_AllocFlatClosure(JSContext *cx, JSFunction *fun, JSObject *scopeChain);
 
 extern JSObject *
 js_NewFlatClosure(JSContext *cx, JSFunction *fun, JSOp op, size_t oplen);
 
 extern JSFunction *
-js_DefineFunction(JSContext *cx, JSObject *obj, jsid id, js::Native native,
+js_DefineFunction(JSContext *cx, JSObject *obj, jsid id, JSNative native,
                   uintN nargs, uintN flags);
 
 /*
  * Flags for js_ValueToFunction and js_ReportIsNotFunction.
  */
 #define JSV2F_CONSTRUCT         INITIAL_CONSTRUCT
 #define JSV2F_SEARCH_STACK      0x10000
 
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -962,17 +962,17 @@ js_FinishGC(JSRuntime *rt)
 #endif
     rt->gcRootsHash.clear();
     rt->gcLocksHash.clear();
 }
 
 JSBool
 js_AddRoot(JSContext *cx, Value *vp, const char *name)
 {
-    JSBool ok = js_AddRootRT(cx->runtime, Jsvalify(vp), name);
+    JSBool ok = js_AddRootRT(cx->runtime, vp, name);
     if (!ok)
         JS_ReportOutOfMemory(cx);
     return ok;
 }
 
 JSBool
 js_AddGCThingRoot(JSContext *cx, void **rp, const char *name)
 {
--- a/js/src/jsinfer.h
+++ b/js/src/jsinfer.h
@@ -42,17 +42,16 @@
 #ifndef jsinfer_h___
 #define jsinfer_h___
 
 #include "jsalloc.h"
 #include "jsarena.h"
 #include "jscell.h"
 #include "jstl.h"
 #include "jsprvtd.h"
-#include "jsvalue.h"
 #include "jshashtable.h"
 
 namespace js {
     class CallArgs;
     namespace analyze {
         class ScriptAnalysis;
     }
     class GlobalObject;
--- a/js/src/jsinterp.cpp
+++ b/js/src/jsinterp.cpp
@@ -484,31 +484,31 @@ no_such_method_trace(JSTracer *trc, JSOb
 {
     gc::MarkValue(trc, obj->getSlot(JSSLOT_FOUND_FUNCTION), "found function");
     gc::MarkValue(trc, obj->getSlot(JSSLOT_SAVED_ID), "saved id");
 }
 
 Class js_NoSuchMethodClass = {
     "NoSuchMethod",
     JSCLASS_HAS_RESERVED_SLOTS(2) | JSCLASS_IS_ANONYMOUS,
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
-    NULL,                 /* finalize */
-    NULL,                 /* reserved0 */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call */
-    NULL,                 /* construct */
-    NULL,                 /* XDR */
-    NULL,                 /* hasInstance */
-    no_such_method_trace  /* trace */
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
+    NULL,                    /* finalize */
+    NULL,                    /* reserved0 */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call */
+    NULL,                    /* construct */
+    NULL,                    /* XDR */
+    NULL,                    /* hasInstance */
+    no_such_method_trace     /* trace */
 };
 
 /*
  * When JSOP_CALLPROP or JSOP_CALLELEM does not find the method property of
  * the base object, we search for the __noSuchMethod__ method in the base.
  * If it exists, we store the method and the property's id into an object of
  * NoSuchMethod class and store this object into the callee's stack slot.
  * Later, Invoke will recognise such an object and transfer control to
@@ -958,17 +958,17 @@ js::LooselyEqual(JSContext *cx, const Va
             return true;
         }
 
         if (lval.isObject()) {
             JSObject *l = &lval.toObject();
             JSObject *r = &rval.toObject();
             l->assertSpecialEqualitySynced();
 
-            if (EqualityOp eq = l->getClass()->ext.equality) {
+            if (JSEqualityOp eq = l->getClass()->ext.equality) {
                 return eq(cx, l, &rval, result);
             }
 
             *result = l == r;
             return true;
         }
 
         *result = lval.payloadAsRawUint32() == rval.payloadAsRawUint32();
@@ -2044,20 +2044,18 @@ js::Interpret(JSContext *cx, StackFrame 
                 AbortRecording(cx, "interrupt hook or singleStepMode");
 #ifdef JS_METHODJIT
             if (TRACE_PROFILER(cx))
                 AbortProfiling(cx);
 #endif
 #endif
             Value rval;
             JSTrapStatus status = JSTRAP_CONTINUE;
-            if (hook) {
-                status = hook(cx, script, regs.pc, Jsvalify(&rval),
-                              cx->debugHooks->interruptHookData);
-            }
+            if (hook)
+                status = hook(cx, script, regs.pc, &rval, cx->debugHooks->interruptHookData);
             if (status == JSTRAP_CONTINUE && script->stepModeEnabled())
                 status = Debugger::onSingleStep(cx, &rval);
             switch (status) {
               case JSTRAP_ERROR:
                 goto error;
               case JSTRAP_CONTINUE:
                 break;
               case JSTRAP_RETURN:
@@ -2685,33 +2683,33 @@ END_CASE(JSOP_PICK)
 
 BEGIN_CASE(JSOP_SETCONST)
 {
     JSAtom *atom;
     LOAD_ATOM(0, atom);
     JSObject &obj = regs.fp()->varObj();
     const Value &ref = regs.sp[-1];
     if (!obj.defineProperty(cx, ATOM_TO_JSID(atom), ref,
-                            PropertyStub, StrictPropertyStub,
+                            JS_PropertyStub, JS_StrictPropertyStub,
                             JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY)) {
         goto error;
     }
 }
 END_SET_CASE(JSOP_SETCONST);
 
 #if JS_HAS_DESTRUCTURING
 BEGIN_CASE(JSOP_ENUMCONSTELEM)
 {
     const Value &ref = regs.sp[-3];
     JSObject *obj;
     FETCH_OBJECT(cx, -2, obj);
     jsid id;
     FETCH_ELEMENT_ID(obj, -1, id);
     if (!obj->defineProperty(cx, id, ref,
-                             PropertyStub, StrictPropertyStub,
+                             JS_PropertyStub, JS_StrictPropertyStub,
                              JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY)) {
         goto error;
     }
     regs.sp -= 3;
 }
 END_CASE(JSOP_ENUMCONSTELEM)
 #endif
 
@@ -3222,17 +3220,17 @@ BEGIN_CASE(JSOP_TOID)
         TypeScript::MonitorUnknown(cx, script, regs.pc);
 }
 END_CASE(JSOP_TOID)
 
 BEGIN_CASE(JSOP_TYPEOFEXPR)
 BEGIN_CASE(JSOP_TYPEOF)
 {
     const Value &ref = regs.sp[-1];
-    JSType type = JS_TypeOfValue(cx, Jsvalify(ref));
+    JSType type = JS_TypeOfValue(cx, ref);
     JSAtom *atom = rt->atomState.typeAtoms[type];
     regs.sp[-1].setString(atom);
 }
 END_CASE(JSOP_TYPEOF)
 
 BEGIN_CASE(JSOP_VOID)
     regs.sp[-1].setUndefined();
 END_CASE(JSOP_VOID)
@@ -4630,17 +4628,17 @@ BEGIN_CASE(JSOP_DEFVAR)
          * As attrs includes readonly, CheckRedeclaration can succeed only
          * if prop does not exist.
          */
         shouldDefine = true;
     }
 
     /* Bind a variable only if it's not yet defined. */
     if (shouldDefine &&
-        !DefineNativeProperty(cx, obj, id, UndefinedValue(), PropertyStub, StrictPropertyStub,
+        !DefineNativeProperty(cx, obj, id, UndefinedValue(), JS_PropertyStub, JS_StrictPropertyStub,
                               attrs, 0, 0)) {
         goto error;
     }
 }
 END_CASE(JSOP_DEFVAR)
 
 BEGIN_CASE(JSOP_DEFFUN)
 {
@@ -4708,27 +4706,27 @@ BEGIN_CASE(JSOP_DEFFUN)
     if (!parent->lookupProperty(cx, id, &pobj, &prop))
         goto error;
 
     Value rval = ObjectValue(*obj);
 
     do {
         /* Steps 5d, 5f. */
         if (!prop || pobj != parent) {
-            if (!parent->defineProperty(cx, id, rval, PropertyStub, StrictPropertyStub, attrs))
+            if (!parent->defineProperty(cx, id, rval, JS_PropertyStub, JS_StrictPropertyStub, attrs))
                 goto error;
             break;
         }
 
         /* Step 5e. */
         JS_ASSERT(parent->isNative());
         Shape *shape = reinterpret_cast<Shape *>(prop);
         if (parent->isGlobal()) {
             if (shape->configurable()) {
-                if (!parent->defineProperty(cx, id, rval, PropertyStub, StrictPropertyStub, attrs))
+                if (!parent->defineProperty(cx, id, rval, JS_PropertyStub, JS_StrictPropertyStub, attrs))
                     goto error;
                 break;
             }
 
             if (shape->isAccessorDescriptor() || !shape->writable() || !shape->enumerable()) {
                 JSAutoByteString bytes;
                 if (const char *name = js_ValueToPrintable(cx, IdToValue(id), &bytes)) {
                     JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
@@ -4770,17 +4768,17 @@ BEGIN_CASE(JSOP_DEFFUN_FC)
     JSObject &parent = regs.fp()->varObj();
 
     jsid id = ATOM_TO_JSID(fun->atom);
     if (!CheckRedeclaration(cx, &parent, id, attrs))
         goto error;
 
     if ((attrs == JSPROP_ENUMERATE)
         ? !parent.setProperty(cx, id, &rval, script->strictModeCode)
-        : !parent.defineProperty(cx, id, rval, PropertyStub, StrictPropertyStub, attrs)) {
+        : !parent.defineProperty(cx, id, rval, JS_PropertyStub, JS_StrictPropertyStub, attrs)) {
         goto error;
     }
 }
 END_CASE(JSOP_DEFFUN_FC)
 
 BEGIN_CASE(JSOP_DEFLOCALFUN)
 {
     /*
@@ -5047,20 +5045,20 @@ BEGIN_CASE(JSOP_SETTER)
     uintN attrs;
     if (!CheckAccess(cx, obj, id, JSACC_WATCH, &rtmp, &attrs))
         goto error;
 
     PropertyOp getter;
     StrictPropertyOp setter;
     if (op == JSOP_GETTER) {
         getter = CastAsPropertyOp(&rval.toObject());
-        setter = StrictPropertyStub;
+        setter = JS_StrictPropertyStub;
         attrs = JSPROP_GETTER;
     } else {
-        getter = PropertyStub;
+        getter = JS_PropertyStub;
         setter = CastAsStrictPropertyOp(&rval.toObject());
         attrs = JSPROP_SETTER;
     }
     attrs |= JSPROP_ENUMERATE | JSPROP_SHARED;
 
     /* Check for a readonly or permanent property of the same name. */
     if (!CheckRedeclaration(cx, obj, id, attrs))
         goto error;
@@ -5482,17 +5480,17 @@ BEGIN_CASE(JSOP_INSTANCEOF)
 }
 END_CASE(JSOP_INSTANCEOF)
 
 BEGIN_CASE(JSOP_DEBUGGER)
 {
     JSTrapStatus st = JSTRAP_CONTINUE;
     Value rval;
     if (JSDebuggerHandler handler = cx->debugHooks->debuggerHandler)
-        st = handler(cx, script, regs.pc, Jsvalify(&rval), cx->debugHooks->debuggerHandlerData);
+        st = handler(cx, script, regs.pc, &rval, cx->debugHooks->debuggerHandlerData);
     if (st == JSTRAP_CONTINUE)
         st = Debugger::onDebuggerStatement(cx, &rval);
     switch (st) {
       case JSTRAP_ERROR:
         goto error;
       case JSTRAP_CONTINUE:
         break;
       case JSTRAP_RETURN:
@@ -5640,29 +5638,29 @@ BEGIN_CASE(JSOP_XMLNAME)
 }
 END_CASE(JSOP_XMLNAME)
 
 BEGIN_CASE(JSOP_DESCENDANTS)
 BEGIN_CASE(JSOP_DELDESC)
 {
     JSObject *obj;
     FETCH_OBJECT(cx, -2, obj);
-    jsval rval = Jsvalify(regs.sp[-1]);
+    jsval rval = regs.sp[-1];
     if (!js_GetXMLDescendants(cx, obj, rval, &rval))
         goto error;
 
     if (op == JSOP_DELDESC) {
-        regs.sp[-1] = Valueify(rval);   /* set local root */
+        regs.sp[-1] = rval;   /* set local root */
         if (!js_DeleteXMLListElements(cx, JSVAL_TO_OBJECT(rval)))
             goto error;
         rval = JSVAL_TRUE;                  /* always succeed */
     }
 
     regs.sp--;
-    regs.sp[-1] = Valueify(rval);
+    regs.sp[-1] = rval;
 }
 END_CASE(JSOP_DESCENDANTS)
 
 {
 BEGIN_CASE(JSOP_FILTER)
     /*
      * We push the hole value before jumping to [enditer] so we can detect the
      * first iteration and direct js_StepXMLListFilter to initialize filter's
@@ -6016,17 +6014,17 @@ END_CASE(JSOP_ARRAYPUSH)
 
         /* Call debugger throw hook if set. */
         if (cx->debugHooks->throwHook || !cx->compartment->getDebuggees().empty()) {
             Value rval;
             JSTrapStatus st = Debugger::onExceptionUnwind(cx, &rval);
             if (st == JSTRAP_CONTINUE) {
                 handler = cx->debugHooks->throwHook;
                 if (handler)
-                    st = handler(cx, script, regs.pc, Jsvalify(&rval), cx->debugHooks->throwHookData);
+                    st = handler(cx, script, regs.pc, &rval, cx->debugHooks->throwHookData);
             }
 
             switch (st) {
               case JSTRAP_ERROR:
                 cx->clearPendingException();
                 goto error;
               case JSTRAP_RETURN:
                 cx->clearPendingException();
--- a/js/src/jsinterp.h
+++ b/js/src/jsinterp.h
@@ -42,17 +42,16 @@
 #define jsinterp_h___
 /*
  * JS interpreter interface.
  */
 #include "jsprvtd.h"
 #include "jspubtd.h"
 #include "jsopcode.h"
 #include "jsscript.h"
-#include "jsvalue.h"
 
 #include "vm/Stack.h"
 
 namespace js {
 
 extern JSObject *
 GetBlockChain(JSContext *cx, StackFrame *fp);
 
@@ -342,11 +341,111 @@ extern bool
 UnwindScope(JSContext *cx, jsint stackDepth, JSBool normalUnwind);
 
 extern bool
 OnUnknownMethod(JSContext *cx, js::Value *vp);
 
 extern bool
 IsActiveWithOrBlock(JSContext *cx, JSObject &obj, int stackDepth);
 
+/************************************************************************/
+
+static JS_ALWAYS_INLINE void
+ClearValueRange(Value *vec, uintN len, bool useHoles)
+{
+    if (useHoles) {
+        for (uintN i = 0; i < len; i++)
+            vec[i].setMagic(JS_ARRAY_HOLE);
+    } else {
+        for (uintN i = 0; i < len; i++)
+            vec[i].setUndefined();
+    }
+}
+
+static JS_ALWAYS_INLINE void
+MakeRangeGCSafe(Value *vec, size_t len)
+{
+    PodZero(vec, len);
+}
+
+static JS_ALWAYS_INLINE void
+MakeRangeGCSafe(Value *beg, Value *end)
+{
+    PodZero(beg, end - beg);
+}
+
+static JS_ALWAYS_INLINE void
+MakeRangeGCSafe(jsid *beg, jsid *end)
+{
+    for (jsid *id = beg; id != end; ++id)
+        *id = INT_TO_JSID(0);
+}
+
+static JS_ALWAYS_INLINE void
+MakeRangeGCSafe(jsid *vec, size_t len)
+{
+    MakeRangeGCSafe(vec, vec + len);
+}
+
+static JS_ALWAYS_INLINE void
+MakeRangeGCSafe(const Shape **beg, const Shape **end)
+{
+    PodZero(beg, end - beg);
+}
+
+static JS_ALWAYS_INLINE void
+MakeRangeGCSafe(const Shape **vec, size_t len)
+{
+    PodZero(vec, len);
+}
+
+static JS_ALWAYS_INLINE void
+SetValueRangeToUndefined(Value *beg, Value *end)
+{
+    for (Value *v = beg; v != end; ++v)
+        v->setUndefined();
+}
+
+static JS_ALWAYS_INLINE void
+SetValueRangeToUndefined(Value *vec, size_t len)
+{
+    SetValueRangeToUndefined(vec, vec + len);
+}
+
+static JS_ALWAYS_INLINE void
+SetValueRangeToNull(Value *beg, Value *end)
+{
+    for (Value *v = beg; v != end; ++v)
+        v->setNull();
+}
+
+static JS_ALWAYS_INLINE void
+SetValueRangeToNull(Value *vec, size_t len)
+{
+    SetValueRangeToNull(vec, vec + len);
+}
+
+/*
+ * To really poison a set of values, using 'magic' or 'undefined' isn't good
+ * enough since often these will just be ignored by buggy code (see bug 629974)
+ * in debug builds and crash in release builds. Instead, we use a safe-for-crash
+ * pointer.
+ */
+static JS_ALWAYS_INLINE void
+Debug_SetValueRangeToCrashOnTouch(Value *beg, Value *end)
+{
+#ifdef DEBUG
+    for (Value *v = beg; v != end; ++v)
+        v->setObject(*reinterpret_cast<JSObject *>(0x42));
+#endif
+}
+
+static JS_ALWAYS_INLINE void
+Debug_SetValueRangeToCrashOnTouch(Value *vec, size_t len)
+{
+#ifdef DEBUG
+    Debug_SetValueRangeToCrashOnTouch(vec, vec + len);
+#endif
+}
+
 }  /* namespace js */
 
 #endif /* jsinterp_h___ */
--- a/js/src/jsiter.cpp
+++ b/js/src/jsiter.cpp
@@ -90,37 +90,37 @@ static void iterator_finalize(JSContext 
 static void iterator_trace(JSTracer *trc, JSObject *obj);
 static JSObject *iterator_iterator(JSContext *cx, JSObject *obj, JSBool keysonly);
 
 Class js::IteratorClass = {
     "Iterator",
     JSCLASS_HAS_PRIVATE |
     JSCLASS_CONCURRENT_FINALIZER |
     JSCLASS_HAS_CACHED_PROTO(JSProto_Iterator),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
     iterator_finalize,
-    NULL,                 /* reserved    */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call        */
-    NULL,                 /* construct   */
-    NULL,                 /* xdrObject   */
-    NULL,                 /* hasInstance */
+    NULL,                    /* reserved    */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call        */
+    NULL,                    /* construct   */
+    NULL,                    /* xdrObject   */
+    NULL,                    /* hasInstance */
     iterator_trace,
     {
-        NULL,             /* equality       */
-        NULL,             /* outerObject    */
-        NULL,             /* innerObject    */
-        iterator_iterator,
-        NULL              /* unused  */
+        NULL,                /* equality       */
+        NULL,                /* outerObject    */
+        NULL,                /* innerObject    */
+        iterator_iterator,   
+        NULL                 /* unused  */
     }
 };
 
 void
 NativeIterator::mark(JSTracer *trc)
 {
     MarkIdRange(trc, begin(), end(), "props");
     if (obj)
@@ -1051,29 +1051,29 @@ stopiter_hasInstance(JSContext *cx, JSOb
     *bp = IsStopIteration(*v);
     return JS_TRUE;
 }
 
 Class js::StopIterationClass = {
     js_StopIteration_str,
     JSCLASS_HAS_CACHED_PROTO(JSProto_StopIteration) |
     JSCLASS_FREEZE_PROTO,
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
-    NULL,                 /* finalize    */
-    NULL,                 /* reserved0   */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call        */
-    NULL,                 /* construct   */
-    NULL,                 /* xdrObject   */
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
+    NULL,                    /* finalize    */
+    NULL,                    /* reserved0   */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call        */
+    NULL,                    /* construct   */
+    NULL,                    /* xdrObject   */
     stopiter_hasInstance
 };
 
 #if JS_HAS_GENERATORS
 
 static void
 generator_finalize(JSContext *cx, JSObject *obj)
 {
@@ -1118,37 +1118,37 @@ generator_trace(JSTracer *trc, JSObject 
     MarkStackRangeConservatively(trc, gen->floatingStack, fp->formalArgsEnd());
     js_TraceStackFrame(trc, fp);
     MarkStackRangeConservatively(trc, fp->slots(), gen->regs.sp);
 }
 
 Class js::GeneratorClass = {
     "Generator",
     JSCLASS_HAS_PRIVATE,
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
     generator_finalize,
-    NULL,                 /* reserved    */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call        */
-    NULL,                 /* construct   */
-    NULL,                 /* xdrObject   */
-    NULL,                 /* hasInstance */
+    NULL,                    /* reserved    */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call        */
+    NULL,                    /* construct   */
+    NULL,                    /* xdrObject   */
+    NULL,                    /* hasInstance */
     generator_trace,
     {
-        NULL,             /* equality       */
-        NULL,             /* outerObject    */
-        NULL,             /* innerObject    */
-        iterator_iterator,
-        NULL              /* unused */
+        NULL,                /* equality       */
+        NULL,                /* outerObject    */
+        NULL,                /* innerObject    */
+        iterator_iterator,   
+        NULL                 /* unused */
     }
 };
 
 /*
  * Called from the JSOP_GENERATOR case in the interpreter, with fp referring
  * to the frame by which the generator function was activated.  Create a new
  * JSGenerator object, which contains its own StackFrame that we populate
  * from *fp.  We know that upon return, the JSOP_GENERATOR opcode will return
--- a/js/src/jsmath.cpp
+++ b/js/src/jsmath.cpp
@@ -104,23 +104,23 @@ MathCache::MathCache() {
     JS_ASSERT(JSDOUBLE_IS_NEGZERO(-0.0));
     JS_ASSERT(!JSDOUBLE_IS_NEGZERO(+0.0));
     JS_ASSERT(hash(-0.0) != hash(+0.0));
 }
 
 Class js::MathClass = {
     js_Math_str,
     JSCLASS_HAS_CACHED_PROTO(JSProto_Math),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub
 };
 
 JSBool
 js_math_abs(JSContext *cx, uintN argc, Value *vp)
 {
     jsdouble x, z;
 
     if (argc == 0) {
@@ -848,17 +848,17 @@ static JSFunctionSpec math_static_method
     JS_TN("round",          js_math_round,        1, 0, &js_math_round_trcinfo),
     JS_TN("sin",            math_sin,             1, 0, &math_sin_trcinfo),
     JS_TN("sqrt",           js_math_sqrt,         1, 0, &js_math_sqrt_trcinfo),
     JS_TN("tan",            math_tan,             1, 0, &math_tan_trcinfo),
     JS_FS_END
 };
 
 bool
-js_IsMathFunction(JSNative native)
+js_IsMathFunction(Native native)
 {
     for (size_t i=0; math_static_methods[i].name != NULL; i++) {
         if (native == math_static_methods[i].call)
             return true;
     }
     return false;
 }
 
--- a/js/src/jsnum.cpp
+++ b/js/src/jsnum.cpp
@@ -556,23 +556,23 @@ static JSFunctionSpec number_functions[]
     JS_TN(js_parseFloat_str,    num_parseFloat,      1,0, &num_parseFloat_trcinfo),
     JS_TN(js_parseInt_str,      num_parseInt,        2,0, &num_parseInt_trcinfo),
     JS_FS_END
 };
 
 Class js::NumberClass = {
     js_Number_str,
     JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_HAS_CACHED_PROTO(JSProto_Number),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub
 };
 
 static JSBool
 Number(JSContext *cx, uintN argc, Value *vp)
 {
     /* Sample JS_CALLEE before clobbering. */
     bool isConstructing = IsConstructing(vp);
 
@@ -836,17 +836,17 @@ num_toLocaleString(JSContext *cx, uintN 
         JS_ASSERT(tmpDest - buf + ptrdiff_t(strlen(nint + 1)) <= buflen);
         strcpy(tmpDest, nint + 1);
     } else {
         JS_ASSERT(tmpDest - buf + ptrdiff_t(strlen(nint)) <= buflen);
         strcpy(tmpDest, nint);
     }
 
     if (cx->localeCallbacks && cx->localeCallbacks->localeToUnicode) {
-        JSBool ok = cx->localeCallbacks->localeToUnicode(cx, buf, Jsvalify(vp));
+        JSBool ok = cx->localeCallbacks->localeToUnicode(cx, buf, vp);
         cx->free_(buf);
         return ok;
     }
 
     str = js_NewStringCopyN(cx, buf, buflen);
     cx->free_(buf);
     if (!str)
         return JS_FALSE;
@@ -1114,24 +1114,24 @@ js_InitNumberClass(JSContext *cx, JSObje
     if (!JS_DefineFunctions(cx, obj, number_functions))
         return NULL;
 
     if (!JS_DefineConstDoubles(cx, ctor, number_constants))
         return NULL;
 
     /* ECMA 15.1.1.1 */
     rt = cx->runtime;
-    if (!JS_DefineProperty(cx, obj, js_NaN_str, Jsvalify(rt->NaNValue),
+    if (!JS_DefineProperty(cx, obj, js_NaN_str, rt->NaNValue,
                            JS_PropertyStub, JS_StrictPropertyStub,
                            JSPROP_PERMANENT | JSPROP_READONLY)) {
         return NULL;
     }
 
     /* ECMA 15.1.1.2 */
-    if (!JS_DefineProperty(cx, obj, js_Infinity_str, Jsvalify(rt->positiveInfinityValue),
+    if (!JS_DefineProperty(cx, obj, js_Infinity_str, rt->positiveInfinityValue,
                            JS_PropertyStub, JS_StrictPropertyStub,
                            JSPROP_PERMANENT | JSPROP_READONLY)) {
         return NULL;
     }
     return proto;
 }
 
 namespace v8 {
--- a/js/src/jsnum.h
+++ b/js/src/jsnum.h
@@ -39,17 +39,16 @@
 
 #ifndef jsnum_h___
 #define jsnum_h___
 
 #include <math.h>
 #ifdef WIN32
 #include <float.h>
 #endif
-#include "jsvalue.h"
 
 #include "jsstdint.h"
 #include "jsobj.h"
 
 /*
  * JS number (IEEE double) interface.
  *
  * JS numbers are optimistically stored in the top 31 bits of 32-bit integers,
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -113,23 +113,23 @@ using namespace js;
 using namespace js::gc;
 using namespace js::types;
 
 JS_FRIEND_DATA(js::Shape) Shape::sharedNonNative(SHAPELESS);
 
 Class js::ObjectClass = {
     js_Object_str,
     JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub
 };
 
 JS_FRIEND_API(JSObject *)
 js_ObjectToOuterObject(JSContext *cx, JSObject *obj)
 {
     OBJ_TO_OUTER_OBJECT(cx, obj);
     return obj;
 }
@@ -149,17 +149,17 @@ NULLABLE_OBJ_TO_INNER_OBJECT(JSContext *
 
 static JSBool
 obj_getProto(JSContext *cx, JSObject *obj, jsid id, Value *vp);
 
 static JSBool
 obj_setProto(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp);
 
 JSPropertySpec object_props[] = {
-    {js_proto_str, 0, JSPROP_PERMANENT|JSPROP_SHARED, Jsvalify(obj_getProto), Jsvalify(obj_setProto)},
+    {js_proto_str, 0, JSPROP_PERMANENT|JSPROP_SHARED, obj_getProto, obj_setProto},
     {0,0,0,0,0}
 };
 
 static JSBool
 obj_getProto(JSContext *cx, JSObject *obj, jsid id, Value *vp)
 {
     /* Let CheckAccess get the slot's value, based on the access mode. */
     uintN attrs;
@@ -1402,19 +1402,18 @@ obj_watch_handler(JSContext *cx, JSObjec
         }
     }
 
     /* Avoid recursion on (obj, id) already being watched on cx. */
     AutoResolving resolving(cx, obj, id, AutoResolving::WATCH);
     if (resolving.alreadyStarted())
         return true;
 
-    Value argv[] = { IdToValue(id), Valueify(old), Valueify(*nvp) };
-    return Invoke(cx, ObjectValue(*obj), ObjectOrNullValue(callable), JS_ARRAY_LENGTH(argv), argv,
-                  Valueify(nvp));
+    Value argv[] = { IdToValue(id), old, *nvp };
+    return Invoke(cx, ObjectValue(*obj), ObjectOrNullValue(callable), JS_ARRAY_LENGTH(argv), argv, nvp);
 }
 
 static JSBool
 obj_watch(JSContext *cx, uintN argc, Value *vp)
 {
     if (argc <= 1) {
         js_ReportMissingArg(cx, *vp, 1);
         return JS_FALSE;
@@ -1632,17 +1631,17 @@ js_obj_defineGetter(JSContext *cx, uintN
      * Getters and setters are just like watchpoints from an access
      * control point of view.
      */
     Value junk;
     uintN attrs;
     if (!CheckAccess(cx, obj, id, JSACC_WATCH, &junk, &attrs))
         return JS_FALSE;
     call.rval().setUndefined();
-    return obj->defineProperty(cx, id, UndefinedValue(), getter, StrictPropertyStub,
+    return obj->defineProperty(cx, id, UndefinedValue(), getter, JS_StrictPropertyStub,
                                JSPROP_ENUMERATE | JSPROP_GETTER | JSPROP_SHARED);
 }
 
 JS_FRIEND_API(JSBool)
 js_obj_defineSetter(JSContext *cx, uintN argc, Value *vp)
 {
     CallArgs call = CallArgsFromVp(argc, vp);
     if (!BoxNonStrictThis(cx, call))
@@ -1666,17 +1665,17 @@ js_obj_defineSetter(JSContext *cx, uintN
      * Getters and setters are just like watchpoints from an access
      * control point of view.
      */
     Value junk;
     uintN attrs;
     if (!CheckAccess(cx, obj, id, JSACC_WATCH, &junk, &attrs))
         return JS_FALSE;
     call.rval().setUndefined();
-    return obj->defineProperty(cx, id, UndefinedValue(), PropertyStub, setter,
+    return obj->defineProperty(cx, id, UndefinedValue(), JS_PropertyStub, setter,
                                JSPROP_ENUMERATE | JSPROP_SETTER | JSPROP_SHARED);
 }
 
 static JSBool
 obj_lookupGetter(JSContext *cx, uintN argc, Value *vp)
 {
     jsid id;
     if (!ValueToId(cx, argc != 0 ? vp[2] : UndefinedValue(), &id))
@@ -1803,34 +1802,34 @@ PropDesc::makeObject(JSContext *cx)
     JSObject *obj = NewBuiltinClassInstance(cx, &ObjectClass);
     if (!obj)
         return false;
 
     const JSAtomState &atomState = cx->runtime->atomState;
     if ((hasConfigurable &&
          !obj->defineProperty(cx, ATOM_TO_JSID(atomState.configurableAtom),
                               BooleanValue((attrs & JSPROP_PERMANENT) == 0),
-                              PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE)) ||
+                              JS_PropertyStub, JS_StrictPropertyStub, JSPROP_ENUMERATE)) ||
         (hasEnumerable &&
          !obj->defineProperty(cx, ATOM_TO_JSID(atomState.enumerableAtom),
                               BooleanValue((attrs & JSPROP_ENUMERATE) != 0),
-                              PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE)) ||
+                              JS_PropertyStub, JS_StrictPropertyStub, JSPROP_ENUMERATE)) ||
         (hasGet &&
          !obj->defineProperty(cx, ATOM_TO_JSID(atomState.getAtom), get,
-                              PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE)) ||
+                              JS_PropertyStub, JS_StrictPropertyStub, JSPROP_ENUMERATE)) ||
         (hasSet &&
          !obj->defineProperty(cx, ATOM_TO_JSID(atomState.setAtom), set,
-                              PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE)) ||
+                              JS_PropertyStub, JS_StrictPropertyStub, JSPROP_ENUMERATE)) ||
         (hasValue &&
          !obj->defineProperty(cx, ATOM_TO_JSID(atomState.valueAtom), value,
-                              PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE)) ||
+                              JS_PropertyStub, JS_StrictPropertyStub, JSPROP_ENUMERATE)) ||
         (hasWritable &&
          !obj->defineProperty(cx, ATOM_TO_JSID(atomState.writableAtom),
                               BooleanValue((attrs & JSPROP_READONLY) == 0),
-                              PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE)))
+                              JS_PropertyStub, JS_StrictPropertyStub, JSPROP_ENUMERATE)))
     {
         return false;
     }
 
     pd.setObject(*obj);
     return true;
 }
 
@@ -2133,17 +2132,17 @@ DefinePropertyOnObject(JSContext *cx, JS
         if (!obj->isExtensible())
             return Reject(cx, obj, JSMSG_OBJECT_NOT_EXTENSIBLE, throwError, rval);
 
         *rval = true;
 
         if (desc.isGenericDescriptor() || desc.isDataDescriptor()) {
             JS_ASSERT(!obj->getOps()->defineProperty);
             return js_DefineProperty(cx, obj, id, &desc.value,
-                                     PropertyStub, StrictPropertyStub, desc.attrs);
+                                     JS_PropertyStub, JS_StrictPropertyStub, desc.attrs);
         }
 
         JS_ASSERT(desc.isAccessorDescriptor());
 
         /*
          * Getters and setters are just like watchpoints from an access
          * control point of view.
          */
@@ -2336,36 +2335,36 @@ DefinePropertyOnObject(JSContext *cx, JS
         if (desc.hasConfigurable)
             changed |= JSPROP_PERMANENT;
         if (desc.hasEnumerable)
             changed |= JSPROP_ENUMERATE;
 
         attrs = (shape->attributes() & ~changed) | (desc.attrs & changed);
         if (shape->isMethod()) {
             JS_ASSERT(!(attrs & (JSPROP_GETTER | JSPROP_SETTER)));
-            getter = PropertyStub;
-            setter = StrictPropertyStub;
+            getter = JS_PropertyStub;
+            setter = JS_StrictPropertyStub;
         } else {
             getter = shape->getter();
             setter = shape->setter();
         }
     } else if (desc.isDataDescriptor()) {
         uintN unchanged = 0;
         if (!desc.hasConfigurable)
             unchanged |= JSPROP_PERMANENT;
         if (!desc.hasEnumerable)
             unchanged |= JSPROP_ENUMERATE;
         if (!desc.hasWritable)
             unchanged |= JSPROP_READONLY;
 
         if (desc.hasValue)
             v = desc.value;
         attrs = (desc.attrs & ~unchanged) | (shape->attributes() & unchanged);
-        getter = PropertyStub;
-        setter = StrictPropertyStub;
+        getter = JS_PropertyStub;
+        setter = JS_StrictPropertyStub;
     } else {
         JS_ASSERT(desc.isAccessorDescriptor());
 
         /*
          * Getters and setters are just like watchpoints from an access
          * control point of view.
          */
         Value dummy;
@@ -2385,24 +2384,24 @@ DefinePropertyOnObject(JSContext *cx, JS
         if (desc.hasSet)
             changed |= JSPROP_SETTER | JSPROP_SHARED;
 
         attrs = (desc.attrs & changed) | (shape->attributes() & ~changed);
         if (desc.hasGet) {
             getter = desc.getter();
         } else {
             getter = (shape->isMethod() || (shape->hasDefaultGetter() && !shape->hasGetterValue()))
-                     ? PropertyStub
+                     ? JS_PropertyStub
                      : shape->getter();
         }
         if (desc.hasSet) {
             setter = desc.setter();
         } else {
             setter = (shape->hasDefaultSetter() && !shape->hasSetterValue())
-                     ? StrictPropertyStub
+                     ? JS_StrictPropertyStub
                      : shape->setter();
         }
     }
 
     *rval = true;
 
     /*
      * Since "data" properties implemented using native C functions may rely on
@@ -3370,37 +3369,37 @@ static JSObject *
 with_ThisObject(JSContext *cx, JSObject *obj)
 {
     return obj->getWithThis();
 }
 
 Class js::WithClass = {
     "With",
     JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(2) | JSCLASS_IS_ANONYMOUS,
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
-    NULL,                 /* finalize */
-    NULL,                 /* reserved    */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call        */
-    NULL,                 /* construct   */
-    NULL,                 /* xdrObject   */
-    NULL,                 /* hasInstance */
-    NULL,                 /* trace       */
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
+    NULL,                    /* finalize */
+    NULL,                    /* reserved    */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call        */
+    NULL,                    /* construct   */
+    NULL,                    /* xdrObject   */
+    NULL,                    /* hasInstance */
+    NULL,                    /* trace       */
     JS_NULL_CLASS_EXT,
     {
         with_LookupProperty,
         with_LookupElement,
-        NULL,             /* defineProperty */
-        NULL,             /* defineElement */
+        NULL,                /* defineProperty */
+        NULL,                /* defineElement */
         with_GetProperty,
         with_GetElement,
         with_SetProperty,
         with_SetElement,
         with_GetAttributes,
         with_GetElementAttributes,
         with_SetAttributes,
         with_SetElementAttributes,
@@ -4075,23 +4074,23 @@ js_XDRBlockObject(JSXDRState *xdr, JSObj
     return true;
 }
 
 #endif
 
 Class js::BlockClass = {
     "Block",
     JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_IS_ANONYMOUS,
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub
 };
 
 static bool
 DefineStandardSlot(JSContext *cx, JSObject *obj, JSProtoKey key, JSAtom *atom,
                    const Value &v, uint32 attrs, bool &named)
 {
     jsid id = ATOM_TO_JSID(atom);
 
@@ -4107,26 +4106,26 @@ DefineStandardSlot(JSContext *cx, JSObje
         if (!obj->ensureClassReservedSlots(cx))
             return false;
 
         const Shape *shape = obj->nativeLookup(cx, id);
         if (!shape) {
             uint32 slot = 2 * JSProto_LIMIT + key;
             if (!js_SetReservedSlot(cx, obj, slot, v))
                 return false;
-            if (!obj->addProperty(cx, id, PropertyStub, StrictPropertyStub, slot, attrs, 0, 0))
+            if (!obj->addProperty(cx, id, JS_PropertyStub, JS_StrictPropertyStub, slot, attrs, 0, 0))
                 return false;
             AddTypePropertyId(cx, obj, id, v);
 
             named = true;
             return true;
         }
     }
 
-    named = obj->defineProperty(cx, id, v, PropertyStub, StrictPropertyStub, attrs);
+    named = obj->defineProperty(cx, id, v, JS_PropertyStub, JS_StrictPropertyStub, attrs);
     return named;
 }
 
 namespace js {
 
 static bool
 SetClassObject(JSContext *cx, JSObject *obj, JSProtoKey key, JSObject *cobj, JSObject *proto)
 {
@@ -5027,17 +5026,17 @@ js_ChangeNativePropertyAttrs(JSContext *
 {
     if (!obj->ensureClassReservedSlots(cx))
         return NULL;
 
     /*
      * Check for freezing an object with shape-memoized methods here, on a
      * shape-by-shape basis. Note that getter may be a pun of the method's
      * joined function object value, to indicate "no getter change". In this
-     * case we must null getter to get the desired PropertyStub behavior.
+     * case we must null getter to get the desired JS_PropertyStub behavior.
      */
     if ((attrs & JSPROP_READONLY) && shape->isMethod()) {
         JSObject *funobj = &shape->methodObject();
         Value v = ObjectValue(*funobj);
 
         shape = obj->methodReadBarrier(cx, *shape, &v);
         if (!shape)
             return NULL;
@@ -5072,17 +5071,17 @@ js_DefineElement(JSContext *cx, JSObject
  * Backward compatibility requires allowing addProperty hooks to mutate the
  * nominal initial value of a slotful property, while GC safety wants that
  * value to be stored before the call-out through the hook.  Optimize to do
  * both while saving cycles for classes that stub their addProperty hook.
  */
 static inline bool
 CallAddPropertyHook(JSContext *cx, Class *clasp, JSObject *obj, const Shape *shape, Value *vp)
 {
-    if (clasp->addProperty != PropertyStub) {
+    if (clasp->addProperty != JS_PropertyStub) {
         Value nominal = *vp;
 
         if (!CallJSPropertyOp(cx, clasp->addProperty, obj, shape->propid, vp))
             return false;
         if (*vp != nominal) {
             if (obj->containsSlot(shape->slot))
                 obj->nativeSetSlotWithType(cx, shape, *vp);
         }
@@ -5164,17 +5163,17 @@ DefineNativeProperty(JSContext *cx, JSOb
     Class *clasp = obj->getClass();
     if (!(defineHow & DNP_SET_METHOD)) {
         if (!getter && !(attrs & JSPROP_GETTER))
             getter = clasp->getProperty;
         if (!setter && !(attrs & JSPROP_SETTER))
             setter = clasp->setProperty;
     }
 
-    if (((defineHow & DNP_SET_METHOD) || getter == PropertyStub) &&
+    if (((defineHow & DNP_SET_METHOD) || getter == JS_PropertyStub) &&
         !(defineHow & DNP_SKIP_TYPE)) {
         /*
          * Type information for normal native properties should reflect the
          * initial value of the property.
          */
         AddTypePropertyId(cx, obj, id, value);
         if (attrs & JSPROP_READONLY)
             MarkTypePropertyConfigured(cx, obj, id);
@@ -6532,17 +6531,17 @@ DefaultValue(JSContext *cx, JSObject *ob
 JS_FRIEND_API(JSBool)
 js_Enumerate(JSContext *cx, JSObject *obj, JSIterateOp enum_op, Value *statep, jsid *idp)
 {
     /* If the class has a custom JSCLASS_NEW_ENUMERATE hook, call it. */
     Class *clasp = obj->getClass();
     JSEnumerateOp enumerate = clasp->enumerate;
     if (clasp->flags & JSCLASS_NEW_ENUMERATE) {
         JS_ASSERT(enumerate != JS_EnumerateStub);
-        return ((NewEnumerateOp) enumerate)(cx, obj, enum_op, statep, idp);
+        return ((JSNewEnumerateOp) enumerate)(cx, obj, enum_op, statep, idp);
     }
 
     if (!enumerate(cx, obj))
         return false;
 
     /* Tell InitNativeIterator to treat us like a native object. */
     JS_ASSERT(enum_op == JSENUMERATE_INIT || enum_op == JSENUMERATE_INIT_ALL);
     statep->setMagic(JS_NATIVE_ENUMERATE);
@@ -6556,17 +6555,17 @@ CheckAccess(JSContext *cx, JSObject *obj
             Value *vp, uintN *attrsp)
 {
     JSBool writing;
     JSObject *pobj;
     JSProperty *prop;
     Class *clasp;
     const Shape *shape;
     JSSecurityCallbacks *callbacks;
-    CheckAccessOp check;
+    JSCheckAccessOp check;
 
     while (JS_UNLIKELY(obj->isWith()))
         obj = obj->getProto();
 
     writing = (mode & JSACC_WRITE) != 0;
     switch (mode & JSACC_TYPEMASK) {
       case JSACC_PROTO:
         pobj = obj;
@@ -6622,17 +6621,17 @@ CheckAccess(JSContext *cx, JSObject *obj
      * classes that stub out checkAccess, through the global checkObjectAccess
      * hook.  This covers precompilation-based sharing and (possibly
      * unintended) runtime sharing across trust boundaries.
      */
     clasp = pobj->getClass();
     check = clasp->checkAccess;
     if (!check) {
         callbacks = JS_GetSecurityCallbacks(cx);
-        check = callbacks ? Valueify(callbacks->checkObjectAccess) : NULL;
+        check = callbacks ? callbacks->checkObjectAccess : NULL;
     }
     return !check || check(cx, pobj, id, mode, vp);
 }
 
 }
 
 JSType
 js_TypeOf(JSContext *cx, JSObject *obj)
--- a/js/src/jsobj.h
+++ b/js/src/jsobj.h
@@ -45,22 +45,22 @@
  * JS object definitions.
  *
  * A JS object consists of a possibly-shared object descriptor containing
  * ordered property names, called the map; and a dense vector of property
  * values, called slots.  The map/slot pointer pair is GC'ed, while the map
  * is reference counted and the slot vector is malloc'ed.
  */
 #include "jsapi.h"
+#include "jsclass.h"
 #include "jsinfer.h"
 #include "jshash.h"
 #include "jspubtd.h"
 #include "jsprvtd.h"
 #include "jslock.h"
-#include "jsvalue.h"
 #include "jsvector.h"
 #include "jscell.h"
 
 namespace nanojit { class ValidateWriter; }
 
 namespace js {
 
 class AutoPropDescArrayRooter;
@@ -79,26 +79,26 @@ CastAsPropertyOp(JSObject *object)
 }
 
 static inline StrictPropertyOp
 CastAsStrictPropertyOp(JSObject *object)
 {
     return JS_DATA_TO_FUNC_PTR(StrictPropertyOp, object);
 }
 
-static inline JSPropertyOp
+static inline PropertyOp
 CastAsJSPropertyOp(JSObject *object)
 {
-    return JS_DATA_TO_FUNC_PTR(JSPropertyOp, object);
+    return JS_DATA_TO_FUNC_PTR(PropertyOp, object);
 }
 
-static inline JSStrictPropertyOp
+static inline StrictPropertyOp
 CastAsJSStrictPropertyOp(JSObject *object)
 {
-    return JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, object);
+    return JS_DATA_TO_FUNC_PTR(StrictPropertyOp, object);
 }
 
 inline JSObject *
 CastAsObject(PropertyOp op)
 {
     return JS_FUNC_TO_DATA_PTR(JSObject *, op);
 }
 
@@ -116,16 +116,32 @@ CastAsObjectJsval(PropertyOp op)
 
 inline Value
 CastAsObjectJsval(StrictPropertyOp op)
 {
     return ObjectOrNullValue(CastAsObject(op));
 }
 
 /*
+ * JSPropertySpec uses JSAPI JSPropertyOp and JSStrictPropertyOp in function
+ * signatures, but with JSPROP_NATIVE_ACCESSORS the actual values must be
+ * JSNatives. To avoid widespread casting, have JS_PSG and JS_PSGS perform
+ * type-safe casts.
+ */
+#define JS_PSG(name,getter,flags)                                             \
+    {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS,              \
+     (JSPropertyOp)getter, NULL}
+#define JS_PSGS(name,getter,setter,flags)                                     \
+    {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS,              \
+     (JSPropertyOp)getter, (JSStrictPropertyOp)setter}
+#define JS_PS_END {0, 0, 0, 0, 0}
+
+/******************************************************************************/
+
+/*
  * A representation of ECMA-262 ed. 5's internal Property Descriptor data
  * structure.
  */
 struct PropDesc {
     /*
      * Original object from which this descriptor derives, passed through for
      * the benefit of proxies.
      */
@@ -208,20 +224,20 @@ struct PropDesc {
 
     const js::Value &getterValue() const {
         return get;
     }
     const js::Value &setterValue() const {
         return set;
     }
 
-    js::PropertyOp getter() const {
+    PropertyOp getter() const {
         return js::CastAsPropertyOp(getterObject());
     }
-    js::StrictPropertyOp setter() const {
+    StrictPropertyOp setter() const {
         return js::CastAsStrictPropertyOp(setterObject());
     }
 
     /*
      * Throw a TypeError if a getter/setter is present and is neither callable
      * nor undefined. These methods do exactly the type checks that are skipped
      * by passing false as the checkAccessors parameter of initialize.
      */
@@ -247,21 +263,21 @@ extern JS_FRIEND_API(JSBool)
 js_LookupProperty(JSContext *cx, JSObject *obj, jsid id, JSObject **objp,
                   JSProperty **propp);
 
 extern JS_FRIEND_API(JSBool)
 js_LookupElement(JSContext *cx, JSObject *obj, uint32 index, JSObject **objp, JSProperty **propp);
 
 extern JSBool
 js_DefineProperty(JSContext *cx, JSObject *obj, jsid id, const js::Value *value,
-                  js::PropertyOp getter, js::StrictPropertyOp setter, uintN attrs);
+                  JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs);
 
 extern JSBool
 js_DefineElement(JSContext *cx, JSObject *obj, uint32 index, const js::Value *value,
-                 js::PropertyOp getter, js::StrictPropertyOp setter, uintN attrs);
+                 JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs);
 
 extern JSBool
 js_GetProperty(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, js::Value *vp);
 
 extern JSBool
 js_GetElement(JSContext *cx, JSObject *obj, JSObject *receiver, uint32, js::Value *vp);
 
 inline JSBool
@@ -1350,17 +1366,17 @@ struct JSObject : js::gc::Cell {
     /*
      * Internal helper that adds a shape not yet mapped by this object.
      *
      * Notes:
      * 1. getter and setter must be normalized based on flags (see jsscope.cpp).
      * 2. !isExtensible() checking must be done by callers.
      */
     const js::Shape *addPropertyInternal(JSContext *cx, jsid id,
-                                         js::PropertyOp getter, js::StrictPropertyOp setter,
+                                         JSPropertyOp getter, JSStrictPropertyOp setter,
                                          uint32 slot, uintN attrs,
                                          uintN flags, intN shortid,
                                          js::Shape **spp);
 
     bool toDictionaryMode(JSContext *cx);
 
     struct TradeGutsReserved;
     static bool ReserveForTradeGuts(JSContext *cx, JSObject *a, JSObject *b,
@@ -1369,60 +1385,60 @@ struct JSObject : js::gc::Cell {
     static void TradeGuts(JSContext *cx, JSObject *a, JSObject *b,
                           TradeGutsReserved &reserved);
 
     void updateFixedSlots(uintN fixed);
 
   public:
     /* Add a property whose id is not yet in this scope. */
     const js::Shape *addProperty(JSContext *cx, jsid id,
-                                 js::PropertyOp getter, js::StrictPropertyOp setter,
+                                 JSPropertyOp getter, JSStrictPropertyOp setter,
                                  uint32 slot, uintN attrs,
                                  uintN flags, intN shortid);
 
     /* Add a data property whose id is not yet in this scope. */
     const js::Shape *addDataProperty(JSContext *cx, jsid id, uint32 slot, uintN attrs) {
         JS_ASSERT(!(attrs & (JSPROP_GETTER | JSPROP_SETTER)));
         return addProperty(cx, id, NULL, NULL, slot, attrs, 0, 0);
     }
 
     /* Add or overwrite a property for id in this scope. */
     const js::Shape *putProperty(JSContext *cx, jsid id,
-                                 js::PropertyOp getter, js::StrictPropertyOp setter,
+                                 JSPropertyOp getter, JSStrictPropertyOp setter,
                                  uint32 slot, uintN attrs,
                                  uintN flags, intN shortid);
 
     /* Change the given property into a sibling with the same id in this scope. */
     const js::Shape *changeProperty(JSContext *cx, const js::Shape *shape, uintN attrs, uintN mask,
-                                    js::PropertyOp getter, js::StrictPropertyOp setter);
+                                    JSPropertyOp getter, JSStrictPropertyOp setter);
 
     /* Remove the property named by id from this object. */
     bool removeProperty(JSContext *cx, jsid id);
 
     /* Clear the scope, making it empty. */
     void clear(JSContext *cx);
 
     JSBool lookupProperty(JSContext *cx, jsid id, JSObject **objp, JSProperty **propp) {
         js::LookupPropOp op = getOps()->lookupProperty;
         return (op ? op : js_LookupProperty)(cx, this, id, objp, propp);
     }
 
     inline JSBool lookupElement(JSContext *cx, uint32 index, JSObject **objp, JSProperty **propp);
 
     JSBool defineProperty(JSContext *cx, jsid id, const js::Value &value,
-                          js::PropertyOp getter = js::PropertyStub,
-                          js::StrictPropertyOp setter = js::StrictPropertyStub,
+                          JSPropertyOp getter = JS_PropertyStub,
+                          JSStrictPropertyOp setter = JS_StrictPropertyStub,
                           uintN attrs = JSPROP_ENUMERATE) {
         js::DefinePropOp op = getOps()->defineProperty;
         return (op ? op : js_DefineProperty)(cx, this, id, &value, getter, setter, attrs);
     }
 
     JSBool defineElement(JSContext *cx, uint32 index, const js::Value &value,
-                         js::PropertyOp getter = js::PropertyStub,
-                         js::StrictPropertyOp setter = js::StrictPropertyStub,
+                         JSPropertyOp getter = JS_PropertyStub,
+                         JSStrictPropertyOp setter = JS_StrictPropertyStub,
                          uintN attrs = JSPROP_ENUMERATE)
     {
         js::DefineElementOp op = getOps()->defineElement;
         return (op ? op : js_DefineElement)(cx, this, index, &value, getter, setter, attrs);
     }
 
     inline JSBool getProperty(JSContext *cx, JSObject *receiver, jsid id, js::Value *vp);
 
@@ -1465,23 +1481,23 @@ struct JSObject : js::gc::Cell {
         return (op ? op : js_SetElementAttributes)(cx, this, index, attrsp);
     }
 
     inline JSBool deleteProperty(JSContext *cx, jsid id, js::Value *rval, JSBool strict);
 
     inline JSBool deleteElement(JSContext *cx, uint32 index, js::Value *rval, JSBool strict);
 
     JSBool enumerate(JSContext *cx, JSIterateOp iterop, js::Value *statep, jsid *idp) {
-        js::NewEnumerateOp op = getOps()->enumerate;
+        JSNewEnumerateOp op = getOps()->enumerate;
         return (op ? op : js_Enumerate)(cx, this, iterop, statep, idp);
     }
 
     bool defaultValue(JSContext *cx, JSType hint, js::Value *vp) {
-        js::ConvertOp op = getClass()->convert;
-        bool ok = (op == js::ConvertStub ? js::DefaultValue : op)(cx, this, hint, vp);
+        JSConvertOp op = getClass()->convert;
+        bool ok = (op == JS_ConvertStub ? js::DefaultValue : op)(cx, this, hint, vp);
         JS_ASSERT_IF(ok, vp->isPrimitive());
         return ok;
     }
 
     JSType typeOf(JSContext *cx) {
         js::TypeOfOp op = getOps()->typeOf;
         return (op ? op : js_TypeOf)(cx, this);
     }
@@ -1783,17 +1799,17 @@ IsStandardClassResolved(JSObject *obj, j
 
 void
 MarkStandardClassInitializedNoProto(JSObject *obj, js::Class *clasp);
 
 }
 
 extern JSObject *
 js_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto,
-             js::Class *clasp, js::Native constructor, uintN nargs,
+             js::Class *clasp, JSNative constructor, uintN nargs,
              JSPropertySpec *ps, JSFunctionSpec *fs,
              JSPropertySpec *static_ps, JSFunctionSpec *static_fs,
              JSObject **ctorp = NULL);
 
 /*
  * Select Object.prototype method names shared between jsapi.cpp and jsobj.cpp.
  */
 extern const char js_watch_str[];
@@ -1864,28 +1880,28 @@ js_PurgeScopeChain(JSContext *cx, JSObje
 }
 
 /*
  * Find or create a property named by id in obj's scope, with the given getter
  * and setter, slot, attributes, and other members.
  */
 extern const js::Shape *
 js_AddNativeProperty(JSContext *cx, JSObject *obj, jsid id,
-                     js::PropertyOp getter, js::StrictPropertyOp setter, uint32 slot,
+                     JSPropertyOp getter, JSStrictPropertyOp setter, uint32 slot,
                      uintN attrs, uintN flags, intN shortid);
 
 /*
  * Change shape to have the given attrs, getter, and setter in scope, morphing
  * it into a potentially new js::Shape.  Return a pointer to the changed
  * or identical property.
  */
 extern const js::Shape *
 js_ChangeNativePropertyAttrs(JSContext *cx, JSObject *obj,
                              const js::Shape *shape, uintN attrs, uintN mask,
-                             js::PropertyOp getter, js::StrictPropertyOp setter);
+                             JSPropertyOp getter, JSStrictPropertyOp setter);
 
 extern JSBool
 js_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id,
                      const js::Value &descriptor, JSBool *bp);
 
 namespace js {
 
 /*
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -671,17 +671,17 @@ JSObject::getNamePrefix() const
     const js::Value &v = getSlot(JSSLOT_NAME_PREFIX);
     return !v.isUndefined() ? &v.toString()->asLinear() : NULL;
 }
 
 inline jsval
 JSObject::getNamePrefixVal() const
 {
     JS_ASSERT(isNamespace() || isQName());
-    return js::Jsvalify(getSlot(JSSLOT_NAME_PREFIX));
+    return getSlot(JSSLOT_NAME_PREFIX);
 }
 
 inline void
 JSObject::setNamePrefix(JSLinearString *prefix)
 {
     JS_ASSERT(isNamespace() || isQName());
     setSlot(JSSLOT_NAME_PREFIX, prefix ? js::StringValue(prefix) : js::UndefinedValue());
 }
@@ -700,53 +700,53 @@ JSObject::getNameURI() const
     const js::Value &v = getSlot(JSSLOT_NAME_URI);
     return !v.isUndefined() ? &v.toString()->asLinear() : NULL;
 }
 
 inline jsval
 JSObject::getNameURIVal() const
 {
     JS_ASSERT(isNamespace() || isQName());
-    return js::Jsvalify(getSlot(JSSLOT_NAME_URI));
+    return getSlot(JSSLOT_NAME_URI);
 }
 
 inline void
 JSObject::setNameURI(JSLinearString *uri)
 {
     JS_ASSERT(isNamespace() || isQName());
     setSlot(JSSLOT_NAME_URI, uri ? js::StringValue(uri) : js::UndefinedValue());
 }
 
 inline jsval
 JSObject::getNamespaceDeclared() const
 {
     JS_ASSERT(isNamespace());
-    return js::Jsvalify(getSlot(JSSLOT_NAMESPACE_DECLARED));
+    return getSlot(JSSLOT_NAMESPACE_DECLARED);
 }
 
 inline void
 JSObject::setNamespaceDeclared(jsval decl)
 {
     JS_ASSERT(isNamespace());
-    setSlot(JSSLOT_NAMESPACE_DECLARED, js::Valueify(decl));
+    setSlot(JSSLOT_NAMESPACE_DECLARED, decl);
 }
 
 inline JSAtom *
 JSObject::getQNameLocalName() const
 {
     JS_ASSERT(isQName());
     const js::Value &v = getSlot(JSSLOT_QNAME_LOCAL_NAME);
     return !v.isUndefined() ? &v.toString()->asAtom() : NULL;
 }
 
 inline jsval
 JSObject::getQNameLocalNameVal() const
 {
     JS_ASSERT(isQName());
-    return js::Jsvalify(getSlot(JSSLOT_QNAME_LOCAL_NAME));
+    return getSlot(JSSLOT_QNAME_LOCAL_NAME);
 }
 
 inline void
 JSObject::setQNameLocalName(JSAtom *name)
 {
     JS_ASSERT(isQName());
     setSlot(JSSLOT_QNAME_LOCAL_NAME, name ? js::StringValue(name) : js::UndefinedValue());
 }
--- a/js/src/json.cpp
+++ b/js/src/json.cpp
@@ -72,23 +72,23 @@
 
 using namespace js;
 using namespace js::gc;
 using namespace js::types;
 
 Class js::JSONClass = {
     js_JSON_str,
     JSCLASS_HAS_CACHED_PROTO(JSProto_JSON),
-    PropertyStub,        /* addProperty */
-    PropertyStub,        /* delProperty */
-    PropertyStub,        /* getProperty */
-    StrictPropertyStub,  /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub
+    JS_PropertyStub,        /* addProperty */
+    JS_PropertyStub,        /* delProperty */
+    JS_PropertyStub,        /* getProperty */
+    JS_StrictPropertyStub,  /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub
 };
 
 /* ES5 15.12.2. */
 JSBool
 js_json_parse(JSContext *cx, uintN argc, Value *vp)
 {
     /* Step 1. */
     JSLinearString *linear;
@@ -744,17 +744,17 @@ js_Stringify(JSContext *cx, Value *vp, J
 
     /* Step 9. */
     JSObject *wrapper = NewBuiltinClassInstance(cx, &ObjectClass);
     if (!wrapper)
         return false;
 
     /* Step 10. */
     jsid emptyId = ATOM_TO_JSID(cx->runtime->atomState.emptyAtom);
-    if (!DefineNativeProperty(cx, wrapper, emptyId, *vp, PropertyStub, StrictPropertyStub,
+    if (!DefineNativeProperty(cx, wrapper, emptyId, *vp, JS_PropertyStub, JS_StrictPropertyStub,
                               JSPROP_ENUMERATE, 0, 0))
     {
         return false;
     }
 
     /* Step 11. */
     StringifyContext scx(cx, sb, gap, replacer, propertyList);
     if (!scx.init())
@@ -809,18 +809,18 @@ Walk(JSContext *cx, JSObject *holder, js
                  * property definition and deletion will always succeed,
                  * and we need not check for failure.
                  */
                 if (newElement.isUndefined()) {
                     /* Step 2a(iii)(2). */
                     JS_ALWAYS_TRUE(array_deleteProperty(cx, obj, id, &newElement, false));
                 } else {
                     /* Step 2a(iii)(3). */
-                    JS_ALWAYS_TRUE(array_defineProperty(cx, obj, id, &newElement, PropertyStub,
-                                                        StrictPropertyStub, JSPROP_ENUMERATE));
+                    JS_ALWAYS_TRUE(array_defineProperty(cx, obj, id, &newElement, JS_PropertyStub,
+                                                        JS_StrictPropertyStub, JSPROP_ENUMERATE));
                 }
             }
         } else {
             /* Step 2b(i). */
             AutoIdVector keys(cx);
             if (!GetPropertyNames(cx, obj, JSITER_OWNONLY, &keys))
                 return false;
 
@@ -834,18 +834,18 @@ Walk(JSContext *cx, JSObject *holder, js
 
                 if (newElement.isUndefined()) {
                     /* Step 2b(ii)(2). */
                     if (!js_DeleteProperty(cx, obj, id, &newElement, false))
                         return false;
                 } else {
                     /* Step 2b(ii)(3). */
                     JS_ASSERT(obj->isNative());
-                    if (!DefineNativeProperty(cx, obj, id, newElement, PropertyStub,
-                                              StrictPropertyStub, JSPROP_ENUMERATE, 0, 0))
+                    if (!DefineNativeProperty(cx, obj, id, newElement, JS_PropertyStub,
+                                              JS_StrictPropertyStub, JSPROP_ENUMERATE, 0, 0))
                     {
                         return false;
                     }
                 }
             }
         }
     }
 
--- a/js/src/json.h
+++ b/js/src/json.h
@@ -35,17 +35,16 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef json_h___
 #define json_h___
 
 #include "jsprvtd.h"
 #include "jspubtd.h"
-#include "jsvalue.h"
 #include "jsvector.h"
 
 #define JSON_MAX_DEPTH  2048
 #define JSON_PARSER_BUFSIZE 1024
 
 extern JSObject *
 js_InitJSONClass(JSContext *cx, JSObject *obj);
 
--- a/js/src/jsonparser.cpp
+++ b/js/src/jsonparser.cpp
@@ -534,17 +534,17 @@ JSONParser::parse(Value *vp)
           case FinishObjectMember: {
             Value v = valueStack.popCopy();
             /*
              * NB: Relies on js_DefineNativeProperty performing
              *     js_CheckForStringIndex.
              */
             jsid propid = ATOM_TO_JSID(&valueStack.popCopy().toString()->asAtom());
             if (!DefineNativeProperty(cx, &valueStack.back().toObject(), propid, v,
-                                      PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE,
+                                      JS_PropertyStub, JS_StrictPropertyStub, JSPROP_ENUMERATE,
                                       0, 0))
             {
                 return false;
             }
             token = advanceAfterProperty();
             if (token == ObjectClose)
                 break;
             if (token != Comma) {
--- a/js/src/jsonparser.h
+++ b/js/src/jsonparser.h
@@ -40,17 +40,16 @@
 
 #ifndef jsonparser_h___
 #define jsonparser_h___
 
 #include "mozilla/RangedPtr.h"
 
 #include "jscntxt.h"
 #include "jsstr.h"
-#include "jsvalue.h"
 
 /*
  * NB: This class must only be used on the stack as it contains a js::Value.
  */
 class JSONParser
 {
   public:
     enum ErrorHandling { RaiseError, NoError };
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -426,21 +426,21 @@ ToDisassemblySource(JSContext *cx, jsval
                 return false;
             return bytes->encode(cx, str);
         }
 
         if (clasp == &RegExpClass) {
             AutoValueRooter tvr(cx);
             if (!js_regexp_toString(cx, obj, tvr.addr()))
                 return false;
-            return bytes->encode(cx, JSVAL_TO_STRING(Jsvalify(tvr.value())));
+            return bytes->encode(cx, tvr.value().toString());
         }
     }
 
-    return !!js_ValueToPrintable(cx, Valueify(v), bytes, true);
+    return !!js_ValueToPrintable(cx, v, bytes, true);
 }
 
 JS_FRIEND_API(uintN)
 js_Disassemble1(JSContext *cx, JSScript *script, jsbytecode *pc,
                 uintN loc, JSBool lines, Sprinter *sp)
 {
     JSOp op;
     const JSCodeSpec *cs;
@@ -514,17 +514,17 @@ js_Disassemble1(JSContext *cx, JSScript 
         break;
 
       case JOF_ATOM:
       case JOF_OBJECT:
       case JOF_REGEXP:
         index = js_GetIndexFromBytecode(cx, script, pc, 0);
         if (type == JOF_ATOM) {
             if (op == JSOP_DOUBLE) {
-                v = Jsvalify(script->getConst(index));
+                v = script->getConst(index);
             } else {
                 JS_GET_SCRIPT_ATOM(script, pc, index, atom);
                 v = STRING_TO_JSVAL(atom);
             }
         } else {
             if (type == JOF_OBJECT) {
                 /* Don't call obj.toSource if analysis/inference is active. */
                 if (cx->compartment->activeAnalysis) {
@@ -607,17 +607,17 @@ js_Disassemble1(JSContext *cx, JSScript 
         Sprint(sp, " offset %d npairs %u", intN(off), uintN(npairs));
         while (npairs) {
             uint16 constIndex = GET_INDEX(pc2);
             pc2 += INDEX_LEN;
             off = GetJumpOffset(pc, pc2);
             pc2 += jmplen;
 
             JSAutoByteString bytes;
-            if (!ToDisassemblySource(cx, Jsvalify(script->getConst(constIndex)), &bytes))
+            if (!ToDisassemblySource(cx, script->getConst(constIndex), &bytes))
                 return 0;
             Sprint(sp, "\n\t%s: %d", bytes.ptr(), intN(off));
             npairs--;
         }
         len = 1 + pc2 - pc;
         break;
       }
 
@@ -1375,17 +1375,17 @@ DecompileSwitch(SprintStack *ss, TableEn
                 } else if (JSVAL_IS_DOUBLE(key)) {
                     JSOp junk;
 
                     todo = SprintDoubleValue(&ss->sprinter, key, &junk);
                     if (todo < 0)
                         return JS_FALSE;
                     str = NULL;
                 } else {
-                    str = js_ValueToString(cx, Valueify(key));
+                    str = js_ValueToString(cx, key);
                     if (!str)
                         return JS_FALSE;
                 }
                 if (todo >= 0) {
                     rval = OFF2STR(&ss->sprinter, todo);
                 } else {
                     rval = QuoteString(&ss->sprinter, str, (jschar)
                                        (JSVAL_IS_STRING(key) ? '"' : 0));
@@ -4250,17 +4250,17 @@ Decompile(SprintStack *ss, jsbytecode *p
                 LOAD_OBJECT(0);
                 str = js_ValueToSource(cx, ObjectValue(*obj));
                 if (!str)
                     return NULL;
                 goto sprint_string;
 
               case JSOP_REGEXP:
                 GET_REGEXP_FROM_BYTECODE(jp->script, pc, 0, obj);
-                if (!js_regexp_toString(cx, obj, Valueify(&val)))
+                if (!js_regexp_toString(cx, obj, &val))
                     return NULL;
                 str = JSVAL_TO_STRING(val);
                 goto sprint_string;
 
               case JSOP_TABLESWITCH:
               case JSOP_TABLESWITCHX:
               {
                 ptrdiff_t jmplen, off, off2;
@@ -4359,17 +4359,17 @@ Decompile(SprintStack *ss, jsbytecode *p
                         GET_SOURCE_NOTE_ATOM(sn, table[k].label);
                     } else {
                         table[k].label = NULL;
                     }
                     uint16 constIndex = GET_INDEX(pc2);
                     pc2 += INDEX_LEN;
                     off2 = GetJumpOffset(pc, pc2);
                     pc2 += jmplen;
-                    table[k].key = Jsvalify(jp->script->getConst(constIndex));
+                    table[k].key = jp->script->getConst(constIndex);
                     table[k].offset = off2;
                 }
 
                 ok = DecompileSwitch(ss, table, (uintN)npairs, pc, len, off,
                                      JS_FALSE);
                 cx->free_(table);
                 if (!ok)
                     return NULL;
@@ -5099,25 +5099,23 @@ js_DecompileFunction(JSPrinter *jp)
 
     if (!jp->pretty && !jp->grouped && (fun->flags & JSFUN_LAMBDA))
         js_puts(jp, ")");
 
     return JS_TRUE;
 }
 
 char *
-js_DecompileValueGenerator(JSContext *cx, intN spindex, jsval v_in,
+js_DecompileValueGenerator(JSContext *cx, intN spindex, jsval v,
                            JSString *fallback)
 {
     StackFrame *fp;
     JSScript *script;
     jsbytecode *pc;
 
-    Value v = Valueify(v_in);
-
     JS_ASSERT(spindex < 0 ||
               spindex == JSDVG_IGNORE_STACK ||
               spindex == JSDVG_SEARCH_STACK);
 
     LeaveTrace(cx);
     
     if (!cx->hasfp() || !cx->fp()->isScriptFrame())
         goto do_fallback;
--- a/js/src/jsopcode.h
+++ b/js/src/jsopcode.h
@@ -43,20 +43,16 @@
  * JS bytecode definitions.
  */
 #include <stddef.h>
 #include "jsprvtd.h"
 #include "jspubtd.h"
 #include "jsutil.h"
 #include "jsarena.h"
 
-#ifdef __cplusplus
-# include "jsvalue.h"
-#endif
-
 JS_BEGIN_EXTERN_C
 
 /*
  * JS operation bytecodes.
  */
 typedef enum JSOp {
 #define OPDEF(op,val,name,token,length,nuses,ndefs,prec,format) \
     op = val,
@@ -497,17 +493,17 @@ js_GetVariableBytecodeLength(jsbytecode 
 }
 
 namespace js {
 
 static inline char *
 DecompileValueGenerator(JSContext *cx, intN spindex, const Value &v,
                         JSString *fallback)
 {
-    return js_DecompileValueGenerator(cx, spindex, Jsvalify(v), fallback);
+    return js_DecompileValueGenerator(cx, spindex, v, fallback);
 }
 
 /*
  * Sprintf, but with unlimited and automatically allocated buffering.
  */
 struct Sprinter {
     JSContext       *context;       /* context executing the decompiler */
     JSArenaPool     *pool;          /* string allocation pool */
--- a/js/src/jsparse.cpp
+++ b/js/src/jsparse.cpp
@@ -1155,17 +1155,17 @@ Compiler::defineGlobals(JSContext *cx, G
         /*
          * Don't update the type information when defining the property for the
          * global object, per the consistency rules for type properties. If the
          * property is only undefined before it is ever written, we can check
          * the global directly during compilation and avoid having to emit type
          * checks every time it is accessed in the script.
          */
         const Shape *shape =
-            DefineNativeProperty(cx, globalObj, id, rval, PropertyStub, StrictPropertyStub,
+            DefineNativeProperty(cx, globalObj, id, rval, JS_PropertyStub, JS_StrictPropertyStub,
                                  JSPROP_ENUMERATE | JSPROP_PERMANENT, 0, 0, DNP_SKIP_TYPE);
         if (!shape)
             return false;
         def.knownSlot = shape->slot;
     }
 
     js::Vector<JSScript *, 16> worklist(cx);
     if (!worklist.append(script))
--- a/js/src/jsproxy.cpp
+++ b/js/src/jsproxy.cpp
@@ -119,17 +119,17 @@ JSProxyHandler::get(JSContext *cx, JSObj
     AutoPropertyDescriptorRooter desc(cx);
     if (!getPropertyDescriptor(cx, proxy, id, false, &desc))
         return false;
     if (!desc.obj) {
         vp->setUndefined();
         return true;
     }
     if (!desc.getter ||
-        (!(desc.attrs & JSPROP_GETTER) && desc.getter == PropertyStub)) {
+        (!(desc.attrs & JSPROP_GETTER) && desc.getter == JS_PropertyStub)) {
         *vp = desc.value;
         return true;
     }
     if (desc.attrs & JSPROP_GETTER)
         return InvokeGetterOrSetter(cx, receiver, CastAsObjectJsval(desc.getter), 0, NULL, vp);
     if (!(desc.attrs & JSPROP_SHARED))
         *vp = desc.value;
     else
@@ -147,47 +147,47 @@ JSProxyHandler::set(JSContext *cx, JSObj
     AutoPropertyDescriptorRooter desc(cx);
     if (!getOwnPropertyDescriptor(cx, proxy, id, true, &desc))
         return false;
     /* The control-flow here differs from ::get() because of the fall-through case below. */
     if (desc.obj) {
         if (desc.attrs & JSPROP_READONLY)
             return true;
         if (!desc.setter) {
-            desc.setter = StrictPropertyStub;
-        } else if ((desc.attrs & JSPROP_SETTER) || desc.setter != StrictPropertyStub) {
+            desc.setter = JS_StrictPropertyStub;
+        } else if ((desc.attrs & JSPROP_SETTER) || desc.setter != JS_StrictPropertyStub) {
             if (!CallSetter(cx, receiver, id, desc.setter, desc.attrs, desc.shortid, strict, vp))
                 return false;
             if (!proxy->isProxy() || proxy->getProxyHandler() != this)
                 return true;
             if (desc.attrs & JSPROP_SHARED)
                 return true;
         }
         if (!desc.getter)
-            desc.getter = PropertyStub;
+            desc.getter = JS_PropertyStub;
         desc.value = *vp;
         return defineProperty(cx, receiver, id, &desc);
     }
     if (!getPropertyDescriptor(cx, proxy, id, true, &desc))
         return false;
     if (desc.obj) {
         if (desc.attrs & JSPROP_READONLY)
             return true;
         if (!desc.setter) {
-            desc.setter = StrictPropertyStub;
-        } else if ((desc.attrs & JSPROP_SETTER) || desc.setter != StrictPropertyStub) {
+            desc.setter = JS_StrictPropertyStub;
+        } else if ((desc.attrs & JSPROP_SETTER) || desc.setter != JS_StrictPropertyStub) {
             if (!CallSetter(cx, receiver, id, desc.setter, desc.attrs, desc.shortid, strict, vp))
                 return false;
             if (!proxy->isProxy() || proxy->getProxyHandler() != this)
                 return true;
             if (desc.attrs & JSPROP_SHARED)
                 return true;
         }
         if (!desc.getter)
-            desc.getter = PropertyStub;
+            desc.getter = JS_PropertyStub;
         return defineProperty(cx, receiver, id, &desc);
     }
 
     desc.obj = receiver;
     desc.value = *vp;
     desc.attrs = JSPROP_ENUMERATE;
     desc.shortid = 0;
     desc.getter = NULL;
@@ -1100,99 +1100,99 @@ proxy_TypeOf(JSContext *cx, JSObject *pr
 {
     JS_ASSERT(proxy->isProxy());
     return JSProxy::typeOf(cx, proxy);
 }
 
 JS_FRIEND_DATA(Class) js::ObjectProxyClass = {
     "Proxy",
     Class::NON_NATIVE | JSCLASS_HAS_RESERVED_SLOTS(3),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
     proxy_Convert,
-    proxy_Finalize,       /* finalize    */
-    NULL,                 /* reserved0   */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call        */
-    NULL,                 /* construct   */
-    NULL,                 /* xdrObject   */
-    proxy_HasInstance,    /* hasInstance */
-    proxy_TraceObject,    /* trace       */
+    proxy_Finalize,          /* finalize    */
+    NULL,                    /* reserved0   */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call        */
+    NULL,                    /* construct   */
+    NULL,                    /* xdrObject   */
+    proxy_HasInstance,       /* hasInstance */
+    proxy_TraceObject,       /* trace       */
     JS_NULL_CLASS_EXT,
     {
         proxy_LookupProperty,
         proxy_LookupElement,
         proxy_DefineProperty,
         proxy_DefineElement,
         proxy_GetProperty,
         proxy_GetElement,
         proxy_SetProperty,
         proxy_SetElement,
         proxy_GetAttributes,
         proxy_GetElementAttributes,
         proxy_SetAttributes,
         proxy_SetElementAttributes,
         proxy_DeleteProperty,
         proxy_DeleteElement,
-        NULL,             /* enumerate       */
+        NULL,                /* enumerate       */
         proxy_TypeOf,
-        proxy_Fix,        /* fix             */
-        NULL,             /* thisObject      */
-        NULL,             /* clear           */
+        proxy_Fix,           /* fix             */
+        NULL,                /* thisObject      */
+        NULL,                /* clear           */
     }
 };
 
 JS_FRIEND_DATA(Class) js::OuterWindowProxyClass = {
     "Proxy",
     Class::NON_NATIVE | JSCLASS_HAS_RESERVED_SLOTS(3),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
-    proxy_Finalize,       /* finalize    */
-    NULL,                 /* reserved0   */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call        */
-    NULL,                 /* construct   */
-    NULL,                 /* xdrObject   */
-    NULL,                 /* hasInstance */
-    proxy_TraceObject,    /* trace       */
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
+    proxy_Finalize,          /* finalize    */
+    NULL,                    /* reserved0   */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call        */
+    NULL,                    /* construct   */
+    NULL,                    /* xdrObject   */
+    NULL,                    /* hasInstance */
+    proxy_TraceObject,       /* trace       */
     {
-        NULL,             /* equality    */
-        NULL,             /* outerObject */
+        NULL,                /* equality    */
+        NULL,                /* outerObject */
         proxy_innerObject,
-        NULL        /* unused */
+        NULL                 /* unused */
     },
     {
         proxy_LookupProperty,
         proxy_LookupElement,
         proxy_DefineProperty,
         proxy_DefineElement,
         proxy_GetProperty,
         proxy_GetElement,
         proxy_SetProperty,
         proxy_SetElement,
         proxy_GetAttributes,
         proxy_GetElementAttributes,
         proxy_SetAttributes,
         proxy_SetElementAttributes,
         proxy_DeleteProperty,
         proxy_DeleteElement,
-        NULL,             /* enumerate       */
-        NULL,             /* typeof          */
-        NULL,             /* fix             */
-        NULL,             /* thisObject      */
-        NULL,             /* clear           */
+        NULL,                /* enumerate       */
+        NULL,                /* typeof          */
+        NULL,                /* fix             */
+        NULL,                /* thisObject      */
+        NULL,                /* clear           */
     }
 };
 
 static JSBool
 proxy_Call(JSContext *cx, uintN argc, Value *vp)
 {
     JSObject *proxy = &JS_CALLEE(cx, vp).toObject();
     JS_ASSERT(proxy->isProxy());
@@ -1206,52 +1206,52 @@ proxy_Construct(JSContext *cx, uintN arg
     JS_ASSERT(proxy->isProxy());
     bool ok = JSProxy::construct(cx, proxy, argc, JS_ARGV(cx, vp), vp);
     return ok;
 }
 
 JS_FRIEND_DATA(Class) js::FunctionProxyClass = {
     "Proxy",
     Class::NON_NATIVE | JSCLASS_HAS_RESERVED_SLOTS(5),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
-    NULL,                 /* finalize */
-    NULL,                 /* reserved0   */
-    NULL,                 /* checkAccess */
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
+    NULL,                    /* finalize */
+    NULL,                    /* reserved0   */
+    NULL,                    /* checkAccess */
     proxy_Call,
     proxy_Construct,
-    NULL,                 /* xdrObject   */
+    NULL,                    /* xdrObject   */
     FunctionClass.hasInstance,
-    proxy_TraceFunction,  /* trace       */
+    proxy_TraceFunction,     /* trace       */
     JS_NULL_CLASS_EXT,
     {
         proxy_LookupProperty,
         proxy_LookupElement,
         proxy_DefineProperty,
         proxy_DefineElement,
         proxy_GetProperty,
         proxy_GetElement,
         proxy_SetProperty,
         proxy_SetElement,
         proxy_GetAttributes,
         proxy_GetElementAttributes,
         proxy_SetAttributes,
         proxy_SetElementAttributes,
         proxy_DeleteProperty,
         proxy_DeleteElement,
-        NULL,             /* enumerate       */
+        NULL,                /* enumerate       */
         proxy_TypeOf,
-        NULL,             /* fix             */
-        NULL,             /* thisObject      */
-        NULL,             /* clear           */
+        NULL,                /* fix             */
+        NULL,                /* thisObject      */
+        NULL,                /* clear           */
     }
 };
 
 JS_FRIEND_API(JSObject *)
 js::NewProxyObject(JSContext *cx, JSProxyHandler *handler, const Value &priv, JSObject *proto,
                JSObject *parent, JSObject *call, JSObject *construct)
 {
     JS_ASSERT_IF(proto, cx->compartment == proto->compartment());
@@ -1468,26 +1468,26 @@ callable_Construct(JSContext *cx, uintN 
 
     bool ok = Invoke(cx, ObjectValue(*thisobj), fval, argc, vp + 2, vp);
     return ok;
 }
 
 Class js::CallableObjectClass = {
     "Function",
     JSCLASS_HAS_RESERVED_SLOTS(2),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
-    NULL,                 /* finalize    */
-    NULL,                 /* reserved0   */
-    NULL,                 /* checkAccess */
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
+    NULL,                    /* finalize    */
+    NULL,                    /* reserved0   */
+    NULL,                    /* checkAccess */
     callable_Call,
     callable_Construct,
 };
 
 JS_FRIEND_API(JSBool)
 js::FixProxy(JSContext *cx, JSObject *proxy, JSBool *bp)
 {
     if (OperationInProgress(cx, proxy)) {
@@ -1540,23 +1540,23 @@ js::FixProxy(JSContext *cx, JSObject *pr
 
     *bp = true;
     return true;
 }
 
 Class js::ProxyClass = {
     "Proxy",
     JSCLASS_HAS_CACHED_PROTO(JSProto_Proxy),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub
 };
 
 JS_FRIEND_API(JSObject *)
 js_InitProxyClass(JSContext *cx, JSObject *obj)
 {
     JSObject *module = NewNonFunction<WithProto::Class>(cx, &ProxyClass, NULL, obj);
     if (!module || !module->setSingletonType(cx))
         return NULL;
--- a/js/src/jsprvtd.h
+++ b/js/src/jsprvtd.h
@@ -122,16 +122,17 @@ class JSStaticAtom;
 class JSRope;
 class JSAtom;
 struct JSDefinition;
 class JSWrapper;
 
 namespace js {
 
 struct ArgumentsData;
+struct Class;
 
 class RegExp;
 class RegExpStatics;
 class AutoStringRooter;
 class ExecuteArgsGuard;
 class InvokeFrameGuard;
 class InvokeArgsGuard;
 class StringBuffer;
@@ -179,17 +180,16 @@ class HashSet;
 
 template <typename K,
           typename V,
           size_t InlineElems>
 class InlineMap;
 
 class PropertyCache;
 struct PropertyCacheEntry;
-struct PropertyDescriptor;
 
 struct Shape;
 struct EmptyShape;
 class Bindings;
 
 class MultiDeclRange;
 class ParseMapPool;
 class DefnOrHeader;
@@ -200,16 +200,21 @@ typedef Vector<UpvarCookie, 8> UpvarCook
 
 class Breakpoint;
 class BreakpointSite;
 typedef HashMap<jsbytecode *, BreakpointSite *, DefaultHasher<jsbytecode *>, RuntimeAllocPolicy>
     BreakpointSiteMap;
 class Debugger;
 class WatchpointMap;
 
+typedef JSNative             Native;
+typedef JSPropertyOp         PropertyOp;
+typedef JSStrictPropertyOp   StrictPropertyOp;
+typedef JSPropertyDescriptor PropertyDescriptor;
+
 } /* namespace js */
 
 } /* export "C++" */
 
 #else
 
 typedef struct JSAtom JSAtom;
 
--- a/js/src/jsreflect.cpp
+++ b/js/src/jsreflect.cpp
@@ -54,17 +54,16 @@
 #include "jsregexp.h"
 #include "jsvector.h"
 #include "jsemit.h"
 #include "jsscan.h"
 #include "jsprf.h"
 #include "jsiter.h"
 #include "jsbool.h"
 #include "jsval.h"
-#include "jsvalue.h"
 #include "jsinferinlines.h"
 #include "jsobjinlines.h"
 #include "jsobj.h"
 #include "jsarray.h"
 #include "jsnum.h"
 
 #include "jsscriptinlines.h"
 
@@ -3112,28 +3111,28 @@ static JSBool
 reflect_parse(JSContext *cx, uint32 argc, jsval *vp)
 {
     if (argc < 1) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_MORE_ARGS_NEEDED,
                              "Reflect.parse", "0", "s");
         return JS_FALSE;
     }
 
-    JSString *src = js_ValueToString(cx, Valueify(JS_ARGV(cx, vp)[0]));
+    JSString *src = js_ValueToString(cx, JS_ARGV(cx, vp)[0]);
     if (!src)
         return JS_FALSE;
 
     char *filename = NULL;
     AutoReleaseNullablePtr filenamep(cx, filename);
     uint32 lineno = 1;
     bool loc = true;
 
     JSObject *builder = NULL;
 
-    Value arg = argc > 1 ? Valueify(JS_ARGV(cx, vp)[1]) : UndefinedValue();
+    Value arg = argc > 1 ? JS_ARGV(cx, vp)[1] : UndefinedValue();
 
     if (!arg.isNullOrUndefined()) {
         if (!arg.isObject()) {
             js_ReportValueErrorFlags(cx, JSREPORT_ERROR, JSMSG_UNEXPECTED_TYPE,
                                      JSDVG_SEARCH_STACK, arg, NULL, "not an object", NULL);
             return JS_FALSE;
         }
 
@@ -3216,17 +3215,17 @@ reflect_parse(JSContext *cx, uint32 argc
         return JS_FALSE;
 
     Value val;
     if (!serialize.program(pn, &val)) {
         JS_SET_RVAL(cx, vp, JSVAL_NULL);
         return JS_FALSE;
     }
 
-    JS_SET_RVAL(cx, vp, Jsvalify(val));
+    JS_SET_RVAL(cx, vp, val);
     return JS_TRUE;
 }
 
 static JSFunctionSpec static_methods[] = {
     JS_FN("parse", reflect_parse, 1, 0),
     JS_FS_END
 };
 
--- a/js/src/jsregexp.cpp
+++ b/js/src/jsregexp.cpp
@@ -92,30 +92,30 @@ resc_trace(JSTracer *trc, JSObject *obj)
     JS_ASSERT(pdata);
     RegExpStatics *res = static_cast<RegExpStatics *>(pdata);
     res->mark(trc);
 }
 
 Class js::regexp_statics_class = {
     "RegExpStatics",
     JSCLASS_HAS_PRIVATE,
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
     resc_finalize,
-    NULL,                 /* reserved0   */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call        */
-    NULL,                 /* construct   */
-    NULL,                 /* xdrObject   */
-    NULL,                 /* hasInstance */
+    NULL,                    /* reserved0   */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call        */
+    NULL,                    /* construct   */
+    NULL,                    /* xdrObject   */
+    NULL,                    /* hasInstance */
     resc_trace
 };
 
 /*
  * Replace the regexp internals of |obj| with |newRegExp|.
  * Decref the replaced regexp internals.
  * Note that the refcount of |newRegExp| is unchanged.
  */
@@ -361,33 +361,33 @@ JSObject::assignInitialRegExpShape(JSCon
 #define DEFINE_STATIC_GETTER(name, code)                                        \
     static JSBool                                                               \
     name(JSContext *cx, JSObject *obj, jsid id, jsval *vp)                      \
     {                                                                           \
         RegExpStatics *res = cx->regExpStatics();                               \
         code;                                                                   \
     }
 
-DEFINE_STATIC_GETTER(static_input_getter,        return res->createPendingInput(cx, Valueify(vp)))
+DEFINE_STATIC_GETTER(static_input_getter,        return res->createPendingInput(cx, vp))
 DEFINE_STATIC_GETTER(static_multiline_getter,    *vp = BOOLEAN_TO_JSVAL(res->multiline());
                                                  return true)
-DEFINE_STATIC_GETTER(static_lastMatch_getter,    return res->createLastMatch(cx, Valueify(vp)))
-DEFINE_STATIC_GETTER(static_lastParen_getter,    return res->createLastParen(cx, Valueify(vp)))
-DEFINE_STATIC_GETTER(static_leftContext_getter,  return res->createLeftContext(cx, Valueify(vp)))
-DEFINE_STATIC_GETTER(static_rightContext_getter, return res->createRightContext(cx, Valueify(vp)))
+DEFINE_STATIC_GETTER(static_lastMatch_getter,    return res->createLastMatch(cx, vp))
+DEFINE_STATIC_GETTER(static_lastParen_getter,    return res->createLastParen(cx, vp))
+DEFINE_STATIC_GETTER(static_leftContext_getter,  return res->createLeftContext(cx, vp))
+DEFINE_STATIC_GETTER(static_rightContext_getter, return res->createRightContext(cx, vp))
 
-DEFINE_STATIC_GETTER(static_paren1_getter,       return res->createParen(cx, 1, Valueify(vp)))
-DEFINE_STATIC_GETTER(static_paren2_getter,       return res->createParen(cx, 2, Valueify(vp)))
-DEFINE_STATIC_GETTER(static_paren3_getter,       return res->createParen(cx, 3, Valueify(vp)))
-DEFINE_STATIC_GETTER(static_paren4_getter,       return res->createParen(cx, 4, Valueify(vp)))
-DEFINE_STATIC_GETTER(static_paren5_getter,       return res->createParen(cx, 5, Valueify(vp)))
-DEFINE_STATIC_GETTER(static_paren6_getter,       return res->createParen(cx, 6, Valueify(vp)))
-DEFINE_STATIC_GETTER(static_paren7_getter,       return res->createParen(cx, 7, Valueify(vp)))
-DEFINE_STATIC_GETTER(static_paren8_getter,       return res->createParen(cx, 8, Valueify(vp)))
-DEFINE_STATIC_GETTER(static_paren9_getter,       return res->createParen(cx, 9, Valueify(vp)))
+DEFINE_STATIC_GETTER(static_paren1_getter,       return res->createParen(cx, 1, vp))
+DEFINE_STATIC_GETTER(static_paren2_getter,       return res->createParen(cx, 2, vp))
+DEFINE_STATIC_GETTER(static_paren3_getter,       return res->createParen(cx, 3, vp))
+DEFINE_STATIC_GETTER(static_paren4_getter,       return res->createParen(cx, 4, vp))
+DEFINE_STATIC_GETTER(static_paren5_getter,       return res->createParen(cx, 5, vp))
+DEFINE_STATIC_GETTER(static_paren6_getter,       return res->createParen(cx, 6, vp))
+DEFINE_STATIC_GETTER(static_paren7_getter,       return res->createParen(cx, 7, vp))
+DEFINE_STATIC_GETTER(static_paren8_getter,       return res->createParen(cx, 8, vp))
+DEFINE_STATIC_GETTER(static_paren9_getter,       return res->createParen(cx, 9, vp))
 
 #define DEFINE_STATIC_SETTER(name, code)                                        \
     static JSBool                                                               \
     name(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)       \
     {                                                                           \
         RegExpStatics *res = cx->regExpStatics();                               \
         code;                                                                   \
         return true;                                                            \
@@ -493,31 +493,31 @@ js_XDRRegExpObject(JSXDRState *xdr, JSOb
 
 #endif /* !JS_HAS_XDR */
 
 Class js::RegExpClass = {
     js_RegExp_str,
     JSCLASS_HAS_PRIVATE |
     JSCLASS_HAS_RESERVED_SLOTS(JSObject::REGEXP_CLASS_RESERVED_SLOTS) |
     JSCLASS_HAS_CACHED_PROTO(JSProto_RegExp),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,        /* enumerate */
-    ResolveStub,
-    ConvertStub,
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,        /* enumerate */
+    JS_ResolveStub,
+    JS_ConvertStub,
     regexp_finalize,
-    NULL,                 /* reserved0 */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call */
-    NULL,                 /* construct */
+    NULL,                    /* reserved0 */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call */
+    NULL,                    /* construct */
     js_XDRRegExpObject,
-    NULL,                 /* hasInstance */
-    NULL                  /* trace */
+    NULL,                    /* hasInstance */
+    NULL                     /* trace */
 };
 
 /*
  * RegExp instance methods.
  */
 
 JSBool
 js_regexp_toString(JSContext *cx, JSObject *obj, Value *vp)
--- a/js/src/jsregexpinlines.h
+++ b/js/src/jsregexpinlines.h
@@ -226,25 +226,25 @@ class RegExp
 
 class RegExpMatchBuilder
 {
     JSContext   * const cx;
     JSObject    * const array;
 
     bool setProperty(JSAtom *name, Value v) {
         return !!js_DefineProperty(cx, array, ATOM_TO_JSID(name), &v,
-                                   PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE);
+                                   JS_PropertyStub, JS_StrictPropertyStub, JSPROP_ENUMERATE);
     }
 
   public:
     RegExpMatchBuilder(JSContext *cx, JSObject *array) : cx(cx), array(array) {}
 
     bool append(uint32 index, Value v) {
         JS_ASSERT(!array->getOps()->getElement);
-        return !!js_DefineElement(cx, array, index, &v, PropertyStub, StrictPropertyStub,
+        return !!js_DefineElement(cx, array, index, &v, JS_PropertyStub, JS_StrictPropertyStub,
                                   JSPROP_ENUMERATE);
     }
 
     bool setIndex(int index) {
         return setProperty(cx->runtime->atomState.indexAtom, Int32Value(index));
     }
 
     bool setInput(JSString *str) {
--- a/js/src/jsscope.cpp
+++ b/js/src/jsscope.cpp
@@ -517,27 +517,27 @@ JSObject::toDictionaryMode(JSContext *cx
  * SHAPE_CALL_[GS]ETTER macros.
  */
 static inline bool
 NormalizeGetterAndSetter(JSContext *cx, JSObject *obj,
                          jsid id, uintN attrs, uintN flags,
                          PropertyOp &getter,
                          StrictPropertyOp &setter)
 {
-    if (setter == StrictPropertyStub) {
+    if (setter == JS_StrictPropertyStub) {
         JS_ASSERT(!(attrs & JSPROP_SETTER));
         setter = NULL;
     }
     if (flags & Shape::METHOD) {
         /* Here, getter is the method, a function object reference. */
         JS_ASSERT(getter);
         JS_ASSERT(!setter);
         JS_ASSERT(!(attrs & (JSPROP_GETTER | JSPROP_SETTER)));
     } else {
-        if (getter == PropertyStub) {
+        if (getter == JS_PropertyStub) {
             JS_ASSERT(!(attrs & JSPROP_GETTER));
             getter = NULL;
         }
     }
 
     return true;
 }
 
@@ -904,19 +904,19 @@ JSObject::changeProperty(JSContext *cx, 
 
     /* Don't allow method properties to be changed to have a getter. */
     JS_ASSERT_IF(getter != shape->rawGetter, !shape->isMethod());
 
     types::MarkTypePropertyConfigured(cx, this, shape->propid);
     if (attrs & (JSPROP_GETTER | JSPROP_SETTER))
         types::AddTypePropertyId(cx, this, shape->propid, types::Type::UnknownType());
 
-    if (getter == PropertyStub)
+    if (getter == JS_PropertyStub)
         getter = NULL;
-    if (setter == StrictPropertyStub)
+    if (setter == JS_StrictPropertyStub)
         setter = NULL;
 
     if (!CheckCanChangeAttrs(cx, this, shape, &attrs))
         return NULL;
     
     if (shape->attrs == attrs && shape->getter() == getter && shape->setter() == setter)
         return shape;
 
--- a/js/src/jsscope.h
+++ b/js/src/jsscope.h
@@ -327,26 +327,26 @@ struct Shape : public js::gc::Cell
     };
 
     inline void freeTable(JSContext *cx);
 
     jsid                propid;
 
   protected:
     union {
-        js::PropertyOp  rawGetter;      /* getter and setter hooks or objects */
+        PropertyOp      rawGetter;      /* getter and setter hooks or objects */
         JSObject        *getterObj;     /* user-defined callable "get" object or
                                            null if shape->hasGetterValue(); or
                                            joined function object if METHOD flag
                                            is set. */
         js::Class       *clasp;         /* prototype class for empty scope */
     };
 
     union {
-        js::StrictPropertyOp  rawSetter;/* getter is JSObject* and setter is 0
+        StrictPropertyOp rawSetter;     /* getter is JSObject* and setter is 0
                                            if shape->isMethod() */
         JSObject        *setterObj;     /* user-defined callable "set" object or
                                            null if shape->hasSetterValue() */
     };
 
   public:
     uint32              slot;           /* abstract index in object slots */
   private:
@@ -506,17 +506,17 @@ struct Shape : public js::gc::Cell
         IN_DICTIONARY   = 0x02,
 
         /* Prevent unwanted mutation of shared Bindings::lastBinding nodes. */
         FROZEN          = 0x04,
 
         UNUSED_BITS     = 0x38
     };
 
-    Shape(jsid id, js::PropertyOp getter, js::StrictPropertyOp setter, uint32 slot, uintN attrs,
+    Shape(jsid id, PropertyOp getter, StrictPropertyOp setter, uint32 slot, uintN attrs,
           uintN flags, intN shortid, uint32 shape = INVALID_SHAPE, uint32 slotSpan = 0);
 
     /* Used by EmptyShape (see jsscopeinlines.h). */
     Shape(JSCompartment *comp, Class *aclasp);
 
     /* Used by sharedNonNative. */
     explicit Shape(uint32 shape);
 
@@ -535,49 +535,49 @@ struct Shape : public js::gc::Cell
     };
 
     uintN getFlags() const  { return flags & PUBLIC_FLAGS; }
     bool hasShortID() const { return (flags & HAS_SHORTID) != 0; }
     bool isMethod() const   { return (flags & METHOD) != 0; }
 
     JSObject &methodObject() const { JS_ASSERT(isMethod()); return *getterObj; }
 
-    js::PropertyOp getter() const { return rawGetter; }
+    PropertyOp getter() const { return rawGetter; }
     bool hasDefaultGetter() const  { return !rawGetter; }
-    js::PropertyOp getterOp() const { JS_ASSERT(!hasGetterValue()); return rawGetter; }
+    PropertyOp getterOp() const { JS_ASSERT(!hasGetterValue()); return rawGetter; }
     JSObject *getterObject() const { JS_ASSERT(hasGetterValue()); return getterObj; }
 
     // Per ES5, decode null getterObj as the undefined value, which encodes as null.
-    js::Value getterValue() const {
+    Value getterValue() const {
         JS_ASSERT(hasGetterValue());
         return getterObj ? js::ObjectValue(*getterObj) : js::UndefinedValue();
     }
 
-    js::Value getterOrUndefined() const {
+    Value getterOrUndefined() const {
         return hasGetterValue() && getterObj ? js::ObjectValue(*getterObj) : js::UndefinedValue();
     }
 
-    js::StrictPropertyOp setter() const { return rawSetter; }
+    StrictPropertyOp setter() const { return rawSetter; }
     bool hasDefaultSetter() const  { return !rawSetter; }
-    js::StrictPropertyOp setterOp() const { JS_ASSERT(!hasSetterValue()); return rawSetter; }
+    StrictPropertyOp setterOp() const { JS_ASSERT(!hasSetterValue()); return rawSetter; }
     JSObject *setterObject() const { JS_ASSERT(hasSetterValue()); return setterObj; }
 
     // Per ES5, decode null setterObj as the undefined value, which encodes as null.
-    js::Value setterValue() const {
+    Value setterValue() const {
         JS_ASSERT(hasSetterValue());
         return setterObj ? js::ObjectValue(*setterObj) : js::UndefinedValue();
     }
 
-    js::Value setterOrUndefined() const {
+    Value setterOrUndefined() const {
         return hasSetterValue() && setterObj ? js::ObjectValue(*setterObj) : js::UndefinedValue();
     }
 
     inline JSDHashNumber hash() const;
     inline bool matches(const js::Shape *p) const;
-    inline bool matchesParamsAfterId(js::PropertyOp agetter, js::StrictPropertyOp asetter,
+    inline bool matchesParamsAfterId(PropertyOp agetter, StrictPropertyOp asetter,
                                      uint32 aslot, uintN aattrs, uintN aflags,
                                      intN ashortid) const;
 
     bool get(JSContext* cx, JSObject *receiver, JSObject *obj, JSObject *pobj, js::Value* vp) const;
     bool set(JSContext* cx, JSObject *obj, bool strict, js::Value* vp) const;
 
     bool hasSlot() const { return (attrs & JSPROP_SHARED) == 0; }
 
@@ -598,17 +598,17 @@ struct Shape : public js::gc::Cell
     bool isDataDescriptor() const {
         return (attrs & (JSPROP_SETTER | JSPROP_GETTER)) == 0;
     }
     bool isAccessorDescriptor() const {
         return (attrs & (JSPROP_SETTER | JSPROP_GETTER)) != 0;
     }
 
     /*
-     * For ES5 compatibility, we allow properties with JSPropertyOp-flavored
+     * For ES5 compatibility, we allow properties with PropertyOp-flavored
      * setters to be shadowed when set. The "own" property thereby created in
      * the directly referenced object will have the same getter and setter as
      * the prototype property. See bug 552432.
      */
     bool shadowable() const {
         JS_ASSERT_IF(isDataDescriptor(), writable());
         return hasSlot() || (attrs & JSPROP_SHADOWABLE);
     }
--- a/js/src/jsscopeinlines.h
+++ b/js/src/jsscopeinlines.h
@@ -166,17 +166,17 @@ StringObject::init(JSContext *cx, JSStri
     JS_ASSERT(!nativeEmpty());
     JS_ASSERT(nativeLookup(cx, ATOM_TO_JSID(cx->runtime->atomState.lengthAtom))->slot == LENGTH_SLOT);
 
     setStringThis(str);
     return true;
 }
 
 inline
-Shape::Shape(jsid propid, js::PropertyOp getter, js::StrictPropertyOp setter, uint32 slot,
+Shape::Shape(jsid propid, PropertyOp getter, StrictPropertyOp setter, uint32 slot,
              uintN attrs, uintN flags, intN shortid, uint32 shapeid, uint32 slotSpan)
   : shapeid(shapeid),
     slotSpan(slotSpan),
     numLinearSearches(0),
     propid(propid),
     rawGetter(getter),
     rawSetter(setter),
     slot(slot),
@@ -250,17 +250,17 @@ Shape::matches(const js::Shape *other) c
     JS_ASSERT(!JSID_IS_VOID(propid));
     JS_ASSERT(!JSID_IS_VOID(other->propid));
     return propid == other->propid &&
            matchesParamsAfterId(other->rawGetter, other->rawSetter, other->slot, other->attrs,
                                 other->flags, other->shortid);
 }
 
 inline bool
-Shape::matchesParamsAfterId(js::PropertyOp agetter, js::StrictPropertyOp asetter, uint32 aslot,
+Shape::matchesParamsAfterId(PropertyOp agetter, StrictPropertyOp asetter, uint32 aslot,
                             uintN aattrs, uintN aflags, intN ashortid) const
 {
     JS_ASSERT(!JSID_IS_VOID(propid));
     return rawGetter == agetter &&
            rawSetter == asetter &&
            slot == aslot &&
            attrs == aattrs &&
            ((flags ^ aflags) & PUBLIC_FLAGS) == 0 &&
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -727,17 +727,17 @@ js_XDRScript(JSXDRState *xdr, JSScript *
             if (xdr->mode == JSXDR_DECODE) {
                 tn->kind = (uint8)(kindAndDepth >> 16);
                 tn->stackDepth = (uint16)kindAndDepth;
             }
         } while (tn != tnfirst);
     }
 
     for (i = 0; i != nconsts; ++i) {
-        if (!JS_XDRValue(xdr, Jsvalify(&script->consts()->vector[i])))
+        if (!JS_XDRValue(xdr, &script->consts()->vector[i]))
             goto error;
     }
 
     xdr->script = oldscript;
     return JS_TRUE;
 
   error:
     if (xdr->mode == JSXDR_DECODE)
@@ -777,30 +777,30 @@ script_trace(JSTracer *trc, JSObject *ob
         MarkScript(trc, script, "script");
     }
 }
 
 Class js::ScriptClass = {
     "Script",
     JSCLASS_HAS_PRIVATE |
     JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
-    NULL,                 /* finalize */
-    NULL,                 /* reserved0   */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call        */
-    NULL,                 /* construct   */
-    NULL,                 /* xdrObject   */
-    NULL,                 /* hasInstance */
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
+    NULL,                    /* finalize */
+    NULL,                    /* reserved0   */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call        */
+    NULL,                    /* construct   */
+    NULL,                    /* xdrObject   */
+    NULL,                    /* hasInstance */
     script_trace
 };
 
 /*
  * Shared script filename management.
  */
 
 static const char *
--- a/js/src/jsstr.cpp
+++ b/js/src/jsstr.cpp
@@ -347,17 +347,17 @@ static JSBool
 str_enumerate(JSContext *cx, JSObject *obj)
 {
     JSString *str = obj->getPrimitiveThis().toString();
     for (size_t i = 0, length = str->length(); i < length; i++) {
         JSString *str1 = js_NewDependentString(cx, str, i, 1);
         if (!str1)
             return false;
         if (!obj->defineElement(cx, i, StringValue(str1),
-                                PropertyStub, StrictPropertyStub,
+                                JS_PropertyStub, JS_StrictPropertyStub,
                                 STRING_ELEMENT_ATTRS)) {
             return false;
         }
     }
 
     return true;
 }
 
@@ -383,23 +383,23 @@ str_resolve(JSContext *cx, JSObject *obj
     }
     return JS_TRUE;
 }
 
 Class js::StringClass = {
     js_String_str,
     JSCLASS_HAS_RESERVED_SLOTS(StringObject::RESERVED_SLOTS) |
     JSCLASS_NEW_RESOLVE | JSCLASS_HAS_CACHED_PROTO(JSProto_String),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
     str_enumerate,
     (JSResolveOp)str_resolve,
-    ConvertStub
+    JS_ConvertStub
 };
 
 /*
  * Returns a JSString * for the |this| value associated with vp, or throws a
  * TypeError if |this| is null or undefined.  This algorithm is the same as
  * calling CheckObjectCoercible(this), then returning ToString(this), as all
  * String.prototype.* methods do (other than toString and valueOf).
  */
@@ -619,17 +619,17 @@ str_toLocaleLowerCase(JSContext *cx, uin
     /*
      * Forcefully ignore the first (or any) argument and return toLowerCase(),
      * ECMA has reserved that argument, presumably for defining the locale.
      */
     if (cx->localeCallbacks && cx->localeCallbacks->localeToLowerCase) {
         JSString *str = ThisToStringForStringProto(cx, vp);
         if (!str)
             return false;
-        return cx->localeCallbacks->localeToLowerCase(cx, str, Jsvalify(vp));
+        return cx->localeCallbacks->localeToLowerCase(cx, str, vp);
     }
 
     return str_toLowerCase(cx, 0, vp);
 }
 
 JSString* JS_FASTCALL
 js_toUpperCase(JSContext *cx, JSString *str)
 {
@@ -670,17 +670,17 @@ str_toLocaleUpperCase(JSContext *cx, uin
     /*
      * Forcefully ignore the first (or any) argument and return toUpperCase(),
      * ECMA has reserved that argument, presumably for defining the locale.
      */
     if (cx->localeCallbacks && cx->localeCallbacks->localeToUpperCase) {
         JSString *str = ThisToStringForStringProto(cx, vp);
         if (!str)
             return false;
-        return cx->localeCallbacks->localeToUpperCase(cx, str, Jsvalify(vp));
+        return cx->localeCallbacks->localeToUpperCase(cx, str, vp);
     }
 
     return str_toUpperCase(cx, 0, vp);
 }
 
 static JSBool
 str_localeCompare(JSContext *cx, uintN argc, Value *vp)
 {
@@ -691,17 +691,17 @@ str_localeCompare(JSContext *cx, uintN a
     if (argc == 0) {
         vp->setInt32(0);
     } else {
         JSString *thatStr = js_ValueToString(cx, vp[2]);
         if (!thatStr)
             return false;
         if (cx->localeCallbacks && cx->localeCallbacks->localeCompare) {
             vp[2].setString(thatStr);
-            return cx->localeCallbacks->localeCompare(cx, str, thatStr, Jsvalify(vp));
+            return cx->localeCallbacks->localeCompare(cx, str, thatStr, vp);
         }
         int32 result;
         if (!CompareStrings(cx, str, thatStr, &result))
             return false;
         vp->setInt32(result);
     }
     return true;
 }
--- a/js/src/jsstr.h
+++ b/js/src/jsstr.h
@@ -41,17 +41,16 @@
 #define jsstr_h___
 
 #include <ctype.h>
 #include "jsapi.h"
 #include "jsprvtd.h"
 #include "jshashtable.h"
 #include "jslock.h"
 #include "jsobj.h"
-#include "jsvalue.h"
 #include "jscell.h"
 
 #include "vm/Unicode.h"
 
 namespace js {
 
 /* Implemented in jsstrinlines.h */
 class StringBuffer;
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -10271,18 +10271,18 @@ TraceRecorder::guardPrototypeHasNoIndexe
  * method. Several imacros require this.
  */
 JS_REQUIRES_STACK RecordingStatus
 TraceRecorder::guardNativeConversion(Value& v)
 {
     JSObject* obj = &v.toObject();
     LIns* obj_ins = get(&v);
 
-    ConvertOp convert = obj->getClass()->convert;
-    if (convert != ConvertStub)
+    JSConvertOp convert = obj->getClass()->convert;
+    if (convert != JS_ConvertStub)
         RETURN_STOP("operand has convert hook");
 
     VMSideExit* exit = snapshot(BRANCH_EXIT);
     if (obj->isNative()) {
         // The common case. Guard on shape rather than class because it'll
         // often be free: we're about to do a shape guard anyway to get the
         // .valueOf property of this object, and this guard will be cached.
         CHECK_STATUS(guardShape(obj_ins, obj, obj->shape(),
@@ -12211,22 +12211,22 @@ TraceRecorder::addDataProperty(JSObject*
     // that since we do not record this case, SETNAME and SETPROP are identical
     // as far as the tracer is concerned. (js_CheckUndeclaredVarAssignment
     // distinguishes the two, in the interpreter.)
     if (obj == globalObj)
         RETURN_STOP("set new property of global object"); // global shape change
 
     // js_AddProperty does not call the addProperty hook.
     Class* clasp = obj->getClass();
-    if (clasp->addProperty != Valueify(JS_PropertyStub))
+    if (clasp->addProperty != JS_PropertyStub)
         RETURN_STOP("set new property of object with addProperty hook");
 
     // See comment in TR::nativeSet about why we do not support setting a
     // property that has both a setter and a slot.
-    if (clasp->setProperty != Valueify(JS_StrictPropertyStub))
+    if (clasp->setProperty != JS_StrictPropertyStub)
         RETURN_STOP("set new property with setter and slot");
 
 #ifdef DEBUG
     addPropShapeBefore = obj->lastProperty();
 #endif
     return RECORD_CONTINUE;
 }
 
@@ -14052,17 +14052,17 @@ TraceRecorder::prop(JSObject* obj, LIns*
     if (pcval.isNull()) {
         if (slotp)
             RETURN_STOP_A("property not found");
 
         /*
          * We could specialize to guard on just JSClass.getProperty, but a mere
          * class guard is simpler and slightly faster.
          */
-        if (obj->getClass()->getProperty != Valueify(JS_PropertyStub)) {
+        if (obj->getClass()->getProperty != JS_PropertyStub) {
             RETURN_STOP_A("can't trace through access to undefined property if "
                           "JSClass.getProperty hook isn't stubbed");
         }
         guardClass(obj_ins, obj->getClass(), snapshot(MISMATCH_EXIT), LOAD_NORMAL);
 
         /*
          * This trace will be valid as long as neither the object nor any object
          * on its prototype chain changes shape.
@@ -17021,17 +17021,17 @@ LoopProfile::profileOperation(JSContext*
         JSObject *callee;
         if (IsFunctionObject(v, &callee)) {
             JSFunction *fun = callee->getFunctionPrivate();
             if (fun->isInterpreted()) {
                 if (cx->fp()->isFunctionFrame() && fun == cx->fp()->fun())
                     increment(OP_RECURSIVE);
             } else {
                 js::Native native = fun->u.n.native;
-                if (js_IsMathFunction(JS_JSVALIFY_NATIVE(native)))
+                if (js_IsMathFunction(native))
                     increment(OP_FLOAT);
             }
         }
     }
 
     if (op == JSOP_CALLPROP && loopStackDepth == 0)
         branchMultiplier *= mjit::GetCallTargetCount(script, pc);
 
--- a/js/src/jstypedarray.cpp
+++ b/js/src/jstypedarray.cpp
@@ -1883,39 +1883,39 @@ TypedArrayTemplate<double>::copyIndexToV
  * ArrayBuffer (base)
  */
 
 Class ArrayBuffer::slowClass = {
     "ArrayBuffer",
     JSCLASS_HAS_PRIVATE |
     JSCLASS_HAS_RESERVED_SLOTS(ARRAYBUFFER_RESERVED_SLOTS) |
     JSCLASS_HAS_CACHED_PROTO(JSProto_ArrayBuffer),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
-    FinalizeStub
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
+    JS_FinalizeStub
 };
 
 Class js::ArrayBufferClass = {
     "ArrayBuffer",
     JSCLASS_HAS_PRIVATE |
     Class::NON_NATIVE |
     JSCLASS_HAS_RESERVED_SLOTS(ARRAYBUFFER_RESERVED_SLOTS) |
     JSCLASS_HAS_CACHED_PROTO(JSProto_ArrayBuffer),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
     NULL,           /* finalize    */
     NULL,           /* reserved0   */
     NULL,           /* checkAccess */
     NULL,           /* call        */
     NULL,           /* construct   */
     NULL,           /* xdrObject   */
     NULL,           /* hasInstance */
     ArrayBuffer::obj_trace,
@@ -1940,37 +1940,37 @@ Class js::ArrayBufferClass = {
         NULL,       /* thisObject      */
         NULL,       /* clear           */
     }
 };
 
 JSPropertySpec ArrayBuffer::jsprops[] = {
     { "byteLength",
       -1, JSPROP_SHARED | JSPROP_PERMANENT | JSPROP_READONLY,
-      Jsvalify(ArrayBuffer::prop_getByteLength), JS_StrictPropertyStub },
+      ArrayBuffer::prop_getByteLength, JS_StrictPropertyStub },
     {0,0,0,0,0}
 };
 
 /*
  * shared TypedArray
  */
 
 JSPropertySpec TypedArray::jsprops[] = {
     { js_length_str,
       -1, JSPROP_SHARED | JSPROP_PERMANENT | JSPROP_READONLY,
-      Jsvalify(TypedArray::prop_getLength), JS_StrictPropertyStub },
+      TypedArray::prop_getLength, JS_StrictPropertyStub },
     { "byteLength",
       -1, JSPROP_SHARED | JSPROP_PERMANENT | JSPROP_READONLY,
-      Jsvalify(TypedArray::prop_getByteLength), JS_StrictPropertyStub },
+      TypedArray::prop_getByteLength, JS_StrictPropertyStub },
     { "byteOffset",
       -1, JSPROP_SHARED | JSPROP_PERMANENT | JSPROP_READONLY,
-      Jsvalify(TypedArray::prop_getByteOffset), JS_StrictPropertyStub },
+      TypedArray::prop_getByteOffset, JS_StrictPropertyStub },
     { "buffer",
       -1, JSPROP_SHARED | JSPROP_PERMANENT | JSPROP_READONLY,
-      Jsvalify(TypedArray::prop_getBuffer), JS_StrictPropertyStub },
+      TypedArray::prop_getBuffer, JS_StrictPropertyStub },
     {0,0,0,0,0}
 };
 
 /*
  * TypedArray boilerplate
  */
 
 #define IMPL_TYPED_ARRAY_STATICS(_typedArray)                                  \
@@ -1981,47 +1981,47 @@ JSFunctionSpec _typedArray::jsfuncs[] = 
 }
 
 #define IMPL_TYPED_ARRAY_SLOW_CLASS(_typedArray)                               \
 {                                                                              \
     #_typedArray,                                                              \
     JSCLASS_HAS_RESERVED_SLOTS(TypedArray::FIELD_MAX) |                        \
     JSCLASS_HAS_PRIVATE |                                                      \
     JSCLASS_HAS_CACHED_PROTO(JSProto_##_typedArray),                           \
-    PropertyStub,         /* addProperty */                                    \
-    PropertyStub,         /* delProperty */                                    \
-    PropertyStub,         /* getProperty */                                    \
-    StrictPropertyStub,   /* setProperty */                                    \
-    EnumerateStub,                                                             \
-    ResolveStub,                                                               \
-    ConvertStub,                                                               \
-    FinalizeStub                                                               \
+    JS_PropertyStub,         /* addProperty */                                 \
+    JS_PropertyStub,         /* delProperty */                                 \
+    JS_PropertyStub,         /* getProperty */                                 \
+    JS_StrictPropertyStub,   /* setProperty */                                 \
+    JS_EnumerateStub,                                                          \
+    JS_ResolveStub,                                                            \
+    JS_ConvertStub,                                                            \
+    JS_FinalizeStub                                                            \
 }
 
 #define IMPL_TYPED_ARRAY_FAST_CLASS(_typedArray)                               \
 {                                                                              \
     #_typedArray,                                                              \
     JSCLASS_HAS_RESERVED_SLOTS(TypedArray::FIELD_MAX) |                        \
     JSCLASS_HAS_PRIVATE |                                                      \
     Class::NON_NATIVE,                                                         \
-    PropertyStub,         /* addProperty */                                    \
-    PropertyStub,         /* delProperty */                                    \
-    PropertyStub,         /* getProperty */                                    \
-    StrictPropertyStub,   /* setProperty */                                    \
-    EnumerateStub,                                                             \
-    ResolveStub,                                                               \
-    ConvertStub,                                                               \
-    NULL,           /* finalize    */                                          \
-    NULL,           /* reserved0   */                                          \
-    NULL,           /* checkAccess */                                          \
-    NULL,           /* call        */                                          \
-    NULL,           /* construct   */                                          \
-    NULL,           /* xdrObject   */                                          \
-    NULL,           /* hasInstance */                                          \
-    _typedArray::obj_trace,           /* trace       */                                          \
+    JS_PropertyStub,         /* addProperty */                                 \
+    JS_PropertyStub,         /* delProperty */                                 \
+    JS_PropertyStub,         /* getProperty */                                 \
+    JS_StrictPropertyStub,   /* setProperty */                                 \
+    JS_EnumerateStub,                                                          \
+    JS_ResolveStub,                                                            \
+    JS_ConvertStub,                                                            \
+    NULL,                    /* finalize    */                                 \
+    NULL,                    /* reserved0   */                                 \
+    NULL,                    /* checkAccess */                                 \
+    NULL,                    /* call        */                                 \
+    NULL,                    /* construct   */                                 \
+    NULL,                    /* xdrObject   */                                 \
+    NULL,                    /* hasInstance */                                 \
+    _typedArray::obj_trace,  /* trace       */                                 \
     JS_NULL_CLASS_EXT,                                                         \
     {                                                                          \
         _typedArray::obj_lookupProperty,                                       \
         _typedArray::obj_lookupElement,                                        \
         _typedArray::obj_defineProperty,                                       \
         _typedArray::obj_defineElement,                                        \
         _typedArray::obj_getProperty,                                          \
         _typedArray::obj_getElement,                                           \
@@ -2030,18 +2030,18 @@ JSFunctionSpec _typedArray::jsfuncs[] = 
         _typedArray::obj_getAttributes,                                        \
         _typedArray::obj_getElementAttributes,                                 \
         _typedArray::obj_setAttributes,                                        \
         _typedArray::obj_setElementAttributes,                                 \
         _typedArray::obj_deleteProperty,                                       \
         _typedArray::obj_deleteElement,                                        \
         _typedArray::obj_enumerate,                                            \
         _typedArray::obj_typeOf,                                               \
-        NULL,       /* thisObject      */                                      \
-        NULL,       /* clear           */                                      \
+        NULL,                /* thisObject  */                                 \
+        NULL,                /* clear       */                                 \
     }                                                                          \
 }
 
 template<class ArrayType>
 static inline JSObject *
 InitTypedArrayClass(JSContext *cx, GlobalObject *global)
 {
     JSObject *proto = global->createBlankPrototype(cx, ArrayType::slowClass());
@@ -2054,21 +2054,21 @@ InitTypedArrayClass(JSContext *cx, Globa
     if (!ctor)
         return NULL;
 
     if (!LinkConstructorAndPrototype(cx, ctor, proto))
         return NULL;
 
     if (!ctor->defineProperty(cx, ATOM_TO_JSID(cx->runtime->atomState.BYTES_PER_ELEMENTAtom),
                               Int32Value(ArrayType::BYTES_PER_ELEMENT),
-                              PropertyStub, StrictPropertyStub,
+                              JS_PropertyStub, JS_StrictPropertyStub,
                               JSPROP_PERMANENT | JSPROP_READONLY) ||
         !proto->defineProperty(cx, ATOM_TO_JSID(cx->runtime->atomState.BYTES_PER_ELEMENTAtom),
                                Int32Value(ArrayType::BYTES_PER_ELEMENT),
-                               PropertyStub, StrictPropertyStub,
+                               JS_PropertyStub, JS_StrictPropertyStub,
                                JSPROP_PERMANENT | JSPROP_READONLY))
     {
         return NULL;
     }
 
     if (!DefinePropertiesAndBrand(cx, proto, ArrayType::jsprops, ArrayType::jsfuncs))
         return NULL;
 
--- a/js/src/jstypedarray.h
+++ b/js/src/jstypedarray.h
@@ -36,17 +36,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef jstypedarray_h
 #define jstypedarray_h
 
 #include "jsapi.h"
-#include "jsvalue.h"
+#include "jsclass.h"
 
 typedef struct JSProperty JSProperty;
 
 namespace js {
 
 /*
  * ArrayBuffer
  *
--- a/js/src/jstypedarrayinlines.h
+++ b/js/src/jstypedarrayinlines.h
@@ -36,17 +36,16 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef jstypedarrayinlines_h
 #define jstypedarrayinlines_h
 
 #include "jsapi.h"
-#include "jsvalue.h"
 #include "jsobj.h"
 
 inline uint32
 JSObject::arrayBufferByteLength()
 {
     JS_ASSERT(isArrayBuffer());
     return *((uint32*) slots);
 }
deleted file mode 100644
--- a/js/src/jsvalue.h
+++ /dev/null
@@ -1,498 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set ts=8 sw=4 et tw=99 ft=cpp:
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla SpiderMonkey JavaScript 1.9 code, released
- * June 30, 2010
- *
- * The Initial Developer of the Original Code is
- *   the Mozilla Corporation.
- *
- * Contributor(s):
- *   Luke Wagner <lw@mozilla.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef jsvalue_h__
-#define jsvalue_h__
-/*
- * Private value interface.
- */
-#include "jsprvtd.h"
-
-namespace js {
-
-/*
- * As asserted above, js::Value and jsval are layout equivalent. This means:
- *  - an instance of jsval may be reinterpreted as a js::Value and vice versa;
- *  - a pointer to a function taking jsval arguments may be reinterpreted as a
- *    function taking the same arguments, s/jsval/js::Value/, and vice versa;
- *  - a struct containing jsval members may be reinterpreted as a struct with
- *    the same members, s/jsval/js::Value/, and vice versa.
- *
- * To prevent widespread conversion using casts, which would effectively
- * disable the C++ typesystem in places where we want it, a set of safe
- * conversions between known-equivalent types is provided below. Given a type
- * JsvalT expressedin terms of jsval and an equivalent type ValueT expressed in
- * terms of js::Value, instances may be converted back and forth using:
- *
- *   JsvalT *x = ...
- *   ValueT *y = js::Valueify(x);
- *   JsvalT *z = js::Jsvalify(y);
- *   assert(x == z);
- *
- * Conversions between references is also provided for some types. If it seems
- * like a cast is needed to convert between jsval/js::Value, consider adding a
- * new safe overload to Jsvalify/Valueify.
- */
-
-static inline jsval *        Jsvalify(Value *v)        { return v; }
-static inline const jsval *  Jsvalify(const Value *v)  { return v; }
-static inline jsval &        Jsvalify(Value &v)        { return v; }
-static inline const jsval &  Jsvalify(const Value &v)  { return v; }
-static inline Value *        Valueify(jsval *v)        { return v; }
-static inline const Value *  Valueify(const jsval *v)  { return v; }
-static inline Value **       Valueify(jsval **v)       { return v; }
-static inline Value &        Valueify(jsval &v)        { return v; }
-static inline const Value &  Valueify(const jsval &v)  { return v; }
-
-struct Class;
-
-typedef JSBool
-(* Native)(JSContext *cx, uintN argc, Value *vp);
-typedef JSBool
-(* PropertyOp)(JSContext *cx, JSObject *obj, jsid id, Value *vp);
-typedef JSBool
-(* StrictPropertyOp)(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp);
-typedef JSBool
-(* ConvertOp)(JSContext *cx, JSObject *obj, JSType type, Value *vp);
-typedef JSBool
-(* NewEnumerateOp)(JSContext *cx, JSObject *obj, JSIterateOp enum_op,
-                   Value *statep, jsid *idp);
-typedef JSBool
-(* HasInstanceOp)(JSContext *cx, JSObject *obj, const Value *v, JSBool *bp);
-typedef JSBool
-(* CheckAccessOp)(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode,
-                  Value *vp);
-typedef JSBool
-(* EqualityOp)(JSContext *cx, JSObject *obj, const Value *v, JSBool *bp);
-typedef JSBool
-(* DefinePropOp)(JSContext *cx, JSObject *obj, jsid id, const Value *value,
-                 PropertyOp getter, StrictPropertyOp setter, uintN attrs);
-typedef JSBool
-(* DefineElementOp)(JSContext *cx, JSObject *obj, uint32 index, const Value *value,
-                    PropertyOp getter, StrictPropertyOp setter, uintN attrs);
-typedef JSBool
-(* PropertyIdOp)(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp);
-typedef JSBool
-(* ElementIdOp)(JSContext *cx, JSObject *obj, JSObject *receiver, uint32 index, Value *vp);
-typedef JSBool
-(* StrictPropertyIdOp)(JSContext *cx, JSObject *obj, jsid id, Value *vp, JSBool strict);
-typedef JSBool
-(* StrictElementIdOp)(JSContext *cx, JSObject *obj, uint32 index, Value *vp, JSBool strict);
-typedef JSBool
-(* DeleteIdOp)(JSContext *cx, JSObject *obj, jsid id, Value *vp, JSBool strict);
-typedef JSBool
-(* DeleteElementOp)(JSContext *cx, JSObject *obj, uint32 index, Value *vp, JSBool strict);
-typedef JSBool
-(* CallOp)(JSContext *cx, uintN argc, Value *vp);
-typedef JSBool
-(* LookupPropOp)(JSContext *cx, JSObject *obj, jsid id, JSObject **objp,
-                 JSProperty **propp);
-typedef JSBool
-(* LookupElementOp)(JSContext *cx, JSObject *obj, uint32 index, JSObject **objp,
-                    JSProperty **propp);
-typedef JSBool
-(* AttributesOp)(JSContext *cx, JSObject *obj, jsid id, uintN *attrsp);
-typedef JSBool
-(* ElementAttributesOp)(JSContext *cx, JSObject *obj, uint32 index, uintN *attrsp);
-typedef JSType
-(* TypeOfOp)(JSContext *cx, JSObject *obj);
-typedef JSObject *
-(* ObjectOp)(JSContext *cx, JSObject *obj);
-typedef void
-(* FinalizeOp)(JSContext *cx, JSObject *obj);
-
-class AutoIdVector;
-
-class PropertyName;
-
-/*
- * Prepare to make |obj| non-extensible; in particular, fully resolve its properties.
- * On error, return false.
- * If |obj| is now ready to become non-extensible, set |*fixed| to true and return true.
- * If |obj| refuses to become non-extensible, set |*fixed| to false and return true; the
- * caller will throw an appropriate error.
- */
-typedef JSBool
-(* FixOp)(JSContext *cx, JSObject *obj, bool *fixed, AutoIdVector *props);
-
-static inline Native             Valueify(JSNative f)           { return (Native)f; }
-static inline JSNative           Jsvalify(Native f)             { return (JSNative)f; }
-static inline PropertyOp         Valueify(JSPropertyOp f)       { return (PropertyOp)f; }
-static inline JSPropertyOp       Jsvalify(PropertyOp f)         { return (JSPropertyOp)f; }
-static inline StrictPropertyOp   Valueify(JSStrictPropertyOp f) { return (StrictPropertyOp)f; }
-static inline JSStrictPropertyOp Jsvalify(StrictPropertyOp f)   { return (JSStrictPropertyOp)f; }
-static inline ConvertOp          Valueify(JSConvertOp f)        { return (ConvertOp)f; }
-static inline JSConvertOp        Jsvalify(ConvertOp f)          { return (JSConvertOp)f; }
-static inline NewEnumerateOp     Valueify(JSNewEnumerateOp f)   { return (NewEnumerateOp)f; }
-static inline JSNewEnumerateOp   Jsvalify(NewEnumerateOp f)     { return (JSNewEnumerateOp)f; }
-static inline HasInstanceOp      Valueify(JSHasInstanceOp f)    { return (HasInstanceOp)f; }
-static inline JSHasInstanceOp    Jsvalify(HasInstanceOp f)      { return (JSHasInstanceOp)f; }
-static inline CheckAccessOp      Valueify(JSCheckAccessOp f)    { return (CheckAccessOp)f; }
-static inline JSCheckAccessOp    Jsvalify(CheckAccessOp f)      { return (JSCheckAccessOp)f; }
-static inline EqualityOp         Valueify(JSEqualityOp f);      /* Same type as JSHasInstanceOp */
-static inline JSEqualityOp       Jsvalify(EqualityOp f);        /* Same type as HasInstanceOp */
-
-static inline PropertyName       *Valueify(JSPropertyName *n)     { return (PropertyName *)n; }
-static inline JSPropertyName     *Jsvalify(PropertyName *n)       { return (JSPropertyName *)n; }
-
-static const PropertyOp       PropertyStub       = (PropertyOp)JS_PropertyStub;
-static const StrictPropertyOp StrictPropertyStub = (StrictPropertyOp)JS_StrictPropertyStub;
-static const JSEnumerateOp    EnumerateStub      = JS_EnumerateStub;
-static const JSResolveOp      ResolveStub        = JS_ResolveStub;
-static const ConvertOp        ConvertStub        = (ConvertOp)JS_ConvertStub;
-static const JSFinalizeOp     FinalizeStub       = JS_FinalizeStub;
-
-#define JS_CLASS_MEMBERS                                                      \
-    const char          *name;                                                \
-    uint32              flags;                                                \
-                                                                              \
-    /* Mandatory non-null function pointer members. */                        \
-    PropertyOp          addProperty;                                          \
-    PropertyOp          delProperty;                                          \
-    PropertyOp          getProperty;                                          \
-    StrictPropertyOp    setProperty;                                          \
-    JSEnumerateOp       enumerate;                                            \
-    JSResolveOp         resolve;                                              \
-    ConvertOp           convert;                                              \
-    JSFinalizeOp        finalize;                                             \
-                                                                              \
-    /* Optionally non-null members start here. */                             \
-    JSClassInternal     reserved0;                                            \
-    CheckAccessOp       checkAccess;                                          \
-    Native              call;                                                 \
-    Native              construct;                                            \
-    JSXDRObjectOp       xdrObject;                                            \
-    HasInstanceOp       hasInstance;                                          \
-    JSTraceOp           trace
-
-/*
- * The helper struct to measure the size of JS_CLASS_MEMBERS to know how much
- * we have to padd js::Class to match the size of JSClass;
- */
-struct ClassSizeMeasurement {
-    JS_CLASS_MEMBERS;
-};
-
-struct ClassExtension {
-    EqualityOp          equality;
-    JSObjectOp          outerObject;
-    JSObjectOp          innerObject;
-    JSIteratorOp        iteratorObject;
-    void               *unused;
-
-    /*
-     * isWrappedNative is true only if the class is an XPCWrappedNative.
-     * WeakMaps use this to override the wrapper disposal optimization.
-     */
-    bool                isWrappedNative;
-};
-
-#define JS_NULL_CLASS_EXT   {NULL,NULL,NULL,NULL,NULL,false}
-
-struct ObjectOps {
-    js::LookupPropOp        lookupProperty;
-    js::LookupElementOp     lookupElement;
-    js::DefinePropOp        defineProperty;
-    js::DefineElementOp     defineElement;
-    js::PropertyIdOp        getProperty;
-    js::ElementIdOp         getElement;
-    js::StrictPropertyIdOp  setProperty;
-    js::StrictElementIdOp   setElement;
-    js::AttributesOp        getAttributes;
-    js::ElementAttributesOp getElementAttributes;
-    js::AttributesOp        setAttributes;
-    js::ElementAttributesOp setElementAttributes;
-    js::DeleteIdOp          deleteProperty;
-    js::DeleteElementOp     deleteElement;
-
-    js::NewEnumerateOp      enumerate;
-    js::TypeOfOp            typeOf;
-    js::FixOp               fix;
-    js::ObjectOp            thisObject;
-    js::FinalizeOp          clear;
-};
-
-#define JS_NULL_OBJECT_OPS                                                    \
-    {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,   \
-     NULL,NULL,NULL,NULL,NULL}
-
-struct Class {
-    JS_CLASS_MEMBERS;
-    ClassExtension      ext;
-    ObjectOps           ops;
-    uint8               pad[sizeof(JSClass) - sizeof(ClassSizeMeasurement) -
-                            sizeof(ClassExtension) - sizeof(ObjectOps)];
-
-    /* Class is not native and its map is not a scope. */
-    static const uint32 NON_NATIVE = JSCLASS_INTERNAL_FLAG2;
-
-    bool isNative() const {
-        return !(flags & NON_NATIVE);
-    }
-};
-
-JS_STATIC_ASSERT(offsetof(JSClass, name) == offsetof(Class, name));
-JS_STATIC_ASSERT(offsetof(JSClass, flags) == offsetof(Class, flags));
-JS_STATIC_ASSERT(offsetof(JSClass, addProperty) == offsetof(Class, addProperty));
-JS_STATIC_ASSERT(offsetof(JSClass, delProperty) == offsetof(Class, delProperty));
-JS_STATIC_ASSERT(offsetof(JSClass, getProperty) == offsetof(Class, getProperty));
-JS_STATIC_ASSERT(offsetof(JSClass, setProperty) == offsetof(Class, setProperty));
-JS_STATIC_ASSERT(offsetof(JSClass, enumerate) == offsetof(Class, enumerate));
-JS_STATIC_ASSERT(offsetof(JSClass, resolve) == offsetof(Class, resolve));
-JS_STATIC_ASSERT(offsetof(JSClass, convert) == offsetof(Class, convert));
-JS_STATIC_ASSERT(offsetof(JSClass, finalize) == offsetof(Class, finalize));
-JS_STATIC_ASSERT(offsetof(JSClass, reserved0) == offsetof(Class, reserved0));
-JS_STATIC_ASSERT(offsetof(JSClass, checkAccess) == offsetof(Class, checkAccess));
-JS_STATIC_ASSERT(offsetof(JSClass, call) == offsetof(Class, call));
-JS_STATIC_ASSERT(offsetof(JSClass, construct) == offsetof(Class, construct));
-JS_STATIC_ASSERT(offsetof(JSClass, xdrObject) == offsetof(Class, xdrObject));
-JS_STATIC_ASSERT(offsetof(JSClass, hasInstance) == offsetof(Class, hasInstance));
-JS_STATIC_ASSERT(offsetof(JSClass, trace) == offsetof(Class, trace));
-JS_STATIC_ASSERT(sizeof(JSClass) == sizeof(Class));
-
-struct PropertyDescriptor {
-    JSObject           *obj;
-    uintN              attrs;
-    PropertyOp         getter;
-    StrictPropertyOp   setter;
-    Value              value;
-    uintN              shortid;
-};
-JS_STATIC_ASSERT(offsetof(JSPropertyDescriptor, obj) == offsetof(PropertyDescriptor, obj));
-JS_STATIC_ASSERT(offsetof(JSPropertyDescriptor, attrs) == offsetof(PropertyDescriptor, attrs));
-JS_STATIC_ASSERT(offsetof(JSPropertyDescriptor, getter) == offsetof(PropertyDescriptor, getter));
-JS_STATIC_ASSERT(offsetof(JSPropertyDescriptor, setter) == offsetof(PropertyDescriptor, setter));
-JS_STATIC_ASSERT(offsetof(JSPropertyDescriptor, value) == offsetof(PropertyDescriptor, value));
-JS_STATIC_ASSERT(offsetof(JSPropertyDescriptor, shortid) == offsetof(PropertyDescriptor, shortid));
-JS_STATIC_ASSERT(sizeof(JSPropertyDescriptor) == sizeof(PropertyDescriptor));
-
-static JS_ALWAYS_INLINE JSClass *              Jsvalify(Class *c)                { return (JSClass *)c; }
-static JS_ALWAYS_INLINE Class *                Valueify(JSClass *c)              { return (Class *)c; }
-static JS_ALWAYS_INLINE JSPropertyDescriptor * Jsvalify(PropertyDescriptor *p) { return (JSPropertyDescriptor *) p; }
-static JS_ALWAYS_INLINE PropertyDescriptor *   Valueify(JSPropertyDescriptor *p) { return (PropertyDescriptor *) p; }
-
-/******************************************************************************/
-
-/*
- * Any cast-via-function-call, inlined or not, will cause initialization to
- * happen at startup, rather than statically, so just cast in release builds.
- */
-#ifdef DEBUG
-
-# define JS_VALUEIFY(type, v) js::Valueify(v)
-# define JS_JSVALIFY(type, v) js::Jsvalify(v)
-
-static inline JSNative JsvalifyNative(Native n)   { return n; }
-static inline Native ValueifyNative(JSNative n)   { return n; }
-static inline JSPropertyOp CastNativeToJSPropertyOp(Native n) { return (JSPropertyOp) n; }
-static inline JSStrictPropertyOp CastNativeToJSStrictPropertyOp(Native n) {
-    return (JSStrictPropertyOp) n;
-}
-
-# define JS_VALUEIFY_NATIVE(n) js::ValueifyNative(n)
-# define JS_JSVALIFY_NATIVE(n) js::JsvalifyNative(n)
-# define JS_CAST_NATIVE_TO_JSPROPERTYOP(n) js::CastNativeToJSPropertyOp(n)
-# define JS_CAST_NATIVE_TO_JSSTRICTPROPERTYOP(n) js::CastNativeToJSStrictPropertyOp(n)
-
-#else
-
-# define JS_VALUEIFY(type, v) ((type) (v))
-# define JS_JSVALIFY(type, v) ((type) (v))
-
-# define JS_VALUEIFY_NATIVE(n) ((js::Native) (n))
-# define JS_JSVALIFY_NATIVE(n) ((JSNative) (n))
-# define JS_CAST_NATIVE_TO_JSPROPERTYOP(n) ((JSPropertyOp) (n))
-# define JS_CAST_NATIVE_TO_JSSTRICTPROPERTYOP(n) ((JSStrictPropertyOp) (n))
-
-#endif
-
-/*
- * JSFunctionSpec uses JSAPI jsval in function signatures whereas the engine
- * uses js::Value. To avoid widespread (JSNative) casting, have JS_FN perform a
- * type-safe cast.
- */
-#undef JS_FN
-#define JS_FN(name,call,nargs,flags)                                          \
-     {name, JS_JSVALIFY_NATIVE(call), nargs, (flags) | JSFUN_STUB_GSOPS}
-
-/*
- * JSPropertySpec uses JSAPI JSPropertyOp and JSStrictPropertyOp in function
- * signatures, but with JSPROP_NATIVE_ACCESSORS the actual values must be
- * JSNatives. To avoid widespread casting, have JS_PSG and JS_PSGS perform
- * type-safe casts.
- */
-#define JS_PSG(name,getter,flags)                                             \
-    {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS,              \
-     JS_CAST_NATIVE_TO_JSPROPERTYOP(getter),                                  \
-     NULL}
-#define JS_PSGS(name,getter,setter,flags)                                     \
-    {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS,              \
-     JS_CAST_NATIVE_TO_JSPROPERTYOP(getter),                                  \
-     JS_CAST_NATIVE_TO_JSSTRICTPROPERTYOP(setter)}
-#define JS_PS_END {0, 0, 0, 0, 0}
-
-/******************************************************************************/
-
-/*
- * In some cases (quickstubs) we want to take a value in whatever manner is
- * appropriate for the architecture and normalize to a const js::Value &. On
- * x64, passing a js::Value may cause the to unnecessarily be passed through
- * memory instead of registers, so jsval, which is a builtin uint64 is used.
- */
-#if JS_BITS_PER_WORD == 32
-typedef const js::Value *ValueArgType;
-
-static JS_ALWAYS_INLINE const js::Value &
-ValueArgToConstRef(const js::Value *arg)
-{
-    return *arg;
-}
-
-#elif JS_BITS_PER_WORD == 64
-typedef js::Value        ValueArgType;
-
-static JS_ALWAYS_INLINE const Value &
-ValueArgToConstRef(const Value &v)
-{
-    return v;
-}
-#endif
-
-/******************************************************************************/
-
-static JS_ALWAYS_INLINE void
-ClearValueRange(Value *vec, uintN len, bool useHoles)
-{
-    if (useHoles) {
-        for (uintN i = 0; i < len; i++)
-            vec[i].setMagic(JS_ARRAY_HOLE);
-    } else {
-        for (uintN i = 0; i < len; i++)
-            vec[i].setUndefined();
-    }
-}
-
-static JS_ALWAYS_INLINE void
-MakeRangeGCSafe(Value *vec, size_t len)
-{
-    PodZero(vec, len);
-}
-
-static JS_ALWAYS_INLINE void
-MakeRangeGCSafe(Value *beg, Value *end)
-{
-    PodZero(beg, end - beg);
-}
-
-static JS_ALWAYS_INLINE void
-MakeRangeGCSafe(jsid *beg, jsid *end)
-{
-    for (jsid *id = beg; id != end; ++id)
-        *id = INT_TO_JSID(0);
-}
-
-static JS_ALWAYS_INLINE void
-MakeRangeGCSafe(jsid *vec, size_t len)
-{
-    MakeRangeGCSafe(vec, vec + len);
-}
-
-static JS_ALWAYS_INLINE void
-MakeRangeGCSafe(const Shape **beg, const Shape **end)
-{
-    PodZero(beg, end - beg);
-}
-
-static JS_ALWAYS_INLINE void
-MakeRangeGCSafe(const Shape **vec, size_t len)
-{
-    PodZero(vec, len);
-}
-
-static JS_ALWAYS_INLINE void
-SetValueRangeToUndefined(Value *beg, Value *end)
-{
-    for (Value *v = beg; v != end; ++v)
-        v->setUndefined();
-}
-
-static JS_ALWAYS_INLINE void
-SetValueRangeToUndefined(Value *vec, size_t len)
-{
-    SetValueRangeToUndefined(vec, vec + len);
-}
-
-static JS_ALWAYS_INLINE void
-SetValueRangeToNull(Value *beg, Value *end)
-{
-    for (Value *v = beg; v != end; ++v)
-        v->setNull();
-}
-
-static JS_ALWAYS_INLINE void
-SetValueRangeToNull(Value *vec, size_t len)
-{
-    SetValueRangeToNull(vec, vec + len);
-}
-
-/*
- * To really poison a set of values, using 'magic' or 'undefined' isn't good
- * enough since often these will just be ignored by buggy code (see bug 629974)
- * in debug builds and crash in release builds. Instead, we use a safe-for-crash
- * pointer.
- */
-static JS_ALWAYS_INLINE void
-Debug_SetValueRangeToCrashOnTouch(Value *beg, Value *end)
-{
-#ifdef DEBUG
-    for (Value *v = beg; v != end; ++v)
-        v->setObject(*reinterpret_cast<JSObject *>(0x42));
-#endif
-}
-
-static JS_ALWAYS_INLINE void
-Debug_SetValueRangeToCrashOnTouch(Value *vec, size_t len)
-{
-#ifdef DEBUG
-    Debug_SetValueRangeToCrashOnTouch(vec, vec + len);
-#endif
-}
-
-}      /* namespace js */
-#endif /* jsvalue_h__ */
--- a/js/src/jswatchpoint.cpp
+++ b/js/src/jswatchpoint.cpp
@@ -164,17 +164,17 @@ WatchpointMap::triggerWatchpoint(JSConte
                 } else {
                     old = obj->nativeGetSlot(slot);
                 }
             }
         }
     }
 
     /* Call the handler. */
-    return handler(cx, obj, id, Jsvalify(old), Jsvalify(vp), closure);
+    return handler(cx, obj, id, old, vp, closure);
 }
 
 bool
 WatchpointMap::markAllIteratively(JSTracer *trc)
 {
     JSRuntime *rt = trc->context->runtime;
     if (rt->gcCurrentCompartment) {
         WatchpointMap *wpmap = rt->gcCurrentCompartment->watchpointMap;
--- a/js/src/jswatchpoint.h
+++ b/js/src/jswatchpoint.h
@@ -38,17 +38,16 @@
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef jswatchpoint_h___
 #define jswatchpoint_h___
 
 #include "jshashtable.h"
 #include "jsprvtd.h"
 #include "jsapi.h"
-#include "jsvalue.h"
 
 namespace js {
 
 struct WatchKey {
     WatchKey() {}
     WatchKey(JSObject *obj, jsid id) : object(obj), id(id) {}
     JSObject *object;
     jsid id;
--- a/js/src/jsweakmap.cpp
+++ b/js/src/jsweakmap.cpp
@@ -257,30 +257,30 @@ WeakMap_construct(JSContext *cx, uintN a
     vp->setObject(*obj);
     return true;
 }
 
 Class js::WeakMapClass = {
     "WeakMap",
     JSCLASS_HAS_PRIVATE |
     JSCLASS_HAS_CACHED_PROTO(JSProto_WeakMap),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
     WeakMap_finalize,
-    NULL,                 /* reserved0   */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call        */
-    NULL,                 /* construct   */
-    NULL,                 /* xdrObject   */
-    NULL,                 /* hasInstance */
+    NULL,                    /* reserved0   */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call        */
+    NULL,                    /* construct   */
+    NULL,                    /* xdrObject   */
+    NULL,                    /* hasInstance */
     WeakMap_mark
 };
 
 static JSFunctionSpec weak_map_methods[] = {
     JS_FN("has",    WeakMap_has, 1, 0),
     JS_FN("get",    WeakMap_get, 2, 0),
     JS_FN("delete", WeakMap_delete, 1, 0),
     JS_FN("set",    WeakMap_set, 2, 0),
--- a/js/src/jswrapper.cpp
+++ b/js/src/jswrapper.cpp
@@ -124,53 +124,50 @@ JSWrapper::~JSWrapper()
 #define SET(action) CHECKED(action, SET)
 #define GET(action) CHECKED(action, GET)
 
 bool
 JSWrapper::getPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id,
                                  bool set, PropertyDescriptor *desc)
 {
     desc->obj = NULL; // default result if we refuse to perform this action
-    CHECKED(JS_GetPropertyDescriptorById(cx, wrappedObject(wrapper), id, JSRESOLVE_QUALIFIED,
-                                         Jsvalify(desc)), set ? SET : GET);
+    CHECKED(JS_GetPropertyDescriptorById(cx, wrappedObject(wrapper), id, JSRESOLVE_QUALIFIED, desc),
+            set ? SET : GET);
 }
 
 static bool
 GetOwnPropertyDescriptor(JSContext *cx, JSObject *obj, jsid id, uintN flags, JSPropertyDescriptor *desc)
 {
     // If obj is a proxy, we can do better than just guessing. This is
     // important for certain types of wrappers that wrap other wrappers.
-    if (obj->isProxy()) {
-        return JSProxy::getOwnPropertyDescriptor(cx, obj, id,
-                                                 flags & JSRESOLVE_ASSIGNING,
-                                                 Valueify(desc));
-    }
+    if (obj->isProxy())
+        return JSProxy::getOwnPropertyDescriptor(cx, obj, id, flags & JSRESOLVE_ASSIGNING, desc);
 
     if (!JS_GetPropertyDescriptorById(cx, obj, id, flags, desc))
         return false;
     if (desc->obj != obj)
         desc->obj = NULL;
     return true;
 }
 
 bool
 JSWrapper::getOwnPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id, bool set,
                                     PropertyDescriptor *desc)
 {
     desc->obj = NULL; // default result if we refuse to perform this action
-    CHECKED(GetOwnPropertyDescriptor(cx, wrappedObject(wrapper), id, JSRESOLVE_QUALIFIED,
-                                     Jsvalify(desc)), set ? SET : GET);
+    CHECKED(GetOwnPropertyDescriptor(cx, wrappedObject(wrapper), id, JSRESOLVE_QUALIFIED, desc),
+            set ? SET : GET);
 }
 
 bool
 JSWrapper::defineProperty(JSContext *cx, JSObject *wrapper, jsid id,
                           PropertyDescriptor *desc)
 {
-    SET(JS_DefinePropertyById(cx, wrappedObject(wrapper), id, Jsvalify(desc->value),
-                              Jsvalify(desc->getter), Jsvalify(desc->setter), desc->attrs));
+    SET(JS_DefinePropertyById(cx, wrappedObject(wrapper), id, desc->value,
+                              desc->getter, desc->setter, desc->attrs));
 }
 
 bool
 JSWrapper::getOwnPropertyNames(JSContext *cx, JSObject *wrapper, AutoIdVector &props)
 {
     // if we refuse to perform this action, props remains empty
     jsid id = JSID_VOID;
     GET(GetPropertyNames(cx, wrappedObject(wrapper), JSITER_OWNONLY | JSITER_HIDDEN, &props));
@@ -183,17 +180,17 @@ ValueToBoolean(Value *vp, bool *bp)
     return true;
 }
 
 bool
 JSWrapper::delete_(JSContext *cx, JSObject *wrapper, jsid id, bool *bp)
 {
     *bp = true; // default result if we refuse to perform this action
     Value v;
-    SET(JS_DeletePropertyById2(cx, wrappedObject(wrapper), id, Jsvalify(&v)) &&
+    SET(JS_DeletePropertyById2(cx, wrappedObject(wrapper), id, &v) &&
         ValueToBoolean(&v, bp));
 }
 
 bool
 JSWrapper::enumerate(JSContext *cx, JSObject *wrapper, AutoIdVector &props)
 {
     // if we refuse to perform this action, props remains empty
     static jsid id = JSID_VOID;
@@ -224,17 +221,17 @@ JSWrapper::has(JSContext *cx, JSObject *
 }
 
 bool
 JSWrapper::hasOwn(JSContext *cx, JSObject *wrapper, jsid id, bool *bp)
 {
     *bp = false; // default result if we refuse to perform this action
     PropertyDescriptor desc;
     JSObject *wobj = wrappedObject(wrapper);
-    GET(JS_GetPropertyDescriptorById(cx, wobj, id, JSRESOLVE_QUALIFIED, Jsvalify(&desc)) &&
+    GET(JS_GetPropertyDescriptorById(cx, wobj, id, JSRESOLVE_QUALIFIED, &desc) &&
         Cond(desc.obj == wobj, bp));
 }
 
 bool
 JSWrapper::get(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, Value *vp)
 {
     vp->setUndefined(); // default result if we refuse to perform this action
     GET(wrappedObject(wrapper)->getProperty(cx, receiver, id, vp));
@@ -281,17 +278,17 @@ JSWrapper::construct(JSContext *cx, JSOb
 }
 
 bool
 JSWrapper::hasInstance(JSContext *cx, JSObject *wrapper, const Value *vp, bool *bp)
 {
     *bp = false; // default result if we refuse to perform this action
     const jsid id = JSID_VOID;
     JSBool b = JS_FALSE;
-    GET(JS_HasInstance(cx, wrappedObject(wrapper), Jsvalify(*vp), &b) && Cond(b, bp));
+    GET(JS_HasInstance(cx, wrappedObject(wrapper), *vp, &b) && Cond(b, bp));
 }
 
 JSType
 JSWrapper::typeOf(JSContext *cx, JSObject *wrapper)
 {
     return TypeOfValue(cx, ObjectValue(*wrappedObject(wrapper)));
 }
 
--- a/js/src/jsxml.cpp
+++ b/js/src/jsxml.cpp
@@ -208,37 +208,37 @@ namespace_equality(JSContext *cx, JSObje
           : EqualStrings(obj->getNameURI(), obj2->getNameURI());
     return JS_TRUE;
 }
 
 JS_FRIEND_DATA(Class) js::NamespaceClass = {
     "Namespace",
     JSCLASS_HAS_RESERVED_SLOTS(JSObject::NAMESPACE_CLASS_RESERVED_SLOTS) |
     JSCLASS_HAS_CACHED_PROTO(JSProto_Namespace),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
-    FinalizeStub,
-    NULL,                 /* reserved0   */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call        */
-    NULL,                 /* construct   */
-    NULL,                 /* xdrObject   */
-    NULL,                 /* hasInstance */
-    NULL,                 /* mark        */
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
+    JS_FinalizeStub,
+    NULL,                    /* reserved0   */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call        */
+    NULL,                    /* construct   */
+    NULL,                    /* xdrObject   */
+    NULL,                    /* hasInstance */
+    NULL,                    /* mark        */
     {
         namespace_equality,
-        NULL,             /* outerObject    */
-        NULL,             /* innerObject    */
-        NULL,             /* iteratorObject */
-        NULL,             /* wrappedObject  */
+        NULL,                /* outerObject    */
+        NULL,                /* innerObject    */
+        NULL,                /* iteratorObject */
+        NULL,                /* wrappedObject  */
     }
 };
 
 #define NAMESPACE_ATTRS                                                       \
     (JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_SHARED)
 
 static JSPropertySpec namespace_props[] = {
     {js_prefix_str, 0, NAMESPACE_ATTRS, NamePrefix_getter, 0},
@@ -251,17 +251,17 @@ namespace_toString(JSContext *cx, uintN 
 {
     JSObject *obj = ToObject(cx, &vp[1]);
     if (!obj)
         return JS_FALSE;
     if (!obj->isNamespace()) {
         ReportIncompatibleMethod(cx, vp, &NamespaceClass);
         return JS_FALSE;
     }
-    *vp = Valueify(obj->getNameURIVal());
+    *vp = obj->getNameURIVal();
     return JS_TRUE;
 }
 
 static JSFunctionSpec namespace_methods[] = {
     JS_FN(js_toString_str,  namespace_toString,        0,0),
     JS_FS_END
 };
 
@@ -324,72 +324,72 @@ qname_equality(JSContext *cx, JSObject *
           : qname_identity(qn, obj2);
     return JS_TRUE;
 }
 
 JS_FRIEND_DATA(Class) js::QNameClass = {
     "QName",
     JSCLASS_HAS_RESERVED_SLOTS(JSObject::QNAME_CLASS_RESERVED_SLOTS) |
     JSCLASS_HAS_CACHED_PROTO(JSProto_QName),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
-    FinalizeStub,
-    NULL,                 /* reserved0   */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call        */
-    NULL,                 /* construct   */
-    NULL,                 /* xdrObject   */
-    NULL,                 /* hasInstance */
-    NULL,                 /* mark        */
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
+    JS_FinalizeStub,
+    NULL,                    /* reserved0   */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call        */
+    NULL,                    /* construct   */
+    NULL,                    /* xdrObject   */
+    NULL,                    /* hasInstance */
+    NULL,                    /* mark        */
     {
         qname_equality,
-        NULL,             /* outerObject    */
-        NULL,             /* innerObject    */
-        NULL,             /* iteratorObject */
-        NULL,             /* wrappedObject  */
+        NULL,                /* outerObject    */
+        NULL,                /* innerObject    */
+        NULL,                /* iteratorObject */
+        NULL,                /* wrappedObject  */
     }
 };
 
 /*
  * Classes for the ECMA-357-internal types AttributeName and AnyName, which
  * are like QName, except that they have no property getters.  They share the
  * qname_toString method, and therefore are exposed as constructable objects
  * in this implementation.
  */
 JS_FRIEND_DATA(Class) js::AttributeNameClass = {
     js_AttributeName_str,
     JSCLASS_HAS_RESERVED_SLOTS(JSObject::QNAME_CLASS_RESERVED_SLOTS) |
     JSCLASS_IS_ANONYMOUS,
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
-    FinalizeStub
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
+    JS_FinalizeStub
 };
 
 JS_FRIEND_DATA(Class) js::AnyNameClass = {
     js_AnyName_str,
     JSCLASS_HAS_RESERVED_SLOTS(JSObject::QNAME_CLASS_RESERVED_SLOTS) |
     JSCLASS_IS_ANONYMOUS,
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
-    FinalizeStub
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
+    JS_FinalizeStub
 };
 
 #define QNAME_ATTRS (JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_SHARED)
 
 static JSPropertySpec qname_props[] = {
     {js_uri_str,       0, QNAME_ATTRS, QNameNameURI_getter,   0},
     {js_localName_str, 0, QNAME_ATTRS, QNameLocalName_getter, 0},
     {0,0,0,0,0}
@@ -568,17 +568,17 @@ js_IsXMLName(JSContext *cx, jsval v)
      * without actually allocating the object or computing its uri and prefix.
      * See ECMA-357 13.1.2.1 step 1 and 13.3.2.
      */
     if (!JSVAL_IS_PRIMITIVE(v) &&
         JSVAL_TO_OBJECT(v)->isQName()) {
         name = JSVAL_TO_OBJECT(v)->getQNameLocalName();
     } else {
         older = JS_SetErrorReporter(cx, NULL);
-        JSString *str = js_ValueToString(cx, Valueify(v));
+        JSString *str = js_ValueToString(cx, v);
         if (str)
             name = str->ensureLinear(cx);
         JS_SetErrorReporter(cx, older);
         if (!name) {
             JS_ClearPendingException(cx);
             return JS_FALSE;
         }
     }
@@ -642,73 +642,73 @@ NamespaceHelper(JSContext *cx, JSObject 
     if (argc == 1 || argc == -1) {
         if (isNamespace) {
             obj->setNameURI(uriobj->getNameURI());
             obj->setNamePrefix(uriobj->getNamePrefix());
         } else if (isQName && (uri = uriobj->getNameURI())) {
             obj->setNameURI(uri);
             obj->setNamePrefix(uriobj->getNamePrefix());
         } else {
-            JSString *str = js_ValueToString(cx, Valueify(urival));
+            JSString *str = js_ValueToString(cx, urival);
             if (!str)
                 return JS_FALSE;
             uri = str->ensureLinear(cx);
             if (!uri)
                 return JS_FALSE;
             obj->setNameURI(uri);
             if (!uri->empty())
                 obj->clearNamePrefix();
         }
     } else if (argc == 2) {
         if (!isQName || !(uri = uriobj->getNameURI())) {
-            JSString *str = js_ValueToString(cx, Valueify(urival));
+            JSString *str = js_ValueToString(cx, urival);
             if (!str)
                 return JS_FALSE;
             uri = str->ensureLinear(cx);
             if (!uri)
                 return JS_FALSE;
         }
         obj->setNameURI(uri);
 
         prefixval = argv[0];
         if (uri->empty()) {
             if (!JSVAL_IS_VOID(prefixval)) {
-                JSString *str = js_ValueToString(cx, Valueify(prefixval));
+                JSString *str = js_ValueToString(cx, prefixval);
                 if (!str)
                     return JS_FALSE;
                 if (!str->empty()) {
                     JSAutoByteString bytes;
                     if (js_ValueToPrintable(cx, StringValue(str), &bytes)) {
                         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
                                              JSMSG_BAD_XML_NAMESPACE, bytes.ptr());
                     }
                     return JS_FALSE;
                 }
             }
         } else if (JSVAL_IS_VOID(prefixval) || !js_IsXMLName(cx, prefixval)) {
             obj->clearNamePrefix();
         } else {
-            JSString *str = js_ValueToString(cx, Valueify(prefixval));
+            JSString *str = js_ValueToString(cx, prefixval);
             if (!str)
                 return JS_FALSE;
             prefix = str->ensureLinear(cx);
             if (!prefix)
                 return JS_FALSE;
             obj->setNamePrefix(prefix);
         }
     }
     return JS_TRUE;
 }
 
 static JSBool
 Namespace(JSContext *cx, uintN argc, Value *vp)
 {
     JSObject *thisobj = NULL;
     (void)IsConstructing_PossiblyWithGivenThisObject(vp, &thisobj);
-    return NamespaceHelper(cx, thisobj, argc, Jsvalify(vp + 2), Jsvalify(vp));
+    return NamespaceHelper(cx, thisobj, argc, vp + 2, vp);
 }
 
 /*
  * When argc is -1, it indicates argv is empty but the code should behave as
  * if argc is 1 and argv[0] is JSVAL_VOID.
  */
 static JSBool
 QNameHelper(JSContext *cx, JSObject *obj, intN argc, jsval *argv, jsval *rval)
@@ -759,17 +759,17 @@ QNameHelper(JSContext *cx, JSObject *obj
         nameval = qn->getQNameLocalNameVal();
     }
 
     if (argc == 0) {
         name = cx->runtime->emptyString;
     } else if (argc < 0) {
         name = cx->runtime->atomState.typeAtoms[JSTYPE_VOID];
     } else {
-        if (!js_ValueToAtom(cx, Valueify(nameval), &name))
+        if (!js_ValueToAtom(cx, nameval, &name))
             return false;
     }
 
     if (argc > 1 && !JSVAL_IS_VOID(argv[0])) {
         nsval = argv[0];
     } else if (IS_STAR(name)) {
         nsval = JSVAL_NULL;
     } else {
@@ -804,17 +804,17 @@ QNameHelper(JSContext *cx, JSObject *obj
         if (isNamespace) {
             uri = obj2->getNameURI();
             prefix = obj2->getNamePrefix();
         } else if (isQName && (uri = obj2->getNameURI())) {
             JS_ASSERT(argc > 1);
             prefix = obj2->getNamePrefix();
         } else {
             JS_ASSERT(argc > 1);
-            JSString *str = js_ValueToString(cx, Valueify(nsval));
+            JSString *str = js_ValueToString(cx, nsval);
             if (!str)
                 return JS_FALSE;
             uri = str->ensureLinear(cx);
             if (!uri)
                 return JS_FALSE;
             argv[0] = STRING_TO_JSVAL(uri);     /* local root */
 
             /* NULL here represents *undefined* in ECMA-357 13.2.2 3(c)iii. */
@@ -826,17 +826,17 @@ out:
     return InitXMLQName(cx, obj, uri, prefix, name);
 }
 
 static JSBool
 QName(JSContext *cx, uintN argc, Value *vp)
 {
     JSObject *thisobj = NULL;
     (void)IsConstructing_PossiblyWithGivenThisObject(vp, &thisobj);
-    return QNameHelper(cx, thisobj, argc, Jsvalify(vp + 2), Jsvalify(vp));
+    return QNameHelper(cx, thisobj, argc, vp + 2, vp);
 }
 
 /*
  * XMLArray library functions.
  */
 static JSBool
 namespace_identity(const void *a, const void *b)
 {
@@ -1633,17 +1633,17 @@ fail:
  * XML helper, object-ops, and library functions.  We start with the helpers,
  * in ECMA-357 order, but merging XML (9.1) and XMLList (9.2) helpers.
  */
 static JSBool
 GetXMLSetting(JSContext *cx, const char *name, jsval *vp)
 {
     jsval v;
 
-    if (!js_FindClassObject(cx, NULL, JSProto_XML, Valueify(&v)))
+    if (!js_FindClassObject(cx, NULL, JSProto_XML, &v))
         return JS_FALSE;
     if (JSVAL_IS_PRIMITIVE(v) || !JSVAL_TO_OBJECT(v)->isFunction()) {
         *vp = JSVAL_VOID;
         return JS_TRUE;
     }
     return JS_GetProperty(cx, JSVAL_TO_OBJECT(v), name, vp);
 }
 
@@ -1849,17 +1849,17 @@ ToXML(JSContext *cx, jsval v)
 
         if (clasp != &StringClass &&
             clasp != &NumberClass &&
             clasp != &BooleanClass) {
             goto bad;
         }
     }
 
-    str = js_ValueToString(cx, Valueify(v));
+    str = js_ValueToString(cx, v);
     if (!str)
         return NULL;
     if (str->empty()) {
         length = 0;
 #ifdef __GNUC__         /* suppress bogus gcc warnings */
         xml = NULL;
 #endif
     } else {
@@ -1883,17 +1883,17 @@ ToXML(JSContext *cx, jsval v)
     } else {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_SYNTAX_ERROR);
         return NULL;
     }
     return obj;
 
 bad:
     js_ReportValueError(cx, JSMSG_BAD_XML_CONVERSION,
-                        JSDVG_IGNORE_STACK, Valueify(v), NULL);
+                        JSDVG_IGNORE_STACK, v, NULL);
     return NULL;
 }
 
 static JSBool
 Append(JSContext *cx, JSXML *list, JSXML *kid);
 
 static JSObject *
 ToXMLList(JSContext *cx, jsval v)
@@ -1930,17 +1930,17 @@ ToXMLList(JSContext *cx, jsval v)
 
         if (clasp != &StringClass &&
             clasp != &NumberClass &&
             clasp != &BooleanClass) {
             goto bad;
         }
     }
 
-    str = js_ValueToString(cx, Valueify(v));
+    str = js_ValueToString(cx, v);
     if (!str)
         return NULL;
     if (str->empty()) {
         xml = NULL;
         length = 0;
     } else {
         if (!js_EnterLocalRootScope(cx))
             return NULL;
@@ -1965,17 +1965,17 @@ ToXMLList(JSContext *cx, jsval v)
     }
 
     if (xml)
         js_LeaveLocalRootScopeWithResult(cx, listobj);
     return listobj;
 
 bad:
     js_ReportValueError(cx, JSMSG_BAD_XMLLIST_CONVERSION,
-                        JSDVG_IGNORE_STACK, Valueify(v), NULL);
+                        JSDVG_IGNORE_STACK, v, NULL);
     return NULL;
 }
 
 /*
  * ECMA-357 10.2.1 Steps 5-7 pulled out as common subroutines of XMLToXMLString
  * and their library-public js_* counterparts.  The guts of MakeXMLCDataString,
  * MakeXMLCommentString, and MakeXMLPIString are further factored into a common
  * MakeXMLSpecialString subroutine.
@@ -2220,18 +2220,17 @@ GetNamespace(JSContext *cx, JSObject *qn
             }
         }
     }
 
     /* If we didn't match, make a new namespace from qn. */
     if (!match) {
         argv[0] = prefix ? STRING_TO_JSVAL(prefix) : JSVAL_VOID;
         argv[1] = STRING_TO_JSVAL(uri);
-        ns = js_ConstructObject(cx, &NamespaceClass, NULL, NULL,
-                                2, Valueify(argv));
+        ns = js_ConstructObject(cx, &NamespaceClass, NULL, NULL, 2, argv);
         if (!ns)
             return NULL;
         match = ns;
     }
     return match;
 }
 
 static JSLinearString *
@@ -2727,28 +2726,28 @@ ToXMLString(JSContext *cx, jsval v, uint
     if (JSVAL_IS_NULL(v) || JSVAL_IS_VOID(v)) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
                              JSMSG_BAD_XML_CONVERSION,
                              JSVAL_IS_NULL(v) ? js_null_str : js_undefined_str);
         return NULL;
     }
 
     if (JSVAL_IS_BOOLEAN(v) || JSVAL_IS_NUMBER(v))
-        return js_ValueToString(cx, Valueify(v));
+        return js_ValueToString(cx, v);
 
     if (JSVAL_IS_STRING(v)) {
         StringBuffer sb(cx);
         return EscapeElementValue(cx, sb, JSVAL_TO_STRING(v), toSourceFlag);
     }
 
     JSObject *obj = JSVAL_TO_OBJECT(v);
     if (!obj->isXML()) {
-        if (!ToPrimitive(cx, JSTYPE_STRING, Valueify(&v)))
+        if (!ToPrimitive(cx, JSTYPE_STRING, &v))
             return NULL;
-        JSString *str = js_ValueToString(cx, Valueify(v));
+        JSString *str = js_ValueToString(cx, v);
         if (!str)
             return NULL;
         StringBuffer sb(cx);
         return EscapeElementValue(cx, sb, str, toSourceFlag);
     }
 
     /* Handle non-element cases in this switch, returning from each case. */
     JS::Anchor<JSObject *> anch(obj);
@@ -2761,23 +2760,23 @@ ToAttributeName(JSContext *cx, jsval v)
 {
     JSLinearString *uri, *prefix;
     JSObject *obj;
     Class *clasp;
     JSObject *qn;
 
     JSAtom *name;
     if (JSVAL_IS_STRING(v)) {
-        if (!js_ValueToAtom(cx, Valueify(v), &name))
+        if (!js_ValueToAtom(cx, v, &name))
             return NULL;
         uri = prefix = cx->runtime->emptyString;
     } else {
         if (JSVAL_IS_PRIMITIVE(v)) {
             js_ReportValueError(cx, JSMSG_BAD_XML_ATTR_NAME,
-                                JSDVG_IGNORE_STACK, Valueify(v), NULL);
+                                JSDVG_IGNORE_STACK, v, NULL);
             return NULL;
         }
 
         obj = JSVAL_TO_OBJECT(v);
         clasp = obj->getClass();
         if (clasp == &AttributeNameClass)
             return obj;
 
@@ -2785,17 +2784,17 @@ ToAttributeName(JSContext *cx, jsval v)
             qn = obj;
             uri = qn->getNameURI();
             prefix = qn->getNamePrefix();
             name = qn->getQNameLocalName();
         } else {
             if (clasp == &AnyNameClass) {
                 name = cx->runtime->atomState.starAtom;
             } else {
-                if (!js_ValueToAtom(cx, Valueify(v), &name))
+                if (!js_ValueToAtom(cx, v, &name))
                     return NULL;
             }
             uri = prefix = cx->runtime->emptyString;
         }
     }
 
     qn = NewXMLAttributeName(cx, uri, prefix, name);
     if (!qn)
@@ -2837,29 +2836,29 @@ ToXMLName(JSContext *cx, jsval v, jsid *
     JSObject *obj;
     Class *clasp;
     uint32 index;
 
     if (JSVAL_IS_STRING(v)) {
         name = JSVAL_TO_STRING(v);
     } else {
         if (JSVAL_IS_PRIMITIVE(v)) {
-            ReportBadXMLName(cx, Valueify(v));
+            ReportBadXMLName(cx, v);
             return NULL;
         }
 
         obj = JSVAL_TO_OBJECT(v);
         clasp = obj->getClass();
         if (clasp == &AttributeNameClass || clasp == &QNameClass)
             goto out;
         if (clasp == &AnyNameClass) {
             name = cx->runtime->atomState.starAtom;
             goto construct;
         }
-        name = js_ValueToString(cx, Valueify(v));
+        name = js_ValueToString(cx, v);
         if (!name)
             return NULL;
     }
 
     atomizedName = js_AtomizeString(cx, name);
     if (!atomizedName)
         return NULL;
 
@@ -2884,17 +2883,17 @@ ToXMLName(JSContext *cx, jsval v, jsid *
         if (!name)
             return NULL;
         *funidp = JSID_VOID;
         return ToAttributeName(cx, STRING_TO_JSVAL(name));
     }
 
 construct:
     v = STRING_TO_JSVAL(name);
-    obj = js_ConstructObject(cx, &QNameClass, NULL, NULL, 1, Valueify(&v));
+    obj = js_ConstructObject(cx, &QNameClass, NULL, NULL, 1, &v);
     if (!obj)
         return NULL;
 
 out:
     if (!GetLocalNameFromFunctionQName(obj, funidp, cx))
         *funidp = JSID_VOID;
     return obj;
 
@@ -3377,17 +3376,17 @@ Equals(JSContext *cx, JSXML *xml, jsval 
         if (xml->xml_class == JSXML_CLASS_LIST) {
             if (xml->xml_kids.length == 1) {
                 vxml = XMLARRAY_MEMBER(&xml->xml_kids, 0, JSXML);
                 if (!vxml)
                     return JS_TRUE;
                 vobj = js_GetXMLObject(cx, vxml);
                 if (!vobj)
                     return JS_FALSE;
-                return js_TestXMLEquality(cx, ObjectValue(*vobj), Valueify(v), bp);
+                return js_TestXMLEquality(cx, ObjectValue(*vobj), v, bp);
             }
             if (JSVAL_IS_VOID(v) && xml->xml_kids.length == 0)
                 *bp = JS_TRUE;
         }
     } else {
         vobj = JSVAL_TO_OBJECT(v);
         if (!vobj->isXML()) {
             *bp = JS_FALSE;
@@ -3448,17 +3447,17 @@ Insert(JSContext *cx, JSXML *xml, uint32
             } else if (vxml->xml_class == JSXML_CLASS_ELEMENT) {
                 /* OPTION: enforce that descendants have superset namespaces. */
                 if (!CheckCycle(cx, xml, vxml))
                     return JS_FALSE;
             }
         }
     }
     if (!vxml) {
-        str = js_ValueToString(cx, Valueify(v));
+        str = js_ValueToString(cx, v);
         if (!str)
             return JS_FALSE;
 
         vxml = js_NewXML(cx, JSXML_CLASS_TEXT);
         if (!vxml)
             return JS_FALSE;
         vxml->xml_value = str;
     }
@@ -3527,17 +3526,17 @@ Replace(JSContext *cx, JSXML *xml, uint3
       case JSXML_CLASS_LIST:
         if (i < n)
             DeleteByIndex(cx, xml, i);
         if (!Insert(cx, xml, i, v))
             return JS_FALSE;
         break;
 
       default:
-        str = js_ValueToString(cx, Valueify(v));
+        str = js_ValueToString(cx, v);
         if (!str)
             return JS_FALSE;
 
         vxml = js_NewXML(cx, JSXML_CLASS_TEXT);
         if (!vxml)
             return JS_FALSE;
         vxml->xml_value = str;
 
@@ -3741,17 +3740,17 @@ GetProperty(JSContext *cx, JSObject *obj
      */
     nameqn = ToXMLName(cx, IdToJsval(id), &funid);
     if (!nameqn)
         return false;
     if (!JSID_IS_VOID(funid))
         return GetXMLFunction(cx, obj, funid, vp);
 
     jsval roots[2] = { OBJECT_TO_JSVAL(nameqn), JSVAL_NULL };
-    AutoArrayRooter tvr(cx, JS_ARRAY_LENGTH(roots), Valueify(roots));
+    AutoArrayRooter tvr(cx, JS_ARRAY_LENGTH(roots), roots);
 
     listobj = js_NewXMLObject(cx, JSXML_CLASS_LIST);
     if (!listobj)
         return false;
 
     roots[1] = OBJECT_TO_JSVAL(listobj);
 
     list = (JSXML *) listobj->getPrivate();
@@ -3842,17 +3841,17 @@ PutProperty(JSContext *cx, JSObject *obj
     if (!ok)
         return JS_FALSE;
 
     MUST_FLOW_THROUGH("out");
     jsval roots[3];
     roots[OBJ_ROOT] = OBJECT_TO_JSVAL(obj);
     roots[ID_ROOT] = IdToJsval(id);
     roots[VAL_ROOT] = *vp;
-    AutoArrayRooter tvr(cx, JS_ARRAY_LENGTH(roots), Valueify(roots));
+    AutoArrayRooter tvr(cx, JS_ARRAY_LENGTH(roots), roots);
 
     if (js_IdIsIndex(id, &index)) {
         if (xml->xml_class != JSXML_CLASS_LIST) {
             /* See NOTE in spec: this variation is reserved for future use. */
             ReportBadXMLName(cx, IdToValue(id));
             goto bad;
         }
 
@@ -4144,17 +4143,17 @@ PutProperty(JSContext *cx, JSObject *obj
     } else {
         /*
          * ECMA-357 9.2.1.2/9.1.1.2 qname case.
          */
         nameqn = ToXMLName(cx, IdToJsval(id), &funid);
         if (!nameqn)
             goto bad;
         if (!JSID_IS_VOID(funid)) {
-            ok = js_SetPropertyHelper(cx, obj, funid, 0, Valueify(vp), false);
+            ok = js_SetPropertyHelper(cx, obj, funid, 0, vp, false);
             goto out;
         }
         nameobj = nameqn;
         roots[ID_ROOT] = OBJECT_TO_JSVAL(nameobj);
 
         if (xml->xml_class == JSXML_CLASS_LIST) {
             /*
              * Step 3 of 9.2.1.2.
@@ -4710,18 +4709,17 @@ xml_lookupProperty(JSContext *cx, JSObje
             return js_LookupProperty(cx, obj, funid, objp, propp);
         found = HasNamedProperty(xml, qn);
     }
     if (!found) {
         *objp = NULL;
         *propp = NULL;
     } else {
         const Shape *shape =
-            js_AddNativeProperty(cx, obj, id,
-                                 Valueify(GetProperty), Valueify(PutProperty),
+            js_AddNativeProperty(cx, obj, id, GetProperty, PutProperty,
                                  SHAPE_INVALID_SLOT, JSPROP_ENUMERATE,
                                  0, 0);
         if (!shape)
             return JS_FALSE;
 
         *objp = obj;
         *propp = (JSProperty *) shape;
     }
@@ -4739,18 +4737,17 @@ xml_lookupElement(JSContext *cx, JSObjec
         return true;
     }
 
     jsid id;
     if (!IndexToId(cx, index, &id))
         return false;
 
     const Shape *shape =
-        js_AddNativeProperty(cx, obj, id,
-                             Valueify(GetProperty), Valueify(PutProperty),
+        js_AddNativeProperty(cx, obj, id, GetProperty, PutProperty,
                              SHAPE_INVALID_SLOT, JSPROP_ENUMERATE,
                              0, 0);
     if (!shape)
         return false;
 
     *objp = obj;
     *propp = (JSProperty *) shape;
     return true;
@@ -4761,17 +4758,17 @@ xml_defineProperty(JSContext *cx, JSObje
                    PropertyOp getter, StrictPropertyOp setter, uintN attrs)
 {
     if (IsFunctionObject(*v) || getter || setter ||
         (attrs & JSPROP_ENUMERATE) == 0 ||
         (attrs & (JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_SHARED))) {
         return js_DefineProperty(cx, obj, id, v, getter, setter, attrs);
     }
 
-    jsval tmp = Jsvalify(*v);
+    jsval tmp = *v;
     return PutProperty(cx, obj, id, false, &tmp);
 }
 
 static JSBool
 xml_defineElement(JSContext *cx, JSObject *obj, uint32 index, const Value *v,
                   PropertyOp getter, StrictPropertyOp setter, uintN attrs)
 {
     jsid id;
@@ -4783,32 +4780,32 @@ xml_defineElement(JSContext *cx, JSObjec
 static JSBool
 xml_getProperty(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp)
 {
     if (JSID_IS_DEFAULT_XML_NAMESPACE(id)) {
         vp->setUndefined();
         return JS_TRUE;
     }
 
-    return GetProperty(cx, obj, id, Jsvalify(vp));
+    return GetProperty(cx, obj, id, vp);
 }
 
 static JSBool
 xml_getElement(JSContext *cx, JSObject *obj, JSObject *receiver, uint32 index, Value *vp)
 {
     jsid id;
     if (!IndexToId(cx, index, &id))
         return false;
     return xml_getProperty(cx, obj, receiver, id, vp);
 }
 
 static JSBool
 xml_setProperty(JSContext *cx, JSObject *obj, jsid id, Value *vp, JSBool strict)
 {
-    return PutProperty(cx, obj, id, strict, Jsvalify(vp));
+    return PutProperty(cx, obj, id, strict, vp);
 }
 
 static JSBool
 xml_setElement(JSContext *cx, JSObject *obj, uint32 index, Value *vp, JSBool strict)
 {
     jsid id;
     if (!IndexToId(cx, index, &id))
         return false;
@@ -5078,17 +5075,17 @@ js_GetXMLMethod(JSContext *cx, JSObject 
     if (JSID_IS_OBJECT(id))
         js_GetLocalNameFromFunctionQName(JSID_TO_OBJECT(id), &id, cx);
 
     /*
      * As our callers have a bad habit of passing a pointer to an unrooted
      * local value as vp, we use a proper root here.
      */
     AutoValueRooter tvr(cx);
-    JSBool ok = GetXMLFunction(cx, obj, id, Jsvalify(tvr.addr()));
+    JSBool ok = GetXMLFunction(cx, obj, id, tvr.addr());
     *vp = tvr.value();
     return ok;
 }
 
 JSBool
 js_TestXMLEquality(JSContext *cx, const Value &v1, const Value &v2, JSBool *bp)
 {
     JSXML *xml, *vxml;
@@ -5096,19 +5093,19 @@ js_TestXMLEquality(JSContext *cx, const 
     JSBool ok;
     JSString *str, *vstr;
     jsdouble d, d2;
 
     JSObject *obj;
     jsval v;
     if (v1.isObject() && v1.toObject().isXML()) {
         obj = &v1.toObject();
-        v = Jsvalify(v2);
+        v = v2;
     } else {
-        v = Jsvalify(v1);
+        v = v1;
         obj = &v2.toObject();
     }
 
     JS_ASSERT(obj->isXML());
 
     xml = (JSXML *) obj->getPrivate();
     vxml = NULL;
     if (!JSVAL_IS_PRIMITIVE(v)) {
@@ -5127,31 +5124,31 @@ js_TestXMLEquality(JSContext *cx, const 
                   xml->xml_class == JSXML_CLASS_ATTRIBUTE) &&
                  HasSimpleContent(vxml)) ||
                 ((vxml->xml_class == JSXML_CLASS_TEXT ||
                   vxml->xml_class == JSXML_CLASS_ATTRIBUTE) &&
                  HasSimpleContent(xml))) {
                 ok = js_EnterLocalRootScope(cx);
                 if (ok) {
                     ok = (str = js_ValueToString(cx, ObjectValue(*obj))) &&
-                         (vstr = js_ValueToString(cx, Valueify(v)));
+                         (vstr = js_ValueToString(cx, v));
                     if (ok)
                         ok = EqualStrings(cx, str, vstr, bp);
                     js_LeaveLocalRootScope(cx);
                 }
             } else {
                 ok = XMLEquals(cx, xml, vxml, bp);
             }
         }
     } else {
         ok = js_EnterLocalRootScope(cx);
         if (ok) {
             if (HasSimpleContent(xml)) {
                 ok = (str = js_ValueToString(cx, ObjectValue(*obj))) &&
-                     (vstr = js_ValueToString(cx, Valueify(v)));
+                     (vstr = js_ValueToString(cx, v));
                 if (ok)
                     ok = EqualStrings(cx, str, vstr, bp);
             } else if (JSVAL_IS_STRING(v) || JSVAL_IS_NUMBER(v)) {
                 str = js_ValueToString(cx, ObjectValue(*obj));
                 if (!str) {
                     ok = JS_FALSE;
                 } else if (JSVAL_IS_STRING(v)) {
                     ok = EqualStrings(cx, str, JSVAL_TO_STRING(v), bp);
@@ -5207,22 +5204,22 @@ out:
     js_LeaveLocalRootScopeWithResult(cx, *vp);
     return ok;
 }
 
 JS_FRIEND_DATA(Class) js::XMLClass = {
     js_XML_str,
     JSCLASS_HAS_PRIVATE |
     JSCLASS_HAS_CACHED_PROTO(JSProto_XML),
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
     xml_convert,
     xml_finalize,
     NULL,                 /* reserved0   */
     NULL,                 /* checkAccess */
     NULL,                 /* call        */
     NULL,                 /* construct   */
     NULL,                 /* xdrObject   */
     xml_hasInstance,
@@ -5256,21 +5253,21 @@ StartNonListXMLMethod(JSContext *cx, jsv
 {
     JSXML *xml;
     JSFunction *fun;
     char numBuf[12];
 
     JS_ASSERT(!JSVAL_IS_PRIMITIVE(*vp));
     JS_ASSERT(JSVAL_TO_OBJECT(*vp)->isFunction());
 
-    *objp = ToObject(cx, Valueify(&vp[1]));
+    *objp = ToObject(cx, &vp[1]);
     if (!*objp)
         return NULL;
     if (!(*objp)->isXML()) {
-        ReportIncompatibleMethod(cx, Valueify(vp), &XMLClass);
+        ReportIncompatibleMethod(cx, vp, &XMLClass);
         return NULL;
     }
     xml = (JSXML *) (*objp)->getPrivate();
     if (!xml || xml->xml_class != JSXML_CLASS_LIST)
         return xml;
 
     if (xml->xml_kids.length == 1) {
         xml = XMLARRAY_MEMBER(&xml->xml_kids, 0, JSXML);
@@ -5290,21 +5287,21 @@ StartNonListXMLMethod(JSContext *cx, jsv
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_NON_LIST_XML_METHOD,
                              funName, numBuf);
     }
     return NULL;
 }
 
 /* Beware: these two are not bracketed by JS_BEGIN/END_MACRO. */
 #define XML_METHOD_PROLOG                                                     \
-    JSObject *obj = ToObject(cx, Valueify(&vp[1]));                           \
+    JSObject *obj = ToObject(cx, &vp[1]);                                     \
     if (!obj)                                                                 \
         return JS_FALSE;                                                      \
     if (!obj->isXML()) {                                                      \
-        ReportIncompatibleMethod(cx, Valueify(vp), &XMLClass);                \
+        ReportIncompatibleMethod(cx, vp, &XMLClass);                          \
         return JS_FALSE;                                                      \
     }                                                                         \
     JSXML *xml = (JSXML *)obj->getPrivate();                                  \
     if (!xml)                                                                 \
         return JS_FALSE
 
 #define NON_LIST_XML_METHOD_PROLOG                                            \
     JSObject *obj;                                                            \
@@ -5377,44 +5374,44 @@ xml_appendChild(JSContext *cx, uintN arg
 
 /* XML and XMLList */
 static JSBool
 xml_attribute(JSContext *cx, uintN argc, jsval *vp)
 {
     JSObject *qn;
 
     if (argc == 0) {
-        js_ReportMissingArg(cx, Valueify(*vp), 0);
+        js_ReportMissingArg(cx, *vp, 0);
         return JS_FALSE;
     }
 
     qn = ToAttributeName(cx, vp[2]);
     if (!qn)
         return JS_FALSE;
     vp[2] = OBJECT_TO_JSVAL(qn);        /* local root */
 
     jsid id = OBJECT_TO_JSID(qn);
-    JSObject *obj = ToObject(cx, Valueify(&vp[1]));
+    JSObject *obj = ToObject(cx, &vp[1]);
     if (!obj)
         return JS_FALSE;
     return GetProperty(cx, obj, id, vp);
 }
 
 /* XML and XMLList */
 static JSBool
 xml_attributes(JSContext *cx, uintN argc, jsval *vp)
 {
     jsval name = STRING_TO_JSVAL(cx->runtime->atomState.starAtom);
     JSObject *qn = ToAttributeName(cx, name);
     if (!qn)
         return JS_FALSE;
 
     AutoObjectRooter tvr(cx, qn);
     jsid id = OBJECT_TO_JSID(qn);
-    JSObject *obj = ToObject(cx, Valueify(&vp[1]));
+    JSObject *obj = ToObject(cx, &vp[1]);
     if (!obj)
         return JS_FALSE;
     return GetProperty(cx, obj, id, vp);
 }
 
 static JSXML *
 xml_list_helper(JSContext *cx, JSXML *xml, jsval *rval)
 {
@@ -5433,27 +5430,27 @@ xml_list_helper(JSContext *cx, JSXML *xm
 
 static JSBool
 ValueToId(JSContext *cx, jsval v, AutoIdRooter *idr)
 {
     if (JSVAL_IS_INT(v)) {
         jsint i = JSVAL_TO_INT(v);
         if (INT_FITS_IN_JSID(i))
             *idr->addr() = INT_TO_JSID(i);
-        else if (!js_ValueToStringId(cx, Valueify(v), idr->addr()))
+        else if (!js_ValueToStringId(cx, v, idr->addr()))
             return JS_FALSE;
     } else if (JSVAL_IS_STRING(v)) {
         JSAtom *atom = js_AtomizeString(cx, JSVAL_TO_STRING(v));
         if (!atom)
             return JS_FALSE;
         *idr->addr() = ATOM_TO_JSID(atom);
     } else if (!JSVAL_IS_PRIMITIVE(v)) {
         *idr->addr() = OBJECT_TO_JSID(JSVAL_TO_OBJECT(v));
     } else {
-        ReportBadXMLName(cx, Valueify(v));
+        ReportBadXMLName(cx, v);
         return JS_FALSE;
     }
     return JS_TRUE;
 }
 
 static JSBool
 xml_child_helper(JSContext *cx, JSObject *obj, JSXML *xml, jsval name,
                  jsval *rval)
@@ -5562,17 +5559,17 @@ xml_childIndex(JSContext *cx, uintN argc
         *vp = DOUBLE_TO_JSVAL(i);
     return JS_TRUE;
 }
 
 /* XML and XMLList */
 static JSBool
 xml_children(JSContext *cx, uintN argc, jsval *vp)
 {
-    JSObject *obj = ToObject(cx, Valueify(&vp[1]));
+    JSObject *obj = ToObject(cx, &vp[1]);
     if (!obj)
         return false;
     jsid name = ATOM_TO_JSID(cx->runtime->atomState.starAtom);
     return GetProperty(cx, obj, name, vp);
 }
 
 /* XML and XMLList */
 static JSBool
@@ -5600,17 +5597,17 @@ xml_comments_helper(JSContext *cx, JSObj
                     break;
                 kidobj = js_GetXMLObject(cx, kid);
                 if (kidobj) {
                     ok = xml_comments_helper(cx, kidobj, kid, &v);
                 } else {
                     ok = JS_FALSE;
                     v = JSVAL_NULL;
                 }
-                js_LeaveLocalRootScopeWithResult(cx, Valueify(v));
+                js_LeaveLocalRootScopeWithResult(cx, v);
                 if (!ok)
                     break;
                 vxml = (JSXML *) JSVAL_TO_OBJECT(v)->getPrivate();
                 if (JSXML_LENGTH(vxml) != 0) {
                     ok = Append(cx, list, vxml);
                     if (!ok)
                         break;
                 }
@@ -5648,23 +5645,23 @@ xml_contains(JSContext *cx, uintN argc, 
 
     XML_METHOD_PROLOG;
     value = argc != 0 ? vp[2] : JSVAL_VOID;
     if (xml->xml_class == JSXML_CLASS_LIST) {
         eq = JS_FALSE;
         JSXMLArrayCursor cursor(&xml->xml_kids);
         while (JSXML *kid = (JSXML *) cursor.getNext()) {
             kidobj = js_GetXMLObject(cx, kid);
-            if (!kidobj || !js_TestXMLEquality(cx, ObjectValue(*kidobj), Valueify(value), &eq))
+            if (!kidobj || !js_TestXMLEquality(cx, ObjectValue(*kidobj), value, &eq))
                 return JS_FALSE;
             if (eq)
                 break;
         }
     } else {
-        if (!js_TestXMLEquality(cx, ObjectValue(*obj), Valueify(value), &eq))
+        if (!js_TestXMLEquality(cx, ObjectValue(*obj), value, &eq))
             return JS_FALSE;
     }
     *vp = BOOLEAN_TO_JSVAL(eq);
     return JS_TRUE;
 }
 
 /* XML and XMLList */
 static JSBool
@@ -5724,17 +5721,17 @@ xml_elements_helper(JSContext *cx, JSObj
                     break;
                 kidobj = js_GetXMLObject(cx, kid);
                 if (kidobj) {
                     ok = xml_elements_helper(cx, kidobj, kid, nameqn, &v);
                 } else {
                     ok = JS_FALSE;
                     v = JSVAL_NULL;
                 }
-                js_LeaveLocalRootScopeWithResult(cx, Valueify(v));
+                js_LeaveLocalRootScopeWithResult(cx, v);
                 if (!ok)
                     break;
                 vxml = (JSXML *) JSVAL_TO_OBJECT(v)->getPrivate();
                 if (JSXML_LENGTH(vxml) != 0) {
                     ok = Append(cx, list, vxml);
                     if (!ok)
                         break;
                 }
@@ -5777,32 +5774,32 @@ xml_elements(JSContext *cx, uintN argc, 
 
 /* XML and XMLList */
 static JSBool
 xml_hasOwnProperty(JSContext *cx, uintN argc, jsval *vp)
 {
     jsval name;
     JSBool found;
 
-    JSObject *obj = ToObject(cx, Valueify(&vp[1]));
+    JSObject *obj = ToObject(cx, &vp[1]);
     if (!obj)
         return JS_FALSE;
     if (!obj->isXML()) {
-        ReportIncompatibleMethod(cx, Valueify(vp), &XMLClass);
+        ReportIncompatibleMethod(cx, vp, &XMLClass);
         return JS_FALSE;
     }
 
     name = argc != 0 ? vp[2] : JSVAL_VOID;
     if (!HasProperty(cx, obj, name, &found))
         return JS_FALSE;
     if (found) {
         *vp = JSVAL_TRUE;
         return JS_TRUE;
     }
-    return js_HasOwnPropertyHelper(cx, js_LookupProperty, argc, Valueify(vp));
+    return js_HasOwnPropertyHelper(cx, js_LookupProperty, argc, vp);
 }
 
 /* XML and XMLList */
 static JSBool
 xml_hasComplexContent(JSContext *cx, uintN argc, jsval *vp)
 {
     JSXML *kid;
     JSObject *kidobj;
@@ -6037,17 +6034,17 @@ xml_namespace(JSContext *cx, uintN argc,
     if (argc == 0 && !JSXML_HAS_NAME(xml)) {
         *vp = JSVAL_NULL;
         return true;
     }
 
     if (argc == 0) {
         prefix = NULL;
     } else {
-        JSString *str = js_ValueToString(cx, Valueify(vp[2]));
+        JSString *str = js_ValueToString(cx, vp[2]);
         if (!str)
             return false;
         prefix = str->ensureLinear(cx);
         if (!prefix)
             return false;
         vp[2] = STRING_TO_JSVAL(prefix);      /* local root */
     }
 
@@ -6270,17 +6267,17 @@ xml_processingInstructions_helper(JSCont
                 kidobj = js_GetXMLObject(cx, kid);
                 if (kidobj) {
                     ok = xml_processingInstructions_helper(cx, kidobj, kid,
                                                            nameqn, &v);
                 } else {
                     ok = JS_FALSE;
                     v = JSVAL_NULL;
                 }
-                js_LeaveLocalRootScopeWithResult(cx, Valueify(v));
+                js_LeaveLocalRootScopeWithResult(cx, v);
                 if (!ok)
                     break;
                 vxml = (JSXML *) JSVAL_TO_OBJECT(v)->getPrivate();
                 if (JSXML_LENGTH(vxml) != 0) {
                     ok = Append(cx, list, vxml);
                     if (!ok)
                         break;
                 }
@@ -6545,17 +6542,17 @@ xml_setLocalName(JSContext *cx, uintN ar
     JSAtom *namestr;
     if (argc == 0) {
         namestr = cx->runtime->atomState.typeAtoms[JSTYPE_VOID];
     } else {
         jsval name = vp[2];
         if (!JSVAL_IS_PRIMITIVE(name) && JSVAL_TO_OBJECT(name)->isQName()) {
             namestr = JSVAL_TO_OBJECT(name)->getQNameLocalName();
         } else {
-            if (!js_ValueToAtom(cx, Valueify(name), &namestr))
+            if (!js_ValueToAtom(cx, name, &namestr))
                 return false;
         }
     }
 
     xml = CHECK_COPY_ON_WRITE(cx, xml, obj);
     if (!xml)
         return JS_FALSE;
     if (namestr)
@@ -6584,17 +6581,17 @@ xml_setName(JSContext *cx, uintN argc, j
         name = vp[2];
         if (!JSVAL_IS_PRIMITIVE(name) &&
             JSVAL_TO_OBJECT(name)->getClass() == &QNameClass &&
             !(nameqn = JSVAL_TO_OBJECT(name))->getNameURI()) {
             name = vp[2] = nameqn->getQNameLocalNameVal();
         }
     }
 
-    nameqn = js_ConstructObject(cx, &QNameClass, NULL, NULL, 1, Valueify(&name));
+    nameqn = js_ConstructObject(cx, &QNameClass, NULL, NULL, 1, &name);
     if (!nameqn)
         return JS_FALSE;
 
     /* ECMA-357 13.4.4.35 Step 4. */
     if (xml->xml_class == JSXML_CLASS_PROCESSING_INSTRUCTION)
         nameqn->setNameURI(cx->runtime->emptyString);
 
     xml = CHECK_COPY_ON_WRITE(cx, xml, obj);
@@ -6686,26 +6683,25 @@ xml_setNamespace(JSContext *cx, uintN ar
     NON_LIST_XML_METHOD_PROLOG;
     if (!JSXML_HAS_NAME(xml))
         return JS_TRUE;
 
     xml = CHECK_COPY_ON_WRITE(cx, xml, obj);
     if (!xml)
         return JS_FALSE;
 
-    ns = js_ConstructObject(cx, &NamespaceClass, NULL, obj,
-                            argc == 0 ? 0 : 1, Valueify(vp + 2));
+    ns = js_ConstructObject(cx, &NamespaceClass, NULL, obj, argc == 0 ? 0 : 1, vp + 2);
     if (!ns)
         return JS_FALSE;
     vp[0] = OBJECT_TO_JSVAL(ns);
     ns->setNamespaceDeclared(JSVAL_TRUE);
 
     qnargv[0] = OBJECT_TO_JSVAL(ns);
     qnargv[1] = OBJECT_TO_JSVAL(xml->name);
-    qn = js_ConstructObject(cx, &QNameClass, NULL, NULL, 2, Valueify(qnargv));
+    qn = js_ConstructObject(cx, &QNameClass, NULL, NULL, 2, qnargv);
     if (!qn)
         return JS_FALSE;
 
     xml->name = qn;
 
     /*
      * Erratum: the spec fails to update the governing in-scope namespaces.
      * See the erratum noted in xml_setName, above.
@@ -6747,17 +6743,17 @@ xml_text_helper(JSContext *cx, JSObject 
                     break;
                 kidobj = js_GetXMLObject(cx, kid);
                 if (kidobj) {
                     ok = xml_text_helper(cx, kidobj, kid, &v);
                 } else {
                     ok = JS_FALSE;
                     v = JSVAL_NULL;
                 }
-                js_LeaveLocalRootScopeWithResult(cx, Valueify(v));
+                js_LeaveLocalRootScopeWithResult(cx, v);
                 if (!ok)
                     return JS_FALSE;
                 vxml = (JSXML *) JSVAL_TO_OBJECT(v)->getPrivate();
                 if (JSXML_LENGTH(vxml) != 0 && !Append(cx, list, vxml))
                     return JS_FALSE;
             }
         }
     } else {
@@ -6812,17 +6808,17 @@ xml_toString_helper(JSContext *cx, JSXML
     }
     js_LeaveLocalRootScopeWithResult(cx, str);
     return str;
 }
 
 static JSBool
 xml_toSource(JSContext *cx, uintN argc, jsval *vp)
 {
-    JSObject *obj = ToObject(cx, Valueify(&vp[1]));
+    JSObject *obj = ToObject(cx, &vp[1]);
     if (!obj)
         return JS_FALSE;
     JSString *str = ToXMLString(cx, OBJECT_TO_JSVAL(obj), TO_SOURCE_FLAG);
     if (!str)
         return JS_FALSE;
     *vp = STRING_TO_JSVAL(str);
     return JS_TRUE;
 }
@@ -6839,31 +6835,31 @@ xml_toString(JSContext *cx, uintN argc, 
     *vp = STRING_TO_JSVAL(str);
     return JS_TRUE;
 }
 
 /* XML and XMLList */
 static JSBool
 xml_toXMLString(JSContext *cx, uintN argc, jsval *vp)
 {
-    JSObject *obj = ToObject(cx, Valueify(&vp[1]));
+    JSObject *obj = ToObject(cx, &vp[1]);
     if (!obj)
         return JS_FALSE;
     JSString *str = ToXMLString(cx, OBJECT_TO_JSVAL(obj), 0);
     if (!str)
         return JS_FALSE;
     *vp = STRING_TO_JSVAL(str);
     return JS_TRUE;
 }
 
 /* XML and XMLList */
 static JSBool
 xml_valueOf(JSContext *cx, uintN argc, jsval *vp)
 {
-    JSObject *obj = ToObject(cx, Valueify(&vp[1]));
+    JSObject *obj = ToObject(cx, &vp[1]);
     if (!obj)
         return false;
     *vp = OBJECT_TO_JSVAL(obj);
     return true;
 }
 
 static JSFunctionSpec xml_methods[] = {
     JS_FN("addNamespace",          xml_addNamespace,          1,0),
@@ -6953,30 +6949,30 @@ SetDefaultXMLSettings(JSContext *cx, JSO
 
 static JSBool
 xml_settings(JSContext *cx, uintN argc, jsval *vp)
 {
     JSObject *settings = JS_NewObject(cx, NULL, NULL, NULL);
     if (!settings)
         return false;
     *vp = OBJECT_TO_JSVAL(settings);
-    JSObject *obj = ToObject(cx, Valueify(&vp[1]));
+    JSObject *obj = ToObject(cx, &vp[1]);
     if (!obj)
         return false;
     return CopyXMLSettings(cx, obj, settings);
 }
 
 static JSBool
 xml_setSettings(JSContext *cx, uintN argc, jsval *vp)
 {
     JSObject *settings;
     jsval v;
     JSBool ok;
 
-    JSObject *obj = ToObject(cx, Valueify(&vp[1]));
+    JSObject *obj = ToObject(cx, &vp[1]);
     if (!obj)
         return JS_FALSE;
     v = (argc == 0) ? JSVAL_VOID : vp[2];
     if (JSVAL_IS_NULL(v) || JSVAL_IS_VOID(v)) {
         ok = SetDefaultXMLSettings(cx, obj);
     } else {
         if (JSVAL_IS_PRIMITIVE(v)) {
             vp[0] = JSVAL_VOID;
@@ -7010,17 +7006,17 @@ static JSFunctionSpec xml_static_methods
 
 static JSBool
 XML(JSContext *cx, uintN argc, Value *vp)
 {
     JSXML *xml, *copy;
     JSObject *xobj, *vobj;
     Class *clasp;
 
-    jsval v = argc ? Jsvalify(vp[2]) : JSVAL_VOID;
+    jsval v = argc ? vp[2] : JSVAL_VOID;
 
     if (JSVAL_IS_NULL(v) || JSVAL_IS_VOID(v))
         v = STRING_TO_JSVAL(cx->runtime->emptyString);
 
     xobj = ToXML(cx, v);
     if (!xobj)
         return JS_FALSE;
     xml = (JSXML *) xobj->getPrivate();
@@ -7048,17 +7044,17 @@ XMLList(JSContext *cx, uintN argc, jsval
     JSObject *vobj, *listobj;
     JSXML *xml, *list;
 
     jsval v = argc ? vp[2] : JSVAL_VOID;
 
     if (JSVAL_IS_NULL(v) || JSVAL_IS_VOID(v))
         v = STRING_TO_JSVAL(cx->runtime->emptyString);
 
-    if (IsConstructing(Valueify(vp)) && !JSVAL_IS_PRIMITIVE(v)) {
+    if (IsConstructing(vp) && !JSVAL_IS_PRIMITIVE(v)) {
         vobj = JSVAL_TO_OBJECT(v);
         if (vobj->isXML()) {
             xml = (JSXML *) vobj->getPrivate();
             if (xml->xml_class == JSXML_CLASS_LIST) {
                 listobj = js_NewXMLObject(cx, JSXML_CLASS_LIST);
                 if (!listobj)
                     return JS_FALSE;
                 *vp = OBJECT_TO_JSVAL(listobj);
@@ -7307,17 +7303,17 @@ js_InitXMLClass(JSContext *cx, JSObject 
         return NULL;
 
     /* Define the XMLList function, and give it the same .prototype as XML. */
     JSFunction *xmllist =
         JS_DefineFunction(cx, global, js_XMLList_str, XMLList, 1, JSFUN_CONSTRUCTOR);
     if (!xmllist)
         return NULL;
     if (!xmllist->defineProperty(cx, ATOM_TO_JSID(cx->runtime->atomState.classPrototypeAtom),
-                                 ObjectValue(*xmlProto), PropertyStub, StrictPropertyStub,
+                                 ObjectValue(*xmlProto), JS_PropertyStub, JS_StrictPropertyStub,
                                  JSPROP_PERMANENT | JSPROP_READONLY))
     {
         return NULL;
     }
 
     if (!DefineConstructorAndPrototype(cx, global, JSProto_XML, ctor, xmlProto))
         return NULL;
 
@@ -7393,31 +7389,31 @@ js_GetDefaultXMLNamespace(JSContext *cx,
 
     JSObject *scopeChain = GetScopeChain(cx);
 
     obj = NULL;
     for (tmp = scopeChain; tmp; tmp = tmp->getParent()) {
         Class *clasp = tmp->getClass();
         if (clasp == &BlockClass || clasp == &WithClass)
             continue;
-        if (!tmp->getProperty(cx, JS_DEFAULT_XML_NAMESPACE_ID, Valueify(&v)))
+        if (!tmp->getProperty(cx, JS_DEFAULT_XML_NAMESPACE_ID, &v))
             return JS_FALSE;
         if (!JSVAL_IS_PRIMITIVE(v)) {
             *vp = v;
             return JS_TRUE;
         }
         obj = tmp;
     }
 
     ns = js_ConstructObject(cx, &NamespaceClass, NULL, obj, 0, NULL);
     if (!ns)
         return JS_FALSE;
     v = OBJECT_TO_JSVAL(ns);
-    if (!obj->defineProperty(cx, JS_DEFAULT_XML_NAMESPACE_ID, Valueify(v),
-                             PropertyStub, StrictPropertyStub, JSPROP_PERMANENT)) {
+    if (!obj->defineProperty(cx, JS_DEFAULT_XML_NAMESPACE_ID, v,
+                             JS_PropertyStub, JS_StrictPropertyStub, JSPROP_PERMANENT)) {
         return JS_FALSE;
     }
     *vp = v;
     return JS_TRUE;
 }
 
 JSBool
 js_SetDefaultXMLNamespace(JSContext *cx, const Value &v)
@@ -7426,28 +7422,28 @@ js_SetDefaultXMLNamespace(JSContext *cx,
     argv[0].setString(cx->runtime->emptyString);
     argv[1] = v;
     JSObject *ns = js_ConstructObject(cx, &NamespaceClass, NULL, NULL, 2, argv);
     if (!ns)
         return JS_FALSE;
 
     JSObject &varobj = cx->fp()->varObj();
     if (!varobj.defineProperty(cx, JS_DEFAULT_XML_NAMESPACE_ID, ObjectValue(*ns),
-                               PropertyStub, StrictPropertyStub, JSPROP_PERMANENT)) {
+                               JS_PropertyStub, JS_StrictPropertyStub, JSPROP_PERMANENT)) {
         return JS_FALSE;
     }
     return JS_TRUE;
 }
 
 JSBool
 js_ToAttributeName(JSContext *cx, Value *vp)
 {
     JSObject *qn;
 
-    qn = ToAttributeName(cx, Jsvalify(*vp));
+    qn = ToAttributeName(cx, *vp);
     if (!qn)
         return JS_FALSE;
     vp->setObject(*qn);
     return JS_TRUE;
 }
 
 JSFlatString *
 js_EscapeAttributeValue(JSContext *cx, JSString *str, JSBool quote)
@@ -7496,17 +7492,17 @@ js_EscapeElementValue(JSContext *cx, JSS
 {
     StringBuffer sb(cx);
     return EscapeElementValue(cx, sb, str, 0);
 }
 
 JSString *
 js_ValueToXMLString(JSContext *cx, const Value &v)
 {
-    return ToXMLString(cx, Jsvalify(v), 0);
+    return ToXMLString(cx, v, 0);
 }
 
 JSBool
 js_GetAnyName(JSContext *cx, jsid *idp)
 {
     JSObject *global = cx->hasfp() ? cx->fp()->scopeChain().getGlobal() : cx->globalObject;
     Value v = global->getReservedSlot(JSProto_AnyName);
     if (v.isUndefined()) {
@@ -7539,18 +7535,17 @@ js_FindXMLProperty(JSContext *cx, const 
     JSXML *xml;
     JSBool found;
     JSProperty *prop;
 
     JS_ASSERT(nameval.isObject());
     nameobj = &nameval.toObject();
     if (nameobj->getClass() == &AnyNameClass) {
         v = STRING_TO_JSVAL(cx->runtime->atomState.starAtom);
-        nameobj = js_ConstructObject(cx, &QNameClass, NULL, NULL, 1,
-                                     Valueify(&v));
+        nameobj = js_ConstructObject(cx, &QNameClass, NULL, NULL, 1, &v);
         if (!nameobj)
             return JS_FALSE;
     } else {
         JS_ASSERT(nameobj->getClass() == &AttributeNameClass ||
                   nameobj->getClass() == &QNameClass);
     }
 
     qn = nameobj;
@@ -7608,17 +7603,17 @@ GetXMLFunction(JSContext *cx, JSObject *
 
     /*
      * See comments before xml_lookupProperty about the need for the proto
      * chain lookup.
      */
     JSObject *target = obj;
     AutoObjectRooter tvr(cx);
     for (;;) {
-        if (!js_GetProperty(cx, target, id, Valueify(vp)))
+        if (!js_GetProperty(cx, target, id, vp))
             return false;
         if (!JSVAL_IS_PRIMITIVE(*vp) && JSVAL_TO_OBJECT(*vp)->isFunction())
             return true;
         target = target->getProto();
         if (target == NULL || !target->isNative())
             break;
         tvr.setObject(target);
     }
@@ -7627,17 +7622,17 @@ GetXMLFunction(JSContext *cx, JSObject *
     if (!HasSimpleContent(xml))
         return true;
 
     /* Search in String.prototype to implement 11.2.2.1 Step 3(f). */
     if (!js_GetClassPrototype(cx, NULL, JSProto_String, tvr.addr()))
         return false;
 
     JS_ASSERT(tvr.object());
-    return tvr.object()->getProperty(cx, id, Valueify(vp));
+    return tvr.object()->getProperty(cx, id, vp);
 }
 
 static JSXML *
 GetPrivate(JSContext *cx, JSObject *obj, const char *method)
 {
     if (!obj->isXML()) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
                              JSMSG_INCOMPATIBLE_METHOD,
@@ -7717,50 +7712,50 @@ xmlfilter_finalize(JSContext *cx, JSObje
         return;
 
     cx->delete_(filter);
 }
 
 Class js_XMLFilterClass = {
     "XMLFilter",
     JSCLASS_HAS_PRIVATE | JSCLASS_IS_ANONYMOUS,
-    PropertyStub,         /* addProperty */
-    PropertyStub,         /* delProperty */
-    PropertyStub,         /* getProperty */
-    StrictPropertyStub,   /* setProperty */
-    EnumerateStub,
-    ResolveStub,
-    ConvertStub,
+    JS_PropertyStub,         /* addProperty */
+    JS_PropertyStub,         /* delProperty */
+    JS_PropertyStub,         /* getProperty */
+    JS_StrictPropertyStub,   /* setProperty */
+    JS_EnumerateStub,
+    JS_ResolveStub,
+    JS_ConvertStub,
     xmlfilter_finalize,
-    NULL,                 /* reserved0   */
-    NULL,                 /* checkAccess */
-    NULL,                 /* call        */
-    NULL,                 /* construct   */
-    NULL,                 /* xdrObject   */
-    NULL,                 /* hasInstance */
+    NULL,                    /* reserved0   */
+    NULL,                    /* checkAccess */
+    NULL,                    /* call        */
+    NULL,                    /* construct   */
+    NULL,                    /* xdrObject   */
+    NULL,                    /* hasInstance */
     xmlfilter_trace
 };
 
 JSBool
 js_StepXMLListFilter(JSContext *cx, JSBool initialized)
 {
     jsval *sp;
     JSObject *obj, *filterobj, *resobj, *kidobj;
     JSXML *xml, *list;
     JSXMLFilter *filter;
 
     LeaveTrace(cx);
-    sp = Jsvalify(cx->regs().sp);
+    sp = cx->regs().sp;
     if (!initialized) {
         /*
          * We haven't iterated yet, so initialize the filter based on the
          * value stored in sp[-2].
          */
         if (!VALUE_IS_XML(sp[-2])) {
-            js_ReportValueError(cx, JSMSG_NON_XML_FILTER, -2, Valueify(sp[-2]), NULL);
+            js_ReportValueError(cx, JSMSG_NON_XML_FILTER, -2, sp[-2], NULL);
             return JS_FALSE;
         }
         obj = JSVAL_TO_OBJECT(sp[-2]);
         xml = (JSXML *) obj->getPrivate();
 
         if (xml->xml_class == JSXML_CLASS_LIST) {
             list = xml;
         } else {
@@ -7804,17 +7799,17 @@ js_StepXMLListFilter(JSContext *cx, JSBo
     } else {
         /* We have iterated at least once. */
         JS_ASSERT(!JSVAL_IS_PRIMITIVE(sp[-2]));
         JS_ASSERT(JSVAL_TO_OBJECT(sp[-2])->getClass() == &js_XMLFilterClass);
         filter = (JSXMLFilter *) JSVAL_TO_OBJECT(sp[-2])->getPrivate();
         JS_ASSERT(filter->kid);
 
         /* Check if the filter expression wants to append the element. */
-        if (js_ValueToBoolean(Valueify(sp[-1])) &&
+        if (js_ValueToBoolean(sp[-1]) &&
             !Append(cx, filter->result, filter->kid)) {
             return JS_FALSE;
         }
     }
 
     /* Do the iteration. */
     filter->kid = (JSXML *) filter->cursor.getNext();
     if (!filter->kid) {
@@ -7835,23 +7830,23 @@ js_StepXMLListFilter(JSContext *cx, JSBo
     /* Null as kidobj at sp[-1] signals filter termination. */
     sp[-1] = OBJECT_TO_JSVAL(kidobj);
     return JS_TRUE;
 }
 
 JSObject *
 js_ValueToXMLObject(JSContext *cx, const Value &v)
 {
-    return ToXML(cx, Jsvalify(v));
+    return ToXML(cx, v);
 }
 
 JSObject *
 js_ValueToXMLListObject(JSContext *cx, const Value &v)
 {
-    return ToXMLList(cx, Jsvalify(v));
+    return ToXMLList(cx, v);
 }
 
 JSObject *
 js_NewXMLSpecialObject(JSContext *cx, JSXMLClass xml_class, JSString *name,
                        JSString *value)
 {
     uintN flags;
     JSObject *obj;
--- a/js/src/methodjit/Compiler.cpp
+++ b/js/src/methodjit/Compiler.cpp
@@ -2111,21 +2111,21 @@ mjit::Compiler::generateMethod()
           }
           END_CASE(JSOP_DOUBLE)
 
           BEGIN_CASE(JSOP_STRING)
             frame.push(StringValue(script->getAtom(fullAtomIndex(PC))));
           END_CASE(JSOP_STRING)
 
           BEGIN_CASE(JSOP_ZERO)
-            frame.push(Valueify(JSVAL_ZERO));
+            frame.push(JSVAL_ZERO);
           END_CASE(JSOP_ZERO)
 
           BEGIN_CASE(JSOP_ONE)
-            frame.push(Valueify(JSVAL_ONE));
+            frame.push(JSVAL_ONE);
           END_CASE(JSOP_ONE)
 
           BEGIN_CASE(JSOP_NULL)
             frame.push(NullValue());
           END_CASE(JSOP_NULL)
 
           BEGIN_CASE(JSOP_THIS)
             jsop_this();
--- a/js/src/methodjit/FrameEntry.h
+++ b/js/src/methodjit/FrameEntry.h
@@ -72,17 +72,16 @@ class FrameEntry
 
     Value getValue() const {
         JS_ASSERT(isConstant());
         return IMPL_TO_JSVAL(v_);
     }
 
 #if defined JS_NUNBOX32
     uint32 getPayload() const {
-        //JS_ASSERT(!Valueify(v_.asBits).isDouble() || type.synced());
         JS_ASSERT(isConstant());
         return v_.s.payload.u32;
     }
 #elif defined JS_PUNBOX64
     uint64 getPayload() const {
         JS_ASSERT(isConstant());
         return v_.asBits & JSVAL_PAYLOAD_MASK;
     }
@@ -90,17 +89,17 @@ class FrameEntry
 
     /* For a constant double FrameEntry, truncate to an int32. */
     void convertConstantDoubleToInt32(JSContext *cx) {
         JS_ASSERT(isType(JSVAL_TYPE_DOUBLE) && isConstant());
         int32 value;
         ValueToECMAInt32(cx, getValue(), &value);
 
         Value newValue = Int32Value(value);
-        setConstant(Jsvalify(newValue));
+        setConstant(newValue);
     }
 
     /*
      * Accessors for entries whose type is known. Any entry can have a known
      * type, and constant entries must have one.
      */
 
     bool isTypeKnown() const {
--- a/js/src/methodjit/FrameState-inl.h
+++ b/js/src/methodjit/FrameState-inl.h
@@ -246,17 +246,17 @@ FrameState::rawPush()
 
     return fe;
 }
 
 inline void
 FrameState::push(const Value &v)
 {
     FrameEntry *fe = rawPush();
-    fe->setConstant(Jsvalify(v));
+    fe->setConstant(v);
 }
 
 inline void
 FrameState::pushSynced(JSValueType type)
 {
     FrameEntry *fe = rawPush();
 
     fe->resetSynced();
--- a/js/src/methodjit/FrameState.cpp
+++ b/js/src/methodjit/FrameState.cpp
@@ -1822,17 +1822,17 @@ void
 FrameState::ensureDouble(FrameEntry *fe)
 {
     if (fe->isType(JSVAL_TYPE_DOUBLE))
         return;
 
     if (fe->isConstant()) {
         JS_ASSERT(fe->getValue().isInt32());
         Value newValue = DoubleValue(double(fe->getValue().toInt32()));
-        fe->setConstant(Jsvalify(newValue));
+        fe->setConstant(newValue);
         return;
     }
 
     FrameEntry *backing = fe;
     if (fe->isCopy()) {
         /* Forget this entry is a copy.  We are converting this entry, not the backing. */
         backing = fe->copyOf();
         fe->clear();
@@ -1873,17 +1873,17 @@ FrameState::ensureInteger(FrameEntry *fe
 {
     /*
      * This method is used to revert a previous ensureDouble call made for a
      * branch. The entry is definitely a double, and has had no copies made.
      */
 
     if (fe->isConstant()) {
         Value newValue = Int32Value(int32(fe->getValue().toDouble()));
-        fe->setConstant(Jsvalify(newValue));
+        fe->setConstant(newValue);
         return;
     }
 
     JS_ASSERT(!fe->isCopy() && !fe->isCopied());
     JS_ASSERT_IF(fe->isTypeKnown(), fe->isType(JSVAL_TYPE_DOUBLE));
 
     if (!fe->isType(JSVAL_TYPE_DOUBLE)) {
         /*
@@ -1928,17 +1928,17 @@ FrameState::ensureInMemoryDoubles(Assemb
 
 void
 FrameState::pushCopyOf(FrameEntry *backing)
 {
     JS_ASSERT(backing->isTracked());
     FrameEntry *fe = rawPush();
     fe->resetUnsynced();
     if (backing->isConstant()) {
-        fe->setConstant(Jsvalify(backing->getValue()));
+        fe->setConstant(backing->getValue());
     } else {
         if (backing->isCopy())
             backing = backing->copyOf();
         fe->setCopyOf(backing);
 
         /* Maintain tracker ordering guarantees for copies. */
         JS_ASSERT(backing->isCopied());
         if (fe->trackerIndex() < backing->trackerIndex())
@@ -2216,17 +2216,17 @@ FrameState::storeTop(FrameEntry *target)
 
     /* Completely invalidate the local variable. */
     forgetEntry(target);
     target->resetUnsynced();
 
     /* Constants are easy to propagate. */
     if (top->isConstant()) {
         target->clear();
-        target->setConstant(Jsvalify(top->getValue()));
+        target->setConstant(top->getValue());
         if (trySyncType && target->isType(oldType))
             target->type.sync();
         return;
     }
 
     /*
      * When dealing with copies, there are three important invariants:
      *
--- a/js/src/methodjit/InvokeHelpers.cpp
+++ b/js/src/methodjit/InvokeHelpers.cpp
@@ -557,17 +557,17 @@ js_InternalThrow(VMFrame &f)
     for (;;) {
         if (cx->isExceptionPending()) {
             // Call the throw hook if necessary
             JSThrowHook handler = cx->debugHooks->throwHook;
             if (handler || !cx->compartment->getDebuggees().empty()) {
                 Value rval;
                 JSTrapStatus st = Debugger::onExceptionUnwind(cx, &rval);
                 if (st == JSTRAP_CONTINUE && handler) {
-                    st = handler(cx, cx->fp()->script(), cx->regs().pc, Jsvalify(&rval),
+                    st = handler(cx, cx->fp()->script(), cx->regs().pc, &rval,
                                  cx->debugHooks->throwHookData);
                 }
 
                 switch (st) {
                 case JSTRAP_ERROR:
                     cx->clearPendingException();
                     return NULL;
 
--- a/js/src/methodjit/PolyIC.cpp
+++ b/js/src/methodjit/PolyIC.cpp
@@ -533,17 +533,17 @@ class SetPropCompiler : public PICStubCo
             return disable("dense array");
         if (!obj->isNative())
             return disable("non-native");
         if (obj->watched())
             return disable("watchpoint");
 
         Class *clasp = obj->getClass();
 
-        if (clasp->setProperty != StrictPropertyStub)
+        if (clasp->setProperty != JS_StrictPropertyStub)
             return disable("set property hook");
         if (clasp->ops.lookupProperty)
             return disable("ops lookup property hook");
         if (clasp->ops.setProperty)
             return disable("ops set property hook");
 
         jsid id = ATOM_TO_JSID(atom);
 
@@ -578,17 +578,17 @@ class SetPropCompiler : public PICStubCo
 
         if (!prop) {
             /* Adding a property to the object. */
             if (obj->isDelegate())
                 return disable("delegate");
             if (!obj->isExtensible())
                 return disable("not extensible");
 
-            if (clasp->addProperty != PropertyStub)
+            if (clasp->addProperty != JS_PropertyStub)
                 return disable("add property hook");
             if (clasp->ops.defineProperty)
                 return disable("ops define property hook");
 
             uint32 index;
             if (js_IdIsIndex(id, &index))
                 return disable("index");
 
--- a/js/src/methodjit/RematInfo.h
+++ b/js/src/methodjit/RematInfo.h
@@ -131,17 +131,17 @@ struct ValueRemat {
     bool isFPRegister_  : 1;
     bool isDataSynced   : 1;
     bool isTypeSynced   : 1;
 
     static ValueRemat FromConstant(const Value &v) {
         ValueRemat vr;
         vr.isConstant_ = true;
         vr.isFPRegister_ = false;
-        vr.u.v_ = Jsvalify(v);
+        vr.u.v_ = v;
         return vr;
     }
     static ValueRemat FromFPRegister(FPRegisterID fpreg) {
         ValueRemat vr;
         vr.isConstant_ = false;
         vr.isFPRegister_ = true;
         vr.u.fpreg_ = fpreg;
         return vr;
@@ -194,17 +194,17 @@ struct ValueRemat {
         return StateRemat::FromInt32(u.s.dataRemat_);
     }
     StateRemat typeRemat() const {
         JS_ASSERT(!isTypeKnown());
         return StateRemat::FromInt32(u.s.type.typeRemat_);
     }
     Value value() const {
         JS_ASSERT(isConstant());
-        return Valueify(u.v_);
+        return u.v_;
     }
     JSValueType knownType() const {
         JS_ASSERT(isTypeKnown());
         if (isConstant()) {
             const Value v = value();
             if (v.isDouble())
                 return JSVAL_TYPE_DOUBLE;
             return v.extractNonDoubleType();
--- a/js/src/methodjit/StubCalls.cpp
+++ b/js/src/methodjit/StubCalls.cpp
@@ -804,27 +804,27 @@ stubs::DefFun(VMFrame &f, JSFunction *fu
     if (!parent->lookupProperty(cx, id, &pobj, &prop))
         THROW();
 
     Value rval = ObjectValue(*obj);
 
     do {
         /* Steps 5d, 5f. */
         if (!prop || pobj != parent) {
-            if (!parent->defineProperty(cx, id, rval, PropertyStub, StrictPropertyStub, attrs))
+            if (!parent->defineProperty(cx, id, rval, JS_PropertyStub, JS_StrictPropertyStub, attrs))
                 THROW();
             break;
         }
 
         /* Step 5e. */
         JS_ASSERT(parent->isNative());
         Shape *shape = reinterpret_cast<Shape *>(prop);
         if (parent->isGlobal()) {
             if (shape->configurable()) {
-                if (!parent->defineProperty(cx, id, rval, PropertyStub, StrictPropertyStub, attrs))
+                if (!parent->defineProperty(cx, id, rval, JS_PropertyStub, JS_StrictPropertyStub, attrs))
                     THROW();
                 break;
             }
 
             if (shape->isAccessorDescriptor() || !shape->writable() || !shape->enumerable()) {
                 JSAutoByteString bytes;
                 if (const char *name = js_ValueToPrintable(cx, IdToValue(id), &bytes)) {
                     JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
@@ -951,17 +951,17 @@ StubEqualityOp(VMFrame &f)
             double r = rval.toDouble();
             if (EQ)
                 cond = JSDOUBLE_COMPARE(l, ==, r, IFNAN);
             else
                 cond = JSDOUBLE_COMPARE(l, !=, r, IFNAN);
         } else if (lval.isObject()) {
             JSObject *l = &lval.toObject(), *r = &rval.toObject();
             l->assertSpecialEqualitySynced();
-            if (EqualityOp eq = l->getClass()->ext.equality) {
+            if (JSEqualityOp eq = l->getClass()->ext.equality) {
                 if (!eq(cx, l, &rval, &cond))
                     return false;
                 cond = cond == EQ;
             } else {
                 cond = (l == r) == EQ;
             }
         } else if (lval.isNullOrUndefined()) {
             cond = EQ;
@@ -1188,20 +1188,18 @@ stubs::Mod(VMFrame &f)
 
 void JS_FASTCALL
 stubs::DebuggerStatement(VMFrame &f, jsbytecode *pc)
 {
     JSDebuggerHandler handler = f.cx->debugHooks->debuggerHandler;
     if (handler || !f.cx->compartment->getDebuggees().empty()) {
         JSTrapStatus st = JSTRAP_CONTINUE;
         Value rval;
-        if (handler) {
-            st = handler(f.cx, f.script(), pc, Jsvalify(&rval),
-                         f.cx->debugHooks->debuggerHandlerData);
-        }
+        if (handler)
+            st = handler(f.cx, f.script(), pc, &rval, f.cx->debugHooks->debuggerHandlerData);
         if (st == JSTRAP_CONTINUE)
             st = Debugger::onDebuggerStatement(f.cx, &rval);
 
         switch (st) {
           case JSTRAP_THROW:
             f.cx->setPendingException(rval);
             THROW();
 
@@ -1249,18 +1247,17 @@ stubs::Trap(VMFrame &f, uint32 trapTypes
     JSTrapStatus result = JSTRAP_CONTINUE;
     if (trapTypes & JSTRAP_SINGLESTEP) {
         /*
          * single step mode may be paused without recompiling by
          * setting the interruptHook to NULL.
          */
         JSInterruptHook hook = f.cx->debugHooks->interruptHook;
         if (hook)
-            result = hook(f.cx, f.script(), f.pc(), Jsvalify(&rval),
-                          f.cx->debugHooks->interruptHookData);
+            result = hook(f.cx, f.script(), f.pc(), &rval, f.cx->debugHooks->interruptHookData);
 
         if (result == JSTRAP_CONTINUE)
             result = Debugger::onSingleStep(f.cx, &rval);
     }
 
     if (result == JSTRAP_CONTINUE && (trapTypes & JSTRAP_TRAP))
         result = Debugger::onTrap(f.cx, &rval);
 
@@ -1858,17 +1855,17 @@ stubs::EndIter(VMFrame &f)
     if (!js_CloseIterator(f.cx, &f.regs.sp[-1].toObject()))
         THROW();
 }
 
 JSString * JS_FASTCALL
 stubs::TypeOf(VMFrame &f)
 {
     const Value &ref = f.regs.sp[-1];
-    JSType type = JS_TypeOfValue(f.cx, Jsvalify(ref));
+    JSType type = JS_TypeOfValue(f.cx, ref);
     JSAtom *atom = f.cx->runtime->atomState.typeAtoms[type];
     return atom;
 }
 
 void JS_FASTCALL
 stubs::StrictEq(VMFrame &f)
 {
     const Value &rhs = f.regs.sp[-1];
@@ -2302,32 +2299,32 @@ stubs::DefVarOrConst(VMFrame &f, JSAtom 
          * As attrs includes readonly, CheckRedeclaration can succeed only
          * if prop does not exist.
          */
         shouldDefine = true;
     }
 
     /* Bind a variable only if it's not yet defined. */
     if (shouldDefine && 
-        !DefineNativeProperty(cx, obj, id, UndefinedValue(), PropertyStub, StrictPropertyStub,
+        !DefineNativeProperty(cx, obj, id, UndefinedValue(), JS_PropertyStub, JS_StrictPropertyStub,
                               attrs, 0, 0)) {
         THROW();
     }
 }
 
 void JS_FASTCALL
 stubs::SetConst(VMFrame &f, JSAtom *atom)
 {
     JSContext *cx = f.cx;
 
     JSObject *obj = &f.fp()->varObj();
     const Value &ref = f.regs.sp[-1];
 
     if (!obj->defineProperty(cx, ATOM_TO_JSID(atom), ref,
-                             PropertyStub, StrictPropertyStub,
+                             JS_PropertyStub, JS_StrictPropertyStub,
                              JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY)) {
         THROW();
     }
 }
 
 JSBool JS_FASTCALL
 stubs::In(VMFrame &f)
 {
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -1193,17 +1193,17 @@ AssertJit(JSContext *cx, uintN argc, jsv
     return JS_TRUE;
 }
 
 static JSBool
 GC(JSContext *cx, uintN argc, jsval *vp)
 {
     JSCompartment *comp = NULL;
     if (argc == 1) {
-        Value arg = Valueify(vp[2]);
+        Value arg = vp[2];
         if (arg.isObject())
             comp = arg.toObject().unwrap()->compartment();
     }
 
     size_t preBytes = cx->runtime->gcBytes;
     JS_CompartmentGC(cx, comp);
 
     char buf[256];
@@ -1322,17 +1322,17 @@ GCZeal(JSContext *cx, uintN argc, jsval 
         return JS_FALSE;
     }
     if (!JS_ValueToECMAUint32(cx, argc < 1 ? JSVAL_VOID : vp[2], &zeal))
         return JS_FALSE;
     if (argc >= 2)
         if (!JS_ValueToECMAUint32(cx, vp[3], &frequency))
             return JS_FALSE;
     if (argc >= 3)
-        compartment = js_ValueToBoolean(Valueify(vp[3]));
+        compartment = js_ValueToBoolean(vp[3]);
 
     JS_SetGCZeal(cx, (uint8)zeal, frequency, compartment);
     *vp = JSVAL_VOID;
     return JS_TRUE;
 }
 
 static JSBool
 ScheduleGC(JSContext *cx, uintN argc, jsval *vp)
@@ -1346,17 +1346,17 @@ ScheduleGC(JSContext *cx, uintN argc, js
                              ? JSSMSG_NOT_ENOUGH_ARGS
                              : JSSMSG_TOO_MANY_ARGS,
                              "schedulegc");
         return JS_FALSE;
     }
     if (!JS_ValueToECMAUint32(cx, vp[2], &count))
         return JS_FALSE;
     if (argc == 2)
-        compartment = js_ValueToBoolean(Valueify(vp[3]));
+        compartment = js_ValueToBoolean(vp[3]);
 
     JS_ScheduleGC(cx, count, compartment);
     *vp = JSVAL_VOID;
     return JS_TRUE;
 }
 #endif /* JS_GC_ZEAL */
 
 typedef struct JSCountHeapNode JSCountHeapNode;
@@ -2529,17 +2529,17 @@ DumpStack(JSContext *cx, uintN argc, Val
             } else if (iter.fp()->isEvalFrame()) {
                 v = StringValue(evalStr);
             } else {
                 v = StringValue(globalStr);
             }
         } else {
             v = iter.nativeArgs().calleev();
         }
-        if (!JS_SetElement(cx, arr, index, Jsvalify(&v)))
+        if (!JS_SetElement(cx, arr, index, &v))
             return false;
     }
 
     JS_SET_RVAL(cx, vp, ObjectValue(*arr));
     return true;
 }
 
 #ifdef TEST_CVTARGS
@@ -3034,17 +3034,17 @@ EvalInContext(JSContext *cx, uintN argc,
         if (!JS_EvaluateUCScript(cx, sobj, src, srclen,
                                  script->filename,
                                  JS_PCToLineNumber(cx, script, pc),
                                  &rval)) {
             return false;
         }
     }
 
-    if (!cx->compartment->wrap(cx, Valueify(&rval)))
+    if (!cx->compartment->wrap(cx, &rval))
         return false;
 
     JS_SET_RVAL(cx, vp, rval);
     return true;
 }
 
 static JSBool
 EvalInFrame(JSContext *cx, uintN argc, jsval *vp)
@@ -3149,20 +3149,20 @@ CopyProperty(JSContext *cx, JSObject *ob
             desc.value = referent->nativeGetSlot(shape->slot);
         } else {
             desc.value.setUndefined();
         }
 
         desc.attrs = shape->attributes();
         desc.getter = shape->getter();
         if (!desc.getter && !(desc.attrs & JSPROP_GETTER))
-            desc.getter = PropertyStub;
+            desc.getter = JS_PropertyStub;
         desc.setter = shape->setter();
         if (!desc.setter && !(desc.attrs & JSPROP_SETTER))
-            desc.setter = StrictPropertyStub;
+            desc.setter = JS_StrictPropertyStub;
         desc.shortid = shape->shortid;
         propFlags = shape->getFlags();
    } else if (referent->isProxy()) {
         PropertyDescriptor desc;
         if (!JSProxy::getOwnPropertyDescriptor(cx, referent, id, false, &desc))
             return false;
         if (!desc.obj)
             return true;
@@ -3171,18 +3171,18 @@ CopyProperty(JSContext *cx, JSObject *ob
             return false;
         if (*objp != referent)
             return true;
         if (!referent->getProperty(cx, id, &desc.value) ||
             !referent->getAttributes(cx, id, &desc.attrs)) {
             return false;
         }
         desc.attrs &= JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT;
-        desc.getter = PropertyStub;
-        desc.setter = StrictPropertyStub;
+        desc.getter = JS_PropertyStub;
+        desc.setter = JS_StrictPropertyStub;
         desc.shortid = 0;
     }
 
     *objp = obj;
     return !!DefineNativeProperty(cx, obj, id, desc.value, desc.getter, desc.setter,
                                   desc.attrs, propFlags, desc.shortid);
 }
 
@@ -4172,17 +4172,17 @@ ParseLegacyJSON(JSContext *cx, uintN arg
     }
 
     JSString *str = JSVAL_TO_STRING(JS_ARGV(cx, vp)[0]);
 
     size_t length;
     const jschar *chars = JS_GetStringCharsAndLength(cx, str, &length);
     if (!chars)
         return false;
-    return js::ParseJSONWithReviver(cx, chars, length, js::NullValue(), js::Valueify(vp), LEGACY);
+    return js::ParseJSONWithReviver(cx, chars, length, js::NullValue(), vp, LEGACY);
 }
 
 static JSBool
 EnableStackWalkingAssertion(JSContext *cx, uintN argc, jsval *vp)
 {
     if (argc == 0 || !JSVAL_IS_BOOLEAN(JS_ARGV(cx, vp)[0])) {
         JS_ReportErrorNumber(cx, my_GetErrorMessage, NULL, JSSMSG_INVALID_ARGS,
                              "enableStackWalkingAssertion");
--- a/js/src/shell/jsheaptools.cpp
+++ b/js/src/shell/jsheaptools.cpp
@@ -45,24 +45,23 @@
 #include "jsalloc.h"
 #include "jscntxt.h"
 #include "jscompartment.h"
 #include "jsfun.h"
 #include "jshashtable.h"
 #include "jsobj.h"
 #include "jsprf.h"
 #include "jsutil.h"
-#include "jsvalue.h"
 #include "jsvector.h"
 
 using namespace js;
 
 #ifdef DEBUG
 
-
+
 /*** class HeapReverser **************************************************************************/
 
 /*
  * A class for constructing a map of the JavaScript heap, with all
  * reference edges reversed.
  *
  * Unfortunately, it's not possible to build the results for findReferences
  * while visiting things solely in the order that JS_TraceRuntime and
@@ -462,17 +461,17 @@ ReferenceFinder::Path::computeName(JSCon
     JS_ASSERT(next + 1 == path + size);
 
     return path;
 }
 
 bool
 ReferenceFinder::addReferrer(jsval referrer, Path *path)
 {
-    if (!context->compartment->wrap(context, Valueify(&referrer)))
+    if (!context->compartment->wrap(context, &referrer))
         return NULL;
 
     char *pathName = path->computeName(context);
     if (!pathName)
         return false;
     AutoReleasePtr releasePathName(context, pathName);
 
     /* Find the property of the results object named |pathName|. */
--- a/js/src/shell/jsworkers.cpp
+++ b/js/src/shell/jsworkers.cpp
@@ -894,17 +894,17 @@ class InitEvent : public Event
         if (!filename)
             return fail;
 
         JSScript *script = JS_CompileFile(cx, child->getGlobal(), filename.ptr());
         if (!script)
             return fail;
 
         AutoValueRooter rval(cx);
-        JSBool ok = JS_ExecuteScript(cx, child->getGlobal(), script, Jsvalify(rval.addr()));
+        JSBool ok = JS_ExecuteScript(cx, child->getGlobal(), script, rval.addr());
         return Result(ok);
     }
 };
 
 class DownMessageEvent : public Event
 {
   public:
     static DownMessageEvent *create(JSContext *cx, Worker *child, jsval data) {
@@ -930,17 +930,17 @@ class UpMessageEvent : public Event
 
 class ErrorEvent : public Event
 {
   public:
     static ErrorEvent *create(JSContext *cx, Worker *child) {
         JSString *data = NULL;
         jsval exc;
         if (JS_GetPendingException(cx, &exc)) {
-            AutoValueRooter tvr(cx, Valueify(exc));
+            AutoValueRooter tvr(cx, exc);
             JS_ClearPendingException(cx);
 
             // Determine what error message to put in the error event.
             // If exc.message is a string, use that; otherwise use String(exc).
             // (This is a little different from what web workers do.)
             if (JSVAL_IS_OBJECT(exc)) {
                 jsval msg;
                 if (!JS_GetProperty(cx, JSVAL_TO_OBJECT(exc), "message", &msg))
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -588,17 +588,17 @@ Debugger::newCompletionValue(AutoCompart
         ac.leave();
         vp->setNull();
         return true;
     }
 
     JSObject *obj = NewBuiltinClassInstance(cx, &ObjectClass);
     if (!obj ||
         !wrapDebuggeeValue(cx, &val) ||
-        !DefineNativeProperty(cx, obj, key, val, PropertyStub, StrictPropertyStub,
+        !DefineNativeProperty(cx, obj, key, val, JS_PropertyStub, JS_StrictPropertyStub,
                               JSPROP_ENUMERATE, 0, 0))
     {
         return false;
     }
     vp->setObject(*obj);
     return true;
 }
 
@@ -897,18 +897,17 @@ Debugger::onTrap(JSContext *cx, Value *v
                 return st;
 
             /* Calling JS code invalidates site. Reload it. */
             site = cx->compartment->getBreakpointSite(pc);
         }
     }
 
     if (site && site->trapHandler) {
-        JSTrapStatus st = site->trapHandler(cx, fp->script(), pc, Jsvalify(vp),
-                                            Jsvalify(site->trapClosure));
+        JSTrapStatus st = site->trapHandler(cx, fp->script(), pc, vp, site->trapClosure);
         if (st != JSTRAP_CONTINUE)
             return st;
     }
 
     /* By convention, return the true op to the interpreter in vp. */
     vp->setInt32(op);
     return JSTRAP_CONTINUE;
 }
@@ -1276,18 +1275,18 @@ Debugger::finalize(JSContext *cx, JSObje
         for (GlobalObjectSet::Enum e(dbg->debuggees); !e.empty(); e.popFront())
             dbg->removeDebuggeeGlobal(cx, e.front(), NULL, &e);
     }
     cx->delete_(dbg);
 }
 
 Class Debugger::jsclass = {
     "Debugger", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUG_COUNT),
-    PropertyStub, PropertyStub, PropertyStub, StrictPropertyStub,
-    EnumerateStub, ResolveStub, ConvertStub, Debugger::finalize,
+    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
+    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Debugger::finalize,
     NULL,                 /* reserved0   */
     NULL,                 /* checkAccess */
     NULL,                 /* call        */
     NULL,                 /* construct   */
     NULL,                 /* xdrObject   */
     NULL,                 /* hasInstance */
     Debugger::traceObject
 };
@@ -1863,18 +1862,18 @@ DebuggerScript_trace(JSTracer *trc, JSOb
             if (JSObject *obj = (JSObject *) v.toPrivate())
                 MarkObject(trc, *obj, "Debugger.Script referent holder");
         }
     }
 }
 
 Class DebuggerScript_class = {
     "Script", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGSCRIPT_COUNT),
-    PropertyStub, PropertyStub, PropertyStub, StrictPropertyStub,
-    EnumerateStub, ResolveStub, ConvertStub, NULL,
+    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
+    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, NULL,
     NULL,                 /* reserved0   */
     NULL,                 /* checkAccess */
     NULL,                 /* call        */
     NULL,                 /* construct   */
     NULL,                 /* xdrObject   */
     NULL,                 /* hasInstance */
     DebuggerScript_trace
 };
@@ -2502,18 +2501,18 @@ static JSFunctionSpec DebuggerScript_met
     JS_FS_END
 };
 
 
 /*** Debugger.Frame ******************************************************************************/
 
 Class DebuggerFrame_class = {
     "Frame", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGFRAME_COUNT),
-    PropertyStub, PropertyStub, PropertyStub, StrictPropertyStub,
-    EnumerateStub, ResolveStub, ConvertStub
+    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
+    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
 };
 
 static JSObject *
 CheckThisFrame(JSContext *cx, const CallArgs &args, const char *fnname, bool checkLive)
 {
     if (!args.thisv().isObject()) {
         ReportObjectRequired(cx);
         return NULL;
@@ -2639,18 +2638,18 @@ DebuggerFrame_getOlder(JSContext *cx, ui
             return dbg->getScriptFrame(cx, fp, vp);
     }
     args.rval().setNull();
     return true;
 }
 
 Class DebuggerArguments_class = {
     "Arguments", JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGARGUMENTS_COUNT),
-    PropertyStub, PropertyStub, PropertyStub, StrictPropertyStub,
-    EnumerateStub, ResolveStub, ConvertStub
+    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
+    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
 };
 
 /* The getter used for each element of frame.arguments. See DebuggerFrame_getArguments. */
 static JSBool
 DebuggerArguments_getArg(JSContext *cx, uintN argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     int32 i = args.callee().getReservedSlot(0).toInt32();
@@ -3019,18 +3018,18 @@ DebuggerObject_trace(JSTracer *trc, JSOb
     if (!trc->context->runtime->gcCurrentCompartment) {
         if (JSObject *referent = (JSObject *) obj->getPrivate())
             MarkObject(trc, *referent, "Debugger.Object referent");
     }
 }
 
 Class DebuggerObject_class = {
     "Object", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGOBJECT_COUNT),
-    PropertyStub, PropertyStub, PropertyStub, StrictPropertyStub,
-    EnumerateStub, ResolveStub, ConvertStub, NULL,
+    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
+    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, NULL,
     NULL,                 /* reserved0   */
     NULL,                 /* checkAccess */
     NULL,                 /* call        */
     NULL,                 /* construct   */
     NULL,                 /* xdrObject   */
     NULL,                 /* hasInstance */
     DebuggerObject_trace
 };
--- a/js/src/vm/Debugger.h
+++ b/js/src/vm/Debugger.h
@@ -45,17 +45,16 @@
 #include "jsapi.h"
 #include "jsclist.h"
 #include "jscntxt.h"
 #include "jscompartment.h"
 #include "jsgc.h"
 #include "jshashtable.h"
 #include "jsweakmap.h"
 #include "jswrapper.h"
-#include "jsvalue.h"
 #include "vm/GlobalObject.h"
 
 namespace js {
 
 class Debugger {
     friend class js::Breakpoint;
     friend JSBool (::JS_DefineDebuggerObject)(JSContext *cx, JSObject *obj);
 
--- a/js/src/vm/GlobalObject.cpp
+++ b/js/src/vm/GlobalObject.cpp
@@ -274,17 +274,17 @@ GlobalObject::initStandardClasses(JSCont
 {
     /* Native objects get their reserved slots from birth. */
     JS_ASSERT(numSlots() >= JSSLOT_FREE(getClass()));
 
     JSAtomState &state = cx->runtime->atomState;
 
     /* Define a top-level property 'undefined' with the undefined value. */
     if (!defineProperty(cx, ATOM_TO_JSID(state.typeAtoms[JSTYPE_VOID]), UndefinedValue(),
-                        PropertyStub, StrictPropertyStub, JSPROP_PERMANENT | JSPROP_READONLY))
+                        JS_PropertyStub, JS_StrictPropertyStub, JSPROP_PERMANENT | JSPROP_READONLY))
     {
         return false;
     }
 
     if (!initFunctionAndObjectClasses(cx))
         return false;
 
     /* Initialize the rest of the standard objects and functions. */
@@ -408,20 +408,20 @@ GlobalObject::createBlankPrototypeInheri
 {
     return CreateBlankProto(cx, clasp, proto, *this);
 }
 
 bool
 LinkConstructorAndPrototype(JSContext *cx, JSObject *ctor, JSObject *proto)
 {
     return ctor->defineProperty(cx, ATOM_TO_JSID(cx->runtime->atomState.classPrototypeAtom),
-                                ObjectValue(*proto), PropertyStub, StrictPropertyStub,
+                                ObjectValue(*proto), JS_PropertyStub, JS_StrictPropertyStub,
                                 JSPROP_PERMANENT | JSPROP_READONLY) &&
            proto->defineProperty(cx, ATOM_TO_JSID(cx->runtime->atomState.constructorAtom),
-                                 ObjectValue(*ctor), PropertyStub, StrictPropertyStub, 0);
+                                 ObjectValue(*ctor), JS_PropertyStub, JS_StrictPropertyStub, 0);
 }
 
 bool
 DefinePropertiesAndBrand(JSContext *cx, JSObject *obj, JSPropertySpec *ps, JSFunctionSpec *fs)
 {
     if ((ps && !JS_DefineProperties(cx, obj, ps)) || (fs && !JS_DefineFunctions(cx, obj, fs)))
         return false;
     if (!cx->typeInferenceEnabled())
@@ -433,18 +433,18 @@ void
 GlobalDebuggees_finalize(JSContext *cx, JSObject *obj)
 {
     cx->delete_((GlobalObject::DebuggerVector *) obj->getPrivate());
 }
 
 static Class
 GlobalDebuggees_class = {
     "GlobalDebuggee", JSCLASS_HAS_PRIVATE,
-    PropertyStub, PropertyStub, PropertyStub, StrictPropertyStub,
-    EnumerateStub, ResolveStub, ConvertStub, GlobalDebuggees_finalize
+    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
+    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, GlobalDebuggees_finalize
 };
 
 GlobalObject::DebuggerVector *
 GlobalObject::getDebuggers()
 {
     Value debuggers = getReservedSlot(DEBUGGERS);
     if (debuggers.isUndefined())
         return NULL;
--- a/js/src/vm/GlobalObject.h
+++ b/js/src/vm/GlobalObject.h
@@ -161,17 +161,17 @@ class GlobalObject : public ::JSObject {
   public:
     static GlobalObject *create(JSContext *cx, Class *clasp);
 
     /*
      * Create a constructor function with the specified name and length using
      * ctor, a method which creates objects with the given class.
      */
     JSFunction *
-    createConstructor(JSContext *cx, Native ctor, Class *clasp, JSAtom *name, uintN length);
+    createConstructor(JSContext *cx, JSNative ctor, Class *clasp, JSAtom *name, uintN length);
 
     /*
      * Create an object to serve as [[Prototype]] for instances of the given
      * class, using |Object.prototype| as its [[Prototype]].  Users creating
      * prototype objects with particular internal structure (e.g. reserved
      * slots guaranteed to contain values of particular types) must immediately
      * complete the minimal initialization to make the returned object safe to
      * touch.
--- a/js/src/xpconnect/src/qsgen.py
+++ b/js/src/xpconnect/src/qsgen.py
@@ -1197,32 +1197,32 @@ def writeTraceableArgumentConversion(f, 
             return rvdeclared
         # else fall through; the type isn't supported yet.
     elif isInterfaceType(type):
         if type.name == 'nsIVariant':
             # Totally custom.
             assert haveCcx
             template = (
                 "    nsCOMPtr<nsIVariant> ${name}(already_AddRefed<nsIVariant>("
-                "XPCVariant::newVariant(ccx, js::Jsvalify(js::ValueArgToConstRef(${argVal})))));\n"
+                "XPCVariant::newVariant(ccx, js::ValueArgToConstRef(${argVal}))));\n"
                 "    if (!${name}) {\n")
             f.write(substitute(template, params))
             writeFailure(f, getTraceInfoDefaultReturn(member.realtype), 2)
             return rvdeclared
         elif type.name == 'nsIAtom':
             # Should have special atomizing behavior.  Fall through.
             pass
         else:
             if not rvdeclared:
                 f.write("    nsresult rv;\n");
             f.write("    %s *%s;\n" % (type.name, name))
             f.write("    xpc_qsSelfRef %sref;\n" % name)
             f.write("    JS::Anchor<jsval> %sanchor;\n" % name);
             f.write("    rv = xpc_qsUnwrapArg<%s>("
-                    "cx, js::Jsvalify(js::ValueArgToConstRef(%s)), &%s, &%sref.ptr, &%sanchor.get());\n"
+                    "cx, js::ValueArgToConstRef(%s), &%s, &%sref.ptr, &%sanchor.get());\n"
                     % (type.name, argVal, name, name, name))
             f.write("    if (NS_FAILED(rv)) {\n")
             if haveCcx:
                 f.write("        xpc_qsThrowBadArgWithCcx(ccx, rv, %d);\n" % i)
             else:
                 # XXX Fix this to return a real error!
                 f.write("        xpc_qsThrowBadArgWithDetails(cx, rv, %d, "
                         "\"%s\", \"%s\");\n"
--- a/js/src/xpconnect/src/xpcprivate.h
+++ b/js/src/xpconnect/src/xpcprivate.h
@@ -1400,17 +1400,17 @@ XPC_WN_JSOp_ThisObject(JSContext *cx, JS
         nsnull, /* setProperty    */                                          \
         nsnull, /* setElement    */                                           \
         nsnull, /* getAttributes  */                                          \
         nsnull, /* getElementAttributes  */                                   \
         nsnull, /* setAttributes  */                                          \
         nsnull, /* setElementAttributes  */                                   \
         nsnull, /* deleteProperty */                                          \
         nsnull, /* deleteElement */                                           \
-        js::Valueify(XPC_WN_JSOp_Enumerate),                                  \
+        XPC_WN_JSOp_Enumerate,                                                \
         XPC_WN_JSOp_TypeOf_Function,                                          \
         nsnull, /* fix            */                                          \
         XPC_WN_JSOp_ThisObject,                                               \
         XPC_WN_JSOp_Clear                                                     \
     }
 
 #define XPC_WN_NoCall_ObjectOps                                               \
     {                                                                         \
@@ -1423,17 +1423,17 @@ XPC_WN_JSOp_ThisObject(JSContext *cx, JS
         nsnull, /* setProperty    */                                          \
         nsnull, /* setElement    */                                           \
         nsnull, /* getAttributes  */                                          \
         nsnull, /* getElementAttributes  */                                   \
         nsnull, /* setAttributes  */                                          \
         nsnull, /* setElementAttributes  */                                   \
         nsnull, /* deleteProperty */                                          \
         nsnull, /* deleteElement */                                           \
-        js::Valueify(XPC_WN_JSOp_Enumerate),                                  \
+        XPC_WN_JSOp_Enumerate,                                                \
         XPC_WN_JSOp_TypeOf_Object,                                            \
         nsnull, /* fix            */                                          \
         XPC_WN_JSOp_ThisObject,                                               \
         XPC_WN_JSOp_Clear                                                     \
     }
 
 // Maybe this macro should check for class->enumerate ==
 // XPC_WN_Shared_Proto_Enumerate or something rather than checking for
@@ -1992,17 +1992,17 @@ struct XPCNativeScriptableSharedJSClass
 
 class XPCNativeScriptableShared
 {
 public:
     const XPCNativeScriptableFlags& GetFlags() const {return mFlags;}
     PRUint32                        GetInterfacesBitmap() const
         {return mJSClass.interfacesBitmap;}
     JSClass*                        GetJSClass()
-        {return js::Jsvalify(&mJSClass.base);}
+        {return Jsvalify(&mJSClass.base);}
     JSClass*                        GetSlimJSClass()
         {if(mCanBeSlim) return GetJSClass(); return nsnull;}
 
     XPCNativeScriptableShared(JSUint32 aFlags, char* aName,
                               PRUint32 interfacesBitmap)
         : mFlags(aFlags),
           mCanBeSlim(JS_FALSE)
         {memset(&mJSClass, 0, sizeof(mJSClass));
--- a/js/src/xpconnect/src/xpcwrappednative.cpp
+++ b/js/src/xpconnect/src/xpcwrappednative.cpp
@@ -1126,19 +1126,17 @@ XPCWrappedNative::Init(XPCCallContext& c
             if(HasProto() && !HasSharedProto())
                 GetProto()->SetScriptableInfo(mScriptableInfo);
         }
     }
     XPCNativeScriptableInfo* si = mScriptableInfo;
 
     // create our flatJSObject
 
-    js::Class* jsclazz = si
-                         ? js::Valueify(si->GetJSClass())
-                         : &XPC_WN_NoHelper_JSClass;
+    JSClass* jsclazz = si ? si->GetJSClass() : Jsvalify(&XPC_WN_NoHelper_JSClass);
 
     if(isGlobal)
     {
         // Resolving a global object's class can cause us to create a global's
         // JS class without the proper global flags. Notice that here and fix
         // the problem.
         if(!(jsclazz->flags & JSCLASS_IS_GLOBAL))
             jsclazz->flags |= JSCLASS_GLOBAL_FLAGS;
@@ -1162,18 +1160,17 @@ XPCWrappedNative::Init(XPCCallContext& c
     JSObject* protoJSObject = HasProto() ?
                                 GetProto()->GetJSProtoObject() :
                                 GetScope()->GetPrototypeNoHelper(ccx);
 
     if (!protoJSObject) {
         return JS_FALSE;
     }
 
-    mFlatJSObject = xpc_NewSystemInheritingJSObject(ccx, js::Jsvalify(jsclazz),
-                                                    protoJSObject, false, parent);
+    mFlatJSObject = xpc_NewSystemInheritingJSObject(ccx, jsclazz, protoJSObject, false, parent);
     if(!mFlatJSObject)
         return JS_FALSE;
 
     return FinishInit(ccx);
 }
 
 JSBool
 XPCWrappedNative::Init(XPCCallContext &ccx, JSObject *existingJSObject)
@@ -2145,17 +2142,17 @@ XPCWrappedNative::InitTearOff(XPCCallCon
 
 JSBool
 XPCWrappedNative::InitTearOffJSObject(XPCCallContext& ccx,
                                       XPCWrappedNativeTearOff* to)
 {
     // This is only called while locked (during XPCWrappedNative::FindTearOff).
 
     JSObject* obj =
-        xpc_NewSystemInheritingJSObject(ccx, js::Jsvalify(&XPC_WN_Tearoff_JSClass),
+        xpc_NewSystemInheritingJSObject(ccx, Jsvalify(&XPC_WN_Tearoff_JSClass),
                                         GetScope()->GetPrototypeJSObject(),
                                         false, mFlatJSObject);
 
     if(!obj || !JS_SetPrivate(ccx, obj, to))
         return JS_FALSE;
 
     to->SetJSObject(obj);
     return JS_TRUE;
--- a/js/src/xpconnect/src/xpcwrappednativeinfo.cpp
+++ b/js/src/xpconnect/src/xpcwrappednativeinfo.cpp
@@ -89,18 +89,18 @@ xpc_CloneJSFunction(XPCCallContext &ccx,
 // static
 JSBool
 XPCNativeMember::GetCallInfo(XPCCallContext& ccx,
                              JSObject* funobj,
                              XPCNativeInterface** pInterface,
                              XPCNativeMember**    pMember)
 {
     funobj = funobj->unwrap();
-    jsval ifaceVal = js::Jsvalify(funobj->getSlot(0));
-    jsval memberVal = js::Jsvalify(funobj->getSlot(1));
+    jsval ifaceVal = funobj->getSlot(0);
+    jsval memberVal = funobj->getSlot(1);
 
     *pInterface = (XPCNativeInterface*) JSVAL_TO_PRIVATE(ifaceVal);
     *pMember = (XPCNativeMember*) JSVAL_TO_PRIVATE(memberVal);
 
     return JS_TRUE;
 }
 
 JSBool
--- a/js/src/xpconnect/src/xpcwrappednativejsops.cpp
+++ b/js/src/xpconnect/src/xpcwrappednativejsops.cpp
@@ -870,38 +870,38 @@ XPC_WN_OuterObject(JSContext *cx, JSObje
 }
 
 js::Class XPC_WN_NoHelper_JSClass = {
     "XPCWrappedNative_NoHelper",    // name;
     WRAPPER_SLOTS |
     JSCLASS_PRIVATE_IS_NSISUPPORTS, // flags
 
     /* Mandatory non-null function pointer members. */
-    JS_VALUEIFY(js::PropertyOp, XPC_WN_OnlyIWrite_AddPropertyStub),       // addProperty
-    JS_VALUEIFY(js::PropertyOp, XPC_WN_CannotModifyPropertyStub),         // delProperty
-    js::PropertyStub,                                                     // getProperty
-    JS_VALUEIFY(js::StrictPropertyOp, XPC_WN_OnlyIWrite_SetPropertyStub), // setProperty
+    XPC_WN_OnlyIWrite_AddPropertyStub, // addProperty
+    XPC_WN_CannotModifyPropertyStub,   // delProperty
+    JS_PropertyStub,                   // getProperty
+    XPC_WN_OnlyIWrite_SetPropertyStub, // setProperty
    
-    XPC_WN_Shared_Enumerate,                                     // enumerate
-    XPC_WN_NoHelper_Resolve,                                     // resolve
-    JS_VALUEIFY(js::ConvertOp, XPC_WN_Shared_Convert),           // convert
-    XPC_WN_NoHelper_Finalize,                                    // finalize
+    XPC_WN_Shared_Enumerate,           // enumerate
+    XPC_WN_NoHelper_Resolve,           // resolve
+    XPC_WN_Shared_Convert,             // convert
+    XPC_WN_NoHelper_Finalize,          // finalize
    
     /* Optionally non-null members start here. */
     nsnull,                         // reserved0
     nsnull,                         // checkAccess
     nsnull,                         // call
     nsnull,                         // construct
     nsnull,                         // xdrObject;
     nsnull,                         // hasInstance
     XPC_WN_Shared_Trace,            // trace
 
     // ClassExtension
     {
-        JS_VALUEIFY(js::EqualityOp, XPC_WN_Equality),
+        XPC_WN_Equality,
         nsnull, // outerObject
         nsnull, // innerObject
         nsnull, // iteratorObject
         nsnull, // unused
         true,   // isWrappedNative
     },
    
     // ObjectOps
@@ -915,17 +915,17 @@ js::Class XPC_WN_NoHelper_JSClass = {
         nsnull, // setProperty
         nsnull, // setElement
         nsnull, // getAttributes
         nsnull, // getElementAttributes
         nsnull, // setAttributes
         nsnull, // setElementAttributes
         nsnull, // deleteProperty
         nsnull, // deleteElement
-        JS_VALUEIFY(js::NewEnumerateOp, XPC_WN_JSOp_Enumerate),
+        XPC_WN_JSOp_Enumerate,
         XPC_WN_JSOp_TypeOf_Object,
         nsnull, // fix
         XPC_WN_JSOp_ThisObject,
         XPC_WN_JSOp_Clear
     }
 };
 
 
@@ -1261,17 +1261,17 @@ XPC_WN_JSOp_Enumerate(JSContext *cx, JSO
 {
     js::Class *clazz = obj->getClass();
     if(!IS_WRAPPER_CLASS(clazz) || clazz == &XPC_WN_NoHelper_JSClass)
     {
         // obj must be a prototype object or a wrapper w/o a
         // helper. Short circuit this call to the default
         // implementation.
 
-        return js_Enumerate(cx, obj, enum_op, js::Valueify(statep), idp);
+        return js_Enumerate(cx, obj, enum_op, statep, idp);
     }
 
     MORPH_SLIM_WRAPPER(cx, obj);
 
     XPCCallContext ccx(JS_CALLER, cx, obj);
     XPCWrappedNative* wrapper = ccx.GetWrapper();
     THROW_AND_RETURN_IF_BAD_WRAPPER(cx, wrapper);
 
@@ -1334,17 +1334,17 @@ XPC_WN_JSOp_Enumerate(JSContext *cx, JSO
             if(!retval)
                 return JS_FALSE;
             // Then fall through and call the default implementation...
         }
     }
 
     // else call js_ObjectOps.enumerate...
 
-    return js_Enumerate(cx, obj, enum_op, js::Valueify(statep), idp);
+    return js_Enumerate(cx, obj, enum_op, statep, idp);
 }
 
 JSType
 XPC_WN_JSOp_TypeOf_Object(JSContext *cx, JSObject *obj)
 {
     return JSTYPE_OBJECT;
 }
 
@@ -1466,107 +1466,107 @@ XPCNativeScriptableShared::PopulateJSCla
     if(mFlags.WantAddProperty())
         addProperty = XPC_WN_Helper_AddProperty;
     else if(mFlags.UseJSStubForAddProperty())
         addProperty = JS_PropertyStub;
     else if(mFlags.AllowPropModsDuringResolve())
         addProperty = XPC_WN_MaybeResolvingPropertyStub;
     else
         addProperty = XPC_WN_CannotModifyPropertyStub;
-    mJSClass.base.addProperty = js::Valueify(addProperty);
+    mJSClass.base.addProperty = addProperty;
 
     JSPropertyOp delProperty;
     if(mFlags.WantDelProperty())
         delProperty = XPC_WN_Helper_DelProperty;
     else if(mFlags.UseJSStubForDelProperty())
         delProperty = JS_PropertyStub;
     else if(mFlags.AllowPropModsDuringResolve())
         delProperty = XPC_WN_MaybeResolvingPropertyStub;
     else
         delProperty = XPC_WN_CannotModifyPropertyStub;
-    mJSClass.base.delProperty = js::Valueify(delProperty);
+    mJSClass.base.delProperty = delProperty;
 
     if(mFlags.WantGetProperty())
-        mJSClass.base.getProperty = js::Valueify(XPC_WN_Helper_GetProperty);
+        mJSClass.base.getProperty = XPC_WN_Helper_GetProperty;
     else
-        mJSClass.base.getProperty = js::PropertyStub;
+        mJSClass.base.getProperty = JS_PropertyStub;
 
     JSStrictPropertyOp setProperty;
     if(mFlags.WantSetProperty())
         setProperty = XPC_WN_Helper_SetProperty;
     else if(mFlags.UseJSStubForSetProperty())
         setProperty = JS_StrictPropertyStub;
     else if(mFlags.AllowPropModsDuringResolve())
         setProperty = XPC_WN_MaybeResolvingStrictPropertyStub;
     else
         setProperty = XPC_WN_CannotModifyStrictPropertyStub;
-    mJSClass.base.setProperty = js::Valueify(setProperty);
+    mJSClass.base.setProperty = setProperty;
 
     // We figure out most of the enumerate strategy at call time.
 
     if(mFlags.WantNewEnumerate() || mFlags.WantEnumerate() ||
        mFlags.DontEnumStaticProps())
-        mJSClass.base.enumerate = js::EnumerateStub;
+        mJSClass.base.enumerate = JS_EnumerateStub;
     else
         mJSClass.base.enumerate = XPC_WN_Shared_Enumerate;
 
     // We have to figure out resolve strategy at call time
     mJSClass.base.resolve = (JSResolveOp) XPC_WN_Helper_NewResolve;
 
     if(mFlags.WantConvert())
-        mJSClass.base.convert = js::Valueify(XPC_WN_Helper_Convert);
+        mJSClass.base.convert = XPC_WN_Helper_Convert;
     else
-        mJSClass.base.convert = js::Valueify(XPC_WN_Shared_Convert);
+        mJSClass.base.convert = XPC_WN_Shared_Convert;
 
     if(mFlags.WantFinalize())
         mJSClass.base.finalize = XPC_WN_Helper_Finalize;
     else
         mJSClass.base.finalize = XPC_WN_NoHelper_Finalize;
 
     // We let the rest default to nsnull unless the helper wants them...
     if(mFlags.WantCheckAccess())
-        mJSClass.base.checkAccess = js::Valueify(XPC_WN_Helper_CheckAccess);
+        mJSClass.base.checkAccess = XPC_WN_Helper_CheckAccess;
 
     // Note that we *must* set the ObjectOps (even for the cases were it does
     // not do much) because with these dynamically generated JSClasses, the
     // code in XPCWrappedNative::GetWrappedNativeOfJSObject() needs to look
     // for that these callback pointers in order to identify that a given
     // JSObject represents a wrapper.
     js::ObjectOps *ops = &mJSClass.base.ops;
-    ops->enumerate = js::Valueify(XPC_WN_JSOp_Enumerate);
+    ops->enumerate = XPC_WN_JSOp_Enumerate;
     ops->clear = XPC_WN_JSOp_Clear;
     ops->thisObject = XPC_WN_JSOp_ThisObject;
 
     if(mFlags.WantCall() || mFlags.WantConstruct())
     {
         ops->typeOf = XPC_WN_JSOp_TypeOf_Function;
         if(mFlags.WantCall())
-            mJSClass.base.call = js::Valueify(XPC_WN_Helper_Call);
+            mJSClass.base.call = XPC_WN_Helper_Call;
         if(mFlags.WantConstruct())
-            mJSClass.base.construct = js::Valueify(XPC_WN_Helper_Construct);
+            mJSClass.base.construct = XPC_WN_Helper_Construct;
     }
     else
     {
         ops->typeOf = XPC_WN_JSOp_TypeOf_Object;
     }
 
     if(mFlags.UseStubEqualityHook())
     {
         NS_ASSERTION(!mFlags.WantEquality(),
                      "If you want an Equality callback, you can't use a stub "
                      "equality hook");
         mJSClass.base.ext.equality = nsnull;
     }
     else
     {
-        mJSClass.base.ext.equality = js::Valueify(XPC_WN_Equality);
+        mJSClass.base.ext.equality = XPC_WN_Equality;
     }
 
     if(mFlags.WantHasInstance())
-        mJSClass.base.hasInstance = js::Valueify(XPC_WN_Helper_HasInstance);
+        mJSClass.base.hasInstance = XPC_WN_Helper_HasInstance;
 
     if(mFlags.WantTrace())
         mJSClass.base.trace = XPC_WN_Helper_Trace;
     else
         mJSClass.base.trace = XPC_WN_Shared_Trace;
 
     if(mFlags.WantOuterObject())
         mJSClass.base.ext.outerObject = XPC_WN_OuterObject;
@@ -1761,23 +1761,23 @@ XPC_WN_ModsAllowed_Proto_Resolve(JSConte
                                  enumFlag, nsnull);
 }
 
 js::Class XPC_WN_ModsAllowed_WithCall_Proto_JSClass = {
     "XPC_WN_ModsAllowed_WithCall_Proto_JSClass", // name;
     WRAPPER_SLOTS, // flags;
 
     /* Mandatory non-null function pointer members. */
-    js::PropertyStub,               // addProperty;
-    js::PropertyStub,               // delProperty;
-    js::PropertyStub,               // getProperty;
-    js::StrictPropertyStub,         // setProperty;
+    JS_PropertyStub,                // addProperty;
+    JS_PropertyStub,                // delProperty;
+    JS_PropertyStub,                // getProperty;
+    JS_StrictPropertyStub,          // setProperty;
     XPC_WN_Shared_Proto_Enumerate,  // enumerate;
     XPC_WN_ModsAllowed_Proto_Resolve, // resolve;
-    js::ConvertStub,                // convert;
+    JS_ConvertStub,                 // convert;
     XPC_WN_Shared_Proto_Finalize,   // finalize;
 
     /* Optionally non-null members start here. */
     nsnull,                         // reserved0;
     nsnull,                         // checkAccess;
     nsnull,                         // call;
     nsnull,                         // construct;
     nsnull,                         // xdrObject;
@@ -1788,24 +1788,24 @@ js::Class XPC_WN_ModsAllowed_WithCall_Pr
     XPC_WN_WithCall_ObjectOps
 };
 
 js::Class XPC_WN_ModsAllowed_NoCall_Proto_JSClass = {
     "XPC_WN_ModsAllowed_NoCall_Proto_JSClass", // name;
     WRAPPER_SLOTS,                  // flags;
 
     /* Mandatory non-null function pointer members. */
-    js::PropertyStub,               // addProperty;
-    js::PropertyStub,               // delProperty;
-    js::PropertyStub,               // getProperty;
-    js::StrictPropertyStub,         // setProperty;
+    JS_PropertyStub,                // addProperty;
+    JS_PropertyStub,                // delProperty;
+    JS_PropertyStub,                // getProperty;