summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-04 03:49:43 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-04 03:49:43 +0000
commita5200c59e41685b68728f8c65a64a8c436b6c9af (patch)
tree4a32a4fd223657b55bd7f35eb5dd174ea8ed8434
parent9eb12e0191907a5684f98cbc948417243729efc9 (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@26570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog13
-rw-r--r--iseq.c21
-rw-r--r--version.h2
3 files changed, 33 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 2b7247a81b..188138d7a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Thu Feb 26 13:23:20 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * iseq.c (cdhash_each): resurrects internal literals.
+
+Wed Feb 18 14:33:35 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* string.c (rb_str_justify): fixed the case a fill size is a
diff --git a/iseq.c b/iseq.c
index 3f9bcdd686..c069b302fe 100644
--- a/iseq.c
+++ b/iseq.c
@@ -23,6 +23,22 @@ VALUE rb_cISeq;
#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 @@ insn_operand_intern(rb_iseq_t *iseq,
break;
}
}
+ op = obj_resurrect(op);
ret = rb_inspect(op);
if (CLASS_OF(op) == rb_cISeq) {
rb_ary_push(child, op);
@@ -1015,7 +1032,7 @@ exception_type2symbol(VALUE type)
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 @@ iseq_data_to_ary(rb_iseq_t *iseq)
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:
{
diff --git a/version.h b/version.h
index be3022b351..a4be85505a 100644
--- a/version.h
+++ b/version.h
@@ -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