ytljit 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/ytljit/vm.rb CHANGED
@@ -110,7 +110,7 @@ LocalVarNode
110
110
  if @my_element_node == nil then
111
111
  @my_element_node = BaseNode.new(self)
112
112
  end
113
- @element_node_list = [[sig, @my_element_node]]
113
+ @element_node_list = [[sig, @my_element_node, nil]]
114
114
  end
115
115
  end
116
116
  end
@@ -137,7 +137,7 @@ LocalVarNode
137
137
  if @my_element_node == nil then
138
138
  @my_element_node = BaseNode.new(self)
139
139
  end
140
- @element_node_list = [[sig, @my_element_node]]
140
+ @element_node_list = [[sig, @my_element_node, nil]]
141
141
  end
142
142
  end
143
143
  end
@@ -173,9 +173,12 @@ LocalVarNode
173
173
  @my_element_node = nil
174
174
  @type_inference_proc = cs
175
175
  @type_cache = nil
176
+ @is_escape = false
176
177
 
177
178
  @ti_observer = {}
178
179
  @ti_observee = []
180
+
181
+ @debug_info = nil
179
182
  end
180
183
 
181
184
  attr_accessor :parent
@@ -184,10 +187,13 @@ LocalVarNode
184
187
 
185
188
  attr_accessor :type
186
189
  attr_accessor :element_node_list
190
+ attr_accessor :is_escape
187
191
 
188
192
  attr :ti_observer
189
193
  attr :ti_observee
190
194
 
195
+ attr_accessor :debug_info
196
+
191
197
  def collect_info(context)
192
198
  if is_a?(HaveChildlenMixin) then
193
199
  traverse_childlen {|rec|
@@ -296,6 +302,8 @@ LocalVarNode
296
302
  dst.ti_changed
297
303
  context.convergent = false
298
304
  end
305
+
306
+ dst.is_escape ||= src.is_escape
299
307
  end
300
308
 
301
309
  def same_type(dst, src, dsig, ssig, context)
@@ -319,15 +327,27 @@ LocalVarNode
319
327
  ti_update(dst, src, dsig, ssig, context)
320
328
  end
321
329
 
322
- def add_element_node(sig, enode, context)
330
+ def add_element_node(sig, enode, index, context)
323
331
  slfetnode = @element_node_list
324
332
  unless slfetnode.include?(enode)
325
- @element_node_list.push [sig, enode]
333
+ if @element_node_list == nil and index != nil then
334
+ @element_node_list.push [sig, enode, nil]
335
+ end
336
+ @element_node_list.push [sig, enode, index]
326
337
  orgsig = @element_node_list[0][0]
327
338
  orgnode = @element_node_list[0][1]
328
339
  if orgnode != enode then
329
340
  same_type(orgnode, enode, orgsig, sig, context)
330
341
  end
342
+ if index != nil then
343
+ @element_node_list.each do |orgsig, orgnode, orgindex|
344
+ if orgindex == index and
345
+ orgnode != enode then
346
+ same_type(orgnode, enode, orgsig, sig, context)
347
+ end
348
+ end
349
+ end
350
+
331
351
  ti_changed
332
352
  # context.convergent = false
333
353
  end
@@ -338,17 +358,18 @@ LocalVarNode
338
358
  context
339
359
  end
340
360
 
341
- def decide_type_core(tlist)
361
+ def decide_type_core(tlist, local_cache = {})
342
362
  tlist = tlist.select {|e| e.class != RubyType::DefaultType0 }
343
363
  case tlist.size
344
364
  when 0
345
365
  RubyType::DefaultType0.new
346
366
 
347
367
  when 1
368
+ local_cache[self] = tlist[0]
348
369
  if tlist[0].have_element? then
349
370
  sig = @element_node_list[0][0]
350
371
  node = @element_node_list[0][1]
351
- node.decide_type_once(sig)
372
+ node.decide_type_once(sig, local_cache)
352
373
  tlist[0].element_type = node.type
353
374
  end
354
375
  tlist[0]
@@ -360,18 +381,25 @@ LocalVarNode
360
381
  else
361
382
  tlist[1]
362
383
  end
384
+
363
385
  else
364
386
  RubyType::DefaultType0.new
365
387
  end
366
388
  end
367
389
 
368
- def decide_type_once(sig)
390
+ def decide_type_once(sig, local_cache = {})
391
+ if local_cache[self] then
392
+ return local_cache[self]
393
+ end
394
+
369
395
  if @type.equal?(nil) or @type.is_a?(RubyType::DefaultType0) then
370
396
  tlist = type_list(sig).flatten.uniq
371
- @type = decide_type_core(tlist)
397
+ @type = decide_type_core(tlist, local_cache)
372
398
  else
373
399
  @type
374
400
  end
401
+
402
+ @type
375
403
  end
376
404
 
377
405
  def decide_type(sig)
@@ -511,9 +539,7 @@ LocalVarNode
511
539
  context.start_using_reg(TMPR2)
512
540
 
513
541
  context = gen_make_argv(context) do |context, rarg|
514
- context.start_using_reg(FUNC_ARG[0])
515
- context.start_using_reg(FUNC_ARG[1])
516
- context.start_using_reg(FUNC_ARG[2])
542
+ context.start_arg_reg
517
543
 
518
544
  context.cpustack_pushn(3 * AsmType::MACHINE_WORD.size)
519
545
  casm = context.assembler
@@ -521,27 +547,25 @@ LocalVarNode
521
547
  casm.mov(FUNC_ARG[0], rarg.size) # argc
522
548
  casm.mov(FUNC_ARG[1], TMPR2) # argv
523
549
  end
524
- context.set_reg_content(FUNC_ARG[0], nil)
525
- context.set_reg_content(FUNC_ARG[1], TMPR2)
550
+ context.set_reg_content(FUNC_ARG[0].dst_opecode, nil)
551
+ context.set_reg_content(FUNC_ARG[1].dst_opecode, TMPR2)
526
552
 
527
553
  # Method Select
528
554
  # it is legal. use TMPR2 for method select
529
- # use TMPR3 for store self
555
+ # use PTMPR for store self
530
556
  context = @func.compile(context)
531
557
  fnc = context.ret_reg
532
558
  casm.with_retry do
533
559
  casm.mov(FUNC_ARG[2], context.ret_reg2) # self
534
560
  end
535
- context.set_reg_content(FUNC_ARG[2], context.ret_node)
561
+ context.set_reg_content(FUNC_ARG[2].dst_opecode, context.ret_node)
536
562
 
537
563
  context = gen_call(context, fnc, 3)
538
564
  context.cpustack_popn(3 * AsmType::MACHINE_WORD.size)
539
-
540
- context.end_using_reg(FUNC_ARG[2])
541
- context.end_using_reg(FUNC_ARG[1])
542
- context.end_using_reg(FUNC_ARG[0])
565
+ context.end_arg_reg
543
566
  context.end_using_reg(TMPR2)
544
567
  context.ret_reg = RETR
568
+ context.set_reg_content(context.ret_reg, self)
545
569
  context.ret_node = self
546
570
 
547
571
  decide_type_once(context.to_signature)
@@ -557,9 +581,7 @@ LocalVarNode
557
581
  fnc = nil
558
582
  numarg = @arguments.size - 2
559
583
 
560
- numarg.times do |i|
561
- context.start_using_reg(FUNC_ARG[i])
562
- end
584
+ context.start_arg_reg
563
585
  context.cpustack_pushn(numarg * AsmType::MACHINE_WORD.size)
564
586
 
565
587
  argpos = 0
@@ -575,14 +597,15 @@ LocalVarNode
575
597
  # Self
576
598
  # Method Select
577
599
  # it is legal. use TMPR2 for method select
578
- # use TMPR3 for store self
600
+ # use PTMPR for store self
579
601
  context = @func.compile(context)
580
602
  fnc = context.ret_reg
581
603
  casm = context.assembler
582
604
  casm.with_retry do
583
605
  casm.mov(FUNC_ARG[0], context.ret_reg2)
584
606
  end
585
- context.set_reg_content(FUNC_ARG[0], context.ret_node)
607
+ context.set_reg_content(FUNC_ARG[0].dst_opecode,
608
+ context.ret_node)
586
609
  else
587
610
  # other arg.
588
611
  context = arg.compile(context)
@@ -593,7 +616,8 @@ LocalVarNode
593
616
  casm.with_retry do
594
617
  casm.mov(FUNC_ARG[argpos], context.ret_reg)
595
618
  end
596
- context.set_reg_content(FUNC_ARG[argpos], context.ret_node)
619
+ context.set_reg_content(FUNC_ARG[argpos].dst_opecode,
620
+ context.ret_node)
597
621
  end
598
622
  argpos = argpos + 1
599
623
  cursrc = cursrc + 1
@@ -602,11 +626,10 @@ LocalVarNode
602
626
  context = gen_call(context, fnc, numarg)
603
627
 
604
628
  context.cpustack_popn(numarg * AsmType::MACHINE_WORD.size)
605
- numarg.times do |i|
606
- context.end_using_reg(FUNC_ARG[numarg - i - 1])
607
- end
629
+ context.end_arg_reg
608
630
  context.end_using_reg(fnc)
609
631
  context.ret_reg = RETR
632
+ context.set_reg_content(context.ret_reg, self)
610
633
 
611
634
  decide_type_once(context.to_signature)
612
635
  if !@type.boxed then
@@ -620,9 +643,8 @@ LocalVarNode
620
643
  fnc = nil
621
644
  numarg = @arguments.size
622
645
 
623
- numarg.times do |i|
624
- context.start_using_reg(FUNC_ARG_YTL[i])
625
- end
646
+ context.start_arg_reg
647
+ context.start_arg_reg(FUNC_ARG_YTL)
626
648
  context.cpustack_pushn(numarg * 8)
627
649
 
628
650
  # push prev env
@@ -633,12 +655,12 @@ LocalVarNode
633
655
  casm.mov(TMPR, prevenv)
634
656
  casm.mov(FUNC_ARG_YTL[0], TMPR)
635
657
  end
636
- context.set_reg_content(FUNC_ARG_YTL[0], prevenv)
658
+ context.set_reg_content(FUNC_ARG_YTL[0].dst_opecode, prevenv)
637
659
  else
638
660
  casm.with_retry do
639
661
  casm.mov(FUNC_ARG_YTL[0], BPR)
640
662
  end
641
- context.set_reg_content(FUNC_ARG_YTL[0], BPR)
663
+ context.set_reg_content(FUNC_ARG_YTL[0].dst_opecode, BPR)
642
664
  end
643
665
 
644
666
  # block
@@ -647,6 +669,7 @@ LocalVarNode
647
669
 
648
670
  # compile block with other code space and context
649
671
  tcontext = context.dup
672
+ tcontext.prev_context = context
650
673
  @arguments[1].compile(tcontext)
651
674
 
652
675
  casm = context.assembler
@@ -658,34 +681,77 @@ LocalVarNode
658
681
  casm.with_retry do
659
682
  casm.mov(FUNC_ARG_YTL[i + 3], context.ret_reg)
660
683
  end
661
- context.set_reg_content(FUNC_ARG_YTL[i + 3], context.ret_node)
684
+ context.set_reg_content(FUNC_ARG_YTL[i + 3].dst_opecode,
685
+ context.ret_node)
662
686
  end
663
687
 
664
688
  casm.with_retry do
665
689
  entry = @arguments[1].code_space.var_base_immidiate_address
666
690
  casm.mov(FUNC_ARG_YTL[1], entry)
667
691
  end
668
- context.set_reg_content(FUNC_ARG_YTL[1], nil)
692
+ context.set_reg_content(FUNC_ARG_YTL[1].dst_opecode, nil)
669
693
 
670
694
  # self
671
695
  # Method Select
672
696
  # it is legal. use TMPR2 for method select
673
- # use TMPR3 for store self
697
+ # use PTMPR for store self
674
698
  context = @func.compile(context)
675
699
  fnc = context.ret_reg
676
700
  casm = context.assembler
677
701
  casm.with_retry do
678
702
  casm.mov(FUNC_ARG_YTL[2], context.ret_reg2)
679
703
  end
680
- context.set_reg_content(FUNC_ARG_YTL[2], @arguments[2])
704
+ context.set_reg_content(FUNC_ARG_YTL[2].dst_opecode, @arguments[2])
681
705
 
682
706
  context = gen_call(context, fnc, numarg)
683
707
 
684
708
  context.cpustack_popn(numarg * 8)
685
- numarg.size.times do |i|
686
- context.end_using_reg(FUNC_ARG_YTL[numarg - i])
709
+ context.end_arg_reg
710
+ context.end_arg_reg(FUNC_ARG_YTL)
711
+ context.end_using_reg(fnc)
712
+ context
713
+ end
714
+
715
+ def compile_c_fixarg_raw(context)
716
+ context = @func.compile(context)
717
+ fnc = context.ret_reg
718
+ numarg = @arguments.size
719
+
720
+ context.start_arg_reg
721
+ context.cpustack_pushn(numarg * AsmType::MACHINE_WORD.size)
722
+
723
+ @arguments.each_with_index do |arg, argpos|
724
+ # p "#{@func.name} #{argpos}"
725
+ context = arg.compile(context)
726
+ rtype = context.ret_node.decide_type_once(context.to_signature)
727
+
728
+ atype = @func.arg_type[argpos]
729
+ if atype == :"..." or atype == nil then
730
+ if @func.arg_type.last == :"..." then
731
+ atype = @func.arg_type[-2]
732
+ end
733
+ end
734
+ if atype == :VALUE then
735
+ context = rtype.gen_boxing(context)
736
+ end
737
+
738
+ casm = context.assembler
739
+ casm.with_retry do
740
+ casm.mov(FUNC_ARG[argpos], context.ret_reg)
741
+ end
742
+ context.set_reg_content(FUNC_ARG[argpos].dst_opecode,
743
+ context.ret_node)
687
744
  end
745
+
746
+ context = gen_call(context, fnc, numarg)
747
+
748
+ context.cpustack_popn(numarg * AsmType::MACHINE_WORD.size)
749
+ context.end_arg_reg
688
750
  context.end_using_reg(fnc)
751
+ context.ret_reg = RETR
752
+ context.set_reg_content(context.ret_reg, self)
753
+
754
+ decide_type_once(context.to_signature)
689
755
  context
690
756
  end
691
757
  end
@@ -761,21 +827,59 @@ LocalVarNode
761
827
  end
762
828
  end
763
829
 
764
- def construct_frame_info(locals, argnum)
830
+ def add_arg_to_args(args, addnum)
831
+ if args.is_a?(Integer) then
832
+ args = args + addnum
833
+ elsif args.is_a?(Array) then
834
+ args = args.dup
835
+ args[0] += addnum
836
+ args[3] += addnum if args[3] >= 0
837
+ args[4] += addnum if args[4] >= 0
838
+ args[5] += addnum if args[5] >= 0
839
+ else
840
+ raise "Unkonwn args #{args}"
841
+ end
842
+
843
+ args
844
+ end
845
+
846
+ def construct_frame_info(locals, argnum, args)
765
847
  finfo = LocalFrameInfoNode.new(self)
766
- finfo.system_num = 4 # BP ON Stack, BP, RET
848
+ finfo.system_num = 5 # BP ON Stack, HP, ET, BP, RET
849
+
850
+ argc = args
851
+ opt_label = []
852
+ rest_index = -1
853
+ post_len = -1
854
+ post_start = -1
855
+ block_index = -1
856
+ simple = -1
857
+ if args.is_a?(Array) then
858
+ argc = args[0]
859
+ opt_label = args[1]
860
+ post_len = args[2]
861
+ post_start = args[3]
862
+ rest_index = args[4]
863
+ block_index = args[5]
864
+ simple = args[6]
865
+ end
767
866
 
768
- # 3 means BP, BP and SP
867
+ # 5means BP, HP, Exception Tag, BP and SP
769
868
  lsize = locals.size + finfo.system_num
770
869
 
771
870
  # construct frame
772
871
  frame_layout = Array.new(lsize)
773
- i = 0
774
872
  fargstart = lsize - argnum
873
+ i = 0
775
874
  argnum.times do
776
- lnode = LocalVarNode.new(finfo, locals[i], fargstart + i)
875
+ kind = :arg
876
+ if i == rest_index then
877
+ kind = :rest_arg
878
+ end
879
+ lnode = LocalVarNode.new(finfo, locals[i], fargstart + i,
880
+ kind)
777
881
  frame_layout[fargstart + i] = lnode
778
- i += 1
882
+ i = i + 1
779
883
  end
780
884
 
781
885
  curpos = fargstart - 1
@@ -786,7 +890,10 @@ LocalVarNode
786
890
  :OLD_BP, curpos)
787
891
  curpos -= 1
788
892
  frame_layout[curpos] = SystemValueNode.new(finfo,
789
- :FRAME_INFO, curpos)
893
+ :EXPTAG, curpos)
894
+ curpos -= 1
895
+ frame_layout[curpos] = SystemValueNode.new(finfo,
896
+ :TMPHEAP, curpos)
790
897
  curpos -= 1
791
898
  frame_layout[curpos] = SystemValueNode.new(finfo,
792
899
  :OLD_BPSTACK, curpos)
@@ -794,7 +901,7 @@ LocalVarNode
794
901
  j = 0
795
902
  lvarnum = lsize - finfo.system_num
796
903
  while i < lvarnum do
797
- lnode = LocalVarNode.new(finfo, locals[i], j)
904
+ lnode = LocalVarNode.new(finfo, locals[i], j, :local_var)
798
905
  frame_layout[j] = lnode
799
906
  i += 1
800
907
  j += 1
@@ -803,6 +910,7 @@ LocalVarNode
803
910
  finfo.argument_num = argnum
804
911
 
805
912
  @body = finfo
913
+ finfo.init_after_construct
806
914
  finfo
807
915
  end
808
916
 
@@ -849,6 +957,10 @@ LocalVarNode
849
957
  end
850
958
  end
851
959
 
960
+ def compile_init(context)
961
+ context
962
+ end
963
+
852
964
  def compile(context)
853
965
  oldcs = context.code_space
854
966
  @code_spaces.each do |sig, cs|
@@ -857,6 +969,7 @@ LocalVarNode
857
969
  context = super(context)
858
970
  context.reset_using_reg
859
971
  context = gen_method_prologue(context)
972
+ context = compile_init(context)
860
973
  context = @body.compile(context)
861
974
  context.current_method_signature.pop
862
975
  end
@@ -885,12 +998,13 @@ LocalVarNode
885
998
  context
886
999
  end
887
1000
 
888
- def construct_frame_info(locals, argnum)
1001
+ def construct_frame_info(locals, argnum, args)
889
1002
  locals.unshift :_self
890
1003
  locals.unshift :_block
891
1004
  locals.unshift :_prev_env
892
1005
  argnum += 3
893
- super(locals, argnum)
1006
+ args = add_arg_to_args(args, 3)
1007
+ super(locals, argnum, args)
894
1008
  end
895
1009
  end
896
1010
 
@@ -922,7 +1036,7 @@ LocalVarNode
922
1036
  @constant_tab = {}
923
1037
  @method_tab = {}
924
1038
  @klass_object = klassobj
925
- @klassclass = ClassClassWrapper.new(@klass_object)
1039
+ @klassclass = ClassClassWrapper.instance(@klass_object)
926
1040
  @klassclass_node = nil # Lazy
927
1041
  RubyType::define_wraped_class(@klassclass,
928
1042
  RubyType::RubyTypeBoxed)
@@ -931,6 +1045,12 @@ LocalVarNode
931
1045
  end
932
1046
  end
933
1047
 
1048
+ attr :klass_object
1049
+ attr :constant_tab
1050
+ attr :method_tab
1051
+ attr :klassclass
1052
+ attr :klassclass_node
1053
+
934
1054
  def collect_info(context)
935
1055
  context.modified_local_var.push [{}]
936
1056
  context.modified_instance_var = Hash.new
@@ -943,21 +1063,14 @@ LocalVarNode
943
1063
  end
944
1064
  end
945
1065
 
946
- def collect_candidate_type(context, signode, sig)
947
- super
948
- if @klassclass_node then
949
- @klassclass_node.collect_candidate_type(context, signode, sig)
950
- else
951
- context
952
- end
953
- end
954
-
955
1066
  def make_klassclass_node
956
- clsclsnode = ClassTopNode.new(self,
957
- @klassclass,
958
- @klassclass.name)
959
- clsclsnode.body = DummyNode.new
960
- @klassclass_node = clsclsnode
1067
+ if @klassclass_node == nil then
1068
+ clsclsnode = ClassTopNode.new(self,
1069
+ @klassclass,
1070
+ @klassclass.name)
1071
+ clsclsnode.body = DummyNode.new
1072
+ @klassclass_node = clsclsnode
1073
+ end
961
1074
  end
962
1075
 
963
1076
  def get_method_tab(klassobj = @klass_object)
@@ -1007,16 +1120,13 @@ LocalVarNode
1007
1120
  [nil, nil]
1008
1121
  end
1009
1122
 
1010
- attr :klass_object
1011
- attr :constant_tab
1012
- attr :method_tab
1013
-
1014
- def construct_frame_info(locals, argnum)
1123
+ def construct_frame_info(locals, argnum, args)
1015
1124
  locals.unshift :_self
1016
1125
  locals.unshift :_block
1017
1126
  locals.unshift :_prev_env
1018
1127
  argnum += 3
1019
- super(locals, argnum)
1128
+ args = add_arg_to_args(args, 3)
1129
+ super(locals, argnum, args)
1020
1130
  end
1021
1131
 
1022
1132
  def collect_candidate_type(context, signode, sig)
@@ -1033,30 +1143,42 @@ LocalVarNode
1033
1143
  context.push_signature(signode, self)
1034
1144
  context = @body.collect_candidate_type(context)
1035
1145
  context.pop_signature
1036
- context
1146
+
1147
+ if @klassclass_node then
1148
+ @klassclass_node.collect_candidate_type(context, signode, sig)
1149
+ else
1150
+ context
1151
+ end
1037
1152
  end
1038
1153
 
1039
1154
  def compile(context)
1040
1155
  context = super(context)
1041
1156
 
1042
- cs = self.find_cs_by_signature(context.to_signature)
1157
+ sig = context.to_signature.dup
1158
+ sig[2] = @type
1159
+ =begin
1160
+ pp sig
1161
+ pp @name
1162
+ pp @code_spaces.map{|a| a[0]}
1163
+ =end
1164
+
1165
+ cs = self.find_cs_by_signature(sig)
1043
1166
  if cs then
1044
1167
  asm = context.assembler
1045
- add = lambda { @klassclass.value.address }
1168
+ add = lambda { @klass_object.address }
1046
1169
  var_klassclass = OpVarImmidiateAddress.new(add)
1047
- context.start_using_reg(FUNC_ARG[0])
1048
- context.start_using_reg(FUNC_ARG[1])
1049
- context.start_using_reg(FUNC_ARG[2])
1170
+ context.start_arg_reg
1050
1171
  asm.with_retry do
1051
1172
  asm.mov(FUNC_ARG_YTL[0], BPR)
1052
1173
  asm.mov(FUNC_ARG_YTL[1], 4)
1053
1174
  asm.mov(FUNC_ARG_YTL[2], var_klassclass)
1054
1175
  end
1176
+ context.set_reg_content(FUNC_ARG_YTL[0].dst_opecode, BPR)
1177
+ context.set_reg_content(FUNC_ARG_YTL[1].dst_opecode, nil)
1178
+ context.set_reg_content(FUNC_ARG_YTL[2].dst_opecode, self)
1055
1179
  add = cs.var_base_address
1056
1180
  context = gen_call(context, add, 3)
1057
- context.end_using_reg(FUNC_ARG[2])
1058
- context.end_using_reg(FUNC_ARG[1])
1059
- context.end_using_reg(FUNC_ARG[0])
1181
+ context.end_arg_reg
1060
1182
  end
1061
1183
 
1062
1184
  context
@@ -1069,6 +1191,12 @@ LocalVarNode
1069
1191
 
1070
1192
  class TopTopNode<ClassTopNode
1071
1193
  include MethodTopCodeGen
1194
+ @@frame_struct_tab = {}
1195
+ @@local_object_area = Runtime::Arena.new
1196
+
1197
+ def self.get_frame_struct_tab
1198
+ @@frame_struct_tab
1199
+ end
1072
1200
 
1073
1201
  def initialize(parent, klassobj, name = :top)
1074
1202
  super
@@ -1077,6 +1205,7 @@ LocalVarNode
1077
1205
  @asm_tab = {}
1078
1206
  @id.push 0
1079
1207
 
1208
+ @frame_struct_array = []
1080
1209
  @unwind_proc = CodeSpace.new
1081
1210
  @init_node = nil
1082
1211
  init_unwind_proc
@@ -1086,6 +1215,13 @@ LocalVarNode
1086
1215
  attr_accessor :init_node
1087
1216
  attr :code_space_tab
1088
1217
  attr :asm_tab
1218
+ attr :frame_struct_array
1219
+
1220
+ def make_frame_struct_tab
1221
+ @frame_struct_array.each do |vkey, val|
1222
+ @@frame_struct_tab[vkey.value] = val
1223
+ end
1224
+ end
1089
1225
 
1090
1226
  def traverse_childlen
1091
1227
  if @init_node then
@@ -1130,12 +1266,21 @@ LocalVarNode
1130
1266
  super(context, signode, sig)
1131
1267
  end
1132
1268
 
1269
+ def compile_init(context)
1270
+ ar = @@local_object_area
1271
+ aa = (ar.address + ar.size) & (~0xf)
1272
+ asm = context.assembler
1273
+ asm.with_retry do
1274
+ asm.mov(THEPR, aa)
1275
+ end
1276
+ context
1277
+ end
1278
+
1133
1279
  def compile(context)
1134
1280
  if @init_node then
1135
1281
  context = @init_node.compile(context)
1136
1282
  end
1137
- context = super(context)
1138
- context
1283
+ super(context)
1139
1284
  end
1140
1285
  end
1141
1286
 
@@ -1149,6 +1294,12 @@ LocalVarNode
1149
1294
  @system_num = nil
1150
1295
  @previous_frame = search_previous_frame(parent)
1151
1296
  @offset_cache = {}
1297
+ @local_area_size = nil
1298
+ @alloca_area_size = 0
1299
+ end
1300
+
1301
+ def init_after_construct
1302
+ @local_area_size = compute_local_area_size
1152
1303
  end
1153
1304
 
1154
1305
  def search_previous_frame(mtop)
@@ -1184,9 +1335,11 @@ LocalVarNode
1184
1335
  @frame_layout.inject(0) {|sum, slot| sum += slot.size}
1185
1336
  end
1186
1337
 
1187
- def local_area_size
1338
+ def compute_local_area_size
1188
1339
  localnum = @frame_layout.size - @argument_num - @system_num
1189
- @frame_layout[0, localnum].inject(0) {|sum, slot| sum += slot.size}
1340
+ @frame_layout[0, localnum].inject(0) {|sum, slot|
1341
+ sum += slot.size
1342
+ }
1190
1343
  end
1191
1344
 
1192
1345
  def real_offset(off)
@@ -1207,7 +1360,7 @@ LocalVarNode
1207
1360
  obyte += @frame_layout[i].size
1208
1361
  end
1209
1362
 
1210
- obyte - local_area_size
1363
+ obyte - @local_area_size
1211
1364
  end
1212
1365
 
1213
1366
  def offset_arg(n, basereg)
@@ -1226,6 +1379,12 @@ LocalVarNode
1226
1379
  rc
1227
1380
  end
1228
1381
 
1382
+ def alloca(size)
1383
+ # base = -offset_by_byte(0)
1384
+ @alloca_area_size += size
1385
+ -(@local_area_size + @alloca_area_size)
1386
+ end
1387
+
1229
1388
  def collect_candidate_type(context)
1230
1389
  traverse_childlen {|rec|
1231
1390
  context = rec.collect_candidate_type(context)
@@ -1234,26 +1393,30 @@ LocalVarNode
1234
1393
 
1235
1394
  def compile(context)
1236
1395
  context = super(context)
1237
- siz = local_area_size
1396
+ siz = @local_area_size + @alloca_area_size
1238
1397
  if siz != 0 then
1239
1398
  asm = context.assembler
1240
1399
  asm.with_retry do
1241
1400
  asm.sub(SPR, siz)
1242
1401
  end
1243
- context.cpustack_pushn(siz)
1244
1402
  end
1245
- @body.compile(context)
1403
+ context.cpustack_pushn(siz)
1404
+ context = @body.compile(context)
1405
+ context.cpustack_popn(siz)
1406
+ context
1246
1407
  end
1247
1408
  end
1248
1409
 
1249
1410
  class LocalVarNode<BaseNode
1250
- def initialize(parent, name, offset)
1411
+ def initialize(parent, name, offset, kind)
1251
1412
  super(parent)
1252
1413
  @name = name
1253
1414
  @offset = offset
1415
+ @kind = kind
1254
1416
  end
1255
1417
 
1256
1418
  attr :name
1419
+ attr :kind
1257
1420
 
1258
1421
  def size
1259
1422
  8
@@ -1387,6 +1550,7 @@ LocalVarNode
1387
1550
  end
1388
1551
 
1389
1552
  def collect_candidate_type(context)
1553
+ @is_escape = true
1390
1554
  context = @value_node.collect_candidate_type(context)
1391
1555
  cursig = context.to_signature
1392
1556
  same_type(self, @value_node, cursig, cursig, context)
@@ -1440,7 +1604,6 @@ LocalVarNode
1440
1604
  if vnode then
1441
1605
  cursig = context.to_signature
1442
1606
  same_type(self, vnode, cursig, cursig, context)
1443
- same_type(vnode, self, cursig, cursig, context)
1444
1607
  end
1445
1608
  end
1446
1609
  context
@@ -1448,9 +1611,9 @@ LocalVarNode
1448
1611
 
1449
1612
  def compile(context)
1450
1613
  context = super(context)
1451
- context.set_reg_content(TMPR, self)
1452
1614
  context.ret_node = self
1453
1615
  context.ret_reg = RETR
1616
+ context.set_reg_content(RETR, self)
1454
1617
  context
1455
1618
  end
1456
1619
  end
@@ -1535,6 +1698,7 @@ LocalVarNode
1535
1698
  end
1536
1699
  end
1537
1700
 
1701
+ context.set_reg_content(context.ret_reg, self)
1538
1702
  context
1539
1703
  end
1540
1704
 
@@ -1683,6 +1847,61 @@ LocalVarNode
1683
1847
  include HaveChildlenMixin
1684
1848
  end
1685
1849
 
1850
+ # Multiplexer of node (Using YARV stack operation)
1851
+ class MultiplexNode<BaseNode
1852
+ include HaveChildlenMixin
1853
+ include NodeUtil
1854
+
1855
+ def initialize(node)
1856
+ super(node.parent)
1857
+ @node = node
1858
+ @first_compile = true
1859
+ @res_area = nil
1860
+ end
1861
+
1862
+ def traverse_childlen
1863
+ yield @node
1864
+ end
1865
+
1866
+ def collect_info(context)
1867
+ tnode = search_frame_info
1868
+ offset = tnode.alloca(8)
1869
+ @res_area = OpIndirect.new(BPR, offset)
1870
+ @node.collect_info(context)
1871
+ end
1872
+
1873
+ def collect_candidate_type(context)
1874
+ sig = context.to_signature
1875
+ same_type(self, @node, sig, sig, context)
1876
+ same_type(@node, self, sig, sig, context)
1877
+ @node.collect_candidate_type(context)
1878
+ end
1879
+
1880
+ def compile(context)
1881
+ if @first_compile then
1882
+ context = @node.compile(context)
1883
+ asm = context.assembler
1884
+ asm.with_retry do
1885
+ asm.mov(@res_area, context.ret_reg)
1886
+ end
1887
+ context.set_reg_content(@res_area, self)
1888
+ @first_compile = false
1889
+
1890
+ context
1891
+ else
1892
+ asm = context.assembler
1893
+ asm.with_retry do
1894
+ asm.mov(RETR, @res_area)
1895
+ end
1896
+ context.set_reg_content(@res_area, self)
1897
+ context.ret_reg = RETR
1898
+ context.ret_node = self
1899
+
1900
+ context
1901
+ end
1902
+ end
1903
+ end
1904
+
1686
1905
  # Literal
1687
1906
  class LiteralNode<BaseNode
1688
1907
  include TypeListWithoutSignature
@@ -1702,14 +1921,22 @@ LocalVarNode
1702
1921
  end
1703
1922
 
1704
1923
  sig = context.to_signature
1705
- add_type(sig, @type)
1706
1924
  case @value
1707
1925
  when Array
1926
+ add_type(sig, @type)
1708
1927
  @value.each do |ele|
1709
1928
  etype = RubyType::BaseType.from_object(ele)
1710
1929
  @element_node_list[0][1].add_type(sig, etype)
1711
1930
  end
1931
+
1932
+ when Range
1933
+ @type = @type.to_box
1934
+ add_type(sig, @type)
1935
+
1936
+ else
1937
+ add_type(sig, @type)
1712
1938
  end
1939
+
1713
1940
  context
1714
1941
  end
1715
1942
 
@@ -1741,6 +1968,7 @@ LocalVarNode
1741
1968
  context.ret_reg = XMM0
1742
1969
  end
1743
1970
  context.ret_node = self
1971
+ context.set_reg_content(context.ret_reg, self)
1744
1972
 
1745
1973
  else
1746
1974
  if @var_value == nil then
@@ -1751,6 +1979,7 @@ LocalVarNode
1751
1979
  context.ret_node = self
1752
1980
  context.ret_reg = @var_value
1753
1981
  context = @type.gen_copy(context)
1982
+ context.set_reg_content(context.ret_reg, self)
1754
1983
  end
1755
1984
 
1756
1985
  context
@@ -1780,10 +2009,13 @@ LocalVarNode
1780
2009
  dmylit = LiteralNode.new(self, nil)
1781
2010
  arg = [dmylit, dmylit, @define]
1782
2011
  sig = []
2012
+ cursig = context.to_signature
1783
2013
  arg.each do |ele|
1784
- ele.decide_type_once(context.to_signature)
2014
+ ele.decide_type_once(cursig)
1785
2015
  sig.push ele.type
1786
2016
  end
2017
+ type = RubyType::BaseType.from_ruby_class(@define.klassclass)
2018
+ sig[2] = type
1787
2019
  context = @define.collect_candidate_type(context, arg, sig)
1788
2020
 
1789
2021
  @body.collect_candidate_type(context)
@@ -1852,24 +2084,73 @@ LocalVarNode
1852
2084
  context = super(context)
1853
2085
  asm = context.assembler
1854
2086
  # You can crash when you use yield in block.
1855
- # You can fix this bug for traversing TMPR3 for method top.
2087
+ # You can fix this bug for traversing PTMPR for method top.
1856
2088
  # But is is little troublesome. So it is not supported.
1857
2089
  prevenv = @frame_info.offset_arg(0, BPR)
1858
2090
  # offset of self is common, so it no nessery traverse prev frame
1859
2091
  # for @frame_info.
1860
- slfarg = @frame_info.offset_arg(2, TMPR3)
2092
+ slfarg = @frame_info.offset_arg(2, PTMPR)
1861
2093
  asm.with_retry do
1862
- asm.mov(TMPR3, prevenv)
1863
- asm.mov(TMPR3, slfarg)
2094
+ asm.mov(PTMPR, prevenv)
2095
+ asm.mov(PTMPR, slfarg)
1864
2096
  end
1865
- context.ret_reg2 = TMPR3
2097
+ context.ret_reg2 = PTMPR
1866
2098
 
1867
2099
  context.ret_reg = @frame_info.offset_arg(1, BPR)
1868
2100
  context.ret_node = self
2101
+ context.set_reg_content(context.ret_reg, self)
2102
+ context
2103
+ end
2104
+ end
2105
+
2106
+ class CApiCommonNode<BaseNode
2107
+ include NodeUtil
2108
+ include SendUtil
2109
+
2110
+ def initialize(parent, name, atype, rtype = :VALUE)
2111
+ super(parent)
2112
+ @name = name
2113
+ @frame_info = search_frame_info
2114
+ @arg_type = atype
2115
+ @ret_type = rtype
2116
+ end
2117
+
2118
+ attr :name
2119
+ attr :frame_info
2120
+ attr :arg_type
2121
+ attr :ret_type
2122
+
2123
+ def collect_candidate_type(context)
2124
+ context
2125
+ end
2126
+
2127
+ def method_top_node(ctop, slf)
2128
+ nil
2129
+ end
2130
+
2131
+ def compile(context)
2132
+ context = super(context)
2133
+ context.ret_reg = OpMemAddress.new(address_of(@name))
2134
+ context.ret_node = self
2135
+ context.set_reg_content(context.ret_reg, self)
1869
2136
  context
1870
2137
  end
1871
2138
  end
1872
2139
 
2140
+ # C API (fix arguments)
2141
+ class FixArgCApiNode<CApiCommonNode
2142
+ def calling_convention(context)
2143
+ :c_fixarg_raw
2144
+ end
2145
+ end
2146
+
2147
+ # C API (variable arguments)
2148
+ class VarArgCApiNode<CApiCommonNode
2149
+ def calling_convention(context)
2150
+ :c_vararg_raw
2151
+ end
2152
+ end
2153
+
1873
2154
  # Method name
1874
2155
  class MethodSelectNode<BaseNode
1875
2156
  def initialize(parent, val)
@@ -1885,6 +2166,11 @@ LocalVarNode
1885
2166
  @send_node = sendnode
1886
2167
  if sendnode.is_fcall or sendnode.is_vcall then
1887
2168
  @reciever = @parent.class_top
2169
+ if @reciever == @parent.search_top and
2170
+ !@reciever.is_a?(TopTopNode) then
2171
+ @reciever.make_klassclass_node
2172
+ @reciever = @reciever.klassclass_node
2173
+ end
1888
2174
  else
1889
2175
  @reciever = sendnode.arguments[2]
1890
2176
  end
@@ -1900,7 +2186,7 @@ LocalVarNode
1900
2186
 
1901
2187
  def method_top_node(ctop, slf)
1902
2188
  if slf then
1903
- ctop.search_method_with_super(@name, slf.ruby_type)[0]
2189
+ ctop.search_method_with_super(@name, slf.ruby_type_raw)[0]
1904
2190
  else
1905
2191
  ctop.search_method_with_super(@name)[0]
1906
2192
  end
@@ -1913,17 +2199,20 @@ LocalVarNode
1913
2199
  @calling_convention = :ytl
1914
2200
  else
1915
2201
  # reciever = Object
1916
- if @reciever.klass_object then
1917
- addr = @reciever.klass_object.method_address_of(@name)
2202
+ recobj = @reciever.klass_object
2203
+ if recobj.is_a?(ClassClassWrapper) then
2204
+ recobj = recobj.value
2205
+ end
2206
+ if recobj then
2207
+ addr = recobj.method_address_of(@name)
1918
2208
  if addr then
1919
- recobj = @reciever.klass_object
1920
2209
  if variable_argument?(recobj.method(@name).parameters) then
1921
2210
  @calling_convention = :c_vararg
1922
2211
  else
1923
2212
  @calling_convention = :c_fixarg
1924
2213
  end
1925
2214
  else
1926
- raise "Unkown method - #{@name}"
2215
+ raise "Unkown method - #{recobj}##{@name}"
1927
2216
  @calling_convention = :c
1928
2217
  end
1929
2218
  else
@@ -1931,12 +2220,12 @@ LocalVarNode
1931
2220
  end
1932
2221
  end
1933
2222
  else
1934
- @reciever.decide_type_once(context.to_signature)
1935
- rtype = @reciever.type
1936
- rklass = rtype.ruby_type
2223
+ rtype = @reciever.decide_type_once(context.to_signature)
2224
+ rklass = rtype.ruby_type_raw
1937
2225
  knode = ClassTopNode.get_class_top_node(rklass)
1938
2226
  if knode and knode.search_method_with_super(@name)[0] then
1939
2227
  @calling_convention = :ytl
2228
+ @ruby_reciever = rklass
1940
2229
  else
1941
2230
  slfval = @reciever.get_constant_value
1942
2231
  mth = nil
@@ -1948,8 +2237,26 @@ LocalVarNode
1948
2237
  end
1949
2238
  end
1950
2239
  if slfval == nil or mth == nil then
1951
- mth = rklass.instance_method(@name)
1952
- @ruby_reciever = rtype.instance_eval {@ruby_type}
2240
+ if rklass.is_a?(ClassClassWrapper) then
2241
+ rklass = rklass.value
2242
+ end
2243
+ begin
2244
+ mth = rklass.instance_method(@name)
2245
+ rescue NameError
2246
+ p @parent.debug_info
2247
+ p context.to_signature
2248
+ p @name
2249
+ # p @reciever.func.reciever.class
2250
+ p @reciever.instance_eval {@type_list }
2251
+ =begin
2252
+ mc = @reciever.get_send_method_node(context.to_signature)[0]
2253
+ iv = mc.end_nodes[0].parent.value_node
2254
+ p iv.instance_eval {@name}
2255
+ p iv.instance_eval {@type_list}
2256
+ =end
2257
+ raise
2258
+ end
2259
+ @ruby_reciever = rtype.ruby_type_raw
1953
2260
  end
1954
2261
 
1955
2262
  if variable_argument?(mth.parameters) then
@@ -1969,18 +2276,22 @@ LocalVarNode
1969
2276
  slfop = @parent.frame_info.offset_arg(2, BPR)
1970
2277
  asm = context.assembler
1971
2278
  asm.with_retry do
1972
- asm.mov(TMPR3, slfop)
2279
+ asm.mov(PTMPR, slfop)
1973
2280
  end
1974
- context.ret_reg2 = TMPR3
2281
+ context.ret_reg2 = PTMPR
1975
2282
  mtop = @reciever.search_method_with_super(@name)[0]
1976
2283
  if mtop then
1977
2284
  sig = @parent.signature(context)
1978
2285
  cs = mtop.find_cs_by_signature(sig)
1979
2286
  context.ret_reg = cs.var_base_address
1980
2287
  else
1981
- if @reciever.klass_object then
2288
+ recobj = @reciever.klass_object
2289
+ if recobj.is_a?(ClassClassWrapper) then
2290
+ recobj = recobj.value
2291
+ end
2292
+ if recobj then
1982
2293
  addr = lambda {
1983
- @reciever.klass_object.method_address_of(@name)
2294
+ recobj.method_address_of(@name)
1984
2295
  }
1985
2296
  if addr.call then
1986
2297
  context.ret_reg = OpVarMemAddress.new(addr)
@@ -1997,13 +2308,16 @@ LocalVarNode
1997
2308
  end
1998
2309
  else
1999
2310
  context = @reciever.compile(context)
2000
- context.ret_node.decide_type_once(context.to_signature)
2001
- rtype = context.ret_node.type
2311
+ rtype = context.ret_node.decide_type_once(context.to_signature)
2002
2312
  if @calling_convention != :ytl then
2003
2313
  context = rtype.gen_boxing(context)
2314
+ rtype = rtype.to_box
2315
+ elsif !rtype.boxed then
2316
+ context = rtype.gen_unboxing(context)
2004
2317
  end
2005
2318
  recval = context.ret_reg
2006
- knode = ClassTopNode.get_class_top_node(rtype.ruby_type)
2319
+ rrtype = rtype.ruby_type_raw
2320
+ knode = ClassTopNode.get_class_top_node(rrtype)
2007
2321
  mtop = nil
2008
2322
 
2009
2323
  if rtype.is_a?(RubyType::DefaultType0) then
@@ -2014,8 +2328,7 @@ LocalVarNode
2014
2328
  meaddrof = OpMemAddress.new(addr)
2015
2329
 
2016
2330
  context.start_using_reg(TMPR2)
2017
- context.start_using_reg(FUNC_ARG[0])
2018
- context.start_using_reg(FUNC_ARG[1])
2331
+ context.start_arg_reg
2019
2332
 
2020
2333
  asm = context.assembler
2021
2334
  asm.with_retry do
@@ -2026,20 +2339,22 @@ LocalVarNode
2026
2339
  asm.mov(FUNC_ARG[1], mnval)
2027
2340
  asm.call_with_arg(meaddrof, 2)
2028
2341
  asm.mov(TMPR2, RETR)
2029
- asm.pop(TMPR3)
2342
+ asm.pop(PTMPR)
2030
2343
  end
2031
- context.ret_reg2 = TMPR3
2344
+ context.set_reg_content(FUNC_ARG_YTL[0].dst_opecode, nil)
2345
+ context.set_reg_content(FUNC_ARG_YTL[1].dst_opecode, self)
2346
+ context.ret_reg2 = PTMPR
2032
2347
 
2033
- context.end_using_reg(FUNC_ARG[1])
2034
- context.end_using_reg(FUNC_ARG[0])
2348
+ context.end_arg_reg
2035
2349
 
2036
2350
  context.ret_node = self
2037
2351
  context.set_reg_content(RETR, self)
2038
2352
  context.set_reg_content(TMPR2, self)
2039
- context.set_reg_content(TMPR3, @reciever)
2353
+ context.set_reg_content(PTMPR, @reciever)
2040
2354
  context.ret_reg = TMPR2
2041
2355
 
2042
- elsif knode and mtop = knode.search_method_with_super(@name)[0] then
2356
+ elsif knode and
2357
+ mtop = knode.search_method_with_super(@name)[0] then
2043
2358
  asm = context.assembler
2044
2359
  if !rtype.boxed and rtype.ruby_type == Float then
2045
2360
  if recval != XMM0 then
@@ -2050,9 +2365,9 @@ LocalVarNode
2050
2365
  context.ret_reg2 = XMM0
2051
2366
  else
2052
2367
  asm.with_retry do
2053
- asm.mov(TMPR3, recval)
2368
+ asm.mov(PTMPR, recval)
2054
2369
  end
2055
- context.ret_reg2 = TMPR3
2370
+ context.ret_reg2 = PTMPR
2056
2371
  end
2057
2372
 
2058
2373
  sig = @parent.signature(context)
@@ -2072,9 +2387,9 @@ LocalVarNode
2072
2387
  context.ret_reg2 = XMM0
2073
2388
  else
2074
2389
  asm.with_retry do
2075
- asm.mov(TMPR3, recval)
2390
+ asm.mov(PTMPR, recval)
2076
2391
  end
2077
- context.ret_reg2 = TMPR3
2392
+ context.ret_reg2 = PTMPR
2078
2393
  end
2079
2394
 
2080
2395
  addr = lambda {
@@ -2197,6 +2512,7 @@ LocalVarNode
2197
2512
  def initialize(parent)
2198
2513
  super(parent, 2, 0)
2199
2514
  @classtop = search_class_top
2515
+ @topnode = search_top
2200
2516
  end
2201
2517
 
2202
2518
  def compile_main(context)
@@ -2206,11 +2522,17 @@ LocalVarNode
2206
2522
  context
2207
2523
  end
2208
2524
 
2525
+ #=begin
2209
2526
  def collect_candidate_type(context)
2210
- @type = RubyType::BaseType.from_ruby_class(@classtop.klass_object)
2211
- add_type(context.to_signature, @type)
2212
- context
2527
+ if @topnode.is_a?(ClassTopNode) then
2528
+ @type = RubyType::BaseType.from_ruby_class(@classtop.klass_object)
2529
+ add_type(context.to_signature, @type)
2530
+ context
2531
+ else
2532
+ super(context)
2533
+ end
2213
2534
  end
2535
+ #=end
2214
2536
 
2215
2537
  def compile(context)
2216
2538
  # context = super(context)
@@ -2273,6 +2595,7 @@ LocalVarNode
2273
2595
  end
2274
2596
 
2275
2597
  valr = context.ret_reg
2598
+ valn = context.ret_node
2276
2599
  context = gen_pursue_parent_function(context, @depth)
2277
2600
  base = context.ret_reg
2278
2601
  offarg = @current_frame_info.offset_arg(@offset, base)
@@ -2290,7 +2613,11 @@ LocalVarNode
2290
2613
  asm.mov(offarg, TMPR)
2291
2614
  end
2292
2615
  end
2293
-
2616
+
2617
+ tmpctx = context
2618
+ @depth.times { tmpctx = tmpctx.prev_context}
2619
+ tmpctx.set_reg_content(offarg, valn)
2620
+
2294
2621
  context.ret_reg = nil
2295
2622
  if base == TMPR2 then
2296
2623
  context.end_using_reg(base)
@@ -2321,6 +2648,7 @@ LocalVarNode
2321
2648
  vti = context.modified_instance_var[@name]
2322
2649
  if vti == nil then
2323
2650
  vti = []
2651
+ context.modified_instance_var[@name] = vti
2324
2652
  end
2325
2653
  # Not dup so vti may update after.
2326
2654
  @var_type_info = vti
@@ -2362,11 +2690,16 @@ LocalVarNode
2362
2690
 
2363
2691
  def collect_info(context)
2364
2692
  context = @val.collect_info(context)
2365
- context.modified_instance_var[@name] = [self]
2693
+ if context.modified_instance_var[@name] == nil then
2694
+ context.modified_instance_var[@name] = []
2695
+ end
2696
+ context.modified_instance_var[@name].push self
2366
2697
  @body.collect_info(context)
2367
2698
  end
2368
2699
 
2369
2700
  def collect_candidate_type(context)
2701
+ @is_escape = true
2702
+ @val.is_escape = true
2370
2703
  context = @val.collect_candidate_type(context)
2371
2704
  cursig = context.to_signature
2372
2705
  same_type(self, @val, cursig, cursig, context)
@@ -2427,10 +2760,6 @@ LocalVarNode
2427
2760
  end
2428
2761
  context
2429
2762
  end
2430
-
2431
- def type
2432
- @value_node.type
2433
- end
2434
2763
 
2435
2764
  def compile(context)
2436
2765
  case @value_node