diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-05-27 22:00:01 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-06-04 22:45:23 +0200 |
commit | a368e603451cd3c3d44776ff47351a1d93cb546b (patch) | |
tree | 56b018041a164292c8c9754d5d3fccd024247619 /src/qml/jsapi/qjsvalue.cpp | |
parent | 744e7a55b143bd26cb1d1c19963e23d00d5ba2db (diff) |
QJSEngine: optimize isInterrupted handling
The isInterrupted flag is just that: a flag, so it doesn't require
acquire/release semantics when loading/storing.
Use relaxed loads and stores instead.
Change-Id: I6d733a6bebcfc7f2b786265fc28f9ba7e25bb1c7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsapi/qjsvalue.cpp')
-rw-r--r-- | src/qml/jsapi/qjsvalue.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index 03cd1e9aa9..c79953130e 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -713,7 +713,7 @@ QJSValue QJSValue::call(const QJSValueList &args) const ScopedValue result(scope, f->call(jsCallData)); if (engine->hasException) result = engine->catchException(); - if (engine->isInterrupted.loadAcquire()) + if (engine->isInterrupted.loadRelaxed()) result = engine->newErrorObject(QStringLiteral("Interrupted")); return QJSValuePrivate::fromReturnedValue(result->asReturnedValue()); @@ -767,7 +767,7 @@ QJSValue QJSValue::callWithInstance(const QJSValue &instance, const QJSValueList ScopedValue result(scope, f->call(jsCallData)); if (engine->hasException) result = engine->catchException(); - if (engine->isInterrupted.loadAcquire()) + if (engine->isInterrupted.loadRelaxed()) result = engine->newErrorObject(QStringLiteral("Interrupted")); return QJSValuePrivate::fromReturnedValue(result->asReturnedValue()); @@ -813,7 +813,7 @@ QJSValue QJSValue::callAsConstructor(const QJSValueList &args) const ScopedValue result(scope, f->callAsConstructor(jsCallData)); if (engine->hasException) result = engine->catchException(); - if (engine->isInterrupted.loadAcquire()) + if (engine->isInterrupted.loadRelaxed()) result = engine->newErrorObject(QStringLiteral("Interrupted")); return QJSValuePrivate::fromReturnedValue(result->asReturnedValue()); |