aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-08-03 12:20:06 +0200
committerLars Knoll <lars.knoll@qt.io>2017-08-03 10:22:06 +0000
commit920339c210778ca987aa161b1102df4a0d00149f (patch)
tree186756d7b07d50ef73bb5cb6173b0c5ed05a1e6d /src
parentef5d5a989a344ba812a91b365cd54ace65f27f26 (diff)
No need to pass the Engine pointer to VME::exec()
Change-Id: I1e43305e26833a6d9b714e89f59ccead6bd12605 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/jsruntime/qv4function.cpp2
-rw-r--r--src/qml/jsruntime/qv4function_p.h4
-rw-r--r--src/qml/jsruntime/qv4profiling_p.h10
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp4
-rw-r--r--src/qml/jsruntime/qv4vme_moth_p.h2
5 files changed, 12 insertions, 10 deletions
diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp
index 713ed589b7..d21afa3b87 100644
--- a/src/qml/jsruntime/qv4function.cpp
+++ b/src/qml/jsruntime/qv4function.cpp
@@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
using namespace QV4;
Function::Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit, const CompiledData::Function *function,
- ReturnedValue (*codePtr)(Function *, ExecutionEngine *))
+ ReturnedValue (*codePtr)(Function *))
: compiledFunction(function)
, compilationUnit(unit)
, code(codePtr)
diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h
index 70561f28e8..9fc51e90af 100644
--- a/src/qml/jsruntime/qv4function_p.h
+++ b/src/qml/jsruntime/qv4function_p.h
@@ -63,7 +63,7 @@ struct Q_QML_EXPORT Function {
const CompiledData::Function *compiledFunction;
CompiledData::CompilationUnit *compilationUnit;
- ReturnedValue (*code)(Function *, ExecutionEngine *);
+ ReturnedValue (*code)(Function *);
const uchar *codeData;
// first nArguments names in internalClass are the actual arguments
@@ -73,7 +73,7 @@ struct Q_QML_EXPORT Function {
bool canUseSimpleCall;
Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit, const CompiledData::Function *function,
- ReturnedValue (*codePtr)(Function *, ExecutionEngine *));
+ ReturnedValue (*codePtr)(Function *));
~Function();
// used when dynamically assigning signal handlers (QQmlConnection)
diff --git a/src/qml/jsruntime/qv4profiling_p.h b/src/qml/jsruntime/qv4profiling_p.h
index 71a6d34f9d..e7b6909690 100644
--- a/src/qml/jsruntime/qv4profiling_p.h
+++ b/src/qml/jsruntime/qv4profiling_p.h
@@ -61,7 +61,7 @@
#define Q_V4_PROFILE_ALLOC(engine, size, type) (!engine)
#define Q_V4_PROFILE_DEALLOC(engine, size, type) (!engine)
-#define Q_V4_PROFILE(engine, function) (function->code(engine, function->codeData))
+#define Q_V4_PROFILE(engine, function) (function->code(function))
QT_BEGIN_NAMESPACE
@@ -88,8 +88,8 @@ QT_END_NAMESPACE
#define Q_V4_PROFILE(engine, function)\
(Q_UNLIKELY(engine->profiler()) &&\
(engine->profiler()->featuresEnabled & (1 << Profiling::FeatureFunctionCall)) ?\
- Profiling::FunctionCallProfiler::profileCall(engine->profiler(), engine, function) :\
- function->code(function, engine))
+ Profiling::FunctionCallProfiler::profileCall(engine->profiler(), function) :\
+ function->code(function))
QT_BEGIN_NAMESPACE
@@ -279,10 +279,10 @@ public:
profiler->m_data.append(FunctionCall(function, startTime, profiler->m_timer.nsecsElapsed()));
}
- static ReturnedValue profileCall(Profiler *profiler, ExecutionEngine *engine, Function *function)
+ static ReturnedValue profileCall(Profiler *profiler, Function *function)
{
FunctionCallProfiler callProfiler(profiler, function);
- return function->code(function, engine);
+ return function->code(function);
}
Profiler *profiler;
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index 85def98492..d3a2533136 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -419,7 +419,7 @@ static inline const QV4::Value &constant(Function *function, int index)
return function->compilationUnit->constants[index];
}
-QV4::ReturnedValue VME::exec(Function *function, ExecutionEngine *engine)
+QV4::ReturnedValue VME::exec(Function *function)
{
#ifdef DO_TRACE_INSTR
qDebug("Starting VME with context=%p and code=%p", context, code);
@@ -435,6 +435,8 @@ QV4::ReturnedValue VME::exec(Function *function, ExecutionEngine *engine)
#undef MOTH_INSTR_ADDR
#endif
+ ExecutionEngine *engine = function->internalClass->engine;
+
// Arguments/locals are used a *lot*, and pre-fetching them removes a whole bunch of triple
// (or quadruple) indirect loads.
QV4::Value *arguments = nullptr;
diff --git a/src/qml/jsruntime/qv4vme_moth_p.h b/src/qml/jsruntime/qv4vme_moth_p.h
index 4e42ca6fde..51ea5fbdac 100644
--- a/src/qml/jsruntime/qv4vme_moth_p.h
+++ b/src/qml/jsruntime/qv4vme_moth_p.h
@@ -65,7 +65,7 @@ namespace Moth {
class VME
{
public:
- static QV4::ReturnedValue exec(QV4::Function *, QV4::ExecutionEngine *);
+ static QV4::ReturnedValue exec(QV4::Function *);
};
} // namespace Moth