diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-07 07:48:25 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-07 07:48:25 +0000 |
commit | 0fa24bc77ccbba05bf4db783392c79db53c1cded (patch) | |
tree | 1489cc15c9c2a43712eb119da0bfb87c1b2721cc /compile.c | |
parent | d5ad30d225a716d05ad3cedc346a078037c11524 (diff) | |
download | ruby-0fa24bc77ccbba05bf4db783392c79db53c1cded.tar.gz |
compile.c (COMPILE_ERROR): reduce GET_THREAD() calls
Shorten a long line and reduce global variable access, giving
a minor code size reduction (at least on 32-bit x86):
text data bss dec hex filename
96807 772 48 97627 17d5b compile.orig
96775 772 48 97595 17d3b compile.o
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -287,12 +287,13 @@ r_value(VALUE value) /* error */ #define COMPILE_ERROR(strs) \ { \ - VALUE tmp = GET_THREAD()->errinfo; \ + rb_thread_t *th = GET_THREAD(); \ + VALUE tmp = th->errinfo; \ if (compile_debug) rb_compile_bug strs; \ - GET_THREAD()->errinfo = iseq->compile_data->err_info; \ + th->errinfo = iseq->compile_data->err_info; \ rb_compile_error strs; \ - RB_OBJ_WRITE(iseq->self, &iseq->compile_data->err_info, GET_THREAD()->errinfo); \ - GET_THREAD()->errinfo = tmp; \ + RB_OBJ_WRITE(iseq->self, &iseq->compile_data->err_info, th->errinfo); \ + th->errinfo = tmp; \ ret = 0; \ break; \ } |