mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* vm_core.h (rb_num_t): moved form vm.h.
* tool/instruction.rb (RubyVM::Instruction#sp_increase_c_expr), tool/instruction.rb (RubyVM::VmBodyGenerator#make_header_operands): omit unused variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
39a86bf60a
commit
59432db7f7
4 changed files with 19 additions and 6 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Fri May 23 12:23:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* vm_core.h (rb_num_t): moved form vm.h.
|
||||||
|
|
||||||
|
* tool/instruction.rb (RubyVM::Instruction#sp_increase_c_expr),
|
||||||
|
tool/instruction.rb (RubyVM::VmBodyGenerator#make_header_operands):
|
||||||
|
omit unused variables.
|
||||||
|
|
||||||
Fri May 23 06:15:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri May 23 06:15:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* iseq.c (rb_iseq_compile_with_option): get rid of segv.
|
* iseq.c (rb_iseq_compile_with_option): get rid of segv.
|
||||||
|
|
|
@ -66,13 +66,14 @@ module RubyVM
|
||||||
ret = "int inc = 0;\n"
|
ret = "int inc = 0;\n"
|
||||||
|
|
||||||
@opes.each_with_index{|(t, v), i|
|
@opes.each_with_index{|(t, v), i|
|
||||||
if t == 'rb_num_t'
|
if t == 'rb_num_t' && ((re = /\b#{v}\b/n) =~ @sp_inc ||
|
||||||
ret << " unsigned long #{v} = FIX2INT(opes[#{i}]);\n"
|
@defopes.any?{|t, val| re =~ val})
|
||||||
|
ret << " #{t} #{v} = FIX2INT(opes[#{i}]);\n"
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
@defopes.each_with_index{|((t, var), val), i|
|
@defopes.each_with_index{|((t, var), val), i|
|
||||||
if t == 'rb_num_t' && val != '*'
|
if t == 'rb_num_t' && val != '*' && /\b#{var}\b/ =~ @sp_inc
|
||||||
ret << " unsigned long #{var} = #{val};\n"
|
ret << " #{t} #{var} = #{val};\n"
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -707,7 +708,10 @@ module RubyVM
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
ops << " #{type} #{var} = (#{type})GET_OPERAND(#{i+1});"
|
re = /\b#{var}\b/n
|
||||||
|
if re =~ insn.body or re =~ insn.sp_inc or insn.rets.any?{|t, v| re =~ v}
|
||||||
|
ops << " #{type} #{var} = (#{type})GET_OPERAND(#{i+1});"
|
||||||
|
end
|
||||||
n += 1
|
n += 1
|
||||||
}
|
}
|
||||||
@opn = n
|
@opn = n
|
||||||
|
|
1
vm.h
1
vm.h
|
@ -13,7 +13,6 @@
|
||||||
#define RUBY_VM_H
|
#define RUBY_VM_H
|
||||||
|
|
||||||
typedef long OFFSET;
|
typedef long OFFSET;
|
||||||
typedef unsigned long rb_num_t;
|
|
||||||
typedef unsigned long lindex_t;
|
typedef unsigned long lindex_t;
|
||||||
typedef unsigned long dindex_t;
|
typedef unsigned long dindex_t;
|
||||||
typedef rb_num_t GENTRY;
|
typedef rb_num_t GENTRY;
|
||||||
|
|
|
@ -88,6 +88,8 @@
|
||||||
#define UNLIKELY(x) (x)
|
#define UNLIKELY(x) (x)
|
||||||
#endif /* __GNUC__ >= 3 */
|
#endif /* __GNUC__ >= 3 */
|
||||||
|
|
||||||
|
typedef unsigned long rb_num_t;
|
||||||
|
|
||||||
#define ISEQ_TYPE_TOP INT2FIX(1)
|
#define ISEQ_TYPE_TOP INT2FIX(1)
|
||||||
#define ISEQ_TYPE_METHOD INT2FIX(2)
|
#define ISEQ_TYPE_METHOD INT2FIX(2)
|
||||||
#define ISEQ_TYPE_BLOCK INT2FIX(3)
|
#define ISEQ_TYPE_BLOCK INT2FIX(3)
|
||||||
|
|
Loading…
Add table
Reference in a new issue