aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jit
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-11-21 10:10:36 +0100
committerLars Knoll <lars.knoll@qt.io>2017-11-23 15:05:25 +0000
commit458daae517b4465fafb315323e9c727f1655764d (patch)
tree623a4a9a6268f08c53cb2369268c98bda966d1c6 /src/qml/jit
parent1f5c79c59aa43e416778a2046e4121731b34bb6a (diff)
V4: Change CallValue to have the value on the stack
We used to store the value-to-be-called in the accumulator. So the generated bytecode looked like: LoadReg r1 CallValue() The first thing done in CallValue is to store the accumulator. So by not loading the accumulator, we can actually remove the subsequent store, which results in less interpreter instructions and one less store in CallValue. Change-Id: Icc7c8a5449bf369b9226d66bc6055cb705ef660e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jit')
-rw-r--r--src/qml/jit/qv4jit.cpp5
-rw-r--r--src/qml/jit/qv4jit_p.h2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/qml/jit/qv4jit.cpp b/src/qml/jit/qv4jit.cpp
index e1737cbe45..3de03e5327 100644
--- a/src/qml/jit/qv4jit.cpp
+++ b/src/qml/jit/qv4jit.cpp
@@ -518,14 +518,13 @@ void BaselineJIT::generate_LoadIdObject(int index, int base)
as->checkException();
}
-void BaselineJIT::generate_CallValue(int argc, int argv)
+void BaselineJIT::generate_CallValue(int name, int argc, int argv)
{
STORE_IP();
- STORE_ACC();
as->prepareCallWithArgCount(4);
as->passInt32AsArg(argc, 3);
as->passRegAsArg(argv, 2);
- as->passAccumulatorAsArg(1);
+ as->passRegAsArg(name, 1);
as->passEngineAsArg(0);
JIT_GENERATE_RUNTIME_CALL(Runtime::method_callValue, Assembler::ResultInAccumulator);
as->checkException();
diff --git a/src/qml/jit/qv4jit_p.h b/src/qml/jit/qv4jit_p.h
index f9e2a9650c..c7ec1700c3 100644
--- a/src/qml/jit/qv4jit_p.h
+++ b/src/qml/jit/qv4jit_p.h
@@ -161,7 +161,7 @@ public:
void generate_LoadContextObjectProperty(int propertyIndex, int base,
int captureRequired) Q_DECL_OVERRIDE;
void generate_LoadIdObject(int index, int base) Q_DECL_OVERRIDE;
- void generate_CallValue(int argc, int argv) Q_DECL_OVERRIDE;
+ void generate_CallValue(int name, int argc, int argv) Q_DECL_OVERRIDE;
void generate_CallProperty(int name, int base, int argc, int argv) Q_DECL_OVERRIDE;
void generate_CallPropertyLookup(int lookupIndex, int base, int argc, int argv) Q_DECL_OVERRIDE;
void generate_CallElement(int base, int index, int argc, int argv) Q_DECL_OVERRIDE;