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/jit | |
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/jit')
-rw-r--r-- | src/qml/jit/qv4baselinejit.cpp | 3 | ||||
-rw-r--r-- | src/qml/jit/qv4baselinejit_p.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/jit/qv4baselinejit.cpp b/src/qml/jit/qv4baselinejit.cpp index 8de0259509..b0734d0a2d 100644 --- a/src/qml/jit/qv4baselinejit.cpp +++ b/src/qml/jit/qv4baselinejit.cpp @@ -1023,10 +1023,11 @@ void BaselineJIT::generate_GetTemplateObject(int index) as->checkException(); } -void BaselineJIT::startInstruction(Instr::Type /*instr*/) +ByteCodeHandler::Verdict BaselineJIT::startInstruction(Instr::Type /*instr*/) { if (labels.contains(currentInstructionOffset())) as->addLabel(currentInstructionOffset()); + return ProcessInstruction; } void BaselineJIT::endInstruction(Instr::Type instr) diff --git a/src/qml/jit/qv4baselinejit_p.h b/src/qml/jit/qv4baselinejit_p.h index 998f9f110b..5f3cb7eb2e 100644 --- a/src/qml/jit/qv4baselinejit_p.h +++ b/src/qml/jit/qv4baselinejit_p.h @@ -217,7 +217,7 @@ public: void generate_ThrowOnNullOrUndefined() override; void generate_GetTemplateObject(int index) override; - void startInstruction(Moth::Instr::Type instr) override; + Verdict startInstruction(Moth::Instr::Type instr) override; void endInstruction(Moth::Instr::Type instr) override; private: |