Eliminate qmldevtools_build

Move the relevant files into more fitting locations and build the
devtools from only parser, compiler and qmldirparser.

Change-Id: Ibf37a1187f36d02983f9f43c6622acb243785b7b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Ulf Hermann 2019-05-20 17:05:50 +02:00
parent 2f24150b03
commit 6c76ee30ce
30 changed files with 52 additions and 72 deletions

View File

@ -77,7 +77,6 @@ SOURCES += $$PWD/disassembler/ARM64Disassembler.cpp
SOURCES += $$PWD/disassembler/ARM64/A64DOpcode.cpp
HEADERS += $$PWD/disassembler/ARM64/A64DOpcode.h
!qmldevtools_build {
SOURCES += $$PWD/yarr/YarrCanonicalizeUCS2.cpp \
$$PWD/yarr/YarrCanonicalizeUnicode.cpp \
$$PWD/yarr/YarrInterpreter.cpp \
@ -94,7 +93,6 @@ HEADERS += $$PWD/yarr/Yarr.h \
$$PWD/yarr/YarrPattern.h \
$$PWD/yarr/YarrSyntaxChecker.h \
$$PWD/yarr/YarrUnicodeProperties.h
}
#
# Generate RegExpJitTables.h

View File

@ -60,6 +60,7 @@
#include <QAbstractAnimation>
#include <QtQml/qqml.h>
#include <private/qv4util_p.h>
#include <private/qv4global_p.h>
#include "qtquickparticlesglobal_p.h"
QT_BEGIN_NAMESPACE

View File

@ -2,6 +2,7 @@ INCLUDEPATH += $$PWD
INCLUDEPATH += $$OUT_PWD
HEADERS += \
$$PWD/qv4alloca_p.h \
$$PWD/qv4bytecodegenerator_p.h \
$$PWD/qv4compileddata_p.h \
$$PWD/qv4compiler_p.h \
@ -11,7 +12,11 @@ HEADERS += \
$$PWD/qv4codegen_p.h \
$$PWD/qqmlirbuilder_p.h \
$$PWD/qv4instr_moth_p.h \
$$PWD/qv4bytecodehandler_p.h
$$PWD/qv4bytecodehandler_p.h \
$$PWD/qv4calldata_p.h \
$$PWD/qv4util_p.h \
$$PWD/qv4staticvalue_p.h \
$$PWD/qv4stringtoarrayindex_p.h
SOURCES += \
$$PWD/qv4bytecodegenerator.cpp \
@ -24,30 +29,6 @@ SOURCES += \
$$PWD/qv4instr_moth.cpp \
$$PWD/qv4bytecodehandler.cpp
!qmldevtools_build {
HEADERS += \
$$PWD/qqmlirloader_p.h \
$$PWD/qqmlpropertyresolver_p.h \
$$PWD/qqmltypecompiler_p.h \
$$PWD/qqmlpropertycachecreator_p.h \
$$PWD/qqmlpropertyvalidator_p.h \
$$PWD/qv4compilationunitmapper_p.h \
$$PWD/qv4executablecompilationunit_p.h
SOURCES += \
$$PWD/qqmlirloader.cpp \
$$PWD/qqmlpropertyresolver.cpp \
$$PWD/qqmltypecompiler.cpp \
$$PWD/qqmlpropertycachecreator.cpp \
$$PWD/qqmlpropertyvalidator.cpp \
$$PWD/qv4compilationunitmapper.cpp \
$$PWD/qv4executablecompilationunit.cpp
unix: SOURCES += $$PWD/qv4compilationunitmapper_unix.cpp
else: SOURCES += $$PWD/qv4compilationunitmapper_win.cpp
}
gcc {
equals(QT_GCC_MAJOR_VERSION, 5): QMAKE_CXXFLAGS += -fno-strict-aliasing
}

View File

@ -44,9 +44,16 @@
#include <private/qv4alloca_p.h>
#include <private/qqmljslexer_p.h>
#include <private/qqmljsast_p.h>
#include <wtf/MathExtras.h>
#include <QCryptographicHash>
// Efficient implementation that takes advantage of powers of two.
static inline size_t roundUpToMultipleOf(size_t divisor, size_t x)
{
Q_ASSERT(divisor && !(divisor & (divisor - 1)));
const size_t remainderMask = divisor - 1;
return (x + remainderMask) & ~remainderMask;
}
QV4::Compiler::StringTableGenerator::StringTableGenerator()
{
clear();
@ -91,7 +98,7 @@ void QV4::Compiler::StringTableGenerator::serialize(CompiledData::Unit *unit)
{
char *dataStart = reinterpret_cast<char *>(unit);
quint32_le *stringTable = reinterpret_cast<quint32_le *>(dataStart + unit->offsetToStringTable);
char *stringData = reinterpret_cast<char *>(stringTable) + WTF::roundUpToMultipleOf(8, unit->stringTableSize * sizeof(uint));
char *stringData = reinterpret_cast<char *>(stringTable) + roundUpToMultipleOf(8, unit->stringTableSize * sizeof(uint));
for (int i = backingUnitTableSize ; i < strings.size(); ++i) {
const int index = i - backingUnitTableSize;
stringTable[index] = stringData - dataStart;
@ -393,7 +400,7 @@ void QV4::Compiler::JSUnitGenerator::writeFunction(char *f, QV4::Compiler::Conte
{
QV4::CompiledData::Function *function = (QV4::CompiledData::Function *)f;
quint32 currentOffset = static_cast<quint32>(WTF::roundUpToMultipleOf(8, sizeof(*function)));
quint32 currentOffset = static_cast<quint32>(roundUpToMultipleOf(8, sizeof(*function)));
function->nameIndex = getStringId(irFunction->name);
function->flags = 0;
@ -543,7 +550,7 @@ void QV4::Compiler::JSUnitGenerator::writeBlock(char *b, QV4::Compiler::Context
{
QV4::CompiledData::Block *block = reinterpret_cast<QV4::CompiledData::Block *>(b);
quint32 currentOffset = static_cast<quint32>(WTF::roundUpToMultipleOf(8, sizeof(*block)));
quint32 currentOffset = static_cast<quint32>(roundUpToMultipleOf(8, sizeof(*block)));
block->sizeOfLocalTemporalDeadZone = irBlock->sizeOfLocalTemporalDeadZone;
block->nLocals = irBlock->locals.size();
@ -606,7 +613,7 @@ QV4::CompiledData::Unit QV4::Compiler::JSUnitGenerator::generateHeader(QV4::Comp
unit.constantTableSize = constants.size();
// Ensure we load constants from well-aligned addresses into for example SSE registers.
nextOffset = static_cast<quint32>(WTF::roundUpToMultipleOf(16, nextOffset));
nextOffset = static_cast<quint32>(roundUpToMultipleOf(16, nextOffset));
unit.offsetToConstantTable = nextOffset;
nextOffset += unit.constantTableSize * sizeof(ReturnedValue);
@ -617,19 +624,19 @@ QV4::CompiledData::Unit QV4::Compiler::JSUnitGenerator::generateHeader(QV4::Comp
*jsClassDataOffset = nextOffset;
nextOffset += jsClassData.size();
nextOffset = static_cast<quint32>(WTF::roundUpToMultipleOf(8, nextOffset));
nextOffset = static_cast<quint32>(roundUpToMultipleOf(8, nextOffset));
unit.translationTableSize = translations.count();
unit.offsetToTranslationTable = nextOffset;
nextOffset += unit.translationTableSize * sizeof(CompiledData::TranslationData);
nextOffset = static_cast<quint32>(WTF::roundUpToMultipleOf(8, nextOffset));
nextOffset = static_cast<quint32>(roundUpToMultipleOf(8, nextOffset));
const auto reserveExportTable = [&nextOffset](int count, quint32_le *tableSizePtr, quint32_le *offsetPtr) {
*tableSizePtr = count;
*offsetPtr = nextOffset;
nextOffset += count * sizeof(CompiledData::ExportEntry);
nextOffset = static_cast<quint32>(WTF::roundUpToMultipleOf(8, nextOffset));
nextOffset = static_cast<quint32>(roundUpToMultipleOf(8, nextOffset));
};
reserveExportTable(module->localExportEntries.count(), &unit.localExportEntryTableSize, &unit.offsetToLocalExportEntryTable);
@ -639,12 +646,12 @@ QV4::CompiledData::Unit QV4::Compiler::JSUnitGenerator::generateHeader(QV4::Comp
unit.importEntryTableSize = module->importEntries.count();
unit.offsetToImportEntryTable = nextOffset;
nextOffset += unit.importEntryTableSize * sizeof(CompiledData::ImportEntry);
nextOffset = static_cast<quint32>(WTF::roundUpToMultipleOf(8, nextOffset));
nextOffset = static_cast<quint32>(roundUpToMultipleOf(8, nextOffset));
unit.moduleRequestTableSize = module->moduleRequests.count();
unit.offsetToModuleRequestTable = nextOffset;
nextOffset += unit.moduleRequestTableSize * sizeof(uint);
nextOffset = static_cast<quint32>(WTF::roundUpToMultipleOf(8, nextOffset));
nextOffset = static_cast<quint32>(roundUpToMultipleOf(8, nextOffset));
quint32 functionSize = 0;
for (int i = 0; i < module->functions.size(); ++i) {
@ -684,7 +691,7 @@ QV4::CompiledData::Unit QV4::Compiler::JSUnitGenerator::generateHeader(QV4::Comp
if (option == GenerateWithStringTable) {
unit.stringTableSize = stringTable.stringCount();
nextOffset = static_cast<quint32>(WTF::roundUpToMultipleOf(8, nextOffset));
nextOffset = static_cast<quint32>(roundUpToMultipleOf(8, nextOffset));
unit.offsetToStringTable = nextOffset;
nextOffset += stringTable.sizeOfTableAndData();
} else {

View File

@ -50,7 +50,6 @@
// We mean it.
//
#include "qv4global_p.h"
#include <QtCore/QBitArray>
#include <algorithm>
#include <vector>

View File

@ -1,7 +1,6 @@
INCLUDEPATH += $$PWD
INCLUDEPATH += $$OUT_PWD
!qmldevtools_build {
SOURCES += \
$$PWD/qv4engine.cpp \
$$PWD/qv4context.cpp \
@ -60,13 +59,15 @@ SOURCES += \
$$PWD/qv4module.cpp \
$$PWD/qv4promiseobject.cpp \
$$PWD/qv4runtime.cpp \
$$PWD/qv4value.cpp
$$PWD/qv4value.cpp \
$$PWD/qv4compilationunitmapper.cpp \
$$PWD/qv4executablecompilationunit.cpp \
$$PWD/qv4executableallocator.cpp
qtConfig(qml-debug): SOURCES += $$PWD/qv4profiling.cpp
HEADERS += \
$$PWD/qv4global_p.h \
$$PWD/qv4alloca_p.h \
$$PWD/qv4engine_p.h \
$$PWD/qv4enginebase_p.h \
$$PWD/qv4context_p.h \
@ -133,7 +134,11 @@ HEADERS += \
$$PWD/qv4module_p.h \
$$PWD/qv4promiseobject_p.h \
$$PWD/qv4runtime_p.h \
$$PWD/qv4value_p.h
$$PWD/qv4value_p.h \
$$PWD/qv4compilationunitmapper_p.h \
$$PWD/qv4executablecompilationunit_p.h \
$$PWD/qv4functiontable_p.h \
$$PWD/qv4runtimeapi_p.h
qtConfig(qml-sequence-object) {
HEADERS += \
@ -143,24 +148,10 @@ qtConfig(qml-sequence-object) {
$$PWD/qv4sequenceobject.cpp
}
}
unix: SOURCES += $$PWD/qv4compilationunitmapper_unix.cpp
else: SOURCES += $$PWD/qv4compilationunitmapper_win.cpp
HEADERS += \
$$PWD/qv4calldata_p.h \
$$PWD/qv4runtimeapi_p.h \
$$PWD/qv4stringtoarrayindex_p.h \
$$PWD/qv4util_p.h \
$$PWD/qv4functiontable_p.h \
$$PWD/qv4staticvalue_p.h
SOURCES += \
$$PWD/qv4executableallocator.cpp
qmldevtools_build {
SOURCES += \
$$PWD/qv4functiontable_noop.cpp
} else:win32 {
win32 {
!winrt:equals(QT_ARCH, x86_64) {
SOURCES += \
$$PWD/qv4functiontable_win64.cpp

View File

@ -54,7 +54,7 @@
#include "qv4managed_p.h"
#include <QtCore/private/qnumeric_p.h>
#include "qv4enginebase_p.h"
#include "qv4stringtoarrayindex_p.h"
#include <private/qv4stringtoarrayindex_p.h>
QT_BEGIN_NAMESPACE

View File

@ -1,15 +1,11 @@
INCLUDEPATH += $$PWD
INCLUDEPATH += $$OUT_PWD
!qmldevtools_build {
SOURCES += \
$$PWD/qv4mm.cpp \
HEADERS += \
$$PWD/qv4mm_p.h \
$$PWD/qv4mmdefs_p.h \
$$PWD/qv4writebarrier_p.h
}
HEADERS += \
$$PWD/qv4writebarrier_p.h \
$$PWD/qv4heap_p.h

View File

@ -52,7 +52,12 @@ SOURCES += \
$$PWD/qqmlfileselector.cpp \
$$PWD/qqmlobjectcreator.cpp \
$$PWD/qqmldelayedcallqueue.cpp \
$$PWD/qqmlloggingcategory.cpp
$$PWD/qqmlloggingcategory.cpp \
$$PWD/qqmlirloader.cpp \
$$PWD/qqmlpropertyresolver.cpp \
$$PWD/qqmltypecompiler.cpp \
$$PWD/qqmlpropertycachecreator.cpp \
$$PWD/qqmlpropertyvalidator.cpp
HEADERS += \
$$PWD/qqmlglobal_p.h \
@ -132,7 +137,12 @@ HEADERS += \
$$PWD/qqmlfileselector.h \
$$PWD/qqmlobjectcreator_p.h \
$$PWD/qqmldelayedcallqueue_p.h \
$$PWD/qqmlloggingcategory_p.h
$$PWD/qqmlloggingcategory_p.h \
$$PWD/qqmlirloader_p.h \
$$PWD/qqmlpropertyresolver_p.h \
$$PWD/qqmltypecompiler_p.h \
$$PWD/qqmlpropertycachecreator_p.h \
$$PWD/qqmlpropertyvalidator_p.h
qtConfig(qml-xml-http-request) {
HEADERS += \

View File

@ -1,7 +1,7 @@
option(host_build)
TARGET = QtQmlDevTools
QT = core-private
CONFIG += minimal_syncqt internal_module qmldevtools_build generated_privates
CONFIG += minimal_syncqt internal_module generated_privates
MODULE_INCNAME = QtQml
INCLUDEPATH += $$OUT_PWD/../qml
@ -12,11 +12,8 @@ intel_icc: WERROR += -ww2415
clang:if(greaterThan(QT_CLANG_MAJOR_VERSION, 3)|greaterThan(QT_CLANG_MINOR_VERSION, 3)): \
WERROR += -Wno-error=unused-const-variable
include(../3rdparty/masm/masm-defs.pri)
include(../qml/parser/parser.pri)
include(../qml/jsruntime/jsruntime.pri)
include(../qml/compiler/compiler.pri)
include(../qml/memory/memory.pri)
include(../qml/qmldirparser/qmldirparser.pri)
load(qt_module)