mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
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
This commit is contained in:
parent
9eb12e0191
commit
a5200c59e4
3 changed files with 33 additions and 3 deletions
13
ChangeLog
13
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>
|
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
|
* string.c (rb_str_justify): fixed the case a fill size is a
|
||||||
|
|
21
iseq.c
21
iseq.c
|
@ -23,6 +23,22 @@ VALUE rb_cISeq;
|
||||||
|
|
||||||
#define hidden_obj_p(obj) (!SPECIAL_CONST_P(obj) && !RBASIC(obj)->klass)
|
#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
|
static void
|
||||||
compile_data_free(struct iseq_compile_data *compile_data)
|
compile_data_free(struct iseq_compile_data *compile_data)
|
||||||
{
|
{
|
||||||
|
@ -714,6 +730,7 @@ insn_operand_intern(rb_iseq_t *iseq,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
op = obj_resurrect(op);
|
||||||
ret = rb_inspect(op);
|
ret = rb_inspect(op);
|
||||||
if (CLASS_OF(op) == rb_cISeq) {
|
if (CLASS_OF(op) == rb_cISeq) {
|
||||||
rb_ary_push(child, op);
|
rb_ary_push(child, op);
|
||||||
|
@ -1015,7 +1032,7 @@ exception_type2symbol(VALUE type)
|
||||||
static int
|
static int
|
||||||
cdhash_each(VALUE key, VALUE value, VALUE ary)
|
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);
|
rb_ary_push(ary, value);
|
||||||
return ST_CONTINUE;
|
return ST_CONTINUE;
|
||||||
}
|
}
|
||||||
|
@ -1145,7 +1162,7 @@ iseq_data_to_ary(rb_iseq_t *iseq)
|
||||||
rb_ary_push(ary, INT2FIX(*seq));
|
rb_ary_push(ary, INT2FIX(*seq));
|
||||||
break;
|
break;
|
||||||
case TS_VALUE:
|
case TS_VALUE:
|
||||||
rb_ary_push(ary, *seq);
|
rb_ary_push(ary, obj_resurrect(*seq));
|
||||||
break;
|
break;
|
||||||
case TS_ISEQ:
|
case TS_ISEQ:
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#define RUBY_VERSION "1.9.1"
|
#define RUBY_VERSION "1.9.1"
|
||||||
#define RUBY_PATCHLEVEL 419
|
#define RUBY_PATCHLEVEL 420
|
||||||
#define RUBY_VERSION_MAJOR 1
|
#define RUBY_VERSION_MAJOR 1
|
||||||
#define RUBY_VERSION_MINOR 9
|
#define RUBY_VERSION_MINOR 9
|
||||||
#define RUBY_VERSION_TEENY 1
|
#define RUBY_VERSION_TEENY 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue