diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-06 22:07:52 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-08-08 18:59:47 +0000 |
commit | 01c338023a3a604bb24c2efb18d48f9bac33e6bc (patch) | |
tree | dd5fbedf26dd680323a64bdc5bfe82263199d413 /src/qml/compiler/qv4codegen.cpp | |
parent | a0720e562c464a5b22e4cbd74b48212e5d3bf6e4 (diff) | |
download | qtdeclarative-01c338023a3a604bb24c2efb18d48f9bac33e6bc.tar.gz |
Inline more of the runtime code into the interpreter
Change-Id: I4744c9b39d4de599f02dd91622dd19713c8cc7eb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index d00e29bc09..f75839ad4b 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -73,12 +73,6 @@ static inline QV4::Runtime::RuntimeMethods aluOpFunction(QSOperator::Op op) switch (op) { case QSOperator::Invalid: return QV4::Runtime::InvalidRuntimeMethod; - case QSOperator::BitAnd: - return QV4::Runtime::bitAnd; - case QSOperator::BitOr: - return QV4::Runtime::bitOr; - case QSOperator::BitXor: - return QV4::Runtime::bitXor; case QSOperator::Add: return QV4::Runtime::InvalidRuntimeMethod; case QSOperator::Sub: @@ -111,6 +105,11 @@ static inline QV4::Runtime::RuntimeMethods aluOpFunction(QSOperator::Op op) return QV4::Runtime::strictEqual; case QSOperator::StrictNotEqual: return QV4::Runtime::strictNotEqual; + case QSOperator::BitAnd: + case QSOperator::BitOr: + case QSOperator::BitXor: + Q_UNREACHABLE(); + // fall through default: Q_ASSERT(!"Unknown AluOp"); return QV4::Runtime::InvalidRuntimeMethod; @@ -175,13 +174,13 @@ Codegen::Reference Codegen::unop(UnaryOperation op, const Reference &expr) if (v.isNumber()) { switch (op) { case Not: - return Reference::fromConst(this, Runtime::method_uNot(v)); + return Reference::fromConst(this, Encode(!v.toBoolean())); case UMinus: return Reference::fromConst(this, Runtime::method_uMinus(v)); case UPlus: return expr; case Compl: - return Reference::fromConst(this, Runtime::method_complement(v)); + return Reference::fromConst(this, Encode((int)~v.toInt32())); default: break; } |