diff 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
line wrap: on
line diff
--- a/nworker_c.rhope	Sun May 01 18:41:17 2011 -0700
+++ b/nworker_c.rhope	Sun May 08 01:37:44 2011 -0700
@@ -898,11 +898,22 @@
 			save outs <- [node]Outputs >>
 			out <- Val[after save]
 		}{
-			[program]Method?[[[node]Data >>]Name >>]
+			fname <- [[node]Data >>]Name >>
+			[program]Method?[fname]
 			{
-				with call <- [func]Method Call[[[node]Data >>]Name >>, inputs]
+				with call <- [func]Method Call[fname, inputs]
 			}{
-				with call <- [func]Call[[[node]Data >>]Name >>, inputs]
+				,normal call <- If[[[fname]Contains["@"]]And[[[inputs]Length]=[2]]]
+				{
+					//Check for inline on static method calls
+					//TODO: Deal with unused output
+					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]]
+				}
+				
+				Val[normal call]
+				{
+					with call <- [func]Call[fname, inputs]
+				}
 			}
 			first unused <- [Max Used Output[node, [[node]Outputs >>]-[1]]]+[1]
 			If[[first unused] > [[node]Min Outputs >>]]