aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jit
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-04-06 10:20:08 +0200
committerLars Knoll <lars.knoll@qt.io>2018-05-02 14:17:51 +0000
commit922e6f42b4fa9b9fa87246c577c13bb945bd4bc4 (patch)
tree182cf430b7340c4f34c0cb350af1c15fd41b6648 /src/qml/jit
parent20d30b6b3a253eebedc927dbb91685bbec52cfee (diff)
Rework catch context handling
Remove the need for a specialized catch context, instead use a regular block context, that also captures the catched variable. This also removes the need to do lookups by name inside a catch expression. Change-Id: I8b037add7f423922e2a76b4c0da646ca7e25813a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jit')
-rw-r--r--src/qml/jit/qv4assembler.cpp7
-rw-r--r--src/qml/jit/qv4assembler_p.h2
-rw-r--r--src/qml/jit/qv4jit.cpp2
-rw-r--r--src/qml/jit/qv4jit_p.h2
4 files changed, 7 insertions, 6 deletions
diff --git a/src/qml/jit/qv4assembler.cpp b/src/qml/jit/qv4assembler.cpp
index 890d9d03a1..c73b3919ae 100644
--- a/src/qml/jit/qv4assembler.cpp
+++ b/src/qml/jit/qv4assembler.cpp
@@ -2222,11 +2222,12 @@ void Assembler::clearExceptionHandler()
pasm()->storePtr(TrustedImmPtr(nullptr), pasm()->exceptionHandlerAddress());
}
-void Assembler::pushCatchContext(int name, int reg)
+void Assembler::pushCatchContext(int reg, int index, int name)
{
pasm()->copyReg(pasm()->contextAddress(), regAddr(reg));
- prepareCallWithArgCount(2);
- passInt32AsArg(name, 1);
+ prepareCallWithArgCount(3);
+ passInt32AsArg(name, 2);
+ passInt32AsArg(index, 1);
passRegAsArg(CallData::Context, 0);
IN_JIT_GENERATE_RUNTIME_CALL(Runtime::method_createCatchContext, ResultInAccumulator);
pasm()->storeAccumulator(pasm()->contextAddress());
diff --git a/src/qml/jit/qv4assembler_p.h b/src/qml/jit/qv4assembler_p.h
index a98761c6ab..f9a74edc77 100644
--- a/src/qml/jit/qv4assembler_p.h
+++ b/src/qml/jit/qv4assembler_p.h
@@ -163,7 +163,7 @@ public:
void setException();
void setExceptionHandler(int offset);
void clearExceptionHandler();
- void pushCatchContext(int name, int reg);
+ void pushCatchContext(int reg, int index, int name);
void popContext(int reg);
// other stuff
diff --git a/src/qml/jit/qv4jit.cpp b/src/qml/jit/qv4jit.cpp
index 4a2e2b959c..678a0c16db 100644
--- a/src/qml/jit/qv4jit.cpp
+++ b/src/qml/jit/qv4jit.cpp
@@ -604,7 +604,7 @@ void BaselineJIT::generate_CreateCallContext()
as->storeHeapObject(CallData::Context);
}
-void BaselineJIT::generate_PushCatchContext(int name, int reg) { as->pushCatchContext(name, reg); }
+void BaselineJIT::generate_PushCatchContext(int reg, int index, int name) { as->pushCatchContext(reg, index, name); }
static void pushWithContextHelper(ExecutionEngine *engine, QV4::Value *stack, int reg)
{
diff --git a/src/qml/jit/qv4jit_p.h b/src/qml/jit/qv4jit_p.h
index 3e81807754..150f4b6aab 100644
--- a/src/qml/jit/qv4jit_p.h
+++ b/src/qml/jit/qv4jit_p.h
@@ -175,7 +175,7 @@ public:
void generate_GetException() override;
void generate_SetException() override;
void generate_CreateCallContext() override;
- void generate_PushCatchContext(int name, int reg) override;
+ void generate_PushCatchContext(int reg, int index, int name) override;
void generate_PushWithContext(int reg) override;
void generate_PushBlockContext(int reg, int index) override;
void generate_PopContext(int reg) override;