* internal.h, eval_intern.h: move CREF accessors.
List IMEMO supported types in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ce179b3d04
commit
48cb739119
@ -1,3 +1,9 @@
|
|||||||
|
Wed Mar 11 21:53:43 2015 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* internal.h, eval_intern.h: move CREF accessors.
|
||||||
|
|
||||||
|
List IMEMO supported types in internal.h.
|
||||||
|
|
||||||
Wed Mar 11 21:45:36 2015 Koichi Sasada <ko1@atdot.net>
|
Wed Mar 11 21:45:36 2015 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* vm_insnhelper.h: use T_IMEMO to create THROW_DATA.
|
* vm_insnhelper.h: use T_IMEMO to create THROW_DATA.
|
||||||
|
@ -203,6 +203,89 @@ enum ruby_tag_type {
|
|||||||
#define SCOPE_CHECK(f) (CREF_VISI(rb_vm_cref()) == (f))
|
#define SCOPE_CHECK(f) (CREF_VISI(rb_vm_cref()) == (f))
|
||||||
#define SCOPE_SET(f) (CREF_VISI_SET(rb_vm_cref(), (f)))
|
#define SCOPE_SET(f) (CREF_VISI_SET(rb_vm_cref(), (f)))
|
||||||
|
|
||||||
|
/* CREF operators */
|
||||||
|
|
||||||
|
#define NODE_FL_CREF_PUSHED_BY_EVAL_ (((VALUE)1)<<15)
|
||||||
|
#define NODE_FL_CREF_OMOD_SHARED_ (((VALUE)1)<<16)
|
||||||
|
|
||||||
|
static inline VALUE
|
||||||
|
CREF_CLASS(const rb_cref_t *cref)
|
||||||
|
{
|
||||||
|
return cref->klass;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
CREF_CLASS_SET(rb_cref_t *cref, VALUE klass)
|
||||||
|
{
|
||||||
|
RB_OBJ_WRITE(cref, &cref->klass, klass);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline rb_cref_t *
|
||||||
|
CREF_NEXT(const rb_cref_t *cref)
|
||||||
|
{
|
||||||
|
return cref->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
CREF_NEXT_SET(rb_cref_t *cref, const rb_cref_t *next_cref)
|
||||||
|
{
|
||||||
|
RB_OBJ_WRITE(cref, &cref->next, next_cref);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline long
|
||||||
|
CREF_VISI(const rb_cref_t *cref)
|
||||||
|
{
|
||||||
|
return (long)cref->visi;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
CREF_VISI_SET(rb_cref_t *cref, long v)
|
||||||
|
{
|
||||||
|
cref->visi = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline VALUE
|
||||||
|
CREF_REFINEMENTS(const rb_cref_t *cref)
|
||||||
|
{
|
||||||
|
return cref->refinements;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
CREF_REFINEMENTS_SET(rb_cref_t *cref, VALUE refs)
|
||||||
|
{
|
||||||
|
RB_OBJ_WRITE(cref, &cref->refinements, refs);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int
|
||||||
|
CREF_PUSHED_BY_EVAL(const rb_cref_t *cref)
|
||||||
|
{
|
||||||
|
return cref->flags & NODE_FL_CREF_PUSHED_BY_EVAL_;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
CREF_PUSHED_BY_EVAL_SET(rb_cref_t *cref)
|
||||||
|
{
|
||||||
|
cref->flags |= NODE_FL_CREF_PUSHED_BY_EVAL_;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int
|
||||||
|
CREF_OMOD_SHARED(const rb_cref_t *cref)
|
||||||
|
{
|
||||||
|
return cref->flags & NODE_FL_CREF_OMOD_SHARED_;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
CREF_OMOD_SHARED_SET(rb_cref_t *cref)
|
||||||
|
{
|
||||||
|
cref->flags |= NODE_FL_CREF_OMOD_SHARED_;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
CREF_OMOD_SHARED_UNSET(rb_cref_t *cref)
|
||||||
|
{
|
||||||
|
cref->flags &= ~NODE_FL_CREF_OMOD_SHARED_;
|
||||||
|
}
|
||||||
|
|
||||||
void rb_thread_cleanup(void);
|
void rb_thread_cleanup(void);
|
||||||
void rb_thread_wait_other_threads(void);
|
void rb_thread_wait_other_threads(void);
|
||||||
|
|
||||||
|
81
internal.h
81
internal.h
@ -555,87 +555,6 @@ typedef struct rb_cref_struct {
|
|||||||
struct rb_cref_struct * const next;
|
struct rb_cref_struct * const next;
|
||||||
} rb_cref_t;
|
} rb_cref_t;
|
||||||
|
|
||||||
#define NODE_FL_CREF_PUSHED_BY_EVAL_ (((VALUE)1)<<15)
|
|
||||||
#define NODE_FL_CREF_OMOD_SHARED_ (((VALUE)1)<<16)
|
|
||||||
|
|
||||||
static inline VALUE
|
|
||||||
CREF_CLASS(const rb_cref_t *cref)
|
|
||||||
{
|
|
||||||
return cref->klass;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
CREF_CLASS_SET(rb_cref_t *cref, VALUE klass)
|
|
||||||
{
|
|
||||||
RB_OBJ_WRITE(cref, &cref->klass, klass);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline rb_cref_t *
|
|
||||||
CREF_NEXT(const rb_cref_t *cref)
|
|
||||||
{
|
|
||||||
return cref->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
CREF_NEXT_SET(rb_cref_t *cref, const rb_cref_t *next_cref)
|
|
||||||
{
|
|
||||||
RB_OBJ_WRITE(cref, &cref->next, next_cref);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline long
|
|
||||||
CREF_VISI(const rb_cref_t *cref)
|
|
||||||
{
|
|
||||||
return (long)cref->visi;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
CREF_VISI_SET(rb_cref_t *cref, long v)
|
|
||||||
{
|
|
||||||
cref->visi = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline VALUE
|
|
||||||
CREF_REFINEMENTS(const rb_cref_t *cref)
|
|
||||||
{
|
|
||||||
return cref->refinements;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
CREF_REFINEMENTS_SET(rb_cref_t *cref, VALUE refs)
|
|
||||||
{
|
|
||||||
RB_OBJ_WRITE(cref, &cref->refinements, refs);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int
|
|
||||||
CREF_PUSHED_BY_EVAL(const rb_cref_t *cref)
|
|
||||||
{
|
|
||||||
return cref->flags & NODE_FL_CREF_PUSHED_BY_EVAL_;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
CREF_PUSHED_BY_EVAL_SET(rb_cref_t *cref)
|
|
||||||
{
|
|
||||||
cref->flags |= NODE_FL_CREF_PUSHED_BY_EVAL_;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int
|
|
||||||
CREF_OMOD_SHARED(const rb_cref_t *cref)
|
|
||||||
{
|
|
||||||
return cref->flags & NODE_FL_CREF_OMOD_SHARED_;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
CREF_OMOD_SHARED_SET(rb_cref_t *cref)
|
|
||||||
{
|
|
||||||
cref->flags |= NODE_FL_CREF_OMOD_SHARED_;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
CREF_OMOD_SHARED_UNSET(rb_cref_t *cref)
|
|
||||||
{
|
|
||||||
cref->flags &= ~NODE_FL_CREF_OMOD_SHARED_;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* SVAR */
|
/* SVAR */
|
||||||
|
|
||||||
struct vm_svar {
|
struct vm_svar {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user