path: root/vm_insnhelper.h
diff options
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-11 12:49:27 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-11 12:49:27 (GMT)
commitce179b3d04e0875d7cb332f5b57c9df89bb4de07 (patch)
tree697f3a45265e184f5e9affabf530656b52b2b5c9 /vm_insnhelper.h
parentac28b985bdc2f85eada8070d40f6de9f11dab7f8 (diff)
* vm_insnhelper.h: use T_IMEMO to create THROW_DATA.
Add THROW_DATA_NEW(). * internal.h: move defnition of `struct THROW_DATA' from vm_insnhelper.h to internal.h. Rename `THROW_DATA' to `vm_throw_data'. * eval_intern.h (THROW_DATA_P): move to internal.h. THROW_DATA is no longer T_NODE, so check T_IMEMO. * gc.c (gc_mark_children): mark THROW_DATA. * vm.c: catch up these changes. * vm_eval.c: ditto. * vm_insnhelper.c: ditto. git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.h')
1 files changed, 8 insertions, 16 deletions
diff --git a/vm_insnhelper.h b/vm_insnhelper.h
index 9a3a2b1..ab72b22 100644
--- a/vm_insnhelper.h
+++ b/vm_insnhelper.h
@@ -229,46 +229,38 @@ enum vm_regan_acttype {
static VALUE make_no_method_exception(VALUE exc, const char *format,
VALUE obj, int argc, const VALUE *argv);
-struct THROW_DATA {
- VALUE flags;
- VALUE reserved;
- VALUE throw_obj;
- const rb_control_frame_t *catch_frame;
- VALUE throw_state;
-static inline struct THROW_DATA *
-NEW_THROW_DATA(VALUE val, rb_control_frame_t *cf, VALUE st)
+static inline struct vm_throw_data *
+THROW_DATA_NEW(VALUE val, rb_control_frame_t *cf, VALUE st)
- return (struct THROW_DATA *)rb_node_newnode(NODE_LIT, val, (VALUE)cf, st);
+ return (struct vm_throw_data *)rb_imemo_new(imemo_throw_data, val, (VALUE)cf, st, 0);
static inline void
-THROW_DATA_CATCH_FRAME_SET(struct THROW_DATA *obj, const rb_control_frame_t *cfp)
+THROW_DATA_CATCH_FRAME_SET(struct vm_throw_data *obj, const rb_control_frame_t *cfp)
obj->catch_frame = cfp;
static inline void
-THROW_DATA_STATE_SET(struct THROW_DATA *obj, int st)
+THROW_DATA_STATE_SET(struct vm_throw_data *obj, int st)
obj->throw_state = (VALUE)st;
static inline VALUE
-THROW_DATA_VAL(const struct THROW_DATA *obj)
+THROW_DATA_VAL(const struct vm_throw_data *obj)
return obj->throw_obj;
static inline const rb_control_frame_t *
+THROW_DATA_CATCH_FRAME(const struct vm_throw_data *obj)
return obj->catch_frame;
static int
-THROW_DATA_STATE(const struct THROW_DATA *obj)
+THROW_DATA_STATE(const struct vm_throw_data *obj)
return (int)obj->throw_state;