[don't store nodes that consist solely of a 'WHAT' field on the heap, encode it directly into the wptr_t.
John Meacham <john@repetae.net>**20080310170229] hunk ./C/FromGrin2.hs 127
-                    
+
hunk ./C/FromGrin2.hs 133
-                                     (creturn $ cast fr2 $ functionCall fnname $ 
+                                     (creturn $ cast fr2 $ functionCall fnname $
hunk ./C/FromGrin2.hs 136
-                    
+
hunk ./C/FromGrin2.hs 168
-        NodeC a ts | Just bn <- basicNode tyenv a ts -> return (cast sptr_t bn)
+        NodeC a ts -> do
+            bn <- basicNode tyenv a ts 
+            case bn of 
+                Just bn ->  return (cast sptr_t bn)
+                _ -> do
+                    (_,i) <- newConst h
+                    return $ variable (name $  'c':show i )
hunk ./C/FromGrin2.hs 180
-    case basicNode tyenv a ts of
+    bn <- basicNode tyenv a ts
+    case bn of
hunk ./C/FromGrin2.hs 625
-    return $ getHead e =* f_EVALTAG (reference (variable en))
+    return $ getHead e =* f_EVALFUNC (reference (variable en))
hunk ./C/FromGrin2.hs 641
-        Just [n'] | n' == t -> return ()
+        --Just [n'] | n' == t ->  return ()
hunk ./C/FromGrin2.hs 650
-    case basicNode tyenv t as of
+    bn <- basicNode tyenv t as
+    case bn of
hunk ./C/FromGrin2.hs 686
-basicNode :: TyEnv -> Atom -> [Val] -> (Maybe Expression)
+basicNode :: TyEnv -> Atom -> [Val] -> C (Maybe Expression)
+basicNode tyenv a [] = do tellTags a ; return . Just $ (f_RAWWHAT (constant $ enum (nodeTagName a)))
+basicNode _ _ _ = return Nothing
+{-
hunk ./C/FromGrin2.hs 696
+-}
hunk ./C/FromGrin2.hs 733
+f_EVALFUNC e  = functionCall (name "EVALFUNC") [e]
hunk ./C/FromGrin2.hs 741
+f_RAWWHAT e   = functionCall (name "RAWWHAT") [e]
hunk ./data/jhc_rts2.c 9
-#define EVALTAG(fn)  (assert(((uintptr_t)(fn) & 0x3) == 0),(sptr_t)((uintptr_t)(fn) | P_FUNC))
-#define EVALTAGC(fn) ((sptr_t)((void *)(fn) + P_FUNC))
+#define EVALTAG(fn)  (assert(((uintptr_t)(fn) & 0x3) == 0),(sptr_t)((uintptr_t)(fn) | P_LAZY))
+#define EVALTAGC(fn) ((sptr_t)((void *)(fn) + P_LAZY))
+#define EVALFUNC(fn) ((fptr_t)((uintptr_t)(fn) | P_FUNC))
hunk ./data/jhc_rts2.c 16
-#define GETWHAT(x)   (DNODEP(x)->what)
+#define GETWHAT(x)   (GETTAG(x) == P_VALUE ? ((uintptr_t)(x) >> 16) : DNODEP(x)->what)
+
hunk ./data/jhc_rts2.c 19
+#define RAWWHAT(w)     (wptr_t)(((uintptr_t)w << 16) | P_VALUE)
hunk ./data/jhc_rts2.c 122
-typedef uint16_t       what_t;
+typedef uintptr_t      what_t;