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

ruby-changes:13131

From: ko1 <ko1@a...>
Date: Sun, 13 Sep 2009 02:16:43 +0900 (JST)
Subject: [ruby-changes:13131] Ruby:r24881 (trunk): * vm_core.h: change members of iseq_inline_cache_entry.

ko1	2009-09-13 02:16:27 +0900 (Sun, 13 Sep 2009)

  New Revision: 24881

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

  Log:
    * vm_core.h: change members of iseq_inline_cache_entry.
      make cache value members to one union member "ic_value".
    * insns.def: ditto.
    * vm_insnhelper.c: ditto.

  Modified files:
    trunk/ChangeLog
    trunk/insns.def
    trunk/vm_core.h
    trunk/vm_insnhelper.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 24880)
+++ ChangeLog	(revision 24881)
@@ -1,3 +1,12 @@
+Sun Sep 13 02:08:43 2009  Koichi Sasada  <ko1@a...>
+
+	* vm_core.h: change members of iseq_inline_cache_entry.
+	  make cache value members to one union member "ic_value".
+
+	* insns.def: ditto.
+
+	* vm_insnhelper.c: ditto.
+
 Sun Sep 13 01:15:49 2009  Tanaka Akira  <akr@f...>
 
 	* lib/open-uri.rb (URI::FTP#buffer_open): fix the %2F handling.
Index: insns.def
===================================================================
--- insns.def	(revision 24880)
+++ insns.def	(revision 24881)
@@ -1174,7 +1174,7 @@
 (VALUE val)
 {
     if (ic->ic_vmstat == GET_VM_STATE_VERSION()) {
-	val = ic->ic_value;
+	val = ic->ic_value.value;
 	JUMP(dst);
     }
     else {
@@ -1195,12 +1195,12 @@
 (VALUE val)
 {
     if (ic->ic_vmstat) {
-	val = ic->ic_value;
+	val = ic->ic_value.value;
 	JUMP(dst);
     }
     else {
 	/* none */
-	ic->ic_value = Qundef;
+	ic->ic_value.value = Qundef;
 	val = Qnil;
     }
 }
@@ -1218,10 +1218,10 @@
 {
     IC ic = GET_CONST_INLINE_CACHE(dst);
 
-    if (ic->ic_value == Qundef) {
+    if (ic->ic_value.value == Qundef) {
 	rb_ary_push(GET_ISEQ()->mark_ary, val);
     }
-    ic->ic_value = val;
+    ic->ic_value.value = val;
     ic->ic_vmstat = GET_VM_STATE_VERSION() - ruby_vm_const_missing_count;
     ruby_vm_const_missing_count = 0;
 }
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 24880)
+++ vm_core.h	(revision 24881)
@@ -112,9 +112,11 @@
 struct iseq_inline_cache_entry {
     long  ic_vmstat;
     VALUE ic_class;
-    VALUE ic_value;
-    rb_method_entry_t *ic_method;
-#define ic_index ic_vmstat
+    union {
+	VALUE value;
+	rb_method_entry_t *method;
+	long index;
+    } ic_value;
 };
 
 #if 1
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 24880)
+++ vm_insnhelper.c	(revision 24881)
@@ -1196,7 +1196,7 @@
 	VALUE klass = RBASIC(obj)->klass;
 
 	if (ic->ic_class == klass) {
-	    long index = ic->ic_index;
+	    long index = ic->ic_value.index;
 	    long len = ROBJECT_NUMIV(obj);
 	    VALUE *ptr = ROBJECT_IVPTR(obj);
 
@@ -1216,7 +1216,7 @@
 			val = ptr[index];
 		    }
 		    ic->ic_class = klass;
-		    ic->ic_index = index;
+		    ic->ic_value.index = index;
 		}
 	    }
 	}
@@ -1250,7 +1250,7 @@
 	st_data_t index;
 
 	if (ic->ic_class == klass) {
-	    long index = ic->ic_index;
+	    long index = ic->ic_value.index;
 	    long len = ROBJECT_NUMIV(obj);
 	    VALUE *ptr = ROBJECT_IVPTR(obj);
 
@@ -1264,7 +1264,7 @@
 
 	    if (iv_index_tbl && st_lookup(iv_index_tbl, (st_data_t)id, &index)) {
 		ic->ic_class = klass;
-		ic->ic_index = index;
+		ic->ic_value.index = index;
 	    }
 	    /* fall through */
 	}
@@ -1282,12 +1282,12 @@
 #if OPT_INLINE_METHOD_CACHE
     if (LIKELY(klass == ic->ic_class) &&
 	LIKELY(GET_VM_STATE_VERSION() == ic->ic_vmstat)) {
-	me = ic->ic_method;
+	me = ic->ic_value.method;
     }
     else {
 	me = rb_method_entry(klass, id);
 	ic->ic_class = klass;
-	ic->ic_method = me;
+	ic->ic_value.method = me;
 	ic->ic_vmstat = GET_VM_STATE_VERSION();
     }
 #else

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

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