Skip to content

Commit

Permalink
Merge pull request #2524 from lioncash/aarch64
Browse files Browse the repository at this point in the history
Arm64: Make some functions const.
  • Loading branch information
Tilka committed Jun 5, 2015
2 parents 97382ec + fe77505 commit 2f2e514
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Source/Core/Common/Arm64Emitter.h
Expand Up @@ -276,7 +276,7 @@ class ArithOption
{
return m_type;
}
ARM64Reg GetReg()
ARM64Reg GetReg() const
{
return m_destReg;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Common/CodeBlock.h
Expand Up @@ -51,7 +51,7 @@ template<class T> class CodeBlock : public T, NonCopyable
region_size = 0;
}

bool IsInSpace(u8 *ptr)
bool IsInSpace(u8 *ptr) const
{
return (ptr >= region) && (ptr < (region + region_size));
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/PowerPC/JitArm64/Jit.h
Expand Up @@ -35,7 +35,7 @@ class JitArm64 : public JitBase, public Arm64Gen::ARM64CodeBlock

JitBaseBlockCache *GetBlockCache() { return &blocks; }

bool IsInCodeSpace(u8 *ptr) { return IsInSpace(ptr); }
bool IsInCodeSpace(u8 *ptr) const { return IsInSpace(ptr); }

bool HandleFault(uintptr_t access_address, SContext* ctx) override;

Expand Down
18 changes: 9 additions & 9 deletions Source/Core/Core/PowerPC/JitArm64/JitArm64_RegCache.h
Expand Up @@ -46,16 +46,16 @@ class OpArg
{
}

RegType GetType()
RegType GetType() const
{
return m_type;
}

ARM64Reg GetReg()
ARM64Reg GetReg() const
{
return m_reg;
}
u32 GetImm()
u32 GetImm() const
{
return m_value;
}
Expand All @@ -81,12 +81,12 @@ class OpArg
m_last_used = 0xFFFF;
}

u32 GetLastUsed() { return m_last_used; }
u32 GetLastUsed() const { return m_last_used; }
void ResetLastUsed() { m_last_used = 0; }
void IncrementLastUsed() { ++m_last_used; }

void SetDirty(bool dirty) { m_dirty = dirty; }
bool IsDirty() { return m_dirty; }
bool IsDirty() const { return m_dirty; }

private:
// For REG_REG
Expand All @@ -106,10 +106,10 @@ class HostReg
public:
HostReg() : m_reg(INVALID_REG), m_locked(false) {}
HostReg(ARM64Reg reg) : m_reg(reg), m_locked(false) {}
bool IsLocked() { return m_locked; }
bool IsLocked() const { return m_locked; }
void Lock() { m_locked = true; }
void Unlock() { m_locked = false; }
ARM64Reg GetReg() { return m_reg; }
ARM64Reg GetReg() const { return m_reg; }

bool operator==(const ARM64Reg& reg)
{
Expand Down Expand Up @@ -233,10 +233,10 @@ class Arm64GPRCache : public Arm64RegCache
void SetImmediate(u32 preg, u32 imm);

// Returns if a register is set as an immediate
bool IsImm(u32 reg) { return m_guest_registers[reg].GetType() == REG_IMM; }
bool IsImm(u32 reg) const { return m_guest_registers[reg].GetType() == REG_IMM; }

// Gets the immediate that a register is set to
u32 GetImm(u32 reg) { return m_guest_registers[reg].GetImm(); }
u32 GetImm(u32 reg) const { return m_guest_registers[reg].GetImm(); }

void BindToRegister(u32 preg, bool do_load);

Expand Down

0 comments on commit 2f2e514

Please sign in to comment.