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

* vm_opts.h: enable optimization - operand unifications.

Operand unification technique enable to combine
  an instruction and specific operands and make new
  instruction.
* defs/opt_operand.def: add several configuration
  of operand unifications.
* insns.def: use `int' instead to suppress warning.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2012-12-04 04:57:50 +00:00
parent 51ee08fd71
commit d3842de5c9
4 changed files with 27 additions and 50 deletions

View file

@ -1,3 +1,15 @@
Tue Dec 04 13:55:07 2012 Koichi Sasada <ko1@atdot.net>
* vm_opts.h: enable optimization - operand unifications.
Operand unification technique enable to combine
an instruction and specific operands and make new
instruction.
* defs/opt_operand.def: add several configuration
of operand unifications.
* insns.def: use `int' instead to suppress warning.
Mon Dec 3 17:58:53 2012 NARUSE, Yui <naruse@ruby-lang.org> Mon Dec 3 17:58:53 2012 NARUSE, Yui <naruse@ruby-lang.org>
* parse.y: replase parser->enc with current_enc. * parse.y: replase parser->enc with current_enc.

View file

@ -7,53 +7,16 @@
# wildcard: * # wildcard: *
# #
__END__ getlocal *, 0
getlocal *, 1
getlocal 2 setlocal *, 0
getlocal 3 setlocal *, 1
getlocal 4
setlocal 2
setlocal 3
setlocal 4
getdynamic *, 0
getdynamic 1, 0
getdynamic 2, 0
getdynamic 3, 0
getdynamic 4, 0
setdynamic *, 0
setdynamic 1, 0
setdynamic 2, 0
setdynamic 3, 0
setdynamic 4, 0
putobject INT2FIX(0) putobject INT2FIX(0)
putobject INT2FIX(1) putobject INT2FIX(1)
putobject Qtrue
putobject Qfalse
# CALL
send *, *, Qfalse, 0, *
send *, 0, Qfalse, 0, *
send *, 1, Qfalse, 0, *
send *, 2, Qfalse, 0, *
send *, 3, Qfalse, 0, *
# FCALL
send *, *, Qfalse, 0x04, *
send *, 0, Qfalse, 0x04, *
send *, 1, Qfalse, 0x04, *
send *, 2, Qfalse, 0x04, *
send *, 3, Qfalse, 0x04, *
# VCALL
send *, 0, Qfalse, 0x0c, *
__END__ __END__
putobject Qtrue
putobject Qfalse

View file

@ -57,10 +57,11 @@ getlocal
() ()
(VALUE val) (VALUE val)
{ {
rb_num_t i; int i, lev = (int)level;
VALUE *ep = GET_EP(); VALUE *ep = GET_EP();
for (i = 0; i < level; i++) {
ep = GET_PREV_EP(ep); for (i = 0; i < lev; i++) {
ep = GET_PREV_EP(ep);
} }
val = *(ep - idx); val = *(ep - idx);
} }
@ -78,9 +79,10 @@ setlocal
(VALUE val) (VALUE val)
() ()
{ {
rb_num_t i; int i, lev = (int)level;
VALUE *ep = GET_EP(); VALUE *ep = GET_EP();
for (i = 0; i < level; i++) {
for (i = 0; i < lev; i++) {
ep = GET_PREV_EP(ep); ep = GET_PREV_EP(ep);
} }
*(ep - idx) = val; *(ep - idx) = val;

View file

@ -41,7 +41,7 @@
#define OPT_BLOCKINLINING 0 #define OPT_BLOCKINLINING 0
/* architecture independent, affects generated code */ /* architecture independent, affects generated code */
#define OPT_OPERANDS_UNIFICATION 0 #define OPT_OPERANDS_UNIFICATION 1
#define OPT_INSTRUCTIONS_UNIFICATION 0 #define OPT_INSTRUCTIONS_UNIFICATION 0
#define OPT_UNIFY_ALL_COMBINATION 0 #define OPT_UNIFY_ALL_COMBINATION 0
#define OPT_STACK_CACHING 0 #define OPT_STACK_CACHING 0
@ -50,7 +50,7 @@
#define SUPPORT_JOKE 0 #define SUPPORT_JOKE 0
#ifndef VM_COLLECT_USAGE_DETAILS #ifndef VM_COLLECT_USAGE_DETAILS
#define VM_COLLECT_USAGE_DETAILS 0 #define VM_COLLECT_USAGE_DETAILS 0
#endif #endif
#endif /* RUBY_VM_OPTS_H */ #endif /* RUBY_VM_OPTS_H */