From d942a9a1eef1636ebd98998f8e13dd6b9e615bea Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 3 May 2007 09:09:14 +0000 Subject: [PATCH] * vm_evalbody.ci, insns.def, vm.c, tool/insns2vm.rb (rb_num_t): renamed to get rid of name clash. [ruby-dev:30504] * yarvcore.c (ruby_thread_init): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ insns.def | 52 ++++++++++++++++++++++++------------------------ tool/insns2vm.rb | 8 ++++---- vm.c | 6 +++--- vm_evalbody.ci | 2 +- yarvcore.c | 6 +++--- 6 files changed, 44 insertions(+), 37 deletions(-) diff --git a/ChangeLog b/ChangeLog index e3da7a74ff..344b930e72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu May 3 18:10:12 2007 Nobuyoshi Nakada + + * vm_evalbody.ci, insns.def, vm.c, tool/insns2vm.rb (rb_num_t): + renamed to get rid of name clash. [ruby-dev:30504] + + * yarvcore.c (ruby_thread_init): ditto. + Wed May 2 18:52:58 2007 Koichi Sasada * vm.c, yarvcore.h, yarvcore.c, insns.def: fix to mark VM stack diff --git a/insns.def b/insns.def index 29fa67d8c6..3631ac4ebd 100644 --- a/insns.def +++ b/insns.def @@ -81,7 +81,7 @@ setlocal */ DEFINE_INSN getspecial -(num_t idx, num_t type) +(rb_num_t idx, rb_num_t type) () (VALUE val) { @@ -122,7 +122,7 @@ getspecial */ DEFINE_INSN setspecial -(num_t idx) +(rb_num_t idx) (VALUE obj) () { @@ -139,7 +139,7 @@ setspecial */ DEFINE_INSN getdynamic -(dindex_t idx, num_t level) +(dindex_t idx, rb_num_t level) () (VALUE val) { @@ -160,7 +160,7 @@ getdynamic */ DEFINE_INSN setdynamic -(dindex_t idx, num_t level) +(dindex_t idx, rb_num_t level) (VALUE val) () { @@ -406,7 +406,7 @@ putstring */ DEFINE_INSN concatstrings -(num_t num) +(rb_num_t num) (...) (VALUE val) // inc += 1 - num; { @@ -442,7 +442,7 @@ tostring */ DEFINE_INSN toregexp -(num_t flag) +(rb_num_t flag) (VALUE str) (VALUE val) { @@ -456,7 +456,7 @@ toregexp */ DEFINE_INSN newarray -(num_t num) +(rb_num_t num) (...) (VALUE val) // inc += 1 - num; { @@ -489,7 +489,7 @@ duparray */ DEFINE_INSN expandarray -(num_t num, num_t flag) +(rb_num_t num, rb_num_t flag) (..., VALUE ary) (...) // inc += (num > 0) ? num - 1 + (flag ? 1 : 0) : num + 1 - (flag ? 1 : 0); { @@ -650,7 +650,7 @@ checkincludearray */ DEFINE_INSN newhash -(num_t num) +(rb_num_t num) (...) (VALUE val) // inc += 1 - num; { @@ -673,7 +673,7 @@ newhash */ DEFINE_INSN newrange -(num_t flag) +(rb_num_t flag) (VALUE low, VALUE high) (VALUE val) { @@ -740,7 +740,7 @@ dup */ DEFINE_INSN dupn -(num_t n) +(rb_num_t n) (...) (...) // inc += n; { @@ -788,7 +788,7 @@ reput */ DEFINE_INSN topn -(num_t n) +(rb_num_t n) (...) (VALUE val) // inc += 1; { @@ -802,7 +802,7 @@ topn */ DEFINE_INSN setn -(num_t n) +(rb_num_t n) (..., VALUE val) (VALUE val) // inc += 0 { @@ -835,7 +835,7 @@ emptstack */ DEFINE_INSN definemethod -(ID id, ISEQ body, num_t is_singleton) +(ID id, ISEQ body, rb_num_t is_singleton) (VALUE obj) () { @@ -888,7 +888,7 @@ undef */ DEFINE_INSN defined -(num_t type, VALUE obj, VALUE needstr) +(rb_num_t type, VALUE obj, VALUE needstr) (VALUE v) (VALUE val) { @@ -1019,7 +1019,7 @@ postexe */ DEFINE_INSN trace -(num_t nf) +(rb_num_t nf) () () { @@ -1042,7 +1042,7 @@ trace */ DEFINE_INSN defineclass -(ID id, ISEQ klass_iseq, num_t define_type) +(ID id, ISEQ klass_iseq, rb_num_t define_type) (VALUE cbase, VALUE super) (VALUE val) { @@ -1145,7 +1145,7 @@ defineclass */ DEFINE_INSN send -(ID op_id, num_t op_argc, ISEQ blockiseq, num_t op_flag, IC ic) +(ID op_id, rb_num_t op_argc, ISEQ blockiseq, rb_num_t op_flag, IC ic) (...) (VALUE val) // inc += - (op_argc + ((op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? 1 : 0)); { @@ -1153,8 +1153,8 @@ send VALUE recv; VALUE klass; rb_block_t *blockptr = 0; - num_t num = op_argc; - num_t flag = op_flag; + rb_num_t num = op_argc; + rb_num_t flag = op_flag; ID id = op_id; macro_eval_setup_send_arguments(num, blockptr, flag, blockiseq); @@ -1287,7 +1287,7 @@ send */ DEFINE_INSN invokesuper -(num_t op_argc, ISEQ blockiseq, num_t flag) +(rb_num_t op_argc, ISEQ blockiseq, rb_num_t flag) (...) (VALUE val) // inc += - op_argc; { @@ -1312,7 +1312,7 @@ invokesuper */ DEFINE_INSN invokeblock -(num_t num, num_t flag) +(rb_num_t num, rb_num_t flag) (...) (VALUE val) // inc += 1 - num; { @@ -1414,13 +1414,13 @@ finish */ DEFINE_INSN throw -(num_t throw_state) +(rb_num_t throw_state) (VALUE throwobj) (VALUE val) { - num_t state = throw_state & 0xff; - num_t flag = throw_state & 0x8000; - num_t level = throw_state >> 16; + rb_num_t state = throw_state & 0xff; + rb_num_t flag = throw_state & 0x8000; + rb_num_t level = throw_state >> 16; val = Qnil; /* dummy */ if (state != 0) { diff --git a/tool/insns2vm.rb b/tool/insns2vm.rb index 4fecf0a701..57d282bd67 100644 --- a/tool/insns2vm.rb +++ b/tool/insns2vm.rb @@ -135,12 +135,12 @@ class InsnsDef ret = "int inc = 0;\n" @opes.each_with_index{|(t, v), i| - if t == 'num_t' + if t == 'rb_num_t' ret << " unsigned long #{v} = FIX2INT(opes[#{i}]);\n" end } @defopes.each_with_index{|((t, var), val), i| - if t == 'num_t' && val != '*' + if t == 'rb_num_t' && val != '*' ret << " unsigned long #{var} = #{val};\n" end } @@ -916,7 +916,7 @@ class InsnsDef case op when /^OFFSET/ "TS_OFFSET" - when /^num_t/ + when /^rb_num_t/ "TS_NUM" when /^lindex_t/ "TS_LINDEX" @@ -1037,7 +1037,7 @@ class InsnsDef val = op[1] case type - when /^long/, /^num_t/, /^lindex_t/, /^dindex_t/ + when /^long/, /^rb_num_t/, /^lindex_t/, /^dindex_t/ "INT2FIX(#{val})" when /^VALUE/ val diff --git a/vm.c b/vm.c index c8e43d974f..d1a0b34e37 100644 --- a/vm.c +++ b/vm.c @@ -30,11 +30,11 @@ VALUE rb_cEnv; #define EVALBODY_HELPER_FUNCTION static inline -typedef unsigned long num_t; +typedef unsigned long rb_num_t; typedef unsigned long lindex_t; typedef unsigned long dindex_t; -typedef num_t GENTRY; +typedef rb_num_t GENTRY; void vm_analysis_operand(int insn, int n, VALUE op); void vm_analysis_register(int reg, int isset); @@ -1263,7 +1263,7 @@ eval_get_cvar_base(rb_thread_t *th, rb_iseq_t *iseq) EVALBODY_HELPER_FUNCTION void eval_define_method(rb_thread_t *th, VALUE obj, - ID id, rb_iseq_t *miseq, num_t is_singleton, NODE *cref) + ID id, rb_iseq_t *miseq, rb_num_t is_singleton, NODE *cref) { NODE *newbody; int noex = cref->nd_visi; diff --git a/vm_evalbody.ci b/vm_evalbody.ci index 2afe40df0a..3497ac7ff1 100644 --- a/vm_evalbody.ci +++ b/vm_evalbody.ci @@ -78,7 +78,7 @@ th_eval(rb_thread_t *th, VALUE initial) ID tmp_id; rb_block_t *tmp_blockptr; - num_t tmp_num; + rb_num_t tmp_num; #if OPT_TOKEN_THREADED_CODE || OPT_DIRECT_THREADED_CODE #include "vmtc.inc" diff --git a/yarvcore.c b/yarvcore.c index 883ae8252d..47d1a41330 100644 --- a/yarvcore.c +++ b/yarvcore.c @@ -359,7 +359,7 @@ th_init(rb_thread_t *th) extern VALUE ruby_top_self; static VALUE -thread_init(VALUE self) +ruby_thread_init(VALUE self) { rb_thread_t *th; rb_vm_t *vm = GET_THREAD()->vm; @@ -378,7 +378,7 @@ VALUE rb_thread_alloc(VALUE klass) { VALUE self = thread_alloc(klass); - thread_init(self); + ruby_thread_init(self); return self; } @@ -463,7 +463,7 @@ Init_VM(void) /* ::Thread */ rb_cThread = rb_define_class("Thread", rb_cObject); rb_undef_alloc_func(rb_cThread); - rb_define_method(rb_cThread, "initialize", thread_init, 0); + rb_define_method(rb_cThread, "initialize", ruby_thread_init, 0); /* ::VM::USAGE_ANALISYS_* */ rb_define_const(rb_cVM, "USAGE_ANALISYS_INSN", rb_hash_new());