* vm_core.h: constify rb_call_info_t::blockiseq and rb_iseq_t::iseq.
* vm.c, vm_insnhelper.c: catch up this fix. * iseq.c (iseq_data_to_ary): constify the first iseq parameter. * vm_insnhelper.c (vm_make_proc_with_iseq): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c5618920ed
commit
948bd807c3
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
Wed Jul 22 06:25:45 2015 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* vm_core.h: constify rb_call_info_t::blockiseq and rb_iseq_t::iseq.
|
||||||
|
|
||||||
|
* vm.c, vm_insnhelper.c: catch up this fix.
|
||||||
|
|
||||||
|
* iseq.c (iseq_data_to_ary): constify the first iseq parameter.
|
||||||
|
|
||||||
|
* vm_insnhelper.c (vm_make_proc_with_iseq): ditto.
|
||||||
|
|
||||||
Wed Jul 22 06:17:35 2015 Koichi Sasada <ko1@atdot.net>
|
Wed Jul 22 06:17:35 2015 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* method.h: constify rb_method_iseq_t::iseqptr.
|
* method.h: constify rb_method_iseq_t::iseqptr.
|
||||||
|
9
iseq.c
9
iseq.c
@ -934,8 +934,7 @@ rb_iseq_method_name(VALUE self)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static VALUE iseq_data_to_ary(const rb_iseq_t *iseq);
|
||||||
VALUE iseq_data_to_ary(rb_iseq_t *iseq);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
@ -1611,7 +1610,7 @@ cdhash_each(VALUE key, VALUE value, VALUE ary)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
iseq_data_to_ary(rb_iseq_t *iseq)
|
iseq_data_to_ary(const rb_iseq_t *iseq)
|
||||||
{
|
{
|
||||||
long i;
|
long i;
|
||||||
size_t ti;
|
size_t ti;
|
||||||
@ -1731,7 +1730,7 @@ iseq_data_to_ary(rb_iseq_t *iseq)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* body */
|
/* body */
|
||||||
iseq_original = rb_iseq_original_iseq(iseq);
|
iseq_original = rb_iseq_original_iseq((rb_iseq_t *)iseq);
|
||||||
|
|
||||||
for (seq = iseq_original; seq < iseq_original + iseq->iseq_size; ) {
|
for (seq = iseq_original; seq < iseq_original + iseq->iseq_size; ) {
|
||||||
VALUE insn = *seq++;
|
VALUE insn = *seq++;
|
||||||
@ -1756,7 +1755,7 @@ iseq_data_to_ary(rb_iseq_t *iseq)
|
|||||||
break;
|
break;
|
||||||
case TS_ISEQ:
|
case TS_ISEQ:
|
||||||
{
|
{
|
||||||
rb_iseq_t *iseq = (rb_iseq_t *)*seq;
|
const rb_iseq_t *iseq = (rb_iseq_t *)*seq;
|
||||||
if (iseq) {
|
if (iseq) {
|
||||||
VALUE val = iseq_data_to_ary(iseq);
|
VALUE val = iseq_data_to_ary(iseq);
|
||||||
rb_ary_push(ary, val);
|
rb_ary_push(ary, val);
|
||||||
|
2
vm.c
2
vm.c
@ -769,7 +769,7 @@ rb_binding_add_dynavars(rb_binding_t *bind, int dyncount, const ID *dynvars)
|
|||||||
rb_env_t *env;
|
rb_env_t *env;
|
||||||
rb_block_t *base_block;
|
rb_block_t *base_block;
|
||||||
rb_thread_t *th = GET_THREAD();
|
rb_thread_t *th = GET_THREAD();
|
||||||
rb_iseq_t *base_iseq;
|
const rb_iseq_t *base_iseq;
|
||||||
NODE *node = 0;
|
NODE *node = 0;
|
||||||
ID minibuf[4], *dyns = minibuf;
|
ID minibuf[4], *dyns = minibuf;
|
||||||
VALUE idtmp = 0;
|
VALUE idtmp = 0;
|
||||||
|
@ -201,7 +201,7 @@ typedef struct rb_call_info_struct {
|
|||||||
|
|
||||||
unsigned int flag;
|
unsigned int flag;
|
||||||
int orig_argc;
|
int orig_argc;
|
||||||
rb_iseq_t *blockiseq;
|
const rb_iseq_t *blockiseq;
|
||||||
rb_call_info_kw_arg_t *kw_arg;
|
rb_call_info_kw_arg_t *kw_arg;
|
||||||
|
|
||||||
/* inline cache: keys */
|
/* inline cache: keys */
|
||||||
@ -565,7 +565,7 @@ typedef struct rb_control_frame_struct {
|
|||||||
typedef struct rb_block_struct {
|
typedef struct rb_block_struct {
|
||||||
VALUE self; /* share with method frame if it's only block */
|
VALUE self; /* share with method frame if it's only block */
|
||||||
VALUE *ep; /* share with method frame if it's only block */
|
VALUE *ep; /* share with method frame if it's only block */
|
||||||
rb_iseq_t *iseq;
|
const rb_iseq_t *iseq;
|
||||||
VALUE proc;
|
VALUE proc;
|
||||||
} rb_block_t;
|
} rb_block_t;
|
||||||
|
|
||||||
|
@ -2305,7 +2305,7 @@ static VALUE
|
|||||||
vm_invoke_block(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_t *ci)
|
vm_invoke_block(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_t *ci)
|
||||||
{
|
{
|
||||||
const rb_block_t *block = VM_CF_BLOCK_PTR(reg_cfp);
|
const rb_block_t *block = VM_CF_BLOCK_PTR(reg_cfp);
|
||||||
rb_iseq_t *iseq;
|
const rb_iseq_t *iseq;
|
||||||
VALUE type = GET_ISEQ()->local_iseq->type;
|
VALUE type = GET_ISEQ()->local_iseq->type;
|
||||||
|
|
||||||
if ((type != ISEQ_TYPE_METHOD && type != ISEQ_TYPE_CLASS) || block == 0) {
|
if ((type != ISEQ_TYPE_METHOD && type != ISEQ_TYPE_CLASS) || block == 0) {
|
||||||
@ -2344,7 +2344,7 @@ vm_invoke_block(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_t *ci
|
|||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
vm_make_proc_with_iseq(rb_iseq_t *blockiseq)
|
vm_make_proc_with_iseq(const rb_iseq_t *blockiseq)
|
||||||
{
|
{
|
||||||
rb_block_t *blockptr;
|
rb_block_t *blockptr;
|
||||||
rb_thread_t *th = GET_THREAD();
|
rb_thread_t *th = GET_THREAD();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user