From 8e64fdf246a9076d4044e6c78af29e499f48905c Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 9 Feb 2017 15:53:13 +0100 Subject: Prepare run-time method calling mechanism for cross-compilation The current way of encoding the offsetof() of the method_ members in QV4::Runtime is not portable when cross-compiling from a 64-bit host (where the offsetof would be calculated on) to a 32-bit target (where the offset would be different), or vice versa. In preparation for making this work, this patch first replaces the direct use of the run-time members with use through a void * and an enum for indexing. This gives us some type-safety in some places and will also allow for a translation of the pointer offset from host pointer indexing to target pointer indexes. As a bonus we can avoid going through the engine->runtime indirection in the interpreter altogether and call the static methods right away. Task-number: QTBUG-58666 Change-Id: I3cd6459523923a9719408317fa729bca19c2bf3c Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4arraydata.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/jsruntime/qv4arraydata.cpp') diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp index d8a7de5466..c29cedaa9b 100644 --- a/src/qml/jsruntime/qv4arraydata.cpp +++ b/src/qml/jsruntime/qv4arraydata.cpp @@ -697,7 +697,7 @@ bool ArrayElementLessThan::operator()(Value v1, Value v2) const callData->thisObject = Primitive::undefinedValue(); callData->args[0] = v1; callData->args[1] = v2; - result = scope.engine->runtime.callValue(scope.engine, m_comparefn, callData); + result = QV4::Runtime::method_callValue(scope.engine, m_comparefn, callData); return result->toNumber() < 0; } -- cgit v1.2.3