aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4runtime.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2024-06-14 16:31:59 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2024-06-18 14:56:51 +0200
commitef715b350077cdcbe6419fbc74b06a2d6be6f08e (patch)
tree84be21d41c4b7cc89c288f36050d144063c95ec7 /src/qml/jsruntime/qv4runtime.cpp
parentfae951b94e68cfcbe41220a6e70124bfe584fd95 (diff)
JIT: storeLocal needs to go through WriteBarrier
The interpreter already has the necessary setup, but the JIT did simply write the value without marking so far. We fix this by adding a new runtime function call, which simply uses QV4::WriteBarrier::markCustom to mark the given value. Both the StoreLocal and StoreScopedLocal bytecode instructions are handled by adding the code to BaselineAssembler::storeLocal. Pick-to: 6.8 Change-Id: I4b9226848bff029a076c0cfa6daf899ca9b84622 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 8582f44668..b5c497be49 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -1807,6 +1807,21 @@ void Runtime::ThrowOnNullOrUndefined::call(ExecutionEngine *engine, const Value
engine->throwTypeError();
}
+void Runtime::MarkCustom::call(const Value &toBeMarked)
+{
+ auto *h = toBeMarked.heapObject();
+ if (!h)
+ return;
+ Q_ASSERT(h->internalClass);
+ auto engine = h->internalClass->engine;
+ Q_ASSERT(engine);
+ // runtime function is only meant to be called while gc is ongoing
+ Q_ASSERT(engine->isGCOngoing);
+ QV4::WriteBarrier::markCustom(engine, [&](QV4::MarkStack *ms) {
+ h->mark(ms);
+ });
+}
+
ReturnedValue Runtime::ConvertThisToObject::call(ExecutionEngine *engine, const Value &t)
{
if (!t.isObject()) {
@@ -2493,6 +2508,8 @@ QHash<const void *, const char *> Runtime::symbolTable()
{symbol<Closure>(), "Closure" },
+ {symbol<MarkCustom>(), "MarkCustom"},
+
{symbol<ConvertThisToObject>(), "ConvertThisToObject" },
{symbol<DeclareVar>(), "DeclareVar" },
{symbol<CreateMappedArgumentsObject>(), "CreateMappedArgumentsObject" },