aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jit/qv4assembler.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-05-15 13:15:43 +0200
committerLars Knoll <lars.knoll@qt.io>2018-05-23 13:19:01 +0000
commit6f1e2722b9eef73a4fe19951b47c4b172642a2ba (patch)
tree01e58c038a7d63ed9206c834c4f6df1fb51db142 /src/qml/jit/qv4assembler.cpp
parent3e6d5d9cd1de1373f67f2ff31373a59c37f7b576 (diff)
Simplify Push and PopContext instructions
There's no need for a temp register to store the old context in, as PopContext can simply retrieve the old context from the current one. Change-Id: Ife9cfdff7fa8e47fc71e844a7798de88dbc79e26 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jit/qv4assembler.cpp')
-rw-r--r--src/qml/jit/qv4assembler.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/qml/jit/qv4assembler.cpp b/src/qml/jit/qv4assembler.cpp
index 736dfd0908..45dc87db19 100644
--- a/src/qml/jit/qv4assembler.cpp
+++ b/src/qml/jit/qv4assembler.cpp
@@ -2241,9 +2241,8 @@ void Assembler::clearExceptionHandler()
pasm()->storePtr(TrustedImmPtr(nullptr), pasm()->exceptionHandlerAddress());
}
-void Assembler::pushCatchContext(int reg, int index, int name)
+void Assembler::pushCatchContext(int index, int name)
{
- pasm()->copyReg(pasm()->contextAddress(), regAddr(reg));
prepareCallWithArgCount(3);
passInt32AsArg(name, 2);
passInt32AsArg(index, 1);
@@ -2252,9 +2251,13 @@ void Assembler::pushCatchContext(int reg, int index, int name)
pasm()->storeAccumulator(pasm()->contextAddress());
}
-void Assembler::popContext(int reg)
+void Assembler::popContext()
{
- pasm()->copyReg(regAddr(reg), pasm()->contextAddress());
+ Heap::CallContext ctx;
+ Q_UNUSED(ctx)
+ pasm()->loadPointerFromValue(regAddr(CallData::Context), PlatformAssembler::ScratchRegister);
+ pasm()->loadAccumulator(Address(PlatformAssembler::ScratchRegister, ctx.outer.offset));
+ pasm()->storeAccumulator(regAddr(CallData::Context));
}
void Assembler::ret()