From f2f08335df6a84ad82bba9defe7e5f3e7cfd8d55 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 20 Aug 2007 14:17:16 +0000 Subject: * vm_core.h (struct rb_thread_struct): removed first_func_arg and reuse first_args instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ thread.c | 9 ++++----- version.h | 6 +++--- vm.c | 11 +++++------ vm_core.h | 1 - 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c4ff64fe8..e9e3ab2d45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Aug 20 23:17:14 2007 Nobuyoshi Nakada + + * vm_core.h (struct rb_thread_struct): removed first_func_arg and + reuse first_args instead. + Sun Aug 19 13:31:40 2007 Tanaka Akira * gc.c: use VALGRIND_MAKE_MEM_UNDEFINED to detect use of collected diff --git a/thread.c b/thread.c index aec4340d5e..9a20254c6a 100644 --- a/thread.c +++ b/thread.c @@ -321,7 +321,7 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s RARRAY_LEN(args), RARRAY_PTR(args)); } else { - th->value = (*th->first_func)(th->first_func_arg); + th->value = (*th->first_func)((void *)th->first_args); } }); } @@ -365,7 +365,7 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s } static VALUE -thread_create_core(VALUE klass, VALUE args, VALUE (*fn)(ANYARGS), void *arg) +thread_create_core(VALUE klass, VALUE args, VALUE (*fn)(ANYARGS)) { rb_thread_t *th; VALUE thval; @@ -378,7 +378,6 @@ thread_create_core(VALUE klass, VALUE args, VALUE (*fn)(ANYARGS), void *arg) th->first_args = args; th->first_proc = fn ? Qfalse : rb_block_proc(); th->first_func = fn; - th->first_func_arg = arg; th->priority = GET_THREAD()->priority; @@ -402,13 +401,13 @@ thread_create_core(VALUE klass, VALUE args, VALUE (*fn)(ANYARGS), void *arg) static VALUE thread_s_new(VALUE klass, VALUE args) { - return thread_create_core(klass, args, 0, 0); + return thread_create_core(klass, args, 0); } VALUE rb_thread_create(VALUE (*fn)(ANYARGS), void *arg) { - return thread_create_core(rb_cThread, 0, fn, arg); + return thread_create_core(rb_cThread, (VALUE)arg, fn); } diff --git a/version.h b/version.h index 4393d5083c..b1b9795b5a 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2007-08-19" +#define RUBY_RELEASE_DATE "2007-08-20" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20070819 +#define RUBY_RELEASE_CODE 20070820 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_MONTH 8 -#define RUBY_RELEASE_DAY 19 +#define RUBY_RELEASE_DAY 20 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; diff --git a/vm.c b/vm.c index c87017814d..e09497dd49 100644 --- a/vm.c +++ b/vm.c @@ -180,7 +180,7 @@ check_env_value(VALUE envval) if (check_env(env)) { return envval; } - rb_bug("invalid env\n"); + rb_bug("invalid env"); return Qnil; /* unreachable */ } @@ -209,8 +209,7 @@ vm_make_env_each(rb_thread_t *th, rb_control_frame_t *cfp, pcfp++; if (pcfp->dfp == 0) { SDR(); - printf("[BUG] orz\n"); - exit(0); + rb_bug("invalid dfp"); } } penvval = vm_make_env_each(th, pcfp, penvptr, endptr); @@ -485,7 +484,7 @@ vm_call0(rb_thread_t *th, VALUE klass, VALUE recv, break; } default: - rb_bug("unsupported: vm_call0"); + rb_bug("unsupported: vm_call0(%s)", ruby_node_name(nd_type(body))); } RUBY_VM_CHECK_INTS(); return val; @@ -501,7 +500,7 @@ vm_call_super(rb_thread_t *th, int argc, const VALUE *argv) int nosuper = 0; rb_control_frame_t *cfp = th->cfp; - if (!th->cfp->iseq) { + if (!cfp->iseq) { klass = cfp->method_klass; klass = RCLASS(klass)->super; @@ -1572,7 +1571,7 @@ rb_thread_mark(void *ptr) /* mark ruby objects */ RUBY_MARK_UNLESS_NULL(th->first_proc); - RUBY_MARK_UNLESS_NULL(th->first_args); + if (th->first_proc) RUBY_MARK_UNLESS_NULL(th->first_args); RUBY_MARK_UNLESS_NULL(th->thgroup); RUBY_MARK_UNLESS_NULL(th->value); diff --git a/vm_core.h b/vm_core.h index 2fd42df856..80d3b3e586 100644 --- a/vm_core.h +++ b/vm_core.h @@ -447,7 +447,6 @@ struct rb_thread_struct VALUE first_proc; VALUE first_args; VALUE (*first_func)(ANYARGS); - void *first_func_arg; /* for GC */ VALUE *machine_stack_start; -- cgit v1.2.3