diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2019-01-10 13:42:42 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2019-02-01 14:07:23 +0000 |
commit | ad8e47f5181fd8240645282abbc671812a9f4fa8 (patch) | |
tree | cdd5da6824bca8e84e860d5f91d3e812bdf16e9a /src/qml/compiler/qv4bytecodehandler.cpp | |
parent | 3254ac322be96ad0ee5efd3d0728be03d8be34da (diff) |
V4: Change ByteCodeHandler::startInstruction to return an enum
If ProcessInstruction is returned, the generate_* function and
endInstruction will be called. If SkipInstruction is returned, they
won't be called. This can be used by subclasses that can detect dead
code, to suppress handling that code.
Change-Id: I3b4a8eebb5701f287c8199bd40bc63fe04a35007
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4bytecodehandler.cpp')
-rw-r--r-- | src/qml/compiler/qv4bytecodehandler.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/compiler/qv4bytecodehandler.cpp b/src/qml/compiler/qv4bytecodehandler.cpp index 92b112c2fa..f9f755b8c0 100644 --- a/src/qml/compiler/qv4bytecodehandler.cpp +++ b/src/qml/compiler/qv4bytecodehandler.cpp @@ -58,9 +58,10 @@ ByteCodeHandler::~ByteCodeHandler() Q_UNUSED(base_ptr); \ _currentOffset = _nextOffset; \ _nextOffset = code - start; \ - startInstruction(Instr::Type::instr); \ - INSTR_##instr(DISPATCH) \ - endInstruction(Instr::Type::instr); \ + if (startInstruction(Instr::Type::instr) == ProcessInstruction) { \ + INSTR_##instr(DISPATCH) \ + endInstruction(Instr::Type::instr); \ + } \ continue; \ } |