[前][次][番号順一覧][スレッド一覧][生データ]

yarv-diff:351

From: ko1 atdot.net
Date: 12 Jul 2006 13:42:42 +0900
Subject: [yarv-diff:351] r517 - in trunk: . yarvtest

Author: ko1
Date: 2006-07-12 13:42:41 +0900 (Wed, 12 Jul 2006)
New Revision: 517

Modified:
   trunk/ChangeLog
   trunk/compile.c
   trunk/eval.c
   trunk/gc.h
   trunk/iseq.c
   trunk/thread.c
   trunk/thread_pthread.h
   trunk/vm.c
   trunk/yarvcore.c
   trunk/yarvcore.h
   trunk/yarvtest/test_eval.rb
Log:
        * eval.c : fix indent

        * gc.h :

        * thread_pthread.h : vanish warnning message

        * iseq.c : ditto

        * compile.c : ditto

        * thread.c : ditto

        * vm.c : ditto

        * yarvcore.c : prohibit tail call optimization to mark 
	iseq object

        * yarvcore.h : add some allocator function declaration

        * yarvtest/test_eval.rb : remove output



Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-07-11 20:11:18 UTC (rev 516)
+++ trunk/ChangeLog	2006-07-12 04:42:41 UTC (rev 517)
@@ -4,6 +4,30 @@
 #  from Mon, 03 May 2004 01:24:19 +0900
 #
 
+2006-07-12(Wed) 13:38:03 +0900  Koichi Sasada  <ko1 atdot.net>
+
+        * eval.c : fix indent
+
+        * gc.h :
+
+        * thread_pthread.h : vanish warnning message
+
+        * iseq.c : ditto
+
+        * compile.c : ditto
+
+        * thread.c : ditto
+
+        * vm.c : ditto
+
+        * yarvcore.c : prohibit tail call optimization to mark 
+	iseq object
+
+        * yarvcore.h : add some allocator function declaration
+
+        * yarvtest/test_eval.rb : remove output
+
+
 2006-07-12(Wed) 05:01:23 +0900  Koichi Sasada  <ko1 atdot.net>
 
 	* yarvcore.c : undef alloc funcs

Modified: trunk/compile.c
===================================================================
--- trunk/compile.c	2006-07-11 20:11:18 UTC (rev 516)
+++ trunk/compile.c	2006-07-12 04:42:41 UTC (rev 517)
@@ -651,7 +651,7 @@
 }
 
 static VALUE
-new_child_iseq(yarv_iseq_t *iseq, NODE * node,
+new_child_iseq(yarv_iseq_t *iseq, NODE *node,
 	       VALUE name, VALUE parent, VALUE type, VALUE block_opt)
 {
     VALUE args[6];
@@ -4764,7 +4764,6 @@
 				      iseq_load(0, op, iseq->self, Qnil);
 				}
 				else if (CLASS_OF(op) == cYarvISeq) {
-				    yarv_iseq_t *iseq;
 				    argv[j] = op;
 				}
 				else {

Modified: trunk/eval.c
===================================================================
--- trunk/eval.c	2006-07-11 20:11:18 UTC (rev 516)
+++ trunk/eval.c	2006-07-12 04:42:41 UTC (rev 517)
@@ -230,9 +230,8 @@
     PUSH_TAG(0);
     if ((state = EXEC_TAG()) == 0) {
 	GET_THREAD()->base_block = 0;
-	val =
-	    yarvcore_eval_parsed(ruby_eval_tree,
-				 rb_str_new2(ruby_sourcefile));
+	val = yarvcore_eval_parsed(ruby_eval_tree,
+				   rb_str_new2(ruby_sourcefile));
     }
     POP_TAG();
     return state;

Modified: trunk/gc.h
===================================================================
--- trunk/gc.h	2006-07-11 20:11:18 UTC (rev 516)
+++ trunk/gc.h	2006-07-12 04:42:41 UTC (rev 517)
@@ -20,7 +20,7 @@
 	g_indent--;
     }
     rb_gc_debug_indent();
-    printf("%s: %s %s (%p)\n", mode, st ? "->" : "<-" msg, ptr);
+    printf("%s: %s %s (%p)\n", mode, st ? "->" : "<-", msg, ptr);
     if (st) {
 	g_indent++;
     }
@@ -31,7 +31,7 @@
 #define MARK_REPORT_LEAVE(msg) GC_REPORT_BODY("mark", msg, 0, ptr)
 #define FREE_REPORT_ENTER(msg) GC_REPORT_BODY("free", msg, 1, ptr)
 #define FREE_REPORT_LEAVE(msg) GC_REPORT_BODY("free", msg, 0, ptr)
-#define GC_INFO                gc_debug_indent(); printf
+#define GC_INFO                rb_gc_debug_indent(); printf
 
 #else
 #define MARK_REPORT_ENTER(msg)

Modified: trunk/iseq.c
===================================================================
--- trunk/iseq.c	2006-07-11 20:11:18 UTC (rev 516)
+++ trunk/iseq.c	2006-07-12 04:42:41 UTC (rev 517)
@@ -266,6 +266,9 @@
     return self;
 }
 
+VALUE iseq_build_from_ary(yarv_iseq_t *iseq, VALUE line,
+			  VALUE locals, VALUE args, VALUE exception, VALUE body);
+
 VALUE
 iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
 {
@@ -419,6 +422,8 @@
     return iseq;
 }
 
+VALUE yarv_th_eval(yarv_thread_t *th, VALUE iseqval);
+
 static VALUE
 iseq_eval(VALUE self)
 {
@@ -1008,7 +1013,7 @@
 static VALUE
 register_label(struct st_table *table, int idx)
 {
-    VALUE sym, tsym;
+    VALUE sym;
     char buff[0x20];
 
     snprintf(buff, 0x20, "label_%u", idx);
@@ -1045,7 +1050,7 @@
 VALUE
 iseq_data_to_ary(yarv_iseq_t *iseq)
 {
-    int i, j, pos, opt = 0;
+    int i, pos, opt = 0;
     VALUE *seq;
 
     VALUE val = rb_ary_new();

Modified: trunk/thread.c
===================================================================
--- trunk/thread.c	2006-07-11 20:11:18 UTC (rev 516)
+++ trunk/thread.c	2006-07-12 04:42:41 UTC (rev 517)
@@ -310,7 +310,7 @@
 /* +infty, for this purpose */
 #define DELAY_INFTY 1E30
 
-VALUE th_make_localjump_error(const char *mesg, VALUE value, int reason);
+VALUE th_make_jump_tag_but_local_jump(int state, VALUE val);
 
 static VALUE
 yarv_thread_join(yarv_thread_t *target_th, double delay)
@@ -1498,10 +1498,11 @@
 rb_thread_select(int max, fd_set * read, fd_set * write, fd_set * except,
 		 struct timeval *timeout)
 {
-    struct timeval tv, *tvp = timeout;
+    struct timeval *tvp = timeout;
     int lerrno, n;
 #ifndef linux
     double limit;
+    struct timeval tv;
 #endif
 
     if (!read && !write && !except) {
@@ -1579,6 +1580,8 @@
  *
  */
 
+int rb_get_next_signal(yarv_vm_t *vm);
+
 static void
 timer_function(void)
 {

Modified: trunk/thread_pthread.h
===================================================================
--- trunk/thread_pthread.h	2006-07-11 20:11:18 UTC (rev 516)
+++ trunk/thread_pthread.h	2006-07-12 04:42:41 UTC (rev 517)
@@ -60,7 +60,9 @@
 static void *
 thread_start_func_1(void *th_ptr)
 {
+#if USE_THREAD_CACHE
   thread_start:
+#endif
     {
 	yarv_thread_t *th = th_ptr;
 	VALUE stack_start;

Modified: trunk/vm.c
===================================================================
--- trunk/vm.c	2006-07-11 20:11:18 UTC (rev 516)
+++ trunk/vm.c	2006-07-12 04:42:41 UTC (rev 517)
@@ -188,6 +188,7 @@
 }
 
 static int check_env(yarv_env_t *env);
+VALUE yarv_env_alloc(VALUE klass);
 
 static VALUE
 th_make_env_each(yarv_thread_t *th, yarv_control_frame_t *cfp,
@@ -409,7 +410,7 @@
     if (PROCDEBUG) {
 	check_env_value(envval);
     }
-    procval = yarv_proc_alloc();
+    procval = yarv_proc_alloc(cYarvProc);
     GetProcPtr(procval, proc);
     proc->blockprocval = blockprocval;
     proc->block.self = block->self;
@@ -458,8 +459,8 @@
     VALUE val;
     yarv_block_t *blockptr = 0;
 
-    if (0) printf("id: %s (%p), nd: %s, argc: %d, passed: %p\n",
-		  rb_id2name(id), id, node_name(nd_type(body)),
+    if (0) printf("id: %s, nd: %s, argc: %d, passed: %p\n",
+		  rb_id2name(id), node_name(nd_type(body)),
 		  argc, th->passed_block);
     //SDR2(th->cfp);
 
@@ -872,6 +873,7 @@
 {
     int line_no = 0;
     yarv_iseq_t *iseq = cfp->iseq;
+
     if (YARV_NORMAL_ISEQ_P(iseq)) {
 	int i;
 	int pos = cfp->pc - cfp->iseq->iseq_encoded;
@@ -901,6 +903,7 @@
 	if (cfp->iseq != 0) {
 	    if (cfp->pc != 0) {
 		yarv_iseq_t *iseq = cfp->iseq;
+
 		line_no = th_get_sourceline(cfp);
 		file = RSTRING(iseq->file_name)->ptr;
 		str = rb_sprintf("%s:%d:in `%s'",
@@ -1022,7 +1025,7 @@
 {
     while (cref) {
 	dp(cref->nd_clss);
-	printf("%d\n", cref->nd_visi);
+	printf("%ld\n", cref->nd_visi);
 	cref = cref->nd_next;
     }
 }

Modified: trunk/yarvcore.c
===================================================================
--- trunk/yarvcore.c	2006-07-11 20:11:18 UTC (rev 516)
+++ trunk/yarvcore.c	2006-07-12 04:42:41 UTC (rev 517)
@@ -248,7 +248,7 @@
 static void
 vm_mark(void *ptr)
 {
-    MARK_REPORT_ENTER("vm")
+    MARK_REPORT_ENTER("vm");
     GC_INFO("-------------------------------------------------\n");
     if (ptr) {
 	yarv_vm_t *vm = ptr;
@@ -436,6 +436,7 @@
 yarv_th_eval(yarv_thread_t *th, VALUE iseqval)
 {
     VALUE val;
+    volatile VALUE tmp;
     
     th_set_top_stack(th, iseqval);
 
@@ -443,6 +444,7 @@
 	rb_define_global_const("TOPLEVEL_BINDING", rb_f_binding(Qnil));
     }
     val = th_eval_body(th);
+    tmp = iseqval;
     return val;
 }
 
@@ -655,7 +657,7 @@
 	if (iseq->insn_info_tbl) {
 	    line_no = iseq->insn_info_tbl[0].line_no;
 	}
-	str = rb_sprintf("#<%s:%p@%s:%d>", cname, self,
+	str = rb_sprintf("#<%s:%lx@%s:%d>", cname, self,
 			 RSTRING(iseq->file_name)->ptr,
 			 line_no);
     }

Modified: trunk/yarvcore.h
===================================================================
--- trunk/yarvcore.h	2006-07-11 20:11:18 UTC (rev 516)
+++ trunk/yarvcore.h	2006-07-12 04:42:41 UTC (rev 517)
@@ -574,7 +574,14 @@
 #define DEFINED_ZSUPER INT2FIX(8)
 #define DEFINED_FUNC   INT2FIX(9)
 
+/* VM related object allocate functions */
+/* TODO: should be static functions */
+VALUE yarv_thread_alloc(VALUE klass);
+VALUE yarv_env_alloc(VALUE klass);
+VALUE yarv_proc_alloc(VALUE klass);
+VALUE yarv_binding_alloc(VALUE klass);
 
+
 /* for debug */
 extern void vm_stack_dump_raw(yarv_thread_t *, yarv_control_frame_t *);
 #define SDR()     vm_stack_dump_raw(GET_THREAD(), GET_THREAD()->cfp)

Modified: trunk/yarvtest/test_eval.rb
===================================================================
--- trunk/yarvtest/test_eval.rb	2006-07-11 20:11:18 UTC (rev 516)
+++ trunk/yarvtest/test_eval.rb	2006-07-12 04:42:41 UTC (rev 517)
@@ -89,7 +89,7 @@
         Const = 1
       end
       1.instance_eval %{
-        p Const
+        Const
       }
     }
   end


--
ML: yarv-diff quickml.atdot.net
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧][生データ]