Skip to content

Commit

Permalink
Revert "vm_args.c (rb_warn_check): Use iseq_unique_id instead of its …
Browse files Browse the repository at this point in the history
…pointer"

This reverts commit 036bc1d.

This caused a failure on iseq_binary mode.
http://ci.rvm.jp/results/trunk-iseq_binary@silicon-docker/2474587

Numbering iseqs is not trivial due to dump/load.
  • Loading branch information
mame committed Dec 9, 2019
1 parent 39c7230 commit 3cdb37d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
3 changes: 0 additions & 3 deletions iseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,14 +427,11 @@ rb_iseq_memsize(const rb_iseq_t *iseq)
return size;
}

static unsigned long fresh_iseq_unique_id = 0; /* -- Remove In 3.0 -- */

static rb_iseq_t *
iseq_alloc(void)
{
rb_iseq_t *iseq = iseq_imemo_alloc();
iseq->body = ZALLOC(struct rb_iseq_constant_body);
iseq->body->iseq_unique_id = fresh_iseq_unique_id++; /* -- Remove In 3.0 -- */
return iseq;
}

Expand Down
6 changes: 1 addition & 5 deletions vm_args.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,12 +593,8 @@ VALUE rb_iseq_location(const rb_iseq_t *iseq);
*/
static st_table *caller_to_callees = 0;

static VALUE rb_warn_check(const rb_execution_context_t * const ec, const rb_iseq_t *const iseq)
static VALUE rb_warn_check(const rb_execution_context_t * const ec, const void *const callee)
{
if (!iseq) return 0;

const void *const callee = (void *)iseq->body->iseq_unique_id;

const rb_control_frame_t * const cfp = rb_vm_get_ruby_level_next_cfp(ec, ec->cfp);

if (!cfp) return 0;
Expand Down
2 changes: 0 additions & 2 deletions vm_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,6 @@ struct rb_iseq_constant_body {
long unsigned total_calls; /* number of total calls with `mjit_exec()` */
struct rb_mjit_unit *jit_unit;
#endif

unsigned long iseq_unique_id; /* -- Remove In 3.0 -- */
};

/* T_IMEMO/iseq */
Expand Down

0 comments on commit 3cdb37d

Please sign in to comment.