From 557ea845157d4f6b757ec2eebbc71e1af9910cc6 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 7 Nov 2017 16:41:55 +0100 Subject: V4: Get rid of Reference::This and treat it as a stack slot This actually generates better code, for example for 'this.x'. Previously: LoadReg (this) GetLookupA acc(0) Now: GetLookup (this)(0) Change-Id: I7e4125d3dff707e9af9691f8b00c5c398087e395 Reviewed-by: Lars Knoll --- src/qml/compiler/qv4codegen.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/qml/compiler/qv4codegen.cpp') diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 3cee80e977..04d16d412e 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -3073,8 +3073,6 @@ Codegen::Reference &Codegen::Reference::operator =(const Reference &other) qmlNotifyIndex = other.qmlNotifyIndex; captureRequired = other.captureRequired; break; - case This: - break; } // keep loaded reference @@ -3111,8 +3109,6 @@ bool Codegen::Reference::operator==(const Codegen::Reference &other) const case QmlContextObject: return qmlCoreIndex == other.qmlCoreIndex && qmlNotifyIndex == other.qmlNotifyIndex && captureRequired == other.captureRequired; - case This: - return true; } return true; } @@ -3218,7 +3214,6 @@ bool Codegen::Reference::storeWipesAccumulator() const switch (type) { default: case Invalid: - case This: case Const: case Accumulator: Q_UNREACHABLE(); @@ -3303,7 +3298,6 @@ void Codegen::Reference::storeAccumulator() const case Invalid: case Accumulator: case Const: - case This: break; } @@ -3457,11 +3451,6 @@ QT_WARNING_POP if (!captureRequired) codegen->_context->contextObjectPropertyDependencies.insert(qmlCoreIndex, qmlNotifyIndex); } return; - case This: { - Instruction::LoadReg load; - load.reg = Moth::StackSlot::createRegister(CallData::This); - codegen->bytecodeGenerator->addInstruction(load); - } return; case Invalid: break; } -- cgit v1.2.3