aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4script_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2016-07-13 11:27:28 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2016-08-02 10:37:28 +0000
commitbc84dd0b85c5067a75c7a7b6c30527c08a4844bb (patch)
tree28aa1cb68654544ea3b58bf137602185885eda94 /src/qml/jsruntime/qv4script_p.h
parent54ee6994e66936c1d532f7718c858c9b18e3c91d (diff)
Make generated code loading constants relocatable
On 32-bit architectures we were encoding the absolute address of generated constants in memory into the load instruction. In order to make the code reloctable, this patch changes the JIT over to use the constant table in the compilation unit. This means two additional loads per constant. On architectures that support instruction pointer relative addressing, we can try to fix this in the future (arm32 for example). Change-Id: I8ed7aa7c67711696d6c46c72b3b642d610ff2cbc Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4script_p.h')
-rw-r--r--src/qml/jsruntime/qv4script_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4script_p.h b/src/qml/jsruntime/qv4script_p.h
index e81bc3049c..2e87a7692b 100644
--- a/src/qml/jsruntime/qv4script_p.h
+++ b/src/qml/jsruntime/qv4script_p.h
@@ -71,6 +71,7 @@ struct ContextStateSaver {
Value *savedContext;
bool strictMode;
Lookup *lookups;
+ const QV4::Value *constantTable;
CompiledData::CompilationUnit *compilationUnit;
int lineNumber;
@@ -78,6 +79,7 @@ struct ContextStateSaver {
: savedContext(scope.alloc(1))
, strictMode(context->d()->strictMode)
, lookups(context->d()->lookups)
+ , constantTable(context->d()->constantTable)
, compilationUnit(context->d()->compilationUnit)
, lineNumber(context->d()->lineNumber)
{
@@ -87,6 +89,7 @@ struct ContextStateSaver {
: savedContext(scope.alloc(1))
, strictMode(context->strictMode)
, lookups(context->lookups)
+ , constantTable(context->constantTable)
, compilationUnit(context->compilationUnit)
, lineNumber(context->lineNumber)
{
@@ -98,6 +101,7 @@ struct ContextStateSaver {
Heap::ExecutionContext *ctx = static_cast<Heap::ExecutionContext *>(savedContext->m());
ctx->strictMode = strictMode;
ctx->lookups = lookups;
+ ctx->constantTable = constantTable;
ctx->compilationUnit = compilationUnit;
ctx->lineNumber = lineNumber;
}