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

ruby-changes:36768

From: nobu <ko1@a...>
Date: Tue, 16 Dec 2014 04:09:39 +0900 (JST)
Subject: [ruby-changes:36768] nobu:r48849 (trunk): compile.c: support for TS_FUNCPTR

nobu	2014-12-16 04:09:25 +0900 (Tue, 16 Dec 2014)

  New Revision: 48849

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

  Log:
    compile.c: support for TS_FUNCPTR
    
    * compile.c (iseq_set_sequence): support for TS_FUNCPTR.
    
    * compile.c (insn_data_to_s_detail): ditto.
    
    * compile.c (iseq_build_from_ary_body): ditto.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 48848)
+++ compile.c	(revision 48849)
@@ -1599,6 +1599,9 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L1599
 			    generated_iseq[pos + 1 + j] = (VALUE)entry;
 			}
 			break;
+		      case TS_FUNCPTR:
+			generated_iseq[pos + 1 + j] = operands[j];
+			break;
 		      default:
 			rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
 					 "unknown operand type: %c", type);
@@ -5600,6 +5603,9 @@ insn_data_to_s_detail(INSN *iobj) https://github.com/ruby/ruby/blob/trunk/compile.c#L5603
 	      case TS_CDHASH:	/* case/when condition cache */
 		rb_str_cat2(str, "<ch>");
 		break;
+	      case TS_FUNCPTR:
+		rb_str_catf(str, "<%p>", (rb_insn_func_t)OPERAND_AT(iobj, j));
+		break;
 	      default:{
 		rb_raise(rb_eSyntaxError, "unknown operand type: %c", type);
 	      }
@@ -5943,6 +5949,9 @@ iseq_build_from_ary_body(rb_iseq_t *iseq https://github.com/ruby/ruby/blob/trunk/compile.c#L5949
 			    iseq_add_mark_object_compile_time(iseq, map);
 			}
 			break;
+		      case TS_FUNCPTR:
+			argv[j] = op;
+			break;
 		      default:
 			rb_raise(rb_eSyntaxError, "unknown operand: %c", insn_op_type((VALUE)insn_id, j));
 		    }

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

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