summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--include/ruby/ruby.h3
-rw-r--r--iseq.c2
-rw-r--r--test/ruby/test_method.rb2
-rw-r--r--test/ruby/test_settracefunc.rb6
-rw-r--r--vm.c24
-rw-r--r--vm_core.h3
-rw-r--r--vm_dump.c8
8 files changed, 35 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 2812282e58..c7362733f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Mon Jun 30 02:14:34 2008 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c, vm_core.h,vm_core.h, vm_dump.c, iseq.c: rename class name
+ VM -> RubyVM, and rename rb_cVM -> rb_cRubyVM.
+ "VM" is too short name for class.
+
+ * test/ruby/test_method.rb, test/ruby/test_settracefunc.rb: ditto.
+
+ * include/ruby/ruby.h: rb_cRubyVM, rb_cEnv, rb_cISeq should not be
+ exposed.
+
Mon Jun 30 02:10:32 2008 Koichi Sasada <ko1@atdot.net>
* process.c (Init_process): fix to avoid a warning.
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 2d602d4a46..fd3f911326 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -907,9 +907,6 @@ RUBY_EXTERN VALUE rb_cThread;
RUBY_EXTERN VALUE rb_cTime;
RUBY_EXTERN VALUE rb_cTrueClass;
RUBY_EXTERN VALUE rb_cUnboundMethod;
-RUBY_EXTERN VALUE rb_cISeq;
-RUBY_EXTERN VALUE rb_cVM;
-RUBY_EXTERN VALUE rb_cEnv;
RUBY_EXTERN VALUE rb_eException;
RUBY_EXTERN VALUE rb_eStandardError;
diff --git a/iseq.c b/iseq.c
index e09c9c4ae6..24d15575e9 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1290,7 +1290,7 @@ void
Init_ISeq(void)
{
/* declare ::VM::InstructionSequence */
- rb_cISeq = rb_define_class_under(rb_cVM, "InstructionSequence", rb_cObject);
+ rb_cISeq = rb_define_class_under(rb_cRubyVM, "InstructionSequence", rb_cObject);
rb_define_alloc_func(rb_cISeq, iseq_alloc);
rb_define_method(rb_cISeq, "inspect", iseq_inspect, 0);
rb_define_method(rb_cISeq, "disasm", ruby_iseq_disasm, 0);
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index e0267d777f..8ab9a4a965 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -70,7 +70,7 @@ class TestMethod < Test::Unit::TestCase
def test_body
o = Object.new
def o.foo; end
- assert_nothing_raised { VM::InstructionSequence.disasm(o.method(:foo)) }
+ assert_nothing_raised { RubyVM::InstructionSequence.disasm(o.method(:foo)) }
end
def test_new
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb
index 1f260e003c..7ef7d3b802 100644
--- a/test/ruby/test_settracefunc.rb
+++ b/test/ruby/test_settracefunc.rb
@@ -2,15 +2,15 @@ require 'test/unit'
class TestSetTraceFunc < Test::Unit::TestCase
def setup
- @original_compile_option = VM::InstructionSequence.compile_option
- VM::InstructionSequence.compile_option = {
+ @original_compile_option = RubyVM::InstructionSequence.compile_option
+ RubyVM::InstructionSequence.compile_option = {
:trace_instruction => true,
:specialized_instruction => false
}
end
def teardown
- VM::InstructionSequence.compile_option = @original_compile_option
+ RubyVM::InstructionSequence.compile_option = @original_compile_option
end
def test_c_call
diff --git a/vm.c b/vm.c
index 775dbd59ed..680375b08a 100644
--- a/vm.c
+++ b/vm.c
@@ -21,7 +21,7 @@
#define BUFSIZE 0x100
#define PROCDEBUG 0
-VALUE rb_cVM;
+VALUE rb_cRubyVM;
VALUE rb_cThread;
VALUE rb_cEnv;
@@ -1674,11 +1674,11 @@ Init_VM(void)
VALUE opts;
/* ::VM */
- rb_cVM = rb_define_class("VM", rb_cObject);
- rb_undef_alloc_func(rb_cVM);
+ rb_cRubyVM = rb_define_class("RubyVM", rb_cObject);
+ rb_undef_alloc_func(rb_cRubyVM);
/* Env */
- rb_cEnv = rb_define_class_under(rb_cVM, "Env", rb_cObject);
+ rb_cEnv = rb_define_class_under(rb_cRubyVM, "Env", rb_cObject);
rb_undef_alloc_func(rb_cEnv);
/* ::Thread */
@@ -1686,10 +1686,10 @@ Init_VM(void)
rb_undef_alloc_func(rb_cThread);
/* ::VM::USAGE_ANALYSIS_* */
- rb_define_const(rb_cVM, "USAGE_ANALYSIS_INSN", rb_hash_new());
- rb_define_const(rb_cVM, "USAGE_ANALYSIS_REGS", rb_hash_new());
- rb_define_const(rb_cVM, "USAGE_ANALYSIS_INSN_BIGRAM", rb_hash_new());
- rb_define_const(rb_cVM, "OPTS", opts = rb_ary_new());
+ rb_define_const(rb_cRubyVM, "USAGE_ANALYSIS_INSN", rb_hash_new());
+ rb_define_const(rb_cRubyVM, "USAGE_ANALYSIS_REGS", rb_hash_new());
+ rb_define_const(rb_cRubyVM, "USAGE_ANALYSIS_INSN_BIGRAM", rb_hash_new());
+ rb_define_const(rb_cRubyVM, "OPTS", opts = rb_ary_new());
#if OPT_DIRECT_THREADED_CODE
rb_ary_push(opts, rb_str_new2("direct threaded code"));
@@ -1720,12 +1720,12 @@ Init_VM(void)
#endif
/* ::VM::InsnNameArray */
- rb_define_const(rb_cVM, "INSTRUCTION_NAMES", insns_name_array());
+ rb_define_const(rb_cRubyVM, "INSTRUCTION_NAMES", insns_name_array());
/* debug functions ::VM::SDR(), ::VM::NSDR() */
#if VMDEBUG
- rb_define_singleton_method(rb_cVM, "SDR", sdr, 0);
- rb_define_singleton_method(rb_cVM, "NSDR", nsdr, 0);
+ rb_define_singleton_method(rb_cRubyVM, "SDR", sdr, 0);
+ rb_define_singleton_method(rb_cRubyVM, "NSDR", nsdr, 0);
#else
(void)sdr;
(void)nsdr;
@@ -1741,7 +1741,7 @@ Init_VM(void)
rb_iseq_t *iseq;
/* create vm object */
- vm->self = Data_Wrap_Struct(rb_cVM, rb_vm_mark, vm_free, vm);
+ vm->self = Data_Wrap_Struct(rb_cRubyVM, rb_vm_mark, vm_free, vm);
/* create main thread */
th_self = th->self = Data_Wrap_Struct(rb_cThread, rb_thread_mark, thread_free, th);
diff --git a/vm_core.h b/vm_core.h
index 3fd26232db..dec5765dcc 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -502,6 +502,9 @@ VALUE ruby_iseq_disasm(VALUE self);
VALUE ruby_iseq_disasm_insn(VALUE str, VALUE *iseqval, int pos, rb_iseq_t *iseq, VALUE child);
const char *ruby_node_name(int node);
+RUBY_EXTERN VALUE rb_cISeq;
+RUBY_EXTERN VALUE rb_cRubyVM;
+RUBY_EXTERN VALUE rb_cEnv;
/* each thread has this size stack : 128KB */
#define RUBY_VM_THREAD_STACK_SIZE (128 * 1024)
diff --git a/vm_dump.c b/vm_dump.c
index 7f7d84c324..e1da979d04 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -435,7 +435,7 @@ vm_analysis_insn(int insn)
CONST_ID(usage_hash, "USAGE_ANALYSIS_INSN");
CONST_ID(bigram_hash, "USAGE_ANALYSIS_INSN_BIGRAM");
- uh = rb_const_get(rb_cVM, usage_hash);
+ uh = rb_const_get(rb_cRubyVM, usage_hash);
if ((ihash = rb_hash_aref(uh, INT2FIX(insn))) == Qnil) {
ihash = rb_hash_new();
rb_hash_aset(uh, INT2FIX(insn), ihash);
@@ -455,7 +455,7 @@ vm_analysis_insn(int insn)
ary[1] = INT2FIX(insn);
bi = rb_ary_new4(2, &ary[0]);
- uh = rb_const_get(rb_cVM, bigram_hash);
+ uh = rb_const_get(rb_cRubyVM, bigram_hash);
if ((cv = rb_hash_aref(uh, bi)) == Qnil) {
cv = INT2FIX(0);
}
@@ -481,7 +481,7 @@ vm_analysis_operand(int insn, int n, VALUE op)
CONST_ID(usage_hash, "USAGE_ANALYSIS_INSN");
- uh = rb_const_get(rb_cVM, usage_hash);
+ uh = rb_const_get(rb_cRubyVM, usage_hash);
if ((ihash = rb_hash_aref(uh, INT2FIX(insn))) == Qnil) {
ihash = rb_hash_new();
rb_hash_aset(uh, INT2FIX(insn), ihash);
@@ -540,7 +540,7 @@ vm_analysis_register(int reg, int isset)
}
valstr = syms[reg][isset];
- uh = rb_const_get(rb_cVM, usage_hash);
+ uh = rb_const_get(rb_cRubyVM, usage_hash);
if ((cv = rb_hash_aref(uh, valstr)) == Qnil) {
cv = INT2FIX(0);
}