Bug 588021: Remove vestigial ifdefs. (r=dmandelin)
authorChris Leary <cdleary@mozilla.com>
Thu, 13 Jan 2011 22:42:48 -0800
changeset 60598 a5d0ccdb9985e5fdb052541bb4a8cfda28da291c
parent 60597 a08bbc16b665b9c755ad0aab242aea4558855a6f
child 60599 8ee980212905235719218b3a08b312f74c6f154f
push idunknown
push userunknown
push dateunknown
reviewersdmandelin
bugs588021
milestone2.0b10pre
Bug 588021: Remove vestigial ifdefs. (r=dmandelin)
js/src/configure.in
js/src/methodjit/Compiler.cpp
js/src/methodjit/FastOps.cpp
js/src/methodjit/PolyIC.cpp
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -2908,55 +2908,36 @@ dnl Configure JIT support
 
 case "$target" in
 i?86-*)
     ENABLE_TRACEJIT=1
     NANOJIT_ARCH=i386
     ENABLE_METHODJIT=1
     ENABLE_MONOIC=1
     ENABLE_POLYIC=1
-    ENABLE_POLYIC_GETPROP=1
-    ENABLE_POLYIC_SETPROP=1
-    ENABLE_POLYIC_CALLPROP=1
-    ENABLE_POLYIC_BIND=1
-    ENABLE_POLYIC_NAME=1
-    ENABLE_POLYIC_GETELEM=1
-    ENABLE_POLYIC_SETELEM=1
+    ENABLE_POLYIC_TYPED_ARRAY=1
     AC_DEFINE(JS_CPU_X86)
     AC_DEFINE(JS_NUNBOX32)
     ;;
 x86_64*-*)
     ENABLE_TRACEJIT=1
     NANOJIT_ARCH=X64
     ENABLE_METHODJIT=1
     ENABLE_MONOIC=1
     ENABLE_POLYIC=1
-    ENABLE_POLYIC_GETPROP=1
-    ENABLE_POLYIC_SETPROP=1
-    ENABLE_POLYIC_CALLPROP=1
-    ENABLE_POLYIC_BIND=1
-    ENABLE_POLYIC_NAME=1
-    ENABLE_POLYIC_GETELEM=1
-    ENABLE_POLYIC_SETELEM=1
+    ENABLE_POLYIC_TYPED_ARRAY=1
     AC_DEFINE(JS_CPU_X64)
     AC_DEFINE(JS_PUNBOX64)
     ;;
 arm*-*)
     ENABLE_TRACEJIT=1
     NANOJIT_ARCH=ARM
     ENABLE_METHODJIT=1
     ENABLE_MONOIC=1
     ENABLE_POLYIC=1
-    ENABLE_POLYIC_GETPROP=1
-    ENABLE_POLYIC_SETPROP=1
-    ENABLE_POLYIC_CALLPROP=1
-    ENABLE_POLYIC_BIND=1
-    ENABLE_POLYIC_NAME=1
-    ENABLE_POLYIC_GETELEM=1
-    ENABLE_POLYIC_SETELEM=1
     AC_DEFINE(JS_CPU_ARM)
     AC_DEFINE(JS_NUNBOX32)
     ;;
 sparc*-*)
     ENABLE_TRACEJIT=1
     NANOJIT_ARCH=Sparc
     AC_DEFINE(JS_CPU_SPARC)
     ;;
@@ -2992,42 +2973,18 @@ fi
 if test "$ENABLE_MONOIC"; then
     AC_DEFINE(JS_MONOIC)
 fi
 
 if test "$ENABLE_POLYIC"; then
     AC_DEFINE(JS_POLYIC)
 fi
 
-if test "$ENABLE_POLYIC_GETPROP"; then
-    AC_DEFINE(JS_POLYIC_GETPROP)
-fi
-
-if test "$ENABLE_POLYIC_SETPROP"; then
-    AC_DEFINE(JS_POLYIC_SETPROP)
-fi
-
-if test "$ENABLE_POLYIC_CALLPROP"; then
-    AC_DEFINE(JS_POLYIC_CALLPROP)
-fi
-
-if test "$ENABLE_POLYIC_NAME"; then
-    AC_DEFINE(JS_POLYIC_NAME)
-fi
-
-if test "$ENABLE_POLYIC_BIND"; then
-    AC_DEFINE(JS_POLYIC_BIND)
-fi
-
-if test "$ENABLE_POLYIC_GETELEM"; then
-    AC_DEFINE(JS_POLYIC_GETELEM)
-fi
-
-if test "$ENABLE_POLYIC_SETELEM"; then
-    AC_DEFINE(JS_POLYIC_SETELEM)
+if test "$ENABLE_POLYIC_TYPED_ARRAY"; then
+    AC_DEFINE(JS_POLYIC_TYPED_ARRAY)
 fi
 
 if test "$ENABLE_METHODJIT_SPEW"; then
     AC_DEFINE(JS_METHODJIT_SPEW)
 fi
 
 if test "$ENABLE_TRACEJIT"; then
 
--- a/js/src/methodjit/Compiler.cpp
+++ b/js/src/methodjit/Compiler.cpp
@@ -638,17 +638,17 @@ mjit::Compiler::finishThisUp(JITScript *
         CallPatchInfo &patch = callPatches[i];
 
         if (patch.hasFastNcode)
             fullCode.patch(patch.fastNcodePatch, fullCode.locationOf(patch.joinPoint));
         if (patch.hasSlowNcode)
             stubCode.patch(patch.slowNcodePatch, fullCode.locationOf(patch.joinPoint));
     }
 
-#if defined JS_POLYIC_GETELEM
+#ifdef JS_POLYIC
     jit->nGetElems = getElemICs.length();
     if (getElemICs.length()) {
         jit->getElems = (ic::GetElementIC *)cursor;
         cursor += sizeof(ic::GetElementIC) * getElemICs.length();
     } else {
         jit->getElems = NULL;
     }
 
@@ -671,19 +671,17 @@ mjit::Compiler::finishThisUp(JITScript *
         }
         int inlineClaspGuard = fullCode.locationOf(from.claspGuard) -
                                fullCode.locationOf(from.fastPathStart);
         to.inlineClaspGuard = inlineClaspGuard;
         JS_ASSERT(to.inlineClaspGuard == inlineClaspGuard);
 
         stubCode.patch(from.paramAddr, &to);
     }
-#endif /* JS_POLYIC_GETELEM */
-
-#if defined JS_POLYIC_SETELEM
+
     jit->nSetElems = setElemICs.length();
     if (setElemICs.length()) {
         jit->setElems = (ic::SetElementIC *)cursor;
         cursor += sizeof(ic::SetElementIC) * setElemICs.length();
     } else {
         jit->setElems = NULL;
     }
 
@@ -718,19 +716,17 @@ mjit::Compiler::finishThisUp(JITScript *
 
         CheckIsStubCall(to.slowPathCall.labelAtOffset(0));
 
         to.volatileMask = from.volatileMask;
         JS_ASSERT(to.volatileMask == from.volatileMask);
 
         stubCode.patch(from.paramAddr, &to);
     }
-#endif /* JS_POLYIC_SETELEM */
-
-#if defined JS_POLYIC
+
     jit->nPICs = pics.length();
     if (pics.length()) {
         jit->pics = (ic::PICInfo *)cursor;
         cursor += sizeof(ic::PICInfo) * pics.length();
     } else {
         jit->pics = NULL;
     }
 
@@ -2971,19 +2967,17 @@ mjit::Compiler::passMICAddress(MICGenInf
 #endif
 
 #if defined JS_POLYIC
 void
 mjit::Compiler::passICAddress(BaseICInfo *ic)
 {
     ic->paramAddr = stubcc.masm.moveWithPatch(ImmPtr(NULL), Registers::ArgReg1);
 }
-#endif
-
-#if defined JS_POLYIC_GETPROP
+
 bool
 mjit::Compiler::jsop_getprop(JSAtom *atom, bool doTypeCheck, bool usePropCache)
 {
     FrameEntry *top = frame.peek(-1);
 
     /* If the incoming type will never PIC, take slow path. */
     if (top->isTypeKnown() && top->getKnownType() != JSVAL_TYPE_OBJECT) {
         JS_ASSERT_IF(atom == cx->runtime->atomState.lengthAtom,
@@ -3084,19 +3078,17 @@ mjit::Compiler::jsop_getprop(JSAtom *ato
     pic.objReg = objReg;
     frame.pushRegs(shapeReg, objReg);
 
     stubcc.rejoin(Changes(1));
 
     pics.append(pic);
     return true;
 }
-#endif /* JS_POLYIC_GETPROP */
-
-#if defined JS_POLYIC_CALLPROP
+
 bool
 mjit::Compiler::jsop_callprop_generic(JSAtom *atom)
 {
     FrameEntry *top = frame.peek(-1);
 
     /*
      * These two must be loaded first. The objReg because the string path
      * wants to read it, and the shapeReg because it could cause a spill that
@@ -3363,19 +3355,17 @@ mjit::Compiler::jsop_callprop(JSAtom *at
             return jsop_callprop_str(atom);
         return jsop_callprop_slow(atom);
     }
 
     if (top->isTypeKnown())
         return jsop_callprop_obj(atom);
     return jsop_callprop_generic(atom);
 }
-#endif /* JS_POLYIC_CALLPROP */
-
-#ifdef JS_POLYIC_SETPROP
+
 bool
 mjit::Compiler::jsop_setprop(JSAtom *atom, bool usePropCache)
 {
     FrameEntry *lhs = frame.peek(-2);
     FrameEntry *rhs = frame.peek(-1);
 
     /* If the incoming type will never PIC, take slow path. */
     if (lhs->isTypeKnown() && lhs->getKnownType() != JSVAL_TYPE_OBJECT) {
@@ -3485,20 +3475,17 @@ mjit::Compiler::jsop_setprop(JSAtom *ato
     labels.setInlineShapeJump(masm, inlineShapeData, afterInlineShapeJump);
 #else
     labels.setInlineShapeJump(masm, pic.shapeGuard, afterInlineShapeJump);
 #endif
 
     pics.append(pic);
     return true;
 }
-#endif
-
-
-#ifdef JS_POLYIC_NAME
+
 void
 mjit::Compiler::jsop_name(JSAtom *atom)
 {
     PICGenInfo pic(ic::PICInfo::NAME, JSOp(*PC), true);
 
     RESERVE_IC_SPACE(masm);
 
     pic.shapeReg = frame.allocReg();
@@ -3568,31 +3555,28 @@ mjit::Compiler::jsop_xname(JSAtom *atom)
         CHECK_OOL_SPACE();
     }
 
     pic.fastPathRejoin = masm.label();
 
     RETURN_IF_OOM(false);
 
     /* Initialize op labels. */
-    ScopeNameLabels &label = pic.scopeNameLabels();
+    ScopeNameLabels &labels = pic.scopeNameLabels();
     labels.setInlineJumpOffset(masm.differenceBetween(pic.fastPathStart, inlineJump));
 
     frame.pop();
     frame.pushRegs(pic.shapeReg, pic.objReg);
 
     stubcc.rejoin(Changes(1));
 
     pics.append(pic);
     return true;
 }
 
-#endif /* JSOP_POLYIC_NAME */
-
-#ifdef JS_POLYIC_BIND
 void
 mjit::Compiler::jsop_bindname(JSAtom *atom, bool usePropCache)
 {
     PICGenInfo pic(ic::PICInfo::BIND, JSOp(*PC), usePropCache);
 
     // This code does not check the frame flags to see if scopeChain has been
     // set. Rather, it relies on the up-front analysis statically determining
     // whether BINDNAME can be used, which reifies the scope chain at the
@@ -3630,61 +3614,53 @@ mjit::Compiler::jsop_bindname(JSAtom *at
 
     frame.pushTypedPayload(JSVAL_TYPE_OBJECT, pic.objReg);
     frame.freeReg(pic.shapeReg);
 
     stubcc.rejoin(Changes(1));
 
     pics.append(pic);
 }
-#endif /* JS_POLYIC_BIND */
-
-#if !defined JS_POLYIC_NAME
+
+#else /* !JS_POLYIC */
+
 void
 mjit::Compiler::jsop_name(JSAtom *atom)
 {
     prepareStubCall(Uses(0));
     INLINE_STUBCALL(stubs::Name);
     frame.pushSynced();
 }
 
 bool
 mjit::Compiler::jsop_xname(JSAtom *atom)
 {
     return jsop_getprop(atom);
 }
-#endif
-
-#if !defined JS_POLYIC_GETPROP
+
 bool
 mjit::Compiler::jsop_getprop(JSAtom *atom, bool typecheck, bool usePropCache)
 {
     jsop_getprop_slow(atom, usePropCache);
     return true;
 }
-#endif
-
-#if !defined JS_POLYIC_CALLPROP
+
 bool
 mjit::Compiler::jsop_callprop(JSAtom *atom)
 {
     return jsop_callprop_slow(atom);
 }
-#endif
-
-#if !defined JS_POLYIC_SETPROP
+
 bool
 mjit::Compiler::jsop_setprop(JSAtom *atom, bool usePropCache)
 {
     jsop_setprop_slow(atom, usePropCache);
     return true;
 }
-#endif
-
-#if !defined JS_POLYIC_BIND
+
 void
 mjit::Compiler::jsop_bindname(JSAtom *atom, bool usePropCache)
 {
     RegisterID reg = frame.allocReg();
     Address scopeChain(JSFrameReg, JSStackFrame::offsetOfScopeChain());
     masm.loadPtr(scopeChain, reg);
 
     Address address(reg, offsetof(JSObject, parent));
--- a/js/src/methodjit/FastOps.cpp
+++ b/js/src/methodjit/FastOps.cpp
@@ -1283,17 +1283,17 @@ mjit::Compiler::jsop_setelem(bool popGua
     } else {
         BaseIndex slot(ic.objReg, ic.key.reg(), Assembler::JSVAL_SCALE);
         ic.holeGuard = masm.guardNotHole(slot);
         masm.storeValue(ic.vr, slot);
     }
     stubcc.linkExitDirect(ic.holeGuard, ic.slowPathStart);
 
     stubcc.leave();
-#if defined JS_POLYIC && defined JS_POLYIC_SETELEM
+#if defined JS_POLYIC
     passICAddress(&ic);
     ic.slowPathCall = OOL_STUBCALL(STRICT_VARIANT(ic::SetElement));
 #else
     OOL_STUBCALL(STRICT_VARIANT(stubs::SetElem));
 #endif
 
     ic.fastPathRejoin = masm.label();
 
@@ -1323,32 +1323,32 @@ mjit::Compiler::jsop_setelem(bool popGua
     } else if (!ic.vr.isConstant()) {
         ic.volatileMask |= Registers::maskReg(ic.vr.dataReg());
     }
 
     frame.freeReg(ic.objReg);
     frame.shimmy(2);
     stubcc.rejoin(Changes(2));
 
-#if defined JS_POLYIC && defined JS_POLYIC_SETELEM
+#if defined JS_POLYIC
     if (!setElemICs.append(ic))
         return false;
 #endif
 
     return true;
 }
 
 static inline bool
 IsCacheableGetElem(FrameEntry *obj, FrameEntry *id)
 {
     if (obj->isTypeKnown() && obj->getKnownType() != JSVAL_TYPE_OBJECT)
         return false;
     if (id->isTypeKnown() &&
         !(id->getKnownType() == JSVAL_TYPE_INT32
-#if defined JS_POLYIC && defined JS_POLYIC_GETELEM
+#if defined JS_POLYIC
           || id->getKnownType() == JSVAL_TYPE_STRING
 #endif
          )) {
         return false;
     }
 
     if (id->isTypeKnown() && id->getKnownType() == JSVAL_TYPE_INT32 && id->isConstant() &&
         id->getValue().toInt32() < 0) {
@@ -1470,17 +1470,17 @@ mjit::Compiler::jsop_getelem(bool isCall
         // fall back to a slow path.
         ic.claspGuard = masm.jump();
         stubcc.linkExitDirect(ic.claspGuard, ic.slowPathStart);
     }
 
     stubcc.leave();
     if (objTypeGuard.isSet())
         objTypeGuard.get().linkTo(stubcc.masm.label(), &stubcc.masm);
-#if defined JS_POLYIC && defined JS_POLYIC_GETELEM
+#ifdef JS_POLYIC
     passICAddress(&ic);
     if (isCall)
         ic.slowPathCall = OOL_STUBCALL(ic::CallElement);
     else
         ic.slowPathCall = OOL_STUBCALL(ic::GetElement);
 #else
     if (isCall)
         ic.slowPathCall = OOL_STUBCALL(stubs::CallElem);
@@ -1492,17 +1492,17 @@ mjit::Compiler::jsop_getelem(bool isCall
 
     frame.popn(2);
     frame.pushRegs(ic.typeReg, ic.objReg);
     if (isCall)
         frame.pushSynced();
 
     stubcc.rejoin(Changes(2));
 
-#if defined JS_POLYIC && defined JS_POLYIC_GETELEM
+#ifdef JS_POLYIC
     if (!getElemICs.append(ic))
         return false;
 #endif
 
     return true;
 }
 
 static inline bool
--- a/js/src/methodjit/PolyIC.cpp
+++ b/js/src/methodjit/PolyIC.cpp
@@ -180,17 +180,16 @@ class PICStubCompiler : public BaseCompi
 #ifdef JS_METHODJIT_SPEW
         JaegerSpew(JSpew_PICs, "%s %s: %s (%s: %d)\n",
                    type, event, op, script->filename,
                    js_FramePCToLineNumber(cx, f.fp()));
 #endif
     }
 };
 
-#if defined JS_POLYIC_SETPROP
 class SetPropCompiler : public PICStubCompiler
 {
     JSObject *obj;
     JSAtom *atom;
     int lastStubSecondShapeGuard;
 
   public:
     SetPropCompiler(VMFrame &f, JSScript *script, JSObject *obj, ic::PICInfo &pic, JSAtom *atom,
@@ -625,17 +624,16 @@ class SetPropCompiler : public PICStubCo
             shape->hasDefaultSetter() &&
             !obj->isDenseArray()) {
             return patchInline(shape, !obj->hasSlotsArray());
         } 
 
         return generateStub(obj->shape(), shape, false, !obj->hasSlotsArray());
     }
 };
-#endif
 
 static bool
 IsCacheableProtoChain(JSObject *obj, JSObject *holder)
 {
     while (obj != holder) {
         JSObject *proto = obj->getProto();
         if (!proto->isNative())
             return false;
@@ -710,17 +708,16 @@ struct GetPropertyHelper {
     LookupStatus lookupAndTest() {
         LookupStatus status = lookup();
         if (status != Lookup_Cacheable)
             return status;
         return testForGet();
     }
 };
 
-#if defined JS_POLYIC_GETPROP
 class GetPropCompiler : public PICStubCompiler
 {
     JSObject    *obj;
     JSAtom      *atom;
     int         lastStubSecondShapeGuard;
 
   public:
     GetPropCompiler(VMFrame &f, JSScript *script, JSObject *obj, ic::PICInfo &pic, JSAtom *atom,
@@ -1150,19 +1147,17 @@ class GetPropCompiler : public PICStubCo
             return status;
 
         if (obj == getprop.holder && !pic.inlinePathPatched)
             return patchInline(getprop.holder, getprop.shape);
         
         return generateStub(getprop.holder, getprop.shape);
     }
 };
-#endif
-
-#if defined JS_POLYIC_NAME
+
 class ScopeNameCompiler : public PICStubCompiler
 {
   private:
     typedef Vector<Jump, 8, ContextAllocPolicy> JumpList;
 
     JSObject *scopeChain;
     JSAtom *atom;
     GetPropertyHelper<ScopeNameCompiler> getprop;
@@ -1483,19 +1478,17 @@ class ScopeNameCompiler : public PICStub
         JSObject *normalized = obj;
         if (obj->getClass() == &js_WithClass && !shape->hasDefaultGetter())
             normalized = js_UnwrapWithObject(cx, obj);
         NATIVE_GET(cx, normalized, holder, shape, JSGET_METHOD_BARRIER, vp, return false);
 
         return true;
     }
 };
-#endif
  
-#if defined JS_POLYIC_BIND
 class BindNameCompiler : public PICStubCompiler
 {
     JSObject *scopeChain;
     JSAtom *atom;
 
   public:
     BindNameCompiler(VMFrame &f, JSScript *script, JSObject *scopeChain, ic::PICInfo &pic,
                       JSAtom *atom, VoidStubPIC stub)
@@ -1614,19 +1607,17 @@ class BindNameCompiler : public PICStubC
 
         LookupStatus status = generateStub(obj);
         if (status == Lookup_Error)
             return NULL;
 
         return obj;
     }
 };
-#endif
-
-#if defined JS_POLYIC_GETPROP
+
 static void JS_FASTCALL
 DisabledLengthIC(VMFrame &f, ic::PICInfo *pic)
 {
     stubs::Length(f);
 }
 
 static void JS_FASTCALL
 DisabledGetPropIC(VMFrame &f, ic::PICInfo *pic)
@@ -1698,19 +1689,17 @@ ic::GetProp(VMFrame &f, ic::PICInfo *pic
         }
     }
 
     Value v;
     if (!obj->getProperty(f.cx, ATOM_TO_JSID(atom), &v))
         THROW();
     f.regs.sp[-1] = v;
 }
-#endif
-
-#if defined JS_POLYIC_SETPROP
+
 template <JSBool strict>
 static void JS_FASTCALL
 DisabledSetPropIC(VMFrame &f, ic::PICInfo *pic)
 {
     stubs::SetName<strict>(f, pic->atom);
 }
 
 template <JSBool strict>
@@ -1747,19 +1736,17 @@ ic::SetProp(VMFrame &f, ic::PICInfo *pic
         LookupStatus status = cc.update();
         if (status == Lookup_Error)
             THROW();
     }
     
     Value rval = f.regs.sp[-1];
     stub(f, pic);
 }
-#endif
-
-#if defined JS_POLYIC_GETPROP
+
 static void JS_FASTCALL
 DisabledCallPropIC(VMFrame &f, ic::PICInfo *pic)
 {
     stubs::CallProp(f, pic->atom);
 }
 
 void JS_FASTCALL
 ic::CallProp(VMFrame &f, ic::PICInfo *pic)
@@ -1866,19 +1853,17 @@ ic::CallProp(VMFrame &f, ic::PICInfo *pi
 #if JS_HAS_NO_SUCH_METHOD
     if (JS_UNLIKELY(rval.isUndefined()) && regs.sp[-1].isObject()) {
         regs.sp[-2].setString(ATOM_TO_STRING(pic->atom));
         if (!js_OnUnknownMethod(cx, regs.sp - 2))
             THROW();
     }
 #endif
 }
-#endif
-
-#if defined JS_POLYIC_NAME
+
 static void JS_FASTCALL
 DisabledNameIC(VMFrame &f, ic::PICInfo *pic)
 {
     stubs::Name(f);
 }
 
 static void JS_FASTCALL
 DisabledXNameIC(VMFrame &f, ic::PICInfo *pic)
@@ -1917,19 +1902,17 @@ ic::Name(VMFrame &f, ic::PICInfo *pic)
     if (status == Lookup_Error)
         THROW();
 
     Value rval;
     if (!cc.retrieve(&rval))
         THROW();
     f.regs.sp[0] = rval;
 }
-#endif
-
-#if defined JS_POLYIC_BIND
+
 static void JS_FASTCALL
 DisabledBindNameIC(VMFrame &f, ic::PICInfo *pic)
 {
     stubs::BindName(f);
 }
 
 static void JS_FASTCALL
 DisabledBindNameICNoCache(VMFrame &f, ic::PICInfo *pic)
@@ -1950,17 +1933,16 @@ ic::BindName(VMFrame &f, ic::PICInfo *pi
     JSObject *obj = cc.update();
     if (!obj) {
         cc.disable("error");
         THROW();
     }
 
     f.regs.sp[0].setObject(*obj);
 }
-#endif
 
 bool
 BaseIC::isCallOp()
 {
     return !!(js_CodeSpec[op].format & JOF_CALLOP);
 }
 
 void
@@ -1989,17 +1971,16 @@ BaseIC::shouldUpdate(JSContext *cx)
         hit = true;
         spew(cx, "ignored", "first hit");
         return false;
     }
     JS_ASSERT(stubsGenerated < MAX_PIC_STUBS);
     return true;
 }
 
-#if defined JS_POLYIC_GETELEM
 static void JS_FASTCALL
 DisabledGetElem(VMFrame &f, ic::GetElementIC *ic)
 {
     stubs::GetElem(f);
 }
 
 static void JS_FASTCALL
 DisabledCallElem(VMFrame &f, ic::GetElementIC *ic)
@@ -2225,16 +2206,17 @@ GetElementIC::attachGetProp(JSContext *c
     if (shape->isMethod())
         *vp = ObjectValue(shape->methodObject());
     else
         *vp = holder->getSlot(shape->slot);
 
     return Lookup_Cacheable;
 }
 
+#if defined JS_POLYIC_TYPED_ARRAY
 LookupStatus
 GetElementIC::attachTypedArray(JSContext *cx, JSObject *obj, const Value &v, jsid id, Value *vp)
 {
     if (!v.isInt32())
         return disable(cx, "typed array with string key");
 
     if (op == JSOP_CALLELEM)
         return disable(cx, "typed array with call");
@@ -2327,25 +2309,28 @@ GetElementIC::attachTypedArray(JSContext
     disable(cx, "generated typed array stub");
 
     // Fetch the value as expected of Lookup_Cacheable for GetElement.
     if (!obj->getProperty(cx, id, vp))
         return Lookup_Error;
 
     return Lookup_Cacheable;
 }
+#endif /* JS_POLYIC_TYPED_ARRAY */
 
 LookupStatus
 GetElementIC::update(JSContext *cx, JSObject *obj, const Value &v, jsid id, Value *vp)
 {
     if (v.isString())
         return attachGetProp(cx, obj, v, id, vp);
 
+#if defined JS_POLYIC_TYPED_ARRAY
     if (js_IsTypedArray(obj))
         return attachTypedArray(cx, obj, v, id, vp);
+#endif
 
     return disable(cx, "unhandled object and key type");
 }
 
 void JS_FASTCALL
 ic::CallElement(VMFrame &f, ic::GetElementIC *ic)
 {
     JSContext *cx = f.cx;
@@ -2441,19 +2426,17 @@ ic::GetElement(VMFrame &f, ic::GetElemen
             JS_ASSERT(!f.regs.sp[-2].isMagic());
             return;
         }
     }
 
     if (!obj->getProperty(cx, id, &f.regs.sp[-2]))
         THROW();
 }
-#endif /* JS_POLYIC_GETELEM */
-
-#ifdef JS_POLYIC_SETELEM
+
 #define APPLY_STRICTNESS(f, s)                          \
     (FunctionTemplateConditional(s, f<true>, f<false>))
 
 LookupStatus
 SetElementIC::disable(JSContext *cx, const char *reason)
 {
     slowCallPatched = true;
     VoidStub stub = APPLY_STRICTNESS(stubs::SetElem, strictMode);
@@ -2577,16 +2560,17 @@ SetElementIC::attachHoleStub(JSContext *
     repatcher.relink(fastPathStart.jumpAtOffset(inlineHoleGuard), cs);
     inlineHoleGuardPatched = true;
 
     disable(cx, "generated dense array hole stub");
 
     return Lookup_Cacheable;
 }
 
+#if defined JS_POLYIC_TYPED_ARRAY
 LookupStatus
 SetElementIC::attachTypedArray(JSContext *cx, JSObject *obj, int32 key)
 {
     // Right now, only one clasp guard extension is supported.
     JS_ASSERT(!inlineClaspGuardPatched);
 
     Assembler masm;
 
@@ -2664,33 +2648,36 @@ SetElementIC::attachTypedArray(JSContext
     // For simplicitly, they are currently monomorphic.
     if (stubsGenerated == MAX_GETELEM_IC_STUBS)
         disable(cx, "max stubs reached");
 
     disable(cx, "generated typed array stub");
 
     return Lookup_Cacheable;
 }
+#endif /* JS_POLYIC_TYPED_ARRAY */
 
 LookupStatus
 SetElementIC::update(JSContext *cx, const Value &objval, const Value &idval)
 {
     if (!objval.isObject())
         return disable(cx, "primitive lval");
     if (!idval.isInt32())
         return disable(cx, "non-int32 key");
 
     JSObject *obj = &objval.toObject();
     int32 key = idval.toInt32();
 
     if (obj->isDenseArray())
         return attachHoleStub(cx, obj, key);
 
+#if defined JS_POLYIC_TYPED_ARRAY
     if (js_IsTypedArray(obj))
         return attachTypedArray(cx, obj, key);
+#endif
 
     return disable(cx, "unsupported object type");
 }
 
 template<JSBool strict>
 void JS_FASTCALL
 ic::SetElement(VMFrame &f, ic::SetElementIC *ic)
 {
@@ -2702,67 +2689,54 @@ ic::SetElement(VMFrame &f, ic::SetElemen
             THROW();
     }
 
     stubs::SetElem<strict>(f);
 }
 
 template void JS_FASTCALL ic::SetElement<true>(VMFrame &f, SetElementIC *ic);
 template void JS_FASTCALL ic::SetElement<false>(VMFrame &f, SetElementIC *ic);
-#endif /* JS_POLYIC_SETELEM */
 
 void
 JITScript::purgePICs()
 {
     if (!nPICs && !nGetElems && !nSetElems)
         return;
 
     Repatcher repatcher(this);
 
     for (uint32 i = 0; i < nPICs; i++) {
         ic::PICInfo &pic = pics[i];
         switch (pic.kind) {
-#ifdef JS_POLYIC_SETPROP
           case ic::PICInfo::SET:
           case ic::PICInfo::SETMETHOD:
             SetPropCompiler::reset(repatcher, pic);
             break;
-#endif
-#ifdef JS_POLYIC_NAME
           case ic::PICInfo::NAME:
           case ic::PICInfo::XNAME:
             ScopeNameCompiler::reset(repatcher, pic);
             break;
-#endif
-#ifdef JS_POLYIC_BIND
           case ic::PICInfo::BIND:
             BindNameCompiler::reset(repatcher, pic);
             break;
-#endif
-#ifdef JS_POLYIC_GETPROP
           case ic::PICInfo::CALL: /* fall-through */
           case ic::PICInfo::GET:
             GetPropCompiler::reset(repatcher, pic);
             break;
-#endif
           default:
             JS_NOT_REACHED("Unhandled PIC kind");
             break;
         }
         pic.reset();
     }
 
-#if defined JS_POLYIC_GETELEM
     for (uint32 i = 0; i < nGetElems; i++)
         getElems[i].purge(repatcher);
-#endif
-#if defined JS_POLYIC_SETELEM
     for (uint32 i = 0; i < nSetElems; i++)
         setElems[i].purge(repatcher);
-#endif
 }
 
 void
 ic::PurgePICs(JSContext *cx, JSScript *script)
 {
     if (script->jitNormal)
         script->jitNormal->purgePICs();
     if (script->jitCtor)