Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* blockinlining.c, compile.c, compile.h, error.c, eval.c,

  eval_intern.h, eval_jump.h, eval_load.c, eval_method.h,
  eval_safe.h, gc.c, insnhelper.h, insns.def, iseq.c, proc.c,
  process.c, signal.c, thread.c, thread_pthread.ci, thread_win32.ci,
  vm.c, vm.h, vm_dump.c, vm_evalbody.ci, vm_macro.def,
  yarv.h, yarvcore.h, yarvcore.c: change type and macro names:
  * yarv_*_t -> rb_*_t
  * yarv_*_struct -> rb_*_struct
  * yarv_tag -> rb_vm_tag
  * YARV_* -> RUBY_VM_*
* proc.c, vm.c: move functions about env object creation
  from proc.c to vm.c.
* proc.c, yarvcore.c: fix rb_cVM initialization place.
* inits.c: change Init_ISeq() order (after Init_VM).
* ruby.h, proc.c: change declaration place of rb_cEnv
  from proc.c to ruby.c.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 8ee7d0767f7940baeae60ffa95afde93f3378c93 1 parent b1c6339
Koichi Sasada authored February 06, 2007
23  ChangeLog
... ...
@@ -1,3 +1,26 @@
  1
+Wed Feb  7 03:39:32 2007  Koichi Sasada  <ko1@atdot.net>
  2
+
  3
+	* blockinlining.c, compile.c, compile.h, error.c, eval.c,
  4
+	  eval_intern.h, eval_jump.h, eval_load.c, eval_method.h,
  5
+	  eval_safe.h, gc.c, insnhelper.h, insns.def, iseq.c, proc.c,
  6
+	  process.c, signal.c, thread.c, thread_pthread.ci, thread_win32.ci,
  7
+	  vm.c, vm.h, vm_dump.c, vm_evalbody.ci, vm_macro.def,
  8
+	  yarv.h, yarvcore.h, yarvcore.c: change type and macro names:
  9
+	  * yarv_*_t -> rb_*_t
  10
+	  * yarv_*_struct -> rb_*_struct
  11
+	  * yarv_tag -> rb_vm_tag
  12
+	  * YARV_* -> RUBY_VM_*
  13
+
  14
+	* proc.c, vm.c: move functions about env object creation
  15
+	  from proc.c to vm.c.
  16
+
  17
+	* proc.c, yarvcore.c: fix rb_cVM initialization place.
  18
+
  19
+	* inits.c: change Init_ISeq() order (after Init_VM).
  20
+
  21
+	* ruby.h, proc.c: change declaration place of rb_cEnv
  22
+	  from proc.c to ruby.c.
  23
+
1 24
 Tue Feb 06 22:06:45 2007  NARUSE, Yui  <naruse@ruby-lang.org>
2 25
 
3 26
         * ext/nkf/nkf-utf8/{nkf.c,utf8tbl.c}:
36  blockinlining.c
@@ -17,7 +17,7 @@ VALUE yarv_new_iseqval(VALUE node, VALUE name, VALUE file,
17 17
 		       VALUE parent, VALUE type, VALUE block_opt, VALUE opt);
18 18
 
19 19
 static VALUE
20  
-yarv_iseq_special_block(yarv_iseq_t *iseq, void *builder)
  20
+yarv_iseq_special_block(rb_iseq_t *iseq, void *builder)
21 21
 {
22 22
 #if OPT_BLOCKINLINING
23 23
     VALUE parent = Qfalse;
@@ -110,7 +110,7 @@ new_assign(NODE * lnode, NODE * rhs)
110 110
 }
111 111
 
112 112
 static NODE *
113  
-build_Integer_times_node(yarv_iseq_t *iseq, NODE * node, NODE * lnode,
  113
+build_Integer_times_node(rb_iseq_t *iseq, NODE * node, NODE * lnode,
114 114
 			 VALUE param_vars, VALUE local_vars)
115 115
 {
116 116
     /* Special Block for Integer#times
@@ -183,17 +183,17 @@ build_Integer_times_node(yarv_iseq_t *iseq, NODE * node, NODE * lnode,
183 183
 VALUE
184 184
 yarv_invoke_Integer_times_special_block(VALUE num)
185 185
 {
186  
-    yarv_thread_t *th = GET_THREAD();
187  
-    yarv_block_t *orig_block = GC_GUARDED_PTR_REF(th->cfp->lfp[0]);
  186
+    rb_thead_t *th = GET_THREAD();
  187
+    rb_block_t *orig_block = GC_GUARDED_PTR_REF(th->cfp->lfp[0]);
188 188
 
189 189
     if (orig_block && BUILTIN_TYPE(orig_block->iseq) != T_NODE) {
190 190
 	VALUE tsiseqval = yarv_iseq_special_block(orig_block->iseq,
191 191
 						  build_Integer_times_node);
192  
-	yarv_iseq_t *tsiseq;
  192
+	rb_iseq_t *tsiseq;
193 193
 	VALUE argv[2], val;
194 194
 
195 195
 	if (tsiseqval) {
196  
-	    yarv_block_t block = *orig_block;
  196
+	    rb_block_t block = *orig_block;
197 197
 	    GetISeqPtr(tsiseqval, tsiseq);
198 198
 	    block.iseq = tsiseq;
199 199
 	    th->cfp->lfp[0] = GC_GUARDED_PTR(&block);
@@ -212,7 +212,7 @@ yarv_invoke_Integer_times_special_block(VALUE num)
212 212
 }
213 213
 
214 214
 static NODE *
215  
-build_Range_each_node(yarv_iseq_t *iseq, NODE * node, NODE * lnode,
  215
+build_Range_each_node(rb_iseq_t *iseq, NODE * node, NODE * lnode,
216 216
 		      VALUE param_vars, VALUE local_vars, ID mid)
217 217
 {
218 218
     /* Special Block for Range#each
@@ -281,7 +281,7 @@ build_Range_each_node(yarv_iseq_t *iseq, NODE * node, NODE * lnode,
281 281
 }
282 282
 
283 283
 static NODE *
284  
-build_Range_each_node_LE(yarv_iseq_t *iseq, NODE * node, NODE * lnode,
  284
+build_Range_each_node_LE(rb_iseq_t *iseq, NODE * node, NODE * lnode,
285 285
 			 VALUE param_vars, VALUE local_vars)
286 286
 {
287 287
     return build_Range_each_node(iseq, node, lnode,
@@ -289,7 +289,7 @@ build_Range_each_node_LE(yarv_iseq_t *iseq, NODE * node, NODE * lnode,
289 289
 }
290 290
 
291 291
 static NODE *
292  
-build_Range_each_node_LT(yarv_iseq_t *iseq, NODE * node, NODE * lnode,
  292
+build_Range_each_node_LT(rb_iseq_t *iseq, NODE * node, NODE * lnode,
293 293
 			 VALUE param_vars, VALUE local_vars)
294 294
 {
295 295
     return build_Range_each_node(iseq, node, lnode,
@@ -300,19 +300,19 @@ VALUE
300 300
 yarv_invoke_Range_each_special_block(VALUE range,
301 301
 				     VALUE beg, VALUE end, int excl)
302 302
 {
303  
-    yarv_thread_t *th = GET_THREAD();
304  
-    yarv_block_t *orig_block = GC_GUARDED_PTR_REF(th->cfp->lfp[0]);
  303
+    rb_thead_t *th = GET_THREAD();
  304
+    rb_block_t *orig_block = GC_GUARDED_PTR_REF(th->cfp->lfp[0]);
305 305
 
306 306
     if (BUILTIN_TYPE(orig_block->iseq) != T_NODE) {
307 307
 	void *builder =
308 308
 	    excl ? build_Range_each_node_LT : build_Range_each_node_LE;
309 309
 	VALUE tsiseqval = yarv_iseq_special_block(orig_block->iseq, builder);
310  
-	yarv_iseq_t *tsiseq;
  310
+	rb_iseq_t *tsiseq;
311 311
 	VALUE argv[2];
312 312
 
313 313
 	if (tsiseqval) {
314 314
 	    VALUE val;
315  
-	    yarv_block_t block = *orig_block;
  315
+	    rb_block_t block = *orig_block;
316 316
 	    GetISeqPtr(tsiseqval, tsiseq);
317 317
 	    block.iseq = tsiseq;
318 318
 	    th->cfp->lfp[0] = GC_GUARDED_PTR(&block);
@@ -332,7 +332,7 @@ yarv_invoke_Range_each_special_block(VALUE range,
332 332
 
333 333
 
334 334
 static NODE *
335  
-build_Array_each_node(yarv_iseq_t *iseq, NODE * node, NODE * lnode,
  335
+build_Array_each_node(rb_iseq_t *iseq, NODE * node, NODE * lnode,
336 336
 		      VALUE param_vars, VALUE local_vars)
337 337
 {
338 338
     /* Special block for Array#each
@@ -431,18 +431,18 @@ build_Array_each_node(yarv_iseq_t *iseq, NODE * node, NODE * lnode,
431 431
 VALUE
432 432
 yarv_invoke_Array_each_special_block(VALUE ary)
433 433
 {
434  
-    yarv_thread_t *th = GET_THREAD();
435  
-    yarv_block_t *orig_block = GC_GUARDED_PTR_REF(th->cfp->lfp[0]);
  434
+    rb_thead_t *th = GET_THREAD();
  435
+    rb_block_t *orig_block = GC_GUARDED_PTR_REF(th->cfp->lfp[0]);
436 436
 
437 437
     if (BUILTIN_TYPE(orig_block->iseq) != T_NODE) {
438 438
 	VALUE tsiseqval = yarv_iseq_special_block(orig_block->iseq,
439 439
 						  build_Array_each_node);
440  
-	yarv_iseq_t *tsiseq;
  440
+	rb_iseq_t *tsiseq;
441 441
 	VALUE argv[2];
442 442
 
443 443
 	if (tsiseqval) {
444 444
 	    VALUE val;
445  
-	    yarv_block_t block = *orig_block;
  445
+	    rb_block_t block = *orig_block;
446 446
 	    GetISeqPtr(tsiseqval, tsiseq);
447 447
 	    block.iseq = tsiseq;
448 448
 	    th->cfp->lfp[0] = GC_GUARDED_PTR(&block);
156  compile.c
@@ -93,37 +93,37 @@ static int insn_ret_num(int insn);
93 93
 
94 94
 static void ADD_ELEM(LINK_ANCHOR *anchor, LINK_ELEMENT *elem);
95 95
 
96  
-static INSN *new_insn_body(yarv_iseq_t *iseq, int line_no,
  96
+static INSN *new_insn_body(rb_iseq_t *iseq, int line_no,
97 97
 			   int insn_id, int argc, ...);
98  
-static LABEL *new_label_body(yarv_iseq_t *iseq, int line);
  98
+static LABEL *new_label_body(rb_iseq_t *iseq, int line);
99 99
 
100  
-static int iseq_compile_each(yarv_iseq_t *iseq, LINK_ANCHOR *anchor,
  100
+static int iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
101 101
 			     NODE * n, int);
102  
-static int iseq_setup(yarv_iseq_t *iseq, LINK_ANCHOR *anchor);
103  
-
104  
-static int iseq_optimize(yarv_iseq_t *iseq, LINK_ANCHOR *anchor);
105  
-static int iseq_insns_unification(yarv_iseq_t *iseq, LINK_ANCHOR *anchor);
106  
-static int set_sequence_stackcaching(yarv_iseq_t *iseq, LINK_ANCHOR *anchor);
107  
-static int set_sequence(yarv_iseq_t *iseq, LINK_ANCHOR *anchor);
108  
-
109  
-static int set_exception_table(yarv_iseq_t *iseq);
110  
-static int set_localtbl(yarv_iseq_t *iseq, ID *tbl);
111  
-static int set_localtbl_eval(yarv_iseq_t *iseq, ID *tbl);
112  
-static int set_arguments(yarv_iseq_t *iseq, LINK_ANCHOR *anchor, NODE * node);
113  
-static NODE *set_block_local_tbl(yarv_iseq_t *iseq, NODE * node,
  102
+static int iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
  103
+
  104
+static int iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
  105
+static int iseq_insns_unification(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
  106
+static int set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
  107
+static int set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
  108
+
  109
+static int set_exception_table(rb_iseq_t *iseq);
  110
+static int set_localtbl(rb_iseq_t *iseq, ID *tbl);
  111
+static int set_localtbl_eval(rb_iseq_t *iseq, ID *tbl);
  112
+static int set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *anchor, NODE * node);
  113
+static NODE *set_block_local_tbl(rb_iseq_t *iseq, NODE * node,
114 114
 				 LINK_ANCHOR *anchor);
115  
-static int set_exception_tbl(yarv_iseq_t *iseq);
116  
-static int set_optargs_table(yarv_iseq_t *iseq);
  115
+static int set_exception_tbl(rb_iseq_t *iseq);
  116
+static int set_optargs_table(rb_iseq_t *iseq);
117 117
 
118 118
 static int
119  
-iseq_add_mark_object(yarv_iseq_t *iseq, VALUE v)
  119
+iseq_add_mark_object(rb_iseq_t *iseq, VALUE v)
120 120
 {
121 121
     rb_ary_push(iseq->iseq_mark_ary, v);
122 122
     return COMPILE_OK;
123 123
 }
124 124
 
125 125
 static int
126  
-iseq_add_mark_object_compile_time(yarv_iseq_t *iseq, VALUE v)
  126
+iseq_add_mark_object_compile_time(rb_iseq_t *iseq, VALUE v)
127 127
 {
128 128
     rb_ary_push(iseq->compile_data->mark_ary, v);
129 129
     return COMPILE_OK;
@@ -140,7 +140,7 @@ VALUE
140 140
 iseq_compile(VALUE self, NODE *narg)
141 141
 {
142 142
     DECL_ANCHOR(list_anchor);
143  
-    yarv_iseq_t *iseq;
  143
+    rb_iseq_t *iseq;
144 144
     NODE *node = (NODE *) narg;
145 145
     GetISeqPtr(self, iseq);
146 146
 
@@ -272,7 +272,7 @@ iseq_compile(VALUE self, NODE *narg)
272 272
 VALUE th_eval(void *);
273 273
 
274 274
 static int
275  
-iseq_translate_direct_threaded_code(yarv_iseq_t *iseq)
  275
+iseq_translate_direct_threaded_code(rb_iseq_t *iseq)
276 276
 {
277 277
 #if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
278 278
 
@@ -305,7 +305,7 @@ iseq_translate_direct_threaded_code(yarv_iseq_t *iseq)
305 305
 
306 306
 
307 307
 static void *
308  
-compile_data_alloc(yarv_iseq_t *iseq, size_t size)
  308
+compile_data_alloc(rb_iseq_t *iseq, size_t size)
309 309
 {
310 310
     void *ptr = 0;
311 311
     struct iseq_compile_data_storage *storage =
@@ -336,13 +336,13 @@ compile_data_alloc(yarv_iseq_t *iseq, size_t size)
336 336
 }
337 337
 
338 338
 static INSN *
339  
-compile_data_alloc_insn(yarv_iseq_t *iseq)
  339
+compile_data_alloc_insn(rb_iseq_t *iseq)
340 340
 {
341 341
     return (INSN *)compile_data_alloc(iseq, sizeof(INSN));
342 342
 }
343 343
 
344 344
 static LABEL *
345  
-compile_data_alloc_label(yarv_iseq_t *iseq)
  345
+compile_data_alloc_label(rb_iseq_t *iseq)
346 346
 {
347 347
     return (LABEL *)compile_data_alloc(iseq, sizeof(LABEL));
348 348
 }
@@ -620,7 +620,7 @@ debug_list(LINK_ANCHOR *anchor)
620 620
 #endif
621 621
 
622 622
 static LABEL *
623  
-new_label_body(yarv_iseq_t *iseq, int line)
  623
+new_label_body(rb_iseq_t *iseq, int line)
624 624
 {
625 625
     LABEL *labelobj = compile_data_alloc_label(iseq);
626 626
     static int label_no = 0;
@@ -635,7 +635,7 @@ new_label_body(yarv_iseq_t *iseq, int line)
635 635
 }
636 636
 
637 637
 static INSN *
638  
-new_insn_core(yarv_iseq_t *iseq, int line_no,
  638
+new_insn_core(rb_iseq_t *iseq, int line_no,
639 639
 	      int insn_id, int argc, VALUE *argv)
640 640
 {
641 641
     INSN *iobj = compile_data_alloc_insn(iseq);
@@ -651,7 +651,7 @@ new_insn_core(yarv_iseq_t *iseq, int line_no,
651 651
 }
652 652
 
653 653
 static INSN *
654  
-new_insn_body(yarv_iseq_t *iseq, int line_no, int insn_id, int argc, ...)
  654
+new_insn_body(rb_iseq_t *iseq, int line_no, int insn_id, int argc, ...)
655 655
 {
656 656
     VALUE *operands = 0;
657 657
     va_list argv;
@@ -669,7 +669,7 @@ new_insn_body(yarv_iseq_t *iseq, int line_no, int insn_id, int argc, ...)
669 669
 }
670 670
 
671 671
 static INSN *
672  
-new_insn_send(yarv_iseq_t *iseq, int line_no,
  672
+new_insn_send(rb_iseq_t *iseq, int line_no,
673 673
 	      VALUE id, VALUE argc, VALUE block, VALUE flag)
674 674
 {
675 675
     INSN *iobj = 0;
@@ -685,22 +685,22 @@ new_insn_send(yarv_iseq_t *iseq, int line_no,
685 685
 }
686 686
 
687 687
 static VALUE
688  
-new_child_iseq(yarv_iseq_t *iseq, NODE *node,
  688
+new_child_iseq(rb_iseq_t *iseq, NODE *node,
689 689
 	       VALUE name, VALUE parent, VALUE type)
690 690
 {
691 691
     VALUE args[6];
692 692
     VALUE ret;
693 693
 
694 694
     debugs("[new_child_iseq]> ---------------------------------------\n");
695  
-    ret = yarv_iseq_new_with_opt(node, name, iseq_filename(iseq->self),
696  
-				 parent, type, iseq->compile_data->option);
  695
+    ret = rb_iseq_new_with_opt(node, name, iseq_filename(iseq->self),
  696
+			       parent, type, iseq->compile_data->option);
697 697
     debugs("[new_child_iseq]< ---------------------------------------\n");
698 698
     iseq_add_mark_object(iseq, ret);
699 699
     return ret;
700 700
 }
701 701
 
702 702
 static int
703  
-iseq_setup(yarv_iseq_t *iseq, LINK_ANCHOR *anchor)
  703
+iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
704 704
 {
705 705
     /* debugs("[compile step 2] (iseq_array_to_linkedlist)\n"); */
706 706
 
@@ -767,7 +767,7 @@ iseq_assemble_setup(VALUE self, VALUE args, VALUE locals, VALUE insn_ary)
767 767
 }
768 768
 
769 769
 int
770  
-set_exception_tbl(yarv_iseq_t *iseq)
  770
+set_exception_tbl(rb_iseq_t *iseq)
771 771
 {
772 772
     static ID id_dollar_bang;
773 773
 
@@ -806,7 +806,7 @@ search_block_local_variables(NODE * node, VALUE local_vars)
806 806
 }
807 807
 
808 808
 static NODE *
809  
-search_block_local_parameters(yarv_iseq_t *iseq, NODE * lnode)
  809
+search_block_local_parameters(rb_iseq_t *iseq, NODE * lnode)
810 810
 {
811 811
     NODE *node = lnode;
812 812
     NODE *nelem;
@@ -893,7 +893,7 @@ search_block_local_parameters(yarv_iseq_t *iseq, NODE * lnode)
893 893
 
894 894
     /* translate to block inlining code */
895 895
     if (iseq->special_block_builder != 0) {
896  
-	node = ((NODE * (*)(yarv_iseq_t *, NODE *, NODE *, VALUE, VALUE))
  896
+	node = ((NODE * (*)(rb_iseq_t *, NODE *, NODE *, VALUE, VALUE))
897 897
 		iseq->special_block_builder) (iseq, node, lnode->nd_var,
898 898
 					      param_vars, local_vars);
899 899
     }
@@ -917,7 +917,7 @@ search_block_local_parameters(yarv_iseq_t *iseq, NODE * lnode)
917 917
 }
918 918
 
919 919
 static int
920  
-set_block_initializer(yarv_iseq_t *iseq, NODE * node, LINK_ANCHOR *anchor, int didx)
  920
+set_block_initializer(rb_iseq_t *iseq, NODE * node, LINK_ANCHOR *anchor, int didx)
921 921
 {
922 922
     DECL_ANCHOR(anc);
923 923
     LINK_ELEMENT *elem;
@@ -947,7 +947,7 @@ set_block_initializer(yarv_iseq_t *iseq, NODE * node, LINK_ANCHOR *anchor, int d
947 947
 }
948 948
 
949 949
 static NODE *
950  
-set_block_local_tbl(yarv_iseq_t *iseq, NODE * node, LINK_ANCHOR *anchor)
  950
+set_block_local_tbl(rb_iseq_t *iseq, NODE * node, LINK_ANCHOR *anchor)
951 951
 {
952 952
     NODE *rnode;
953 953
 
@@ -1049,7 +1049,7 @@ set_block_local_tbl(yarv_iseq_t *iseq, NODE * node, LINK_ANCHOR *anchor)
1049 1049
 }
1050 1050
 
1051 1051
 static int
1052  
-get_dyna_var_idx_at_raw(yarv_iseq_t *iseq, ID id)
  1052
+get_dyna_var_idx_at_raw(rb_iseq_t *iseq, ID id)
1053 1053
 {
1054 1054
     int i;
1055 1055
     for (i = 0; i < iseq->local_size; i++) {
@@ -1061,7 +1061,7 @@ get_dyna_var_idx_at_raw(yarv_iseq_t *iseq, ID id)
1061 1061
 }
1062 1062
 
1063 1063
 static int
1064  
-get_dyna_var_idx(yarv_iseq_t *iseq, ID id, int *level, int *ls)
  1064
+get_dyna_var_idx(rb_iseq_t *iseq, ID id, int *level, int *ls)
1065 1065
 {
1066 1066
     int lv = 0, idx;
1067 1067
 
@@ -1081,7 +1081,7 @@ get_dyna_var_idx(yarv_iseq_t *iseq, ID id, int *level, int *ls)
1081 1081
 
1082 1082
  */
1083 1083
 static int
1084  
-set_arguments(yarv_iseq_t *iseq, LINK_ANCHOR *optargs, NODE * node)
  1084
+set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE * node)
1085 1085
 {
1086 1086
     int i, j;
1087 1087
 
@@ -1146,7 +1146,7 @@ set_arguments(yarv_iseq_t *iseq, LINK_ANCHOR *optargs, NODE * node)
1146 1146
 }
1147 1147
 
1148 1148
 static int
1149  
-set_localtbl(yarv_iseq_t *iseq, ID *tbl)
  1149
+set_localtbl(rb_iseq_t *iseq, ID *tbl)
1150 1150
 {
1151 1151
     int size;
1152 1152
     if (tbl) {
@@ -1164,7 +1164,7 @@ set_localtbl(yarv_iseq_t *iseq, ID *tbl)
1164 1164
 }
1165 1165
 
1166 1166
 static int
1167  
-set_localtbl_eval(yarv_iseq_t *iseq, ID *tbl)
  1167
+set_localtbl_eval(rb_iseq_t *iseq, ID *tbl)
1168 1168
 {
1169 1169
     int size;
1170 1170
     if (tbl) {
@@ -1185,7 +1185,7 @@ set_localtbl_eval(yarv_iseq_t *iseq, ID *tbl)
1185 1185
   ruby insn object array -> raw instruction sequence
1186 1186
  */
1187 1187
 static int
1188  
-set_sequence(yarv_iseq_t *iseq, LINK_ANCHOR *anchor)
  1188
+set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
1189 1189
 {
1190 1190
     LABEL *lobj;
1191 1191
     INSN *iobj;
@@ -1320,7 +1320,7 @@ set_sequence(yarv_iseq_t *iseq, LINK_ANCHOR *anchor)
1320 1320
 		    case TS_ISEQ:	/* iseq */
1321 1321
 			{
1322 1322
 			    VALUE v = operands[j];
1323  
-			    yarv_iseq_t *block = 0;
  1323
+			    rb_iseq_t *block = 0;
1324 1324
 			    if (v) {
1325 1325
 				GetISeqPtr(v, block);
1326 1326
 			    }
@@ -1405,7 +1405,7 @@ label_get_sp(LABEL *lobj)
1405 1405
 }
1406 1406
 
1407 1407
 static int
1408  
-set_exception_table(yarv_iseq_t *iseq)
  1408
+set_exception_table(rb_iseq_t *iseq)
1409 1409
 {
1410 1410
     VALUE *tptr, *ptr;
1411 1411
     int tlen, i;
@@ -1463,7 +1463,7 @@ set_exception_table(yarv_iseq_t *iseq)
1463 1463
  *      expr2
1464 1464
  */
1465 1465
 static int
1466  
-set_optargs_table(yarv_iseq_t *iseq)
  1466
+set_optargs_table(rb_iseq_t *iseq)
1467 1467
 {
1468 1468
     int i;
1469 1469
 
@@ -1521,7 +1521,7 @@ get_prev_insn(INSN *iobj)
1521 1521
 }
1522 1522
 
1523 1523
 static int
1524  
-iseq_peephole_optimize(yarv_iseq_t *iseq, LINK_ELEMENT *list)
  1524
+iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list)
1525 1525
 {
1526 1526
     INSN *iobj = (INSN *)list;
1527 1527
   again:
@@ -1618,7 +1618,7 @@ insn_set_specialized_instruction(INSN *iobj, int insn_id)
1618 1618
 
1619 1619
 
1620 1620
 static int
1621  
-iseq_specialized_instruction(yarv_iseq_t *iseq, INSN *iobj)
  1621
+iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
1622 1622
 {
1623 1623
     if (iobj->insn_id == BIN(send)) {
1624 1624
 	ID mid = SYM2ID(OPERAND_AT(iobj, 0));
@@ -1681,7 +1681,7 @@ iseq_specialized_instruction(yarv_iseq_t *iseq, INSN *iobj)
1681 1681
 }
1682 1682
 
1683 1683
 static int
1684  
-iseq_optimize(yarv_iseq_t *iseq, LINK_ANCHOR *anchor)
  1684
+iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
1685 1685
 {
1686 1686
     LINK_ELEMENT *list;
1687 1687
     const int do_peephole = iseq->compile_data->option->peephole_optimization;
@@ -1708,7 +1708,7 @@ iseq_optimize(yarv_iseq_t *iseq, LINK_ANCHOR *anchor)
1708 1708
 
1709 1709
 #if OPT_INSTRUCTIONS_UNIFICATION
1710 1710
 static INSN *
1711  
-new_unified_insn(yarv_iseq_t *iseq,
  1711
+new_unified_insn(rb_iseq_t *iseq,
1712 1712
 		 int insn_id, int size, LINK_ELEMENT *seq_list)
1713 1713
 {
1714 1714
     INSN *iobj = 0;
@@ -1748,7 +1748,7 @@ new_unified_insn(yarv_iseq_t *iseq,
1748 1748
  * It's future work (if compile time was bottle neck).
1749 1749
  */
1750 1750
 static int
1751  
-iseq_insns_unification(yarv_iseq_t *iseq, LINK_ANCHOR *anchor)
  1751
+iseq_insns_unification(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
1752 1752
 {
1753 1753
 #if OPT_INSTRUCTIONS_UNIFICATION
1754 1754
     LINK_ELEMENT *list;
@@ -1860,7 +1860,7 @@ label_set_sc_state(LABEL *lobj, int state)
1860 1860
 #endif
1861 1861
 
1862 1862
 static int
1863  
-set_sequence_stackcaching(yarv_iseq_t *iseq, LINK_ANCHOR *anchor)
  1863
+set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
1864 1864
 {
1865 1865
 #if OPT_STACK_CACHING
1866 1866
     LINK_ELEMENT *list;
@@ -1952,7 +1952,7 @@ set_sequence_stackcaching(yarv_iseq_t *iseq, LINK_ANCHOR *anchor)
1952 1952
 
1953 1953
 
1954 1954
 static int
1955  
-compile_dstr(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node)
  1955
+compile_dstr(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node)
1956 1956
 {
1957 1957
     NODE *list = node->nd_next;
1958 1958
     VALUE lit = node->nd_lit;
@@ -1972,7 +1972,7 @@ compile_dstr(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node)
1972 1972
 }
1973 1973
 
1974 1974
 static int
1975  
-compile_branch_condition(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * cond,
  1975
+compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * cond,
1976 1976
 			 LABEL *then_label, LABEL *else_label)
1977 1977
 {
1978 1978
     switch (nd_type(cond)) {
@@ -2020,7 +2020,7 @@ compile_branch_condition(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * cond,
2020 2020
 }
2021 2021
 
2022 2022
 static int
2023  
-compile_array(yarv_iseq_t *iseq,
  2023
+compile_array(rb_iseq_t *iseq,
2024 2024
 	      LINK_ANCHOR *ret, NODE * node_root, VALUE opt_p)
2025 2025
 {
2026 2026
     NODE *node = node_root;
@@ -2076,7 +2076,7 @@ case_when_optimizable_literal(NODE * node)
2076 2076
 }
2077 2077
 
2078 2078
 static VALUE
2079  
-when_vals(yarv_iseq_t *iseq, LINK_ANCHOR *cond_seq, NODE *vals, LABEL *l1, VALUE special_literals)
  2079
+when_vals(rb_iseq_t *iseq, LINK_ANCHOR *cond_seq, NODE *vals, LABEL *l1, VALUE special_literals)
2080 2080
 {
2081 2081
     while (vals) {
2082 2082
 	VALUE lit;
@@ -2103,7 +2103,7 @@ when_vals(yarv_iseq_t *iseq, LINK_ANCHOR *cond_seq, NODE *vals, LABEL *l1, VALUE
2103 2103
 }
2104 2104
 
2105 2105
 static int
2106  
-make_masgn_lhs(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node)
  2106
+make_masgn_lhs(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node)
2107 2107
 {
2108 2108
 
2109 2109
     switch (nd_type(node)) {
@@ -2145,7 +2145,7 @@ make_masgn_lhs(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node)
2145 2145
 }
2146 2146
 
2147 2147
 static int
2148  
-compile_massign(yarv_iseq_t *iseq, LINK_ANCHOR *ret,
  2148
+compile_massign(rb_iseq_t *iseq, LINK_ANCHOR *ret,
2149 2149
 		NODE * rhsn, NODE * splatn, NODE * lhsn, int llen)
2150 2150
 {
2151 2151
     if (lhsn != 0) {
@@ -2265,7 +2265,7 @@ compile_massign(yarv_iseq_t *iseq, LINK_ANCHOR *ret,
2265 2265
 }
2266 2266
 
2267 2267
 static int
2268  
-compile_colon2(yarv_iseq_t *iseq, NODE * node,
  2268
+compile_colon2(rb_iseq_t *iseq, NODE * node,
2269 2269
 	       LINK_ANCHOR *pref, LINK_ANCHOR *body)
2270 2270
 {
2271 2271
     switch (nd_type(node)) {
@@ -2292,7 +2292,7 @@ compile_colon2(yarv_iseq_t *iseq, NODE * node,
2292 2292
 }
2293 2293
 
2294 2294
 static int
2295  
-compile_cpath(LINK_ANCHOR *ret, yarv_iseq_t *iseq, NODE *cpath)
  2295
+compile_cpath(LINK_ANCHOR *ret, rb_iseq_t *iseq, NODE *cpath)
2296 2296
 {
2297 2297
     if(cpath->nd_head) {
2298 2298
 	COMPILE(ret, "nd_else->nd_head", cpath->nd_head);
@@ -2307,7 +2307,7 @@ compile_cpath(LINK_ANCHOR *ret, yarv_iseq_t *iseq, NODE *cpath)
2307 2307
 }
2308 2308
 
2309 2309
 static int
2310  
-defined_expr(yarv_iseq_t *iseq, LINK_ANCHOR *ret,
  2310
+defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
2311 2311
 	     NODE * node, LABEL *lfinish, VALUE needstr)
2312 2312
 {
2313 2313
     char *estr = 0;
@@ -2490,7 +2490,7 @@ defined_expr(yarv_iseq_t *iseq, LINK_ANCHOR *ret,
2490 2490
 #define BUFSIZE 0x100
2491 2491
 
2492 2492
 static VALUE
2493  
-make_name_for_block(yarv_iseq_t *iseq)
  2493
+make_name_for_block(rb_iseq_t *iseq)
2494 2494
 {
2495 2495
     char buf[BUFSIZE];
2496 2496
     if (iseq->parent_iseq == 0) {
@@ -2498,7 +2498,7 @@ make_name_for_block(yarv_iseq_t *iseq)
2498 2498
     }
2499 2499
     else {
2500 2500
 	int level = 1;
2501  
-	yarv_iseq_t *ip = iseq;
  2501
+	rb_iseq_t *ip = iseq;
2502 2502
 	while (1) {
2503 2503
 	    if (ip->local_iseq != ip) {
2504 2504
 		ip = ip->parent_iseq;
@@ -2523,7 +2523,7 @@ make_name_with_str(const char *fmt, const char *str)
2523 2523
 }
2524 2524
 
2525 2525
 static void
2526  
-add_ensure_range(yarv_iseq_t *iseq, struct ensure_range *erange,
  2526
+add_ensure_range(rb_iseq_t *iseq, struct ensure_range *erange,
2527 2527
 		 LABEL *lstart, LABEL *lend)
2528 2528
 {
2529 2529
     struct ensure_range *ne =
@@ -2541,7 +2541,7 @@ add_ensure_range(yarv_iseq_t *iseq, struct ensure_range *erange,
2541 2541
 }
2542 2542
 
2543 2543
 static void
2544  
-add_ensure_iseq(LINK_ANCHOR *ret, yarv_iseq_t *iseq)
  2544
+add_ensure_iseq(LINK_ANCHOR *ret, rb_iseq_t *iseq)
2545 2545
 {
2546 2546
     struct iseq_compile_data_ensure_node_stack *enlp =
2547 2547
 	iseq->compile_data->ensure_node_stack;
@@ -2567,7 +2567,7 @@ add_ensure_iseq(LINK_ANCHOR *ret, yarv_iseq_t *iseq)
2567 2567
 }
2568 2568
 
2569 2569
 static VALUE
2570  
-setup_arg(yarv_iseq_t *iseq, LINK_ANCHOR *args, NODE *node, VALUE *flag)
  2570
+setup_arg(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *node, VALUE *flag)
2571 2571
 {
2572 2572
     VALUE argc = INT2FIX(0);
2573 2573
     NODE *argn = node->nd_args;
@@ -2632,7 +2632,7 @@ setup_arg(yarv_iseq_t *iseq, LINK_ANCHOR *args, NODE *node, VALUE *flag)
2632 2632
   poped: This node will be poped
2633 2633
  */
2634 2634
 static int
2635  
-iseq_compile_each(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
  2635
+iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
2636 2636
 {
2637 2637
     VALUE tmp;			/* reserved for macro */
2638 2638
     int type;
@@ -3002,7 +3002,7 @@ iseq_compile_each(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
3002 3002
 	      COMPILE_ERROR(("Can't escape from eval with break"));
3003 3003
 	  }
3004 3004
 	  else {
3005  
-	      yarv_iseq_t *ip = iseq->parent_iseq;
  3005
+	      rb_iseq_t *ip = iseq->parent_iseq;
3006 3006
 	      while (ip) {
3007 3007
 		  level++;
3008 3008
 		  if (ip->compile_data->redo_label != 0) {
@@ -3041,7 +3041,7 @@ iseq_compile_each(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
3041 3041
 	      COMPILE_ERROR(("Can't escape from eval with next"));
3042 3042
 	  }
3043 3043
 	  else {
3044  
-	      yarv_iseq_t *ip = iseq->parent_iseq;
  3044
+	      rb_iseq_t *ip = iseq->parent_iseq;
3045 3045
 	      while (ip) {
3046 3046
 		  level = 0x8000;
3047 3047
 		  if (ip->type == ISEQ_TYPE_BLOCK) {
@@ -3085,7 +3085,7 @@ iseq_compile_each(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
3085 3085
 	      }
3086 3086
 	  }
3087 3087
 	  else {
3088  
-	      yarv_iseq_t *ip = iseq->parent_iseq;
  3088
+	      rb_iseq_t *ip = iseq->parent_iseq;
3089 3089
 	      unsigned long level = 0x8000 | 0x4000;
3090 3090
 	      while (ip) {
3091 3091
 		  if (ip->type == ISEQ_TYPE_BLOCK) {
@@ -3682,7 +3682,7 @@ iseq_compile_each(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
3682 3682
 	  else {
3683 3683
 	      /* NODE_ZSUPER */
3684 3684
 	      int i;
3685  
-	      yarv_iseq_t *liseq = iseq->local_iseq;
  3685
+	      rb_iseq_t *liseq = iseq->local_iseq;
3686 3686
 
3687 3687
 	      argc = INT2FIX(liseq->argc);
3688 3688
 
@@ -3779,7 +3779,7 @@ iseq_compile_each(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
3779 3779
 	  break;
3780 3780
       }
3781 3781
       case NODE_RETURN:{
3782  
-	  yarv_iseq_t *is = iseq;
  3782
+	  rb_iseq_t *is = iseq;
3783 3783
 
3784 3784
 	  while (is) {
3785 3785
 	      if (is->type == ISEQ_TYPE_TOP || is->type == ISEQ_TYPE_CLASS) {
@@ -4398,7 +4398,7 @@ iseq_compile_each(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
4398 4398
 			    INT2FIX(0));
4399 4399
 	      }
4400 4400
 	      else {
4401  
-		  yarv_iseq_t *ip = iseq;
  4401
+		  rb_iseq_t *ip = iseq;
4402 4402
 		  int level = 0;
4403 4403
 		  while (ip) {
4404 4404
 		      if (ip->type == ISEQ_TYPE_RESCUE) {
@@ -4588,7 +4588,7 @@ insn_data_to_s_detail(INSN *iobj)
4588 4588
 		break;
4589 4589
 	      case TS_ISEQ:	/* iseq */
4590 4590
 		{
4591  
-		    yarv_iseq_t *iseq = (yarv_iseq_t *)OPERAND_AT(iobj, j);
  4591
+		    rb_iseq_t *iseq = (rb_iseq_t *)OPERAND_AT(iobj, j);
4592 4592
 		    VALUE val = Qnil;
4593 4593
 		    if (iseq) {
4594 4594
 			val = iseq->self;
@@ -4692,7 +4692,7 @@ insns_name_array(void)
4692 4692
 }
4693 4693
 
4694 4694
 static LABEL *
4695  
-register_label(yarv_iseq_t *iseq, struct st_table *labels_table, VALUE obj)
  4695
+register_label(rb_iseq_t *iseq, struct st_table *labels_table, VALUE obj)
4696 4696
 {
4697 4697
     LABEL *label = 0;
4698 4698
     obj = rb_convert_type(obj, T_SYMBOL, "Symbol", "to_sym");
@@ -4732,7 +4732,7 @@ get_exception_sym2type(VALUE sym)
4732 4732
 VALUE iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt);
4733 4733
 
4734 4734
 static int
4735  
-iseq_build_exception(yarv_iseq_t *iseq, struct st_table *labels_table,
  4735
+iseq_build_exception(rb_iseq_t *iseq, struct st_table *labels_table,
4736 4736
 		     VALUE exception)
4737 4737
 {
4738 4738
     int i;
@@ -4767,7 +4767,7 @@ iseq_build_exception(yarv_iseq_t *iseq, struct st_table *labels_table,
4767 4767
 struct st_table *insn_make_insn_table(void);
4768 4768
 
4769 4769
 static int
4770  
-iseq_build_body(yarv_iseq_t *iseq, LINK_ANCHOR *anchor,
  4770
+iseq_build_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
4771 4771
 		VALUE body, VALUE line, struct st_table *labels_table)
4772 4772
 {
4773 4773
     /* TODO: body should be freezed */
@@ -4894,7 +4894,7 @@ iseq_build_body(yarv_iseq_t *iseq, LINK_ANCHOR *anchor,
4894 4894
 }
4895 4895
 
4896 4896
 VALUE
4897  
-iseq_build_from_ary(yarv_iseq_t *iseq, VALUE line,
  4897
+iseq_build_from_ary(rb_iseq_t *iseq, VALUE line,
4898 4898
 		    VALUE locals, VALUE args, VALUE exception, VALUE body)
4899 4899
 {
4900 4900
     int i;
2  compile.h
@@ -103,7 +103,7 @@ r_value(VALUE value)
103 103
 #define NEW_LABEL(l) new_label_body(iseq, l)
104 104
 
105 105
 #define iseq_filename(iseq) \
106  
-  (((yarv_iseq_t*)DATA_PTR(iseq))->file_name)
  106
+  (((rb_iseq_t*)DATA_PTR(iseq))->file_name)
107 107
 
108 108
 #define NEW_ISEQVAL(node, name, type)       \
109 109
   new_child_iseq(iseq, node, name, 0, type)
2  error.c
@@ -1473,7 +1473,7 @@ Init_syserr(void)
1473 1473
 static void
1474 1474
 err_append(const char *s)
1475 1475
 {
1476  
-  yarv_thread_t *th = GET_THREAD();
  1476
+  rb_thead_t *th = GET_THREAD();
1477 1477
   if (th->parse_in_eval) {
1478 1478
     if (NIL_P(th->errinfo)) {
1479 1479
       th->errinfo = rb_exc_new2(rb_eSyntaxError, s);
119  eval.c
@@ -182,7 +182,7 @@ ruby_cleanup(int ex)
182 182
 {
183 183
     int state;
184 184
     volatile VALUE err = GET_THREAD()->errinfo;
185  
-    yarv_vm_t *vm = GET_THREAD()->vm;
  185
+    rb_vm_t *vm = GET_THREAD()->vm;
186 186
 
187 187
     /* th->errinfo contains a NODE while break'ing */
188 188
     if (RTEST(err) && (TYPE(err) != T_NODE) &&
@@ -466,13 +466,6 @@ rb_frozen_class_p(VALUE klass)
466 466
 
467 467
 #define MATCH_DATA *rb_svar(node->nd_cnt)
468 468
 
469  
-static VALUE
470  
-rb_obj_is_proc(proc)
471  
-    VALUE proc;
472  
-{
473  
-    return yarv_obj_is_proc(proc);
474  
-}
475  
-
476 469
 void
477 470
 rb_add_event_hook(func, events)
478 471
     rb_event_hook_func_t func;
@@ -886,7 +879,7 @@ rb_mod_protected_method_defined(VALUE mod, VALUE mid)
886 879
     return Qfalse;
887 880
 }
888 881
 
889  
-NORETURN(void th_iter_break _((yarv_thread_t *)));
  882
+NORETURN(void th_iter_break _((rb_thead_t *)));
890 883
 
891 884
 void
892 885
 rb_iter_break()
@@ -903,7 +896,7 @@ rb_longjmp(tag, mesg)
903 896
     VALUE mesg;
904 897
 {
905 898
     VALUE at;
906  
-    yarv_thread_t *th = GET_THREAD();
  899
+    rb_thead_t *th = GET_THREAD();
907 900
 
908 901
     /*
909 902
     //while (th->cfp->pc == 0 || th->cfp->iseq == 0) {
@@ -1088,7 +1081,7 @@ rb_jump_tag(tag)
1088 1081
 int
1089 1082
 rb_block_given_p()
1090 1083
 {
1091  
-    yarv_thread_t *th = GET_THREAD();
  1084
+    rb_thead_t *th = GET_THREAD();
1092 1085
     if (GC_GUARDED_PTR_REF(th->cfp->lfp[0])) {
1093 1086
 	return Qtrue;
1094 1087
     }
@@ -1128,9 +1121,9 @@ rb_iterator_p()
1128 1121
 VALUE
1129 1122
 rb_f_block_given_p()
1130 1123
 {
1131  
-    yarv_thread_t *th = GET_THREAD();
1132  
-    yarv_control_frame_t *cfp = th->cfp;
1133  
-    cfp = th_get_ruby_level_cfp(th, YARV_PREVIOUS_CONTROL_FRAME(cfp));
  1124
+    rb_thead_t *th = GET_THREAD();
  1125
+    rb_control_frame_t *cfp = th->cfp;
  1126
+    cfp = th_get_ruby_level_cfp(th, RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp));
1134 1127
     if (GC_GUARDED_PTR_REF(cfp->lfp[0])) {
1135 1128
 	return Qtrue;
1136 1129
     }
@@ -1245,15 +1238,15 @@ rb_iterate(VALUE (*it_proc) (VALUE), VALUE data1,
1245 1238
     int state;
1246 1239
     volatile VALUE retval = Qnil;
1247 1240
     NODE *node = NEW_IFUNC(bl_proc, data2);
1248  
-    yarv_thread_t *th = GET_THREAD();
1249  
-    yarv_control_frame_t *cfp = th->cfp;
  1241
+    rb_thead_t *th = GET_THREAD();
  1242
+    rb_control_frame_t *cfp = th->cfp;
1250 1243
 
1251 1244
     TH_PUSH_TAG(th);
1252 1245
     state = TH_EXEC_TAG();
1253 1246
     if (state == 0) {
1254 1247
       iter_retry:
1255 1248
 	{
1256  
-	    yarv_block_t *blockptr = GET_BLOCK_PTR_IN_CFP(th->cfp);
  1249
+	    rb_block_t *blockptr = RUBY_VM_GET_BLOCK_PTR_IN_CFP(th->cfp);
1257 1250
 	    blockptr->iseq = (void *)node;
1258 1251
 	    blockptr->proc = 0;
1259 1252
 	    th->passed_block = blockptr;
@@ -1524,7 +1517,7 @@ rb_method_missing(int argc, const VALUE *argv, VALUE obj)
1524 1517
     VALUE exc = rb_eNoMethodError;
1525 1518
     char *format = 0;
1526 1519
     NODE *cnode = ruby_current_node;
1527  
-    yarv_thread_t *th = GET_THREAD();
  1520
+    rb_thead_t *th = GET_THREAD();
1528 1521
     int last_call_status = th->method_missing_reason;
1529 1522
     if (argc == 0 || !SYMBOL_P(argv[0])) {
1530 1523
 	rb_raise(rb_eArgError, "no id given");
@@ -1716,8 +1709,8 @@ VALUE
1716 1709
 rb_f_send(int argc, VALUE *argv, VALUE recv)
1717 1710
 {
1718 1711
     int scope = NOEX_PUBLIC;
1719  
-    yarv_thread_t *th = GET_THREAD();
1720  
-    yarv_control_frame_t *cfp = YARV_PREVIOUS_CONTROL_FRAME(th->cfp);
  1712
+    rb_thead_t *th = GET_THREAD();
  1713
+    rb_control_frame_t *cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
1721 1714
 
1722 1715
     if (SPECIAL_CONST_P(cfp->sp[0])) {
1723 1716
 	scope = NOEX_NOSUPER | NOEX_PRIVATE;
@@ -1856,13 +1849,13 @@ make_backtrace(void)
1856 1849
 }
1857 1850
 
1858 1851
 static ID
1859  
-frame_func_id(yarv_control_frame_t *cfp)
  1852
+frame_func_id(rb_control_frame_t *cfp)
1860 1853
 {
1861  
-    yarv_iseq_t *iseq = cfp->iseq;
  1854
+    rb_iseq_t *iseq = cfp->iseq;
1862 1855
     if (!iseq) {
1863 1856
 	return cfp->method_id;
1864 1857
     }
1865  
-    else if (YARV_IFUNC_P(iseq)) {
  1858
+    else if (RUBY_VM_IFUNC_P(iseq)) {
1866 1859
 	return rb_intern("<ifunc>");
1867 1860
     }
1868 1861
     else {
@@ -1879,8 +1872,8 @@ rb_frame_this_func(void)
1879 1872
 ID
1880 1873
 rb_frame_callee(void)
1881 1874
 {
1882  
-    yarv_thread_t *th = GET_THREAD();
1883  
-    yarv_control_frame_t *prev_cfp = YARV_PREVIOUS_CONTROL_FRAME(th->cfp);
  1875
+    rb_thead_t *th = GET_THREAD();
  1876
+    rb_control_frame_t *prev_cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
1884 1877
     /* check if prev_cfp can be accessible */
1885 1878
     if ((void *)(th->stack + th->stack_size) == (void *)(prev_cfp)) {
1886 1879
         return 0;
@@ -1891,8 +1884,8 @@ rb_frame_callee(void)
1891 1884
 void
1892 1885
 rb_frame_pop(void)
1893 1886
 {
1894  
-    yarv_thread_t *th = GET_THREAD();
1895  
-    th->cfp = YARV_PREVIOUS_CONTROL_FRAME(th->cfp);
  1887
+    rb_thead_t *th = GET_THREAD();
  1888
+    th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
1896 1889
 }
1897 1890
 
1898 1891
 static VALUE
@@ -1904,8 +1897,8 @@ rb_frame_self(void)
1904 1897
 const char *
1905 1898
 rb_sourcefile(void)
1906 1899
 {
1907  
-    yarv_iseq_t *iseq = GET_THREAD()->cfp->iseq;
1908  
-    if (YARV_NORMAL_ISEQ_P(iseq)) {
  1900
+    rb_iseq_t *iseq = GET_THREAD()->cfp->iseq;
  1901
+    if (RUBY_VM_NORMAL_ISEQ_P(iseq)) {
1909 1902
 	return RSTRING_PTR(iseq->file_name);
1910 1903
     }
1911 1904
     return 0;
@@ -1914,12 +1907,12 @@ rb_sourcefile(void)
1914 1907
 int
1915 1908
 rb_sourceline(void)
1916 1909
 {
1917  
-    yarv_thread_t *th = GET_THREAD();
  1910
+    rb_thead_t *th = GET_THREAD();
1918 1911
     return th_get_sourceline(th->cfp);
1919 1912
 }
1920 1913
 
1921  
-VALUE th_set_eval_stack(yarv_thread_t *, VALUE iseq);
1922  
-VALUE th_eval_body(yarv_thread_t *);
  1914
+VALUE th_set_eval_stack(rb_thead_t *, VALUE iseq);
  1915
+VALUE th_eval_body(rb_thead_t *);
1923 1916
 
1924 1917
 static VALUE
1925 1918
 eval(VALUE self, VALUE src, VALUE scope, char *file, int line)
@@ -1927,9 +1920,9 @@ eval(VALUE self, VALUE src, VALUE scope, char *file, int line)
1927 1920
     int state;
1928 1921
     VALUE result = Qundef;
1929 1922
     VALUE envval;
1930  
-    yarv_binding_t *bind = 0;
1931  
-    yarv_thread_t *th = GET_THREAD();
1932  
-    yarv_env_t *env = NULL;
  1923
+    rb_binding_t *bind = 0;
  1924
+    rb_thead_t *th = GET_THREAD();
  1925
+    rb_env_t *env = NULL;
1933 1926
     NODE *stored_cref_stack = 0;
1934 1927
 
1935 1928
     if (file == 0) {
@@ -1939,7 +1932,7 @@ eval(VALUE self, VALUE src, VALUE scope, char *file, int line)
1939 1932
     }
1940 1933
     PUSH_TAG(PROT_NONE);
1941 1934
     if ((state = EXEC_TAG()) == 0) {
1942  
-	yarv_iseq_t *iseq;
  1935
+	rb_iseq_t *iseq;
1943 1936
 	VALUE iseqval;
1944 1937
 
1945 1938
 	if (scope != Qnil) {
@@ -1958,8 +1951,8 @@ eval(VALUE self, VALUE src, VALUE scope, char *file, int line)
1958 1951
 	    th->base_block = &env->block;
1959 1952
 	}
1960 1953
 	else {
1961  
-	    yarv_control_frame_t *cfp = th_get_ruby_level_cfp(th, th->cfp);
1962  
-	    th->base_block = GET_BLOCK_PTR_IN_CFP(cfp);
  1954
+	    rb_control_frame_t *cfp = th_get_ruby_level_cfp(th, th->cfp);
  1955
+	    th->base_block = RUBY_VM_GET_BLOCK_PTR_IN_CFP(cfp);
1963 1956
 	    th->base_block->iseq = cfp->iseq;	/* TODO */
1964 1957
 	}
1965 1958
 
@@ -2065,22 +2058,22 @@ rb_f_eval(int argc, VALUE *argv, VALUE self)
2065 2058
     return eval(self, src, scope, file, line);
2066 2059
 }
2067 2060
 
2068  
-VALUE *th_cfp_svar(yarv_control_frame_t *cfp, int idx);
  2061
+VALUE *th_cfp_svar(rb_control_frame_t *cfp, int idx);
2069 2062
 
2070 2063
 /* function to call func under the specified class/module context */
2071 2064
 static VALUE
2072 2065
 exec_under(VALUE (*func) (VALUE), VALUE under, VALUE self, VALUE args)
2073 2066
 {
2074 2067
     VALUE val = Qnil;		/* OK */
2075  
-    yarv_thread_t *th = GET_THREAD();
2076  
-    yarv_control_frame_t *cfp = th->cfp;
2077  
-    yarv_control_frame_t *pcfp = YARV_PREVIOUS_CONTROL_FRAME(cfp);
  2068
+    rb_thead_t *th = GET_THREAD();
  2069
+    rb_control_frame_t *cfp = th->cfp;
  2070
+    rb_control_frame_t *pcfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
2078 2071
     VALUE stored_self = pcfp->self;
2079 2072
     NODE *stored_cref = 0;
2080 2073
     NODE **pcref = 0;
2081 2074
 
2082  
-    yarv_block_t block;
2083  
-    yarv_block_t *blockptr;
  2075
+    rb_block_t block;
  2076
+    rb_block_t *blockptr;
2084 2077
     int state;
2085 2078
 
2086 2079
     /* replace environment */
@@ -2093,8 +2086,8 @@ exec_under(VALUE (*func) (VALUE), VALUE under, VALUE self, VALUE args)
2093 2086
 	*th->cfp->lfp = GC_GUARDED_PTR(&block);
2094 2087
     }
2095 2088
 
2096  
-    while (!YARV_NORMAL_ISEQ_P(cfp->iseq)) {
2097  
-	cfp = YARV_PREVIOUS_CONTROL_FRAME(cfp);
  2089
+    while (!RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
  2090
+	cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
2098 2091
     }
2099 2092
     
2100 2093
     pcref = (NODE **) th_cfp_svar(cfp, -1);
@@ -2727,12 +2720,12 @@ VALUE rb_f_untrace_var();
2727 2720
 static VALUE
2728 2721
 get_errinfo(void)
2729 2722
 {
2730  
-    yarv_thread_t *th = GET_THREAD();
2731  
-    yarv_control_frame_t *cfp = th->cfp;
2732  
-    yarv_control_frame_t *end_cfp = YARV_END_CONTROL_FRAME(th);
  2723
+    rb_thead_t *th = GET_THREAD();
  2724
+    rb_control_frame_t *cfp = th->cfp;
  2725
+    rb_control_frame_t *end_cfp = RUBY_VM_END_CONTROL_FRAME(th);
2733 2726
 
2734  
-    while (YARV_VALID_CONTROL_FRAME_P(cfp, end_cfp)) {
2735  
-	if (YARV_NORMAL_ISEQ_P(cfp->iseq)) {
  2727
+    while (RUBY_VM_VALID_CONTROL_FRAME_P(cfp, end_cfp)) {
  2728
+	if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
2736 2729
 	    if (cfp->iseq->type == ISEQ_TYPE_RESCUE) {
2737 2730
 		return cfp->dfp[-1];
2738 2731
 	    }
@@ -2741,7 +2734,7 @@ get_errinfo(void)
2741 2734
 		return cfp->dfp[-1];
2742 2735
 	    }
2743 2736
 	}
2744  
-	cfp = YARV_PREVIOUS_CONTROL_FRAME(cfp);
  2737
+	cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
2745 2738
     }
2746 2739
     return Qnil;
2747 2740
 }
@@ -2810,15 +2803,15 @@ errat_setter(VALUE val, ID id, VALUE *var)
2810 2803
  *     local_variables   #=> ["fred", "i"]
2811 2804
  */
2812 2805
 
2813  
-int th_collect_local_variables_in_heap(yarv_thread_t *th, VALUE *dfp, VALUE ary);
  2806
+int th_collect_local_variables_in_heap(rb_thead_t *th, VALUE *dfp, VALUE ary);
2814 2807
 
2815 2808
 static VALUE
2816 2809
 rb_f_local_variables(void)
2817 2810
 {
2818 2811
     VALUE ary = rb_ary_new();
2819  
-    yarv_thread_t *th = GET_THREAD();
2820  
-    yarv_control_frame_t *cfp =
2821  
-	th_get_ruby_level_cfp(th, YARV_PREVIOUS_CONTROL_FRAME(th->cfp));
  2812
+    rb_thead_t *th = GET_THREAD();
  2813
+    rb_control_frame_t *cfp =
  2814
+	th_get_ruby_level_cfp(th, RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp));
2822 2815
     int i;
2823 2816
 
2824 2817
     while (1) {
@@ -2843,7 +2836,7 @@ rb_f_local_variables(void)
2843 2836
 	    }
2844 2837
 	    else {
2845 2838
 		while (cfp->dfp != dfp) {
2846  
-		    cfp = YARV_PREVIOUS_CONTROL_FRAME(cfp);
  2839
+		    cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
2847 2840
 		}
2848 2841
 	    }
2849 2842
 	}
@@ -2960,8 +2953,8 @@ Init_eval()
2960 2953
 VALUE
2961 2954
 rb_dvar_defined(ID id)
2962 2955
 {
2963  
-    yarv_thread_t *th = GET_THREAD();
2964  
-    yarv_iseq_t *iseq;
  2956
+    rb_thead_t *th = GET_THREAD();
  2957
+    rb_iseq_t *iseq;
2965 2958
     if (th->base_block && (iseq = th->base_block->iseq)) {
2966 2959
 	while (iseq->type == ISEQ_TYPE_BLOCK ||
2967 2960
 	       iseq->type == ISEQ_TYPE_RESCUE ||
@@ -2984,7 +2977,7 @@ rb_dvar_defined(ID id)
2984 2977
 void
2985 2978
 rb_scope_setup_top_local_tbl(ID *tbl)
2986 2979
 {
2987  
-    yarv_thread_t *th = GET_THREAD();
  2980
+    rb_thead_t *th = GET_THREAD();
2988 2981
     if (tbl) {
2989 2982
 	if (th->top_local_tbl) {
2990 2983
 	    xfree(th->top_local_tbl);
@@ -3000,7 +2993,7 @@ rb_scope_setup_top_local_tbl(ID *tbl)
3000 2993
 int
3001 2994
 rb_scope_base_local_tbl_size(void)
3002 2995
 {
3003  
-    yarv_thread_t *th = GET_THREAD();
  2996
+    rb_thead_t *th = GET_THREAD();
3004 2997
     if (th->base_block) {
3005 2998
 	return th->base_block->iseq->local_iseq->local_size +
3006 2999
 	    2 /* $_, $~ */  - 1 /* svar */ ;
@@ -3013,7 +3006,7 @@ rb_scope_base_local_tbl_size(void)
3013 3006
 ID
3014 3007
 rb_scope_base_local_tbl_id(int i)
3015 3008
 {
3016  
-    yarv_thread_t *th = GET_THREAD();
  3009
+    rb_thead_t *th = GET_THREAD();
3017 3010
     switch (i) {
3018 3011
     case 0:
3019 3012
 	return rb_intern("$_");
@@ -3028,7 +3021,7 @@ rb_scope_base_local_tbl_id(int i)
3028 3021
 int
3029 3022
 rb_dvar_current(void)
3030 3023
 {
3031  
-    yarv_thread_t *th = GET_THREAD();
  3024
+    rb_thead_t *th = GET_THREAD();
3032 3025
     if (th->base_block) {
3033 3026
 	return 1;
3034 3027
     }
2  eval_error.h
@@ -198,7 +198,7 @@ static int
198 198
 error_handle(int ex)
199 199
 {
200 200
     int status = EXIT_FAILURE;
201  
-    yarv_thread_t *th = GET_THREAD();
  201
+    rb_thead_t *th = GET_THREAD();
202 202
 
203 203
     if (thread_set_raised(th))
204 204
 	return EXIT_FAILURE;
38  eval_intern.h
@@ -4,7 +4,7 @@
4 4
 
5 5
 #define PASS_PASSED_BLOCK() \
6 6
   (GET_THREAD()->passed_block = \
7  
-   GC_GUARDED_PTR_REF((yarv_block_t *)GET_THREAD()->cfp->lfp[0]))
  7
+   GC_GUARDED_PTR_REF((rb_block_t *)GET_THREAD()->cfp->lfp[0]))
8 8
 
9 9
 
10 10
 #define UNSUPPORTED(func) \
@@ -189,8 +189,8 @@ extern int function_call_may_return_twice_false;
189 189
 #include <sys/stat.h>
190 190
 
191 191
 #define TH_PUSH_TAG(th) do { \
192  
-  yarv_thread_t * const _th = th; \
193  
-  struct yarv_tag _tag; \
  192
+  rb_thead_t * const _th = th; \
  193
+  struct rb_vm_tag _tag; \
194 194
   _tag.tag = 0; \
195 195
   _tag.prev = _th->tag; \
196 196
   _th->tag = &_tag;
@@ -278,8 +278,8 @@ extern VALUE sysstack_error;
278 278
 void rb_thread_cleanup _((void));
279 279
 void rb_thread_wait_other_threads _((void));
280 280
 
281  
-int thread_set_raised(yarv_thread_t *th);
282  
-int thread_reset_raised(yarv_thread_t *th);
  281
+int thread_set_raised(rb_thead_t *th);
  282
+int thread_reset_raised(rb_thead_t *th);
283 283
 
284 284
 VALUE rb_f_eval(int argc, VALUE *argv, VALUE self);
285 285
 VALUE rb_make_exception _((int argc, VALUE *argv));
@@ -289,23 +289,22 @@ NORETURN(void print_undef _((VALUE, ID)));
289 289
 NORETURN(void th_localjump_error(const char *, VALUE, int));
290 290
 NORETURN(void th_jump_tag_but_local_jump(int, VALUE));
291 291
 
292  
-rb_thread_t rb_vm_curr_thread();
293  
-VALUE th_compile(yarv_thread_t *th, VALUE str, VALUE file, VALUE line);
  292
+VALUE th_compile(rb_thead_t *th, VALUE str, VALUE file, VALUE line);
294 293
 
295  
-NODE *th_get_cref(yarv_thread_t *th, yarv_iseq_t *iseq, yarv_control_frame_t *cfp);
296  
-NODE *th_cref_push(yarv_thread_t *th, VALUE, int);
297  
-NODE *th_set_special_cref(yarv_thread_t *th, VALUE *lfp, NODE * cref_stack);
  294
+NODE *th_get_cref(rb_thead_t *th, rb_iseq_t *iseq, rb_control_frame_t *cfp);
  295
+NODE *th_cref_push(rb_thead_t *th, VALUE, int);
  296
+NODE *th_set_special_cref(rb_thead_t *th, VALUE *lfp, NODE * cref_stack);
298 297
 
299  
-static yarv_control_frame_t *
300  
-th_get_ruby_level_cfp(yarv_thread_t *th, yarv_control_frame_t *cfp)
  298
+static rb_control_frame_t *
  299
+th_get_ruby_level_cfp(rb_thead_t *th, rb_control_frame_t *cfp)
301 300
 {
302  
-    yarv_iseq_t *iseq = 0;
303  
-    while (!YARV_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp)) {
304  
-	if (YARV_NORMAL_ISEQ_P(cfp->iseq)) {
  301
+    rb_iseq_t *iseq = 0;
  302
+    while (!RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp)) {
  303
+	if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
305 304
 	    iseq = cfp->iseq;
306 305
 	    break;
307 306
 	}
308  
-	cfp = YARV_PREVIOUS_CONTROL_FRAME(cfp);
  307
+	cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
309 308
     }
310 309
     if (!iseq) {
311 310
 	return 0;
@@ -316,12 +315,13 @@ th_get_ruby_level_cfp(yarv_thread_t *th, yarv_control_frame_t *cfp)
316 315
 static NODE *
317 316
 ruby_cref()
318 317
 {
319  
-    yarv_thread_t *th = GET_THREAD();
320  
-    yarv_control_frame_t *cfp = th_get_ruby_level_cfp(th, th->cfp);
  318
+    rb_thead_t *th = GET_THREAD();
  319
+    rb_control_frame_t *cfp = th_get_ruby_level_cfp(th, th->cfp);
321 320
     return th_get_cref(th, cfp->iseq, cfp);
322 321
 }
323 322
 
324  
-VALUE th_get_cbase(yarv_thread_t *th);
  323
+VALUE th_get_cbase(rb_thead_t *th);
  324
+VALUE rb_obj_is_proc(VALUE);
325 325
 
326 326
 #define ruby_cbase() th_get_cbase(GET_THREAD())
327 327
 
8  eval_jump.h
@@ -22,8 +22,8 @@ static VALUE
22 22
 rb_f_throw(int argc, VALUE *argv)
23 23
 {
24 24
     VALUE tag, value;
25  
-    yarv_thread_t *th = GET_THREAD();
26