aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty/masm/assembler/AbstractMacroAssembler.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2017-01-13 16:45:54 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2017-02-01 08:17:10 +0000
commit6aaf6abb692dbdc0f0400ab5c76c438034957d55 (patch)
treec5b1d58ab2932bebc078bf979b682c2a43051a69 /src/3rdparty/masm/assembler/AbstractMacroAssembler.h
parenta159d6d43da100c5a4acb183589fa4554b33a474 (diff)
Include the ARMv7 assembler in the qmldevtools bootstrap build
Even when the C++ target is not ARMv7 we want to include it in order to be able to generate QML cache files with code ahead of time. This requires a few changes: * The Jump classes need to move from the AbstractMacroAssembler super-class into the concrete assembler sub-class, in order to use it in specializations. * Some of the template specializations in LinkBuffer for example or for platform dependent operations need to be pre-processor enabled when bootstrapping * The generic loadPtr/addPtr etc. functions need to move to the concrete assemblers to be able to call the correct 32-bit or 64-bit variations. * We need to force what looks like a loss of precision to the compiler in the 32-bit ARMv7 linking code when linking jumps. Finally then we can explicitly instantiate at least QV4::JIT::Assembler for ARMv7 when bootstrapping. Currently only on x86-64 hosts, but that is a temporary limitation. Change-Id: I501db2360e1fded48f17f17d9e87252d47f8537e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/3rdparty/masm/assembler/AbstractMacroAssembler.h')
-rw-r--r--src/3rdparty/masm/assembler/AbstractMacroAssembler.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/3rdparty/masm/assembler/AbstractMacroAssembler.h b/src/3rdparty/masm/assembler/AbstractMacroAssembler.h
index a9035efed7..4f27e85c98 100644
--- a/src/3rdparty/masm/assembler/AbstractMacroAssembler.h
+++ b/src/3rdparty/masm/assembler/AbstractMacroAssembler.h
@@ -66,7 +66,9 @@ public:
typedef MacroAssemblerCodePtr CodePtr;
typedef MacroAssemblerCodeRef CodeRef;
+#if !CPU(ARM_THUMB2) && !defined(V4_BOOTSTRAP)
class Jump;
+#endif
typedef typename AssemblerType::RegisterID RegisterID;
typedef typename AssemblerType::FPRegisterID FPRegisterID;
@@ -342,6 +344,8 @@ public:
}
bool isSet() const { return m_label.isSet(); }
+
+ const AssemblerLabel &label() const { return m_label; }
private:
AssemblerLabel m_label;
};
@@ -451,6 +455,11 @@ public:
AssemblerLabel m_label;
};
+#if CPU(ARM_THUMB2) || defined(V4_BOOTSTRAP)
+ using Jump = typename AssemblerType::template Jump<Label>;
+ friend Jump;
+#endif
+
// Call:
//
// A Call object is a reference to a call instruction that has been planted
@@ -501,6 +510,7 @@ public:
// into the code buffer - it is typically used to link the jump, setting the
// relative offset such that when executed it will jump to the desired
// destination.
+#if !CPU(ARM_THUMB2) && !defined(V4_BOOTSTRAP)
class Jump {
template<class TemplateAssemblerType>
friend class AbstractMacroAssembler;
@@ -512,7 +522,7 @@ public:
{
}
-#if CPU(ARM_THUMB2)
+#if CPU(ARM_THUMB2) || defined(V4_BOOTSTRAP)
// Fixme: this information should be stored in the instruction stream, not in the Jump object.
Jump(AssemblerLabel jmp, ARMv7Assembler::JumpType type = ARMv7Assembler::JumpNoCondition, ARMv7Assembler::Condition condition = ARMv7Assembler::ConditionInvalid)
: m_label(jmp)
@@ -613,10 +623,11 @@ public:
private:
AssemblerLabel m_label;
-#if CPU(ARM_THUMB2)
+#if CPU(ARM_THUMB2) || defined(V4_BOOTSTRAP)
ARMv7Assembler::JumpType m_type;
ARMv7Assembler::Condition m_condition;
-#elif CPU(ARM64)
+#endif
+#if CPU(ARM64)
ARM64Assembler::JumpType m_type;
ARM64Assembler::Condition m_condition;
bool m_is64Bit;
@@ -627,6 +638,7 @@ public:
SH4Assembler::JumpType m_type;
#endif
};
+#endif
struct PatchableJump {
PatchableJump()
@@ -871,10 +883,12 @@ protected:
AssemblerType::repatchPointer(dataLabelPtr.dataLocation(), value);
}
+#if !defined(V4_BOOTSTRAP)
static void* readPointer(CodeLocationDataLabelPtr dataLabelPtr)
{
return AssemblerType::readPointer(dataLabelPtr.dataLocation());
}
+#endif
static void replaceWithLoad(CodeLocationConvertibleLoad label)
{