comparison nworker_c.rhope @ 169:fd06fb07762a

Basic inlining of arithmetic and comparison operations on integer types
author Mike Pavone <pavone@retrodev.com>
date Sun, 08 May 2011 01:37:44 -0700
parents d2b941f82d74
children ac5c2d78663f
comparison
equal deleted inserted replaced
168:d2b941f82d74 169:fd06fb07762a
896 { 896 {
897 with call <- [func]Set Field Call[[node]Data >>, [inputs]Index[0], [inputs]Index[1]] 897 with call <- [func]Set Field Call[[node]Data >>, [inputs]Index[0], [inputs]Index[1]]
898 save outs <- [node]Outputs >> 898 save outs <- [node]Outputs >>
899 out <- Val[after save] 899 out <- Val[after save]
900 }{ 900 }{
901 [program]Method?[[[node]Data >>]Name >>] 901 fname <- [[node]Data >>]Name >>
902 { 902 [program]Method?[fname]
903 with call <- [func]Method Call[[[node]Data >>]Name >>, inputs] 903 {
904 with call <- [func]Method Call[fname, inputs]
904 }{ 905 }{
905 with call <- [func]Call[[[node]Data >>]Name >>, inputs] 906 ,normal call <- If[[[fname]Contains["@"]]And[[[inputs]Length]=[2]]]
907 {
908 //Check for inline on static method calls
909 //TODO: Deal with unused output
910 out,normal call <- Compile Number Inline Check[func, [fname]Partition["@"], [[[node]Input Types >>]Index[0]]Index[0], [[[node]Input Types >>]Index[1]]Index[0], [inputs]Index[0], [inputs]Index[1], Result Var Name[0, node index]]
911 }
912
913 Val[normal call]
914 {
915 with call <- [func]Call[fname, inputs]
916 }
906 } 917 }
907 first unused <- [Max Used Output[node, [[node]Outputs >>]-[1]]]+[1] 918 first unused <- [Max Used Output[node, [[node]Outputs >>]-[1]]]+[1]
908 If[[first unused] > [[node]Min Outputs >>]] 919 If[[first unused] > [[node]Min Outputs >>]]
909 { 920 {
910 save outs <- [node]Min Outputs >> 921 save outs <- [node]Min Outputs >>