Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arm64: Make some functions const. #2524

Merged
merged 3 commits into from
Jun 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Core/Common/Arm64Emitter.h
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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