aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jit/qv4assembler.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-11-07 13:52:57 +0100
committerErik Verbruggen <erik.verbruggen@qt.io>2017-11-23 09:52:19 +0000
commit8df195c8765429652ccf31e9de9829bbae5ba5bb (patch)
treef31ffee6d72eb7cd82e73685e08abf2eb9fdc3b3 /src/qml/jit/qv4assembler.cpp
parentd6fed261bed0b9b38e44bfa6e00ebc0789059b16 (diff)
V4: Add fastpath for integer-to-integer comparissons
Change-Id: I4831d0b4dda160e43ddbca08b9001611e9cc921d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jit/qv4assembler.cpp')
-rw-r--r--src/qml/jit/qv4assembler.cpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/qml/jit/qv4assembler.cpp b/src/qml/jit/qv4assembler.cpp
index d79739fad5..8165cd0807 100644
--- a/src/qml/jit/qv4assembler.cpp
+++ b/src/qml/jit/qv4assembler.cpp
@@ -1664,10 +1664,16 @@ void Assembler::cmpneInt(int lhs)
pasm()->popValueAligned();
}
-void Assembler::cmp(int /*cond*/, CmpFunc function, const char *functionName, int lhs)
+void Assembler::cmp(int cond, CmpFunc function, const char *functionName, int lhs)
{
-// PlatformAssembler::Address lhsAddr(PlatformAssembler::JSStackFrameRegister, lhs * int(sizeof(QV4::Value)));
-// auto done = pasm()->cmpFastPath(static_cast<PlatformAssembler::RelationalCondition>(cond), lhsAddr);
+ auto c = static_cast<PlatformAssembler::RelationalCondition>(cond);
+ auto done = pasm()->binopBothIntPath(regAddr(lhs), [this, c](){
+ pasm()->compare32(c, PlatformAssembler::ScratchRegister,
+ PlatformAssembler::AccumulatorRegisterValue,
+ PlatformAssembler::AccumulatorRegisterValue);
+ pasm()->setAccumulatorTag(QV4::Value::ValueTypeInternal::Boolean);
+ return PlatformAssembler::Jump();
+ });
// slow path:
saveAccumulatorInFrame();
@@ -1680,7 +1686,7 @@ void Assembler::cmp(int /*cond*/, CmpFunc function, const char *functionName, in
pasm()->setAccumulatorTag(QV4::Value::ValueTypeInternal::Boolean);
// done.
-// done.link(pasm());
+ done.link(pasm());
}
void Assembler::cmpeq(int lhs)
@@ -1721,21 +1727,14 @@ void Assembler::cmple(int lhs)
void Assembler::cmpStrictEqual(int lhs)
{
- saveAccumulatorInFrame();
- prepareCallWithArgCount(2);
- passAccumulatorAsArg(1);
- passRegAsArg(lhs, 0);
- IN_JIT_GENERATE_RUNTIME_CALL(RuntimeHelpers::strictEqual, ResultInAccumulator);
- pasm()->setAccumulatorTag(QV4::Value::ValueTypeInternal::Boolean);
+ cmp(PlatformAssembler::Equal, &RuntimeHelpers::strictEqual,
+ "RuntimeHelpers::strictEqual", lhs);
}
void Assembler::cmpStrictNotEqual(int lhs)
{
- saveAccumulatorInFrame();
- prepareCallWithArgCount(2);
- passAccumulatorAsArg(1);
- passRegAsArg(lhs, 0);
- IN_JIT_GENERATE_RUNTIME_CALL(RuntimeHelpers::strictEqual, ResultInAccumulator);
+ cmp(PlatformAssembler::Equal, &RuntimeHelpers::strictEqual,
+ "RuntimeHelpers::strictEqual", lhs);
pasm()->xor32(TrustedImm32(1), PlatformAssembler::AccumulatorRegisterValue);
pasm()->setAccumulatorTag(QV4::Value::ValueTypeInternal::Boolean);
}