[前][次][番号順一覧][スレッド一覧]

ruby-changes:9018

From: yugui <ko1@a...>
Date: Fri, 5 Dec 2008 22:35:45 +0900 (JST)
Subject: [ruby-changes:9018] Ruby:r20554 (ruby_1_9_1): merges r20535 from trunk into ruby_1_9_1.

yugui	2008-12-05 22:34:34 +0900 (Fri, 05 Dec 2008)

  New Revision: 20554

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20554

  Log:
    merges r20535 from trunk into ruby_1_9_1.
    * compile.c (ruby_iseq_compile, ruby_iseq_translate_threaded_code),
      (ruby_insns_name_array, ruby_iseq_build_from_ary): prefixed with
      ruby_.
    * iseq.c (ruby_iseq_load, ruby_insn_make_insn_table): ditto.

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/compile.c
    branches/ruby_1_9_1/iseq.c
    branches/ruby_1_9_1/iseq.h
    branches/ruby_1_9_1/vm.c

Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 20553)
+++ ruby_1_9_1/ChangeLog	(revision 20554)
@@ -1,3 +1,11 @@
+Fri Dec  5 12:35:46 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* compile.c (ruby_iseq_compile, ruby_iseq_translate_threaded_code),
+	  (ruby_insns_name_array, ruby_iseq_build_from_ary): prefixed with
+	  ruby_.
+
+	* iseq.c (ruby_iseq_load, ruby_insn_make_insn_table): ditto.
+
 Fri Dec  5 10:01:43 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* string.c (rb_str_cmp_m): fixed rdoc.  pointed out by <Thomas
Index: ruby_1_9_1/iseq.c
===================================================================
--- ruby_1_9_1/iseq.c	(revision 20553)
+++ ruby_1_9_1/iseq.c	(revision 20554)
@@ -19,10 +19,6 @@
 #include "insns.inc"
 #include "insns_info.inc"
 
-/* compile.c */
-void iseq_compile(VALUE self, NODE *node);
-int iseq_translate_threaded_code(rb_iseq_t *iseq);
-
 VALUE rb_cISeq;
 
 static void
@@ -326,7 +322,7 @@
     iseq->self = self;
 
     prepare_iseq_build(iseq, name, filename, parent, type, bopt, option);
-    iseq_compile(self, node);
+    ruby_iseq_compile(self, node);
     cleanup_iseq_build(iseq);
     return self;
 }
@@ -348,17 +344,14 @@
 					   bopt, &COMPILE_OPTION_DEFAULT);
 }
 
-VALUE iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
-			  VALUE exception, VALUE body);
-
 #define CHECK_ARRAY(v)   rb_convert_type(v, T_ARRAY, "Array", "to_ary")
 #define CHECK_STRING(v)  rb_convert_type(v, T_STRING, "String", "to_str")
 #define CHECK_SYMBOL(v)  rb_convert_type(v, T_SYMBOL, "Symbol", "to_sym")
 static inline VALUE CHECK_INTEGER(VALUE v) {NUM2LONG(v); return v;}
-VALUE
+static VALUE
 iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
 {
-    VALUE iseqval = iseq_alloc(rb_cISeq);
+    VALUE iseqval = iseq_alloc(self);
 
     VALUE magic, version1, version2, format_type, misc;
     VALUE name, filename;
@@ -428,7 +421,7 @@
     prepare_iseq_build(iseq, name, filename,
 		       parent, iseq_type, 0, &option);
 
-    iseq_build_from_ary(iseq, locals, args, exception, body);
+    ruby_iseq_build_from_ary(iseq, locals, args, exception, body);
 
     cleanup_iseq_build(iseq);
     return iseqval;
@@ -443,6 +436,12 @@
     return iseq_load(self, data, 0, opt);
 }
 
+VALUE
+ruby_iseq_load(VALUE data, VALUE parent, VALUE opt)
+{
+    return iseq_load(rb_cISeq, data, parent, opt);
+}
+
 static NODE *
 compile_string(VALUE str, VALUE file, VALUE line)
 {
@@ -1237,7 +1236,7 @@
 }
 
 struct st_table *
-insn_make_insn_table(void)
+ruby_insn_make_insn_table(void)
 {
     struct st_table *table;
     int i;
@@ -1306,7 +1305,7 @@
 	iseq->iseq[i+1] = (VALUE)func;
     }
 
-    iseq_translate_threaded_code(iseq);
+    ruby_iseq_translate_threaded_code(iseq);
 
 #define ALLOC_AND_COPY(dst, src, type, size) do { \
   if (size) { \
Index: ruby_1_9_1/iseq.h
===================================================================
--- ruby_1_9_1/iseq.h	(revision 20553)
+++ ruby_1_9_1/iseq.h	(revision 20554)
@@ -12,8 +12,17 @@
 #ifndef RUBY_COMPILE_H
 #define RUBY_COMPILE_H
 
-VALUE iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt);
+/* compile.c */
+VALUE ruby_iseq_compile(VALUE self, NODE *node);
+int ruby_iseq_translate_threaded_code(rb_iseq_t *iseq);
+VALUE ruby_insns_name_array(void);
+VALUE ruby_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
+			       VALUE exception, VALUE body);
 
+/* iseq.c */
+VALUE ruby_iseq_load(VALUE data, VALUE parent, VALUE opt);
+struct st_table *ruby_insn_make_insn_table(void);
+
 #define ISEQ_TYPE_TOP    INT2FIX(1)
 #define ISEQ_TYPE_METHOD INT2FIX(2)
 #define ISEQ_TYPE_BLOCK  INT2FIX(3)
Index: ruby_1_9_1/compile.c
===================================================================
--- ruby_1_9_1/compile.c	(revision 20553)
+++ ruby_1_9_1/compile.c	(revision 20554)
@@ -415,7 +415,7 @@
 }
 
 VALUE
-iseq_compile(VALUE self, NODE *node)
+ruby_iseq_compile(VALUE self, NODE *node)
 {
     DECL_ANCHOR(ret);
     rb_iseq_t *iseq;
@@ -502,7 +502,7 @@
 }
 
 int
-iseq_translate_threaded_code(rb_iseq_t *iseq)
+ruby_iseq_translate_threaded_code(rb_iseq_t *iseq)
 {
 #if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
     extern const void **vm_get_insns_address_table(void);
@@ -960,7 +960,7 @@
     iseq_set_optargs_table(iseq);
 
     debugs("[compile step 5 (iseq_translate_threaded_code)] \n");
-    iseq_translate_threaded_code(iseq);
+    ruby_iseq_translate_threaded_code(iseq);
 
     if (compile_debug > 1) {
 	VALUE str = ruby_iseq_disasm(iseq->self);
@@ -4974,14 +4974,14 @@
 }
 
 VALUE
-insns_name_array(void)
+ruby_insns_name_array(void)
 {
     VALUE ary = rb_ary_new();
     int i;
     for (i = 0; i < sizeof(insn_name_info) / sizeof(insn_name_info[0]); i++) {
-	rb_ary_push(ary, rb_str_new2(insn_name_info[i]));
+	rb_ary_push(ary, rb_obj_freeze(rb_str_new2(insn_name_info[i])));
     }
-    return ary;
+    return rb_obj_freeze(ary);
 }
 
 static LABEL *
@@ -5051,7 +5051,7 @@
 	    eiseqval = 0;
 	}
 	else {
-	    eiseqval = iseq_load(0, ptr[1], iseq->self, Qnil);
+	    eiseqval = ruby_iseq_load(ptr[1], iseq->self, Qnil);
 	}
 
 	lstart = register_label(iseq, labels_table, ptr[2]);
@@ -5064,8 +5064,6 @@
     return COMPILE_OK;
 }
 
-struct st_table *insn_make_insn_table(void);
-
 static int
 iseq_build_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
 		VALUE body, struct st_table *labels_table)
@@ -5081,7 +5079,7 @@
     static struct st_table *insn_table;
 
     if (insn_table == 0) {
-	insn_table = insn_make_insn_table();
+	insn_table = ruby_insn_make_insn_table();
     }
 
     for (i=0; i<len; i++) {
@@ -5137,7 +5135,7 @@
 			{
 			    if (op != Qnil) {
 				if (TYPE(op) == T_ARRAY) {
-				    argv[j] = iseq_load(0, op, iseq->self, Qnil);
+				    argv[j] = ruby_iseq_load(op, iseq->self, Qnil);
 				}
 				else if (CLASS_OF(op) == rb_cISeq) {
 				    argv[j] = op;
@@ -5202,8 +5200,8 @@
 static inline VALUE CHECK_INTEGER(VALUE v) {NUM2LONG(v); return v;}
 
 VALUE
-iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
-		    VALUE exception, VALUE body)
+ruby_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
+			 VALUE exception, VALUE body)
 {
     int i;
     ID *tbl;
Index: ruby_1_9_1/vm.c
===================================================================
--- ruby_1_9_1/vm.c	(revision 20553)
+++ ruby_1_9_1/vm.c	(revision 20554)
@@ -1737,7 +1737,6 @@
     return Qnil;
 }
 
-VALUE insns_name_array(void);
 extern VALUE *rb_gc_stack_start;
 extern size_t rb_gc_stack_maxsize;
 #ifdef __ia64
@@ -1845,7 +1844,7 @@
 #endif
 
     /* ::VM::InsnNameArray */
-    rb_define_const(rb_cRubyVM, "INSTRUCTION_NAMES", insns_name_array());
+    rb_define_const(rb_cRubyVM, "INSTRUCTION_NAMES", ruby_insns_name_array());
 
     /* debug functions ::VM::SDR(), ::VM::NSDR() */
 #if VMDEBUG

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]