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

ruby-changes:34874

From: normal <ko1@a...>
Date: Sat, 26 Jul 2014 16:30:33 +0900 (JST)
Subject: [ruby-changes:34874] normal:r46957 (trunk): rb_iseq_t: reduce to (280 bytes from 288 bytes) on 64-bit

normal	2014-07-26 16:30:26 +0900 (Sat, 26 Jul 2014)

  New Revision: 46957

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

  Log:
    rb_iseq_t: reduce to (280 bytes from 288 bytes) on 64-bit
    
    iseq_size and line_info_size may be 32-bit.
    
    4GB instruction sequences should be big enough for anyone.
    Other existing line info counters are 32-bit, and nobody
    should need all that.

  Modified files:
    trunk/ChangeLog
    trunk/compile.c
    trunk/iseq.c
    trunk/vm_core.h
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46956)
+++ ChangeLog	(revision 46957)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jul 26 16:28:06 2014  Eric Wong  <e@8...>
+
+	* vm_core.h (struct rb_iseq_struct): reduce to 280 bytes
+	  (from 288 bytes) on 64-bit
+
 Sat Jul 26 06:44:43 2014  Eric Wong  <e@8...>
 
 	* parse.y (struct parse_params): shrink to 320 to 304 bytes on 64-bit
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 46956)
+++ vm_core.h	(revision 46957)
@@ -214,13 +214,14 @@ struct rb_iseq_struct { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L214
 
     VALUE *iseq;         /* iseq (insn number and operands) */
     VALUE *iseq_encoded; /* encoded iseq */
-    unsigned long iseq_size;
+    unsigned int iseq_size;
+    unsigned int line_info_size;
+
     const VALUE mark_ary;     /* Array: includes operands which should be GC marked */
     const VALUE coverage;     /* coverage array */
 
     /* insn info, must be freed */
     struct iseq_line_info_entry *line_info_table;
-    size_t line_info_size;
 
     ID *local_table;		/* must free */
     int local_table_size;
Index: iseq.c
===================================================================
--- iseq.c	(revision 46956)
+++ iseq.c	(revision 46957)
@@ -1379,7 +1379,7 @@ rb_iseq_disasm(VALUE self) https://github.com/ruby/ruby/blob/trunk/iseq.c#L1379
     VALUE *iseq;
     VALUE str = rb_str_new(0, 0);
     VALUE child = rb_ary_new();
-    unsigned long size;
+    unsigned int size;
     int i;
     long l;
     ID *tbl;
@@ -2144,7 +2144,8 @@ int https://github.com/ruby/ruby/blob/trunk/iseq.c#L2144
 rb_iseq_line_trace_each(VALUE iseqval, int (*func)(int line, rb_event_flag_t *events_ptr, void *d), void *data)
 {
     int trace_num = 0;
-    size_t pos, insn;
+    unsigned int pos;
+    size_t insn;
     rb_iseq_t *iseq;
     int cont = 1;
     GetISeqPtr(iseqval, iseq);
Index: compile.c
===================================================================
--- compile.c	(revision 46956)
+++ compile.c	(revision 46957)
@@ -567,7 +567,7 @@ rb_iseq_translate_threaded_code(rb_iseq_ https://github.com/ruby/ruby/blob/trunk/compile.c#L567
 {
 #if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
     const void * const *table = rb_vm_get_insns_address_table();
-    unsigned long i;
+    unsigned int i;
 
     iseq->iseq_encoded = ALLOC_N(VALUE, iseq->iseq_size);
     MEMCPY(iseq->iseq_encoded, iseq->iseq, VALUE, iseq->iseq_size);

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

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