summaryrefslogtreecommitdiff
path: root/js/src/jit
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-03-16 13:38:26 +0100
committerMoonchild <moonchild@palemoon.org>2023-03-16 13:38:26 +0100
commit8577fab815410efc1dbc23b444b5e339adc6c612 (patch)
tree929e1649e046d41bceea9f66f98d52b9d62f503e /js/src/jit
parent68f456b5fd092c2a5e0e22ad76dd4b3a6f1d3632 (diff)
downloaduxp-8577fab815410efc1dbc23b444b5e339adc6c612.tar.gz
No Issue - Ensure more OsiSpace
ensureOsiSpace(); was very much under-used. This adds more instances where it makes sense to ensure Osi space before placing masm calls.
Diffstat (limited to 'js/src/jit')
-rw-r--r--js/src/jit/CodeGenerator.cpp6
-rw-r--r--js/src/jit/shared/CodeGenerator-shared.cpp2
2 files changed, 7 insertions, 1 deletions
diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
index 3f1b7251a3..78d39bfc52 100644
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -3757,6 +3757,7 @@ CodeGenerator::visitCallNative(LCallNative* call)
if (jitInfo && jitInfo->type() == JSJitInfo::IgnoresReturnValueNative)
native = jitInfo->ignoresReturnValueMethod;
}
+ ensureOsiSpace();
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, native));
emitTracelogStopEvent(TraceLogger_Call);
@@ -3881,6 +3882,7 @@ CodeGenerator::visitCallDOMNative(LCallDOMNative* call)
masm.passABIArg(argObj);
masm.passABIArg(argPrivate);
masm.passABIArg(argArgs);
+ ensureOsiSpace();
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->jitInfo()->method));
if (target->jitInfo()->isInfallible) {
@@ -4006,6 +4008,7 @@ CodeGenerator::visitCallGeneric(LCallGeneric* call)
// Finally call the function in objreg.
masm.bind(&makeCall);
+ ensureOsiSpace();
uint32_t callOffset = masm.callJit(objreg);
markSafepointAt(callOffset, call);
@@ -4104,6 +4107,7 @@ CodeGenerator::visitCallKnown(LCallKnown* call)
masm.Push(Imm32(descriptor));
// Finally call the function in objreg.
+ ensureOsiSpace();
uint32_t callOffset = masm.callJit(objreg);
markSafepointAt(callOffset, call);
@@ -4436,6 +4440,7 @@ CodeGenerator::emitApplyGeneric(T* apply)
masm.bind(&rejoin);
// Finally call the function in objreg, as assigned by one of the paths above.
+ ensureOsiSpace();
uint32_t callOffset = masm.callJit(objreg);
markSafepointAt(callOffset, apply);
@@ -11244,6 +11249,7 @@ CodeGenerator::visitGetDOMProperty(LGetDOMProperty* ins)
masm.passABIArg(ObjectReg);
masm.passABIArg(PrivateReg);
masm.passABIArg(ValueReg);
+ ensureOsiSpace();
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ins->mir()->fun()));
if (ins->mir()->isInfallible()) {
diff --git a/js/src/jit/shared/CodeGenerator-shared.cpp b/js/src/jit/shared/CodeGenerator-shared.cpp
index 08e9d311cf..16e082745c 100644
--- a/js/src/jit/shared/CodeGenerator-shared.cpp
+++ b/js/src/jit/shared/CodeGenerator-shared.cpp
@@ -1112,7 +1112,6 @@ CodeGeneratorShared::ensureOsiSpace()
}
MOZ_ASSERT_IF(!masm.oom(),
masm.currentOffset() - lastOsiPointOffset_ >= Assembler::PatchWrite_NearCallSize());
- lastOsiPointOffset_ = masm.currentOffset();
}
uint32_t
@@ -1124,6 +1123,7 @@ CodeGeneratorShared::markOsiPoint(LOsiPoint* ins)
uint32_t offset = masm.currentOffset();
SnapshotOffset so = ins->snapshot()->snapshotOffset();
masm.propagateOOM(osiIndices_.append(OsiIndex(offset, so)));
+ lastOsiPointOffset_ = offset;
return offset;
}