summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2017-01-08 13:14:02 +1300
committerGitHub <noreply@github.com>2017-01-08 13:14:02 +1300
commitc89aa79380cfa9dfd9bb9c52f0574f85e20aeece (patch)
tree88be7d229820f21854c12bf53e3437b6e6e488af /Source
parent27d7c265e5213d56632bc043cbe0ac9960794acf (diff)
parent9d8e8652fb17a802a74369f46a5033970fb92a89 (diff)
Merge pull request #4626 from lioncash/size
CodeBlock: Get rid of implicit sign-conversion in AllocCodeSpace
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Common/CodeBlock.h5
-rw-r--r--Source/Core/Core/PowerPC/Jit64Common/FarCodeCache.cpp2
-rw-r--r--Source/Core/Core/PowerPC/Jit64Common/FarCodeCache.h7
-rw-r--r--Source/Core/Core/PowerPC/Jit64Common/Jit64Base.h3
-rw-r--r--Source/Core/Core/PowerPC/Jit64Common/TrampolineCache.cpp2
-rw-r--r--Source/Core/Core/PowerPC/Jit64Common/TrampolineCache.h7
-rw-r--r--Source/Core/Core/PowerPC/JitArm64/Jit.h5
7 files changed, 19 insertions, 12 deletions
diff --git a/Source/Core/Common/CodeBlock.h b/Source/Core/Common/CodeBlock.h
index ea3de4fd6f..5696976a5a 100644
--- a/Source/Core/Common/CodeBlock.h
+++ b/Source/Core/Common/CodeBlock.h
@@ -4,7 +4,10 @@
#pragma once
+#include <cstddef>
+
#include "Common/Assert.h"
+#include "Common/CommonTypes.h"
#include "Common/MemoryUtil.h"
#include "Common/NonCopyable.h"
@@ -39,7 +42,7 @@ public:
}
// Call this before you generate any code.
- void AllocCodeSpace(int size, bool need_low = true)
+ void AllocCodeSpace(size_t size, bool need_low = true)
{
region_size = size;
region = static_cast<u8*>(Common::AllocateExecutableMemory(region_size, need_low));
diff --git a/Source/Core/Core/PowerPC/Jit64Common/FarCodeCache.cpp b/Source/Core/Core/PowerPC/Jit64Common/FarCodeCache.cpp
index cd9d5a9462..72909f6a6a 100644
--- a/Source/Core/Core/PowerPC/Jit64Common/FarCodeCache.cpp
+++ b/Source/Core/Core/PowerPC/Jit64Common/FarCodeCache.cpp
@@ -4,7 +4,7 @@
#include "Core/PowerPC/Jit64Common/FarCodeCache.h"
-void FarCodeCache::Init(int size)
+void FarCodeCache::Init(size_t size)
{
AllocCodeSpace(size);
m_enabled = true;
diff --git a/Source/Core/Core/PowerPC/Jit64Common/FarCodeCache.h b/Source/Core/Core/PowerPC/Jit64Common/FarCodeCache.h
index 2606de65fe..bc82045870 100644
--- a/Source/Core/Core/PowerPC/Jit64Common/FarCodeCache.h
+++ b/Source/Core/Core/PowerPC/Jit64Common/FarCodeCache.h
@@ -4,19 +4,20 @@
#pragma once
+#include <cstddef>
#include "Common/x64Emitter.h"
// a bit of a hack; the MMU results in a vast amount more code ending up in the far cache,
// mostly exception handling, so give it a whole bunch more space if the MMU is on.
-constexpr int FARCODE_SIZE = 1024 * 1024 * 8;
-constexpr int FARCODE_SIZE_MMU = 1024 * 1024 * 48;
+constexpr size_t FARCODE_SIZE = 1024 * 1024 * 8;
+constexpr size_t FARCODE_SIZE_MMU = 1024 * 1024 * 48;
// A place to throw blocks of code we don't want polluting the cache, e.g. rarely taken
// exception branches.
class FarCodeCache : public Gen::X64CodeBlock
{
public:
- void Init(int size);
+ void Init(size_t size);
void Shutdown();
bool Enabled() const;
diff --git a/Source/Core/Core/PowerPC/Jit64Common/Jit64Base.h b/Source/Core/Core/PowerPC/Jit64Common/Jit64Base.h
index b6259dd430..e05c8f84ee 100644
--- a/Source/Core/Core/PowerPC/Jit64Common/Jit64Base.h
+++ b/Source/Core/Core/PowerPC/Jit64Common/Jit64Base.h
@@ -4,6 +4,7 @@
#pragma once
+#include <cstddef>
#include <cstdint>
#include "Common/CommonTypes.h"
@@ -32,7 +33,7 @@ constexpr Gen::X64Reg RMEM = Gen::RBX;
// to address as much as possible in a one-byte offset form.
constexpr Gen::X64Reg RPPCSTATE = Gen::RBP;
-constexpr int CODE_SIZE = 1024 * 1024 * 32;
+constexpr size_t CODE_SIZE = 1024 * 1024 * 32;
class Jitx86Base : public JitBase, public QuantizedMemoryRoutines
{
diff --git a/Source/Core/Core/PowerPC/Jit64Common/TrampolineCache.cpp b/Source/Core/Core/PowerPC/Jit64Common/TrampolineCache.cpp
index 954aac6fc5..5fa7c2d911 100644
--- a/Source/Core/Core/PowerPC/Jit64Common/TrampolineCache.cpp
+++ b/Source/Core/Core/PowerPC/Jit64Common/TrampolineCache.cpp
@@ -23,7 +23,7 @@
using namespace Gen;
-void TrampolineCache::Init(int size)
+void TrampolineCache::Init(size_t size)
{
AllocCodeSpace(size);
}
diff --git a/Source/Core/Core/PowerPC/Jit64Common/TrampolineCache.h b/Source/Core/Core/PowerPC/Jit64Common/TrampolineCache.h
index 12ee83ec2d..769c4b4c84 100644
--- a/Source/Core/Core/PowerPC/Jit64Common/TrampolineCache.h
+++ b/Source/Core/Core/PowerPC/Jit64Common/TrampolineCache.h
@@ -4,6 +4,7 @@
#pragma once
+#include <cstddef>
#include "Common/CommonTypes.h"
#include "Core/PowerPC/Jit64Common/EmuCodeBlock.h"
@@ -11,8 +12,8 @@ struct TrampolineInfo;
// a bit of a hack; the MMU results in more code ending up in the trampoline cache,
// because fastmem results in far more backpatches in MMU mode
-constexpr int TRAMPOLINE_CODE_SIZE = 1024 * 1024 * 8;
-constexpr int TRAMPOLINE_CODE_SIZE_MMU = 1024 * 1024 * 32;
+constexpr size_t TRAMPOLINE_CODE_SIZE = 1024 * 1024 * 8;
+constexpr size_t TRAMPOLINE_CODE_SIZE_MMU = 1024 * 1024 * 32;
// We need at least this many bytes for backpatching.
constexpr int BACKPATCH_SIZE = 5;
@@ -23,7 +24,7 @@ class TrampolineCache : public EmuCodeBlock
const u8* GenerateWriteTrampoline(const TrampolineInfo& info);
public:
- void Init(int size);
+ void Init(size_t size);
void Shutdown();
const u8* GenerateTrampoline(const TrampolineInfo& info);
void ClearCodeSpace();
diff --git a/Source/Core/Core/PowerPC/JitArm64/Jit.h b/Source/Core/Core/PowerPC/JitArm64/Jit.h
index 806c50f6e0..e388dfa212 100644
--- a/Source/Core/Core/PowerPC/JitArm64/Jit.h
+++ b/Source/Core/Core/PowerPC/JitArm64/Jit.h
@@ -4,6 +4,7 @@
#pragma once
+#include <cstddef>
#include <map>
#include <tuple>
@@ -17,8 +18,8 @@
#include "Core/PowerPC/JitCommon/JitBase.h"
#include "Core/PowerPC/PPCAnalyst.h"
-constexpr int CODE_SIZE = 1024 * 1024 * 32;
-constexpr int FARCODE_SIZE_MMU = 1024 * 1024 * 48;
+constexpr size_t CODE_SIZE = 1024 * 1024 * 32;
+constexpr size_t FARCODE_SIZE_MMU = 1024 * 1024 * 48;
class JitArm64 : public JitBase, public Arm64Gen::ARM64CodeBlock, public CommonAsmRoutinesBase
{