diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-09-12 19:49:23 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-09-12 19:49:23 +0200 |
commit | 9a1e4ffa661648f4d5715874bbf2470bd5ec489b (patch) | |
tree | e362ff28d18fc73a3b6d1420da382c27f06d0081 /src | |
parent | c950ce0daf4b9fbfbcf6c00aa8ef4875297046f9 (diff) | |
parent | b0c9c5b8d9a78b8f9b6bbb32cf17733d4b582810 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I6472cd72b27c69257efe54376e428274ebf68050
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/jit/qv4assemblercommon_p.h | 2 | ||||
-rw-r--r-- | src/qml/jit/qv4baselineassembler.cpp | 7 | ||||
-rw-r--r-- | src/qml/jit/qv4baselineassembler_p.h | 1 | ||||
-rw-r--r-- | src/qml/jit/qv4baselinejit.cpp | 16 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4vme_moth.cpp | 6 | ||||
-rw-r--r-- | src/qml/parser/qqmljsast.cpp | 73 | ||||
-rw-r--r-- | src/quick/items/qquicktextnodeengine.cpp | 4 |
7 files changed, 67 insertions, 42 deletions
diff --git a/src/qml/jit/qv4assemblercommon_p.h b/src/qml/jit/qv4assemblercommon_p.h index d3d7eedae2..67c7c9cd82 100644 --- a/src/qml/jit/qv4assemblercommon_p.h +++ b/src/qml/jit/qv4assemblercommon_p.h @@ -621,9 +621,9 @@ public: loadPtr(exceptionHandlerAddress(), ScratchRegister); Jump exitFunction = branchPtr(Equal, ScratchRegister, TrustedImmPtr(0)); + loadUndefined(); jump(ScratchRegister); exitFunction.link(this); - loadUndefined(); if (functionExit.isSet()) jump(functionExit); diff --git a/src/qml/jit/qv4baselineassembler.cpp b/src/qml/jit/qv4baselineassembler.cpp index 25c74e74e8..0751704a29 100644 --- a/src/qml/jit/qv4baselineassembler.cpp +++ b/src/qml/jit/qv4baselineassembler.cpp @@ -1479,6 +1479,12 @@ void BaselineAssembler::saveAccumulatorInFrame() offsetof(CallData, accumulator))); } +void BaselineAssembler::loadAccumulatorFromFrame() +{ + pasm()->loadAccumulator(PlatformAssembler::Address(PlatformAssembler::JSStackFrameRegister, + offsetof(CallData, accumulator))); +} + static ReturnedValue TheJitIs__Tail_Calling__ToTheRuntimeSoTheJitFrameIsMissing(CppStackFrame *frame, ExecutionEngine *engine) { return Runtime::method_tailCall(frame, engine); @@ -1606,7 +1612,6 @@ void BaselineAssembler::deadTemporalZoneCheck(int offsetForSavedIP, int variable { auto valueIsAliveJump = pasm()->jumpNotEmpty(); storeInstructionPointer(offsetForSavedIP); - saveAccumulatorInFrame(); prepareCallWithArgCount(2); passInt32AsArg(variableName, 1); passEngineAsArg(0); diff --git a/src/qml/jit/qv4baselineassembler_p.h b/src/qml/jit/qv4baselineassembler_p.h index c39d002bf9..97cb522244 100644 --- a/src/qml/jit/qv4baselineassembler_p.h +++ b/src/qml/jit/qv4baselineassembler_p.h @@ -153,6 +153,7 @@ public: void passPointerAsArg(void *ptr, int arg); void callRuntime(const char *functionName, const void *funcPtr, CallResultDestination dest); void saveAccumulatorInFrame(); + void loadAccumulatorFromFrame(); void jsTailCall(int func, int thisObject, int argc, int argv); // exception/context stuff diff --git a/src/qml/jit/qv4baselinejit.cpp b/src/qml/jit/qv4baselinejit.cpp index 77b7da18e7..d8d4e36f35 100644 --- a/src/qml/jit/qv4baselinejit.cpp +++ b/src/qml/jit/qv4baselinejit.cpp @@ -77,6 +77,7 @@ void BaselineJIT::generate() #define STORE_IP() as->storeInstructionPointer(nextInstructionOffset()) #define STORE_ACC() as->saveAccumulatorInFrame() +#define LOAD_ACC() as->loadAccumulatorFromFrame() #define BASELINEJIT_GENERATE_RUNTIME_CALL(function, destination) \ as->GENERATE_RUNTIME_CALL(function, destination) #define BASELINEJIT_GENERATE_TAIL_CALL(function) \ @@ -235,6 +236,7 @@ void BaselineJIT::generate_StoreNameSloppy(int name) as->passEngineAsArg(0); BASELINEJIT_GENERATE_RUNTIME_CALL(Runtime::method_storeNameSloppy, CallResultDestination::Ignore); as->checkException(); + LOAD_ACC(); } void BaselineJIT::generate_StoreNameStrict(int name) @@ -247,6 +249,7 @@ void BaselineJIT::generate_StoreNameStrict(int name) as->passEngineAsArg(0); BASELINEJIT_GENERATE_RUNTIME_CALL(Runtime::method_storeNameStrict, CallResultDestination::Ignore); as->checkException(); + LOAD_ACC(); } void BaselineJIT::generate_LoadElement(int base, int /*traceSlot*/) @@ -272,6 +275,7 @@ void BaselineJIT::generate_StoreElement(int base, int index, int /*traceSlot*/) as->passEngineAsArg(0); BASELINEJIT_GENERATE_RUNTIME_CALL(Runtime::method_storeElement, CallResultDestination::Ignore); as->checkException(); + LOAD_ACC(); } void BaselineJIT::generate_LoadProperty(int name, int /*traceSlot*/) @@ -310,6 +314,7 @@ void BaselineJIT::generate_StoreProperty(int name, int base) as->passEngineAsArg(0); BASELINEJIT_GENERATE_RUNTIME_CALL(Runtime::method_storeProperty, CallResultDestination::Ignore); as->checkException(); + LOAD_ACC(); } void BaselineJIT::generate_SetLookup(int index, int base) @@ -329,7 +334,6 @@ void BaselineJIT::generate_SetLookup(int index, int base) void BaselineJIT::generate_LoadSuperProperty(int property) { STORE_IP(); - STORE_ACC(); as->prepareCallWithArgCount(2); as->passJSSlotAsArg(property, 1); as->passEngineAsArg(0); @@ -347,6 +351,7 @@ void BaselineJIT::generate_StoreSuperProperty(int property) as->passEngineAsArg(0); BASELINEJIT_GENERATE_RUNTIME_CALL(Runtime::method_storeSuperProperty, CallResultDestination::Ignore); as->checkException(); + LOAD_ACC(); } void BaselineJIT::generate_Yield() @@ -592,6 +597,7 @@ void BaselineJIT::generate_PushBlockContext(int index) as->passInt32AsArg(index, 1); as->passJSSlotAsArg(0, 0); BASELINEJIT_GENERATE_RUNTIME_CALL(Helpers::pushBlockContext, CallResultDestination::Ignore); + as->loadAccumulatorFromFrame(); } void BaselineJIT::generate_CloneBlockContext() @@ -600,6 +606,7 @@ void BaselineJIT::generate_CloneBlockContext() as->prepareCallWithArgCount(1); as->passJSSlotAsArg(CallData::Context, 0); BASELINEJIT_GENERATE_RUNTIME_CALL(Helpers::cloneBlockContext, CallResultDestination::Ignore); + as->loadAccumulatorFromFrame(); } void BaselineJIT::generate_PushScriptContext(int index) @@ -610,6 +617,7 @@ void BaselineJIT::generate_PushScriptContext(int index) as->passEngineAsArg(1); as->passJSSlotAsArg(0, 0); BASELINEJIT_GENERATE_RUNTIME_CALL(Helpers::pushScriptContext, CallResultDestination::Ignore); + as->loadAccumulatorFromFrame(); } void BaselineJIT::generate_PopScriptContext() @@ -619,6 +627,7 @@ void BaselineJIT::generate_PopScriptContext() as->passEngineAsArg(1); as->passJSSlotAsArg(0, 0); BASELINEJIT_GENERATE_RUNTIME_CALL(Helpers::popScriptContext, CallResultDestination::Ignore); + as->loadAccumulatorFromFrame(); } void BaselineJIT::generate_PopContext() { as->popContext(); } @@ -719,11 +728,13 @@ void BaselineJIT::generate_TypeofValue() void BaselineJIT::generate_DeclareVar(int varName, int isDeletable) { + STORE_ACC(); as->prepareCallWithArgCount(3); as->passInt32AsArg(varName, 2); as->passInt32AsArg(isDeletable, 1); as->passEngineAsArg(0); BASELINEJIT_GENERATE_RUNTIME_CALL(Runtime::method_declareVar, CallResultDestination::Ignore); + LOAD_ACC(); } void BaselineJIT::generate_DefineArray(int argc, int args) @@ -781,11 +792,13 @@ void BaselineJIT::generate_CreateRestParameter(int argIndex) void BaselineJIT::generate_ConvertThisToObject() { + STORE_ACC(); as->prepareCallWithArgCount(2); as->passJSSlotAsArg(CallData::This, 1); as->passEngineAsArg(0); BASELINEJIT_GENERATE_RUNTIME_CALL(Helpers::convertThisToObject, CallResultDestination::Ignore); as->checkException(); + LOAD_ACC(); } void BaselineJIT::generate_LoadSuperConstructor() @@ -931,6 +944,7 @@ void BaselineJIT::generate_ThrowOnNullOrUndefined() as->passEngineAsArg(0); BASELINEJIT_GENERATE_RUNTIME_CALL(Helpers::throwOnNullOrUndefined, CallResultDestination::Ignore); as->checkException(); + LOAD_ACC(); } void BaselineJIT::generate_GetTemplateObject(int index) diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index d2c91da12c..4ce8d97ee5 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -727,7 +727,6 @@ QV4::ReturnedValue VME::interpret(CppStackFrame *frame, ExecutionEngine *engine, MOTH_BEGIN_INSTR(LoadSuperProperty) STORE_IP(); - STORE_ACC(); acc = Runtime::method_loadSuperProperty(engine, STACK_VALUE(property)); CHECK_EXCEPTION; MOTH_END_INSTR(LoadSuperProperty) @@ -884,12 +883,14 @@ QV4::ReturnedValue VME::interpret(CppStackFrame *frame, ExecutionEngine *engine, MOTH_BEGIN_INSTR(Construct) STORE_IP(); + STORE_ACC(); acc = Runtime::method_construct(engine, STACK_VALUE(func), ACC, stack + argv, argc); CHECK_EXCEPTION; MOTH_END_INSTR(Construct) MOTH_BEGIN_INSTR(ConstructWithSpread) STORE_IP(); + STORE_ACC(); acc = Runtime::method_constructWithSpread(engine, STACK_VALUE(func), ACC, stack + argv, argc); CHECK_EXCEPTION; MOTH_END_INSTR(ConstructWithSpread) @@ -917,7 +918,6 @@ QV4::ReturnedValue VME::interpret(CppStackFrame *frame, ExecutionEngine *engine, MOTH_BEGIN_INSTR(DeadTemporalZoneCheck) if (ACC.isEmpty()) { STORE_IP(); - STORE_ACC(); Runtime::method_throwReferenceError(engine, name); goto handleUnwind; } @@ -1086,6 +1086,7 @@ QV4::ReturnedValue VME::interpret(CppStackFrame *frame, ExecutionEngine *engine, if (t->isNullOrUndefined()) { *t = engine->globalObject->asReturnedValue(); } else { + STORE_ACC(); *t = t->toObject(engine)->asReturnedValue(); CHECK_EXCEPTION; } @@ -1098,6 +1099,7 @@ QV4::ReturnedValue VME::interpret(CppStackFrame *frame, ExecutionEngine *engine, MOTH_END_INSTR(LoadSuperConstructor) MOTH_BEGIN_INSTR(ToObject) + STORE_ACC(); acc = ACC.toObject(engine)->asReturnedValue(); CHECK_EXCEPTION; MOTH_END_INSTR(ToObject) diff --git a/src/qml/parser/qqmljsast.cpp b/src/qml/parser/qqmljsast.cpp index e5817ab763..2b1a999b38 100644 --- a/src/qml/parser/qqmljsast.cpp +++ b/src/qml/parser/qqmljsast.cpp @@ -238,12 +238,11 @@ void StringLiteral::accept0(Visitor *visitor) void TemplateLiteral::accept0(Visitor *visitor) { - if (visitor->visit(this)) { - if (next) - accept(next, visitor); + bool accepted = true; + for (TemplateLiteral *it = this; it && accepted; it = it->next) { + accepted = visitor->visit(it); + visitor->endVisit(it); } - - visitor->endVisit(this); } void NumericLiteral::accept0(Visitor *visitor) @@ -1013,13 +1012,13 @@ QStringList FormalParameterList::boundNames() const void FormalParameterList::accept0(Visitor *visitor) { - if (visitor->visit(this)) { - accept(element, visitor); - if (next) - accept(next, visitor); + bool accepted = true; + for (FormalParameterList *it = this; it && accepted; it = it->next) { + accepted = visitor->visit(it); + if (accepted) + accept(it->element, visitor); + visitor->endVisit(it); } - - visitor->endVisit(this); } FormalParameterList *FormalParameterList::finish(QQmlJS::MemoryPool *pool) @@ -1290,12 +1289,14 @@ void UiPragma::accept0(Visitor *visitor) void UiHeaderItemList::accept0(Visitor *visitor) { - if (visitor->visit(this)) { - accept(headerItem, visitor); - accept(next, visitor); - } + bool accepted = true; + for (UiHeaderItemList *it = this; it && accepted; it = it->next) { + accepted = visitor->visit(it); + if (accepted) + accept(it->headerItem, visitor); - visitor->endVisit(this); + visitor->endVisit(it); + } } @@ -1359,14 +1360,15 @@ void PatternElement::boundNames(QStringList *names) void PatternElementList::accept0(Visitor *visitor) { - if (visitor->visit(this)) { - accept(elision, visitor); - accept(element, visitor); - if (next) - accept(next, visitor); + bool accepted = true; + for (PatternElementList *it = this; it && accepted; it = it->next) { + accepted = visitor->visit(it); + if (accepted) { + accept(it->elision, visitor); + accept(it->element, visitor); + } + visitor->endVisit(it); } - - visitor->endVisit(this); } void PatternElementList::boundNames(QStringList *names) @@ -1395,13 +1397,13 @@ void PatternProperty::boundNames(QStringList *names) void PatternPropertyList::accept0(Visitor *visitor) { - if (visitor->visit(this)) { - accept(property, visitor); - if (next) - accept(next, visitor); + bool accepted = true; + for (PatternPropertyList *it = this; it && accepted; it = it->next) { + accepted = visitor->visit(it); + if (accepted) + accept(it->property, visitor); + visitor->endVisit(it); } - - visitor->endVisit(this); } void PatternPropertyList::boundNames(QStringList *names) @@ -1446,13 +1448,14 @@ void ClassDeclaration::accept0(Visitor *visitor) void ClassElementList::accept0(Visitor *visitor) { - if (visitor->visit(this)) { - accept(property, visitor); - if (next) - accept(next, visitor); - } + bool accepted = true; + for (ClassElementList *it = this; it && accepted; it = it->next) { + accepted = visitor->visit(it); + if (accepted) + accept(it->property, visitor); - visitor->endVisit(this); + visitor->endVisit(it); + } } ClassElementList *ClassElementList::finish() diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp index 3b2c5ef19e..1119a3d5b4 100644 --- a/src/quick/items/qquicktextnodeengine.cpp +++ b/src/quick/items/qquicktextnodeengine.cpp @@ -781,8 +781,8 @@ void QQuickTextNodeEngine::addToSceneGraph(QQuickTextNode *parentNode, for (int i = 0; i < m_backgrounds.size(); ++i) { const QRectF &rect = m_backgrounds.at(i).first; const QColor &color = m_backgrounds.at(i).second; - - parentNode->addRectangleNode(rect, color); + if (color.alpha() != 0) + parentNode->addRectangleNode(rect, color); } // Add all text with unselected color first |