diff options
author | Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> | 2020-12-08 17:19:28 -0500 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:26 -0400 |
commit | f761e9ee641cb4bf9250fa97d119a444d239e7b7 (patch) | |
tree | fa2e4137df92029e7b21ef404d9b87fa4a28c2d2 /ujit_iface.c | |
parent | e4c65ec49c5e2cba537f2d9ee00888c5dfbcac34 (diff) |
Move code into ujit_iface.c
Diffstat (limited to 'ujit_iface.c')
-rw-r--r-- | ujit_iface.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ujit_iface.c b/ujit_iface.c index 9b407c82d1..404c75dbee 100644 --- a/ujit_iface.c +++ b/ujit_iface.c @@ -19,6 +19,22 @@ bool rb_ujit_enabled; // Hash table of encoded instructions extern st_table *rb_encoded_insn_data; +// Write the uJIT entry point pre-call bytes +void +cb_write_pre_call_bytes(codeblock_t* cb) +{ + for (size_t i = 0; i < sizeof(ujit_with_ec_pre_call_bytes); ++i) + cb_write_byte(cb, ujit_with_ec_pre_call_bytes[i]); +} + +// Write the uJIT exit post-call bytes +void +cb_write_post_call_bytes(codeblock_t* cb) +{ + for (size_t i = 0; i < sizeof(ujit_with_ec_post_call_bytes); ++i) + cb_write_byte(cb, ujit_with_ec_post_call_bytes[i]); +} + // Keep track of mapping from instructions to generated code // See comment for rb_encoded_insn_data in iseq.c void |