aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-23 08:32:30 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-23 08:32:30 +0000
commit804fd345d17cd970e4c5a0810f9da223b3bd3c90 (patch)
tree1fcdc749e929fe7d036d1dd6a8e969041e669792 /compile.c
parentc1f7344674c979fa74ba158876ae716a7a6dd91f (diff)
downloadruby-804fd345d17cd970e4c5a0810f9da223b3bd3c90.tar.gz
iseq.c: add a map from encoded insn to insn data
This enhances rb_vm_insn_addr2insn which retrieves a decoded insn number from encoded insn. The insn data table include not only decoded insn number, but also its len, trace and non-trace version of encoded insn. This table can be used to simplify trace instrumentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/compile.c b/compile.c
index 0e7153f6e7..71fecf1069 100644
--- a/compile.c
+++ b/compile.c
@@ -746,35 +746,6 @@ rb_iseq_translate_threaded_code(rb_iseq_t *iseq)
return COMPILE_OK;
}
-#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
-static st_table *addr2insn;
-
-void
-rb_addr2insn_init(void)
-{
- const void * const *table = rb_vm_get_insns_address_table();
- st_data_t insn;
-
- addr2insn = st_init_numtable_with_size(VM_INSTRUCTION_SIZE);
- for (insn = 0; insn < VM_INSTRUCTION_SIZE; insn++) {
- st_add_direct(addr2insn, (st_data_t)table[insn], insn);
- }
-}
-
-int
-rb_vm_insn_addr2insn(const void *addr)
-{
- st_data_t key = (st_data_t)addr;
- st_data_t val;
-
- if (st_lookup(addr2insn, key, &val)) {
- return (int)val;
- }
-
- rb_bug("rb_vm_insn_addr2insn: invalid insn address: %p", addr);
-}
-#endif /* OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE */
-
VALUE *
rb_iseq_original_iseq(const rb_iseq_t *iseq) /* cold path */
{