summaryrefslogtreecommitdiff
path: root/yjit_asm.h
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2021-07-13 14:56:02 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:37 -0400
commit350b686a2c6cc8f27466222cf8520a8fda931ea2 (patch)
tree36dbefe0c991e13fcd4c07ee7e10845c2d268d87 /yjit_asm.h
parent2440fafba00b6646b312a0c74798523bfa44bfe9 (diff)
First pass at code page GC object.
Diffstat (limited to 'yjit_asm.h')
-rw-r--r--yjit_asm.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/yjit_asm.h b/yjit_asm.h
index c94b54240c..93762987bc 100644
--- a/yjit_asm.h
+++ b/yjit_asm.h
@@ -131,6 +131,20 @@ typedef struct X86Opnd
} x86opnd_t;
+// Struct representing a code page
+typedef struct code_page_struct
+{
+ // Chunk of executable memory
+ uint8_t* mem_block;
+
+ // Size of the executable memory chunk
+ uint32_t page_size;
+
+ // Next node in the free list (private)
+ struct code_page_struct* _next;
+
+} code_page_t;
+
// Dummy none/null operand
static const x86opnd_t NO_OPND = { OPND_NONE, 0, .as.imm = 0 };
@@ -242,8 +256,8 @@ x86opnd_t const_ptr_opnd(const void *ptr);
// Machine code allocation
uint8_t* alloc_exec_mem(uint32_t mem_size);
-uint8_t* alloc_code_page();
-void free_code_page(uint8_t* page_ptr);
+code_page_t* alloc_code_page();
+void free_code_page(code_page_t* code_page);
// Code block methods
void cb_init(codeblock_t* cb, uint8_t* mem_block, uint32_t mem_size);