From 46cdb8f18766383a9e11b5a6e9a0c010e7e8653a Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 10 Mar 2015 18:39:46 +0000 Subject: * vm_insnhelper.h: define struct THROW_DATA to represent throwing data. Also define accessor functions. * eval_intern.h: move related changes into vm_insnhelper.h. Now these MACROs (functions) are only used in vm*.c. There is only THROW_DATA_P(err) to check this data type or not. * vm.c: catch up these changes. * vm_eval.c: ditto. * vm_insnhelper.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_insnhelper.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'vm_insnhelper.c') diff --git a/vm_insnhelper.c b/vm_insnhelper.c index ccc18c5aa7..8b907bfc35 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -627,10 +627,9 @@ vm_setinstancevariable(VALUE obj, ID id, VALUE val, IC ic) } static VALUE -vm_throw_continue(rb_thread_t *th, VALUE throwobj) +vm_throw_continue(rb_thread_t *th, VALUE err) { /* continue throw */ - VALUE err = throwobj; if (FIXNUM_P(err)) { th->state = FIX2INT(err); @@ -638,8 +637,8 @@ vm_throw_continue(rb_thread_t *th, VALUE throwobj) else if (SYMBOL_P(err)) { th->state = TAG_THROW; } - else if (BUILTIN_TYPE(err) == T_NODE) { - th->state = GET_THROWOBJ_STATE(err); + else if (THROW_DATA_P(err)) { + th->state = THROW_DATA_STATE((struct THROW_DATA *)err); } else { th->state = TAG_RAISE; @@ -778,7 +777,7 @@ vm_throw_start(rb_thread_t * const th, rb_control_frame_t * const reg_cfp, int s } th->state = state; - return (VALUE)NEW_THROW_OBJECT(throwobj, (VALUE)escape_cfp, state); + return (VALUE)NEW_THROW_DATA(throwobj, escape_cfp, state); } static VALUE -- cgit v1.2.3