diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2016-02-25 10:58:58 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2016-03-06 14:25:43 +0000 |
commit | c020bc671b30ea90f6bacd8bf6cd26ce5e808a6b (patch) | |
tree | 875a541f27e050e10396bbd1f6289816ca3b6ab2 /src/qml/compiler/qv4jsir_p.h | |
parent | 3cc5c3b845b6c26d2e6c35de4672bd55b7e192b0 (diff) |
V4 IR: Store the phi-node parameters directly in the class.
Every time one of the paramets was accessed, the chain of loads was:
phi->d->incoming->heapdata[i]
Now it is:
phi[i + offsetof(incoming)]
This also removes at least one malloc (for the Data), and usually two
(when the number of parameters is <= 4, which is most of the cases).
Change-Id: I953e784647148266ae5a49a93a203d0d22cdcb63
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/compiler/qv4jsir_p.h')
-rw-r--r-- | src/qml/compiler/qv4jsir_p.h | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/qml/compiler/qv4jsir_p.h b/src/qml/compiler/qv4jsir_p.h index 974e8dfe0d..0189ff4a23 100644 --- a/src/qml/compiler/qv4jsir_p.h +++ b/src/qml/compiler/qv4jsir_p.h @@ -753,21 +753,15 @@ struct Ret: Stmt { struct Phi: Stmt { Temp *targetTemp; - struct Data { - QVector<Expr *> incoming; // used by Phi nodes - }; - - Data *d; + VarLengthArray<Expr *, 4> incoming; - Phi(int id): Stmt(id), d(0) {} + Phi(int id): Stmt(id) {} virtual void accept(StmtVisitor *v) { v->visitPhi(this); } virtual Phi *asPhi() { return this; } - void destroyData() { - delete d; - d = 0; - } + void destroyData() + { incoming.~VarLengthArray(); } }; struct Q_QML_PRIVATE_EXPORT Module { |