* cont.c (cont_save_machine_stack): clear saved_thread.machine_stack*.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2007-07-03 04:53:05 +00:00
parent ee457d92c2
commit 0e5360b2e4
3 changed files with 19 additions and 10 deletions

View File

@ -1,3 +1,7 @@
Tue Jul 3 13:47:44 2007 Koichi Sasada <ko1@atdot.net>
* cont.c (cont_save_machine_stack): clear saved_thread.machine_stack*.
Mon Jul 2 21:45:53 2007 Koichi Sasada <ko1@atdot.net> Mon Jul 2 21:45:53 2007 Koichi Sasada <ko1@atdot.net>
* compile.c: rename iseq_translate_direct_threaded_code() * compile.c: rename iseq_translate_direct_threaded_code()

19
cont.c
View File

@ -95,6 +95,7 @@ static void
cont_save_machine_stack(rb_thread_t *th, rb_context_t *cont) cont_save_machine_stack(rb_thread_t *th, rb_context_t *cont)
{ {
int size; int size;
rb_thread_t *sth = &cont->saved_thread;
rb_gc_set_stack_end(&th->machine_stack_end); rb_gc_set_stack_end(&th->machine_stack_end);
#ifdef __ia64 #ifdef __ia64
@ -132,6 +133,11 @@ cont_save_machine_stack(rb_thread_t *th, rb_context_t *cont)
MEMCPY(cont->machine_register_stack, cont->machine_register_stack_src, VALUE, size); MEMCPY(cont->machine_register_stack, cont->machine_register_stack_src, VALUE, size);
#endif #endif
sth->machine_stack_start = sth->machine_stack_end = 0;
#ifdef __ia64
sth->machine_register_stack_start = sth->machine_register_stack_end = 0;
#endif
} }
static rb_context_t * static rb_context_t *
@ -139,7 +145,7 @@ cont_new(VALUE klass)
{ {
rb_context_t *cont; rb_context_t *cont;
volatile VALUE contval; volatile VALUE contval;
rb_thread_t *th = GET_THREAD(), *sth; rb_thread_t *th = GET_THREAD();
contval = Data_Make_Struct(klass, rb_context_t, contval = Data_Make_Struct(klass, rb_context_t,
cont_mark, cont_free, cont); cont_mark, cont_free, cont);
@ -150,9 +156,8 @@ cont_new(VALUE klass)
cont->self = contval; cont->self = contval;
cont->alive = Qtrue; cont->alive = Qtrue;
/* save context */ /* save thread context */
cont->saved_thread = *th; cont->saved_thread = *th;
sth = &cont->saved_thread;
return cont; return cont;
} }
@ -163,17 +168,17 @@ static VALUE
cont_capture(volatile int *stat) cont_capture(volatile int *stat)
{ {
rb_context_t *cont; rb_context_t *cont;
rb_thread_t *th; rb_thread_t *th = GET_THREAD(), *sth;
volatile VALUE contval; volatile VALUE contval;
vm_stack_to_heap(GET_THREAD()); vm_stack_to_heap(th);
cont = cont_new(rb_cCont); cont = cont_new(rb_cCont);
contval = cont->self; contval = cont->self;
th = &cont->saved_thread; sth = &cont->saved_thread;
cont->vm_stack = ALLOC_N(VALUE, th->stack_size); cont->vm_stack = ALLOC_N(VALUE, th->stack_size);
MEMCPY(cont->vm_stack, th->stack, VALUE, th->stack_size); MEMCPY(cont->vm_stack, th->stack, VALUE, th->stack_size);
th->stack = 0; sth->stack = 0;
cont_save_machine_stack(th, cont); cont_save_machine_stack(th, cont);

View File

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0" #define RUBY_VERSION "1.9.0"
#define RUBY_RELEASE_DATE "2007-07-02" #define RUBY_RELEASE_DATE "2007-07-03"
#define RUBY_VERSION_CODE 190 #define RUBY_VERSION_CODE 190
#define RUBY_RELEASE_CODE 20070702 #define RUBY_RELEASE_CODE 20070703
#define RUBY_PATCHLEVEL 0 #define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0 #define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 7 #define RUBY_RELEASE_MONTH 7
#define RUBY_RELEASE_DAY 2 #define RUBY_RELEASE_DAY 3
#ifdef RUBY_EXTERN #ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[]; RUBY_EXTERN const char ruby_version[];