aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/compiler/qv4compileddata.cpp4
-rw-r--r--src/qml/compiler/qv4compileddata_p.h2
-rw-r--r--src/qml/compiler/qv4isel_masm.cpp14
-rw-r--r--src/qml/compiler/qv4isel_masm_p.h2
-rw-r--r--src/qml/compiler/qv4isel_moth.cpp14
-rw-r--r--src/qml/compiler/qv4isel_moth_p.h2
6 files changed, 7 insertions, 31 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index 1ecb7f9b93..a434f6c0dc 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -131,13 +131,13 @@ QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine)
}
}
- QV4::Function *entry = linkBackendToEngine(engine);
+ linkBackendToEngine(engine);
runtimeFunctionsSortedByAddress.resize(runtimeFunctions.size());
memcpy(runtimeFunctionsSortedByAddress.data(), runtimeFunctions.data(), runtimeFunctions.size() * sizeof(QV4::Function*));
qSort(runtimeFunctionsSortedByAddress.begin(), runtimeFunctionsSortedByAddress.end(), functionSortHelper);
- return entry;
+ return runtimeFunctions[data->indexOfRootFunction];
}
void CompilationUnit::markObjects()
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index fa139d36e6..854df1185b 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -342,7 +342,7 @@ struct CompilationUnit
void markObjects();
protected:
- virtual QV4::Function *linkBackendToEngine(QV4::ExecutionEngine *engine) = 0;
+ virtual void linkBackendToEngine(QV4::ExecutionEngine *engine) = 0;
};
}
diff --git a/src/qml/compiler/qv4isel_masm.cpp b/src/qml/compiler/qv4isel_masm.cpp
index a64c9ced14..7f97de43d6 100644
--- a/src/qml/compiler/qv4isel_masm.cpp
+++ b/src/qml/compiler/qv4isel_masm.cpp
@@ -69,14 +69,9 @@ CompilationUnit::~CompilationUnit()
UnwindHelper::deregisterFunctions(runtimeFunctions);
}
-QV4::Function *CompilationUnit::linkBackendToEngine(ExecutionEngine *engine)
+void CompilationUnit::linkBackendToEngine(ExecutionEngine *engine)
{
- QV4::Function *rootRuntimeFunction = 0;
-
- const CompiledData::Function *compiledRootFunction = data->functionAt(data->indexOfRootFunction);
-
runtimeFunctions.resize(data->functionTableSize);
-
for (int i = 0 ;i < runtimeFunctions.size(); ++i) {
const CompiledData::Function *compiledFunction = data->functionAt(i);
@@ -84,16 +79,9 @@ QV4::Function *CompilationUnit::linkBackendToEngine(ExecutionEngine *engine)
(Value (*)(QV4::ExecutionContext *, const uchar *)) codeRefs[i].code().executableAddress(),
codeRefs[i].size());
runtimeFunctions[i] = runtimeFunction;
-
- if (compiledFunction == compiledRootFunction) {
- assert(!rootRuntimeFunction);
- rootRuntimeFunction = runtimeFunction;
- }
}
UnwindHelper::registerFunctions(runtimeFunctions);
-
- return rootRuntimeFunction;
}
QV4::ExecutableAllocator::ChunkOfPages *CompilationUnit::chunkForFunction(int functionIndex)
diff --git a/src/qml/compiler/qv4isel_masm_p.h b/src/qml/compiler/qv4isel_masm_p.h
index fa14d8b4d9..f54b95b087 100644
--- a/src/qml/compiler/qv4isel_masm_p.h
+++ b/src/qml/compiler/qv4isel_masm_p.h
@@ -65,7 +65,7 @@ struct CompilationUnit : public QV4::CompiledData::CompilationUnit
{
virtual ~CompilationUnit();
- virtual QV4::Function *linkBackendToEngine(QV4::ExecutionEngine *engine);
+ virtual void linkBackendToEngine(QV4::ExecutionEngine *engine);
virtual QV4::ExecutableAllocator::ChunkOfPages *chunkForFunction(int functionIndex);
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp
index 4c298d8d72..3140030392 100644
--- a/src/qml/compiler/qv4isel_moth.cpp
+++ b/src/qml/compiler/qv4isel_moth.cpp
@@ -1081,14 +1081,9 @@ Instr::Param InstructionSelection::getParam(V4IR::Expr *e) {
}
-QV4::Function *CompilationUnit::linkBackendToEngine(QV4::ExecutionEngine *engine)
+void CompilationUnit::linkBackendToEngine(QV4::ExecutionEngine *engine)
{
- QV4::Function *rootRuntimeFunction = 0;
-
- const QV4::CompiledData::Function *compiledRootFunction = data->functionAt(data->indexOfRootFunction);
-
runtimeFunctions.resize(data->functionTableSize);
-
for (int i = 0 ;i < runtimeFunctions.size(); ++i) {
const QV4::CompiledData::Function *compiledFunction = data->functionAt(i);
@@ -1099,12 +1094,5 @@ QV4::Function *CompilationUnit::linkBackendToEngine(QV4::ExecutionEngine *engine
if (QV4::Debugging::Debugger *debugger = engine->debugger)
debugger->setPendingBreakpoints(runtimeFunction);
-
- if (compiledFunction == compiledRootFunction) {
- assert(!rootRuntimeFunction);
- rootRuntimeFunction = runtimeFunction;
- }
}
-
- return rootRuntimeFunction;
}
diff --git a/src/qml/compiler/qv4isel_moth_p.h b/src/qml/compiler/qv4isel_moth_p.h
index 484d7032de..7b701cf82d 100644
--- a/src/qml/compiler/qv4isel_moth_p.h
+++ b/src/qml/compiler/qv4isel_moth_p.h
@@ -58,7 +58,7 @@ class StackSlotAllocator;
struct CompilationUnit : public QV4::CompiledData::CompilationUnit
{
- virtual QV4::Function *linkBackendToEngine(QV4::ExecutionEngine *engine);
+ virtual void linkBackendToEngine(QV4::ExecutionEngine *engine);
QVector<QByteArray> codeRefs;