Bug 1814899: Ensure more OsiSpace r=jandem

Differential Revision: https://phabricator.services.mozilla.com/D169274
This commit is contained in:
Iain Ireland 2023-02-13 18:33:10 +00:00
parent 4b6b4c4c2e
commit d307cab06d
2 changed files with 10 additions and 1 deletions

View file

@ -348,6 +348,7 @@ void CodeGenerator::callVMInternal(VMFunctionId id, LInstruction* ins) {
// when returning from the call. Failures are handled with exceptions based // when returning from the call. Failures are handled with exceptions based
// on the return value of the C functions. To guard the outcome of the // on the return value of the C functions. To guard the outcome of the
// returned value, use another LIR instruction. // returned value, use another LIR instruction.
ensureOsiSpace();
uint32_t callOffset = masm.callJit(code); uint32_t callOffset = masm.callJit(code);
markSafepointAt(callOffset, ins); markSafepointAt(callOffset, ins);
@ -5231,6 +5232,7 @@ void CodeGenerator::visitCallNative(LCallNative* call) {
native = jitInfo->ignoresReturnValueMethod; native = jitInfo->ignoresReturnValueMethod;
} }
} }
ensureOsiSpace();
masm.callWithABI(DynamicFunction<JSNative>(native), MoveOp::GENERAL, masm.callWithABI(DynamicFunction<JSNative>(native), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame); CheckUnsafeCallWithABI::DontCheckHasExitFrame);
@ -5377,6 +5379,7 @@ void CodeGenerator::visitCallDOMNative(LCallDOMNative* call) {
masm.passABIArg(argObj); masm.passABIArg(argObj);
masm.passABIArg(argPrivate); masm.passABIArg(argPrivate);
masm.passABIArg(argArgs); masm.passABIArg(argArgs);
ensureOsiSpace();
masm.callWithABI(DynamicFunction<JSJitMethodOp>(target->jitInfo()->method), masm.callWithABI(DynamicFunction<JSJitMethodOp>(target->jitInfo()->method),
MoveOp::GENERAL, MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame); CheckUnsafeCallWithABI::DontCheckHasExitFrame);
@ -5530,6 +5533,7 @@ void CodeGenerator::visitCallGeneric(LCallGeneric* call) {
// Finally call the function in objreg. // Finally call the function in objreg.
masm.bind(&makeCall); masm.bind(&makeCall);
ensureOsiSpace();
uint32_t callOffset = masm.callJit(objreg); uint32_t callOffset = masm.callJit(objreg);
markSafepointAt(callOffset, call); markSafepointAt(callOffset, call);
@ -5614,6 +5618,7 @@ void CodeGenerator::visitCallKnown(LCallKnown* call) {
masm.PushFrameDescriptorForJitCall(FrameType::IonJS, call->numActualArgs()); masm.PushFrameDescriptorForJitCall(FrameType::IonJS, call->numActualArgs());
// Finally call the function in objreg. // Finally call the function in objreg.
ensureOsiSpace();
uint32_t callOffset = masm.callJit(objreg); uint32_t callOffset = masm.callJit(objreg);
markSafepointAt(callOffset, call); markSafepointAt(callOffset, call);
@ -6095,6 +6100,7 @@ void CodeGenerator::emitApplyGeneric(T* apply) {
// Finally call the function in objreg, as assigned by one of the paths // Finally call the function in objreg, as assigned by one of the paths
// above. // above.
ensureOsiSpace();
uint32_t callOffset = masm.callJit(objreg); uint32_t callOffset = masm.callJit(objreg);
markSafepointAt(callOffset, apply); markSafepointAt(callOffset, apply);
@ -15606,6 +15612,7 @@ void CodeGenerator::visitGetDOMProperty(LGetDOMProperty* ins) {
masm.passABIArg(ObjectReg); masm.passABIArg(ObjectReg);
masm.passABIArg(PrivateReg); masm.passABIArg(PrivateReg);
masm.passABIArg(ValueReg); masm.passABIArg(ValueReg);
ensureOsiSpace();
masm.callWithABI(DynamicFunction<JSJitGetterOp>(ins->mir()->fun()), masm.callWithABI(DynamicFunction<JSJitGetterOp>(ins->mir()->fun()),
MoveOp::GENERAL, MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame); CheckUnsafeCallWithABI::DontCheckHasExitFrame);
@ -15726,6 +15733,7 @@ void CodeGenerator::visitSetDOMProperty(LSetDOMProperty* ins) {
masm.passABIArg(ObjectReg); masm.passABIArg(ObjectReg);
masm.passABIArg(PrivateReg); masm.passABIArg(PrivateReg);
masm.passABIArg(ValueReg); masm.passABIArg(ValueReg);
ensureOsiSpace();
masm.callWithABI(DynamicFunction<JSJitSetterOp>(ins->mir()->fun()), masm.callWithABI(DynamicFunction<JSJitSetterOp>(ins->mir()->fun()),
MoveOp::GENERAL, MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame); CheckUnsafeCallWithABI::DontCheckHasExitFrame);
@ -17924,6 +17932,7 @@ void CodeGenerator::emitIonToWasmCallBase(LIonToWasmCallBase<NumDefs>* lir) {
Register scratch = ToRegister(lir->temp()); Register scratch = ToRegister(lir->temp());
uint32_t callOffset; uint32_t callOffset;
ensureOsiSpace();
GenerateDirectCallFromJit(masm, funcExport, instObj->instance(), stackArgs, GenerateDirectCallFromJit(masm, funcExport, instObj->instance(), stackArgs,
scratch, &callOffset); scratch, &callOffset);

View file

@ -832,7 +832,6 @@ void CodeGeneratorShared::ensureOsiSpace() {
} }
MOZ_ASSERT_IF(!masm.oom(), masm.currentOffset() - lastOsiPointOffset_ >= MOZ_ASSERT_IF(!masm.oom(), masm.currentOffset() - lastOsiPointOffset_ >=
Assembler::PatchWrite_NearCallSize()); Assembler::PatchWrite_NearCallSize());
lastOsiPointOffset_ = masm.currentOffset();
} }
uint32_t CodeGeneratorShared::markOsiPoint(LOsiPoint* ins) { uint32_t CodeGeneratorShared::markOsiPoint(LOsiPoint* ins) {
@ -842,6 +841,7 @@ uint32_t CodeGeneratorShared::markOsiPoint(LOsiPoint* ins) {
uint32_t offset = masm.currentOffset(); uint32_t offset = masm.currentOffset();
SnapshotOffset so = ins->snapshot()->snapshotOffset(); SnapshotOffset so = ins->snapshot()->snapshotOffset();
masm.propagateOOM(osiIndices_.append(OsiIndex(offset, so))); masm.propagateOOM(osiIndices_.append(OsiIndex(offset, so)));
lastOsiPointOffset_ = offset;
return offset; return offset;
} }