* 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
This commit is contained in:
ko1 2009-07-16 00:01:06 +00:00
Родитель d4628c0bcd
Коммит 94664d6d0c
8 изменённых файлов: 26 добавлений и 24 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Thu Jul 16 08:59:22 2009 Koichi Sasada <ko1@atdot.net>
* 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 <ko1@atdot.net>
* vm_method.c: separate clearing cache entry code.

Просмотреть файл

@ -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));
}

Просмотреть файл

@ -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;

4
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;

12
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 */

Просмотреть файл

@ -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

Просмотреть файл

@ -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)

Просмотреть файл

@ -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))