From 94664d6d0cc8042e98c7256ec28a751d3e5b687c Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 16 Jul 2009 00:01:06 +0000 Subject: * node.h, vm_core.h, variable.c: rename global_entry to rb_global_entry. * compile.c, insns.def, iseq.c, vm_insnhelper.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ compile.c | 6 +++--- insns.def | 2 +- iseq.c | 4 ++-- node.h | 12 +++++++++++- variable.c | 6 +----- vm_core.h | 10 ---------- vm_insnhelper.h | 4 ++-- 8 files changed, 26 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07a8f2821c..8becef733a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Jul 16 08:59:22 2009 Koichi Sasada + + * node.h, vm_core.h, variable.c: rename global_entry to rb_global_entry. + + * compile.c, insns.def, iseq.c, vm_insnhelper.h: ditto. + Thu Jul 16 08:57:44 2009 Koichi Sasada * vm_method.c: separate clearing cache entry code. diff --git a/compile.c b/compile.c index c034ac8e9e..636ad31c4c 100644 --- a/compile.c +++ b/compile.c @@ -1447,8 +1447,8 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor) break; case TS_GENTRY: { - struct global_entry *entry = - (struct global_entry *)(operands[j] & (~1)); + struct rb_global_entry *entry = + (struct rb_global_entry *)(operands[j] & (~1)); generated_iseq[pos + 1 + j] = (VALUE)entry; } break; @@ -4975,7 +4975,7 @@ insn_data_to_s_detail(INSN *iobj) break; case TS_GENTRY: { - struct global_entry *entry = (struct global_entry *) + struct rb_global_entry *entry = (struct rb_global_entry *) (OPERAND_AT(iobj, j) & (~1)); rb_str_cat2(str, rb_id2name(entry->id)); } diff --git a/insns.def b/insns.def index f9310bec69..724f086dce 100644 --- a/insns.def +++ b/insns.def @@ -761,7 +761,7 @@ defined klass = vm_get_cbase(GET_ISEQ(), GET_LFP(), GET_DFP()); break; case DEFINED_GVAR: - if (rb_gvar_defined((struct global_entry *)(obj & ~1))) { + if (rb_gvar_defined((struct rb_global_entry *)(obj & ~1))) { expr_type = "global-variable"; } break; diff --git a/iseq.c b/iseq.c index 643e399c06..d09f397f9d 100644 --- a/iseq.c +++ b/iseq.c @@ -791,7 +791,7 @@ insn_operand_intern(rb_iseq_t *iseq, } case TS_GENTRY: { - struct global_entry *entry = (struct global_entry *)op; + struct rb_global_entry *entry = (struct rb_global_entry *)op; ret = rb_str_dup(rb_id2str(entry->id)); } break; @@ -1213,7 +1213,7 @@ iseq_data_to_ary(rb_iseq_t *iseq) break; case TS_GENTRY: { - struct global_entry *entry = (struct global_entry *)*seq; + struct rb_global_entry *entry = (struct rb_global_entry *)*seq; rb_ary_push(ary, ID2SYM(entry->id)); } break; diff --git a/node.h b/node.h index 8b77873b1a..4ad695ca60 100644 --- a/node.h +++ b/node.h @@ -252,7 +252,7 @@ typedef struct RNode { struct RNode *node; ID id; long state; - struct global_entry *entry; + struct rb_global_entry *entry; long cnt; VALUE value; } u3; @@ -463,6 +463,16 @@ NODE *rb_compile_file(const char*, VALUE, int); NODE *rb_node_newnode(enum node_type,VALUE,VALUE,VALUE); NODE *rb_node_newnode_longlife(enum node_type,VALUE,VALUE,VALUE); +struct rb_global_entry { + struct rb_global_variable *var; + ID id; +}; + +struct rb_global_entry *rb_global_entry(ID); +VALUE rb_gvar_get(struct rb_global_entry *); +VALUE rb_gvar_set(struct rb_global_entry *, VALUE); +VALUE rb_gvar_defined(struct rb_global_entry *); + #if defined(__cplusplus) #if 0 { /* satisfy cc-mode */ diff --git a/variable.c b/variable.c index 14fd4cdbdc..1d8e4133c2 100644 --- a/variable.c +++ b/variable.c @@ -289,6 +289,7 @@ rb_obj_classname(VALUE obj) } #define global_variable rb_global_variable +#define global_entry rb_global_entry #define gvar_getter_t rb_gvar_getter_t #define gvar_setter_t rb_gvar_setter_t @@ -311,11 +312,6 @@ struct global_variable { struct trace_var *trace; }; -struct global_entry { - struct global_variable *var; - ID id; -}; - #define undef_getter rb_gvar_undef_getter #define undef_setter rb_gvar_undef_setter #define undef_marker rb_gvar_undef_marker diff --git a/vm_core.h b/vm_core.h index 9ff652e57a..e838bba5dd 100644 --- a/vm_core.h +++ b/vm_core.h @@ -491,16 +491,6 @@ typedef struct { VALUE env; } rb_binding_t; -struct global_entry { - struct global_variable *var; - ID id; -}; - -struct global_entry *rb_global_entry(ID); -VALUE rb_gvar_get(struct global_entry *); -VALUE rb_gvar_set(struct global_entry *, VALUE); -VALUE rb_gvar_defined(struct global_entry *); - /* used by compile time and send insn */ #define VM_CALL_ARGS_SPLAT_BIT (0x01 << 1) #define VM_CALL_ARGS_BLOCKARG_BIT (0x01 << 2) diff --git a/vm_insnhelper.h b/vm_insnhelper.h index a96298c561..c28a72a5d8 100644 --- a/vm_insnhelper.h +++ b/vm_insnhelper.h @@ -137,8 +137,8 @@ extern VALUE ruby_vm_const_missing_count; #define GET_PREV_DFP(dfp) ((VALUE *)((dfp)[0] & ~0x03)) -#define GET_GLOBAL(entry) rb_gvar_get((struct global_entry*)entry) -#define SET_GLOBAL(entry, val) rb_gvar_set((struct global_entry*)entry, val) +#define GET_GLOBAL(entry) rb_gvar_get((struct rb_global_entry*)entry) +#define SET_GLOBAL(entry, val) rb_gvar_set((struct rb_global_entry*)entry, val) #define GET_CONST_INLINE_CACHE(dst) ((IC) * (GET_PC() + (dst) + 2)) -- cgit v1.2.3