diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-09-12 22:47:07 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-09-14 19:21:25 +0000 |
commit | 6982d0d6290c137468749bb8ab2f2e20dfa453fd (patch) | |
tree | 62b0c22c5bbff0b2da8031930b355815b88a0c8a /src/qml/jit/qv4jithelpers.cpp | |
parent | 2beb77c81a1f3585c15099a09ba8b2192c6da824 (diff) |
Optimize the JIT helpers
Match the argument order to the lookup functions being
called to minimize register shuffling that needs to be
done inside the function.
Change-Id: I0c55234d0c86b524dad021a519c6416d62d34c52
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jit/qv4jithelpers.cpp')
-rw-r--r-- | src/qml/jit/qv4jithelpers.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/qml/jit/qv4jithelpers.cpp b/src/qml/jit/qv4jithelpers.cpp index 427356e5ed..f43f37ad70 100644 --- a/src/qml/jit/qv4jithelpers.cpp +++ b/src/qml/jit/qv4jithelpers.cpp @@ -64,7 +64,7 @@ void convertThisToObject(ExecutionEngine *engine, Value *t) } } -ReturnedValue loadGlobalLookup(ExecutionEngine *engine, Function *f, int index) +ReturnedValue loadGlobalLookup(Function *f, ExecutionEngine *engine, int index) { Lookup *l = f->compilationUnit->runtimeLookups + index; return l->globalGetter(l, engine); @@ -87,20 +87,28 @@ ReturnedValue exp(const Value &base, const Value &exp) return Encode(pow(b,e)); } -ReturnedValue getLookup(ExecutionEngine *engine, Function *f, int index, const Value &base) +ReturnedValue getLookup(Function *f, ExecutionEngine *engine, const Value &base, int index) { Lookup *l = f->compilationUnit->runtimeLookups + index; return l->getter(l, engine, base); } -void setLookup(Function *f, int index, Value &base, const Value &value) +void setLookupSloppy(Function *f, int index, Value &base, const Value &value) { ExecutionEngine *engine = f->internalClass->engine; QV4::Lookup *l = f->compilationUnit->runtimeLookups + index; - if (!l->setter(l, engine, base, value) && f->isStrict()) + l->setter(l, engine, base, value); +} + +void setLookupStrict(Function *f, int index, Value &base, const Value &value) +{ + ExecutionEngine *engine = f->internalClass->engine; + QV4::Lookup *l = f->compilationUnit->runtimeLookups + index; + if (!l->setter(l, engine, base, value)) engine->throwTypeError(); } + void pushBlockContext(Value *stack, int index) { ExecutionContext *c = static_cast<ExecutionContext *>(stack + CallData::Context); |