2007-02-02 10:21:41 -05:00
|
|
|
/** -*-c-*-
|
|
|
|
This file contains instruction information for yarv instruction sequence.
|
2008-12-09 02:14:13 -05:00
|
|
|
|
2007-02-02 10:21:41 -05:00
|
|
|
----
|
|
|
|
This file is auto generated by insns2vm.rb
|
|
|
|
DO NOT TOUCH!
|
2008-12-09 02:14:13 -05:00
|
|
|
|
2007-02-02 10:21:41 -05:00
|
|
|
If you want to fix something, you must edit 'template/insns_info.inc.tmpl'
|
|
|
|
or insns2vm.rb
|
|
|
|
*/
|
|
|
|
|
|
|
|
<%= insn_type_chars %>
|
|
|
|
|
2008-04-02 20:00:48 -04:00
|
|
|
static const char *const insn_name_info[] = {
|
2007-02-02 10:21:41 -05:00
|
|
|
<%= insn_names %>
|
|
|
|
};
|
|
|
|
|
2008-04-02 20:00:48 -04:00
|
|
|
static const char *const insn_operand_info[] = {
|
2007-02-02 10:21:41 -05:00
|
|
|
<%= operands_info %>
|
|
|
|
};
|
|
|
|
|
2008-04-02 20:00:48 -04:00
|
|
|
static const int insn_len_info[] = {
|
2007-02-02 10:21:41 -05:00
|
|
|
<%= operands_num_info %>
|
|
|
|
};
|
|
|
|
|
2009-07-13 05:30:23 -04:00
|
|
|
static const int insn_iclen_info[] = {
|
|
|
|
<%= icoperands_num_info %>
|
|
|
|
};
|
|
|
|
|
2007-08-23 02:48:28 -04:00
|
|
|
#ifdef USE_INSN_RET_NUM
|
2008-04-02 20:00:48 -04:00
|
|
|
static const int insn_stack_push_num_info[] = {
|
2007-02-02 10:21:41 -05:00
|
|
|
<%= stack_num_info %>
|
|
|
|
};
|
2007-08-23 02:48:28 -04:00
|
|
|
#endif
|
2007-02-02 10:21:41 -05:00
|
|
|
|
2007-08-23 02:48:28 -04:00
|
|
|
#ifdef USE_INSN_STACK_INCREASE
|
2007-02-02 10:21:41 -05:00
|
|
|
static int
|
|
|
|
insn_stack_increase(int depth, int insn, VALUE *opes)
|
|
|
|
{
|
|
|
|
switch(insn){
|
|
|
|
<%= stack_increase %>
|
|
|
|
default:
|
|
|
|
rb_bug("insn_sp_increase: unreachable");
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2007-08-23 02:48:28 -04:00
|
|
|
#endif
|
2007-02-02 10:21:41 -05:00
|
|
|
|
|
|
|
/* some utilities */
|
|
|
|
|
|
|
|
static int
|
* compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,
thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c,
vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl,
tool/instruction.rb: fixed types.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21 16:58:26 -04:00
|
|
|
insn_len(VALUE insn)
|
2007-02-02 10:21:41 -05:00
|
|
|
{
|
* compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,
thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c,
vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl,
tool/instruction.rb: fixed types.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21 16:58:26 -04:00
|
|
|
return insn_len_info[(int)insn];
|
2007-02-02 10:21:41 -05:00
|
|
|
}
|
|
|
|
|
2008-04-02 20:00:48 -04:00
|
|
|
static const char *
|
* compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,
thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c,
vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl,
tool/instruction.rb: fixed types.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21 16:58:26 -04:00
|
|
|
insn_name(VALUE insn)
|
2007-02-02 10:21:41 -05:00
|
|
|
{
|
* compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,
thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c,
vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl,
tool/instruction.rb: fixed types.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21 16:58:26 -04:00
|
|
|
return insn_name_info[(int)insn];
|
2007-02-02 10:21:41 -05:00
|
|
|
}
|
|
|
|
|
2008-04-02 20:00:48 -04:00
|
|
|
static const char *
|
* compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,
thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c,
vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl,
tool/instruction.rb: fixed types.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21 16:58:26 -04:00
|
|
|
insn_op_types(VALUE insn)
|
2007-02-02 10:21:41 -05:00
|
|
|
{
|
* compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,
thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c,
vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl,
tool/instruction.rb: fixed types.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21 16:58:26 -04:00
|
|
|
return insn_operand_info[(int)insn];
|
2007-02-02 10:21:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
* compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,
thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c,
vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl,
tool/instruction.rb: fixed types.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21 16:58:26 -04:00
|
|
|
insn_op_type(VALUE insn, long pos)
|
2007-02-02 10:21:41 -05:00
|
|
|
{
|
|
|
|
int len = insn_len(insn) - 1;
|
|
|
|
if(pos < len){
|
* compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,
thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c,
vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl,
tool/instruction.rb: fixed types.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21 16:58:26 -04:00
|
|
|
return insn_operand_info[(int)insn][pos];
|
2007-02-02 10:21:41 -05:00
|
|
|
}
|
|
|
|
else{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-08-23 02:48:28 -04:00
|
|
|
#ifdef USE_INSN_RET_NUM
|
2007-02-02 10:21:41 -05:00
|
|
|
static int
|
* compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,
thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c,
vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl,
tool/instruction.rb: fixed types.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21 16:58:26 -04:00
|
|
|
insn_ret_num(VALUE insn)
|
2007-02-02 10:21:41 -05:00
|
|
|
{
|
* compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,
thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c,
vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl,
tool/instruction.rb: fixed types.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21 16:58:26 -04:00
|
|
|
return insn_stack_push_num_info[(int)insn];
|
2007-02-02 10:21:41 -05:00
|
|
|
}
|
2007-08-23 02:48:28 -04:00
|
|
|
#endif
|
2009-07-13 05:30:23 -04:00
|
|
|
|
|
|
|
#ifdef USE_INSN_ICLEN
|
|
|
|
static int
|
|
|
|
insn_iclen(int insn)
|
|
|
|
{
|
|
|
|
return insn_iclen_info[insn];
|
|
|
|
}
|
|
|
|
#endif
|