зеркало из https://github.com/github/ruby.git
* vm.h, eval_intern.h: move some macros to eval_intern.h.
* eval_jump.ci (rb_f_throw): fix to use NEW_THROW_OBJECT(). * eval.c (rb_f_loop): remove additional macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
8b92f5df32
Коммит
d5e687b724
|
@ -1,3 +1,11 @@
|
|||
Fri Sep 14 16:14:28 2007 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* vm.h, eval_intern.h: move some macros to eval_intern.h.
|
||||
|
||||
* eval_jump.ci (rb_f_throw): fix to use NEW_THROW_OBJECT().
|
||||
|
||||
* eval.c (rb_f_loop): remove additional macro.
|
||||
|
||||
Fri Sep 14 16:12:10 2007 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* insnhelper.ci (vm_expandarray): should be volatile value for GC.
|
||||
|
|
2
eval.c
2
eval.c
|
@ -980,8 +980,6 @@ rb_f_loop(void)
|
|||
return Qnil; /* dummy */
|
||||
}
|
||||
|
||||
#define GET_THROWOBJ_CATCH_POINT(obj) ((VALUE*)RNODE((obj))->u2.value)
|
||||
|
||||
VALUE
|
||||
rb_iterate(VALUE (*it_proc) (VALUE), VALUE data1,
|
||||
VALUE (*bl_proc) (ANYARGS), VALUE data2)
|
||||
|
|
|
@ -162,10 +162,19 @@ char *strrchr _((const char *, const char));
|
|||
#define TAG_RAISE 0x6
|
||||
#define TAG_THROW 0x7
|
||||
#define TAG_FATAL 0x8
|
||||
#define TAG_CONTCALL 0x9
|
||||
#define TAG_THREAD 0xa
|
||||
#define TAG_MASK 0xf
|
||||
|
||||
#define NEW_THROW_OBJECT(val, pt, st) \
|
||||
((VALUE)NEW_NODE(NODE_LIT, (val), (pt), (st)))
|
||||
#define SET_THROWOBJ_CATCH_POINT(obj, val) \
|
||||
(RNODE((obj))->u2.value = (val))
|
||||
#define SET_THROWOBJ_STATE(obj, val) \
|
||||
(RNODE((obj))->u3.value = (val))
|
||||
|
||||
#define GET_THROWOBJ_VAL(obj) ((VALUE)RNODE((obj))->u1.value)
|
||||
#define GET_THROWOBJ_CATCH_POINT(obj) ((VALUE*)RNODE((obj))->u2.value)
|
||||
#define GET_THROWOBJ_STATE(obj) ((int)RNODE((obj))->u3.value)
|
||||
|
||||
#define SCOPE_TEST(f) \
|
||||
(ruby_cref()->nd_visi & (f))
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ rb_f_throw(int argc, VALUE *argv)
|
|||
rb_raise(rb_eArgError, "uncaught throw %s", RSTRING_PTR(desc));
|
||||
}
|
||||
rb_trap_restore_mask();
|
||||
th->errinfo = (VALUE)rb_node_newnode(NODE_MEMO, tag, 0, TAG_THROW);
|
||||
th->errinfo = NEW_THROW_OBJECT(tag, 0, TAG_THROW);
|
||||
|
||||
JUMP_TAG(TAG_THROW);
|
||||
#ifndef __GNUC__
|
||||
|
|
14
vm.h
14
vm.h
|
@ -252,20 +252,6 @@ while (0)
|
|||
#define RUBYVM_CFUNC_FRAME_P(cfp) \
|
||||
(VM_FRAME_TYPE(cfp) == FRAME_MAGIC_CFUNC)
|
||||
|
||||
/*
|
||||
* Excception
|
||||
*/
|
||||
|
||||
#define NEW_THROW_OBJECT(val, pt, st) NEW_NODE(NODE_LIT, (val), (pt), (st))
|
||||
#define GET_THROWOBJ_VAL(obj) ((VALUE)RNODE((obj))->u1.value)
|
||||
#define GET_THROWOBJ_CATCH_POINT(obj) ((VALUE*)RNODE((obj))->u2.value)
|
||||
#define GET_THROWOBJ_STATE(obj) ((int)RNODE((obj))->u3.value)
|
||||
|
||||
#define SET_THROWOBJ_CATCH_POINT(obj, val) \
|
||||
(RNODE((obj))->u2.value = (val))
|
||||
#define SET_THROWOBJ_STATE(obj, val) \
|
||||
(RNODE((obj))->u3.value = (val))
|
||||
|
||||
#if OPT_CALL_THREADED_CODE
|
||||
#define THROW_EXCEPTION(exc) do { \
|
||||
th->errinfo = (VALUE)(exc); \
|
||||
|
|
Загрузка…
Ссылка в новой задаче