summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2020-09-11 14:58:32 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:23 -0400
commit4929ba0a5ce2ea697bad4b8a33ce6047e99da04a (patch)
tree1ac4f0cc10a081677d76b73f29da38dd1e1440fb /iseq.c
parent6a12fb2067e1d0a9ce610b0affd6a3113d13ff1c (diff)
Generate multiple copies of native code for `pop`
Insert generated addresses into st_table for mapping native code addresses back to info about VM instructions. Export `encoded_insn_data` to do this. Also some style fixes.
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/iseq.c b/iseq.c
index 51d923cf8e..15e888670a 100644
--- a/iseq.c
+++ b/iseq.c
@@ -3169,7 +3169,7 @@ rb_iseq_defined_string(enum defined_type type)
/* A map from encoded_insn to insn_data: decoded insn number, its len,
* non-trace version of encoded insn, and trace version. */
-static st_table *encoded_insn_data;
+st_table *rb_encoded_insn_data;
typedef struct insn_data_struct {
int insn;
int insn_len;
@@ -3196,7 +3196,7 @@ rb_vm_encoded_insn_data_table_init(void)
#define INSN_CODE(insn) (insn)
#endif
st_data_t insn;
- encoded_insn_data = st_init_numtable_with_size(VM_INSTRUCTION_SIZE / 2);
+ rb_encoded_insn_data = st_init_numtable_with_size(VM_INSTRUCTION_SIZE / 2);
for (insn = 0; insn < VM_INSTRUCTION_SIZE/2; insn++) {
st_data_t key1 = (st_data_t)INSN_CODE(insn);
@@ -3214,8 +3214,8 @@ rb_vm_encoded_insn_data_table_init(void)
insn_data[insn].trace_encoded_insn = (void *) INSN_CODE(BIN(opt_invokebuiltin_delegate) + VM_INSTRUCTION_SIZE/2);
}
- st_add_direct(encoded_insn_data, key1, (st_data_t)&insn_data[insn]);
- st_add_direct(encoded_insn_data, key2, (st_data_t)&insn_data[insn]);
+ st_add_direct(rb_encoded_insn_data, key1, (st_data_t)&insn_data[insn]);
+ st_add_direct(rb_encoded_insn_data, key2, (st_data_t)&insn_data[insn]);
}
@@ -3271,7 +3271,7 @@ rb_vm_insn_addr2insn(const void *addr)
st_data_t key = (st_data_t)addr;
st_data_t val;
- if (st_lookup(encoded_insn_data, key, &val)) {
+ if (st_lookup(rb_encoded_insn_data, key, &val)) {
insn_data_t *e = (insn_data_t *)val;
return (int)e->insn;
}
@@ -3303,7 +3303,7 @@ encoded_iseq_trace_instrument(VALUE *iseq_encoded_insn, rb_event_flag_t turnon,
st_data_t key = (st_data_t)*iseq_encoded_insn;
st_data_t val;
- if (st_lookup(encoded_insn_data, key, &val)) {
+ if (st_lookup(rb_encoded_insn_data, key, &val)) {
insn_data_t *e = (insn_data_t *)val;
if (remain_current_trace && key == (st_data_t)e->trace_encoded_insn) {
turnon = 1;