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

ruby-changes:35187

From: normal <ko1@a...>
Date: Mon, 25 Aug 2014 11:24:25 +0900 (JST)
Subject: [ruby-changes:35187] normal:r47269 (trunk): rb_iseq_location_t: change first_lineno type to VALUE

normal	2014-08-25 11:24:10 +0900 (Mon, 25 Aug 2014)

  New Revision: 47269

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

  Log:
    rb_iseq_location_t: change first_lineno type to VALUE
    
    Nearly all current uses of iseq->location.first_lineno are as a
    VALUE, not a size_t.  The only exception was the experimental
    (and currently unused) rb_iseq_build_for_ruby2cext function.
    
    * vm_core.h (rb_iseq_location_t): change first_lineno type to VALUE
    * iseq.c (rb_iseq_build_for_ruby2cext): update based on argument

  Modified files:
    trunk/ChangeLog
    trunk/iseq.c
    trunk/vm_core.h
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 47268)
+++ ChangeLog	(revision 47269)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Aug 25 11:02:07 2014  Eric Wong  <e@8...>
+
+	* vm_core.h (rb_iseq_location_t): change first_lineno type to VALUE
+	* iseq.c (rb_iseq_build_for_ruby2cext): update based on argument
+
 Sun Aug 24 16:14:46 2014  SHIBATA Hiroshi  <shibata.hiroshi@g...>
 
 	* lib/e2mmap.rb: remove needless instance variables.
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 47268)
+++ vm_core.h	(revision 47269)
@@ -184,7 +184,7 @@ typedef struct rb_iseq_location_struct { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L184
     const VALUE absolute_path;
     const VALUE base_label;
     const VALUE label;
-    size_t first_lineno;
+    VALUE first_lineno; /* TODO: may be unsigned short */
 } rb_iseq_location_t;
 
 struct rb_iseq_struct;
Index: iseq.c
===================================================================
--- iseq.c	(revision 47268)
+++ iseq.c	(revision 47269)
@@ -183,7 +183,7 @@ iseq_alloc(VALUE klass) https://github.com/ruby/ruby/blob/trunk/iseq.c#L183
 }
 
 static rb_iseq_location_t *
-iseq_location_setup(rb_iseq_t *iseq, VALUE path, VALUE absolute_path, VALUE name, size_t first_lineno)
+iseq_location_setup(rb_iseq_t *iseq, VALUE path, VALUE absolute_path, VALUE name, VALUE first_lineno)
 {
     rb_iseq_location_t *loc = &iseq->location;
     RB_OBJ_WRITE(iseq->self, &loc->path, path);
@@ -2096,7 +2096,7 @@ rb_iseq_build_for_ruby2cext( https://github.com/ruby/ruby/blob/trunk/iseq.c#L2096
     MEMCPY(iseq, iseq_template, rb_iseq_t, 1); /* TODO: write barrier, *iseq = *iseq_template; */
     RB_OBJ_WRITE(iseq->self, &iseq->location.label, rb_str_new2(name));
     RB_OBJ_WRITE(iseq->self, &iseq->location.path, rb_str_new2(path));
-    iseq->location.first_lineno = first_lineno;
+    iseq->location.first_lineno = UINT2NUM(first_lineno);
     RB_OBJ_WRITE(iseq->self, &iseq->mark_ary, 0);
     iseq->self = iseqval;
 

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

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