aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jit
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-11-21 10:00:45 +0100
committerLars Knoll <lars.knoll@qt.io>2017-11-23 15:05:22 +0000
commit1f5c79c59aa43e416778a2046e4121731b34bb6a (patch)
tree27dbc03f147d484e79c40b42c79abc2a2291655b /src/qml/jit
parent8df195c8765429652ccf31e9de9829bbae5ba5bb (diff)
V4: Collapse LoadRegExp+StoreReg into MoveRegExp
LoadRegExp is nearly always followed by a store of the accumulator, so change LoadRegExp to be MoveRegExp. This saves an instruction. Change-Id: I5d47c5bf6ffd7f28247c328410872c3b229ca23c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jit')
-rw-r--r--src/qml/jit/qv4jit.cpp7
-rw-r--r--src/qml/jit/qv4jit_p.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/qml/jit/qv4jit.cpp b/src/qml/jit/qv4jit.cpp
index a8bdd20fbd..e1737cbe45 100644
--- a/src/qml/jit/qv4jit.cpp
+++ b/src/qml/jit/qv4jit.cpp
@@ -255,12 +255,13 @@ void BaselineJIT::generate_LoadRuntimeString(int stringId)
as->loadString(stringId);
}
-void BaselineJIT::generate_LoadRegExp(int regExpId)
+void BaselineJIT::generate_MoveRegExp(int regExpId, int destReg)
{
as->prepareCallWithArgCount(2);
as->passInt32AsArg(regExpId, 1);
as->passEngineAsArg(0);
JIT_GENERATE_RUNTIME_CALL(Runtime::method_regexpLiteral, Assembler::ResultInAccumulator);
+ as->storeReg(destReg);
}
void BaselineJIT::generate_LoadClosure(int value)
@@ -1062,8 +1063,8 @@ void BaselineJIT::collectLabelsInBytecode()
MOTH_BEGIN_INSTR(LoadRuntimeString)
MOTH_END_INSTR(LoadRuntimeString)
- MOTH_BEGIN_INSTR(LoadRegExp)
- MOTH_END_INSTR(LoadRegExp)
+ MOTH_BEGIN_INSTR(MoveRegExp)
+ MOTH_END_INSTR(MoveRegExp)
MOTH_BEGIN_INSTR(LoadClosure)
MOTH_END_INSTR(LoadClosure)
diff --git a/src/qml/jit/qv4jit_p.h b/src/qml/jit/qv4jit_p.h
index dfa2a79c48..f9e2a9650c 100644
--- a/src/qml/jit/qv4jit_p.h
+++ b/src/qml/jit/qv4jit_p.h
@@ -137,7 +137,7 @@ public:
void generate_LoadScopedLocal(int scope, int index) Q_DECL_OVERRIDE;
void generate_StoreScopedLocal(int scope, int index) Q_DECL_OVERRIDE;
void generate_LoadRuntimeString(int stringId) Q_DECL_OVERRIDE;
- void generate_LoadRegExp(int regExpId) Q_DECL_OVERRIDE;
+ void generate_MoveRegExp(int regExpId, int destReg) Q_DECL_OVERRIDE;
void generate_LoadClosure(int value) Q_DECL_OVERRIDE;
void generate_LoadName(int name) Q_DECL_OVERRIDE;
void generate_LoadGlobalLookup(int index) Q_DECL_OVERRIDE;