Skip to content

Commit

Permalink
* node.h, vm_core.h, variable.c: rename global_entry to rb_global_entry.
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ko1 committed Jul 16, 2009
1 parent d4628c0 commit 94664d6
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 24 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Thu Jul 16 08:59:22 2009 Koichi Sasada <[email protected]>

* 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 <[email protected]>

* vm_method.c: separate clearing cache entry code.
Expand Down
6 changes: 3 additions & 3 deletions compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion insns.def
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions iseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
12 changes: 11 additions & 1 deletion node.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down
6 changes: 1 addition & 5 deletions variable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 0 additions & 10 deletions vm_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions vm_insnhelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit 94664d6

Please sign in to comment.