]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/tools/image-analyzer/vm/vm.factor
tools.image-analyzer.*: fixes so that the vocab should work both on 32
[factor.git] / extra / tools / image-analyzer / vm / vm.factor
index 0f6f096913a1ea26aa9e818426f0fd2ac56b3841..c2a7959fd42d43a209d420541f54eb5850f594ed 100644 (file)
@@ -1,6 +1,15 @@
-USING: alien.c-types assocs classes.struct kernel.private vm ;
+USING: alien.c-types assocs classes.struct kernel kernel.private system vm
+vocabs.parser ;
 IN: tools.image-analyzer.vm
 
+<<
+! For the two annoying structs that differ on 32 and 64 bit.
+cpu x86.32?
+"tools.image-analyzer.vm.32"
+"tools.image-analyzer.vm.64"
+? use-vocab
+>>
+
 ! These structs and words correspond to vm/image.hpp
 STRUCT: image-header
     { magic cell }
@@ -34,10 +43,6 @@ STRUCT: bignum
     { header cell }
     { capacity cell } ;
 
-! Different on 32 bit
-STRUCT: byte-array
-    { header cell }
-    { capacity cell } ;
 
 STRUCT: callstack
     { header cell }
@@ -48,11 +53,6 @@ STRUCT: dll
     { path cell }
     { handle void* } ;
 
-! Different on 32 bit
-STRUCT: float
-    { header cell }
-    { n double } ;
-
 STRUCT: quotation
     { header cell }
     { array cell }
@@ -95,8 +95,8 @@ STRUCT: wrapper
 
 UNION: no-payload
     alien
+    boxed-float
     dll
-    float
     quotation
     wrapper
     word ;
@@ -108,7 +108,7 @@ UNION: array-payload
 : tag>class ( tag -- class )
     {
         { 2 array }
-        { 3 float }
+        { 3 boxed-float }
         { 4 quotation }
         { 5 bignum }
         { 6 alien }