aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-06-01 09:35:20 +0200
committerLars Knoll <lars.knoll@qt.io>2018-06-04 13:02:39 +0000
commit0fac88c7ed7bafccd4c89fa952460c921bca85f0 (patch)
treeedf7d9873110a6a2c857b90d6616148b0835b2ad
parent8d69977ab1f7f2d5eb8a0ce518071afe6a62894f (diff)
Rename SetExceptionHandler to SetUnwindHandler
It's being used for more than just exception handling, unwinding for return or break/continue statements also goes through those handlers. Change-Id: I145c7909540a1adca431de6a98d9c115ddf23612 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/qml/compiler/qv4bytecodegenerator_p.h4
-rw-r--r--src/qml/compiler/qv4bytecodehandler.cpp4
-rw-r--r--src/qml/compiler/qv4compilercontrolflow_p.h18
-rw-r--r--src/qml/compiler/qv4instr_moth.cpp4
-rw-r--r--src/qml/compiler/qv4instr_moth_p.h4
-rw-r--r--src/qml/jit/qv4assembler.cpp4
-rw-r--r--src/qml/jit/qv4assembler_p.h4
-rw-r--r--src/qml/jit/qv4baselinejit.cpp6
-rw-r--r--src/qml/jit/qv4baselinejit_p.h2
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp4
10 files changed, 27 insertions, 27 deletions
diff --git a/src/qml/compiler/qv4bytecodegenerator_p.h b/src/qml/compiler/qv4bytecodegenerator_p.h
index 98951b610c..b12584d41f 100644
--- a/src/qml/compiler/qv4bytecodegenerator_p.h
+++ b/src/qml/compiler/qv4bytecodegenerator_p.h
@@ -224,10 +224,10 @@ public:
return addJumpInstruction(data);
}
- void setExceptionHandler(ExceptionHandler *handler)
+ void setUnwindHandler(ExceptionHandler *handler)
{
currentExceptionHandler = handler;
- Instruction::SetExceptionHandler data;
+ Instruction::SetUnwindHandler data;
data.offset = 0;
if (!handler)
addInstruction(data);
diff --git a/src/qml/compiler/qv4bytecodehandler.cpp b/src/qml/compiler/qv4bytecodehandler.cpp
index ad1057bb9d..27182dcc72 100644
--- a/src/qml/compiler/qv4bytecodehandler.cpp
+++ b/src/qml/compiler/qv4bytecodehandler.cpp
@@ -269,9 +269,9 @@ std::vector<int> ByteCodeHandler::collectLabelsInBytecode(const char *code, uint
COLLECTOR_BEGIN_INSTR(CallContextObjectProperty)
COLLECTOR_END_INSTR(CallContextObjectProperty)
- COLLECTOR_BEGIN_INSTR(SetExceptionHandler)
+ COLLECTOR_BEGIN_INSTR(SetUnwindHandler)
addLabel(code - start + offset);
- COLLECTOR_END_INSTR(SetExceptionHandler)
+ COLLECTOR_END_INSTR(SetUnwindHandler)
COLLECTOR_BEGIN_INSTR(ThrowException)
COLLECTOR_END_INSTR(ThrowException)
diff --git a/src/qml/compiler/qv4compilercontrolflow_p.h b/src/qml/compiler/qv4compilercontrolflow_p.h
index db109533eb..b6c207e68c 100644
--- a/src/qml/compiler/qv4compilercontrolflow_p.h
+++ b/src/qml/compiler/qv4compilercontrolflow_p.h
@@ -310,14 +310,14 @@ struct ControlFlowWith : public ControlFlowUnwind
// assumes the with object is in the accumulator
Instruction::PushWithContext pushScope;
generator()->addInstruction(pushScope);
- generator()->setExceptionHandler(&unwindLabel);
+ generator()->setUnwindHandler(&unwindLabel);
}
virtual ~ControlFlowWith() {
// emit code for unwinding
unwindLabel.link();
- generator()->setExceptionHandler(parentExceptionHandler());
+ generator()->setUnwindHandler(parentExceptionHandler());
Instruction::PopContext pop;
generator()->addInstruction(pop);
@@ -335,7 +335,7 @@ struct ControlFlowBlock : public ControlFlowUnwind
if (block->requiresExecutionContext) {
setupExceptionHandler();
- generator()->setExceptionHandler(&unwindLabel);
+ generator()->setUnwindHandler(&unwindLabel);
}
}
@@ -343,7 +343,7 @@ struct ControlFlowBlock : public ControlFlowUnwind
// emit code for unwinding
if (block->requiresExecutionContext ) {
unwindLabel.link();
- generator()->setExceptionHandler(parentExceptionHandler());
+ generator()->setUnwindHandler(parentExceptionHandler());
}
block->emitBlockFooter(cg);
@@ -375,7 +375,7 @@ struct ControlFlowCatch : public ControlFlowUnwind
catchUnwindLabel(generator()->newExceptionHandler())
{
setupExceptionHandler();
- generator()->setExceptionHandler(&exceptionLabel);
+ generator()->setUnwindHandler(&exceptionLabel);
}
virtual Handler getHandler(HandlerType type, const QString &label = QString()) {
@@ -413,7 +413,7 @@ struct ControlFlowCatch : public ControlFlowUnwind
// clear the unwind temp for exceptions, we want to resume normal code flow afterwards
Reference::storeConstOnStack(cg, QV4::Encode::undefined(), controlFlowTemp);
- generator()->setExceptionHandler(&catchUnwindLabel);
+ generator()->setUnwindHandler(&catchUnwindLabel);
if (catchExpression->patternElement->bindingIdentifier.isEmpty())
// destructuring pattern
@@ -431,7 +431,7 @@ struct ControlFlowCatch : public ControlFlowUnwind
// break/continue/return statements in try go here
unwindLabel.link();
- generator()->setExceptionHandler(parentExceptionHandler());
+ generator()->setUnwindHandler(parentExceptionHandler());
emitUnwindHandler();
}
@@ -448,7 +448,7 @@ struct ControlFlowFinally : public ControlFlowUnwind
{
Q_ASSERT(finally != nullptr);
setupExceptionHandler();
- generator()->setExceptionHandler(&unwindLabel);
+ generator()->setUnwindHandler(&unwindLabel);
}
virtual Handler getHandler(HandlerType type, const QString &label = QString()) {
@@ -480,7 +480,7 @@ struct ControlFlowFinally : public ControlFlowUnwind
generator()->addInstruction(instr);
Reference::fromStackSlot(cg, exceptionTemp).storeConsumeAccumulator();
- generator()->setExceptionHandler(parentExceptionHandler());
+ generator()->setUnwindHandler(parentExceptionHandler());
cg->statement(finally->statement);
insideFinally = false;
diff --git a/src/qml/compiler/qv4instr_moth.cpp b/src/qml/compiler/qv4instr_moth.cpp
index c50735b61e..ec9f3fc972 100644
--- a/src/qml/compiler/qv4instr_moth.cpp
+++ b/src/qml/compiler/qv4instr_moth.cpp
@@ -384,12 +384,12 @@ void dumpBytecode(const char *code, int len, int nLocals, int nFormals, int /*st
d << dumpRegister(base, nFormals) << "." << name << dumpArguments(argc, argv, nFormals);
MOTH_END_INSTR(CallContextObjectProperty)
- MOTH_BEGIN_INSTR(SetExceptionHandler)
+ MOTH_BEGIN_INSTR(SetUnwindHandler)
if (offset)
d << ABSOLUTE_OFFSET();
else
d << "<null>";
- MOTH_END_INSTR(SetExceptionHandler)
+ MOTH_END_INSTR(SetUnwindHandler)
MOTH_BEGIN_INSTR(ThrowException)
MOTH_END_INSTR(ThrowException)
diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h
index 2223400787..ea72be12fe 100644
--- a/src/qml/compiler/qv4instr_moth_p.h
+++ b/src/qml/compiler/qv4instr_moth_p.h
@@ -111,7 +111,7 @@ QT_BEGIN_NAMESPACE
#define INSTR_CallGlobalLookup(op) INSTRUCTION(op, CallGlobalLookup, 3, index, argc, argv)
#define INSTR_CallScopeObjectProperty(op) INSTRUCTION(op, CallScopeObjectProperty, 4, name, base, argc, argv)
#define INSTR_CallContextObjectProperty(op) INSTRUCTION(op, CallContextObjectProperty, 4, name, base, argc, argv)
-#define INSTR_SetExceptionHandler(op) INSTRUCTION(op, SetExceptionHandler, 1, offset)
+#define INSTR_SetUnwindHandler(op) INSTRUCTION(op, SetUnwindHandler, 1, offset)
#define INSTR_ThrowException(op) INSTRUCTION(op, ThrowException, 0)
#define INSTR_GetException(op) INSTRUCTION(op, GetException, 0)
#define INSTR_SetException(op) INSTRUCTION(op, SetException, 0)
@@ -240,7 +240,7 @@ QT_BEGIN_NAMESPACE
F(CallGlobalLookup) \
F(CallScopeObjectProperty) \
F(CallContextObjectProperty) \
- F(SetExceptionHandler) \
+ F(SetUnwindHandler) \
F(ThrowException) \
F(GetException) \
F(SetException) \
diff --git a/src/qml/jit/qv4assembler.cpp b/src/qml/jit/qv4assembler.cpp
index 79e6312b26..a32039dc96 100644
--- a/src/qml/jit/qv4assembler.cpp
+++ b/src/qml/jit/qv4assembler.cpp
@@ -2228,14 +2228,14 @@ void Assembler::setException()
pasm()->store8(TrustedImm32(1), addr);
}
-void Assembler::setExceptionHandler(int offset)
+void Assembler::setUnwindHandler(int offset)
{
auto l = pasm()->storePtrWithPatch(TrustedImmPtr(nullptr), pasm()->exceptionHandlerAddress());
pasm()->ehTargets.push_back({ l, offset });
}
-void Assembler::clearExceptionHandler()
+void Assembler::clearUnwindHandler()
{
pasm()->storePtr(TrustedImmPtr(nullptr), pasm()->exceptionHandlerAddress());
}
diff --git a/src/qml/jit/qv4assembler_p.h b/src/qml/jit/qv4assembler_p.h
index a1596e1640..73faf7b69f 100644
--- a/src/qml/jit/qv4assembler_p.h
+++ b/src/qml/jit/qv4assembler_p.h
@@ -162,8 +162,8 @@ public:
void gotoCatchException();
void getException();
void setException();
- void setExceptionHandler(int offset);
- void clearExceptionHandler();
+ void setUnwindHandler(int offset);
+ void clearUnwindHandler();
void pushCatchContext(int index, int name);
void popContext();
diff --git a/src/qml/jit/qv4baselinejit.cpp b/src/qml/jit/qv4baselinejit.cpp
index d8f0976774..031c6e620c 100644
--- a/src/qml/jit/qv4baselinejit.cpp
+++ b/src/qml/jit/qv4baselinejit.cpp
@@ -553,12 +553,12 @@ void BaselineJIT::generate_CallContextObjectProperty(int propIdx, int base, int
as->checkException();
}
-void BaselineJIT::generate_SetExceptionHandler(int offset)
+void BaselineJIT::generate_SetUnwindHandler(int offset)
{
if (offset)
- as->setExceptionHandler(instructionOffset() + offset);
+ as->setUnwindHandler(instructionOffset() + offset);
else
- as->clearExceptionHandler();
+ as->clearUnwindHandler();
}
void BaselineJIT::generate_ThrowException()
diff --git a/src/qml/jit/qv4baselinejit_p.h b/src/qml/jit/qv4baselinejit_p.h
index c83b985bd6..96fd8348b8 100644
--- a/src/qml/jit/qv4baselinejit_p.h
+++ b/src/qml/jit/qv4baselinejit_p.h
@@ -128,7 +128,7 @@ public:
void generate_CallGlobalLookup(int index, int argc, int argv) override;
void generate_CallScopeObjectProperty(int propIdx, int base, int argc, int argv) override;
void generate_CallContextObjectProperty(int propIdx, int base, int argc, int argv) override;
- void generate_SetExceptionHandler(int offset) override;
+ void generate_SetUnwindHandler(int offset) override;
void generate_ThrowException() override;
void generate_GetException() override;
void generate_SetException() override;
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index d5e3ef28bd..e180298789 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -886,9 +886,9 @@ QV4::ReturnedValue VME::interpret(CppStackFrame &frame, const char *code)
CHECK_EXCEPTION;
MOTH_END_INSTR(CallContextObjectProperty)
- MOTH_BEGIN_INSTR(SetExceptionHandler)
+ MOTH_BEGIN_INSTR(SetUnwindHandler)
frame.exceptionHandler = offset ? code + offset : nullptr;
- MOTH_END_INSTR(SetExceptionHandler)
+ MOTH_END_INSTR(SetUnwindHandler)
MOTH_BEGIN_INSTR(ThrowException)
STORE_IP();