diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-08 10:56:34 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-08-10 08:19:18 +0000 |
commit | 5bc4f4d958a3b76f3435d61206ca0109f07aa1a3 (patch) | |
tree | cb2ef4772f2d343e9957271161ac32809bc5d0a6 /src/qml/jsruntime/qv4profiling_p.h | |
parent | 30e3664bf3668bda9a211fe7d1404f8f806dbf7b (diff) |
Refactor context handling
Fix the push/pop context instructions to not modify the JS
stack anymore, as that can cause conflicts with the VME
(and was an ugly hack in any case). Instead, these instructions
not return the old context, that is then stored in a temporary.
Get rid of Engine::current and Engine::currentContext. The
StackFrame structures do now contain the only and authoritive
data. This finally gives us a nice setup where we create and
destroy frames on the stack when entering/leaving functions.
Change-Id: If161e3e941f59865c47ecfe1e094faf62b52bfa0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4profiling_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4profiling_p.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4profiling_p.h b/src/qml/jsruntime/qv4profiling_p.h index adf9853f62..be38690a49 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, jsFunction) (function->code(function, jsFunction)) +#define Q_V4_PROFILE(engine, context, function, jsFunction) (function->code(context, function, jsFunction)) QT_BEGIN_NAMESPACE @@ -85,11 +85,11 @@ QT_END_NAMESPACE (engine->profiler()->featuresEnabled & (1 << Profiling::FeatureMemoryAllocation)) ?\ engine->profiler()->trackDealloc(size, type) : false) -#define Q_V4_PROFILE(engine, function, jsFunction)\ +#define Q_V4_PROFILE(engine, context, function, jsFunction)\ (Q_UNLIKELY(engine->profiler()) &&\ (engine->profiler()->featuresEnabled & (1 << Profiling::FeatureFunctionCall)) ?\ - Profiling::FunctionCallProfiler::profileCall(engine->profiler(), function, jsFunction) :\ - function->code(function, jsFunction)) + Profiling::FunctionCallProfiler::profileCall(engine->profiler(), context, function, jsFunction) :\ + function->code(context, function, jsFunction)) QT_BEGIN_NAMESPACE @@ -279,10 +279,10 @@ public: profiler->m_data.append(FunctionCall(function, startTime, profiler->m_timer.nsecsElapsed())); } - static ReturnedValue profileCall(Profiler *profiler, Function *function, const FunctionObject *jsFunction) + static ReturnedValue profileCall(Profiler *profiler, Heap::ExecutionContext *context, Function *function, const FunctionObject *jsFunction) { FunctionCallProfiler callProfiler(profiler, function); - return function->code(function, jsFunction); + return function->code(context, function, jsFunction); } Profiler *profiler; |