Bug 916712: Convert Float32 TableSwitch inputs to doubles; r=jandem
authorBenjamin Bouvier <bbouvier@mozilla.com>
Tue, 17 Sep 2013 11:42:26 -0700
changeset 161438 063a0d518fa28433ee1cabf357b81304ca837d51
parent 161365 eb501139f68a703fdd1470032496fb29a9a66b2c
child 161439 623728a4a34bdbc8c72e5f310d300f99b308f506
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs916712
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 916712: Convert Float32 TableSwitch inputs to doubles; r=jandem
js/src/jit-test/tests/ion/bug916712.js
js/src/jit/MIR.h
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug916712.js
@@ -0,0 +1,7 @@
+var e = new Error();
+function test() {
+  var arr = Float32Array(1);
+  for (var Number in e) {}
+  var a = arr [0];
+  switch (a) {}
+} test();
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -1036,17 +1036,18 @@ class MControlInstruction : public MInst
     bool isControlInstruction() const {
         return true;
     }
 
     void printOpcode(FILE *fp) const;
 };
 
 class MTableSwitch MOZ_FINAL
-  : public MControlInstruction
+  : public MControlInstruction,
+    public NoFloatPolicy<0>
 {
     // The successors of the tableswitch
     // - First successor = the default case
     // - Successor 2 and higher = the cases sorted on case index.
     Vector<MBasicBlock*, 0, IonAllocPolicy> successors_;
     Vector<size_t, 0, IonAllocPolicy> cases_;
 
     // Contains the blocks/cases that still need to get build
@@ -1154,16 +1155,20 @@ class MTableSwitch MOZ_FINAL
     MDefinition *getOperand(size_t index) const {
         JS_ASSERT(index == 0);
         return operand_.producer();
     }
 
     size_t numOperands() const {
         return 1;
     }
+
+    TypePolicy *typePolicy() {
+        return this;
+    }
 };
 
 template <size_t Arity, size_t Successors>
 class MAryControlInstruction : public MControlInstruction
 {
     mozilla::Array<MUse, Arity> operands_;
     mozilla::Array<MBasicBlock *, Successors> successors_;