diff options
| author | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-06-22 09:37:35 +0200 |
|---|---|---|
| committer | Lars Knoll <lars.knoll@qt.io> | 2017-06-22 08:04:56 +0000 |
| commit | 1d7f082f3393f726b16e24bf85e2eb2f81b29771 (patch) | |
| tree | 6575a2858d3c8e3100d40423c61ad02e31d0e07a /src/qml/compiler/qv4codegen.cpp | |
| parent | 484cf3d76215edb4c51b03985f788ae1a6ad3243 (diff) | |
Do not unnecessary load constants into temporaries
Specifically when creating an object from an object literal.
Change-Id: I2f29be5d977ac2e5a0a634229ae899356e568ebd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
| -rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 28a6e0f3d2..07105ea9d9 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -2093,7 +2093,8 @@ bool Codegen::visit(ObjectLiteral *ast) } v.rvalue = value; - v.rvalue.asRValue(); + if (v.rvalue.type != Reference::Const) + v.rvalue.asRValue(); } else if (PropertyGetterSetter *gs = AST::cast<AST::PropertyGetterSetter *>(it->assignment)) { const int function = defineFunction(name, gs, gs->formals, gs->functionBody ? gs->functionBody->elements : 0); ObjectPropertyValue &v = valueMap[name]; |
