* vm_insnhelper.c (vm_expandarray): use RARRAY_RAWPTR() instead of
RARRAY_PTR() because there is no new reference. * vm_insnhelper.c (vm_caller_setup_args): ditto. * vm_insnhelper.c (vm_yield_setup_block_args): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
33ebcb0538
commit
d9a556548e
@ -1,3 +1,12 @@
|
|||||||
|
Wed Jul 24 18:56:06 2013 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* vm_insnhelper.c (vm_expandarray): use RARRAY_RAWPTR() instead of
|
||||||
|
RARRAY_PTR() because there is no new reference.
|
||||||
|
|
||||||
|
* vm_insnhelper.c (vm_caller_setup_args): ditto.
|
||||||
|
|
||||||
|
* vm_insnhelper.c (vm_yield_setup_block_args): ditto.
|
||||||
|
|
||||||
Wed Jul 24 18:40:11 2013 Koichi Sasada <ko1@atdot.net>
|
Wed Jul 24 18:40:11 2013 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* array.c, gc.c: move ary_unprotect_logging() into
|
* array.c, gc.c: move ary_unprotect_logging() into
|
||||||
|
@ -784,7 +784,8 @@ vm_expandarray(rb_control_frame_t *cfp, VALUE ary, rb_num_t num, int flag)
|
|||||||
{
|
{
|
||||||
int is_splat = flag & 0x01;
|
int is_splat = flag & 0x01;
|
||||||
rb_num_t space_size = num + is_splat;
|
rb_num_t space_size = num + is_splat;
|
||||||
VALUE *base = cfp->sp, *ptr;
|
VALUE *base = cfp->sp;
|
||||||
|
const VALUE *ptr;
|
||||||
rb_num_t len;
|
rb_num_t len;
|
||||||
|
|
||||||
if (!RB_TYPE_P(ary, T_ARRAY)) {
|
if (!RB_TYPE_P(ary, T_ARRAY)) {
|
||||||
@ -793,7 +794,7 @@ vm_expandarray(rb_control_frame_t *cfp, VALUE ary, rb_num_t num, int flag)
|
|||||||
|
|
||||||
cfp->sp += space_size;
|
cfp->sp += space_size;
|
||||||
|
|
||||||
ptr = RARRAY_PTR(ary);
|
ptr = RARRAY_RAWPTR(ary);
|
||||||
len = (rb_num_t)RARRAY_LEN(ary);
|
len = (rb_num_t)RARRAY_LEN(ary);
|
||||||
|
|
||||||
if (flag & 0x02) {
|
if (flag & 0x02) {
|
||||||
@ -1042,7 +1043,7 @@ vm_caller_setup_args(const rb_thread_t *th, rb_control_frame_t *cfp, rb_call_inf
|
|||||||
|
|
||||||
if (UNLIKELY(ci->flag & VM_CALL_ARGS_SPLAT)) {
|
if (UNLIKELY(ci->flag & VM_CALL_ARGS_SPLAT)) {
|
||||||
VALUE ary = *(cfp->sp - 1);
|
VALUE ary = *(cfp->sp - 1);
|
||||||
VALUE *ptr;
|
const VALUE *ptr;
|
||||||
int i;
|
int i;
|
||||||
VALUE tmp;
|
VALUE tmp;
|
||||||
|
|
||||||
@ -1053,7 +1054,7 @@ vm_caller_setup_args(const rb_thread_t *th, rb_control_frame_t *cfp, rb_call_inf
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
long len = RARRAY_LEN(tmp);
|
long len = RARRAY_LEN(tmp);
|
||||||
ptr = RARRAY_PTR(tmp);
|
ptr = RARRAY_RAWPTR(tmp);
|
||||||
cfp->sp -= 1;
|
cfp->sp -= 1;
|
||||||
|
|
||||||
CHECK_VM_STACK_OVERFLOW(cfp, len);
|
CHECK_VM_STACK_OVERFLOW(cfp, len);
|
||||||
@ -2201,7 +2202,7 @@ vm_yield_setup_block_args(rb_thread_t *th, const rb_iseq_t * iseq,
|
|||||||
|
|
||||||
CHECK_VM_STACK_OVERFLOW(th->cfp, argc);
|
CHECK_VM_STACK_OVERFLOW(th->cfp, argc);
|
||||||
|
|
||||||
MEMCPY(argv, RARRAY_PTR(ary), VALUE, argc);
|
MEMCPY(argv, RARRAY_RAWPTR(ary), VALUE, argc);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* vm_push_frame current argv is at the top of sp because vm_invoke_block
|
/* vm_push_frame current argv is at the top of sp because vm_invoke_block
|
||||||
|
Loading…
x
Reference in New Issue
Block a user