summaryrefslogtreecommitdiff
path: root/yjit_asm.h
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2021-09-21 10:59:55 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:41 -0400
commit0385ca2e97ba29653251dba96ab8cf0f21765bb4 (patch)
treee1d1b6cc4ceabe4cbbe67d403609fe920fe19112 /yjit_asm.h
parentc46bda6f191b01121ebbc8afa88b35683b6417a9 (diff)
Try to break the code page refactoring into smaller steps
Diffstat (limited to 'yjit_asm.h')
-rw-r--r--yjit_asm.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/yjit_asm.h b/yjit_asm.h
index de6ccb1cdc..58f9a849ad 100644
--- a/yjit_asm.h
+++ b/yjit_asm.h
@@ -5,6 +5,12 @@
#include <stddef.h>
#include <stdbool.h>
+// Size of code pages to allocate
+#define CODE_PAGE_SIZE 16 * 1024
+
+// How many code pages to allocate at once
+#define PAGES_PER_ALLOC 512
+
// Maximum number of labels to link
#define MAX_LABELS 32
@@ -263,7 +269,9 @@ void free_code_page(code_page_t* code_page);
void cb_init(codeblock_t* cb, uint8_t* mem_block, uint32_t mem_size);
void cb_align_pos(codeblock_t* cb, uint32_t multiple);
void cb_set_pos(codeblock_t* cb, uint32_t pos);
+void cb_set_write_ptr(codeblock_t* cb, uint8_t* code_ptr);
uint8_t* cb_get_ptr(codeblock_t* cb, uint32_t index);
+uint8_t* cb_get_write_ptr(codeblock_t* cb);
void cb_write_byte(codeblock_t* cb, uint8_t byte);
void cb_write_bytes(codeblock_t* cb, uint32_t num_bytes, ...);
void cb_write_int(codeblock_t* cb, uint64_t val, uint32_t num_bits);