Bug 1627618 - Part 11: Remove constant argument from IonBuilder::binaryBitOpEmit. r=jandem
authorAndré Bargull <andre.bargull@gmail.com>
Tue, 07 Apr 2020 08:39:06 +0000
changeset 522639 5b587fcde948c41ae5cdcf40d2494f4af99dfcfc
parent 522638 d4fa8213b43761ca227facf6beb6cecb0a1eaed8
child 522640 40a10f393143edf9b8389729f6217b88914c4e47
push id37293
push userapavel@mozilla.com
push dateTue, 07 Apr 2020 21:44:02 +0000
treeherdermozilla-central@de63e64b9090 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1627618
milestone77.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 1627618 - Part 11: Remove constant argument from IonBuilder::binaryBitOpEmit. r=jandem `IonBuilder::binaryBitOpEmit()` is always called with `specialization == Int32`, so we can remove the specialisation parameter and instead directly handle it within `binaryBitOpEmit()`. Differential Revision: https://phabricator.services.mozilla.com/D69791
js/src/jit/IonBuilder.cpp
js/src/jit/IonBuilder.h
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -3443,20 +3443,17 @@ AbortReasonOr<Ok> IonBuilder::jsop_bitno
       return Ok();
     }
   }
 
   return arithUnaryBinaryCache(JSOp::BitNot, nullptr, input);
 }
 
 AbortReasonOr<MBinaryBitwiseInstruction*> IonBuilder::binaryBitOpEmit(
-    JSOp op, MIRType specialization, MDefinition* left, MDefinition* right) {
-  MOZ_ASSERT(specialization == MIRType::Int32 ||
-             specialization == MIRType::None);
-
+    JSOp op, MDefinition* left, MDefinition* right) {
   MBinaryBitwiseInstruction* ins;
   switch (op) {
     case JSOp::BitAnd:
       ins = MBitAnd::New(alloc(), left, right);
       break;
 
     case JSOp::BitOr:
       ins = MBitOr::New(alloc(), left, right);
@@ -3481,22 +3478,18 @@ AbortReasonOr<MBinaryBitwiseInstruction*
     default:
       MOZ_CRASH("unexpected bitop");
   }
 
   current->add(ins);
   ins->infer(inspector, pc);
 
   // The expected specialization should match the inferred specialization.
-  MOZ_ASSERT_IF(specialization == MIRType::None,
-                ins->specialization() == MIRType::None);
-  MOZ_ASSERT_IF(
-      specialization == MIRType::Int32,
-      ins->specialization() == MIRType::Int32 ||
-          (op == JSOp::Ursh && ins->specialization() == MIRType::Double));
+  MOZ_ASSERT(ins->specialization() == MIRType::Int32 ||
+             (op == JSOp::Ursh && ins->specialization() == MIRType::Double));
 
   current->push(ins);
   if (ins->isEffectful()) {
     MOZ_TRY(resumeAfter(ins));
   }
 
   return ins;
 }
@@ -3509,18 +3502,17 @@ AbortReasonOr<Ok> IonBuilder::binaryBitO
   // Try to emit a specialized binary instruction based on the input types
   // of the operands.
 
   // Anything complex - objects, symbols, and bigints - are not specialized
   if (!SimpleBitOpOperand(left) || !SimpleBitOpOperand(right)) {
     return Ok();
   }
 
-  MIRType specialization = MIRType::Int32;
-  MOZ_TRY(binaryBitOpEmit(op, specialization, left, right));
+  MOZ_TRY(binaryBitOpEmit(op, left, right));
 
   *emitted = true;
   return Ok();
 }
 
 AbortReasonOr<Ok> IonBuilder::jsop_bitop(JSOp op) {
   // Pop inputs.
   MDefinition* right = current->pop();
--- a/js/src/jit/IonBuilder.h
+++ b/js/src/jit/IonBuilder.h
@@ -391,18 +391,19 @@ class MOZ_STACK_CLASS IonBuilder {
   AbortReasonOr<Ok> binaryArithTrySpecialized(bool* emitted, JSOp op,
                                               MDefinition* left,
                                               MDefinition* right);
   AbortReasonOr<Ok> binaryArithTrySpecializedOnBaselineInspector(
       bool* emitted, JSOp op, MDefinition* left, MDefinition* right);
   MDefinition* maybeConvertToNumber(MDefinition* def);
 
   // jsop_bitop helpers.
-  AbortReasonOr<MBinaryBitwiseInstruction*> binaryBitOpEmit(
-      JSOp op, MIRType specialization, MDefinition* left, MDefinition* right);
+  AbortReasonOr<MBinaryBitwiseInstruction*> binaryBitOpEmit(JSOp op,
+                                                            MDefinition* left,
+                                                            MDefinition* right);
   AbortReasonOr<Ok> binaryBitOpTrySpecialized(bool* emitted, JSOp op,
                                               MDefinition* left,
                                               MDefinition* right);
 
   // jsop_bitnot helpers.
   AbortReasonOr<Ok> bitnotTrySpecialized(bool* emitted, MDefinition* input);
 
   // jsop_inc_or_dec helpers.