@@ -30,6 +30,7 @@ my $LCMP := JAST::Instruction.new( :op('lcmp') );
30
30
my $ DCMPL := JAST::Instruction. new ( : op(' dcmpl' ) );
31
31
my $ RETURN := JAST::Instruction. new ( : op(' return' ) );
32
32
my $ ARETURN := JAST::Instruction. new ( : op(' areturn' ) );
33
+ my $ IRETURN := JAST::Instruction. new ( : op(' ireturn' ) );
33
34
my $ ATHROW := JAST::Instruction. new ( : op(' athrow' ) );
34
35
35
36
# Common constant loads.
@@ -2877,9 +2878,9 @@ class QAST::CompilerJAST {
2877
2878
# Compile to JAST and register this block as the deserialization
2878
2879
# handler.
2879
2880
self . as_jast($ block );
2880
- my $ des_meth := JAST::Method. new ( : name(' deserializeCuid ' ), : returns($ TYPE_STR ), : static(0 ) );
2881
- $ des_meth . append (JAST::PushSVal . new ( : value($ block . cuid) ));
2882
- $ des_meth . append (JAST::Instruction . new ( : op( ' areturn ' ) ) );
2881
+ my $ des_meth := JAST::Method. new ( : name(' deserializeQbid ' ), : returns(' I ' ), : static(0 ) );
2882
+ $ des_meth . append (JAST::PushIndex . new ( : value(self . cuid_to_qbid( $ block . cuid) ) ));
2883
+ $ des_meth . append ($ IRETURN );
2883
2884
$ * JCLASS . add_method($ des_meth );
2884
2885
}
2885
2886
@@ -2891,9 +2892,9 @@ class QAST::CompilerJAST {
2891
2892
QAST ::Op. new ( : op(' null' ) )
2892
2893
);
2893
2894
self . as_jast($ load_block );
2894
- my $ load_meth := JAST::Method. new ( : name(' loadCuid ' ), : returns($ TYPE_STR ), : static(0 ) );
2895
- $ load_meth . append (JAST::PushSVal . new ( : value($ load_block . cuid) ));
2896
- $ load_meth . append (JAST::Instruction . new ( : op( ' areturn ' ) ) );
2895
+ my $ load_meth := JAST::Method. new ( : name(' loadQbid ' ), : returns(' I ' ), : static(0 ) );
2896
+ $ load_meth . append (JAST::PushIndex . new ( : value(self . cuid_to_qbid( $ load_block . cuid) ) ));
2897
+ $ load_meth . append ($ IRETURN );
2897
2898
$ * JCLASS . add_method($ load_meth );
2898
2899
}
2899
2900
@@ -2909,16 +2910,16 @@ class QAST::CompilerJAST {
2909
2910
my $ main_meth := JAST::Method. new ( : name(' main' ), : returns(' Void' ) );
2910
2911
$ main_meth . add_argument(' argv' , " [$ TYPE_STR" );
2911
2912
$ main_meth . append (JAST::PushCVal. new ( : value(' L' ~ $ * JCLASS . name ~ ' ;' ) ));
2912
- $ main_meth . append (JAST::PushSVal . new ( : value($ main_block . cuid) ));
2913
+ $ main_meth . append (JAST::PushIndex . new ( : value(self . cuid_to_qbid( $ main_block . cuid) ) ));
2913
2914
$ main_meth . append ($ ALOAD_0 );
2914
2915
$ main_meth . append (JAST::Instruction. new ( : op(' invokestatic' ),
2915
2916
$ TYPE_CU , ' enterFromMain' ,
2916
- ' Void' , ' Ljava/lang/Class;' , $ TYPE_STR , " [$ TYPE_STR" ));
2917
+ ' Void' , ' Ljava/lang/Class;' , ' I ' , " [$ TYPE_STR" ));
2917
2918
$ main_meth . append ($ RETURN );
2918
2919
$ * JCLASS . add_method($ main_meth );
2919
- my $ entry_cuid_meth := JAST::Method. new ( : name(' entryCuid ' ), : returns($ TYPE_STR ), : static(0 ) );
2920
- $ entry_cuid_meth . append (JAST::PushSVal . new ( : value($ main_block . cuid) ));
2921
- $ entry_cuid_meth . append ($ ARETURN );
2920
+ my $ entry_cuid_meth := JAST::Method. new ( : name(' entryQbid ' ), : returns(' I ' ), : static(0 ) );
2921
+ $ entry_cuid_meth . append (JAST::PushIndex . new ( : value(self . cuid_to_qbid( $ main_block . cuid) ) ));
2922
+ $ entry_cuid_meth . append ($ IRETURN );
2922
2923
$ * JCLASS . add_method($ entry_cuid_meth );
2923
2924
}
2924
2925
@@ -2929,9 +2930,9 @@ class QAST::CompilerJAST {
2929
2930
$ * JCLASS . add_method($ hll_meth );
2930
2931
2931
2932
# Add method that returns the mainline block.
2932
- my $ mainline_meth := JAST::Method. new ( : name(' mainlineCuid ' ), : returns($ TYPE_STR ), : static(0 ) );
2933
- $ mainline_meth . append (JAST::PushSVal . new ( : value($ cu [0 ]. cuid) ));
2934
- $ mainline_meth . append (JAST::Instruction . new ( : op( ' areturn ' ) ) );
2933
+ my $ mainline_meth := JAST::Method. new ( : name(' mainlineQbid ' ), : returns(' I ' ), : static(0 ) );
2934
+ $ mainline_meth . append (JAST::PushIndex . new ( : value(self . cuid_to_qbid( $ cu [0 ]. cuid) ) ));
2935
+ $ mainline_meth . append ($ IRETURN );
2935
2936
$ * JCLASS . add_method($ mainline_meth );
2936
2937
2937
2938
return $ * JCLASS ;
0 commit comments