aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4regalloc.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@me.com>2013-10-04 16:06:16 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-10 09:54:24 +0200
commita967a9bdcc2c75a0270c2be48d845ded5332e4f0 (patch)
treebb19264f0e045239103678d568d506d8094bbcd9 /src/qml/compiler/qv4regalloc.cpp
parentdcec03166c93fcbc9aa1ca97f53a6f436faa482c (diff)
V4 JIT: generate some strict (not) equal conditions
Checks for strict (not) equal to null, undefined, or a boolean value can be generated without reserving extra registers, or doing a call. This reduces the amount of runtime calls from >25mln to ~6500 for v8-bench.js Change-Id: If08d1124b2869227654b1233a89833c5b5e7b40c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4regalloc.cpp')
-rw-r--r--src/qml/compiler/qv4regalloc.cpp26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/qml/compiler/qv4regalloc.cpp b/src/qml/compiler/qv4regalloc.cpp
index 58c84add2e..c325ea6b71 100644
--- a/src/qml/compiler/qv4regalloc.cpp
+++ b/src/qml/compiler/qv4regalloc.cpp
@@ -424,7 +424,12 @@ protected: // IRDecoder
{
bool needsCall = true;
- if (leftSource->type == DoubleType && rightSource->type == DoubleType) {
+ if (oper == OpStrictEqual || oper == OpStrictNotEqual) {
+ bool noCall = leftSource->type == NullType || rightSource->type == NullType
+ || leftSource->type == UndefinedType || rightSource->type == UndefinedType
+ || leftSource->type == BoolType || rightSource->type == BoolType;
+ needsCall = !noCall;
+ } else if (leftSource->type == DoubleType && rightSource->type == DoubleType) {
if (oper == OpMul || oper == OpAdd || oper == OpDiv || oper == OpSub
|| (oper >= OpGt && oper <= OpStrictNotEqual)) {
needsCall = false;
@@ -439,25 +444,6 @@ protected: // IRDecoder
}
}
-#if 0 // TODO: change masm to generate code
- switch (leftSource->type) {
- case DoubleType:
- case SInt32Type:
- case UInt32Type:
- switch (rightSource->type) {
- case DoubleType:
- case SInt32Type:
- case UInt32Type:
- if (oper != OpMod)
- needsCall = false;
- default:
- break;
- } break;
- default:
- break;
- }
-#endif
-
addDef(target);
if (needsCall) {