зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 3 changesets (bug 1870747) for causing SM failures in CodeGenerator.cpp CLOSED TREE
Backed out changeset be7423b15b7d (bug 1870747) Backed out changeset 8a1b27094514 (bug 1870747) Backed out changeset a40c148875f1 (bug 1870747)
This commit is contained in:
Родитель
03b4491aa1
Коммит
fb249bfedd
|
@ -1,7 +0,0 @@
|
|||
// |jit-test| --fast-warmup; --no-threads; --ion-check-range-analysis; --arm-hwcap=vfp
|
||||
function foo(x) { return x % -1; }
|
||||
|
||||
with ({}) {}
|
||||
for (var i = 0; i < 1000; i++) {
|
||||
foo(i);
|
||||
}
|
|
@ -20,17 +20,17 @@ namespace js::jit {
|
|||
|
||||
static inline MIRType ToMIRType(MIRType t) { return t; }
|
||||
|
||||
static inline MIRType ToMIRType(ABIType argType) {
|
||||
static inline MIRType ToMIRType(ABIArgType argType) {
|
||||
switch (argType) {
|
||||
case ABIType::General:
|
||||
case ArgType_General:
|
||||
return MIRType::Pointer;
|
||||
case ABIType::Float64:
|
||||
case ArgType_Float64:
|
||||
return MIRType::Double;
|
||||
case ABIType::Float32:
|
||||
case ArgType_Float32:
|
||||
return MIRType::Float32;
|
||||
case ABIType::Int32:
|
||||
case ArgType_Int32:
|
||||
return MIRType::Int32;
|
||||
case ABIType::Int64:
|
||||
case ArgType_Int64:
|
||||
return MIRType::Int64;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -15,32 +15,33 @@
|
|||
namespace js {
|
||||
namespace jit {
|
||||
|
||||
enum class ABIType {
|
||||
enum ABIArgType {
|
||||
// A pointer sized integer
|
||||
General = 0x1,
|
||||
ArgType_General = 0x1,
|
||||
// A 32-bit integer
|
||||
Int32 = 0x2,
|
||||
ArgType_Int32 = 0x2,
|
||||
// A 64-bit integer
|
||||
Int64 = 0x3,
|
||||
ArgType_Int64 = 0x3,
|
||||
// A 32-bit floating point number
|
||||
Float32 = 0x4,
|
||||
ArgType_Float32 = 0x4,
|
||||
// A 64-bit floating point number
|
||||
Float64 = 0x5
|
||||
};
|
||||
ArgType_Float64 = 0x5,
|
||||
|
||||
const size_t ABITypeArgShift = 0x3;
|
||||
const size_t ABITypeArgMask = (1 << ABITypeArgShift) - 1;
|
||||
RetType_Shift = 0x0,
|
||||
ArgType_Shift = 0x3,
|
||||
ArgType_Mask = 0x7
|
||||
};
|
||||
|
||||
namespace detail {
|
||||
|
||||
static constexpr uint64_t MakeABIFunctionType(
|
||||
ABIType ret, std::initializer_list<ABIType> args) {
|
||||
ABIArgType ret, std::initializer_list<ABIArgType> args) {
|
||||
uint64_t abiType = 0;
|
||||
for (auto arg : args) {
|
||||
abiType <<= ABITypeArgShift;
|
||||
abiType <<= ArgType_Shift;
|
||||
abiType |= (uint64_t)arg;
|
||||
}
|
||||
abiType <<= ABITypeArgShift;
|
||||
abiType <<= ArgType_Shift;
|
||||
abiType |= (uint64_t)ret;
|
||||
return abiType;
|
||||
}
|
||||
|
@ -54,7 +55,7 @@ enum ABIFunctionType : uint64_t {
|
|||
};
|
||||
|
||||
static constexpr ABIFunctionType MakeABIFunctionType(
|
||||
ABIType ret, std::initializer_list<ABIType> args) {
|
||||
ABIArgType ret, std::initializer_list<ABIArgType> args) {
|
||||
return ABIFunctionType(detail::MakeABIFunctionType(ret, args));
|
||||
}
|
||||
|
||||
|
|
|
@ -3072,9 +3072,9 @@ bool CacheIRCompiler::emitDoubleModResult(NumberOperandId lhsId,
|
|||
|
||||
using Fn = double (*)(double a, double b);
|
||||
masm.setupUnalignedABICall(scratch);
|
||||
masm.passABIArg(floatScratch0, ABIType::Float64);
|
||||
masm.passABIArg(floatScratch1, ABIType::Float64);
|
||||
masm.callWithABI<Fn, js::NumberMod>(ABIType::Float64);
|
||||
masm.passABIArg(floatScratch0, MoveOp::DOUBLE);
|
||||
masm.passABIArg(floatScratch1, MoveOp::DOUBLE);
|
||||
masm.callWithABI<Fn, js::NumberMod>(MoveOp::DOUBLE);
|
||||
masm.storeCallFloatResult(floatScratch0);
|
||||
|
||||
LiveRegisterSet ignore;
|
||||
|
@ -3102,9 +3102,9 @@ bool CacheIRCompiler::emitDoublePowResult(NumberOperandId lhsId,
|
|||
|
||||
using Fn = double (*)(double x, double y);
|
||||
masm.setupUnalignedABICall(scratch);
|
||||
masm.passABIArg(floatScratch0, ABIType::Float64);
|
||||
masm.passABIArg(floatScratch1, ABIType::Float64);
|
||||
masm.callWithABI<Fn, js::ecmaPow>(ABIType::Float64);
|
||||
masm.passABIArg(floatScratch0, MoveOp::DOUBLE);
|
||||
masm.passABIArg(floatScratch1, MoveOp::DOUBLE);
|
||||
masm.callWithABI<Fn, js::ecmaPow>(MoveOp::DOUBLE);
|
||||
masm.storeCallFloatResult(floatScratch0);
|
||||
|
||||
LiveRegisterSet ignore;
|
||||
|
@ -3659,8 +3659,8 @@ bool CacheIRCompiler::emitTruncateDoubleToUInt32(NumberOperandId inputId,
|
|||
|
||||
using Fn = int32_t (*)(double);
|
||||
masm.setupUnalignedABICall(res);
|
||||
masm.passABIArg(floatReg, ABIType::Float64);
|
||||
masm.callWithABI<Fn, JS::ToInt32>(ABIType::General,
|
||||
masm.passABIArg(floatReg, MoveOp::DOUBLE);
|
||||
masm.callWithABI<Fn, JS::ToInt32>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
masm.storeCallInt32Result(res);
|
||||
|
||||
|
@ -5450,10 +5450,10 @@ bool CacheIRCompiler::emitMathHypot2NumberResult(NumberOperandId first,
|
|||
|
||||
using Fn = double (*)(double x, double y);
|
||||
masm.setupUnalignedABICall(scratch);
|
||||
masm.passABIArg(floatScratch0, ABIType::Float64);
|
||||
masm.passABIArg(floatScratch1, ABIType::Float64);
|
||||
masm.passABIArg(floatScratch0, MoveOp::DOUBLE);
|
||||
masm.passABIArg(floatScratch1, MoveOp::DOUBLE);
|
||||
|
||||
masm.callWithABI<Fn, ecmaHypot>(ABIType::Float64);
|
||||
masm.callWithABI<Fn, ecmaHypot>(MoveOp::DOUBLE);
|
||||
masm.storeCallFloatResult(floatScratch0);
|
||||
|
||||
LiveRegisterSet ignore;
|
||||
|
@ -5484,11 +5484,11 @@ bool CacheIRCompiler::emitMathHypot3NumberResult(NumberOperandId first,
|
|||
|
||||
using Fn = double (*)(double x, double y, double z);
|
||||
masm.setupUnalignedABICall(scratch);
|
||||
masm.passABIArg(floatScratch0, ABIType::Float64);
|
||||
masm.passABIArg(floatScratch1, ABIType::Float64);
|
||||
masm.passABIArg(floatScratch2, ABIType::Float64);
|
||||
masm.passABIArg(floatScratch0, MoveOp::DOUBLE);
|
||||
masm.passABIArg(floatScratch1, MoveOp::DOUBLE);
|
||||
masm.passABIArg(floatScratch2, MoveOp::DOUBLE);
|
||||
|
||||
masm.callWithABI<Fn, hypot3>(ABIType::Float64);
|
||||
masm.callWithABI<Fn, hypot3>(MoveOp::DOUBLE);
|
||||
masm.storeCallFloatResult(floatScratch0);
|
||||
|
||||
LiveRegisterSet ignore;
|
||||
|
@ -5522,12 +5522,12 @@ bool CacheIRCompiler::emitMathHypot4NumberResult(NumberOperandId first,
|
|||
|
||||
using Fn = double (*)(double x, double y, double z, double w);
|
||||
masm.setupUnalignedABICall(scratch);
|
||||
masm.passABIArg(floatScratch0, ABIType::Float64);
|
||||
masm.passABIArg(floatScratch1, ABIType::Float64);
|
||||
masm.passABIArg(floatScratch2, ABIType::Float64);
|
||||
masm.passABIArg(floatScratch3, ABIType::Float64);
|
||||
masm.passABIArg(floatScratch0, MoveOp::DOUBLE);
|
||||
masm.passABIArg(floatScratch1, MoveOp::DOUBLE);
|
||||
masm.passABIArg(floatScratch2, MoveOp::DOUBLE);
|
||||
masm.passABIArg(floatScratch3, MoveOp::DOUBLE);
|
||||
|
||||
masm.callWithABI<Fn, hypot4>(ABIType::Float64);
|
||||
masm.callWithABI<Fn, hypot4>(MoveOp::DOUBLE);
|
||||
masm.storeCallFloatResult(floatScratch0);
|
||||
|
||||
LiveRegisterSet ignore;
|
||||
|
@ -5555,9 +5555,9 @@ bool CacheIRCompiler::emitMathAtan2NumberResult(NumberOperandId yId,
|
|||
|
||||
using Fn = double (*)(double x, double y);
|
||||
masm.setupUnalignedABICall(scratch);
|
||||
masm.passABIArg(floatScratch0, ABIType::Float64);
|
||||
masm.passABIArg(floatScratch1, ABIType::Float64);
|
||||
masm.callWithABI<Fn, js::ecmaAtan2>(ABIType::Float64);
|
||||
masm.passABIArg(floatScratch0, MoveOp::DOUBLE);
|
||||
masm.passABIArg(floatScratch1, MoveOp::DOUBLE);
|
||||
masm.callWithABI<Fn, js::ecmaAtan2>(MoveOp::DOUBLE);
|
||||
masm.storeCallFloatResult(floatScratch0);
|
||||
|
||||
LiveRegisterSet ignore;
|
||||
|
@ -5750,9 +5750,9 @@ bool CacheIRCompiler::emitMathFunctionNumberResultShared(
|
|||
masm.PushRegsInMask(save);
|
||||
|
||||
masm.setupUnalignedABICall(output.scratchReg());
|
||||
masm.passABIArg(inputScratch, ABIType::Float64);
|
||||
masm.passABIArg(inputScratch, MoveOp::DOUBLE);
|
||||
masm.callWithABI(DynamicFunction<UnaryMathFunctionType>(funPtr),
|
||||
ABIType::Float64);
|
||||
MoveOp::DOUBLE);
|
||||
masm.storeCallFloatResult(inputScratch);
|
||||
|
||||
masm.PopRegsInMask(save);
|
||||
|
@ -7189,11 +7189,11 @@ bool CacheIRCompiler::emitCompareBigIntNumberResult(JSOp op,
|
|||
// - |left <= right| is implemented as |right >= left|.
|
||||
// - |left > right| is implemented as |right < left|.
|
||||
if (op == JSOp::Le || op == JSOp::Gt) {
|
||||
masm.passABIArg(floatScratch0, ABIType::Float64);
|
||||
masm.passABIArg(floatScratch0, MoveOp::DOUBLE);
|
||||
masm.passABIArg(lhs);
|
||||
} else {
|
||||
masm.passABIArg(lhs);
|
||||
masm.passABIArg(floatScratch0, ABIType::Float64);
|
||||
masm.passABIArg(floatScratch0, MoveOp::DOUBLE);
|
||||
}
|
||||
|
||||
using FnBigIntNumber = bool (*)(BigInt*, double);
|
||||
|
@ -8202,7 +8202,7 @@ bool CacheIRCompiler::emitCallNumberToString(NumberOperandId inputId,
|
|||
masm.setupUnalignedABICall(result);
|
||||
masm.loadJSContext(result);
|
||||
masm.passABIArg(result);
|
||||
masm.passABIArg(floatScratch0, ABIType::Float64);
|
||||
masm.passABIArg(floatScratch0, MoveOp::DOUBLE);
|
||||
masm.callWithABI<Fn, js::NumberToStringPure>();
|
||||
|
||||
masm.storeCallPointerResult(result);
|
||||
|
|
|
@ -1738,8 +1738,8 @@ static void EmitStoreBufferMutation(MacroAssembler& masm, Register holder,
|
|||
}
|
||||
masm.passABIArg(buffer);
|
||||
masm.passABIArg(addrReg);
|
||||
masm.callWithABI(DynamicFunction<StoreBufferMutationFn>(fun),
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
masm.callWithABI(DynamicFunction<StoreBufferMutationFn>(fun), MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
if (needExtraReg) {
|
||||
masm.pop(holder);
|
||||
|
@ -5537,7 +5537,7 @@ void CodeGenerator::emitCallNative(LCallIns* call, JSNative native) {
|
|||
}
|
||||
#endif
|
||||
if (!emittedCall) {
|
||||
masm.callWithABI(DynamicFunction<JSNative>(native), ABIType::General,
|
||||
masm.callWithABI(DynamicFunction<JSNative>(native), MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
}
|
||||
|
||||
|
@ -5706,7 +5706,7 @@ void CodeGenerator::visitCallDOMNative(LCallDOMNative* call) {
|
|||
masm.passABIArg(argArgs);
|
||||
ensureOsiSpace();
|
||||
masm.callWithABI(DynamicFunction<JSJitMethodOp>(target->jitInfo()->method),
|
||||
ABIType::General,
|
||||
MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
if (target->jitInfo()->isInfallible) {
|
||||
|
@ -7441,9 +7441,9 @@ void CodeGenerator::visitAtan2D(LAtan2D* lir) {
|
|||
|
||||
using Fn = double (*)(double x, double y);
|
||||
masm.setupAlignedABICall();
|
||||
masm.passABIArg(y, ABIType::Float64);
|
||||
masm.passABIArg(x, ABIType::Float64);
|
||||
masm.callWithABI<Fn, ecmaAtan2>(ABIType::Float64);
|
||||
masm.passABIArg(y, MoveOp::DOUBLE);
|
||||
masm.passABIArg(x, MoveOp::DOUBLE);
|
||||
masm.callWithABI<Fn, ecmaAtan2>(MoveOp::DOUBLE);
|
||||
|
||||
MOZ_ASSERT(ToFloatRegister(lir->output()) == ReturnDoubleReg);
|
||||
}
|
||||
|
@ -7453,23 +7453,23 @@ void CodeGenerator::visitHypot(LHypot* lir) {
|
|||
masm.setupAlignedABICall();
|
||||
|
||||
for (uint32_t i = 0; i < numArgs; ++i) {
|
||||
masm.passABIArg(ToFloatRegister(lir->getOperand(i)), ABIType::Float64);
|
||||
masm.passABIArg(ToFloatRegister(lir->getOperand(i)), MoveOp::DOUBLE);
|
||||
}
|
||||
|
||||
switch (numArgs) {
|
||||
case 2: {
|
||||
using Fn = double (*)(double x, double y);
|
||||
masm.callWithABI<Fn, ecmaHypot>(ABIType::Float64);
|
||||
masm.callWithABI<Fn, ecmaHypot>(MoveOp::DOUBLE);
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
using Fn = double (*)(double x, double y, double z);
|
||||
masm.callWithABI<Fn, hypot3>(ABIType::Float64);
|
||||
masm.callWithABI<Fn, hypot3>(MoveOp::DOUBLE);
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
using Fn = double (*)(double x, double y, double z, double w);
|
||||
masm.callWithABI<Fn, hypot4>(ABIType::Float64);
|
||||
masm.callWithABI<Fn, hypot4>(MoveOp::DOUBLE);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -9330,7 +9330,7 @@ void CodeGenerator::visitOutOfLineWasmCallPostWriteBarrier(
|
|||
masm.passABIArg(temp);
|
||||
int32_t instanceOffset = masm.framePushed() - framePushedAfterInstance;
|
||||
masm.callWithABI(wasm::BytecodeOffset(0), wasm::SymbolicAddress::PostBarrier,
|
||||
mozilla::Some(instanceOffset), ABIType::General);
|
||||
mozilla::Some(instanceOffset), MoveOp::GENERAL);
|
||||
|
||||
masm.Pop(InstanceReg);
|
||||
restoreLiveVolatile(ool->lir());
|
||||
|
@ -9576,10 +9576,10 @@ void CodeGenerator::visitPowI(LPowI* ins) {
|
|||
|
||||
using Fn = double (*)(double x, int32_t y);
|
||||
masm.setupAlignedABICall();
|
||||
masm.passABIArg(value, ABIType::Float64);
|
||||
masm.passABIArg(value, MoveOp::DOUBLE);
|
||||
masm.passABIArg(power);
|
||||
|
||||
masm.callWithABI<Fn, js::powi>(ABIType::Float64);
|
||||
masm.callWithABI<Fn, js::powi>(MoveOp::DOUBLE);
|
||||
MOZ_ASSERT(ToFloatRegister(ins->output()) == ReturnDoubleReg);
|
||||
}
|
||||
|
||||
|
@ -9589,9 +9589,9 @@ void CodeGenerator::visitPowD(LPowD* ins) {
|
|||
|
||||
using Fn = double (*)(double x, double y);
|
||||
masm.setupAlignedABICall();
|
||||
masm.passABIArg(value, ABIType::Float64);
|
||||
masm.passABIArg(power, ABIType::Float64);
|
||||
masm.callWithABI<Fn, ecmaPow>(ABIType::Float64);
|
||||
masm.passABIArg(value, MoveOp::DOUBLE);
|
||||
masm.passABIArg(power, MoveOp::DOUBLE);
|
||||
masm.callWithABI<Fn, ecmaPow>(MoveOp::DOUBLE);
|
||||
|
||||
MOZ_ASSERT(ToFloatRegister(ins->output()) == ReturnDoubleReg);
|
||||
}
|
||||
|
@ -9672,9 +9672,9 @@ void CodeGenerator::visitMathFunctionD(LMathFunctionD* ins) {
|
|||
|
||||
masm.setupAlignedABICall();
|
||||
|
||||
masm.passABIArg(input, ABIType::Float64);
|
||||
masm.passABIArg(input, MoveOp::DOUBLE);
|
||||
masm.callWithABI(DynamicFunction<UnaryMathFunctionType>(funPtr),
|
||||
ABIType::Float64);
|
||||
MoveOp::DOUBLE);
|
||||
}
|
||||
|
||||
void CodeGenerator::visitMathFunctionF(LMathFunctionF* ins) {
|
||||
|
@ -9682,7 +9682,7 @@ void CodeGenerator::visitMathFunctionF(LMathFunctionF* ins) {
|
|||
MOZ_ASSERT(ToFloatRegister(ins->output()) == ReturnFloat32Reg);
|
||||
|
||||
masm.setupAlignedABICall();
|
||||
masm.passABIArg(input, ABIType::Float32);
|
||||
masm.passABIArg(input, MoveOp::FLOAT32);
|
||||
|
||||
using Fn = float (*)(float x);
|
||||
Fn funptr = nullptr;
|
||||
|
@ -9706,7 +9706,7 @@ void CodeGenerator::visitMathFunctionF(LMathFunctionF* ins) {
|
|||
MOZ_CRASH("Unknown or unsupported float32 math function");
|
||||
}
|
||||
|
||||
masm.callWithABI(DynamicFunction<Fn>(funptr), ABIType::Float32, check);
|
||||
masm.callWithABI(DynamicFunction<Fn>(funptr), MoveOp::FLOAT32, check);
|
||||
}
|
||||
|
||||
void CodeGenerator::visitModD(LModD* ins) {
|
||||
|
@ -9719,9 +9719,9 @@ void CodeGenerator::visitModD(LModD* ins) {
|
|||
|
||||
using Fn = double (*)(double a, double b);
|
||||
masm.setupAlignedABICall();
|
||||
masm.passABIArg(lhs, ABIType::Float64);
|
||||
masm.passABIArg(rhs, ABIType::Float64);
|
||||
masm.callWithABI<Fn, NumberMod>(ABIType::Float64);
|
||||
masm.passABIArg(lhs, MoveOp::DOUBLE);
|
||||
masm.passABIArg(rhs, MoveOp::DOUBLE);
|
||||
masm.callWithABI<Fn, NumberMod>(MoveOp::DOUBLE);
|
||||
}
|
||||
|
||||
void CodeGenerator::visitModPowTwoD(LModPowTwoD* ins) {
|
||||
|
@ -9790,12 +9790,12 @@ void CodeGenerator::visitWasmBuiltinModD(LWasmBuiltinModD* ins) {
|
|||
MOZ_ASSERT(ToFloatRegister(ins->output()) == ReturnDoubleReg);
|
||||
|
||||
masm.setupWasmABICall();
|
||||
masm.passABIArg(lhs, ABIType::Float64);
|
||||
masm.passABIArg(rhs, ABIType::Float64);
|
||||
masm.passABIArg(lhs, MoveOp::DOUBLE);
|
||||
masm.passABIArg(rhs, MoveOp::DOUBLE);
|
||||
|
||||
int32_t instanceOffset = masm.framePushed() - framePushedAfterInstance;
|
||||
masm.callWithABI(ins->mir()->bytecodeOffset(), wasm::SymbolicAddress::ModD,
|
||||
mozilla::Some(instanceOffset), ABIType::Float64);
|
||||
mozilla::Some(instanceOffset), MoveOp::DOUBLE);
|
||||
|
||||
masm.Pop(InstanceReg);
|
||||
}
|
||||
|
@ -11051,11 +11051,11 @@ void CodeGenerator::visitCompareBigIntDouble(LCompareBigIntDouble* lir) {
|
|||
// - |left <= right| is implemented as |right >= left|.
|
||||
// - |left > right| is implemented as |right < left|.
|
||||
if (op == JSOp::Le || op == JSOp::Gt) {
|
||||
masm.passABIArg(right, ABIType::Float64);
|
||||
masm.passABIArg(right, MoveOp::DOUBLE);
|
||||
masm.passABIArg(left);
|
||||
} else {
|
||||
masm.passABIArg(left);
|
||||
masm.passABIArg(right, ABIType::Float64);
|
||||
masm.passABIArg(right, MoveOp::DOUBLE);
|
||||
}
|
||||
|
||||
using FnBigIntNumber = bool (*)(BigInt*, double);
|
||||
|
@ -12082,7 +12082,7 @@ void JitRuntime::generateFreeStub(MacroAssembler& masm) {
|
|||
using Fn = void (*)(void* p);
|
||||
masm.setupUnalignedABICall(regTemp);
|
||||
masm.passABIArg(regSlots);
|
||||
masm.callWithABI<Fn, js_free>(ABIType::General,
|
||||
masm.callWithABI<Fn, js_free>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.PopRegsInMask(save);
|
||||
|
@ -12115,7 +12115,7 @@ void JitRuntime::generateLazyLinkStub(MacroAssembler& masm) {
|
|||
masm.passABIArg(temp0);
|
||||
masm.passABIArg(temp1);
|
||||
masm.callWithABI<Fn, LazyLinkTopActivation>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
// Discard exit frame and restore frame pointer.
|
||||
masm.leaveExitFrame(0);
|
||||
|
@ -12154,7 +12154,7 @@ void JitRuntime::generateInterpreterStub(MacroAssembler& masm) {
|
|||
masm.passABIArg(temp0);
|
||||
masm.passABIArg(temp1);
|
||||
masm.callWithABI<Fn, InvokeFromInterpreterStub>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
masm.branchIfFalseBool(ReturnReg, masm.failureLabel());
|
||||
|
||||
|
@ -17455,7 +17455,7 @@ void CodeGenerator::visitGetDOMProperty(LGetDOMProperty* ins) {
|
|||
masm.passABIArg(ValueReg);
|
||||
ensureOsiSpace();
|
||||
masm.callWithABI(DynamicFunction<JSJitGetterOp>(ins->mir()->fun()),
|
||||
ABIType::General,
|
||||
MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
if (ins->mir()->isInfallible()) {
|
||||
|
@ -17576,7 +17576,7 @@ void CodeGenerator::visitSetDOMProperty(LSetDOMProperty* ins) {
|
|||
masm.passABIArg(ValueReg);
|
||||
ensureOsiSpace();
|
||||
masm.callWithABI(DynamicFunction<JSJitSetterOp>(ins->mir()->fun()),
|
||||
ABIType::General,
|
||||
MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
masm.branchIfFalseBool(ReturnReg, masm.exceptionLabel());
|
||||
|
@ -18385,7 +18385,7 @@ void CodeGenerator::callWasmStructAllocFun(LInstruction* lir,
|
|||
int32_t instanceOffset = masm.framePushed() - framePushedAfterInstance;
|
||||
CodeOffset offset =
|
||||
masm.callWithABI(wasm::BytecodeOffset(0), fun,
|
||||
mozilla::Some(instanceOffset), ABIType::General);
|
||||
mozilla::Some(instanceOffset), MoveOp::GENERAL);
|
||||
masm.storeCallPointerResult(output);
|
||||
|
||||
markSafepointAt(offset.offset(), lir);
|
||||
|
|
|
@ -448,8 +448,8 @@ def main(c_out, yaml_path):
|
|||
contents = "#define ABI_FUNCTION_TYPE_ENUM \\\n"
|
||||
for func_type in func_types:
|
||||
name = "Args_" + func_type_name(func_type)
|
||||
args = ", ".join(f"ABIType::{p}" for p in func_type["args"])
|
||||
ret = f"ABIType::{func_type['ret']}"
|
||||
args = ", ".join(f"ArgType_{p}" for p in func_type["args"])
|
||||
ret = f"ArgType_{func_type['ret']}"
|
||||
|
||||
contents += f" {name} = detail::MakeABIFunctionType({ret}, {{{args}}}),\\\n"
|
||||
contents += "\n"
|
||||
|
|
|
@ -208,7 +208,7 @@ void JitRuntime::generateInterpreterEntryTrampoline(MacroAssembler& masm) {
|
|||
masm.passABIArg(arg0); // cx
|
||||
masm.passABIArg(arg1); // state
|
||||
masm.callWithABI<Fn, Interpret>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
#ifdef JS_CODEGEN_ARM64
|
||||
masm.syncStackPtr();
|
||||
|
|
|
@ -1157,8 +1157,7 @@ bool IonCacheIRCompiler::emitCallNativeGetterResult(
|
|||
masm.passABIArg(argJSContext);
|
||||
masm.passABIArg(argUintN);
|
||||
masm.passABIArg(argVp);
|
||||
masm.callWithABI(DynamicFunction<JSNative>(target->native()),
|
||||
ABIType::General,
|
||||
masm.callWithABI(DynamicFunction<JSNative>(target->native()), MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
// Test for failure.
|
||||
|
@ -1277,7 +1276,7 @@ bool IonCacheIRCompiler::emitProxyGetResult(ObjOperandId objId,
|
|||
masm.passABIArg(argId);
|
||||
masm.passABIArg(argVp);
|
||||
masm.callWithABI<Fn, ProxyGetProperty>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
// Test for failure.
|
||||
masm.branchIfFalseBool(ReturnReg, masm.exceptionLabel());
|
||||
|
@ -1634,8 +1633,7 @@ bool IonCacheIRCompiler::emitCallNativeSetter(ObjOperandId receiverId,
|
|||
masm.passABIArg(argJSContext);
|
||||
masm.passABIArg(argUintN);
|
||||
masm.passABIArg(argVp);
|
||||
masm.callWithABI(DynamicFunction<JSNative>(target->native()),
|
||||
ABIType::General,
|
||||
masm.callWithABI(DynamicFunction<JSNative>(target->native()), MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
// Test for failure.
|
||||
|
|
|
@ -137,40 +137,53 @@ CodeOffset MacroAssembler::call(const wasm::CallSiteDesc& desc,
|
|||
// ABI function calls.
|
||||
|
||||
void MacroAssembler::passABIArg(Register reg) {
|
||||
passABIArg(MoveOperand(reg), ABIType::General);
|
||||
passABIArg(MoveOperand(reg), MoveOp::GENERAL);
|
||||
}
|
||||
|
||||
void MacroAssembler::passABIArg(FloatRegister reg, ABIType type) {
|
||||
void MacroAssembler::passABIArg(FloatRegister reg, MoveOp::Type type) {
|
||||
passABIArg(MoveOperand(reg), type);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABI(DynFn fun, ABIType result,
|
||||
void MacroAssembler::callWithABI(DynFn fun, MoveOp::Type result,
|
||||
CheckUnsafeCallWithABI check) {
|
||||
AutoProfilerCallInstrumentation profiler(*this);
|
||||
callWithABINoProfiler(fun.address, result, check);
|
||||
}
|
||||
|
||||
template <typename Sig, Sig fun>
|
||||
void MacroAssembler::callWithABI(ABIType result, CheckUnsafeCallWithABI check) {
|
||||
void MacroAssembler::callWithABI(MoveOp::Type result,
|
||||
CheckUnsafeCallWithABI check) {
|
||||
ABIFunction<Sig, fun> abiFun;
|
||||
AutoProfilerCallInstrumentation profiler(*this);
|
||||
callWithABINoProfiler(abiFun.address(), result, check);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABI(Register fun, ABIType result) {
|
||||
void MacroAssembler::callWithABI(Register fun, MoveOp::Type result) {
|
||||
AutoProfilerCallInstrumentation profiler(*this);
|
||||
callWithABINoProfiler(fun, result);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABI(const Address& fun, ABIType result) {
|
||||
void MacroAssembler::callWithABI(const Address& fun, MoveOp::Type result) {
|
||||
AutoProfilerCallInstrumentation profiler(*this);
|
||||
callWithABINoProfiler(fun, result);
|
||||
}
|
||||
|
||||
void MacroAssembler::appendSignatureType(ABIType type) {
|
||||
void MacroAssembler::appendSignatureType(MoveOp::Type type) {
|
||||
#ifdef JS_SIMULATOR
|
||||
signature_ <<= ABITypeArgShift;
|
||||
signature_ |= uint32_t(type);
|
||||
signature_ <<= ArgType_Shift;
|
||||
switch (type) {
|
||||
case MoveOp::GENERAL:
|
||||
signature_ |= ArgType_General;
|
||||
break;
|
||||
case MoveOp::DOUBLE:
|
||||
signature_ |= ArgType_Float64;
|
||||
break;
|
||||
case MoveOp::FLOAT32:
|
||||
signature_ |= ArgType_Float32;
|
||||
break;
|
||||
default:
|
||||
MOZ_CRASH("Invalid argument type");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -202,7 +215,6 @@ ABIFunctionType MacroAssembler::signature() const {
|
|||
case Args_Int_IntDoubleIntInt:
|
||||
case Args_Double_DoubleDoubleDouble:
|
||||
case Args_Double_DoubleDoubleDoubleDouble:
|
||||
case Args_Int64_GeneralGeneral:
|
||||
break;
|
||||
default:
|
||||
MOZ_CRASH("Unexpected type");
|
||||
|
|
|
@ -3331,7 +3331,7 @@ void MacroAssembler::generateBailoutTail(Register scratch,
|
|||
setupUnalignedABICall(temp);
|
||||
passABIArg(bailoutInfo);
|
||||
callWithABI<Fn, FinishBailoutToBaseline>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
branchIfFalseBool(ReturnReg, exceptionLabel());
|
||||
|
||||
// Restore values where they need to be and resume execution.
|
||||
|
@ -3429,7 +3429,7 @@ void MacroAssembler::assumeUnreachable(const char* output) {
|
|||
setupUnalignedABICall(temp);
|
||||
movePtr(ImmPtr(output), temp);
|
||||
passABIArg(temp);
|
||||
callWithABI<Fn, AssumeUnreachable>(ABIType::General,
|
||||
callWithABI<Fn, AssumeUnreachable>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
PopRegsInMask(save);
|
||||
|
@ -3576,14 +3576,14 @@ void MacroAssembler::outOfLineTruncateSlow(FloatRegister src, Register dest,
|
|||
if (compilingWasm) {
|
||||
int32_t instanceOffset = framePushed() - framePushedAfterInstance;
|
||||
setupWasmABICall();
|
||||
passABIArg(src, ABIType::Float64);
|
||||
passABIArg(src, MoveOp::DOUBLE);
|
||||
callWithABI(callOffset, wasm::SymbolicAddress::ToInt32,
|
||||
mozilla::Some(instanceOffset));
|
||||
} else {
|
||||
using Fn = int32_t (*)(double);
|
||||
setupUnalignedABICall(dest);
|
||||
passABIArg(src, ABIType::Float64);
|
||||
callWithABI<Fn, JS::ToInt32>(ABIType::General,
|
||||
passABIArg(src, MoveOp::DOUBLE);
|
||||
callWithABI<Fn, JS::ToInt32>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
}
|
||||
storeCallInt32Result(dest);
|
||||
|
@ -4230,24 +4230,20 @@ void MacroAssembler::setupAlignedABICall() {
|
|||
dynamicAlignment_ = false;
|
||||
}
|
||||
|
||||
void MacroAssembler::passABIArg(const MoveOperand& from, ABIType type) {
|
||||
void MacroAssembler::passABIArg(const MoveOperand& from, MoveOp::Type type) {
|
||||
MOZ_ASSERT(inCall_);
|
||||
appendSignatureType(type);
|
||||
|
||||
ABIArg arg;
|
||||
MoveOp::Type moveType;
|
||||
switch (type) {
|
||||
case ABIType::Float32:
|
||||
case MoveOp::FLOAT32:
|
||||
arg = abiArgs_.next(MIRType::Float32);
|
||||
moveType = MoveOp::FLOAT32;
|
||||
break;
|
||||
case ABIType::Float64:
|
||||
case MoveOp::DOUBLE:
|
||||
arg = abiArgs_.next(MIRType::Double);
|
||||
moveType = MoveOp::DOUBLE;
|
||||
break;
|
||||
case ABIType::General:
|
||||
case MoveOp::GENERAL:
|
||||
arg = abiArgs_.next(MIRType::Pointer);
|
||||
moveType = MoveOp::GENERAL;
|
||||
break;
|
||||
default:
|
||||
MOZ_CRASH("Unexpected argument type");
|
||||
|
@ -4261,10 +4257,10 @@ void MacroAssembler::passABIArg(const MoveOperand& from, ABIType type) {
|
|||
if (oom()) {
|
||||
return;
|
||||
}
|
||||
propagateOOM(moveResolver_.addMove(from, to, moveType));
|
||||
propagateOOM(moveResolver_.addMove(from, to, type));
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(void* fun, ABIType result,
|
||||
void MacroAssembler::callWithABINoProfiler(void* fun, MoveOp::Type result,
|
||||
CheckUnsafeCallWithABI check) {
|
||||
appendSignatureType(result);
|
||||
#ifdef JS_SIMULATOR
|
||||
|
@ -4309,7 +4305,7 @@ void MacroAssembler::callWithABINoProfiler(void* fun, ABIType result,
|
|||
CodeOffset MacroAssembler::callWithABI(wasm::BytecodeOffset bytecode,
|
||||
wasm::SymbolicAddress imm,
|
||||
mozilla::Maybe<int32_t> instanceOffset,
|
||||
ABIType result) {
|
||||
MoveOp::Type result) {
|
||||
MOZ_ASSERT(wasm::NeedsBuiltinThunk(imm));
|
||||
|
||||
uint32_t stackAdjust;
|
||||
|
@ -4331,7 +4327,7 @@ CodeOffset MacroAssembler::callWithABI(wasm::BytecodeOffset bytecode,
|
|||
}
|
||||
|
||||
void MacroAssembler::callDebugWithABI(wasm::SymbolicAddress imm,
|
||||
ABIType result) {
|
||||
MoveOp::Type result) {
|
||||
MOZ_ASSERT(!wasm::NeedsBuiltinThunk(imm));
|
||||
uint32_t stackAdjust;
|
||||
callWithABIPre(&stackAdjust, /* callFromWasm = */ false);
|
||||
|
|
|
@ -721,9 +721,9 @@ class MacroAssembler : public MacroAssemblerSpecific {
|
|||
// 3) Passing arguments. Arguments are passed left-to-right.
|
||||
//
|
||||
// masm.passABIArg(scratch);
|
||||
// masm.passABIArg(FloatOp0, ABIType::Float64);
|
||||
// masm.passABIArg(FloatOp0, MoveOp::Double);
|
||||
//
|
||||
// Note how float register arguments are annotated with ABIType::Float64.
|
||||
// Note how float register arguments are annotated with MoveOp::Double.
|
||||
//
|
||||
// Concerning stack-relative address, see the note on passABIArg.
|
||||
//
|
||||
|
@ -736,7 +736,7 @@ class MacroAssembler : public MacroAssemblerSpecific {
|
|||
// indicated to the callWithABI like this:
|
||||
//
|
||||
// using Fn = double (*)(int32_t)
|
||||
// masm.callWithABI<Fn, Callee>(ABIType::Float64);
|
||||
// masm.callWithABI<Fn, Callee>(MoveOp::DOUBLE);
|
||||
//
|
||||
// There are overloads to allow calls to registers and addresses.
|
||||
//
|
||||
|
@ -795,26 +795,26 @@ class MacroAssembler : public MacroAssemblerSpecific {
|
|||
// automatically adjusted. It is extremely important that esp-relative
|
||||
// addresses are computed *after* setupABICall(). Furthermore, no
|
||||
// operations should be emitted while setting arguments.
|
||||
void passABIArg(const MoveOperand& from, ABIType type);
|
||||
void passABIArg(const MoveOperand& from, MoveOp::Type type);
|
||||
inline void passABIArg(Register reg);
|
||||
inline void passABIArg(FloatRegister reg, ABIType type);
|
||||
inline void passABIArg(FloatRegister reg, MoveOp::Type type);
|
||||
|
||||
inline void callWithABI(
|
||||
DynFn fun, ABIType result = ABIType::General,
|
||||
DynFn fun, MoveOp::Type result = MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI check = CheckUnsafeCallWithABI::Check);
|
||||
template <typename Sig, Sig fun>
|
||||
inline void callWithABI(
|
||||
ABIType result = ABIType::General,
|
||||
MoveOp::Type result = MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI check = CheckUnsafeCallWithABI::Check);
|
||||
inline void callWithABI(Register fun, ABIType result = ABIType::General);
|
||||
inline void callWithABI(Register fun, MoveOp::Type result = MoveOp::GENERAL);
|
||||
inline void callWithABI(const Address& fun,
|
||||
ABIType result = ABIType::General);
|
||||
MoveOp::Type result = MoveOp::GENERAL);
|
||||
|
||||
CodeOffset callWithABI(wasm::BytecodeOffset offset, wasm::SymbolicAddress fun,
|
||||
mozilla::Maybe<int32_t> instanceOffset,
|
||||
ABIType result = ABIType::General);
|
||||
MoveOp::Type result = MoveOp::GENERAL);
|
||||
void callDebugWithABI(wasm::SymbolicAddress fun,
|
||||
ABIType result = ABIType::General);
|
||||
MoveOp::Type result = MoveOp::GENERAL);
|
||||
|
||||
private:
|
||||
// Reinitialize the variables which have to be cleared before making a call
|
||||
|
@ -831,18 +831,18 @@ class MacroAssembler : public MacroAssemblerSpecific {
|
|||
bool callFromWasm = false) PER_ARCH;
|
||||
|
||||
// Emits a call to a C/C++ function, resolving all argument moves.
|
||||
void callWithABINoProfiler(void* fun, ABIType result,
|
||||
void callWithABINoProfiler(void* fun, MoveOp::Type result,
|
||||
CheckUnsafeCallWithABI check);
|
||||
void callWithABINoProfiler(Register fun, ABIType result) PER_ARCH;
|
||||
void callWithABINoProfiler(const Address& fun, ABIType result) PER_ARCH;
|
||||
void callWithABINoProfiler(Register fun, MoveOp::Type result) PER_ARCH;
|
||||
void callWithABINoProfiler(const Address& fun, MoveOp::Type result) PER_ARCH;
|
||||
|
||||
// Restore the stack to its state before the setup function call.
|
||||
void callWithABIPost(uint32_t stackAdjust, ABIType result,
|
||||
void callWithABIPost(uint32_t stackAdjust, MoveOp::Type result,
|
||||
bool callFromWasm = false) PER_ARCH;
|
||||
|
||||
// Create the signature to be able to decode the arguments of a native
|
||||
// function, when calling a function within the simulator.
|
||||
inline void appendSignatureType(ABIType type);
|
||||
inline void appendSignatureType(MoveOp::Type type);
|
||||
inline ABIFunctionType signature() const;
|
||||
|
||||
// Private variables used to handle moves between registers given as
|
||||
|
|
|
@ -574,7 +574,7 @@ void CodeGenerator::visitSoftDivI(LSoftDivI* ins) {
|
|||
masm.passABIArg(lhs);
|
||||
masm.passABIArg(rhs);
|
||||
masm.callWithABI<Fn, __aeabi_idivmod>(
|
||||
ABIType::Int64, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
}
|
||||
|
||||
// idivmod returns the quotient in r0, and the remainder in r1.
|
||||
|
@ -764,7 +764,7 @@ void CodeGenerator::visitSoftModI(LSoftModI* ins) {
|
|||
masm.passABIArg(lhs);
|
||||
masm.passABIArg(rhs);
|
||||
masm.callWithABI<Fn, __aeabi_idivmod>(
|
||||
ABIType::Int64, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
}
|
||||
|
||||
MOZ_ASSERT(r1 != output);
|
||||
|
@ -866,7 +866,7 @@ void CodeGeneratorARM::emitBigIntDiv(LBigIntDiv* ins, Register dividend,
|
|||
masm.setupUnalignedABICall(output);
|
||||
masm.passABIArg(dividend);
|
||||
masm.passABIArg(divisor);
|
||||
masm.callWithABI<Fn, __aeabi_idivmod>(ABIType::Int64,
|
||||
masm.callWithABI<Fn, __aeabi_idivmod>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.PopRegsInMask(volatileRegs);
|
||||
|
@ -909,7 +909,7 @@ void CodeGeneratorARM::emitBigIntMod(LBigIntMod* ins, Register dividend,
|
|||
masm.setupUnalignedABICall(output);
|
||||
masm.passABIArg(dividend);
|
||||
masm.passABIArg(divisor);
|
||||
masm.callWithABI<Fn, __aeabi_idivmod>(ABIType::Int64,
|
||||
masm.callWithABI<Fn, __aeabi_idivmod>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.PopRegsInMask(volatileRegs);
|
||||
|
@ -2344,7 +2344,7 @@ void CodeGenerator::visitSoftUDivOrMod(LSoftUDivOrMod* ins) {
|
|||
masm.passABIArg(lhs);
|
||||
masm.passABIArg(rhs);
|
||||
masm.callWithABI<Fn, __aeabi_uidivmod>(
|
||||
ABIType::Int64, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
}
|
||||
|
||||
if (mod) {
|
||||
|
@ -2461,7 +2461,7 @@ void CodeGenerator::visitWasmTruncateToInt64(LWasmTruncateToInt64* lir) {
|
|||
masm.Push(input);
|
||||
|
||||
masm.setupWasmABICall();
|
||||
masm.passABIArg(inputDouble, ABIType::Float64);
|
||||
masm.passABIArg(inputDouble, MoveOp::DOUBLE);
|
||||
|
||||
int32_t instanceOffset = masm.framePushed() - framePushedAfterInstance;
|
||||
if (lir->mir()->isSaturating()) {
|
||||
|
@ -2544,8 +2544,8 @@ void CodeGenerator::visitInt64ToFloatingPointCall(
|
|||
: wasm::SymbolicAddress::Int64ToDouble);
|
||||
|
||||
int32_t instanceOffset = masm.framePushed() - framePushedAfterInstance;
|
||||
ABIType result =
|
||||
toType == MIRType::Float32 ? ABIType::Float32 : ABIType::Float64;
|
||||
MoveOp::Type result =
|
||||
toType == MIRType::Float32 ? MoveOp::FLOAT32 : MoveOp::DOUBLE;
|
||||
masm.callWithABI(mir->bytecodeOffset(), callee, mozilla::Some(instanceOffset),
|
||||
result);
|
||||
|
||||
|
|
|
@ -3374,7 +3374,7 @@ void MacroAssemblerARMCompat::handleFailureWithHandlerTail(
|
|||
asMasm().setupUnalignedABICall(r1);
|
||||
asMasm().passABIArg(r0);
|
||||
asMasm().callWithABI<Fn, HandleException>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
Label entryFrame;
|
||||
Label catch_;
|
||||
|
@ -4531,7 +4531,7 @@ void MacroAssembler::callWithABIPre(uint32_t* stackAdjust, bool callFromWasm) {
|
|||
}
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, MoveOp::Type result,
|
||||
bool callFromWasm) {
|
||||
if (secondScratchReg_ != lr) {
|
||||
ma_mov(secondScratchReg_, lr);
|
||||
|
@ -4541,16 +4541,15 @@ void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
|||
// fixes up the return value for us.
|
||||
if (!callFromWasm && !UseHardFpABI()) {
|
||||
switch (result) {
|
||||
case ABIType::Float64:
|
||||
case MoveOp::DOUBLE:
|
||||
// Move double from r0/r1 to ReturnFloatReg.
|
||||
ma_vxfer(r0, r1, ReturnDoubleReg);
|
||||
break;
|
||||
case ABIType::Float32:
|
||||
case MoveOp::FLOAT32:
|
||||
// Move float32 from r0 to ReturnFloatReg.
|
||||
ma_vxfer(r0, ReturnFloat32Reg);
|
||||
break;
|
||||
case ABIType::General:
|
||||
case ABIType::Int64:
|
||||
case MoveOp::GENERAL:
|
||||
break;
|
||||
default:
|
||||
MOZ_CRASH("unexpected callWithABI result");
|
||||
|
@ -4571,7 +4570,7 @@ void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
|||
#endif
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, MoveOp::Type result) {
|
||||
// Load the callee in r12, as above.
|
||||
ma_mov(fun, r12);
|
||||
uint32_t stackAdjust;
|
||||
|
@ -4580,7 +4579,8 @@ void MacroAssembler::callWithABINoProfiler(Register fun, ABIType result) {
|
|||
callWithABIPost(stackAdjust, result);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun,
|
||||
MoveOp::Type result) {
|
||||
// Load the callee in r12, no instruction between the ldr and call should
|
||||
// clobber it. Note that we can't use fun.base because it may be one of the
|
||||
// IntArg registers clobbered before the call.
|
||||
|
@ -5940,10 +5940,10 @@ inline void EmitRemainderOrQuotient(bool isRemainder, MacroAssembler& masm,
|
|||
masm.passABIArg(rhs);
|
||||
if (isUnsigned) {
|
||||
masm.callWithABI<Fn, __aeabi_uidivmod>(
|
||||
ABIType::Int64, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
} else {
|
||||
masm.callWithABI<Fn, __aeabi_idivmod>(
|
||||
ABIType::Int64, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
}
|
||||
if (isRemainder) {
|
||||
masm.mov(ReturnRegVal1, lhsOutput);
|
||||
|
@ -5995,10 +5995,10 @@ void MacroAssembler::flexibleDivMod32(Register rhs, Register lhsOutput,
|
|||
passABIArg(lhsOutput);
|
||||
passABIArg(rhs);
|
||||
if (isUnsigned) {
|
||||
callWithABI<Fn, __aeabi_uidivmod>(ABIType::Int64,
|
||||
callWithABI<Fn, __aeabi_uidivmod>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
} else {
|
||||
callWithABI<Fn, __aeabi_idivmod>(ABIType::Int64,
|
||||
callWithABI<Fn, __aeabi_idivmod>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
}
|
||||
moveRegPair(ReturnRegVal0, ReturnRegVal1, lhsOutput, remOutput);
|
||||
|
|
|
@ -271,7 +271,7 @@ void JitRuntime::generateEnterJIT(JSContext* cx, MacroAssembler& masm) {
|
|||
masm.passABIArg(OsrFrameReg); // InterpreterFrame
|
||||
masm.passABIArg(numStackValues);
|
||||
masm.callWithABI<Fn, jit::InitBaselineFrameForOsr>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
Register jitcode = regs.takeAny();
|
||||
masm.pop(jitcode);
|
||||
|
@ -390,7 +390,7 @@ void JitRuntime::generateInvalidator(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.passABIArg(r0);
|
||||
masm.passABIArg(r1);
|
||||
masm.callWithABI<Fn, InvalidationBailout>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.pop(r2); // Get bailoutInfo outparam.
|
||||
|
||||
|
@ -566,7 +566,7 @@ static void GenerateBailoutThunk(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.passABIArg(r0);
|
||||
masm.passABIArg(r1);
|
||||
|
||||
masm.callWithABI<Fn, Bailout>(ABIType::General,
|
||||
masm.callWithABI<Fn, Bailout>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
masm.pop(r2); // Get the bailoutInfo outparam.
|
||||
|
||||
|
@ -627,26 +627,26 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
for (uint32_t explicitArg = 0; explicitArg < f.explicitArgs; explicitArg++) {
|
||||
switch (f.argProperties(explicitArg)) {
|
||||
case VMFunctionData::WordByValue:
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), ABIType::General);
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), MoveOp::GENERAL);
|
||||
argDisp += sizeof(void*);
|
||||
break;
|
||||
case VMFunctionData::DoubleByValue:
|
||||
// Values should be passed by reference, not by value, so we assert
|
||||
// that the argument is a double-precision float.
|
||||
MOZ_ASSERT(f.argPassedInFloatReg(explicitArg));
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), ABIType::Float64);
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), MoveOp::DOUBLE);
|
||||
argDisp += sizeof(double);
|
||||
break;
|
||||
case VMFunctionData::WordByRef:
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
argDisp += sizeof(void*);
|
||||
break;
|
||||
case VMFunctionData::DoubleByRef:
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
argDisp += 2 * sizeof(void*);
|
||||
break;
|
||||
}
|
||||
|
@ -658,10 +658,10 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
if (f.outParam != Type_Void) {
|
||||
masm.passABIArg(MoveOperand(FramePointer, outParamOffset,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
}
|
||||
|
||||
masm.callWithABI(nativeFun, ABIType::General,
|
||||
masm.callWithABI(nativeFun, MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
// Test for failure.
|
||||
|
|
|
@ -199,7 +199,7 @@ void MacroAssemblerCompat::handleFailureWithHandlerTail(Label* profilerExitTail,
|
|||
asMasm().setupUnalignedABICall(r1);
|
||||
asMasm().passABIArg(r0);
|
||||
asMasm().callWithABI<Fn, HandleException>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
Label entryFrame;
|
||||
Label catch_;
|
||||
|
@ -1515,7 +1515,7 @@ void MacroAssembler::callWithABIPre(uint32_t* stackAdjust, bool callFromWasm) {
|
|||
assertStackAlignment(ABIStackAlignment);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, MoveOp::Type result,
|
||||
bool callFromWasm) {
|
||||
// wasm operates without the need for dynamic alignment of SP.
|
||||
MOZ_ASSERT(!(dynamicAlignment_ && callFromWasm));
|
||||
|
@ -1561,7 +1561,7 @@ void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
|||
#endif
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, MoveOp::Type result) {
|
||||
vixl::UseScratchRegisterScope temps(this);
|
||||
const Register scratch = temps.AcquireX().asUnsized();
|
||||
movePtr(fun, scratch);
|
||||
|
@ -1572,7 +1572,8 @@ void MacroAssembler::callWithABINoProfiler(Register fun, ABIType result) {
|
|||
callWithABIPost(stackAdjust, result);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun,
|
||||
MoveOp::Type result) {
|
||||
vixl::UseScratchRegisterScope temps(this);
|
||||
const Register scratch = temps.AcquireX().asUnsized();
|
||||
loadPtr(fun, scratch);
|
||||
|
|
|
@ -233,7 +233,7 @@ void JitRuntime::generateEnterJIT(JSContext* cx, MacroAssembler& masm) {
|
|||
masm.passABIArg(reg_osrFrame); // InterpreterFrame.
|
||||
masm.passABIArg(reg_osrNStack);
|
||||
masm.callWithABI<Fn, jit::InitBaselineFrameForOsr>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
masm.pop(scratch);
|
||||
MOZ_ASSERT(scratch != ReturnReg);
|
||||
|
@ -395,7 +395,7 @@ void JitRuntime::generateInvalidator(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.passABIArg(r1);
|
||||
|
||||
masm.callWithABI<Fn, InvalidationBailout>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.pop(r2); // Get the bailoutInfo outparam.
|
||||
|
||||
|
@ -554,7 +554,7 @@ static void GenerateBailoutThunk(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.setupUnalignedABICall(r2);
|
||||
masm.passABIArg(r0);
|
||||
masm.passABIArg(r1);
|
||||
masm.callWithABI<Fn, Bailout>(ABIType::General,
|
||||
masm.callWithABI<Fn, Bailout>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
// Get the bailoutInfo outparam.
|
||||
|
@ -625,17 +625,16 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
for (uint32_t explicitArg = 0; explicitArg < f.explicitArgs; explicitArg++) {
|
||||
switch (f.argProperties(explicitArg)) {
|
||||
case VMFunctionData::WordByValue:
|
||||
masm.passABIArg(
|
||||
MoveOperand(FramePointer, argDisp),
|
||||
(f.argPassedInFloatReg(explicitArg) ? ABIType::Float64
|
||||
: ABIType::General));
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp),
|
||||
(f.argPassedInFloatReg(explicitArg) ? MoveOp::DOUBLE
|
||||
: MoveOp::GENERAL));
|
||||
argDisp += sizeof(void*);
|
||||
break;
|
||||
|
||||
case VMFunctionData::WordByRef:
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
argDisp += sizeof(void*);
|
||||
break;
|
||||
|
||||
|
@ -654,10 +653,10 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
if (f.outParam != Type_Void) {
|
||||
masm.passABIArg(MoveOperand(FramePointer, outParamOffset,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
}
|
||||
|
||||
masm.callWithABI(nativeFun, ABIType::General,
|
||||
masm.callWithABI(nativeFun, MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
// Test for failure.
|
||||
|
|
|
@ -2811,7 +2811,7 @@ void MacroAssembler::callWithABIPre(uint32_t* stackAdjust, bool callFromWasm) {
|
|||
assertStackAlignment(ABIStackAlignment);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, MoveOp::Type result,
|
||||
bool callFromWasm) {
|
||||
// Restore ra value (as stored in callWithABIPre()).
|
||||
loadPtr(Address(StackPointer, stackAdjust - sizeof(intptr_t)), ra);
|
||||
|
@ -2831,7 +2831,7 @@ void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
|||
#endif
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, MoveOp::Type result) {
|
||||
SecondScratchRegisterScope scratch2(asMasm());
|
||||
// Load the callee in scratch2, no instruction between the movePtr and
|
||||
// call should clobber it. Note that we can't use fun because it may be
|
||||
|
@ -2844,7 +2844,8 @@ void MacroAssembler::callWithABINoProfiler(Register fun, ABIType result) {
|
|||
callWithABIPost(stackAdjust, result);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun,
|
||||
MoveOp::Type result) {
|
||||
SecondScratchRegisterScope scratch2(asMasm());
|
||||
// Load the callee in scratch2, as above.
|
||||
loadPtr(fun, scratch2);
|
||||
|
@ -5355,7 +5356,7 @@ void MacroAssemblerLOONG64Compat::handleFailureWithHandlerTail(
|
|||
asMasm().setupUnalignedABICall(a1);
|
||||
asMasm().passABIArg(a0);
|
||||
asMasm().callWithABI<Fn, HandleException>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
Label entryFrame;
|
||||
Label catch_;
|
||||
|
|
|
@ -249,7 +249,7 @@ void JitRuntime::generateEnterJIT(JSContext* cx, MacroAssembler& masm) {
|
|||
masm.passABIArg(OsrFrameReg); // InterpreterFrame
|
||||
masm.passABIArg(numStackValues);
|
||||
masm.callWithABI<Fn, jit::InitBaselineFrameForOsr>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
regs.add(OsrFrameReg);
|
||||
Register jitcode = regs.takeAny();
|
||||
|
@ -349,7 +349,7 @@ void JitRuntime::generateInvalidator(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.passABIArg(a0);
|
||||
masm.passABIArg(a1);
|
||||
masm.callWithABI<Fn, InvalidationBailout>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.pop(a2);
|
||||
|
||||
|
@ -575,7 +575,7 @@ static void GenerateBailoutThunk(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.setupUnalignedABICall(a2);
|
||||
masm.passABIArg(a0);
|
||||
masm.passABIArg(a1);
|
||||
masm.callWithABI<Fn, Bailout>(ABIType::General,
|
||||
masm.callWithABI<Fn, Bailout>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
// Get the bailoutInfo outparam.
|
||||
|
@ -641,16 +641,16 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
switch (f.argProperties(explicitArg)) {
|
||||
case VMFunctionData::WordByValue:
|
||||
if (f.argPassedInFloatReg(explicitArg)) {
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), ABIType::Float64);
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), MoveOp::DOUBLE);
|
||||
} else {
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), ABIType::General);
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), MoveOp::GENERAL);
|
||||
}
|
||||
argDisp += sizeof(void*);
|
||||
break;
|
||||
case VMFunctionData::WordByRef:
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
argDisp += sizeof(void*);
|
||||
break;
|
||||
case VMFunctionData::DoubleByValue:
|
||||
|
@ -667,10 +667,10 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
if (f.outParam != Type_Void) {
|
||||
masm.passABIArg(MoveOperand(FramePointer, outParamOffset,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
}
|
||||
|
||||
masm.callWithABI(nativeFun, ABIType::General,
|
||||
masm.callWithABI(nativeFun, MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
// Test for failure.
|
||||
|
|
|
@ -411,7 +411,7 @@ void CodeGenerator::visitWasmTruncateToInt64(LWasmTruncateToInt64* lir) {
|
|||
masm.Push(input);
|
||||
|
||||
masm.setupWasmABICall();
|
||||
masm.passABIArg(arg, ABIType::Float64);
|
||||
masm.passABIArg(arg, MoveOp::DOUBLE);
|
||||
|
||||
if (lir->mir()->isUnsigned()) {
|
||||
masm.callWithABI(mir->bytecodeOffset(),
|
||||
|
@ -430,7 +430,7 @@ void CodeGenerator::visitWasmTruncateToInt64(LWasmTruncateToInt64* lir) {
|
|||
masm.bind(ool->rejoin());
|
||||
} else {
|
||||
masm.setupWasmABICall();
|
||||
masm.passABIArg(arg, ABIType::Float64);
|
||||
masm.passABIArg(arg, MoveOp::DOUBLE);
|
||||
if (lir->mir()->isUnsigned()) {
|
||||
masm.callWithABI(mir->bytecodeOffset(),
|
||||
wasm::SymbolicAddress::SaturatingTruncateDoubleToUint64);
|
||||
|
@ -457,19 +457,18 @@ void CodeGenerator::visitInt64ToFloatingPoint(LInt64ToFloatingPoint* lir) {
|
|||
if (lir->mir()->isUnsigned()) {
|
||||
if (toType == MIRType::Double) {
|
||||
masm.callWithABI(mir->bytecodeOffset(),
|
||||
wasm::SymbolicAddress::Uint64ToDouble, ABIType::Float64);
|
||||
wasm::SymbolicAddress::Uint64ToDouble, MoveOp::DOUBLE);
|
||||
} else {
|
||||
masm.callWithABI(mir->bytecodeOffset(),
|
||||
wasm::SymbolicAddress::Uint64ToFloat32,
|
||||
ABIType::Float32);
|
||||
wasm::SymbolicAddress::Uint64ToFloat32, MoveOp::FLOAT32);
|
||||
}
|
||||
} else {
|
||||
if (toType == MIRType::Double) {
|
||||
masm.callWithABI(mir->bytecodeOffset(),
|
||||
wasm::SymbolicAddress::Int64ToDouble, ABIType::Float64);
|
||||
wasm::SymbolicAddress::Int64ToDouble, MoveOp::DOUBLE);
|
||||
} else {
|
||||
masm.callWithABI(mir->bytecodeOffset(),
|
||||
wasm::SymbolicAddress::Int64ToFloat32, ABIType::Float32);
|
||||
wasm::SymbolicAddress::Int64ToFloat32, MoveOp::FLOAT32);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1767,7 +1767,7 @@ void MacroAssemblerMIPSCompat::handleFailureWithHandlerTail(
|
|||
asMasm().setupUnalignedABICall(a1);
|
||||
asMasm().passABIArg(a0);
|
||||
asMasm().callWithABI<Fn, HandleException>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
Label entryFrame;
|
||||
Label catch_;
|
||||
|
@ -2119,7 +2119,7 @@ void MacroAssembler::callWithABIPre(uint32_t* stackAdjust, bool callFromWasm) {
|
|||
assertStackAlignment(ABIStackAlignment);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, MoveOp::Type result,
|
||||
bool callFromWasm) {
|
||||
// Restore ra value (as stored in callWithABIPre()).
|
||||
loadPtr(Address(StackPointer, stackAdjust - sizeof(intptr_t)), ra);
|
||||
|
@ -2139,7 +2139,7 @@ void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
|||
#endif
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, MoveOp::Type result) {
|
||||
// Load the callee in t9, no instruction between the lw and call
|
||||
// should clobber it. Note that we can't use fun.base because it may
|
||||
// be one of the IntArg registers clobbered before the call.
|
||||
|
@ -2150,7 +2150,8 @@ void MacroAssembler::callWithABINoProfiler(Register fun, ABIType result) {
|
|||
callWithABIPost(stackAdjust, result);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun,
|
||||
MoveOp::Type result) {
|
||||
// Load the callee in t9, as above.
|
||||
loadPtr(Address(fun.base, fun.offset), t9);
|
||||
uint32_t stackAdjust;
|
||||
|
|
|
@ -269,7 +269,7 @@ void JitRuntime::generateEnterJIT(JSContext* cx, MacroAssembler& masm) {
|
|||
masm.passABIArg(OsrFrameReg); // InterpreterFrame
|
||||
masm.passABIArg(numStackValues);
|
||||
masm.callWithABI<Fn, jit::InitBaselineFrameForOsr>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
regs.add(OsrFrameReg);
|
||||
regs.take(JSReturnOperand);
|
||||
|
@ -401,7 +401,7 @@ void JitRuntime::generateInvalidator(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.passABIArg(a1);
|
||||
masm.passABIArg(a2);
|
||||
masm.callWithABI<Fn, InvalidationBailout>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.loadPtr(Address(StackPointer, 0), a2);
|
||||
masm.loadPtr(Address(StackPointer, sizeof(uintptr_t)), a1);
|
||||
|
@ -629,7 +629,7 @@ static void GenerateBailoutThunk(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.setupAlignedABICall();
|
||||
masm.passABIArg(a0);
|
||||
masm.passABIArg(a1);
|
||||
masm.callWithABI<Fn, Bailout>(ABIType::General,
|
||||
masm.callWithABI<Fn, Bailout>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
// Get BailoutInfo pointer
|
||||
|
@ -775,20 +775,20 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
for (uint32_t explicitArg = 0; explicitArg < f.explicitArgs; explicitArg++) {
|
||||
switch (f.argProperties(explicitArg)) {
|
||||
case VMFunctionData::WordByValue:
|
||||
masm.passABIArg(MoveOperand(argsBase, argDisp), ABIType::General);
|
||||
masm.passABIArg(MoveOperand(argsBase, argDisp), MoveOp::GENERAL);
|
||||
argDisp += sizeof(uint32_t);
|
||||
break;
|
||||
case VMFunctionData::DoubleByValue:
|
||||
// Values should be passed by reference, not by value, so we
|
||||
// assert that the argument is a double-precision float.
|
||||
MOZ_ASSERT(f.argPassedInFloatReg(explicitArg));
|
||||
masm.passABIArg(MoveOperand(argsBase, argDisp), ABIType::Float64);
|
||||
masm.passABIArg(MoveOperand(argsBase, argDisp), MoveOp::DOUBLE);
|
||||
argDisp += sizeof(double);
|
||||
break;
|
||||
case VMFunctionData::WordByRef:
|
||||
masm.passABIArg(
|
||||
MoveOperand(argsBase, argDisp, MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
argDisp += sizeof(uint32_t);
|
||||
break;
|
||||
case VMFunctionData::DoubleByRef:
|
||||
|
@ -797,7 +797,7 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
masm.as_sdc1(ScratchDoubleReg, doubleArgs, doubleArgDisp);
|
||||
masm.passABIArg(MoveOperand(doubleArgs, doubleArgDisp,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
doubleArgDisp += sizeof(double);
|
||||
argDisp += sizeof(double);
|
||||
break;
|
||||
|
@ -811,10 +811,10 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
if (f.outParam != Type_Void) {
|
||||
masm.passABIArg(MoveOperand(doubleArgs, outParamOffset,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
}
|
||||
|
||||
masm.callWithABI(nativeFun, ABIType::General,
|
||||
masm.callWithABI(nativeFun, MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
// Test for failure.
|
||||
|
|
|
@ -1789,7 +1789,7 @@ void MacroAssemblerMIPS64Compat::handleFailureWithHandlerTail(
|
|||
asMasm().setupUnalignedABICall(a1);
|
||||
asMasm().passABIArg(a0);
|
||||
asMasm().callWithABI<Fn, HandleException>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
Label entryFrame;
|
||||
Label catch_;
|
||||
|
@ -2132,7 +2132,7 @@ void MacroAssembler::callWithABIPre(uint32_t* stackAdjust, bool callFromWasm) {
|
|||
assertStackAlignment(ABIStackAlignment);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, MoveOp::Type result,
|
||||
bool callFromWasm) {
|
||||
// Restore ra value (as stored in callWithABIPre()).
|
||||
loadPtr(Address(StackPointer, stackAdjust - sizeof(intptr_t)), ra);
|
||||
|
@ -2152,7 +2152,7 @@ void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
|||
#endif
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, MoveOp::Type result) {
|
||||
// Load the callee in t9, no instruction between the lw and call
|
||||
// should clobber it. Note that we can't use fun.base because it may
|
||||
// be one of the IntArg registers clobbered before the call.
|
||||
|
@ -2163,7 +2163,8 @@ void MacroAssembler::callWithABINoProfiler(Register fun, ABIType result) {
|
|||
callWithABIPost(stackAdjust, result);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun,
|
||||
MoveOp::Type result) {
|
||||
// Load the callee in t9, as above.
|
||||
loadPtr(Address(fun.base, fun.offset), t9);
|
||||
uint32_t stackAdjust;
|
||||
|
|
|
@ -30,7 +30,7 @@ void MoveEmitterMIPS64::breakCycle(const MoveOperand& from,
|
|||
masm.storeFloat32(to.floatReg(), cycleSlot(slotId));
|
||||
}
|
||||
break;
|
||||
case ABIType::Float64:
|
||||
case MoveOp::DOUBLE:
|
||||
if (to.isMemory()) {
|
||||
FloatRegister temp = ScratchDoubleReg;
|
||||
masm.loadDouble(getAdjustedAddress(to), temp);
|
||||
|
@ -85,7 +85,7 @@ void MoveEmitterMIPS64::completeCycle(const MoveOperand& from,
|
|||
masm.loadFloat32(cycleSlot(slotId), to.floatReg());
|
||||
}
|
||||
break;
|
||||
case ABIType::Float64:
|
||||
case MoveOp::DOUBLE:
|
||||
if (to.isMemory()) {
|
||||
FloatRegister temp = ScratchDoubleReg;
|
||||
masm.loadDouble(cycleSlot(slotId), temp);
|
||||
|
|
|
@ -285,7 +285,7 @@ void JitRuntime::generateEnterJIT(JSContext* cx, MacroAssembler& masm) {
|
|||
masm.passABIArg(OsrFrameReg); // InterpreterFrame
|
||||
masm.passABIArg(numStackValues);
|
||||
masm.callWithABI<Fn, jit::InitBaselineFrameForOsr>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
regs.add(OsrFrameReg);
|
||||
Register jitcode = regs.takeAny();
|
||||
|
@ -385,7 +385,7 @@ void JitRuntime::generateInvalidator(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.passABIArg(a0);
|
||||
masm.passABIArg(a1);
|
||||
masm.callWithABI<Fn, InvalidationBailout>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.pop(a2);
|
||||
|
||||
|
@ -612,7 +612,7 @@ static void GenerateBailoutThunk(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.setupAlignedABICall();
|
||||
masm.passABIArg(a0);
|
||||
masm.passABIArg(a1);
|
||||
masm.callWithABI<Fn, Bailout>(ABIType::General,
|
||||
masm.callWithABI<Fn, Bailout>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
// Get BailoutInfo pointer
|
||||
|
@ -677,16 +677,16 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
switch (f.argProperties(explicitArg)) {
|
||||
case VMFunctionData::WordByValue:
|
||||
if (f.argPassedInFloatReg(explicitArg)) {
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), ABIType::Float64);
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), MoveOp::DOUBLE);
|
||||
} else {
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), ABIType::General);
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), MoveOp::GENERAL);
|
||||
}
|
||||
argDisp += sizeof(void*);
|
||||
break;
|
||||
case VMFunctionData::WordByRef:
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
argDisp += sizeof(void*);
|
||||
break;
|
||||
case VMFunctionData::DoubleByValue:
|
||||
|
@ -702,10 +702,10 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
if (f.outParam != Type_Void) {
|
||||
masm.passABIArg(MoveOperand(FramePointer, outParamOffset,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
}
|
||||
|
||||
masm.callWithABI(nativeFun, ABIType::General,
|
||||
masm.callWithABI(nativeFun, MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
// Test for failure.
|
||||
|
|
|
@ -1921,7 +1921,7 @@ void MacroAssemblerRiscv64Compat::handleFailureWithHandlerTail(
|
|||
asMasm().setupUnalignedABICall(a1);
|
||||
asMasm().passABIArg(a0);
|
||||
asMasm().callWithABI<Fn, HandleException>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
Label entryFrame;
|
||||
Label catch_;
|
||||
|
@ -2955,7 +2955,7 @@ void MacroAssembler::callWithABIPre(uint32_t* stackAdjust, bool callFromWasm) {
|
|||
assertStackAlignment(ABIStackAlignment);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, MoveOp::Type result,
|
||||
bool callFromWasm) {
|
||||
// Restore ra value (as stored in callWithABIPre()).
|
||||
loadPtr(Address(StackPointer, stackAdjust - sizeof(intptr_t)), ra);
|
||||
|
@ -2975,7 +2975,7 @@ void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
|||
#endif
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, MoveOp::Type result) {
|
||||
// Load the callee in scratch2, no instruction between the movePtr and
|
||||
// call should clobber it. Note that we can't use fun because it may be
|
||||
// one of the IntArg registers clobbered before the call.
|
||||
|
@ -2989,7 +2989,8 @@ void MacroAssembler::callWithABINoProfiler(Register fun, ABIType result) {
|
|||
callWithABIPost(stackAdjust, result);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun,
|
||||
MoveOp::Type result) {
|
||||
// Load the callee in scratch2, as above.
|
||||
UseScratchRegisterScope temps(this);
|
||||
temps.Exclude(GeneralRegisterSet(1 << CallReg.code()));
|
||||
|
|
|
@ -165,7 +165,7 @@ static void GenerateBailoutThunk(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.setupUnalignedABICall(a2);
|
||||
masm.passABIArg(a0);
|
||||
masm.passABIArg(a1);
|
||||
masm.callWithABI<Fn, Bailout>(ABIType::General,
|
||||
masm.callWithABI<Fn, Bailout>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
// Get the bailoutInfo outparam.
|
||||
|
@ -318,7 +318,7 @@ void JitRuntime::generateEnterJIT(JSContext* cx, MacroAssembler& masm) {
|
|||
masm.passABIArg(OsrFrameReg); // InterpreterFrame
|
||||
masm.passABIArg(numStackValues);
|
||||
masm.callWithABI<Fn, jit::InitBaselineFrameForOsr>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
regs.add(OsrFrameReg);
|
||||
Register jitcode = regs.takeAny();
|
||||
|
@ -415,7 +415,7 @@ void JitRuntime::generateInvalidator(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.passABIArg(a0);
|
||||
masm.passABIArg(a1);
|
||||
masm.callWithABI<Fn, InvalidationBailout>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.pop(a2);
|
||||
|
||||
|
@ -720,16 +720,16 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
switch (f.argProperties(explicitArg)) {
|
||||
case VMFunctionData::WordByValue:
|
||||
if (f.argPassedInFloatReg(explicitArg)) {
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), ABIType::Float64);
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), MoveOp::DOUBLE);
|
||||
} else {
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), ABIType::General);
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), MoveOp::GENERAL);
|
||||
}
|
||||
argDisp += sizeof(void*);
|
||||
break;
|
||||
case VMFunctionData::WordByRef:
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
argDisp += sizeof(void*);
|
||||
break;
|
||||
case VMFunctionData::DoubleByValue:
|
||||
|
@ -748,10 +748,10 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
if (f.outParam != Type_Void) {
|
||||
masm.passABIArg(MoveOperand(FramePointer, outParamOffset,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
}
|
||||
|
||||
masm.callWithABI(nativeFun, ABIType::General,
|
||||
masm.callWithABI(nativeFun, MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
// Test for failure.
|
||||
|
|
|
@ -386,11 +386,12 @@ void MacroAssembler::branchValueIsNurseryCell(Condition cond,
|
|||
MOZ_CRASH();
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, MoveOp::Type result) {
|
||||
MOZ_CRASH();
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun,
|
||||
MoveOp::Type result) {
|
||||
MOZ_CRASH();
|
||||
}
|
||||
|
||||
|
@ -402,7 +403,7 @@ void MacroAssembler::call(ImmPtr imm) { MOZ_CRASH(); }
|
|||
|
||||
void MacroAssembler::call(JitCode* c) { MOZ_CRASH(); }
|
||||
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, MoveOp::Type result,
|
||||
bool callFromWasm) {
|
||||
MOZ_CRASH();
|
||||
}
|
||||
|
|
|
@ -516,7 +516,7 @@ void MacroAssemblerX64::handleFailureWithHandlerTail(Label* profilerExitTail,
|
|||
asMasm().setupUnalignedABICall(rcx);
|
||||
asMasm().passABIArg(rax);
|
||||
asMasm().callWithABI<Fn, HandleException>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
Label entryFrame;
|
||||
Label catch_;
|
||||
|
@ -776,8 +776,8 @@ void MacroAssembler::callWithABIPre(uint32_t* stackAdjust, bool callFromWasm) {
|
|||
assertStackAlignment(ABIStackAlignment);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
||||
bool callFromWasm) {
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, MoveOp::Type result,
|
||||
bool cleanupArg) {
|
||||
freeStack(stackAdjust);
|
||||
if (dynamicAlignment_) {
|
||||
pop(rsp);
|
||||
|
@ -799,7 +799,7 @@ static bool IsIntArgReg(Register reg) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, MoveOp::Type result) {
|
||||
if (IsIntArgReg(fun)) {
|
||||
// Callee register may be clobbered for an argument. Move the callee to
|
||||
// r10, a volatile, non-argument register.
|
||||
|
@ -816,7 +816,8 @@ void MacroAssembler::callWithABINoProfiler(Register fun, ABIType result) {
|
|||
callWithABIPost(stackAdjust, result);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun,
|
||||
MoveOp::Type result) {
|
||||
Address safeFun = fun;
|
||||
if (IsIntArgReg(safeFun.base)) {
|
||||
// Callee register may be clobbered for an argument. Move the callee to
|
||||
|
|
|
@ -267,7 +267,7 @@ void JitRuntime::generateEnterJIT(JSContext* cx, MacroAssembler& masm) {
|
|||
masm.passABIArg(OsrFrameReg); // InterpreterFrame
|
||||
masm.passABIArg(numStackValues);
|
||||
masm.callWithABI<Fn, jit::InitBaselineFrameForOsr>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
masm.pop(reg_code);
|
||||
|
||||
|
@ -428,7 +428,7 @@ void JitRuntime::generateInvalidator(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.passABIArg(rax);
|
||||
masm.passABIArg(rbx);
|
||||
masm.callWithABI<Fn, InvalidationBailout>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.pop(r9); // Get the bailoutInfo outparam.
|
||||
|
||||
|
@ -632,7 +632,7 @@ static void GenerateBailoutThunk(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.setupUnalignedABICall(rax);
|
||||
masm.passABIArg(r8);
|
||||
masm.passABIArg(r9);
|
||||
masm.callWithABI<Fn, Bailout>(ABIType::General,
|
||||
masm.callWithABI<Fn, Bailout>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.pop(r9); // Get the bailoutInfo outparam.
|
||||
|
@ -697,16 +697,16 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
switch (f.argProperties(explicitArg)) {
|
||||
case VMFunctionData::WordByValue:
|
||||
if (f.argPassedInFloatReg(explicitArg)) {
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), ABIType::Float64);
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), MoveOp::DOUBLE);
|
||||
} else {
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), ABIType::General);
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), MoveOp::GENERAL);
|
||||
}
|
||||
argDisp += sizeof(void*);
|
||||
break;
|
||||
case VMFunctionData::WordByRef:
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
argDisp += sizeof(void*);
|
||||
break;
|
||||
case VMFunctionData::DoubleByValue:
|
||||
|
@ -721,10 +721,10 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
if (f.outParam != Type_Void) {
|
||||
masm.passABIArg(MoveOperand(FramePointer, outParamOffset,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
}
|
||||
|
||||
masm.callWithABI(nativeFun, ABIType::General,
|
||||
masm.callWithABI(nativeFun, MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
// Test for failure.
|
||||
|
|
|
@ -897,7 +897,7 @@ void CodeGeneratorX86::visitOutOfLineTruncate(OutOfLineTruncate* ool) {
|
|||
|
||||
if (gen->compilingWasm()) {
|
||||
masm.setupWasmABICall();
|
||||
masm.passABIArg(input, ABIType::Float64);
|
||||
masm.passABIArg(input, MoveOp::DOUBLE);
|
||||
|
||||
int32_t instanceOffset = masm.framePushed() - framePushedAfterInstance;
|
||||
masm.callWithABI(ool->bytecodeOffset(), wasm::SymbolicAddress::ToInt32,
|
||||
|
@ -905,8 +905,8 @@ void CodeGeneratorX86::visitOutOfLineTruncate(OutOfLineTruncate* ool) {
|
|||
} else {
|
||||
using Fn = int32_t (*)(double);
|
||||
masm.setupUnalignedABICall(output);
|
||||
masm.passABIArg(input, ABIType::Float64);
|
||||
masm.callWithABI<Fn, JS::ToInt32>(ABIType::General,
|
||||
masm.passABIArg(input, MoveOp::DOUBLE);
|
||||
masm.callWithABI<Fn, JS::ToInt32>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
}
|
||||
masm.storeCallInt32Result(output);
|
||||
|
@ -1005,7 +1005,7 @@ void CodeGeneratorX86::visitOutOfLineTruncateFloat32(
|
|||
}
|
||||
|
||||
masm.vcvtss2sd(input, input, input);
|
||||
masm.passABIArg(input.asDouble(), ABIType::Float64);
|
||||
masm.passABIArg(input.asDouble(), MoveOp::DOUBLE);
|
||||
|
||||
if (gen->compilingWasm()) {
|
||||
int32_t instanceOffset = masm.framePushed() - framePushedAfterInstance;
|
||||
|
@ -1013,7 +1013,7 @@ void CodeGeneratorX86::visitOutOfLineTruncateFloat32(
|
|||
mozilla::Some(instanceOffset));
|
||||
} else {
|
||||
using Fn = int32_t (*)(double);
|
||||
masm.callWithABI<Fn, JS::ToInt32>(ABIType::General,
|
||||
masm.callWithABI<Fn, JS::ToInt32>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
}
|
||||
|
||||
|
|
|
@ -520,7 +520,7 @@ void MacroAssemblerX86::handleFailureWithHandlerTail(Label* profilerExitTail,
|
|||
asMasm().setupUnalignedABICall(ecx);
|
||||
asMasm().passABIArg(eax);
|
||||
asMasm().callWithABI<Fn, HandleException>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
Label entryFrame;
|
||||
Label catch_;
|
||||
|
@ -770,19 +770,19 @@ void MacroAssembler::callWithABIPre(uint32_t* stackAdjust, bool callFromWasm) {
|
|||
assertStackAlignment(ABIStackAlignment);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
||||
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, MoveOp::Type result,
|
||||
bool callFromWasm) {
|
||||
freeStack(stackAdjust);
|
||||
|
||||
// Calls to native functions in wasm pass through a thunk which already
|
||||
// fixes up the return value for us.
|
||||
if (!callFromWasm) {
|
||||
if (result == ABIType::Float64) {
|
||||
if (result == MoveOp::DOUBLE) {
|
||||
reserveStack(sizeof(double));
|
||||
fstp(Operand(esp, 0));
|
||||
loadDouble(Operand(esp, 0), ReturnDoubleReg);
|
||||
freeStack(sizeof(double));
|
||||
} else if (result == ABIType::Float32) {
|
||||
} else if (result == MoveOp::FLOAT32) {
|
||||
reserveStack(sizeof(float));
|
||||
fstp32(Operand(esp, 0));
|
||||
loadFloat32(Operand(esp, 0), ReturnFloat32Reg);
|
||||
|
@ -800,14 +800,15 @@ void MacroAssembler::callWithABIPost(uint32_t stackAdjust, ABIType result,
|
|||
#endif
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(Register fun, MoveOp::Type result) {
|
||||
uint32_t stackAdjust;
|
||||
callWithABIPre(&stackAdjust);
|
||||
call(fun);
|
||||
callWithABIPost(stackAdjust, result);
|
||||
}
|
||||
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun, ABIType result) {
|
||||
void MacroAssembler::callWithABINoProfiler(const Address& fun,
|
||||
MoveOp::Type result) {
|
||||
uint32_t stackAdjust;
|
||||
callWithABIPre(&stackAdjust);
|
||||
call(fun);
|
||||
|
|
|
@ -209,7 +209,7 @@ void JitRuntime::generateEnterJIT(JSContext* cx, MacroAssembler& masm) {
|
|||
masm.passABIArg(OsrFrameReg); // InterpreterFrame
|
||||
masm.passABIArg(numStackValues);
|
||||
masm.callWithABI<Fn, jit::InitBaselineFrameForOsr>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
masm.pop(jitcode);
|
||||
|
||||
|
@ -352,7 +352,7 @@ void JitRuntime::generateInvalidator(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.passABIArg(eax);
|
||||
masm.passABIArg(ebx);
|
||||
masm.callWithABI<Fn, InvalidationBailout>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.pop(ecx); // Get bailoutInfo outparam.
|
||||
|
||||
|
@ -542,7 +542,7 @@ static void GenerateBailoutThunk(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.setupUnalignedABICall(ecx);
|
||||
masm.passABIArg(eax);
|
||||
masm.passABIArg(ebx);
|
||||
masm.callWithABI<Fn, Bailout>(ABIType::General,
|
||||
masm.callWithABI<Fn, Bailout>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.pop(ecx); // Get the bailoutInfo outparam.
|
||||
|
@ -605,27 +605,27 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
for (uint32_t explicitArg = 0; explicitArg < f.explicitArgs; explicitArg++) {
|
||||
switch (f.argProperties(explicitArg)) {
|
||||
case VMFunctionData::WordByValue:
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), ABIType::General);
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), MoveOp::GENERAL);
|
||||
argDisp += sizeof(void*);
|
||||
break;
|
||||
case VMFunctionData::DoubleByValue:
|
||||
// We don't pass doubles in float registers on x86, so no need
|
||||
// to check for argPassedInFloatReg.
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), ABIType::General);
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), MoveOp::GENERAL);
|
||||
argDisp += sizeof(void*);
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), ABIType::General);
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp), MoveOp::GENERAL);
|
||||
argDisp += sizeof(void*);
|
||||
break;
|
||||
case VMFunctionData::WordByRef:
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
argDisp += sizeof(void*);
|
||||
break;
|
||||
case VMFunctionData::DoubleByRef:
|
||||
masm.passABIArg(MoveOperand(FramePointer, argDisp,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
argDisp += 2 * sizeof(void*);
|
||||
break;
|
||||
}
|
||||
|
@ -637,10 +637,10 @@ bool JitRuntime::generateVMWrapper(JSContext* cx, MacroAssembler& masm,
|
|||
if (f.outParam != Type_Void) {
|
||||
masm.passABIArg(MoveOperand(FramePointer, outParamOffset,
|
||||
MoveOperand::Kind::EffectiveAddress),
|
||||
ABIType::General);
|
||||
MoveOp::GENERAL);
|
||||
}
|
||||
|
||||
masm.callWithABI(nativeFun, ABIType::General,
|
||||
masm.callWithABI(nativeFun, MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
// Test for failure.
|
||||
|
|
|
@ -286,27 +286,27 @@ constexpr uint64_t FillBits() {
|
|||
template <typename... Args>
|
||||
using ArgsFillBits_t = std::integer_sequence<uint64_t, FillBits<Args>()...>;
|
||||
|
||||
// Given a type, return the ABIType used by passABIArg to know how to
|
||||
// Given a type, return the MoveOp type used by passABIArg to know how to
|
||||
// interpret the value which are given as arguments.
|
||||
template <typename Type>
|
||||
constexpr ABIType TypeToABIType() {
|
||||
constexpr MoveOp::Type TypeToMoveOp() {
|
||||
if constexpr (std::is_same_v<Type, float>) {
|
||||
return ABIType::Float32;
|
||||
return MoveOp::FLOAT32;
|
||||
} else if constexpr (std::is_same_v<Type, double>) {
|
||||
return ABIType::Float64;
|
||||
return MoveOp::DOUBLE;
|
||||
} else {
|
||||
return ABIType::General;
|
||||
return MoveOp::GENERAL;
|
||||
}
|
||||
}
|
||||
|
||||
// Generate a sequence which contains the associated ABIType of each argument.
|
||||
// Generate a sequence which contains the associated MoveOp of each argument.
|
||||
// Note, a new class is defined because C++ header of clang are rejecting the
|
||||
// option of having an enumerated type as argument of std::integer_sequence.
|
||||
template <ABIType... Val>
|
||||
class ABITypeSequence {};
|
||||
template <MoveOp::Type... Val>
|
||||
class MoveOpSequence {};
|
||||
|
||||
template <typename... Args>
|
||||
using ArgsABITypes_t = ABITypeSequence<TypeToABIType<Args>()...>;
|
||||
using ArgsMoveOps_t = MoveOpSequence<TypeToMoveOp<Args>()...>;
|
||||
|
||||
// Generate an std::integer_sequence which corresponds to a buffer containing
|
||||
// values which are spread at the location where each arguments type would be
|
||||
|
@ -454,14 +454,14 @@ NO_ARGS_CHECKS bool CheckArgsEqual(JSAPIRuntimeTest* instance, int lineno,
|
|||
// Generate code to register the value of each argument of the called function.
|
||||
// Each argument's content is read from a buffer whose address is stored in the
|
||||
// `base` register. The offsets of arguments are given as a third argument
|
||||
// which is expected to be generated by `ArgsOffsets`. The ABIType types of
|
||||
// which is expected to be generated by `ArgsOffsets`. The MoveOp types of
|
||||
// arguments are given as the fourth argument and are expected to be generated
|
||||
// by `ArgsABIType`.
|
||||
template <uint64_t... Off, ABIType... Type>
|
||||
// by `ArgsMoveOp`.
|
||||
template <uint64_t... Off, MoveOp::Type... Move>
|
||||
static void passABIArgs(MacroAssembler& masm, Register base,
|
||||
std::integer_sequence<uint64_t, Off...>,
|
||||
ABITypeSequence<Type...>) {
|
||||
(masm.passABIArg(MoveOperand(base, size_t(Off)), Type), ...);
|
||||
MoveOpSequence<Move...>) {
|
||||
(masm.passABIArg(MoveOperand(base, size_t(Off)), Move), ...);
|
||||
}
|
||||
|
||||
// For each function type given as a parameter, create a few functions with the
|
||||
|
@ -595,10 +595,10 @@ struct DefineCheckArgs<Res (*)(Args...)> {
|
|||
|
||||
masm.setupUnalignedABICall(setup);
|
||||
using Offsets = ArgsOffsets_t<0, Args...>;
|
||||
using ABITypes = ArgsABITypes_t<Args...>;
|
||||
passABIArgs(masm, base, Offsets(), ABITypes());
|
||||
using MoveOps = ArgsMoveOps_t<Args...>;
|
||||
passABIArgs(masm, base, Offsets(), MoveOps());
|
||||
masm.callWithABI(DynFn{JS_FUNC_TO_DATA_PTR(void*, test.fun)},
|
||||
TypeToABIType<Res>(),
|
||||
TypeToMoveOp<Res>(),
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5491,7 +5491,7 @@ bool BaseCompiler::emitConvertInt64ToFloatingCallout(SymbolicAddress callee,
|
|||
# endif
|
||||
CodeOffset raOffset = masm.callWithABI(
|
||||
bytecodeOffset(), callee, mozilla::Some(fr.getInstancePtrOffset()),
|
||||
resultType == ValType::F32 ? ABIType::Float32 : ABIType::Float64);
|
||||
resultType == ValType::F32 ? MoveOp::FLOAT32 : MoveOp::DOUBLE);
|
||||
if (!createStackMap("emitConvertInt64To[..]", raOffset)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -5533,7 +5533,7 @@ bool BaseCompiler::emitConvertFloatingToInt64Callout(SymbolicAddress callee,
|
|||
FunctionCall call{};
|
||||
|
||||
masm.setupWasmABICall();
|
||||
masm.passABIArg(doubleInput, ABIType::Float64);
|
||||
masm.passABIArg(doubleInput, MoveOp::DOUBLE);
|
||||
CodeOffset raOffset = masm.callWithABI(
|
||||
bytecodeOffset(), callee, mozilla::Some(fr.getInstancePtrOffset()));
|
||||
if (!createStackMap("emitConvertFloatin[..]", raOffset)) {
|
||||
|
|
|
@ -420,32 +420,32 @@ FOR_EACH_BUILTIN_MODULE_FUNC(VISIT_BUILTIN_FUNC)
|
|||
#undef _FailOnNullPtr
|
||||
|
||||
#ifdef DEBUG
|
||||
ABIType ToABIType(FailureMode mode) {
|
||||
ABIArgType ToABIType(FailureMode mode) {
|
||||
switch (mode) {
|
||||
case FailureMode::FailOnNegI32:
|
||||
return ABIType::Int32;
|
||||
return ArgType_Int32;
|
||||
case FailureMode::FailOnNullPtr:
|
||||
case FailureMode::FailOnInvalidRef:
|
||||
return ABIType::General;
|
||||
return ArgType_General;
|
||||
default:
|
||||
MOZ_CRASH("unexpected failure mode");
|
||||
}
|
||||
}
|
||||
|
||||
ABIType ToABIType(MIRType type) {
|
||||
ABIArgType ToABIType(MIRType type) {
|
||||
switch (type) {
|
||||
case MIRType::None:
|
||||
case MIRType::Int32:
|
||||
return ABIType::Int32;
|
||||
return ArgType_Int32;
|
||||
case MIRType::Int64:
|
||||
return ABIType::Int64;
|
||||
return ArgType_Int64;
|
||||
case MIRType::Pointer:
|
||||
case MIRType::WasmAnyRef:
|
||||
return ABIType::General;
|
||||
return ArgType_General;
|
||||
case MIRType::Float32:
|
||||
return ABIType::Float32;
|
||||
return ArgType_Float32;
|
||||
case MIRType::Double:
|
||||
return ABIType::Float64;
|
||||
return ArgType_Float64;
|
||||
default:
|
||||
MOZ_CRASH("unexpected type");
|
||||
}
|
||||
|
@ -456,11 +456,11 @@ ABIFunctionType ToABIType(const SymbolicAddressSignature& sig) {
|
|||
ToABIType(sig.failureMode) == ToABIType(sig.retType));
|
||||
int abiType = 0;
|
||||
for (int i = 0; i < sig.numArgs; i++) {
|
||||
abiType <<= ABITypeArgShift;
|
||||
abiType |= uint32_t(ToABIType(sig.argTypes[i]));
|
||||
abiType <<= ArgType_Shift;
|
||||
abiType |= ToABIType(sig.argTypes[i]);
|
||||
}
|
||||
abiType <<= ABITypeArgShift;
|
||||
abiType |= uint32_t(ToABIType(sig.retType));
|
||||
abiType <<= ArgType_Shift;
|
||||
abiType |= ToABIType(sig.retType);
|
||||
return ABIFunctionType(abiType);
|
||||
}
|
||||
#endif
|
||||
|
@ -1986,7 +1986,7 @@ static Maybe<ABIFunctionType> ToBuiltinABIFunctionType(
|
|||
return Nothing();
|
||||
}
|
||||
|
||||
if ((args.length() + 1) > (sizeof(uint32_t) * 8 / ABITypeArgShift)) {
|
||||
if ((args.length() + 1) > (sizeof(uint32_t) * 8 / ArgType_Shift)) {
|
||||
return Nothing();
|
||||
}
|
||||
|
||||
|
@ -1994,25 +1994,25 @@ static Maybe<ABIFunctionType> ToBuiltinABIFunctionType(
|
|||
for (size_t i = 0; i < args.length(); i++) {
|
||||
switch (args[i].kind()) {
|
||||
case ValType::F32:
|
||||
abiType <<= ABITypeArgShift;
|
||||
abiType |= uint32_t(ABIType::Float32);
|
||||
abiType <<= ArgType_Shift;
|
||||
abiType |= ArgType_Float32;
|
||||
break;
|
||||
case ValType::F64:
|
||||
abiType <<= ABITypeArgShift;
|
||||
abiType |= uint32_t(ABIType::Float64);
|
||||
abiType <<= ArgType_Shift;
|
||||
abiType |= ArgType_Float64;
|
||||
break;
|
||||
default:
|
||||
return Nothing();
|
||||
}
|
||||
}
|
||||
|
||||
abiType <<= ABITypeArgShift;
|
||||
abiType <<= ArgType_Shift;
|
||||
switch (results[0].kind()) {
|
||||
case ValType::F32:
|
||||
abiType |= uint32_t(ABIType::Float32);
|
||||
abiType |= ArgType_Float32;
|
||||
break;
|
||||
case ValType::F64:
|
||||
abiType |= uint32_t(ABIType::Float64);
|
||||
abiType |= ArgType_Float64;
|
||||
break;
|
||||
default:
|
||||
return Nothing();
|
||||
|
|
|
@ -207,7 +207,7 @@ static void GenPrintf(DebugChannel channel, MacroAssembler& masm,
|
|||
masm.callDebugWithABI(SymbolicAddress::PrintText);
|
||||
} else {
|
||||
using Fn = void (*)(const char* output);
|
||||
masm.callWithABI<Fn, PrintText>(ABIType::General,
|
||||
masm.callWithABI<Fn, PrintText>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
}
|
||||
});
|
||||
|
@ -221,7 +221,7 @@ static void GenPrintIsize(DebugChannel channel, MacroAssembler& masm,
|
|||
masm.callDebugWithABI(SymbolicAddress::PrintI32);
|
||||
} else {
|
||||
using Fn = void (*)(int32_t val);
|
||||
masm.callWithABI<Fn, PrintI32>(ABIType::General,
|
||||
masm.callWithABI<Fn, PrintI32>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
}
|
||||
});
|
||||
|
@ -235,7 +235,7 @@ static void GenPrintPtr(DebugChannel channel, MacroAssembler& masm,
|
|||
masm.callDebugWithABI(SymbolicAddress::PrintPtr);
|
||||
} else {
|
||||
using Fn = void (*)(uint8_t* val);
|
||||
masm.callWithABI<Fn, PrintPtr>(ABIType::General,
|
||||
masm.callWithABI<Fn, PrintPtr>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
}
|
||||
});
|
||||
|
@ -257,12 +257,12 @@ static void GenPrintI64(DebugChannel channel, MacroAssembler& masm,
|
|||
static void GenPrintF32(DebugChannel channel, MacroAssembler& masm,
|
||||
const FloatRegister& src) {
|
||||
GenPrint(channel, masm, Nothing(), [&](bool inWasm, Register temp) {
|
||||
masm.passABIArg(src, ABIType::Float32);
|
||||
masm.passABIArg(src, MoveOp::FLOAT32);
|
||||
if (inWasm) {
|
||||
masm.callDebugWithABI(SymbolicAddress::PrintF32);
|
||||
} else {
|
||||
using Fn = void (*)(float val);
|
||||
masm.callWithABI<Fn, PrintF32>(ABIType::General,
|
||||
masm.callWithABI<Fn, PrintF32>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
}
|
||||
});
|
||||
|
@ -271,12 +271,12 @@ static void GenPrintF32(DebugChannel channel, MacroAssembler& masm,
|
|||
static void GenPrintF64(DebugChannel channel, MacroAssembler& masm,
|
||||
const FloatRegister& src) {
|
||||
GenPrint(channel, masm, Nothing(), [&](bool inWasm, Register temp) {
|
||||
masm.passABIArg(src, ABIType::Float64);
|
||||
masm.passABIArg(src, MoveOp::DOUBLE);
|
||||
if (inWasm) {
|
||||
masm.callDebugWithABI(SymbolicAddress::PrintF64);
|
||||
} else {
|
||||
using Fn = void (*)(double val);
|
||||
masm.callWithABI<Fn, PrintF64>(ABIType::General,
|
||||
masm.callWithABI<Fn, PrintF64>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
}
|
||||
});
|
||||
|
@ -2434,11 +2434,11 @@ struct ABIFunctionArgs {
|
|||
size_t len;
|
||||
|
||||
explicit ABIFunctionArgs(ABIFunctionType sig)
|
||||
: abiType(ABIFunctionType(sig >> ABITypeArgShift)) {
|
||||
: abiType(ABIFunctionType(sig >> ArgType_Shift)) {
|
||||
len = 0;
|
||||
uint64_t i = uint64_t(abiType);
|
||||
while (i) {
|
||||
i = i >> ABITypeArgShift;
|
||||
i = i >> ArgType_Shift;
|
||||
len++;
|
||||
}
|
||||
}
|
||||
|
@ -2450,10 +2450,10 @@ struct ABIFunctionArgs {
|
|||
uint64_t abi = uint64_t(abiType);
|
||||
size_t argAtLSB = len - 1;
|
||||
while (argAtLSB != i) {
|
||||
abi = abi >> ABITypeArgShift;
|
||||
abi = abi >> ArgType_Shift;
|
||||
argAtLSB--;
|
||||
}
|
||||
return ToMIRType(ABIType(abi & ABITypeArgMask));
|
||||
return ToMIRType(ABIArgType(abi & ArgType_Mask));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -2510,8 +2510,8 @@ bool wasm::GenerateBuiltinThunk(MacroAssembler& masm, ABIFunctionType abiType,
|
|||
#elif defined(JS_CODEGEN_X86)
|
||||
// x86 passes the return value on the x87 FP stack.
|
||||
Operand op(esp, 0);
|
||||
MIRType retType = ToMIRType(ABIType(
|
||||
std::underlying_type_t<ABIFunctionType>(abiType) & ABITypeArgMask));
|
||||
MIRType retType = ToMIRType(ABIArgType(
|
||||
std::underlying_type_t<ABIFunctionType>(abiType) & ArgType_Mask));
|
||||
if (retType == MIRType::Float32) {
|
||||
masm.fstp32(op);
|
||||
masm.loadFloat32(op, ReturnFloat32Reg);
|
||||
|
@ -2521,8 +2521,8 @@ bool wasm::GenerateBuiltinThunk(MacroAssembler& masm, ABIFunctionType abiType,
|
|||
}
|
||||
#elif defined(JS_CODEGEN_ARM)
|
||||
// Non hard-fp passes the return values in GPRs.
|
||||
MIRType retType = ToMIRType(ABIType(
|
||||
std::underlying_type_t<ABIFunctionType>(abiType) & ABITypeArgMask));
|
||||
MIRType retType = ToMIRType(ABIArgType(
|
||||
std::underlying_type_t<ABIFunctionType>(abiType) & ArgType_Mask));
|
||||
if (!UseHardFpABI() && IsFloatingPointType(retType)) {
|
||||
masm.ma_vxfer(r0, r1, d0);
|
||||
}
|
||||
|
@ -2923,7 +2923,7 @@ bool wasm::GenerateProvisionalLazyJitEntryStub(MacroAssembler& masm,
|
|||
using Fn = void* (*)();
|
||||
masm.setupUnalignedABICall(temp);
|
||||
masm.callWithABI<Fn, GetContextSensitiveInterpreterStub>(
|
||||
ABIType::General, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
|
||||
#ifdef JS_USE_LINK_REGISTER
|
||||
masm.popReturnAddress();
|
||||
|
|
Загрузка…
Ссылка в новой задаче