mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
593cf11adb
commit
31f21aed2c
1 changed files with 72 additions and 72 deletions
|
@ -1,72 +1,72 @@
|
||||||
|
|
||||||
puts <<EOS
|
puts <<EOS
|
||||||
#if 1 /* enable or disable this optimization */
|
#if 1 /* enable or disable this optimization */
|
||||||
|
|
||||||
/* DO NOT EDIT THIS FILE DIRECTLY
|
/* DO NOT EDIT THIS FILE DIRECTLY
|
||||||
*
|
*
|
||||||
* This file is enerated by tool/mkcall_iseq.rb
|
* This file is enerated by tool/mkcall_iseq.rb
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
P = (0..3)
|
P = (0..3)
|
||||||
L = (1..6)
|
L = (1..6)
|
||||||
|
|
||||||
def fname param, local
|
def fname param, local
|
||||||
"vm_call_iseq_setup_normal_0start_#{param}params_#{local}locals"
|
"vm_call_iseq_setup_normal_0start_#{param}params_#{local}locals"
|
||||||
end
|
end
|
||||||
|
|
||||||
P.each{|param|
|
P.each{|param|
|
||||||
L.each{|local|
|
L.each{|local|
|
||||||
puts <<EOS
|
puts <<EOS
|
||||||
static VALUE
|
static VALUE
|
||||||
#{fname(param, local)}(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc)
|
#{fname(param, local)}(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc)
|
||||||
{
|
{
|
||||||
return vm_call_iseq_setup_normal(th, cfp, calling, ci, cc, 0, #{param}, #{local});
|
return vm_call_iseq_setup_normal(th, cfp, calling, ci, cc, 0, #{param}, #{local});
|
||||||
}
|
}
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
#
|
#
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
puts <<EOS
|
puts <<EOS
|
||||||
/* vm_call_iseq_handlers[param][local] */
|
/* vm_call_iseq_handlers[param][local] */
|
||||||
static const vm_call_handler vm_call_iseq_handlers[][#{L.to_a.size}] = {
|
static const vm_call_handler vm_call_iseq_handlers[][#{L.to_a.size}] = {
|
||||||
#{P.map{|param| '{' + L.map{|local| fname(param, local)}.join(",\n ") + '}'}.join(",\n")}
|
#{P.map{|param| '{' + L.map{|local| fname(param, local)}.join(",\n ") + '}'}.join(",\n")}
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline vm_call_handler
|
static inline vm_call_handler
|
||||||
vm_call_iseq_setup_func(const struct rb_call_info *ci, const int param_size, const int local_size)
|
vm_call_iseq_setup_func(const struct rb_call_info *ci, const int param_size, const int local_size)
|
||||||
{
|
{
|
||||||
if (UNLIKELY(ci->flag & VM_CALL_TAILCALL)) {
|
if (UNLIKELY(ci->flag & VM_CALL_TAILCALL)) {
|
||||||
return vm_call_iseq_setup_tailcall_0start;
|
return vm_call_iseq_setup_tailcall_0start;
|
||||||
}
|
}
|
||||||
else if (0) { /* to disable optimize */
|
else if (0) { /* to disable optimize */
|
||||||
return vm_call_iseq_setup_normal_0start;
|
return vm_call_iseq_setup_normal_0start;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (param_size <= #{P.end} &&
|
if (param_size <= #{P.end} &&
|
||||||
local_size <= #{L.end}) {
|
local_size <= #{L.end}) {
|
||||||
VM_ASSERT(local_size != 0);
|
VM_ASSERT(local_size != 0);
|
||||||
return vm_call_iseq_handlers[param_size][local_size-1];
|
return vm_call_iseq_handlers[param_size][local_size-1];
|
||||||
}
|
}
|
||||||
return vm_call_iseq_setup_normal_0start;
|
return vm_call_iseq_setup_normal_0start;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
||||||
static inline vm_call_handler
|
static inline vm_call_handler
|
||||||
vm_call_iseq_setup_func(const struct rb_call_info *ci, struct rb_call_cache *cc)
|
vm_call_iseq_setup_func(const struct rb_call_info *ci, struct rb_call_cache *cc)
|
||||||
{
|
{
|
||||||
if (UNLIKELY(ci->flag & VM_CALL_TAILCALL)) {
|
if (UNLIKELY(ci->flag & VM_CALL_TAILCALL)) {
|
||||||
return vm_call_iseq_setup_tailcall_0start;
|
return vm_call_iseq_setup_tailcall_0start;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return vm_call_iseq_setup_normal_0start;
|
return vm_call_iseq_setup_normal_0start;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
EOS
|
EOS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue