Bug 1608771 - Part 2, BigInt<>I64 conversion for inlined calls r=lth,wingo
authorAsumu Takikawa <asumu@igalia.com>
Thu, 07 May 2020 21:10:31 +0000
changeset 528693 5a592b174ba30bb015375cb9d1deb233d90f8249
parent 528692 4cc927f402b7b5f0f911b063bf161993390d9e18
child 528694 ae0ddba53299656ae2be10e426957499efb4c51e
push id37393
push userrmaries@mozilla.com
push dateFri, 08 May 2020 03:38:07 +0000
treeherdermozilla-central@ead8f0367372 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslth, wingo
bugs1608771
milestone78.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 1608771 - Part 2, BigInt<>I64 conversion for inlined calls r=lth,wingo This is part 2 of implementing the Wasm BigInt<>I64 conversion proposal for inlined Ion to Wasm calls. This part adds an I64 return value case for LIonToWasmCall, which is needed in general because an I64 result may require multiple defs for the instruction. Differential Revision: https://phabricator.services.mozilla.com/D65234
js/src/jit/CodeGenerator.cpp
js/src/jit/Lowering.cpp
js/src/jit/shared/LIR-shared.h
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -14400,16 +14400,19 @@ void CodeGenerator::emitIonToWasmCallBas
 }
 
 void CodeGenerator::visitIonToWasmCall(LIonToWasmCall* lir) {
   emitIonToWasmCallBase(lir);
 }
 void CodeGenerator::visitIonToWasmCallV(LIonToWasmCallV* lir) {
   emitIonToWasmCallBase(lir);
 }
+void CodeGenerator::visitIonToWasmCallI64(LIonToWasmCallI64* lir) {
+  emitIonToWasmCallBase(lir);
+}
 
 void CodeGenerator::visitWasmNullConstant(LWasmNullConstant* lir) {
   masm.xorPtr(ToRegister(lir->output()), ToRegister(lir->output()));
 }
 
 void CodeGenerator::visitWasmCompareAndSelect(LWasmCompareAndSelect* ins) {
   bool cmpIs32bit = ins->compareType() == MCompare::Compare_Int32 ||
                     ins->compareType() == MCompare::Compare_UInt32;
--- a/js/src/jit/Lowering.cpp
+++ b/js/src/jit/Lowering.cpp
@@ -5242,16 +5242,18 @@ void LIRGenerator::visitIonToWasmCall(MI
                        : tempFixed(FramePointer);
 
   // Note that since this is a LIR call instruction, regalloc will prevent
   // the use*AtStart below from reusing any of the temporaries.
 
   LInstruction* lir;
   if (ins->type() == MIRType::Value) {
     lir = allocateVariadic<LIonToWasmCallV>(ins->numOperands(), scratch, fp);
+  } else if (ins->type() == MIRType::Int64) {
+    lir = allocateVariadic<LIonToWasmCallI64>(ins->numOperands(), scratch, fp);
   } else {
     lir = allocateVariadic<LIonToWasmCall>(ins->numOperands(), scratch, fp);
   }
   if (!lir) {
     abort(AbortReason::Alloc, "OOM: LIRGenerator::visitIonToWasmCall");
     return;
   }
 
--- a/js/src/jit/shared/LIR-shared.h
+++ b/js/src/jit/shared/LIR-shared.h
@@ -7473,16 +7473,24 @@ class LIonToWasmCall : public LIonToWasm
 class LIonToWasmCallV : public LIonToWasmCallBase<BOX_PIECES> {
  public:
   LIR_HEADER(IonToWasmCallV);
   LIonToWasmCallV(uint32_t numOperands, const LDefinition& temp,
                   const LDefinition& fp)
       : LIonToWasmCallBase<BOX_PIECES>(classOpcode, numOperands, temp, fp) {}
 };
 
+class LIonToWasmCallI64 : public LIonToWasmCallBase<INT64_PIECES> {
+ public:
+  LIR_HEADER(IonToWasmCallI64);
+  LIonToWasmCallI64(uint32_t numOperands, const LDefinition& temp,
+                    const LDefinition& fp)
+      : LIonToWasmCallBase<INT64_PIECES>(classOpcode, numOperands, temp, fp) {}
+};
+
 class LWasmBoxValue : public LInstructionHelper<1, BOX_PIECES, 0> {
  public:
   LIR_HEADER(WasmBoxValue)
 
   explicit LWasmBoxValue(const LBoxAllocation& input)
       : LInstructionHelper(classOpcode) {
     setBoxOperand(Input, input);
   }