1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/template/insns_info.inc.tmpl
ko1 20d9aefccb * vm_core.h, compile.c: declare struct iseq_inline_cache_entry.
Inline cache (IC) entries are no longer GC managed object.
  IC entries are freed when ISeq is freed.
* iseq.c: fix mark, free, memsize functions for above change.
* insns.def: remove rb_gc_write_barrier().
* vm_insnhelper.c (vm_method_search): ditto.
* tool/instruction.rb, template/insns_info.inc.tmpl (insn_iclen):
  added.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-13 09:30:23 +00:00

95 lines
1.5 KiB
C

/** -*-c-*-
This file contains instruction information for yarv instruction sequence.
----
This file is auto generated by insns2vm.rb
DO NOT TOUCH!
If you want to fix something, you must edit 'template/insns_info.inc.tmpl'
or insns2vm.rb
*/
<%= insn_type_chars %>
static const char *const insn_name_info[] = {
<%= insn_names %>
};
static const char *const insn_operand_info[] = {
<%= operands_info %>
};
static const int insn_len_info[] = {
<%= operands_num_info %>
};
static const int insn_iclen_info[] = {
<%= icoperands_num_info %>
};
#ifdef USE_INSN_RET_NUM
static const int insn_stack_push_num_info[] = {
<%= stack_num_info %>
};
#endif
#ifdef USE_INSN_STACK_INCREASE
static int
insn_stack_increase(int depth, int insn, VALUE *opes)
{
switch(insn){
<%= stack_increase %>
default:
rb_bug("insn_sp_increase: unreachable");
}
return 0;
}
#endif
/* some utilities */
static int
insn_len(int insn)
{
return insn_len_info[insn];
}
static const char *
insn_name(int insn)
{
return insn_name_info[insn];
}
static const char *
insn_op_types(int insn)
{
return insn_operand_info[insn];
}
static int
insn_op_type(int insn, int pos)
{
int len = insn_len(insn) - 1;
if(pos < len){
return insn_operand_info[insn][pos];
}
else{
return 0;
}
}
#ifdef USE_INSN_RET_NUM
static int
insn_ret_num(int insn)
{
return insn_stack_push_num_info[insn];
}
#endif
#ifdef USE_INSN_ICLEN
static int
insn_iclen(int insn)
{
return insn_iclen_info[insn];
}
#endif