summaryrefslogtreecommitdiff
path: root/yjit_core.h
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2021-07-14 11:36:33 -0700
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:38 -0400
commit6c80150d402758fa07470cb88d5a15b1ffd15e6c (patch)
treed8cf008d20cf8ec30b053428d8ac772e0ced598f /yjit_core.h
parent4ea69e5c0b6163dbc6cdd75b2a44720d2b84a5f6 (diff)
Introduce ctx_{get,set}_opnd_mapping
Diffstat (limited to 'yjit_core.h')
-rw-r--r--yjit_core.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/yjit_core.h b/yjit_core.h
index 9f9a4704f7..c4bbf05833 100644
--- a/yjit_core.h
+++ b/yjit_core.h
@@ -104,6 +104,13 @@ STATIC_ASSERT(temp_mapping_size, sizeof(temp_mapping_t) == 1);
// Temp value is actually self
#define MAP_SELF ( (temp_mapping_t) { .kind = TEMP_SELF } )
+// Represents both the type and mapping
+typedef struct {
+ temp_mapping_t mapping;
+ val_type_t type;
+} temp_type_mapping_t;
+STATIC_ASSERT(temp_type_mapping_size, sizeof(temp_type_mapping_t) == 2);
+
// Operand to a bytecode instruction
typedef struct yjit_insn_opnd
{
@@ -252,6 +259,7 @@ typedef struct yjit_block_version
// Context object methods
x86opnd_t ctx_sp_opnd(ctx_t* ctx, int32_t offset_bytes);
+x86opnd_t ctx_stack_push_mapping(ctx_t* ctx, temp_type_mapping_t mapping);
x86opnd_t ctx_stack_push(ctx_t* ctx, val_type_t type);
x86opnd_t ctx_stack_push_self(ctx_t* ctx);
x86opnd_t ctx_stack_push_local(ctx_t* ctx, size_t local_idx);
@@ -263,6 +271,9 @@ void ctx_set_local_type(ctx_t* ctx, size_t idx, val_type_t type);
void ctx_clear_local_types(ctx_t* ctx);
int ctx_diff(const ctx_t* src, const ctx_t* dst);
+temp_type_mapping_t ctx_get_opnd_mapping(const ctx_t* ctx, insn_opnd_t opnd);
+void ctx_set_opnd_mapping(ctx_t* ctx, insn_opnd_t opnd, temp_type_mapping_t type_mapping);
+
block_t* find_block_version(blockid_t blockid, const ctx_t* ctx);
block_t* gen_block_version(blockid_t blockid, const ctx_t* ctx, rb_execution_context_t *ec);
uint8_t* gen_entry_point(const rb_iseq_t *iseq, uint32_t insn_idx, rb_execution_context_t *ec);