Bug 1661256 part 32 - Convert GC-related callWithABI calls. r=mgaudet

Differential Revision: https://phabricator.services.mozilla.com/D91812
This commit is contained in:
Nicolas B. Pierron 2020-10-05 16:56:27 +00:00
Родитель bb62e3366b
Коммит 690d601f54
4 изменённых файлов: 26 добавлений и 13 удалений

Просмотреть файл

@ -125,10 +125,15 @@ namespace jit {
_(js::jit::InitBaselineFrameForOsr) \
_(js::jit::InvalidationBailout) \
_(js::jit::LazyLinkTopActivation) \
_(js::jit::PostGlobalWriteBarrier) \
_(js::jit::PostWriteBarrier) \
_(js::jit::PostWriteElementBarrier<IndexInBounds::Yes>) \
_(js::jit::PostWriteElementBarrier<IndexInBounds::Maybe>) \
_(js::jit::Printf0) \
_(js::jit::Printf1) \
_(js::jit::SetNativeDataPropertyPure<false>) \
_(js::jit::SetNativeDataPropertyPure<true>) \
_(js::jit::WrapObjectPure) \
_(js::MapIteratorObject::next) \
_(js::NativeObject::addDenseElementPure) \
_(js::NativeObject::growSlotsPure) \
@ -168,6 +173,7 @@ namespace jit {
_(JSJitSetterOp) \
_(JSNative) \
_(js::UnaryMathFunctionType) \
_(void (*)(js::gc::StoreBuffer*, js::gc::Cell**)) \
_(void (*)(JSRuntime * rt, JSObject * *objp)) \
_(void (*)(JSRuntime * rt, JSString * *stringp)) \
_(void (*)(JSRuntime * rt, ObjectGroup * *groupp)) \

Просмотреть файл

@ -522,11 +522,12 @@ bool BaselineCodeGen<Handler>::emitOutOfLinePostBarrierSlot() {
#endif
masm.pushValue(R0);
using Fn = void (*)(JSRuntime * rt, js::gc::Cell * cell);
masm.setupUnalignedABICall(scratch);
masm.movePtr(ImmPtr(cx->runtime()), scratch);
masm.passABIArg(scratch);
masm.passABIArg(objReg);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, PostWriteBarrier));
masm.callWithABI<Fn, PostWriteBarrier>();
restoreInterpreterPCReg();

Просмотреть файл

@ -6734,10 +6734,11 @@ void CacheIRCompiler::emitPostBarrierShared(Register obj,
masm.passABIArg(obj);
if (maybeIndex != InvalidReg) {
masm.passABIArg(maybeIndex);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(
void*, (PostWriteElementBarrier<IndexInBounds::Yes>)));
using Fn = void (*)(JSRuntime * rt, JSObject * obj, int32_t index);
masm.callWithABI<Fn, PostWriteElementBarrier<IndexInBounds::Yes>>();
} else {
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, PostWriteBarrier));
using Fn = void (*)(JSRuntime * rt, js::gc::Cell * cell);
masm.callWithABI<Fn, PostWriteBarrier>();
}
masm.PopRegsInMask(save);
@ -6764,11 +6765,12 @@ bool CacheIRCompiler::emitWrapResult() {
LiveRegisterSet save(GeneralRegisterSet::Volatile(), liveVolatileFloatRegs());
masm.PushRegsInMask(save);
using Fn = JSObject* (*)(JSContext * cx, JSObject * obj);
masm.setupUnalignedABICall(scratch);
masm.loadJSContext(scratch);
masm.passABIArg(scratch);
masm.passABIArg(obj);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, WrapObjectPure));
masm.callWithABI<Fn, WrapObjectPure>();
masm.mov(ReturnReg, obj);
LiveRegisterSet ignore;

Просмотреть файл

@ -1922,11 +1922,12 @@ void CodeGenerator::visitValueToObjectOrNull(LValueToObjectOrNull* lir) {
masm.bind(ool->rejoin());
}
using StoreBufferMutationFn = void (*)(js::gc::StoreBuffer*, js::gc::Cell**);
static void EmitStoreBufferMutation(MacroAssembler& masm, Register holder,
size_t offset, Register buffer,
LiveGeneralRegisterSet& liveVolatiles,
void (*fun)(js::gc::StoreBuffer*,
js::gc::Cell**)) {
StoreBufferMutationFn fun) {
Label callVM;
Label exit;
@ -1952,7 +1953,7 @@ static void EmitStoreBufferMutation(MacroAssembler& masm, Register holder,
}
masm.passABIArg(buffer);
masm.passABIArg(addrReg);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, fun), MoveOp::GENERAL,
masm.callWithABI(DynamicFunction<StoreBufferMutationFn>(fun), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
if (needExtraReg) {
@ -2602,10 +2603,11 @@ void CreateDependentString::generate(MacroAssembler& masm,
masm.mov(ImmPtr(runtime), temp1_);
using Fn = void (*)(JSRuntime * rt, js::gc::Cell * cell);
masm.setupUnalignedABICall(temp2_);
masm.passABIArg(temp1_);
masm.passABIArg(string_);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, PostWriteBarrier));
masm.callWithABI<Fn, PostWriteBarrier>();
masm.PopRegsInMask(regsToSave);
}
@ -5288,9 +5290,11 @@ static void EmitPostWriteBarrier(MacroAssembler& masm, CompileRuntime* runtime,
masm.passABIArg(runtimereg);
masm.passABIArg(objreg);
if (isGlobal) {
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, PostGlobalWriteBarrier));
using Fn = void (*)(JSRuntime * rt, GlobalObject * obj);
masm.callWithABI<Fn, PostGlobalWriteBarrier>();
} else {
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, PostWriteBarrier));
using Fn = void (*)(JSRuntime * rt, js::gc::Cell * obj);
masm.callWithABI<Fn, PostWriteBarrier>();
}
masm.bind(&exit);
@ -5482,13 +5486,13 @@ void CodeGenerator::visitOutOfLineCallPostWriteElementBarrier(
}
Register runtimereg = regs.takeAny();
using Fn = void (*)(JSRuntime * rt, JSObject * obj, int32_t index);
masm.setupUnalignedABICall(runtimereg);
masm.mov(ImmPtr(gen->runtime), runtimereg);
masm.passABIArg(runtimereg);
masm.passABIArg(objreg);
masm.passABIArg(indexreg);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(
void*, (PostWriteElementBarrier<IndexInBounds::Maybe>)));
masm.callWithABI<Fn, PostWriteElementBarrier<IndexInBounds::Maybe>>();
restoreLiveVolatile(ool->lir());