/*
- * Copyright (C) 2008, 2013 Apple Inc.
+ * Copyright (C) 2008, 2013, 2014 Apple Inc.
* Copyright (C) 2009, 2010 University of Szeged
* All rights reserved.
*
namespace JSC {
-class MacroAssemblerARM : public AbstractMacroAssembler<ARMAssembler> {
+class MacroAssemblerARM : public AbstractMacroAssembler<ARMAssembler, MacroAssemblerARM> {
static const int DoubleConditionMask = 0x0f;
static const int DoubleConditionBitSpecial = 0x10;
COMPILE_ASSERT(!(DoubleConditionBitSpecial & DoubleConditionMask), DoubleConditionBitSpecial_should_not_interfere_with_ARMAssembler_Condition_codes);
m_assembler.dataTransfer32(ARMAssembler::LoadUint8, dest, ARMRegisters::S0, 0);
}
- void load8Signed(BaseIndex address, RegisterID dest)
+ void load8SignedExtendTo32(BaseIndex address, RegisterID dest)
{
m_assembler.baseIndexTransfer16(ARMAssembler::LoadInt8, dest, address.base, address.index, static_cast<int>(address.scale), address.offset);
}
m_assembler.baseIndexTransfer16(ARMAssembler::LoadUint16, dest, address.base, address.index, static_cast<int>(address.scale), address.offset);
}
- void load16Signed(BaseIndex address, RegisterID dest)
+ void load16SignedExtendTo32(BaseIndex address, RegisterID dest)
{
m_assembler.baseIndexTransfer16(ARMAssembler::LoadInt16, dest, address.base, address.index, static_cast<int>(address.scale), address.offset);
}
void test32(ResultCondition cond, RegisterID reg, TrustedImm32 mask, RegisterID dest)
{
if (mask.m_value == -1)
- m_assembler.cmp(0, reg);
+ m_assembler.tst(reg, reg);
else
m_assembler.tst(reg, m_assembler.getImm(mask.m_value, ARMRegisters::S0));
m_assembler.mov(dest, ARMAssembler::getOp2Byte(0));
UNREACHABLE_FOR_PLATFORM();
}
-#if USE(MASM_PROBE)
- struct CPUState {
- #define DECLARE_REGISTER(_type, _regName) \
- _type _regName;
- FOR_EACH_CPU_REGISTER(DECLARE_REGISTER)
- #undef DECLARE_REGISTER
- };
-
- struct ProbeContext;
- typedef void (*ProbeFunction)(struct ProbeContext*);
-
- struct ProbeContext {
- ProbeFunction probeFunction;
- void* arg1;
- void* arg2;
- CPUState cpu;
-
- void dump(const char* indentation = 0);
- private:
- void dumpCPURegisters(const char* indentation);
- };
-
- // For details about probe(), see comment in MacroAssemblerX86_64.h.
+#if ENABLE(MASM_PROBE)
+ // Methods required by the MASM_PROBE mechanism as defined in
+ // AbstractMacroAssembler.h.
+ static void printCPURegisters(CPUState&, int indentation = 0);
+ static void printRegister(CPUState&, RegisterID);
+ static void printRegister(CPUState&, FPRegisterID);
void probe(ProbeFunction, void* arg1 = 0, void* arg2 = 0);
-#endif // USE(MASM_PROBE)
+#endif // ENABLE(MASM_PROBE)
protected:
ARMAssembler::Condition ARMCondition(RelationalCondition cond)
ARMAssembler::relinkCall(call.dataLocation(), destination.executableAddress());
}
-#if USE(MASM_PROBE)
+#if ENABLE(MASM_PROBE)
inline TrustedImm32 trustedImm32FromPtr(void* ptr)
{
return TrustedImm32(TrustedImmPtr(ptr));