1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
normal 2015-07-07 07:48:25 +00:00
parent 50c0a20025
commit 2fb7e7df7f
2 changed files with 9 additions and 4 deletions

View file

@ -1,3 +1,7 @@
Tue Jul 7 16:47:30 2015 Eric Wong <e@80x24.org>
* compile.c (COMPILE_ERROR): reduce GET_THREAD() calls
Tue Jul 7 16:39:04 2015 Eric Wong <e@80x24.org>
* random.c (fill_random_bytes_syscall): return -1 for error

View file

@ -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; \
}