summaryrefslogtreecommitdiff
path: root/yjit_codegen.h
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2021-09-10 11:22:36 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:40 -0400
commitcbb0271dd6256601aa6aea669ceac4f82fdb75fe (patch)
tree5a0becaad690d4fcd5c85c840f79a2ca899b07c0 /yjit_codegen.h
parent6e1f2519cc851961939c4de61613161de3caf998 (diff)
Deduplicate side exits
Send instructions currently generate the exact same side exit twice. Cache the exit the first time we generate it. Also add a comment explaining what side exits do. Closes GH-117.
Diffstat (limited to 'yjit_codegen.h')
-rw-r--r--yjit_codegen.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/yjit_codegen.h b/yjit_codegen.h
index 66740a30f5..16c2211656 100644
--- a/yjit_codegen.h
+++ b/yjit_codegen.h
@@ -13,7 +13,7 @@ extern uint32_t yjit_codepage_frozen_bytes;
typedef struct JITState
{
// Block version being compiled
- block_t* block;
+ block_t *block;
// Instruction sequence this is associated with
const rb_iseq_t *iseq;
@@ -27,9 +27,12 @@ typedef struct JITState
// PC of the instruction being compiled
VALUE *pc;
+ // Side exit to the instruction being compiled. See :side-exit:.
+ uint8_t *side_exit_for_pc;
+
// Execution context when compilation started
// This allows us to peek at run-time values
- rb_execution_context_t* ec;
+ rb_execution_context_t *ec;
// Whether we need to record the code address at
// the end of this bytecode instruction for global invalidation