ruby-changes:14714
From: yugui <ko1@a...>
Date: Thu, 4 Feb 2010 12:58:43 +0900 (JST)
Subject: [ruby-changes:14714] Ruby:r26570 (ruby_1_9_1): merges r22395 and r22640 from trunk into ruby_1_9_1.
yugui 2010-02-04 12:49:43 +0900 (Thu, 04 Feb 2010) New Revision: 26570 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26570 Log: merges r22395 and r22640 from trunk into ruby_1_9_1. -- * array.c (rb_ary_resurrect), string.c (rb_str_resurrect): new functions based on [ruby-dev:37983] * insns.def (putstring, duparray): use rb_{ary,str}_resurrect(). * iseq.c (iseq_data_to_ary): needs to result TS_VALUE. -- * iseq.c (cdhash_each): resurrects internal literals. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/iseq.c branches/ruby_1_9_1/version.h Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 26569) +++ ruby_1_9_1/ChangeLog (revision 26570) @@ -1,3 +1,16 @@ +Thu Feb 26 13:23:20 2009 Nobuyoshi Nakada <nobu@r...> + + * iseq.c (cdhash_each): resurrects internal literals. + +Wed Feb 18 14:33:35 2009 Nobuyoshi Nakada <nobu@r...> + + * array.c (rb_ary_resurrect), string.c (rb_str_resurrect): new + functions based on [ruby-dev:37983] + + * insns.def (putstring, duparray): use rb_{ary,str}_resurrect(). + + * iseq.c (iseq_data_to_ary): needs to result TS_VALUE. + Wed Dec 9 09:50:35 2009 Nobuyoshi Nakada <nobu@r...> * string.c (rb_str_justify): fixed the case a fill size is a Index: ruby_1_9_1/iseq.c =================================================================== --- ruby_1_9_1/iseq.c (revision 26569) +++ ruby_1_9_1/iseq.c (revision 26570) @@ -23,6 +23,22 @@ #define hidden_obj_p(obj) (!SPECIAL_CONST_P(obj) && !RBASIC(obj)->klass) +static inline VALUE +obj_resurrect(VALUE obj) +{ + if (hidden_obj_p(obj)) { + switch (BUILTIN_TYPE(obj)) { + case T_STRING: + obj = rb_str_replace(rb_str_new(0, 0), obj); + break; + case T_ARRAY: + obj = rb_ary_new4(RARRAY_LEN(obj), RARRAY_PTR(obj)); + break; + } + } + return obj; +} + static void compile_data_free(struct iseq_compile_data *compile_data) { @@ -714,6 +730,7 @@ break; } } + op = obj_resurrect(op); ret = rb_inspect(op); if (CLASS_OF(op) == rb_cISeq) { rb_ary_push(child, op); @@ -1015,7 +1032,7 @@ static int cdhash_each(VALUE key, VALUE value, VALUE ary) { - rb_ary_push(ary, key); + rb_ary_push(ary, obj_resurrect(key)); rb_ary_push(ary, value); return ST_CONTINUE; } @@ -1145,7 +1162,7 @@ rb_ary_push(ary, INT2FIX(*seq)); break; case TS_VALUE: - rb_ary_push(ary, *seq); + rb_ary_push(ary, obj_resurrect(*seq)); break; case TS_ISEQ: { Index: ruby_1_9_1/version.h =================================================================== --- ruby_1_9_1/version.h (revision 26569) +++ ruby_1_9_1/version.h (revision 26570) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.1" -#define RUBY_PATCHLEVEL 419 +#define RUBY_PATCHLEVEL 420 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/