Bug 785927 - Fix warning for unused IsValueInCompartment; r=bhackett
authorTerrence Cole <terrence@mozilla.com>
Mon, 27 Aug 2012 10:39:21 -0700
changeset 105623 72bb1083fbab13792b9434efe92a49403cb71433
parent 105622 16975ba38809accb39eeb50fd1f1cee06e8d50f6
child 105624 2954b2a61cfa971bda27ebf2cbdc1c3dd3715558
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersbhackett
bugs785927
milestone17.0a1
Bug 785927 - Fix warning for unused IsValueInCompartment; r=bhackett
js/src/vm/ObjectImpl-inl.h
--- a/js/src/vm/ObjectImpl-inl.h
+++ b/js/src/vm/ObjectImpl-inl.h
@@ -205,24 +205,26 @@ js::ObjectImpl::nativeGetSlot(uint32_t s
 
 static JS_ALWAYS_INLINE JSCompartment *
 ValueCompartment(const js::Value &value)
 {
     JS_ASSERT(value.isMarkable());
     return static_cast<js::gc::Cell *>(value.toGCThing())->compartment();
 }
 
-static bool
+#ifdef DEBUG
+inline bool
 IsValueInCompartment(js::Value v, JSCompartment *comp)
 {
     if (!v.isMarkable())
         return true;
     JSCompartment *vcomp = ValueCompartment(v);
     return vcomp == comp->rt->atomsCompartment || vcomp == comp;
 }
+#endif
 
 inline void
 js::ObjectImpl::setSlot(uint32_t slot, const js::Value &value)
 {
     MOZ_ASSERT(slotInRange(slot));
     MOZ_ASSERT(IsValueInCompartment(value, compartment()));
     getSlotRef(slot).set(this->asObjectPtr(), slot, value);
 }