aboutsummaryrefslogtreecommitdiff
path: root/src/ARMJIT_Internal.h
diff options
context:
space:
mode:
authorRSDuck <rsduck@users.noreply.github.com>2020-04-06 12:25:35 +0200
committerRSDuck <rsduck@users.noreply.github.com>2020-06-16 11:57:57 +0200
commit3098c6a9a03dc284b780b19962d35bebde62ea35 (patch)
tree09f46da24fef38b323dcfe08d01328eb78e09350 /src/ARMJIT_Internal.h
parent5ab56cef5fdc9f49cdf19ab719c8d63dd831081f (diff)
preparations for block linking
Diffstat (limited to 'src/ARMJIT_Internal.h')
-rw-r--r--src/ARMJIT_Internal.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/ARMJIT_Internal.h b/src/ARMJIT_Internal.h
index fb05f75..b968dcb 100644
--- a/src/ARMJIT_Internal.h
+++ b/src/ARMJIT_Internal.h
@@ -86,6 +86,14 @@ struct __attribute__((packed)) TinyVector
Capacity = capacity;
}
+ void SetLength(u16 length)
+ {
+ if (Capacity < length)
+ MakeCapacity(length);
+
+ Length = length;
+ }
+
void Clear()
{
Length = 0;
@@ -147,12 +155,7 @@ public:
{
NumInstrs = numInstrs;
NumAddresses = numAddresses;
- Data = new u32[numInstrs + numAddresses];
- }
-
- ~JitBlock()
- {
- delete[] Data;
+ Data.SetLength(numInstrs + numAddresses);
}
u32 StartAddr;
@@ -160,13 +163,14 @@ public:
u32 NumInstrs;
u32 NumAddresses;
+ u32 NumLinks;
JitBlockEntry EntryPoint;
u32* Instrs()
- { return Data; }
+ { return &Data[0]; }
u32* AddressRanges()
- { return Data + NumInstrs; }
+ { return &Data[NumInstrs]; }
private:
/*
@@ -174,7 +178,7 @@ private:
NumInstrs..<(NumLinks + NumInstrs) - pseudo physical addresses where the block is located
(atleast one, the pseudo physical address of the block)
*/
- u32* Data;
+ TinyVector<u32> Data;
};
// size should be 16 bytes because I'm to lazy to use mul and whatnot