Bug 556353 - Remove OBJ_IS_NATIVE, HAS_FUNCTION_CLASS. r=brendan.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 31 Mar 2010 22:13:51 -0700
changeset 40430 fd93131c3bb9c7588e56049f0e2171d9bfa0c9a0
parent 40429 3ddc4115027394c62db4616d09f6163df2914385
child 40431 31b699be9f634c68c179afb8fc4b89ee03583c91
push idunknown
push userunknown
push dateunknown
reviewersbrendan
bugs556353
milestone1.9.3a4pre
Bug 556353 - Remove OBJ_IS_NATIVE, HAS_FUNCTION_CLASS. r=brendan.
js/src/jsapi-tests/testLookup.cpp
js/src/jsapi.cpp
js/src/jsarray.cpp
js/src/jsarray.h
js/src/jsbuiltins.cpp
js/src/jsdbgapi.cpp
js/src/jsfun.cpp
js/src/jsfun.h
js/src/jsgc.cpp
js/src/jslock.cpp
js/src/jslock.h
js/src/jsobj.cpp
js/src/jsobj.h
js/src/jsobjinlines.h
js/src/jsops.cpp
js/src/jsparse.cpp
js/src/jspropertycache.cpp
js/src/jsscope.cpp
js/src/jsscriptinlines.h
js/src/jstracer.cpp
js/src/jstypedarray.cpp
js/src/jsxml.cpp
js/src/shell/js.cpp
js/src/xpconnect/src/xpcdebug.cpp
--- a/js/src/jsapi-tests/testLookup.cpp
+++ b/js/src/jsapi-tests/testLookup.cpp
@@ -15,15 +15,15 @@ BEGIN_TEST(testLookup_bug522590)
     EVAL("mkobj()", x.addr());
     JSObject *xobj = JSVAL_TO_OBJECT(x);
 
     // This lookup must not return an internal function object.
     jsvalRoot r(cx);
     CHECK(JS_LookupProperty(cx, xobj, "f", r.addr()));
     CHECK(JSVAL_IS_OBJECT(r));
     JSObject *funobj = JSVAL_TO_OBJECT(r);
-    CHECK(HAS_FUNCTION_CLASS(funobj));
+    CHECK(funobj->isFunction());
     CHECK(!js::IsInternalFunctionObject(funobj));
     CHECK(GET_FUNCTION_PRIVATE(cx, funobj) != (JSFunction *) funobj);
 
     return true;
 }
 END_TEST(testLookup_bug522590)
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -2765,17 +2765,17 @@ JS_SealObject(JSContext *cx, JSObject *o
     JSScope *scope;
     JSIdArray *ida;
     uint32 nslots, i;
     jsval v;
 
     if (obj->isDenseArray() && !js_MakeArraySlow(cx, obj))
         return JS_FALSE;
 
-    if (!OBJ_IS_NATIVE(obj)) {
+    if (!obj->isNative()) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
                              JSMSG_CANT_SEAL_OBJECT,
                              OBJ_GET_CLASS(cx, obj)->name);
         return JS_FALSE;
     }
 
     scope = OBJ_SCOPE(obj);
 
@@ -2846,17 +2846,17 @@ JS_ConstructObjectWithArguments(JSContex
     return js_ConstructObject(cx, clasp, proto, parent, argc, argv);
 }
 
 static JSBool
 DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value,
                    JSPropertyOp getter, JSPropertyOp setter, uintN attrs,
                    uintN flags, intN tinyid)
 {
-    if (flags != 0 && OBJ_IS_NATIVE(obj)) {
+    if (flags != 0 && obj->isNative()) {
         JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED | JSRESOLVE_DECLARING);
         return !!js_DefineNativeProperty(cx, obj, id, value, getter, setter,
                                          attrs, flags, tinyid, NULL);
     }
     return obj->defineProperty(cx, id, value, getter, setter, attrs);
 }
 
 static JSBool
@@ -2889,17 +2889,17 @@ DefineUCProperty(JSContext *cx, JSObject
                  JSPropertyOp getter, JSPropertyOp setter, uintN attrs,
                  uintN flags, intN tinyid)
 {
     JSAtom *atom;
 
     atom = js_AtomizeChars(cx, name, AUTO_NAMELEN(name, namelen), 0);
     if (!atom)
         return JS_FALSE;
-    if (flags != 0 && OBJ_IS_NATIVE(obj)) {
+    if (flags != 0 && obj->isNative()) {
         JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED | JSRESOLVE_DECLARING);
         return !!js_DefineNativeProperty(cx, obj, ATOM_TO_JSID(atom), value,
                                          getter, setter, attrs, flags, tinyid,
                                          NULL);
     }
     return obj->defineProperty(cx, ATOM_TO_JSID(atom), value, getter, setter, attrs);
 }
 
@@ -3040,17 +3040,17 @@ JS_AliasProperty(JSContext *cx, JSObject
 
     CHECK_REQUEST(cx);
     if (!LookupProperty(cx, obj, name, JSRESOLVE_QUALIFIED, &obj2, &prop))
         return JS_FALSE;
     if (!prop) {
         js_ReportIsNotDefined(cx, name);
         return JS_FALSE;
     }
-    if (obj2 != obj || !OBJ_IS_NATIVE(obj)) {
+    if (obj2 != obj || !obj->isNative()) {
         obj2->dropProperty(cx, prop);
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CANT_ALIAS,
                              alias, name, OBJ_GET_CLASS(cx, obj2)->name);
         return JS_FALSE;
     }
     atom = js_Atomize(cx, alias, strlen(alias), 0);
     if (!atom) {
         ok = JS_FALSE;
@@ -3072,17 +3072,17 @@ LookupResult(JSContext *cx, JSObject *ob
 {
     if (!prop) {
         /* XXX bad API: no way to tell "not defined" from "void value" */
         *vp = JSVAL_VOID;
         return JS_TRUE;
     }
 
     JSBool ok = JS_TRUE;
-    if (OBJ_IS_NATIVE(obj2)) {
+    if (obj2->isNative()) {
         JSScopeProperty *sprop = (JSScopeProperty *) prop;
 
         if (sprop->isMethod()) {
             AutoScopePropertyRooter root(cx, sprop);
             JS_UNLOCK_OBJ(cx, obj2);
             *vp = sprop->methodValue();
             return OBJ_SCOPE(obj2)->methodReadBarrier(cx, sprop, vp);
         }
@@ -3122,17 +3122,17 @@ GetPropertyAttributesById(JSContext *cx,
             obj2->dropProperty(cx, prop);
         return JS_TRUE;
     }
 
     desc->obj = obj2;
 
     ok = obj2->getAttributes(cx, id, prop, &desc->attrs);
     if (ok) {
-        if (OBJ_IS_NATIVE(obj2)) {
+        if (obj2->isNative()) {
             JSScopeProperty *sprop = (JSScopeProperty *) prop;
 
             desc->getter = sprop->getter();
             desc->setter = sprop->setter();
             desc->value = SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(obj2))
                           ? LOCKED_OBJ_GET_SLOT(obj2, sprop->slot)
                           : JSVAL_VOID;
         } else {
@@ -3252,17 +3252,17 @@ JS_SetPropertyAttributes(JSContext *cx, 
 }
 
 static JSBool
 AlreadyHasOwnPropertyHelper(JSContext *cx, JSObject *obj, jsid id,
                             JSBool *foundp)
 {
     JSScope *scope;
 
-    if (!OBJ_IS_NATIVE(obj)) {
+    if (!obj->isNative()) {
         JSObject *obj2;
         JSProperty *prop;
 
         if (!LookupPropertyById(cx, obj, id,
                                 JSRESOLVE_QUALIFIED | JSRESOLVE_DETECTING,
                                 &obj2, &prop)) {
             return JS_FALSE;
         }
@@ -3376,17 +3376,17 @@ JS_LookupPropertyWithFlags(JSContext *cx
 JS_PUBLIC_API(JSBool)
 JS_LookupPropertyWithFlagsById(JSContext *cx, JSObject *obj, jsid id,
                                uintN flags, JSObject **objp, jsval *vp)
 {
     JSBool ok;
     JSProperty *prop;
 
     CHECK_REQUEST(cx);
-    ok = OBJ_IS_NATIVE(obj)
+    ok = obj->isNative()
          ? js_LookupPropertyWithFlags(cx, obj, id, flags, objp, &prop) >= 0
          : obj->lookupProperty(cx, id, objp, &prop);
     if (ok)
         ok = LookupResult(cx, obj, *objp, prop, vp);
     return ok;
 }
 
 JS_PUBLIC_API(JSBool)
@@ -3722,17 +3722,17 @@ JS_AliasElement(JSContext *cx, JSObject 
 
     CHECK_REQUEST(cx);
     if (!LookupProperty(cx, obj, name, JSRESOLVE_QUALIFIED, &obj2, &prop))
         return JS_FALSE;
     if (!prop) {
         js_ReportIsNotDefined(cx, name);
         return JS_FALSE;
     }
-    if (obj2 != obj || !OBJ_IS_NATIVE(obj)) {
+    if (obj2 != obj || !obj->isNative()) {
         char numBuf[12];
         obj2->dropProperty(cx, prop);
         JS_snprintf(numBuf, sizeof numBuf, "%ld", (long)alias);
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CANT_ALIAS,
                              numBuf, name, OBJ_GET_CLASS(cx, obj2)->name);
         return JS_FALSE;
     }
     sprop = (JSScopeProperty *)prop;
@@ -3954,17 +3954,17 @@ JS_NewPropertyIterator(JSContext *cx, JS
     jsint index;
     JSIdArray *ida;
 
     CHECK_REQUEST(cx);
     iterobj = js_NewObject(cx, &prop_iter_class, NULL, obj);
     if (!iterobj)
         return NULL;
 
-    if (OBJ_IS_NATIVE(obj)) {
+    if (obj->isNative()) {
         /* Native case: start with the last property in obj's own scope. */
         scope = OBJ_SCOPE(obj);
         pdata = scope->lastProperty();
         index = -1;
     } else {
         /*
          * Non-native case: enumerate a JSIdArray and keep it via private.
          *
@@ -3994,17 +3994,17 @@ JS_NextProperty(JSContext *cx, JSObject 
     JSScopeProperty *sprop;
     JSIdArray *ida;
 
     CHECK_REQUEST(cx);
     i = JSVAL_TO_INT(iterobj->fslots[JSSLOT_ITER_INDEX]);
     if (i < 0) {
         /* Native case: private data is a property tree node pointer. */
         obj = iterobj->getParent();
-        JS_ASSERT(OBJ_IS_NATIVE(obj));
+        JS_ASSERT(obj->isNative());
         scope = OBJ_SCOPE(obj);
         sprop = (JSScopeProperty *) iterobj->getPrivate();
 
         /*
          * If the next property mapped by scope in the property tree ancestor
          * line is not enumerable, or it's an alias, skip it and keep on trying
          * to find an enumerable property that is still in scope.
          */
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -785,17 +785,17 @@ array_getProperty(JSContext *cx, JSObjec
         }
 
         *vp = JSVAL_VOID;
         if (js_LookupPropertyWithFlags(cx, proto, id, cx->resolveFlags,
                                        &obj2, &prop) < 0)
             return JS_FALSE;
 
         if (prop) {
-            if (OBJ_IS_NATIVE(obj2)) {
+            if (obj2->isNative()) {
                 sprop = (JSScopeProperty *) prop;
                 if (!js_NativeGet(cx, obj, obj2, sprop, JSGET_METHOD_BARRIER, vp))
                     return JS_FALSE;
             }
             obj2->dropProperty(cx, prop);
         }
         return JS_TRUE;
     }
@@ -884,17 +884,17 @@ js_PrototypeHasIndexedProperties(JSConte
      * element on the original object.
      */
     while ((obj = obj->getProto()) != NULL) {
         /*
          * If the prototype is a non-native object (possibly a dense array), or
          * a native object (possibly a slow array) that has indexed properties,
          * return true.
          */
-        if (!OBJ_IS_NATIVE(obj))
+        if (!obj->isNative())
             return JS_TRUE;
         if (OBJ_SCOPE(obj)->hadIndexedProperties())
             return JS_TRUE;
     }
     return JS_FALSE;
 }
 
 #ifdef JS_TRACER
--- a/js/src/jsarray.h
+++ b/js/src/jsarray.h
@@ -63,18 +63,18 @@ JSObject::isDenseArray() const
 
 inline bool
 JSObject::isArray() const
 {
     return isDenseArray() || getClass() == &js_SlowArrayClass;
 }
 
 /*
- * Dense arrays are not native (OBJ_IS_NATIVE(cx, aobj) for a dense array aobj
- * results in false, meaning aobj->map does not point to a JSScope).
+ * Dense arrays are not native -- aobj->isNative() for a dense array aobj
+ * results in false, meaning aobj->map does not point to a JSScope.
  *
  * But Array methods are called via aobj.sort(), e.g., and the interpreter and
  * the trace recorder must consult the property cache in order to perform well.
  * The cache works only for native objects.
  *
  * Therefore the interpreter (js_Interpret in JSOP_GETPROP and JSOP_CALLPROP)
  * and js_GetPropertyHelper use this inline function to skip up one link in the
  * prototype chain when obj is a dense array, in order to find a native object
--- a/js/src/jsbuiltins.cpp
+++ b/js/src/jsbuiltins.cpp
@@ -323,18 +323,18 @@ js_BooleanIntToString(JSContext *cx, int
     JS_ASSERT(uint32(unboxed) <= 1);
     return ATOM_TO_STRING(cx->runtime->atomState.booleanAtoms[unboxed]);
 }
 JS_DEFINE_CALLINFO_2(extern, STRING, js_BooleanIntToString, CONTEXT, INT32, 1, ACC_NONE)
 
 JSObject* FASTCALL
 js_NewNullClosure(JSContext* cx, JSObject* funobj, JSObject* proto, JSObject* parent)
 {
-    JS_ASSERT(HAS_FUNCTION_CLASS(funobj));
-    JS_ASSERT(HAS_FUNCTION_CLASS(proto));
+    JS_ASSERT(funobj->isFunction());
+    JS_ASSERT(proto->isFunction());
     JS_ASSERT(JS_ON_TRACE(cx));
 
     JSFunction *fun = (JSFunction*) funobj;
     JS_ASSERT(GET_FUNCTION_PRIVATE(cx, funobj) == fun);
 
     JSObject* closure = js_NewGCObject(cx);
     if (!closure)
         return NULL;
--- a/js/src/jsdbgapi.cpp
+++ b/js/src/jsdbgapi.cpp
@@ -626,17 +626,17 @@ js_watch_set(JSContext *cx, JSObject *ob
             propid = ID_TO_VALUE(sprop->id);
             userid = SPROP_USERID(sprop);
             scope = OBJ_SCOPE(obj);
             JS_UNLOCK_OBJ(cx, obj);
 
             /* NB: wp is held, so we can safely dereference it still. */
             ok = wp->handler(cx, obj, propid,
                              SPROP_HAS_VALID_SLOT(sprop, scope)
-                             ? obj->lockAndGetSlot(cx, sprop->slot)
+                             ? obj->getSlotMT(cx, sprop->slot)
                              : JSVAL_VOID,
                              vp, wp->closure);
             if (ok) {
                 /*
                  * Create a pseudo-frame for the setter invocation so that any
                  * stack-walking security code under the setter will correctly
                  * identify the guilty party.  So that the watcher appears to
                  * be active to obj_eval and other such code, point frame.pc
@@ -841,17 +841,17 @@ JS_SetWatchPoint(JSContext *cx, JSObject
 
     /*
      * If, by unwrapping and innerizing, we changed the object, check
      * again to make sure that we're allowed to set a watch point.
      */
     if (origobj != obj && !obj->checkAccess(cx, propid, JSACC_WATCH, &v, &attrs))
         return JS_FALSE;
 
-    if (!OBJ_IS_NATIVE(obj)) {
+    if (!obj->isNative()) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CANT_WATCH,
                              OBJ_GET_CLASS(cx, obj)->name);
         return JS_FALSE;
     }
 
     if (!js_LookupProperty(cx, obj, propid, &pobj, &prop))
         return JS_FALSE;
     sprop = (JSScopeProperty *) prop;
@@ -869,17 +869,17 @@ JS_SetWatchPoint(JSContext *cx, JSObject
         }
     } else if (pobj != obj) {
         /* Clone the prototype property so we can watch the right object. */
         jsval value;
         JSPropertyOp getter, setter;
         uintN attrs, flags;
         intN shortid;
 
-        if (OBJ_IS_NATIVE(pobj)) {
+        if (pobj->isNative()) {
             value = SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(pobj))
                     ? LOCKED_OBJ_GET_SLOT(pobj, sprop->slot)
                     : JSVAL_VOID;
             getter = sprop->getter();
             setter = sprop->setter();
             attrs = sprop->attributes();
             flags = sprop->getFlags();
             shortid = sprop->shortid;
@@ -1237,17 +1237,17 @@ JS_GetFrameFunction(JSContext *cx, JSSta
 }
 
 JS_PUBLIC_API(JSObject *)
 JS_GetFrameFunctionObject(JSContext *cx, JSStackFrame *fp)
 {
     if (!fp->fun)
         return NULL;
 
-    JS_ASSERT(HAS_FUNCTION_CLASS(fp->callee()));
+    JS_ASSERT(fp->callee()->isFunction());
     JS_ASSERT(fp->callee()->getPrivate() == fp->fun);
     return fp->callee();
 }
 
 JS_PUBLIC_API(JSBool)
 JS_IsConstructorFrame(JSContext *cx, JSStackFrame *fp)
 {
     return (fp->flags & JSFRAME_CONSTRUCTING) != 0;
@@ -1496,17 +1496,17 @@ JS_GetPropertyDescArray(JSContext *cx, J
 {
     JSClass *clasp;
     JSScope *scope;
     uint32 i, n;
     JSPropertyDesc *pd;
     JSScopeProperty *sprop;
 
     clasp = OBJ_GET_CLASS(cx, obj);
-    if (!OBJ_IS_NATIVE(obj) || (clasp->flags & JSCLASS_NEW_ENUMERATE)) {
+    if (!obj->isNative() || (clasp->flags & JSCLASS_NEW_ENUMERATE)) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
                              JSMSG_CANT_DESCRIBE_PROPS, clasp->name);
         return JS_FALSE;
     }
     if (!clasp->enumerate(cx, obj))
         return JS_FALSE;
 
     /* have no props, or object's scope has not mutated from that of proto */
@@ -1647,17 +1647,17 @@ JS_GetObjectTotalSize(JSContext *cx, JSO
     size_t nbytes;
     JSScope *scope;
 
     nbytes = sizeof *obj;
     if (obj->dslots) {
         nbytes += ((uint32)obj->dslots[-1] - JS_INITIAL_NSLOTS + 1)
                   * sizeof obj->dslots[0];
     }
-    if (OBJ_IS_NATIVE(obj)) {
+    if (obj->isNative()) {
         scope = OBJ_SCOPE(obj);
         if (!scope->isSharedEmpty()) {
             nbytes += sizeof *scope;
             nbytes += SCOPE_CAPACITY(scope) * sizeof(JSScopeProperty *);
         }
     }
     return nbytes;
 }
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -2453,17 +2453,17 @@ js_InitFunctionClass(JSContext *cx, JSOb
 
 JSFunction *
 js_NewFunction(JSContext *cx, JSObject *funobj, JSNative native, uintN nargs,
                uintN flags, JSObject *parent, JSAtom *atom)
 {
     JSFunction *fun;
 
     if (funobj) {
-        JS_ASSERT(HAS_FUNCTION_CLASS(funobj));
+        JS_ASSERT(funobj->isFunction());
         funobj->setParent(parent);
     } else {
         funobj = js_NewObject(cx, &js_FunctionClass, NULL, parent);
         if (!funobj)
             return NULL;
     }
     JS_ASSERT(!funobj->getPrivate());
     fun = (JSFunction *) funobj;
--- a/js/src/jsfun.h
+++ b/js/src/jsfun.h
@@ -243,43 +243,41 @@ extern const uint32 CALL_CLASS_FIXED_RES
 extern JS_FRIEND_DATA(JSClass) js_FunctionClass;
 
 inline bool
 JSObject::isFunction() const
 {
     return getClass() == &js_FunctionClass;
 }
 
-#define HAS_FUNCTION_CLASS(obj) (obj)->isFunction()
-
 /*
  * NB: jsapi.h and jsobj.h must be included before any call to this macro.
  */
 #define VALUE_IS_FUNCTION(cx, v)                                              \
-    (!JSVAL_IS_PRIMITIVE(v) && HAS_FUNCTION_CLASS(JSVAL_TO_OBJECT(v)))
+    (!JSVAL_IS_PRIMITIVE(v) && JSVAL_TO_OBJECT(v)->isFunction())
 
 /*
  * Macro to access the private slot of the function object after the slot is
  * initialized.
  */
 #define GET_FUNCTION_PRIVATE(cx, funobj)                                      \
-    (JS_ASSERT(HAS_FUNCTION_CLASS(funobj)),                                   \
+    (JS_ASSERT((funobj)->isFunction()),                                       \
      (JSFunction *) (funobj)->getPrivate())
 
 namespace js {
 
 /*
  * Return true if this is a compiler-created internal function accessed by
  * its own object. Such a function object must not be accessible to script
  * or embedding code.
  */
 inline bool
 IsInternalFunctionObject(JSObject *funobj)
 {
-    JS_ASSERT(HAS_FUNCTION_CLASS(funobj));
+    JS_ASSERT(funobj->isFunction());
     JSFunction *fun = (JSFunction *) funobj->getPrivate();
     return funobj == fun && (fun->flags & JSFUN_LAMBDA) && !funobj->getParent();
 }
     
 struct ArgsPrivateNative;
 
 inline ArgsPrivateNative *
 GetArgsPrivateNative(JSObject *argsobj)
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -2545,17 +2545,17 @@ FinalizeObject(JSContext *cx, JSObject *
     if (clasp->finalize)
         clasp->finalize(cx, obj);
 
 #ifdef INCLUDE_MOZILLA_DTRACE
     if (JAVASCRIPT_OBJECT_FINALIZE_ENABLED())
         jsdtrace_object_finalize(obj);
 #endif
 
-    if (JS_LIKELY(OBJ_IS_NATIVE(obj))) {
+    if (JS_LIKELY(obj->isNative())) {
         JSScope *scope = OBJ_SCOPE(obj);
         if (scope->isSharedEmpty())
             static_cast<JSEmptyScope *>(scope)->dropFromGC(cx);
         else
             scope->destroy(cx);
     }
     if (obj->hasSlotsArray())
         obj->freeSlotsArray(cx);
--- a/js/src/jslock.cpp
+++ b/js/src/jslock.cpp
@@ -1308,17 +1308,17 @@ js_DropAllEmptyScopeLocks(JSContext *cx,
 }
 
 void
 js_LockObj(JSContext *cx, JSObject *obj)
 {
     JSScope *scope;
     JSTitle *title;
 
-    JS_ASSERT(OBJ_IS_NATIVE(obj));
+    JS_ASSERT(obj->isNative());
 
     /*
      * We must test whether the GC is calling and return without mutating any
      * state, especially cx->lockedSealedScope.  Note asymmetry with respect to
      * js_UnlockObj, which is a thin-layer on top of js_UnlockTitle.
      */
     if (CX_THREAD_IS_RUNNING_GC(cx))
         return;
@@ -1340,17 +1340,17 @@ js_LockObj(JSContext *cx, JSObject *obj)
         /* Lost a race with a mutator; retry with obj's new scope. */
         js_UnlockTitle(cx, title);
     }
 }
 
 void
 js_UnlockObj(JSContext *cx, JSObject *obj)
 {
-    JS_ASSERT(OBJ_IS_NATIVE(obj));
+    JS_ASSERT(obj->isNative());
     js_UnlockTitle(cx, &OBJ_SCOPE(obj)->title);
 }
 
 void
 js_InitTitle(JSContext *cx, JSTitle *title)
 {
 #ifdef JS_THREADSAFE
     title->ownercx = cx;
--- a/js/src/jslock.h
+++ b/js/src/jslock.h
@@ -144,18 +144,18 @@ struct JSTitle {
 #define JS_LOCK(cx, tl)             js_Lock(cx, tl)
 #define JS_UNLOCK(cx, tl)           js_Unlock(cx, tl)
 
 #define JS_LOCK_RUNTIME(rt)         js_LockRuntime(rt)
 #define JS_UNLOCK_RUNTIME(rt)       js_UnlockRuntime(rt)
 
 /*
  * NB: The JS_LOCK_OBJ and JS_UNLOCK_OBJ macros work *only* on native objects
- * (objects for which OBJ_IS_NATIVE returns true).  All uses of these macros in
- * the engine are predicated on OBJ_IS_NATIVE or equivalent checks.  These uses
+ * (objects for which obj->isNative() returns true).  All uses of these macros in
+ * the engine are predicated on obj->isNative or equivalent checks.  These uses
  * are for optimizations above the JSObjectOps layer, under which object locks
  * normally hide.
  */
 #define CX_OWNS_SCOPE_TITLE(cx,scope)   ((scope)->title.ownercx == (cx))
 
 #define JS_LOCK_OBJ(cx,obj)       (CX_OWNS_SCOPE_TITLE(cx, OBJ_SCOPE(obj))    \
                                    ? (void)0                                  \
                                    : (js_LockObj(cx, obj),                    \
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -246,31 +246,31 @@ obj_setSlot(JSContext *cx, JSObject *obj
 JSBool
 js_SetProtoOrParent(JSContext *cx, JSObject *obj, uint32 slot, JSObject *pobj,
                     JSBool checkForCycles)
 {
     JS_ASSERT(slot == JSSLOT_PARENT || slot == JSSLOT_PROTO);
     JS_ASSERT_IF(!checkForCycles, obj != pobj);
 
     if (slot == JSSLOT_PROTO) {
-        if (OBJ_IS_NATIVE(obj)) {
+        if (obj->isNative()) {
             JS_LOCK_OBJ(cx, obj);
             bool ok = !!js_GetMutableScope(cx, obj);
             JS_UNLOCK_OBJ(cx, obj);
             if (!ok)
                 return JS_FALSE;
         }
 
         /*
          * Regenerate property cache shape ids for all of the scopes along the
          * old prototype chain to invalidate their property cache entries, in
          * case any entries were filled by looking up through obj.
          */
         JSObject *oldproto = obj;
-        while (oldproto && OBJ_IS_NATIVE(oldproto)) {
+        while (oldproto && oldproto->isNative()) {
             JS_LOCK_OBJ(cx, oldproto);
             JSScope *scope = OBJ_SCOPE(oldproto);
             scope->protoShapeChange(cx);
             JSObject *tmp = oldproto->getProto();
             JS_UNLOCK_OBJ(cx, oldproto);
             oldproto = tmp;
         }
     }
@@ -370,17 +370,17 @@ MarkSharpObjects(JSContext *cx, JSObject
 #if JS_HAS_GETTER_SETTER
             ok = obj->lookupProperty(cx, id, &obj2, &prop);
             if (!ok)
                 break;
             if (!prop)
                 continue;
             ok = obj2->getAttributes(cx, id, prop, &attrs);
             if (ok) {
-                if (OBJ_IS_NATIVE(obj2) &&
+                if (obj2->isNative() &&
                     (attrs & (JSPROP_GETTER | JSPROP_SETTER))) {
                     JSScopeProperty *sprop = (JSScopeProperty *) prop;
                     val = JSVAL_VOID;
                     if (attrs & JSPROP_GETTER)
                         val = sprop->getterValue();
                     if (attrs & JSPROP_SETTER) {
                         if (val != JSVAL_VOID) {
                             /* Mark the getter, then set val to setter. */
@@ -733,17 +733,17 @@ obj_toSource(JSContext *cx, uintN argc, 
 
         valcnt = 0;
         if (prop) {
             ok = obj2->getAttributes(cx, id, prop, &attrs);
             if (!ok) {
                 obj2->dropProperty(cx, prop);
                 goto error;
             }
-            if (OBJ_IS_NATIVE(obj2) &&
+            if (obj2->isNative() &&
                 (attrs & (JSPROP_GETTER | JSPROP_SETTER))) {
                 JSScopeProperty *sprop = (JSScopeProperty *) prop;
                 if (attrs & JSPROP_GETTER) {
                     val[valcnt] = sprop->getterValue();
                     gsopold[valcnt] =
                         ATOM_TO_STRING(cx->runtime->atomState.getterAtom);
                     gsop[valcnt] =
                         ATOM_TO_STRING(cx->runtime->atomState.getAtom);
@@ -1658,17 +1658,17 @@ js_HasOwnProperty(JSContext *cx, JSLooku
         outer = NULL;
     } else {
         outer = xclasp->outerObject(cx, *objp);
         if (!outer)
             return false;
     }
 
     if (outer != *objp) {
-        if (OBJ_IS_NATIVE(*objp) && obj->getClass() == clasp) {
+        if ((*objp)->isNative() && obj->getClass() == clasp) {
             /*
              * The combination of JSPROP_SHARED and JSPROP_PERMANENT in a
              * delegated property makes that property appear to be direct in
              * all delegating instances of the same native class.  This hack
              * avoids bloating every function instance with its own 'length'
              * (AKA 'arity') property.  But it must not extend across class
              * boundaries, to avoid making hasOwnProperty lie (bug 320854).
              *
@@ -1778,17 +1778,17 @@ js_PropertyIsEnumerable(JSContext *cx, J
      * obviously by fixing this method (not by breaking the for..in loop!).
      *
      * We check here for shared permanent prototype properties, which should
      * be treated as if they are local to obj.  They are an implementation
      * technique used to satisfy ECMA requirements; users should not be able
      * to distinguish a shared permanent proto-property from a local one.
      */
     if (pobj != obj &&
-        !(OBJ_IS_NATIVE(pobj) &&
+        !(pobj->isNative() &&
           ((JSScopeProperty *)prop)->isSharedPermanent())) {
         pobj->dropProperty(cx, prop);
         *vp = JSVAL_FALSE;
         return JS_TRUE;
     }
 
     ok = pobj->getAttributes(cx, id, prop, &attrs);
     pobj->dropProperty(cx, prop);
@@ -1874,17 +1874,17 @@ obj_lookupGetter(JSContext *cx, uintN ar
 
     if (!JS_ValueToId(cx, argc != 0 ? vp[2] : JSVAL_VOID, &id))
         return JS_FALSE;
     obj = JS_THIS_OBJECT(cx, vp);
     if (!obj || !obj->lookupProperty(cx, id, &pobj, &prop))
         return JS_FALSE;
     *vp = JSVAL_VOID;
     if (prop) {
-        if (OBJ_IS_NATIVE(pobj)) {
+        if (pobj->isNative()) {
             sprop = (JSScopeProperty *) prop;
             if (sprop->hasGetterValue())
                 *vp = sprop->getterValue();
         }
         pobj->dropProperty(cx, prop);
     }
     return JS_TRUE;
 }
@@ -1899,17 +1899,17 @@ obj_lookupSetter(JSContext *cx, uintN ar
 
     if (!JS_ValueToId(cx, argc != 0 ? vp[2] : JSVAL_VOID, &id))
         return JS_FALSE;
     obj = JS_THIS_OBJECT(cx, vp);
     if (!obj || !obj->lookupProperty(cx, id, &pobj, &prop))
         return JS_FALSE;
     *vp = JSVAL_VOID;
     if (prop) {
-        if (OBJ_IS_NATIVE(pobj)) {
+        if (pobj->isNative()) {
             sprop = (JSScopeProperty *) prop;
             if (sprop->hasSetterValue())
                 *vp = sprop->setterValue();
         }
         pobj->dropProperty(cx, prop);
     }
     return JS_TRUE;
 }
@@ -1957,17 +1957,17 @@ js_GetOwnPropertyDescriptor(JSContext *c
     if (!pobj->getAttributes(cx, id, prop, &attrs)) {
         pobj->dropProperty(cx, prop);
         return false;
     }
 
     jsval roots[] = { JSVAL_VOID, JSVAL_VOID };
     AutoArrayRooter tvr(cx, JS_ARRAY_LENGTH(roots), roots);
     if (attrs & (JSPROP_GETTER | JSPROP_SETTER)) {
-        if (OBJ_IS_NATIVE(obj)) {
+        if (obj->isNative()) {
             JSScopeProperty *sprop = reinterpret_cast<JSScopeProperty *>(prop);
             if (attrs & JSPROP_GETTER)
                 roots[0] = sprop->getterValue();
             if (attrs & JSPROP_SETTER)
                 roots[1] = sprop->setterValue();
         }
 
         pobj->dropProperty(cx, prop);
@@ -2553,17 +2553,17 @@ DefinePropertyArray(JSContext *cx, JSObj
 
 static JSBool
 DefineProperty(JSContext *cx, JSObject *obj, const PropertyDescriptor &desc, bool throwError,
                bool *rval)
 {
     if (obj->isArray())
         return DefinePropertyArray(cx, obj, desc, throwError, rval);
 
-    if (!OBJ_IS_NATIVE(obj))
+    if (!obj->isNative())
         return Reject(cx, JSMSG_OBJECT_NOT_EXTENSIBLE, throwError, rval);
 
     return DefinePropertyObject(cx, obj, desc, throwError, rval);
 }
 
 JSBool
 js_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id, jsval descriptor, JSBool *bp)
 {
@@ -2783,17 +2783,17 @@ InitScopeForObject(JSContext* cx, JSObje
 {
     JS_ASSERT(ops->isNative());
     JS_ASSERT(proto == obj->getProto());
 
     /* Share proto's emptyScope only if obj is similar to proto. */
     JSClass *clasp = OBJ_GET_CLASS(cx, obj);
     JSScope *scope = NULL;
 
-    if (proto && OBJ_IS_NATIVE(proto)) {
+    if (proto && proto->isNative()) {
         JS_LOCK_OBJ(cx, proto);
         scope = OBJ_SCOPE(proto);
         if (scope->canProvideEmptyScope(ops, clasp)) {
             JSScope *emptyScope = scope->getEmptyScope(cx, clasp);
             JS_UNLOCK_SCOPE(cx, scope);
             if (!emptyScope)
                 goto bad;
             scope = emptyScope;
@@ -3023,17 +3023,17 @@ NewNativeObject(JSContext* cx, JSClass* 
 
     obj->init(clasp, proto, parent, privateSlotValue);
     return InitScopeForObject(cx, obj, proto, &js_ObjectOps) ? obj : NULL;
 }
 
 JSObject* FASTCALL
 js_NewInstance(JSContext *cx, JSClass *clasp, JSObject *ctor)
 {
-    JS_ASSERT(HAS_FUNCTION_CLASS(ctor));
+    JS_ASSERT(ctor->isFunction());
 
     JSAtom *atom = cx->runtime->atomState.classPrototypeAtom;
 
     JSScope *scope = OBJ_SCOPE(ctor);
 #ifdef JS_THREADSAFE
     if (scope->title.ownercx != cx)
         return NULL;
 #endif
@@ -3897,17 +3897,17 @@ js_ShrinkSlots(JSContext *cx, JSObject *
         *slots++ = nslots;
         obj->dslots = slots;
     }
 }
 
 bool
 js_EnsureReservedSlots(JSContext *cx, JSObject *obj, size_t nreserved)
 {
-    JS_ASSERT(OBJ_IS_NATIVE(obj));
+    JS_ASSERT(obj->isNative());
     JS_ASSERT(!obj->dslots);
 
     uintN nslots = JSSLOT_FREE(obj->getClass()) + nreserved;
     if (nslots > obj->numSlots() && !AllocSlots(cx, obj, nslots))
         return false;
 
     JSScope *scope = OBJ_SCOPE(obj);
     if (!scope->isSharedEmpty()) {
@@ -4057,24 +4057,24 @@ js_FindClassObject(JSContext *cx, JSObje
         id = ATOM_TO_JSID(cx->runtime->atomState.classAtoms[protoKey]);
     } else {
         JSAtom *atom = js_Atomize(cx, clasp->name, strlen(clasp->name), 0);
         if (!atom)
             return false;
         id = ATOM_TO_JSID(atom);
     }
 
-    JS_ASSERT(OBJ_IS_NATIVE(obj));
+    JS_ASSERT(obj->isNative());
     if (js_LookupPropertyWithFlags(cx, obj, id, JSRESOLVE_CLASSNAME,
                                    &pobj, &prop) < 0) {
         return JS_FALSE;
     }
     v = JSVAL_VOID;
     if (prop)  {
-        if (OBJ_IS_NATIVE(pobj)) {
+        if (pobj->isNative()) {
             sprop = (JSScopeProperty *) prop;
             if (SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(pobj))) {
                 v = LOCKED_OBJ_GET_SLOT(pobj, sprop->slot);
                 if (JSVAL_IS_PRIMITIVE(v))
                     v = JSVAL_VOID;
             }
         }
         pobj->dropProperty(cx, prop);
@@ -4253,17 +4253,17 @@ js_CheckForStringIndex(jsid id)
 
 static JSBool
 PurgeProtoChain(JSContext *cx, JSObject *obj, jsid id)
 {
     JSScope *scope;
     JSScopeProperty *sprop;
 
     while (obj) {
-        if (!OBJ_IS_NATIVE(obj)) {
+        if (!obj->isNative()) {
             obj = obj->getProto();
             continue;
         }
         JS_LOCK_OBJ(cx, obj);
         scope = OBJ_SCOPE(obj);
         sprop = scope->lookup(id);
         if (sprop) {
             PCMETER(JS_PROPERTY_CACHE(cx).pcpurges++);
@@ -4614,25 +4614,25 @@ js_LookupPropertyWithFlags(JSContext *cx
                     if (!ok)
                         goto cleanup;
 
                     JS_LOCK_OBJ(cx, obj);
                     if (obj2) {
                         /* Resolved: juggle locks and lookup id again. */
                         if (obj2 != obj) {
                             JS_UNLOCK_OBJ(cx, obj);
-                            if (OBJ_IS_NATIVE(obj2))
+                            if (obj2->isNative())
                                 JS_LOCK_OBJ(cx, obj2);
                         }
                         protoIndex = 0;
                         for (proto = start; proto && proto != obj2;
                              proto = proto->getProto()) {
                             protoIndex++;
                         }
-                        if (!OBJ_IS_NATIVE(obj2)) {
+                        if (!obj2->isNative()) {
                             /* Whoops, newresolve handed back a foreign obj2. */
                             JS_ASSERT(obj2 != obj);
                             ok = obj2->lookupProperty(cx, id, objp, propp);
                             if (!ok || *propp)
                                 goto cleanup;
                             JS_LOCK_OBJ(cx, obj2);
                         } else {
                             /*
@@ -4647,32 +4647,32 @@ js_LookupPropertyWithFlags(JSContext *cx
                             if (!scope->isSharedEmpty())
                                 sprop = scope->lookup(id);
                         }
                         if (sprop) {
                             JS_ASSERT(scope == OBJ_SCOPE(obj2));
                             JS_ASSERT(!scope->isSharedEmpty());
                             obj = obj2;
                         } else if (obj2 != obj) {
-                            if (OBJ_IS_NATIVE(obj2))
+                            if (obj2->isNative())
                                 JS_UNLOCK_OBJ(cx, obj2);
                             JS_LOCK_OBJ(cx, obj);
                         }
                     }
                 } else {
                     /*
                      * Old resolve always requires id re-lookup if obj owns
                      * its scope after resolve returns.
                      */
                     JS_UNLOCK_OBJ(cx, obj);
                     ok = resolve(cx, obj, ID_TO_VALUE(id));
                     if (!ok)
                         goto cleanup;
                     JS_LOCK_OBJ(cx, obj);
-                    JS_ASSERT(OBJ_IS_NATIVE(obj));
+                    JS_ASSERT(obj->isNative());
                     scope = OBJ_SCOPE(obj);
                     if (!scope->isSharedEmpty())
                         sprop = scope->lookup(id);
                 }
 
             cleanup:
                 js_StopResolving(cx, &key, JSRESFLAG_LOOKUP, entry, generation);
                 if (!ok)
@@ -4690,17 +4690,17 @@ js_LookupPropertyWithFlags(JSContext *cx
             *propp = (JSProperty *) sprop;
             return protoIndex;
         }
 
         proto = obj->getProto();
         JS_UNLOCK_OBJ(cx, obj);
         if (!proto)
             break;
-        if (!OBJ_IS_NATIVE(proto)) {
+        if (!proto->isNative()) {
             if (!proto->lookupProperty(cx, id, objp, propp))
                 return -1;
             return protoIndex + 1;
         }
 
         /*
          * Correctness elsewhere (the property cache and JIT), not here in
          * particular, depends on all the objects on the prototype chain having
@@ -4748,17 +4748,17 @@ js_FindPropertyHelper(JSContext *cx, jsi
                                        &pobj, &prop);
         if (protoIndex < 0)
             return NULL;
 
         if (prop) {
 #ifdef DEBUG
             if (parent) {
                 JSClass *clasp = OBJ_GET_CLASS(cx, obj);
-                JS_ASSERT(OBJ_IS_NATIVE(pobj));
+                JS_ASSERT(pobj->isNative());
                 JS_ASSERT(OBJ_GET_CLASS(cx, pobj) == clasp);
                 if (clasp == &js_BlockClass) {
                     /*
                      * A block instance on the scope chain is immutable and
                      * the compile-time prototype provides all its properties.
                      */
                     JS_ASSERT(pobj == obj->getProto());
                     JS_ASSERT(protoIndex == 1);
@@ -4842,17 +4842,17 @@ js_FindIdentifierBase(JSContext *cx, JSO
         JSObject *pobj;
         JSProperty *prop;
         int protoIndex = js_LookupPropertyWithFlags(cx, obj, id,
                                                     cx->resolveFlags,
                                                     &pobj, &prop);
         if (protoIndex < 0)
             return NULL;
         if (prop) {
-            JS_ASSERT(OBJ_IS_NATIVE(pobj));
+            JS_ASSERT(pobj->isNative());
             JS_ASSERT(OBJ_GET_CLASS(cx, pobj) == OBJ_GET_CLASS(cx, obj));
 #ifdef DEBUG
             PropertyCacheEntry *entry =
 #endif
                 JS_PROPERTY_CACHE(cx).fill(cx, scopeChain, scopeIndex, protoIndex, pobj,
                                            (JSScopeProperty *) prop);
             JS_ASSERT(entry);
             JS_UNLOCK_OBJ(cx, pobj);
@@ -4894,17 +4894,17 @@ js_NativeGet(JSContext *cx, JSObject *ob
              JSScopeProperty *sprop, uintN getHow, jsval *vp)
 {
     LeaveTraceIfGlobalObject(cx, pobj);
 
     JSScope *scope;
     uint32 slot;
     int32 sample;
 
-    JS_ASSERT(OBJ_IS_NATIVE(pobj));
+    JS_ASSERT(pobj->isNative());
     JS_ASSERT(JS_IS_OBJ_LOCKED(cx, pobj));
     scope = OBJ_SCOPE(pobj);
 
     slot = sprop->slot;
     *vp = (slot != SPROP_INVALID_SLOT)
           ? LOCKED_OBJ_GET_SLOT(pobj, slot)
           : JSVAL_VOID;
     if (sprop->hasDefaultGetter())
@@ -4944,17 +4944,17 @@ js_NativeSet(JSContext *cx, JSObject *ob
              jsval *vp)
 {
     LeaveTraceIfGlobalObject(cx, obj);
 
     JSScope *scope;
     uint32 slot;
     int32 sample;
 
-    JS_ASSERT(OBJ_IS_NATIVE(obj));
+    JS_ASSERT(obj->isNative());
     JS_ASSERT(JS_IS_OBJ_LOCKED(cx, obj));
     scope = OBJ_SCOPE(obj);
 
     slot = sprop->slot;
     if (slot != SPROP_INVALID_SLOT) {
         OBJ_CHECK_SLOT(obj, slot);
 
         /* If sprop has a stub setter, keep scope locked and just store *vp. */
@@ -5075,17 +5075,17 @@ js_GetPropertyHelper(JSContext *cx, JSOb
                                           JSDVG_IGNORE_STACK, ID_TO_VALUE(id),
                                           NULL, NULL, NULL)) {
                 return JS_FALSE;
             }
         }
         return JS_TRUE;
     }
 
-    if (!OBJ_IS_NATIVE(obj2)) {
+    if (!obj2->isNative()) {
         obj2->dropProperty(cx, prop);
         return obj2->getProperty(cx, id, vp);
     }
 
     sprop = (JSScopeProperty *) prop;
 
     if (getHow & JSGET_CACHE_RESULT) {
         JS_ASSERT_NOT_ON_TRACE(cx);
@@ -5189,17 +5189,17 @@ js_SetPropertyHelper(JSContext *cx, JSOb
         goto read_only_error;
     }
 
     protoIndex = js_LookupPropertyWithFlags(cx, obj, id, cx->resolveFlags,
                                             &pobj, &prop);
     if (protoIndex < 0)
         return JS_FALSE;
     if (prop) {
-        if (!OBJ_IS_NATIVE(pobj)) {
+        if (!pobj->isNative()) {
             pobj->dropProperty(cx, prop);
             prop = NULL;
         }
     } else {
         /* We should never add properties to lexical blocks.  */
         JS_ASSERT(OBJ_GET_CLASS(cx, obj) != &js_BlockClass);
 
         if (!obj->getParent() && !js_CheckUndeclaredVarAssignment(cx))
@@ -5411,17 +5411,17 @@ js_GetAttributes(JSContext *cx, JSObject
     noprop = !prop;
     if (noprop) {
         if (!js_LookupProperty(cx, obj, id, &obj, &prop))
             return JS_FALSE;
         if (!prop) {
             *attrsp = 0;
             return JS_TRUE;
         }
-        if (!OBJ_IS_NATIVE(obj)) {
+        if (!obj->isNative()) {
             ok = obj->getAttributes(cx, id, prop, attrsp);
             obj->dropProperty(cx, prop);
             return ok;
         }
     }
     sprop = (JSScopeProperty *)prop;
     *attrsp = sprop->attributes();
     if (noprop)
@@ -5437,17 +5437,17 @@ js_SetAttributes(JSContext *cx, JSObject
     JSScopeProperty *sprop;
 
     noprop = !prop;
     if (noprop) {
         if (!js_LookupProperty(cx, obj, id, &obj, &prop))
             return JS_FALSE;
         if (!prop)
             return JS_TRUE;
-        if (!OBJ_IS_NATIVE(obj)) {
+        if (!obj->isNative()) {
             ok = obj->setAttributes(cx, id, prop, attrsp);
             obj->dropProperty(cx, prop);
             return ok;
         }
     }
     sprop = (JSScopeProperty *)prop;
     sprop = js_ChangeNativePropertyAttrs(cx, obj, sprop, *attrsp, 0,
                                          sprop->getter(), sprop->setter());
@@ -5475,17 +5475,17 @@ js_DeleteProperty(JSContext *cx, JSObjec
     if (!prop || proto != obj) {
         /*
          * If the property was found in a native prototype, check whether it's
          * shared and permanent.  Such a property stands for direct properties
          * in all delegating objects, matching ECMA semantics without bloating
          * each delegating object.
          */
         if (prop) {
-            if (OBJ_IS_NATIVE(proto)) {
+            if (proto->isNative()) {
                 sprop = (JSScopeProperty *)prop;
                 if (sprop->isSharedPermanent())
                     *rval = JSVAL_FALSE;
             }
             proto->dropProperty(cx, prop);
             if (*rval == JSVAL_FALSE)
                 return JS_TRUE;
         }
@@ -5915,17 +5915,17 @@ js_CheckAccess(JSContext *cx, JSObject *
         if (!prop) {
             if (!writing)
                 *vp = JSVAL_VOID;
             *attrsp = 0;
             pobj = obj;
             break;
         }
 
-        if (!OBJ_IS_NATIVE(pobj)) {
+        if (!pobj->isNative()) {
             pobj->dropProperty(cx, prop);
 
             /* Avoid diverging for non-natives that reuse js_CheckAccess. */
             if (pobj->map->ops->checkAccess == js_CheckAccess) {
                 if (!writing) {
                     *vp = JSVAL_VOID;
                     *attrsp = 0;
                 }
@@ -6511,17 +6511,17 @@ js_PrintObjectSlotName(JSTracer *trc, ch
 {
     JS_ASSERT(trc->debugPrinter == js_PrintObjectSlotName);
 
     JSObject *obj = (JSObject *)trc->debugPrintArg;
     uint32 slot = (uint32)trc->debugPrintIndex;
     JS_ASSERT(slot >= JSSLOT_START(obj->getClass()));
 
     JSScopeProperty *sprop;
-    if (OBJ_IS_NATIVE(obj)) {
+    if (obj->isNative()) {
         JSScope *scope = OBJ_SCOPE(obj);
         sprop = scope->lastProperty();
         while (sprop && sprop->slot != slot)
             sprop = sprop->parent;
     } else {
         sprop = NULL;
     }
 
@@ -6551,17 +6551,17 @@ js_PrintObjectSlotName(JSTracer *trc, ch
         }
     }
 }
 #endif
 
 void
 js_TraceObject(JSTracer *trc, JSObject *obj)
 {
-    JS_ASSERT(OBJ_IS_NATIVE(obj));
+    JS_ASSERT(obj->isNative());
 
     JSContext *cx = trc->context;
     JSScope *scope = OBJ_SCOPE(obj);
     if (!scope->isSharedEmpty() && IS_GC_MARKING_TRACER(trc)) {
         /*
          * Check whether we should shrink the object's slots. Skip this check
          * if the scope is shared, since for Block objects and flat closures
          * that share their scope, scope->freeslot can be an underestimate.
@@ -6658,17 +6658,17 @@ ReservedSlotIndexOK(JSContext *cx, JSObj
         return false;
     }
     return true;
 }
 
 bool
 js_GetReservedSlot(JSContext *cx, JSObject *obj, uint32 index, jsval *vp)
 {
-    if (!OBJ_IS_NATIVE(obj)) {
+    if (!obj->isNative()) {
         *vp = JSVAL_VOID;
         return true;
     }
 
     JSClass *clasp = obj->getClass();
     uint32 limit = JSCLASS_RESERVED_SLOTS(clasp);
 
     JS_LOCK_OBJ(cx, obj);
@@ -6679,17 +6679,17 @@ js_GetReservedSlot(JSContext *cx, JSObje
     *vp = (slot < obj->numSlots()) ? obj->getSlot(slot) : JSVAL_VOID;
     JS_UNLOCK_OBJ(cx, obj);
     return true;
 }
 
 bool
 js_SetReservedSlot(JSContext *cx, JSObject *obj, uint32 index, jsval v)
 {
-    if (!OBJ_IS_NATIVE(obj))
+    if (!obj->isNative())
         return true;
 
     JSClass *clasp = OBJ_GET_CLASS(cx, obj);
     uint32 limit = JSCLASS_RESERVED_SLOTS(clasp);
 
     JS_LOCK_OBJ(cx, obj);
     if (index >= limit && !ReservedSlotIndexOK(cx, obj, clasp, index, limit))
         return false;
@@ -6847,17 +6847,17 @@ js_DumpAtom(JSAtom *atom)
 void
 dumpValue(jsval val)
 {
     if (JSVAL_IS_NULL(val)) {
         fprintf(stderr, "null");
     } else if (JSVAL_IS_VOID(val)) {
         fprintf(stderr, "undefined");
     } else if (JSVAL_IS_OBJECT(val) &&
-               HAS_FUNCTION_CLASS(JSVAL_TO_OBJECT(val))) {
+               JSVAL_TO_OBJECT(val)->isFunction()) {
         JSObject *funobj = JSVAL_TO_OBJECT(val);
         JSFunction *fun = GET_FUNCTION_PRIVATE(cx, funobj);
         fprintf(stderr, "<%s %s at %p (JSFunction at %p)>",
                 fun->atom ? "function" : "unnamed",
                 fun->atom ? JS_GetStringBytes(ATOM_TO_STRING(fun->atom)) : "function",
                 (void *) funobj,
                 (void *) fun);
     } else if (JSVAL_IS_OBJECT(val)) {
@@ -6944,28 +6944,28 @@ js_DumpObject(JSObject *obj)
             fprintf(stderr, " %3d: ", i);
             dumpValue(obj->dslots[i]);
             fprintf(stderr, "\n");
             fflush(stderr);
         }
         return;
     }
 
-    if (OBJ_IS_NATIVE(obj)) {
+    if (obj->isNative()) {
         JSScope *scope = OBJ_SCOPE(obj);
         if (scope->sealed())
             fprintf(stderr, "sealed\n");
 
         fprintf(stderr, "properties:\n");
         for (JSScopeProperty *sprop = scope->lastProperty(); sprop;
              sprop = sprop->parent) {
             dumpScopeProp(sprop);
         }
     } else {
-        if (!OBJ_IS_NATIVE(obj))
+        if (!obj->isNative())
             fprintf(stderr, "not native\n");
     }
 
     fprintf(stderr, "proto ");
     dumpValue(OBJECT_TO_JSVAL(obj->getProto()));
     fputc('\n', stderr);
 
     fprintf(stderr, "parent ");
@@ -6975,17 +6975,17 @@ js_DumpObject(JSObject *obj)
     i = JSSLOT_PRIVATE;
     if (clasp->flags & JSCLASS_HAS_PRIVATE) {
         i = JSSLOT_PRIVATE + 1;
         fprintf(stderr, "private %p\n", obj->getPrivate());
     }
 
     fprintf(stderr, "slots:\n");
     reservedEnd = i + JSCLASS_RESERVED_SLOTS(clasp);
-    slots = (OBJ_IS_NATIVE(obj) && !OBJ_SCOPE(obj)->isSharedEmpty())
+    slots = (obj->isNative() && !OBJ_SCOPE(obj)->isSharedEmpty())
             ? OBJ_SCOPE(obj)->freeslot
             : obj->numSlots();
     for (; i < slots; i++) {
         fprintf(stderr, " %3d ", i);
         if (i < reservedEnd)
             fprintf(stderr, "(reserved) ");
         fprintf(stderr, "= ");
         dumpValue(obj->getSlot(i));
--- a/js/src/jsobj.h
+++ b/js/src/jsobj.h
@@ -307,23 +307,23 @@ struct JSObject {
             fslots[slot] = value;
         } else {
             JS_ASSERT(slot < (uint32)dslots[-1]);
             dslots[slot - JS_INITIAL_NSLOTS] = value;
         }
     }
 
     /*
-     * These ones are for multi-threaded objects.  Use getSlot(),
+     * These ones are for multi-threaded ("MT") objects.  Use getSlot(),
      * getSlotRef(), setSlot() to directly manipulate slots in obj when only
      * one thread can access obj, or when accessing read-only slots within
      * JS_INITIAL_NSLOTS.
      */
-    jsval lockAndGetSlot(JSContext *cx, uintN slot);
-    void lockAndSetSlot(JSContext *cx, uintN slot, jsval value);
+    inline jsval getSlotMT(JSContext *cx, uintN slot);
+    inline void setSlotMT(JSContext *cx, uintN slot, jsval value);
 
     JSObject *getProto() const {
         return JSVAL_TO_OBJECT(fslots[JSSLOT_PROTO]);
     }
 
     void clearProto() {
         fslots[JSSLOT_PROTO] = JSVAL_NULL;
     }
@@ -479,19 +479,16 @@ struct JSObject {
     inline bool isDenseArray() const;
     inline bool isFunction() const;
     inline bool isRegExp() const;
     inline bool isXML() const;
 
     inline bool unbrand(JSContext *cx);
 };
 
-/* Compatibility macro. */
-#define OBJ_IS_NATIVE(obj)              ((obj)->isNative())
-
 #define JSSLOT_START(clasp) (((clasp)->flags & JSCLASS_HAS_PRIVATE)           \
                              ? JSSLOT_PRIVATE + 1                             \
                              : JSSLOT_PRIVATE)
 
 #define JSSLOT_FREE(clasp)  (JSSLOT_START(clasp)                              \
                              + JSCLASS_RESERVED_SLOTS(clasp))
 
 /*
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -40,20 +40,20 @@
 
 #ifndef jsobjinlines_h___
 #define jsobjinlines_h___
 
 #include "jsobj.h"
 #include "jsscope.h"
 
 inline jsval
-JSObject::lockAndGetSlot(JSContext *cx, uintN slot) {
+JSObject::getSlotMT(JSContext *cx, uintN slot) {
 #ifdef JS_THREADSAFE
     /*
-     * If thread-safe, define a lockAndGetSlot() that bypasses, for a native
+     * If thread-safe, define a getSlotMT() that bypasses, for a native
      * object, the lock-free "fast path" test of
      * (OBJ_SCOPE(obj)->ownercx == cx), to avoid needlessly switching from
      * lock-free to lock-full scope when doing GC on a different context
      * from the last one to own the scope.  The caller in this case is
      * probably a JSClass.mark function, e.g., fun_mark, or maybe a
      * finalizer.
      */
     OBJ_CHECK_SLOT(this, slot);
@@ -61,17 +61,17 @@ JSObject::lockAndGetSlot(JSContext *cx, 
            ? LOCKED_OBJ_GET_SLOT(this, slot)
            : js_GetSlotThreadSafe(cx, this, slot);
 #else
     return LOCKED_OBJ_GET_SLOT(this, slot);
 #endif
 }
 
 inline void
-JSObject::lockAndSetSlot(JSContext *cx, uintN slot, jsval value) {
+JSObject::setSlotMT(JSContext *cx, uintN slot, jsval value) {
 #ifdef JS_THREADSAFE
     /* Thread-safe way to set a slot. */
     OBJ_CHECK_SLOT(this, slot);
     if (OBJ_SCOPE(this)->title.ownercx == cx)
         LOCKED_OBJ_SET_SLOT(this, slot, value);
     else
         js_SetSlotThreadSafe(cx, this, slot, value);
 #else
@@ -97,17 +97,17 @@ JSObject::freeSlotsArray(JSContext *cx)
     JS_ASSERT(hasSlotsArray());
     JS_ASSERT(size_t(dslots[-1]) > JS_INITIAL_NSLOTS);
     cx->free(dslots - 1);
 }
 
 inline bool
 JSObject::unbrand(JSContext *cx)
 {
-    if (OBJ_IS_NATIVE(this)) {
+    if (this->isNative()) {
         JS_LOCK_OBJ(cx, this);
         JSScope *scope = OBJ_SCOPE(this);
         if (scope->isSharedEmpty()) {
             scope = js_GetMutableScope(cx, this);
             if (!scope) {
                 JS_UNLOCK_OBJ(cx, this);
                 return false;
             }
--- a/js/src/jsops.cpp
+++ b/js/src/jsops.cpp
@@ -1395,29 +1395,29 @@ BEGIN_CASE(JSOP_GVARINC)
     METER_SLOT_OP(op, slot);
     lval = fp->slots[slot];
     if (JSVAL_IS_NULL(lval)) {
         op = op2;
         DO_OP();
     }
     slot = JSVAL_TO_INT(lval);
     JS_ASSERT(fp->varobj(cx) == cx->activeCallStack()->getInitialVarObj());
-    rval = cx->activeCallStack()->getInitialVarObj()->lockAndGetSlot(cx, slot);
+    rval = cx->activeCallStack()->getInitialVarObj()->getSlotMT(cx, slot);
     if (JS_LIKELY(CAN_DO_FAST_INC_DEC(rval))) {
         PUSH_OPND(rval + incr2);
         rval += incr;
     } else {
         PUSH_OPND(rval);
         PUSH_OPND(JSVAL_NULL);  /* Extra root */
         if (!js_DoIncDec(cx, &js_CodeSpec[op], &regs.sp[-2], &regs.sp[-1]))
             goto error;
         rval = regs.sp[-1];
         --regs.sp;
     }
-    fp->varobj(cx)->lockAndSetSlot(cx, slot, rval);
+    fp->varobj(cx)->setSlotMT(cx, slot, rval);
     len = JSOP_INCGVAR_LENGTH;  /* all gvar incops are same length */
     JS_ASSERT(len == js_CodeSpec[op].length);
     DO_NEXT_OP(len);
 }
 
 #define COMPUTE_THIS(cx, fp, obj)                                             \
     JS_BEGIN_MACRO                                                            \
         if (!(obj = (fp)->getThisObject(cx)))                                 \
@@ -1709,17 +1709,17 @@ BEGIN_CASE(JSOP_SETMETHOD)
              * in scope and call NATIVE_SET and break to get out of the
              * do-while(0). But we can call NATIVE_SET only if obj owns
              * scope or sprop is shared.
              */
             bool checkForAdd;
             if (!sprop->hasSlot()) {
                 if (entry->vcapTag() == 0 ||
                     ((obj2 = obj->getProto()) &&
-                     OBJ_IS_NATIVE(obj2) &&
+                     obj2->isNative() &&
                      OBJ_SHAPE(obj2) == entry->vshape())) {
                     goto fast_set_propcache_hit;
                 }
 
                 /* The cache entry doesn't apply. vshape mismatch. */
                 checkForAdd = false;
             } else if (!scope->isSharedEmpty()) {
                 if (sprop == scope->lastProperty() || scope->hasProperty(sprop)) {
@@ -2324,17 +2324,17 @@ BEGIN_CASE(JSOP_CALLNAME)
             PUSH_OPND(JSVAL_VOID);
             len = JSOP_NAME_LENGTH;
             DO_NEXT_OP(len);
         }
         goto atom_not_defined;
     }
 
     /* Take the slow path if prop was not found in a native object. */
-    if (!OBJ_IS_NATIVE(obj) || !OBJ_IS_NATIVE(obj2)) {
+    if (!obj->isNative() || !obj2->isNative()) {
         obj2->dropProperty(cx, prop);
         if (!obj->getProperty(cx, id, &rval))
             goto error;
     } else {
         sprop = (JSScopeProperty *)prop;
   do_native_get:
         NATIVE_GET(cx, obj, obj2, sprop, JSGET_METHOD_BARRIER, &rval);
         obj2->dropProperty(cx, (JSProperty *) sprop);
@@ -2743,17 +2743,17 @@ BEGIN_CASE(JSOP_CALLGVAR)
     lval = fp->slots[slot];
     if (JSVAL_IS_NULL(lval)) {
         op = (op == JSOP_GETGVAR) ? JSOP_NAME : JSOP_CALLNAME;
         DO_OP();
     }
     JS_ASSERT(fp->varobj(cx) == cx->activeCallStack()->getInitialVarObj());
     obj = cx->activeCallStack()->getInitialVarObj();
     slot = JSVAL_TO_INT(lval);
-    rval = obj->lockAndGetSlot(cx, slot);
+    rval = obj->getSlotMT(cx, slot);
     PUSH_OPND(rval);
     if (op == JSOP_CALLGVAR)
         PUSH_OPND(OBJECT_TO_JSVAL(obj));
 END_CASE(JSOP_GETGVAR)
 
 BEGIN_CASE(JSOP_SETGVAR)
     slot = GET_SLOTNO(regs.pc);
     JS_ASSERT(slot < GlobalVarCount(fp));
@@ -2836,17 +2836,17 @@ BEGIN_CASE(JSOP_DEFVAR)
      * Try to optimize a property we either just created, or found
      * directly in the global object, that is permanent, has a slot,
      * and has stub getter and setter, into a "fast global" accessed
      * by the JSOP_*GVAR opcodes.
      */
     if (!fp->fun &&
         index < GlobalVarCount(fp) &&
         obj2 == obj &&
-        OBJ_IS_NATIVE(obj)) {
+        obj->isNative()) {
         sprop = (JSScopeProperty *) prop;
         if (!sprop->configurable() &&
             SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(obj)) &&
             sprop->hasDefaultGetterOrIsMethod() &&
             sprop->hasDefaultSetter()) {
             /*
              * Fast globals use frame variables to map the global name's atom
              * index to the permanent varobj slot number, tagged as a jsval.
@@ -3360,17 +3360,17 @@ BEGIN_CASE(JSOP_INITMETHOD)
 {
     /* Load the property's initial value into rval. */
     JS_ASSERT(regs.sp - StackBase(fp) >= 2);
     rval = FETCH_OPND(-1);
 
     /* Load the object being initialized into lval/obj. */
     lval = FETCH_OPND(-2);
     obj = JSVAL_TO_OBJECT(lval);
-    JS_ASSERT(OBJ_IS_NATIVE(obj));
+    JS_ASSERT(obj->isNative());
     JS_ASSERT(!OBJ_GET_CLASS(cx, obj)->reserveSlots);
     JS_ASSERT(!(obj->getClass()->flags & JSCLASS_SHARE_ALL_PROPERTIES));
 
     JSScope *scope = OBJ_SCOPE(obj);
     PropertyCacheEntry *entry;
 
     /*
      * Probe the property cache. 
--- a/js/src/jsparse.cpp
+++ b/js/src/jsparse.cpp
@@ -218,17 +218,17 @@ JSCompiler::newObjectBox(JSObject *obj)
     objbox->object = obj;
     return objbox;
 }
 
 JSFunctionBox *
 JSCompiler::newFunctionBox(JSObject *obj, JSParseNode *fn, JSTreeContext *tc)
 {
     JS_ASSERT(obj);
-    JS_ASSERT(HAS_FUNCTION_CLASS(obj));
+    JS_ASSERT(obj->isFunction());
 
     /*
      * We use JSContext.tempPool to allocate parsed objects and place them on
      * a list in this JSCompiler to ensure GC safety. Thus the tempPool arenas
      * containing the entries must be alive until we are done with scanning,
      * parsing and code generation for the whole script or top-level function.
      */
     JSFunctionBox *funbox;
--- a/js/src/jspropertycache.cpp
+++ b/js/src/jspropertycache.cpp
@@ -103,17 +103,17 @@ PropertyCache::fill(JSContext *cx, JSObj
         for (;;) {
             tmp = tmp->getProto();
 
             /*
              * We cannot cache properties coming from native objects behind
              * non-native ones on the prototype chain. The non-natives can
              * mutate in arbitrary way without changing any shapes.
              */
-            if (!tmp || !OBJ_IS_NATIVE(tmp)) {
+            if (!tmp || !tmp->isNative()) {
                 PCMETER(noprotos++);
                 return JS_NO_PROP_CACHE_FILL;
             }
             if (tmp == pobj)
                 break;
             ++protoIndex;
         }
     }
@@ -235,17 +235,17 @@ PropertyCache::fill(JSContext *cx, JSObj
                 } else {
                     /*
                      * If obj had its own empty scope before, with a unique
                      * shape, that is lost. Here we only attempt to find a
                      * matching empty scope. In unusual cases involving
                      * __proto__ assignment we may not find one.
                      */
                     JSObject *proto = obj->getProto();
-                    if (!proto || !OBJ_IS_NATIVE(proto))
+                    if (!proto || !proto->isNative())
                         return JS_NO_PROP_CACHE_FILL;
                     JSScope *protoscope = OBJ_SCOPE(proto);
                     if (!protoscope->emptyScope ||
                         protoscope->emptyScope->clasp != obj->getClass()) {
                         return JS_NO_PROP_CACHE_FILL;
                     }
                     kshape = protoscope->emptyScope->shape;
                 }
@@ -369,28 +369,28 @@ PropertyCache::fullTest(JSContext *cx, j
      * cases. All others go here. We could embed the target object in the cache
      * entry but then entry size would be 5 words. Instead we traverse chains.
      */
     pobj = obj;
 
     if (JOF_MODE(cs.format) == JOF_NAME) {
         while (vcap & (PCVCAP_SCOPEMASK << PCVCAP_PROTOBITS)) {
             tmp = pobj->getParent();
-            if (!tmp || !OBJ_IS_NATIVE(tmp))
+            if (!tmp || !tmp->isNative())
                 break;
             pobj = tmp;
             vcap -= PCVCAP_PROTOSIZE;
         }
 
         *objp = pobj;
     }
 
     while (vcap & PCVCAP_PROTOMASK) {
         tmp = pobj->getProto();
-        if (!tmp || !OBJ_IS_NATIVE(tmp))
+        if (!tmp || !tmp->isNative())
             break;
         pobj = tmp;
         --vcap;
     }
 
     if (matchShape(cx, pobj, vcap >> PCVCAP_TAGBITS)) {
 #ifdef DEBUG
         JSAtom *atom = GetAtomFromBytecode(cx, pc, op, cs);
--- a/js/src/jsscope.cpp
+++ b/js/src/jsscope.cpp
@@ -1137,17 +1137,17 @@ JSScope::clear(JSContext *cx)
     clearOwnShape();
     LeaveTraceIfGlobalObject(cx, object);
 
     JSClass *clasp = object->getClass();
     JSObject *proto = object->getProto();
     JSEmptyScope *emptyScope;
     uint32 newShape;
     if (proto &&
-        OBJ_IS_NATIVE(proto) &&
+        proto->isNative() &&
         (emptyScope = OBJ_SCOPE(proto)->emptyScope) &&
         emptyScope->clasp == clasp) {
         newShape = emptyScope->shape;
     } else {
         newShape = js_GenerateShape(cx, false);
     }
     initMinimal(cx, newShape);
 
--- a/js/src/jsscriptinlines.h
+++ b/js/src/jsscriptinlines.h
@@ -45,17 +45,17 @@
 #include "jsopcode.h"
 #include "jsregexp.h"
 #include "jsscript.h"
 
 inline JSFunction *
 JSScript::getFunction(size_t index)
 {
     JSObject *funobj = getObject(index);
-    JS_ASSERT(HAS_FUNCTION_CLASS(funobj));
+    JS_ASSERT(funobj->isFunction());
     JS_ASSERT(funobj == (JSObject *) funobj->getPrivate());
     JSFunction *fun = (JSFunction *) funobj;
     JS_ASSERT(FUN_INTERPRETED(fun));
     return fun;
 }
 
 inline JSObject *
 JSScript::getRegExp(size_t index)
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -1032,17 +1032,17 @@ asInt32(jsval v)
 static inline TraceType
 GetPromotedType(jsval v)
 {
     if (JSVAL_IS_INT(v))
         return TT_DOUBLE;
     if (JSVAL_IS_OBJECT(v)) {
         if (JSVAL_IS_NULL(v))
             return TT_NULL;
-        if (HAS_FUNCTION_CLASS(JSVAL_TO_OBJECT(v)))
+        if (JSVAL_TO_OBJECT(v)->isFunction())
             return TT_FUNCTION;
         return TT_OBJECT;
     }
     /* N.B. void is JSVAL_SPECIAL. */
     if (JSVAL_IS_VOID(v))
         return TT_VOID;
     uint8_t tag = JSVAL_TAG(v);
     JS_ASSERT(tag == JSVAL_DOUBLE || tag == JSVAL_STRING || tag == JSVAL_SPECIAL);
@@ -1056,17 +1056,17 @@ GetPromotedType(jsval v)
 static inline TraceType
 getCoercedType(jsval v)
 {
     if (isInt32(v))
         return TT_INT32;
     if (JSVAL_IS_OBJECT(v)) {
         if (JSVAL_IS_NULL(v))
             return TT_NULL;
-        if (HAS_FUNCTION_CLASS(JSVAL_TO_OBJECT(v)))
+        if (JSVAL_TO_OBJECT(v)->isFunction())
             return TT_FUNCTION;
         return TT_OBJECT;
     }
     /* N.B. void is JSVAL_SPECIAL. */
     if (JSVAL_IS_VOID(v))
         return TT_VOID;
     uint8_t tag = JSVAL_TAG(v);
     JS_ASSERT(tag == JSVAL_DOUBLE || tag == JSVAL_STRING || tag == JSVAL_SPECIAL);
@@ -2561,17 +2561,17 @@ TraceRecorder::trackNativeStackUse(unsig
  */
 static void
 ValueToNative(JSContext* cx, jsval v, TraceType type, double* slot)
 {
     uint8_t tag = JSVAL_TAG(v);
     switch (type) {
       case TT_OBJECT:
         JS_ASSERT(tag == JSVAL_OBJECT);
-        JS_ASSERT(!JSVAL_IS_NULL(v) && !HAS_FUNCTION_CLASS(JSVAL_TO_OBJECT(v)));
+        JS_ASSERT(!JSVAL_IS_NULL(v) && !JSVAL_TO_OBJECT(v)->isFunction());
         *(JSObject**)slot = JSVAL_TO_OBJECT(v);
         debug_only_printf(LC_TMTracer,
                           "object<%p:%s> ", (void*)JSVAL_TO_OBJECT(v),
                           JSVAL_IS_NULL(v)
                           ? "null"
                           : JSVAL_TO_OBJECT(v)->getClass()->name);
         return;
 
@@ -2800,17 +2800,17 @@ NativeToValue(JSContext* cx, jsval& v, T
         break;
 
       case TT_VOID:
         v = JSVAL_VOID;
         debug_only_print0(LC_TMTracer, "undefined ");
         break;
 
       case TT_FUNCTION: {
-        JS_ASSERT(HAS_FUNCTION_CLASS(*(JSObject**)slot));
+        JS_ASSERT((*(JSObject**)slot)->isFunction());
         v = OBJECT_TO_JSVAL(*(JSObject**)slot);
 #ifdef DEBUG
         JSFunction* fun = GET_FUNCTION_PRIVATE(cx, JSVAL_TO_OBJECT(v));
         debug_only_printf(LC_TMTracer,
                           "function<%p:%s> ", (void*)JSVAL_TO_OBJECT(v),
                           fun->atom
                           ? JS_GetStringBytes(ATOM_TO_STRING(fun->atom))
                           : "unnamed");
@@ -3291,17 +3291,17 @@ FlushNativeStackFrame(JSContext* cx, uns
         }
         for (; n != 0; fp = fp->down) {
             --n;
             if (fp->argv) {
                 if (fp->argsobj && GetArgsPrivateNative(JSVAL_TO_OBJECT(fp->argsobj)))
                     JSVAL_TO_OBJECT(fp->argsobj)->setPrivate(fp);
 
                 JS_ASSERT(JSVAL_IS_OBJECT(fp->argv[-1]));
-                JS_ASSERT(HAS_FUNCTION_CLASS(fp->calleeObject()));
+                JS_ASSERT(fp->calleeObject()->isFunction());
                 JS_ASSERT(GET_FUNCTION_PRIVATE(cx, fp->callee()) == fp->fun);
 
                 if (FUN_INTERPRETED(fp->fun) &&
                     (fp->fun->flags & JSFUN_HEAVYWEIGHT)) {
                     // Iff these fields are NULL, then |fp| was synthesized on trace exit, so
                     // we need to update the frame fields.
                     if (!fp->callobj)
                         fp->callobj = fp->scopeChain;
@@ -3839,17 +3839,17 @@ TraceRecorder::determineSlotType(jsval* 
             m = importTypeMap[importStackSlots + offset];
         } else {
             m = importTypeMap[nativeStackSlot(vp)];
         }
         JS_ASSERT(m != TT_IGNORE);
     } else if (JSVAL_IS_OBJECT(*vp)) {
         if (JSVAL_IS_NULL(*vp))
             m = TT_NULL;
-        else if (HAS_FUNCTION_CLASS(JSVAL_TO_OBJECT(*vp)))
+        else if (JSVAL_TO_OBJECT(*vp)->isFunction())
             m = TT_FUNCTION;
         else
             m = TT_OBJECT;
     } else if (JSVAL_IS_VOID(*vp)) {
         /* N.B. void is JSVAL_SPECIAL. */
         m = TT_VOID;
     } else {
         JS_ASSERT(JSVAL_IS_STRING(*vp) || JSVAL_IS_SPECIAL(*vp));
@@ -5236,17 +5236,17 @@ TraceRecorder::hasMethod(JSObject* obj, 
     JSObject* pobj;
     JSProperty* prop;
     int protoIndex = obj->lookupProperty(cx, id, &pobj, &prop);
     if (protoIndex < 0)
         return RECORD_ERROR;
     if (!prop)
         return status;
 
-    if (!OBJ_IS_NATIVE(pobj)) {
+    if (!pobj->isNative()) {
         // We can't rely on __iterator__ being present on trace just because
         // it's there now, if found in a non-native object.
         status = RECORD_STOP;
     } else {
         JSScope* scope = OBJ_SCOPE(pobj);
         JSScopeProperty* sprop = (JSScopeProperty*) prop;
 
         if (sprop->hasDefaultGetterOrIsMethod() && SPROP_HAS_VALID_SLOT(sprop, scope)) {
@@ -6072,17 +6072,17 @@ IsEntryTypeCompatible(jsval* vp, TraceTy
 {
     unsigned tag = JSVAL_TAG(*vp);
 
     debug_only_printf(LC_TMTracer, "%c/%c ", tagChar[tag], typeChar[*m]);
 
     switch (*m) {
       case TT_OBJECT:
         if (tag == JSVAL_OBJECT && !JSVAL_IS_NULL(*vp) &&
-            !HAS_FUNCTION_CLASS(JSVAL_TO_OBJECT(*vp))) {
+            !JSVAL_TO_OBJECT(*vp)->isFunction()) {
             return true;
         }
         debug_only_printf(LC_TMTracer, "object != tag%u ", tag);
         return false;
       case TT_INT32:
         jsint i;
         if (JSVAL_IS_INT(*vp))
             return true;
@@ -6117,17 +6117,17 @@ IsEntryTypeCompatible(jsval* vp, TraceTy
       case TT_VOID:
         if (JSVAL_IS_VOID(*vp))
             return true;
         debug_only_printf(LC_TMTracer, "undefined != tag%u ", tag);
         return false;
       default:
         JS_ASSERT(*m == TT_FUNCTION);
         if (tag == JSVAL_OBJECT && !JSVAL_IS_NULL(*vp) &&
-            HAS_FUNCTION_CLASS(JSVAL_TO_OBJECT(*vp))) {
+            JSVAL_TO_OBJECT(*vp)->isFunction()) {
             return true;
         }
         debug_only_printf(LC_TMTracer, "fun != tag%u ", tag);
         return false;
     }
 }
 
 class TypeCompatibilityVisitor : public SlotVisitorBase
@@ -9156,17 +9156,17 @@ TraceRecorder::test_property_cache(JSObj
                     obj2->dropProperty(localcx, prop);
                 return ARECORD_ABORTED;
             }
 
             if (protoIndex < 0)
                 RETURN_ERROR_A("error in js_LookupPropertyWithFlags");
 
             if (prop) {
-                if (!OBJ_IS_NATIVE(obj2)) {
+                if (!obj2->isNative()) {
                     obj2->dropProperty(cx, prop);
                     RETURN_STOP_A("property found on non-native object");
                 }
                 entry = JS_PROPERTY_CACHE(cx).fill(cx, aobj, 0, protoIndex, obj2,
                                                    (JSScopeProperty*) prop);
                 JS_ASSERT(entry);
                 if (entry == JS_NO_PROP_CACHE_FILL)
                     entry = NULL;
@@ -9389,17 +9389,17 @@ TraceRecorder::unbox_jsval(jsval v, LIns
         } else {
             guard(false, lir->ins_peq0(v_ins), exit);
             guard(true,
                   lir->ins2(LIR_peq,
                             lir->ins2(LIR_piand, v_ins, INS_CONSTWORD(JSVAL_TAGMASK)),
                             INS_CONSTWORD(JSVAL_OBJECT)),
                   exit);
 
-            guard(HAS_FUNCTION_CLASS(JSVAL_TO_OBJECT(v)),
+            guard(JSVAL_TO_OBJECT(v)->isFunction(),
                   lir->ins2(LIR_peq,
                             lir->ins2(LIR_piand,
                                       lir->insLoad(LIR_ldp, v_ins, offsetof(JSObject, classword),
                                                    ACC_OTHER),
                                       INS_CONSTWORD(~JSSLOT_CLASS_MASK_BITS)),
                             INS_CONSTPTR(&js_FunctionClass)),
                   exit);
         }
@@ -10359,17 +10359,17 @@ TraceRecorder::getClassPrototype(JSProto
         RETURN_ERROR("error in js_GetClassPrototype");
 
     // This should not have reentered.
     JS_ASSERT(localtm.recorder);
 
 #ifdef DEBUG
     /* Double-check that a native proto has a matching emptyScope. */
     if (key != JSProto_Array) {
-        JS_ASSERT(OBJ_IS_NATIVE(proto));
+        JS_ASSERT(proto->isNative());
         JSEmptyScope *emptyScope = OBJ_SCOPE(proto)->emptyScope;
         JS_ASSERT(emptyScope);
         JS_ASSERT(JSCLASS_CACHED_PROTO_KEY(emptyScope->clasp) == key);
     }
 #endif
 
     proto_ins = INS_CONSTOBJ(proto);
     return RECORD_CONTINUE;
@@ -12158,17 +12158,17 @@ TraceRecorder::record_JSOP_CALLNAME()
     JSObject* obj2;
     PCVal pcval;
 
     CHECK_STATUS_A(test_property_cache(obj, obj_ins, obj2, pcval));
 
     if (pcval.isNull() || !pcval.isObject())
         RETURN_STOP_A("callee is not an object");
 
-    JS_ASSERT(HAS_FUNCTION_CLASS(pcval.toObject()));
+    JS_ASSERT(pcval.toObject()->isFunction());
 
     stack(0, INS_CONSTOBJ(pcval.toObject()));
     stack(1, obj_ins);
     return ARECORD_CONTINUE;
 }
 
 JS_DEFINE_CALLINFO_5(extern, UINT32, GetUpvarArgOnTrace, CONTEXT, UINT32, INT32, UINT32,
                      DOUBLEPTR, 0, ACC_STORE_ANY)
@@ -12807,17 +12807,17 @@ TraceRecorder::prop(JSObject* obj, LIns*
          * This trace will be valid as long as neither the object nor any object
          * on its prototype chain changes shape.
          *
          * FIXME: This loop can become a single shape guard once bug 497789 has
          * been fixed.
          */
         VMSideExit* exit = snapshot(BRANCH_EXIT);
         do {
-            if (OBJ_IS_NATIVE(obj)) {
+            if (obj->isNative()) {
                 CHECK_STATUS_A(InjectStatus(guardShape(obj_ins, obj, OBJ_SHAPE(obj),
                                                        "guard(shape)", exit)));
             } else if (!guardDenseArray(obj, obj_ins, exit)) {
                 RETURN_STOP_A("non-native object involved in undefined property access");
             }
         } while (guardHasPrototype(obj, obj_ins, &obj, &obj_ins, exit));
 
         set(outp, INS_VOID());
@@ -14560,17 +14560,17 @@ TraceRecorder::record_JSOP_CALLPROP()
     JSObject* obj2;
     PCVal pcval;
     CHECK_STATUS_A(test_property_cache(obj, obj_ins, obj2, pcval));
 
     if (pcval.isObject()) {
         if (pcval.isNull())
             RETURN_STOP_A("callprop of missing method");
 
-        JS_ASSERT(HAS_FUNCTION_CLASS(pcval.toObject()));
+        JS_ASSERT(pcval.toObject()->isFunction());
 
         if (JSVAL_IS_PRIMITIVE(l)) {
             JSFunction* fun = GET_FUNCTION_PRIVATE(cx, pcval.toObject());
             if (!PRIMITIVE_THIS_TEST(fun, l))
                 RETURN_STOP_A("callee does not accept primitive |this|");
         }
 
         set(&l, INS_CONSTOBJ(pcval.toObject()));
@@ -15012,17 +15012,17 @@ TraceRecorder::record_JSOP_LENGTH()
         v_ins = lir->ins1(LIR_i2f, p2i(stobj_get_fslot(obj_ins, JSSLOT_ARRAY_LENGTH)));
     } else if (OkToTraceTypedArrays && js_IsTypedArray(obj)) {
         // Ensure array is a typed array and is the same type as what was written
         guardClass(obj, obj_ins, obj->getClass(), snapshot(BRANCH_EXIT), ACC_OTHER);
         v_ins = lir->ins1(LIR_i2f, lir->insLoad(LIR_ld,
                                                 stobj_get_const_fslot(obj_ins, JSSLOT_PRIVATE),
                                                 js::TypedArray::lengthOffset(), ACC_READONLY));
     } else {
-        if (!OBJ_IS_NATIVE(obj))
+        if (!obj->isNative())
             RETURN_STOP_A("can't trace length property access on non-array, non-native object");
         return getProp(obj, obj_ins);
     }
     set(&l, v_ins);
     return ARECORD_CONTINUE;
 }
 
 JS_REQUIRES_STACK AbortableRecordingStatus
--- a/js/src/jstypedarray.cpp
+++ b/js/src/jstypedarray.cpp
@@ -503,17 +503,17 @@ class TypedArrayTemplate
                 return true;
             }
 
             *vp = JSVAL_VOID;
             if (js_LookupPropertyWithFlags(cx, proto, id, cx->resolveFlags, &obj2, &prop) < 0)
                 return false;
 
             if (prop) {
-                if (OBJ_IS_NATIVE(obj2)) {
+                if (obj2->isNative()) {
                     sprop = (JSScopeProperty *) prop;
                     if (!js_NativeGet(cx, obj, obj2, sprop, JSGET_METHOD_BARRIER, vp))
                         return false;
                 }
                 obj2->dropProperty(cx, prop);
             }
         }
 
--- a/js/src/jsxml.cpp
+++ b/js/src/jsxml.cpp
@@ -5256,17 +5256,17 @@ js_ConcatenateXML(JSContext *cx, JSObjec
         goto out;
 
     *vp = OBJECT_TO_JSVAL(listobj);
 out:
     js_LeaveLocalRootScopeWithResult(cx, *vp);
     return ok;
 }
 
-/* Use NULL for objectMap so XML objects satisfy OBJ_IS_NATIVE tests. */
+/* Use NULL for objectMap so XML objects satisfy obj->isNative() tests. */
 JS_FRIEND_DATA(JSObjectOps) js_XMLObjectOps = {
     NULL,
     xml_lookupProperty,         xml_defineProperty,
     xml_getProperty,            xml_setProperty,
     xml_getAttributes,          xml_setAttributes,
     xml_deleteProperty,         xml_defaultValue,
     xml_enumerate,              js_CheckAccess,
     xml_typeOf,                 js_TraceObject,
@@ -7280,17 +7280,17 @@ js_InitXMLClass(JSContext *cx, JSObject 
     if (!js_LookupProperty(cx, proto,
                            ATOM_TO_JSID(cx->runtime->atomState.constructorAtom),
                            &pobj, &prop)) {
         return NULL;
     }
     JS_ASSERT(prop);
     sprop = (JSScopeProperty *) prop;
     JS_ASSERT(SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(pobj)));
-    cval = pobj->lockAndGetSlot(cx, sprop->slot);
+    cval = pobj->getSlotMT(cx, sprop->slot);
     pobj->dropProperty(cx, prop);
     JS_ASSERT(VALUE_IS_FUNCTION(cx, cval));
 
     /* Set default settings. */
     vp[0] = JSVAL_NULL;
     vp[1] = cval;
     vp[2] = JSVAL_VOID;
     if (!xml_setSettings(cx, 1, vp))
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -1816,17 +1816,17 @@ DisassembleValue(JSContext *cx, jsval v,
         return false;
     SrcNotes(cx, script);
     TryNotes(cx, script);
 
     if (recursive && script->objectsOffset != 0) {
         JSObjectArray *objects = script->objects();
         for (uintN i = 0; i != objects->length; ++i) {
             JSObject *obj = objects->vector[i];
-            if (HAS_FUNCTION_CLASS(obj)) {
+            if (obj->isFunction()) {
                 putchar('\n');
                 if (!DisassembleValue(cx, OBJECT_TO_JSVAL(obj),
                                       lines, recursive)) {
                     return false;
                 }
             }
         }
     }
@@ -3102,17 +3102,17 @@ ShapeOf(JSContext *cx, uintN argc, jsval
         JS_ReportError(cx, "shapeOf: object expected");
         return JS_FALSE;
     }
     JSObject *obj = JSVAL_TO_OBJECT(v);
     if (!obj) {
         *vp = JSVAL_ZERO;
         return JS_TRUE;
     }
-    if (!OBJ_IS_NATIVE(obj)) {
+    if (!obj->isNative()) {
         *vp = INT_TO_JSVAL(-1);
         return JS_TRUE;
     }
     return JS_NewNumberValue(cx, OBJ_SHAPE(obj), vp);
 }
 
 #ifdef JS_THREADSAFE
 
--- a/js/src/xpconnect/src/xpcdebug.cpp
+++ b/js/src/xpconnect/src/xpcdebug.cpp
@@ -421,17 +421,17 @@ private:
 };
 
 
 static const int tab_width = 2;
 #define INDENT(_d) (_d)*tab_width, " "
 
 static void PrintObjectBasics(JSObject* obj)
 {
-    if(OBJ_IS_NATIVE(obj))
+    if (obj->isNative())
         printf("%p 'native' <%s>",
                (void *)obj, obj->getClass()->name);
     else
         printf("%p 'host'", (void *)obj);
 }
 
 static void PrintObject(JSObject* obj, int depth, ObjectPile* pile)
 {
@@ -445,17 +445,17 @@ static void PrintObject(JSObject* obj, i
     case ObjectPile::seen:
         puts(" (SEE ABOVE)");
         return;
     case ObjectPile::overflow:
         puts(" (TOO MANY OBJECTS)");
         return;
     }
 
-    if(!OBJ_IS_NATIVE(obj))
+    if(!obj->isNative())
         return;
 
     JSObject* parent = obj->getParent();
     JSObject* proto  = obj->getProto();
 
     printf("%*sparent: ", INDENT(depth+1));
     if(parent)
         PrintObject(parent, depth+1, pile);