Fix TI API use again (bug 772901, r=sstangl).
authorDavid Anderson <danderson@mozilla.com>
Thu, 12 Jul 2012 14:13:49 -0700
changeset 106592 66aac8e7a214ccdd3903c588a9c36e240596bc68
parent 106591 c08088c00eb283d94ce176a4dca8566bebf5e84c
child 106593 a29f6c63551663cc3aa24b1bb56d9d058fa0ea4e
push id14706
push usereakhgari@mozilla.com
push dateTue, 11 Sep 2012 20:39:52 +0000
treeherdermozilla-inbound@d50bf1edaabe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssstangl
bugs772901
milestone16.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
Fix TI API use again (bug 772901, r=sstangl).
js/src/ion/IonBuilder.cpp
js/src/ion/TypeOracle.cpp
js/src/ion/TypeOracle.h
js/src/jit-test/tests/ion/bug772901.js
--- a/js/src/ion/IonBuilder.cpp
+++ b/js/src/ion/IonBuilder.cpp
@@ -3462,43 +3462,44 @@ IonBuilder::makeCall(HandleFunction targ
     return makeCallBarrier(target, argc, constructing, types, barrier);
 }
 
 bool
 IonBuilder::jsop_incslot(JSOp op, uint32 slot)
 {
     int32 amt = (js_CodeSpec[op].format & JOF_INC) ? 1 : -1;
     bool post = !!(js_CodeSpec[op].format & JOF_POST);
-    TypeOracle::Binary b = oracle->incslot(script, pc);
+    TypeOracle::BinaryTypes types = oracle->incslot(script, pc);
 
     // Grab the value at the local slot, and convert it to a number. Currently,
     // we use ToInt32 or ToNumber which are fallible but idempotent. This whole
     // operation must be idempotent because we cannot resume in the middle of
     // an INC op.
     current->pushSlot(slot);
     MDefinition *value = current->pop();
     MInstruction *lhs;
-    if (b.lhs == MIRType_Int32) {
+
+    JSValueType knownType = types.lhsTypes->getKnownTypeTag(cx);
+    if (knownType == JSVAL_TYPE_INT32) {
         lhs = MToInt32::New(value);
-    } else if (b.lhs == MIRType_Double) {
+    } else if (knownType == JSVAL_TYPE_DOUBLE) {
         lhs = MToDouble::New(value);
     } else {
         // Don't compile effectful incslot ops.
         return abort("INCSLOT non-int/double lhs");
     }
     current->add(lhs);
 
     // If this is a post operation, save the original value.
     if (post)
         current->push(lhs);
 
     MConstant *rhs = MConstant::New(Int32Value(amt));
     current->add(rhs);
 
-    TypeOracle::BinaryTypes types = oracle->binaryTypes(script, pc);
     MAdd *result = MAdd::New(lhs, rhs);
     current->add(result);
     result->infer(cx, types);
     current->push(result);
     current->setSlot(slot);
 
     if (post)
         current->pop();
--- a/js/src/ion/TypeOracle.cpp
+++ b/js/src/ion/TypeOracle.cpp
@@ -112,37 +112,37 @@ TypeInferenceOracle::binaryTypes(JSScrip
     } else {
         res.lhsTypes = script->analysis()->poppedTypes(pc, 1);
         res.rhsTypes = script->analysis()->poppedTypes(pc, 0);
         res.outTypes = script->analysis()->pushedTypes(pc, 0);
     }
     return res;
 }
 
-TypeOracle::Binary
+TypeOracle::BinaryTypes
 TypeInferenceOracle::incslot(JSScript *script, jsbytecode *pc)
 {
     JSOp op = JSOp(*pc);
     unsigned index = GET_SLOTNO(pc);
  
     TypeSet *types = NULL;
     if (js_CodeSpec[op].type() == JOF_LOCAL) {
         if (script->analysis()->trackSlot(LocalSlot(script, index)))
-            return binaryOp(script, pc);
+            return binaryTypes(script, pc);
         types = TypeScript::LocalTypes(script, index);
     } else {
         if (script->analysis()->trackSlot(ArgSlot(index)))
-            return binaryOp(script, pc);
+            return binaryTypes(script, pc);
         types = TypeScript::ArgTypes(script, index);
     }
 
-    Binary b;
-    b.lhs = getMIRType(types);
-    b.rhs = MIRType_Int32;
-    b.rval = getMIRType(script->analysis()->pushedTypes(pc, 0));
+    BinaryTypes b;
+    b.lhsTypes = types;
+    b.rhsTypes = NULL;
+    b.outTypes = script->analysis()->pushedTypes(pc, 0);
     return b;
 }
 
 TypeOracle::Unary
 TypeInferenceOracle::unaryOp(JSScript *script, jsbytecode *pc)
 {
     JS_ASSERT(script == this->script);
 
--- a/js/src/ion/TypeOracle.h
+++ b/js/src/ion/TypeOracle.h
@@ -202,18 +202,18 @@ class TypeOracle
         return MaybeArguments;
     }
     virtual LazyArgumentsType elementReadMagicArguments(JSScript *script, jsbytecode *pc) {
         return MaybeArguments;
     }
     virtual LazyArgumentsType elementWriteMagicArguments(JSScript *script, jsbytecode *pc) {
         return MaybeArguments;
     }
-    virtual Binary incslot(JSScript *script, jsbytecode *pc) {
-        return binaryOp(script, pc);
+    virtual BinaryTypes incslot(JSScript *script, jsbytecode *pc) {
+        return binaryTypes(script, pc);
     }
 };
 
 class DummyOracle : public TypeOracle
 {
   public:
     UnaryTypes unaryTypes(JSScript *script, jsbytecode *pc) {
         UnaryTypes u;
@@ -289,17 +289,17 @@ class TypeInferenceOracle : public TypeO
     bool canEnterInlinedFunction(JSFunction *callee);
     MIRType aliasedVarType(JSScript *script, jsbytecode *pc);
 
     LazyArgumentsType isArgumentObject(types::TypeSet *obj);
     LazyArgumentsType propertyReadMagicArguments(JSScript *script, jsbytecode *pc);
     LazyArgumentsType elementReadMagicArguments(JSScript *script, jsbytecode *pc);
     LazyArgumentsType elementWriteMagicArguments(JSScript *script, jsbytecode *pc);
 
-    Binary incslot(JSScript *script, jsbytecode *pc);
+    BinaryTypes incslot(JSScript *script, jsbytecode *pc);
 };
 
 static inline MIRType
 MIRTypeFromValueType(JSValueType type)
 {
     switch (type) {
       case JSVAL_TYPE_DOUBLE:
         return MIRType_Double;
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug772901.js
@@ -0,0 +1,7 @@
+// vim: set ts=4 sw=4 tw=99 et:
+
+function f(x) {
+    delete ((x)++);
+    arguments[0] !== undefined;
+}
+f(1, x = [f.ArrayBuffer,unwatch.Int32Array], this, this, this) ;