Mercurial > repos > rhope
comparison nworker_c.rhope @ 170:ac5c2d78663f
Inline calls to If@Boolean when static type info is present
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 08 May 2011 18:21:19 -0700 |
parents | fd06fb07762a |
children | a32afde77abb |
comparison
equal
deleted
inserted
replaced
169:fd06fb07762a | 170:ac5c2d78663f |
---|---|
901 fname <- [[node]Data >>]Name >> | 901 fname <- [[node]Data >>]Name >> |
902 [program]Method?[fname] | 902 [program]Method?[fname] |
903 { | 903 { |
904 with call <- [func]Method Call[fname, inputs] | 904 with call <- [func]Method Call[fname, inputs] |
905 }{ | 905 }{ |
906 ,normal call <- If[[[fname]Contains["@"]]And[[[inputs]Length]=[2]]] | 906 justfunc,,,normal call <- [fname]Partition["@"] |
907 { | 907 { |
908 //Check for inline on static method calls | 908 //Check for inline on static method calls |
909 //TODO: Deal with unused output | 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]] | 910 If[[[inputs]Length]=[2]] |
911 { | |
912 out,normal call <- Compile Number Inline Check[func, justfunc, [[[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]] | |
913 }{ | |
914 ,normal call <- If[[[inputs]Length]=[1]] | |
915 { | |
916 out,normal call <- Compile Boolean Inline Check[func, justfunc, [[[node]Input Types >>]Index[0]]Index[0], [inputs]Index[0], Result Var Name[0, node index], Result Var Name[1, node index]] | |
917 } | |
918 } | |
911 } | 919 } |
912 | 920 |
913 Val[normal call] | 921 Val[normal call] |
914 { | 922 { |
915 with call <- [func]Call[fname, inputs] | 923 with call <- [func]Call[fname, inputs] |
931 out <- Val[after maybe] | 939 out <- Val[after maybe] |
932 } | 940 } |
933 } | 941 } |
934 } | 942 } |
935 after save <- Fold[Save Result[?, ?, node index], with call, Range[0, save outs]] | 943 after save <- Fold[Save Result[?, ?, node index], with call, Range[0, save outs]] |
944 Print[["Last NumParams is now "]Append[String[[after save]Last NumParams >>]]] | |
936 } | 945 } |
937 | 946 |
938 Compile Node[worker,program,func,nodes,current:out,out worker] | 947 Compile Node[worker,program,func,nodes,current:out,out worker] |
939 { | 948 { |
940 node index <- [nodes]Index[current] | 949 node index <- [nodes]Index[current] |