ruby-changes:52525
From: k0kubun <ko1@a...>
Date: Thu, 13 Sep 2018 22:59:30 +0900 (JST)
Subject: [ruby-changes:52525] k0kubun:r64736 (trunk): iseq.c: prefix rb_ to non-static iseq functions
k0kubun 2018-09-13 22:59:25 +0900 (Thu, 13 Sep 2018) New Revision: 64736 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64736 Log: iseq.c: prefix rb_ to non-static iseq functions I assume we always prefix rb_ to non-static functions to avoid conflict. These functions are not exported and safe to be renamed. iseq.h: ditto compile.c: ditto Modified files: trunk/compile.c trunk/iseq.c trunk/iseq.h Index: iseq.c =================================================================== --- iseq.c (revision 64735) +++ iseq.c (revision 64736) @@ -505,7 +505,7 @@ rb_iseq_insns_info_decode_positions(cons https://github.com/ruby/ruby/blob/trunk/iseq.c#L505 #endif void -iseq_init_trace(rb_iseq_t *iseq) +rb_iseq_init_trace(rb_iseq_t *iseq) { iseq->aux.trace_events = 0; if (ruby_vm_event_enabled_flags & ISEQ_TRACE_EVENTS) { @@ -540,7 +540,7 @@ finish_iseq_build(rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/iseq.c#L540 rb_exc_raise(err); } - iseq_init_trace(iseq); + rb_iseq_init_trace(iseq); return Qtrue; } @@ -1203,7 +1203,7 @@ iseqw_check(VALUE iseqw) https://github.com/ruby/ruby/blob/trunk/iseq.c#L1203 rb_iseq_t *iseq = DATA_PTR(iseqw); if (!iseq->body) { - ibf_load_iseq_complete(iseq); + rb_ibf_load_iseq_complete(iseq); } if (!iseq->body->location.label) { @@ -3011,7 +3011,7 @@ iseqw_to_binary(int argc, VALUE *argv, V https://github.com/ruby/ruby/blob/trunk/iseq.c#L3011 { VALUE opt; rb_scan_args(argc, argv, "01", &opt); - return iseq_ibf_dump(iseqw_check(self), opt); + return rb_iseq_ibf_dump(iseqw_check(self), opt); } /* @@ -3030,7 +3030,7 @@ iseqw_to_binary(int argc, VALUE *argv, V https://github.com/ruby/ruby/blob/trunk/iseq.c#L3030 static VALUE iseqw_s_load_from_binary(VALUE self, VALUE str) { - return iseqw_new(iseq_ibf_load(str)); + return iseqw_new(rb_iseq_ibf_load(str)); } /* @@ -3042,7 +3042,7 @@ iseqw_s_load_from_binary(VALUE self, VAL https://github.com/ruby/ruby/blob/trunk/iseq.c#L3042 static VALUE iseqw_s_load_from_binary_extra_data(VALUE self, VALUE str) { - return iseq_ibf_load_extra_data(str); + return rb_iseq_ibf_load_extra_data(str); } #if VM_INSN_INFO_TABLE_IMPL == 2 Index: iseq.h =================================================================== --- iseq.h (revision 64735) +++ iseq.h (revision 64736) @@ -140,11 +140,11 @@ iseq_imemo_alloc(void) https://github.com/ruby/ruby/blob/trunk/iseq.h#L140 return (rb_iseq_t *)rb_imemo_new(imemo_iseq, 0, 0, 0, 0); } -VALUE iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt); -void ibf_load_iseq_complete(rb_iseq_t *iseq); -const rb_iseq_t *iseq_ibf_load(VALUE str); -VALUE iseq_ibf_load_extra_data(VALUE str); -void iseq_init_trace(rb_iseq_t *iseq); +VALUE rb_iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt); +void rb_ibf_load_iseq_complete(rb_iseq_t *iseq); +const rb_iseq_t *rb_iseq_ibf_load(VALUE str); +VALUE rb_iseq_ibf_load_extra_data(VALUE str); +void rb_iseq_init_trace(rb_iseq_t *iseq); #if VM_INSN_INFO_TABLE_IMPL == 2 unsigned int *rb_iseq_insns_info_decode_positions(const struct rb_iseq_constant_body *body); Index: compile.c =================================================================== --- compile.c (revision 64735) +++ compile.c (revision 64736) @@ -9804,7 +9804,7 @@ ibf_dump_setup(struct ibf_dump *dump, VA https://github.com/ruby/ruby/blob/trunk/compile.c#L9804 } VALUE -iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt) +rb_iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt) { struct ibf_dump *dump; struct ibf_header header = {{0}}; @@ -9863,14 +9863,14 @@ ibf_iseq_list(const struct ibf_load *loa https://github.com/ruby/ruby/blob/trunk/compile.c#L9863 } void -ibf_load_iseq_complete(rb_iseq_t *iseq) +rb_ibf_load_iseq_complete(rb_iseq_t *iseq) { struct ibf_load *load = RTYPEDDATA_DATA(iseq->aux.loader.obj); rb_iseq_t *prev_src_iseq = load->iseq; const ibf_offset_t offset = ibf_iseq_list(load)[iseq->aux.loader.index]; load->iseq = iseq; #if IBF_ISEQ_DEBUG - fprintf(stderr, "ibf_load_iseq_complete: index=%#x offset=%#x size=%#x\n", + fprintf(stderr, "rb_ibf_load_iseq_complete: index=%#x offset=%#x size=%#x\n", iseq->aux.loader.index, offset, load->header->size); #endif @@ -9888,7 +9888,7 @@ ibf_load_iseq_complete(rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/compile.c#L9888 const rb_iseq_t * rb_iseq_complete(const rb_iseq_t *iseq) { - ibf_load_iseq_complete((rb_iseq_t *)iseq); + rb_ibf_load_iseq_complete((rb_iseq_t *)iseq); return iseq; } #endif @@ -9932,7 +9932,7 @@ ibf_load_iseq(const struct ibf_load *loa https://github.com/ruby/ruby/blob/trunk/compile.c#L9932 #if IBF_ISEQ_DEBUG fprintf(stderr, "ibf_load_iseq: loading iseq=%p\n", iseq); #endif - ibf_load_iseq_complete(iseq); + rb_ibf_load_iseq_complete(iseq); #endif /* !USE_LAZY_LOAD */ #if IBF_ISEQ_DEBUG @@ -10020,7 +10020,7 @@ static const rb_data_type_t ibf_load_typ https://github.com/ruby/ruby/blob/trunk/compile.c#L10020 }; const rb_iseq_t * -iseq_ibf_load(VALUE str) +rb_iseq_ibf_load(VALUE str) { struct ibf_load *load; rb_iseq_t *iseq; @@ -10029,14 +10029,14 @@ iseq_ibf_load(VALUE str) https://github.com/ruby/ruby/blob/trunk/compile.c#L10029 ibf_load_setup(load, loader_obj, str); iseq = ibf_load_iseq(load, 0); - iseq_init_trace(iseq); + rb_iseq_init_trace(iseq); RB_GC_GUARD(loader_obj); return iseq; } VALUE -iseq_ibf_load_extra_data(VALUE str) +rb_iseq_ibf_load_extra_data(VALUE str) { struct ibf_load *load; VALUE loader_obj = TypedData_Make_Struct(0, struct ibf_load, &ibf_load_type, load); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/