Bug 921902 - Fix --disable-ion builds.
authorBrian Hackett <bhackett1024@gmail.com>
Sat, 05 Oct 2013 08:26:19 -0600
changeset 149979 8b6ee274598038b57ce5942da43441b5eff06daf
parent 149978 f4e60efc867f855d0047be6b3925e41226757ad3
child 149980 2e66a625c9712a944646ac5d32e12f0d3ed377c1
push id34709
push userbhackett@mozilla.com
push dateSat, 05 Oct 2013 14:26:23 +0000
treeherdermozilla-inbound@8b6ee2745980 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs921902
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 921902 - Fix --disable-ion builds.
js/src/jsinfer.cpp
js/src/jsinferinlines.h
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -539,17 +539,21 @@ TypeSet::unionSets(TypeSet *a, TypeSet *
 //
 // At the end of compilation, when linking the result on the main thread, the
 // list of compiler constraints are read and converted to type constraints and
 // attached to the type sets. If the property type sets have changed so that the
 // assumptions no longer hold then the compilation is aborted and its result
 // discarded.
 
 static LifoAlloc *IonAlloc() {
+#ifdef JS_ION
     return jit::GetIonContext()->temp->lifoAlloc();
+#else
+    MOZ_CRASH();
+#endif
 }
 
 // Superclass of all constraints generated during Ion compilation. These may
 // be allocated off the main thread, using the current Ion context's allocator.
 class types::CompilerConstraint
 {
   public:
     // Property being queried by the compiler.
@@ -570,18 +574,22 @@ class types::CompilerConstraint
     // Generate the type constraint recording the assumption made by this
     // compilation. Returns true if the assumption originally made still holds.
     virtual bool generateTypeConstraint(JSContext *cx, RecompileInfo recompileInfo) = 0;
 };
 
 void
 CompilerConstraintList::add(CompilerConstraint *constraint)
 {
+#ifdef JS_ION
     if (!constraint || !constraint->expected || !constraints.append(constraint))
         setFailed();
+#else
+    MOZ_CRASH();
+#endif
 }
 
 namespace {
 
 template <typename T>
 class CompilerConstraintInstance : public CompilerConstraint
 {
     T data;
@@ -667,35 +675,43 @@ TypeObjectKey::newScript()
             return addendum->asNewScript();
     }
     return NULL;
 }
 
 bool
 TypeObjectKey::unknownProperties()
 {
+#ifdef JS_ION
     JSContext *cx = jit::GetIonContext()->cx;
     TypeObject *type = isSingleObject() ? asSingleObject()->getType(cx) : asTypeObject();
     if (!type)
         MOZ_CRASH();
     return type->unknownProperties();
+#else
+    MOZ_CRASH();
+#endif
 }
 
 HeapTypeSetKey
 TypeObjectKey::property(jsid id)
 {
+#ifdef JS_ION
     JSContext *cx = jit::GetIonContext()->cx;
     TypeObject *type = isSingleObject() ? asSingleObject()->getType(cx) : asTypeObject();
     if (!type)
         MOZ_CRASH();
     HeapTypeSetKey property;
     property.actualTypes = type->getProperty(cx, id);
     if (!property.actualTypes)
         MOZ_CRASH();
     return property;
+#else
+    MOZ_CRASH();
+#endif
 }
 
 bool
 types::FinishCompilation(JSContext *cx, JSScript *script, jit::ExecutionMode executionMode,
                          CompilerConstraintList *constraints, RecompileInfo *precompileInfo)
 {
     if (constraints->failed())
         return false;
@@ -933,28 +949,32 @@ class ConstraintDataFreezeObjectFlags
     }
 };
 
 } /* anonymous namespace */
 
 bool
 TypeObjectKey::hasFlags(CompilerConstraintList *constraints, TypeObjectFlags flags)
 {
+#ifdef JS_ION
     JS_ASSERT(flags);
 
     JSContext *cx = jit::GetIonContext()->cx;
     TypeObject *type = isSingleObject() ? asSingleObject()->getType(cx) : asTypeObject();
     if (!type)
         MOZ_CRASH();
     if (type->hasAnyFlags(flags))
         return true;
 
     HeapTypeSetKey objectProperty = property(JSID_EMPTY);
     constraints->add(IonAlloc()->new_<CompilerConstraintInstance<ConstraintDataFreezeObjectFlags> >(objectProperty, ConstraintDataFreezeObjectFlags(this, flags)));
     return false;
+#else
+    MOZ_CRASH();
+#endif
 }
 
 void
 TypeObjectKey::watchStateChange(CompilerConstraintList *constraints)
 {
     HeapTypeSetKey objectProperty = property(JSID_EMPTY);
     constraints->add(IonAlloc()->new_<CompilerConstraintInstance<ConstraintDataFreezeObjectFlags> >(objectProperty, ConstraintDataFreezeObjectFlags(this, 0)));
 }
@@ -1648,21 +1668,25 @@ PrototypeHasIndexedProperty(CompilerCons
 
     return false;
 }
 
 bool
 types::ArrayPrototypeHasIndexedProperty(CompilerConstraintList *constraints,
                                         HandleScript script)
 {
+#ifdef JS_ION
     JSObject *proto = script->global().getOrCreateArrayPrototype(jit::GetIonContext()->cx);
     if (!proto)
         return true;
 
     return PrototypeHasIndexedProperty(constraints, proto);
+#else
+    MOZ_CRASH();
+#endif
 }
 
 bool
 types::TypeCanHaveExtraIndexedProperties(CompilerConstraintList *constraints,
                                          TemporaryTypeSet *types)
 {
     const Class *clasp = types->getKnownClass();
 
--- a/js/src/jsinferinlines.h
+++ b/js/src/jsinferinlines.h
@@ -1397,34 +1397,44 @@ TypeNewScript::writeBarrierPre(TypeNewSc
 // still hold.
 bool
 FinishCompilation(JSContext *cx, JSScript *script, jit::ExecutionMode executionMode,
                   CompilerConstraintList *constraints, RecompileInfo *precompileInfo);
 
 class CompilerConstraint;
 class CompilerConstraintList
 {
+#ifdef JS_ION
     // Generated constraints.
     Vector<CompilerConstraint *, 0, jit::IonAllocPolicy> constraints;
+#endif
 
     // OOM during generation of some constraint.
     bool failed_;
 
   public:
     CompilerConstraintList()
       : failed_(false)
     {}
 
     void add(CompilerConstraint *constraint);
 
     size_t length() {
+#ifdef JS_ION
         return constraints.length();
+#else
+        MOZ_CRASH();
+#endif
     }
     CompilerConstraint *get(size_t i) {
+#ifdef JS_ION
         return constraints[i];
+#else
+        MOZ_CRASH();
+#endif
     }
 
     bool failed() {
         return failed_;
     }
     void setFailed() {
         failed_ = true;
     }