aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4bytecodehandler_p.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2018-11-23 12:34:48 +0100
committerErik Verbruggen <erik.verbruggen@qt.io>2019-01-31 09:19:13 +0000
commit3f2efbd1b904cdc9358ed328235502e338b020bf (patch)
tree38fe2d4e1d00d30fb6ce51944eae3f5d8bd662da /src/qml/compiler/qv4bytecodehandler_p.h
parent965f49bb4f83c9eedd56f9ec01f166a4634a05d3 (diff)
V4: Generate labels for backward jumps
When analyzing the bytecode from top-to-bottom in a single pass, we don't know when a jump back to previously seen code occurs. For example, in the baseline JIT we would already have generated code for some bytecode when we see a jump back (like at the end of a loop body), and we can't go back and insert a label to jump to. As JavaScript has no goto's, the only backward jumps are at the end of loops, so there are very few cases where we need to actually generate labels. This was previously handled by analyzing the bytecode twice: once to collect all jump targets, and then second pass over the bytecode to do the actual JITting (which would use the jump targets to insert labels). We can now do that with one single pass. So the trade-off is to store 4 bytes more per function plus 4 bytes for each loop, instead of having to analyze all functions only to find where all jumps are each time that function is JITted. Change-Id: I3abfcb69f65851a397dbd4a9762ea5e9e57495f6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4bytecodehandler_p.h')
-rw-r--r--src/qml/compiler/qv4bytecodehandler_p.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4bytecodehandler_p.h b/src/qml/compiler/qv4bytecodehandler_p.h
index b37c8810bd..10626ddb74 100644
--- a/src/qml/compiler/qv4bytecodehandler_p.h
+++ b/src/qml/compiler/qv4bytecodehandler_p.h
@@ -100,8 +100,6 @@ public:
int currentInstructionOffset() const { return _currentOffset; }
int nextInstructionOffset() const { return _nextOffset; }
- static std::vector<int> collectLabelsInBytecode(const char *code, uint len);
-
protected:
FOR_EACH_MOTH_INSTR(BYTECODE_HANDLER_DEFINE_VIRTUAL_BYTECODE_HANDLER)