summaryrefslogtreecommitdiff
path: root/tool/ruby_vm/views/_insn_type_chars.erb
diff options
context:
space:
mode:
Diffstat (limited to 'tool/ruby_vm/views/_insn_type_chars.erb')
-rw-r--r--tool/ruby_vm/views/_insn_type_chars.erb19
1 files changed, 19 insertions, 0 deletions
diff --git a/tool/ruby_vm/views/_insn_type_chars.erb b/tool/ruby_vm/views/_insn_type_chars.erb
index 4e1f63e660..27daec6c6d 100644
--- a/tool/ruby_vm/views/_insn_type_chars.erb
+++ b/tool/ruby_vm/views/_insn_type_chars.erb
@@ -11,3 +11,22 @@ enum ruby_insn_type_chars {
<%= t %> = '<%= c %>',
% end
};
+
+static inline union iseq_inline_storage_entry *
+ISEQ_IS_ENTRY_START(const struct rb_iseq_constant_body *body, char op_type)
+{
+ unsigned int relative_ic_offset = 0;
+ switch (op_type) {
+ case TS_IC:
+ relative_ic_offset += body->ise_size;
+ case TS_ISE:
+ relative_ic_offset += body->icvarc_size;
+ case TS_ICVARC:
+ relative_ic_offset += body->ivc_size;
+ case TS_IVC:
+ break;
+ default:
+ rb_bug("Wrong op type");
+ }
+ return &body->is_entries[relative_ic_offset];
+}