Bug 817626 - Move JSOpToCondition to IonMacroAssembler.h r=djvj
authorJan de Mooij <jdemooij@mozilla.com>
Mon, 03 Dec 2012 23:08:27 +0100
changeset 123951 9c19b631c2080f768b09c461f5b193b08ba51e5c
parent 123950 f8312a05c1a393c49ee5911470dc1f6436ede485
child 123952 af912a40cd59f96b8ed7ca83bdb63754ccfcc0d6
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdjvj
bugs817626
milestone20.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 817626 - Move JSOpToCondition to IonMacroAssembler.h r=djvj
js/src/ion/IonMacroAssembler.h
js/src/ion/shared/CodeGenerator-shared-inl.h
--- a/js/src/ion/IonMacroAssembler.h
+++ b/js/src/ion/IonMacroAssembler.h
@@ -657,13 +657,61 @@ class MacroAssembler : public MacroAssem
         movePtr(ImmWord(p->sizePointer()), temp);
         add32(Imm32(-1), Address(temp, 0));
     }
 
     void printf(const char *output);
     void printf(const char *output, Register value);
 };
 
+static inline Assembler::Condition
+JSOpToCondition(JSOp op)
+{
+    switch (op) {
+      case JSOP_EQ:
+      case JSOP_STRICTEQ:
+        return Assembler::Equal;
+      case JSOP_NE:
+      case JSOP_STRICTNE:
+        return Assembler::NotEqual;
+      case JSOP_LT:
+        return Assembler::LessThan;
+      case JSOP_LE:
+        return Assembler::LessThanOrEqual;
+      case JSOP_GT:
+        return Assembler::GreaterThan;
+      case JSOP_GE:
+        return Assembler::GreaterThanOrEqual;
+      default:
+        JS_NOT_REACHED("Unrecognized comparison operation");
+        return Assembler::Equal;
+    }
+}
+
+static inline Assembler::DoubleCondition
+JSOpToDoubleCondition(JSOp op)
+{
+    switch (op) {
+      case JSOP_EQ:
+      case JSOP_STRICTEQ:
+        return Assembler::DoubleEqual;
+      case JSOP_NE:
+      case JSOP_STRICTNE:
+        return Assembler::DoubleNotEqualOrUnordered;
+      case JSOP_LT:
+        return Assembler::DoubleLessThan;
+      case JSOP_LE:
+        return Assembler::DoubleLessThanOrEqual;
+      case JSOP_GT:
+        return Assembler::DoubleGreaterThan;
+      case JSOP_GE:
+        return Assembler::DoubleGreaterThanOrEqual;
+      default:
+        JS_NOT_REACHED("Unexpected comparison operation");
+        return Assembler::DoubleEqual;
+    }
+}
+
 } // namespace ion
 } // namespace js
 
 #endif // jsion_macro_assembler_h__
 
--- a/js/src/ion/shared/CodeGenerator-shared-inl.h
+++ b/js/src/ion/shared/CodeGenerator-shared-inl.h
@@ -116,64 +116,16 @@ GetTempValue(const Register &type, const
 #elif defined(JS_PUNBOX64)
     (void)type;
     return ValueOperand(payload);
 #else
 #error "Unknown"
 #endif
 }
 
-static inline Assembler::Condition
-JSOpToCondition(JSOp op)
-{
-    switch (op) {
-      case JSOP_EQ:
-      case JSOP_STRICTEQ:
-        return Assembler::Equal;
-      case JSOP_NE:
-      case JSOP_STRICTNE:
-        return Assembler::NotEqual;
-      case JSOP_LT:
-        return Assembler::LessThan;
-      case JSOP_LE:
-        return Assembler::LessThanOrEqual;
-      case JSOP_GT:
-        return Assembler::GreaterThan;
-      case JSOP_GE:
-        return Assembler::GreaterThanOrEqual;
-      default:
-        JS_NOT_REACHED("Unrecognized comparison operation");
-        return Assembler::Equal;
-    }
-}
-
-static inline Assembler::DoubleCondition
-JSOpToDoubleCondition(JSOp op)
-{
-    switch (op) {
-      case JSOP_EQ:
-      case JSOP_STRICTEQ:
-        return Assembler::DoubleEqual;
-      case JSOP_NE:
-      case JSOP_STRICTNE:
-        return Assembler::DoubleNotEqualOrUnordered;
-      case JSOP_LT:
-        return Assembler::DoubleLessThan;
-      case JSOP_LE:
-        return Assembler::DoubleLessThanOrEqual;
-      case JSOP_GT:
-        return Assembler::DoubleGreaterThan;
-      case JSOP_GE:
-        return Assembler::DoubleGreaterThanOrEqual;
-      default:
-        JS_NOT_REACHED("Unexpected comparison operation");
-        return Assembler::DoubleEqual;
-    }
-}
-
 void
 CodeGeneratorShared::saveLive(LInstruction *ins)
 {
     JS_ASSERT(!ins->isCall());
     LSafepoint *safepoint = ins->safepoint();
     masm.PushRegsInMask(safepoint->liveRegs());
 }