aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2014-01-27 13:00:20 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-31 10:34:02 +0100
commit2d95e67ff4f00260d491255ed0b2af454235a047 (patch)
treea9cd16c9fd32b2f29140bda704f4fb157fbe6200 /src/qml
parentfc218a91ce03187f51058deba9d5cdde9c3e6d05 (diff)
V4 JIT: save/restore ebx (GOT ptr) on linux/x86.
On linux/x86, ebx is used to store the global offset table. When using this register for temporary values, we have to save it at the entry of a generated function, and restore it before doing calls and at the end. Task-number: QTBUG-36289 Change-Id: I30194be3ce44f58b793ee52f6201906bcb68d46a Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/compiler/qv4isel_masm.cpp2
-rw-r--r--src/qml/compiler/qv4isel_masm_p.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4isel_masm.cpp b/src/qml/compiler/qv4isel_masm.cpp
index 0cfb684e93..0fcd770584 100644
--- a/src/qml/compiler/qv4isel_masm.cpp
+++ b/src/qml/compiler/qv4isel_masm.cpp
@@ -122,7 +122,7 @@ static const Assembler::RegisterID calleeSavedRegisters[] = {
#if CPU(X86)
static const Assembler::RegisterID calleeSavedRegisters[] = {
- // Not used: JSC::X86Registers::ebx,
+ JSC::X86Registers::ebx, // temporary register
JSC::X86Registers::esi, // ContextRegister
JSC::X86Registers::edi // LocalsRegister
};
diff --git a/src/qml/compiler/qv4isel_masm_p.h b/src/qml/compiler/qv4isel_masm_p.h
index a146220015..7dfe6a820a 100644
--- a/src/qml/compiler/qv4isel_masm_p.h
+++ b/src/qml/compiler/qv4isel_masm_p.h
@@ -981,6 +981,10 @@ public:
prepareRelativeCall(function, this);
loadArgumentOnStackOrRegister<0>(arg1);
+#if OS(LINUX) && CPU(X86) && (defined(__PIC__) || defined(__PIE__))
+ load32(Address(StackFrameRegister, -sizeof(void*)), JSC::X86Registers::ebx); // restore the GOT ptr
+#endif
+
callAbsolute(functionName, function);
if (stackSpaceNeeded)