aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2018-11-23 12:44:32 +0100
committerErik Verbruggen <erik.verbruggen@qt.io>2019-02-05 09:51:29 +0000
commit2b297cae4b645cb9eebbe7a263c37f80c7f957ae (patch)
treea14db0b487c7e5e44e853f43c2c5318c71893cd5 /src/plugins
parenta322172540d5aafccbabba48e9f921c43560cfa6 (diff)
V4: Clean up the runtime functions declarations
The declarations and usage of runtime functions have seen a number of changes: - we don't use the array of method pointers anymore because we don't use cross-platform AOT JITting - the check if a method can throw a JS exception was invalid, and was not used anymore - value-pointer vs. const-value-ref was inconsistent This patch cleans that up. By fixing the exception checking, we can now use it in the baseline JIT to automatically insert those checks. To make that work correctly, all runtime methods are in a struct, which gets annotated to indicate if that method throws. (The old way of checking which type of engine was used is fragile: some non-throwing methods do not take an engine parameter at all, and those got flagged as throwing). By using a struct, we can also get rid of a bunch of interesting macros. The flags in the struct (as mentioned above) can later be extended to capture more information, e.g. if a method will change the context. Change-Id: I1e0b9ba62a0bf538eb728b4378e2678136e29a64 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
index 8c92b4b170..506ecb64bb 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
@@ -125,7 +125,7 @@ const QV4::Object *collectProperty(const QV4::ScopedValue &value, QV4::Execution
QJsonObject &dict)
{
QV4::Scope scope(engine);
- QV4::ScopedValue typeString(scope, QV4::Runtime::method_typeofValue(engine, value));
+ QV4::ScopedValue typeString(scope, QV4::Runtime::TypeofValue::call(engine, value));
dict.insert(QStringLiteral("type"), typeString->toQStringNoThrow());
const QLatin1String valueKey("value");
diff --git a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
index a5c2f40420..43a48e9d0d 100644
--- a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
@@ -378,7 +378,7 @@ void Collector::collect(QJsonArray *out, const QString &parentIName, const QStri
dict.insert(QStringLiteral("iname"), iname);
dict.insert(QStringLiteral("name"), nonEmptyName);
- QV4::ScopedValue typeString(scope, QV4::Runtime::method_typeofValue(m_engine, value));
+ QV4::ScopedValue typeString(scope, QV4::Runtime::TypeofValue::call(m_engine, value));
dict.insert(QStringLiteral("type"), typeString->toQStringNoThrow());
switch (value.type()) {