summaryrefslogtreecommitdiff
path: root/eval_intern.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-19 17:01:10 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-19 17:01:10 (GMT)
commit9d740ddebeaa46f47c9b4529e8b36d72d97f9105 (patch)
treee9de5e9569c0a30413b1fd892c13cc46f6ef0fdc /eval_intern.h
parent1eac0b55c96c2b5b98748a36ee630ef6a12b2fdb (diff)
eval_jump.c: reuse same tag
* eval_jump.c (rb_exec_end_proc): reduce number of pushing/popping and reuse same tag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_intern.h')
-rw-r--r--eval_intern.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/eval_intern.h b/eval_intern.h
index e32eafe..5802e27 100644
--- a/eval_intern.h
+++ b/eval_intern.h
@@ -104,6 +104,12 @@ extern int select_large_fdset(int, fd_set *, fd_set *, fd_set *, struct timeval
#define TH_POP_TAG2() \
_th->tag = _tag.prev
+#define TH_PUSH_TAG2() (_th->tag = &_tag, 0)
+
+#define TH_TMPPOP_TAG() TH_POP_TAG2()
+
+#define TH_REPUSH_TAG() TH_PUSH_TAG2()
+
#define PUSH_TAG() TH_PUSH_TAG(GET_THREAD())
#define POP_TAG() TH_POP_TAG()
@@ -128,7 +134,7 @@ rb_threadptr_tag_jump(rb_thread_t *th, int st)
[ISO/IEC 9899:1999] 7.13.1.1
*/
#define TH_EXEC_TAG() \
- (ruby_setjmp(_tag.buf) ? rb_threadptr_tag_state(_th) : (_th->tag = &_tag, 0))
+ (ruby_setjmp(_tag.buf) ? rb_threadptr_tag_state(_th) : TH_PUSH_TAG2())
#define EXEC_TAG() \
TH_EXEC_TAG()