Skip to content

Commit

Permalink
* vm.h, eval_intern.h: move some macros to eval_intern.h.
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ko1 committed Sep 14, 2007
1 parent 8b92f5d commit d5e687b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Fri Sep 14 16:14:28 2007 Koichi Sasada <[email protected]>

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

* insnhelper.ci (vm_expandarray): should be volatile value for GC.
Expand Down
2 changes: 0 additions & 2 deletions eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 11 additions & 2 deletions eval_intern.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion eval_jump.ci
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
14 changes: 0 additions & 14 deletions vm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
Expand Down

0 comments on commit d5e687b

Please sign in to comment.