Tue Mar 6 17:46:13 PST 2012 John Meacham <[email protected]> * make Info type ids not depend on the exact format of TypeRep, reduce size of type ids from 32 to 8 bits.
Tue Mar 6 18:05:52 PST 2012 John Meacham <[email protected]> * remove some files from drift_processed that no longer have DrIFT annotations Tue Mar 6 19:55:23 PST 2012 John Meacham <[email protected]> * start using Jhc.ForeignPtr
New patches: [make Info type ids not depend on the exact format of TypeRep, reduce size of type ids from 32 to 8 bits. John Meacham <[email protected]>**20120307014613 Ignore-this: c2243c0c28122f03a4b869c28a449d8d ] hunk ./src/Ho/Binary.hs 22 import Support.MapBinaryInstance current_version :: Int -current_version = 10 +current_version = 11 readHFile :: FilePath -> IO (FilePath,HoHeader,forall a . Binary a => ChunkType -> a) readHFile fn = do hunk ./src/Info/Binary.hs 12 import GenUtil import Info.Info import Info.Types -import StringTable.Atom(HasHash(..)) import Util.BitSet as BS import qualified E.Demand hunk ./src/Info/Binary.hs 20 u :: (Typeable a, Binary a) => a u = u -createTyp :: Typeable a => a -> Word32 -createTyp x = hash32 $ (show (typeOf x)) newEntry x = Entry { entryThing = toDyn x, entryString = show x, entryType = typeOf x } hunk ./src/Info/Binary.hs 22 -cb x = (createTyp x, Binable x) +cb n x = (n, Binable x, typeOf x) hunk ./src/Info/Binary.hs 24 -binTable :: Map.Map Word32 Binable -binTable = Map.fromList [ - cb (u :: Properties), - cb (u :: E.CPR.Val), - cb (u :: FfiExport), - cb (u :: E.Demand.DemandSignature) +-- Note: the numbers here are part of the ABI of the serialized files. +-- If you change them then you must change the ABI version number in +-- Ho.Binary and invalidate all old files. +binTableValues = [ + cb 1 (u :: Properties), + cb 2 (u :: E.CPR.Val), + cb 3 (u :: FfiExport), + cb 4 (u :: E.Demand.DemandSignature) ] hunk ./src/Info/Binary.hs 34 -putDyn :: (Word32,Dynamic,Binable) -> Put +binTable :: Map.Map Word8 Binable +binTable = Map.fromList [ (n,x) | (n,x,_) <- binTableValues ] + +revBinTable :: [(TypeRep,(Word8,Binable))] +revBinTable = [ (t,(n,x)) | (n,x,t) <- binTableValues ] + +putDyn :: (Word8,Dynamic,Binable) -> Put putDyn (ps,d,Binable (_::a)) = do put ps put (fromDyn d (error (show d)) :: a) hunk ./src/Info/Binary.hs 45 --- = case Map.lookup (packString (show d)) of --- Just (Binable (x::a)) -> put_ h (case fromDynamic d of Just x -> x :: a) --- Nothing -> return () - getDyn = do hunk ./src/Info/Binary.hs 46 - (ps::Word32) <- get + (ps::Word8) <- get case Map.lookup ps binTable of Just (Binable (_ :: a)) -> do x <- get :: Get a hunk ./src/Info/Binary.hs 64 putInfo :: Info.Info.Info -> Put putInfo (Info ds) = do let ds' = concatMap (\d -> do - let ps = hash32 $ (show $ entryType d) - case Map.lookup ps binTable of - Just x -> return (ps,entryThing d,x) + case Prelude.lookup (entryType d) revBinTable of + Just (ps,x) -> return (ps,entryThing d,x) Nothing -> fail "key not found" ) ds putWord8 (fromIntegral $ length ds') hunk ./src/Info/Binary.hs 75 getInfo = do n <- getWord8 xs <- replicateM (fromIntegral n) getDyn - return (Info [ x | x <- xs]) + return (Info xs) [remove some files from drift_processed that no longer have DrIFT annotations John Meacham <[email protected]>**20120307020552 Ignore-this: 12c00145035104fbbf869072f3be3569 ] hunk ./Makefile.am 39 src/Util/Relation.hs src/Util/RWS.hs src/Util/SameShape.hs src/Util/Seq.hs src/Util/SetLike.hs src/Util/UnionFind.hs \ src/Util/UnionSolve.hs src/Util/UniqueMonad.hs src/Util/Util.hs src/Util/VarName.hs src/Version/Config.hs src/Version/Version.hs \ src/Support/IniParse.hs src/E/Lint.hs src/Util/Progress.hs src/Grin/StorageAnalysis.hs src/Util/YAML.hs src/Grin/Main.hs \ - src/E/Main.hs src/Util/GMap.hs src/Util/ExitCodes.hs src/Support/TempDir.hs src/E/PrimDecode.hs + src/E/Main.hs src/Util/GMap.hs src/Util/ExitCodes.hs src/Support/TempDir.hs src/E/PrimDecode.hs \ + src/DerivingDrift/StandardRules.hs src/FrontEnd/Exports.hs GHCDEBUGOPTS= -W -fno-warn-unused-matches -fwarn-type-defaults GHCPROFOPTS= -prof -auto-all -osuf prof.o -hisuf prof.hi hunk ./Makefile.am 122 rts/lib/lib_cbits.c rts/jhc_rts_header.h rts/lib/lib_cbits.h rts/rts/gc_jgc_internal.h DRIFTFILES = drift_processed/C/FFI.hs drift_processed/C/FromGrin2.hs drift_processed/Cmm/Op.hs drift_processed/C/Prims.hs drift_processed/DataConstructors.hs \ - drift_processed/DerivingDrift/StandardRules.hs drift_processed/E/CPR.hs drift_processed/E/Demand.hs drift_processed/E/LambdaLift.hs \ + drift_processed/E/CPR.hs drift_processed/E/Demand.hs drift_processed/E/LambdaLift.hs \ drift_processed/E/SSimplify.hs drift_processed/E/ToHs.hs drift_processed/E/TypeCheck.hs drift_processed/E/Type.hs drift_processed/FrontEnd/Class.hs \ hunk ./Makefile.am 124 - drift_processed/FrontEnd/Exports.hs drift_processed/FrontEnd/HsSyn.hs drift_processed/FrontEnd/KindInfer.hs \ + drift_processed/FrontEnd/HsSyn.hs drift_processed/FrontEnd/KindInfer.hs \ drift_processed/FrontEnd/Representation.hs drift_processed/FrontEnd/SrcLoc.hs drift_processed/FrontEnd/Tc/Kind.hs \ drift_processed/FrontEnd/Tc/Monad.hs drift_processed/Grin/SSimplify.hs drift_processed/Name/VConsts.hs drift_processed/Options.hs \ drift_processed/DataConstructors.hs-boot drift_processed/Ho/Type.hs drift_processed/Ho/Build.hs hunk ./Makefile.am 288 ./jhc --help | sed -e 's/^/ /' >> $@ fix-whitespace: - find src -not \( -name .svn -prune -o -name .git -prune \) -type f -print0 | xargs -0 sed -i -E 's/[ ]*$$//' - find lib -not \( -name .svn -prune -o -name .git -prune \) -type f -print0 | xargs -0 sed -i -E 's/[ ]*$$//' + find src -not \( -name .svn -prune -o -name .git -prune \) -type f -name \*.hs -print0 | xargs -0 sed -i -E 's/[ ]*$$//' + find lib -not \( -name .svn -prune -o -name .git -prune \) -type f -name \*.hs -print0 | xargs -0 sed -i -E 's/[ ]*$$//' jhc.1 : $(MAKE) man [start using Jhc.ForeignPtr John Meacham <[email protected]>**20120307035523 Ignore-this: 4947965ba3de583014a924e498ba5367 ] hunk ./lib/base/Foreign/ForeignPtr.hs 16 import Foreign.Ptr import Foreign.Storable import Jhc.IO - -newtype ForeignPtr a = FP (Ptr a) - deriving(Eq,Ord) +import Jhc.ForeignPtr type FinalizerPtr a = FunPtr (Ptr a -> IO ()) hunk ./lib/base/Foreign/ForeignPtr.hs 20 -newForeignPtr_ :: Ptr a -> IO (ForeignPtr a) -newForeignPtr_ = return . FP - newForeignPtr :: FinalizerPtr a -> Ptr a -> IO (ForeignPtr a) newForeignPtr finalizer ptr = do fp <- newForeignPtr_ ptr hunk ./lib/base/Foreign/ForeignPtr.hs 30 addForeignPtrFinalizer _ _ = return () mallocForeignPtrBytes :: Int -> IO (ForeignPtr a) -mallocForeignPtrBytes x = do - ptr <- mallocBytes x - newForeignPtr finalizerFree ptr +mallocForeignPtrBytes sz = mallocForeignPtrAlignBytes 0 sz mallocForeignPtr :: Storable a => IO (ForeignPtr a) mallocForeignPtr = doMalloc undefined where hunk ./lib/base/Foreign/ForeignPtr.hs 35 doMalloc :: Storable b => b -> IO (ForeignPtr b) - doMalloc x = mallocForeignPtrBytes (sizeOf x) + doMalloc x = mallocForeignPtrAlignBytes (alignment x) (sizeOf x) mallocForeignPtrArray :: Storable a => Int -> IO (ForeignPtr a) mallocForeignPtrArray = doMalloc undefined where hunk ./lib/base/Foreign/ForeignPtr.hs 40 doMalloc :: Storable a' => a' -> Int -> IO (ForeignPtr a') - doMalloc dummy size = mallocForeignPtrBytes (size * sizeOf dummy) + doMalloc dummy size = mallocForeignPtrAlignBytes + (alignment dummy) (size * sizeOf dummy) mallocForeignPtrArray0 :: Storable a => Int -> IO (ForeignPtr a) mallocForeignPtrArray0 sz = mallocForeignPtrArray (sz + 1) hunk ./lib/base/Foreign/ForeignPtr.hs 52 touchForeignPtr fp return r -unsafeForeignPtrToPtr :: ForeignPtr a -> Ptr a -unsafeForeignPtrToPtr (FP x) = x - -touchForeignPtr :: ForeignPtr a -> IO () -touchForeignPtr x = fromUIO_ (touch_ x) - -foreign import primitive touch_ :: ForeignPtr a -> UIO_ - -castForeignPtr :: ForeignPtr a -> ForeignPtr b -castForeignPtr (FP x) = FP $ castPtr x - -- |A finalizer is represented as a pointer to a foreign function that, at -- finalisation time, gets as an argument a plain pointer variant of the -- foreign pointer that the finalizer is associated with. hunk ./lib/jhc/jhc.yaml 41 - Jhc.String - Jhc.Text.Read - Jhc.Tuples + - Jhc.ForeignPtr - Numeric - Prelude.CType - Prelude.Float Context: [build_extlibs.prl: correctly check the return status of getstore Roman Cheplyaka <[email protected]>**20120218071732 Ignore-this: 20165069fc8aaa1528969216f7c51435 ] [ghc 7.4 compatibility changes John Meacham <[email protected]>**20120306035643 Ignore-this: c15e182e5a05efb7a623f6386fbb9884 ] [implement finalizers in the RTS, add foreignptr rts routines, properly set saved_gc on safe ffi calls John Meacham <[email protected]>**20120221132313 Ignore-this: 1a27919674abc4a6955c245eec88aaf9 ] [add support for monolithic blocks that are plain malloced memory and can be big. John Meacham <[email protected]>**20120221032043 Ignore-this: 201ba4e67027f3336cfa5e984aefa89 ] [introduce dedicated array allocation routine. clean up jgc garbage collector John Meacham <[email protected]>**20120221011655 Ignore-this: b8e153205aeaf94af76a97b0ee9aa895 ] [make 'div' and 'mod' round to -Infinity properly John Meacham <[email protected]>**20120220094634 Ignore-this: c46b383b9a2a6a63ff44e30a8a63f376 ] [add prototype for gc_alloc John Meacham <[email protected]>**20120220050616 Ignore-this: 444b34148332459dc0e3d32b7c55d3e0 ] [fix deriving rules for read/show when it comes to labels John Meacham <[email protected]>**20120220044322 Ignore-this: 20c9c89ae066716fe3ec8eb4d37c6034 ] [disabled buggy unused transformation in type analysis pass John Meacham <[email protected]>**20120220031442 Ignore-this: 8ad84739daff7f4faff0ba251898ea1a ] [move debugging routines to rts/profile.c John Meacham <[email protected]>**20120217052015 Ignore-this: d2e087faf6e3408dc135fd905d85244b ] [fix rts unit tests John Meacham <[email protected]>**20120217035045 Ignore-this: 460d7eadde056908b668ea27d5a69aa5 ] [export gc_alloc John Meacham <[email protected]>**20120217002235 Ignore-this: dcb70b3ad303f0343147b4e1d6d413b9 ] [Makes the class deriving mechanism more robust: [email protected]**20120216214017 Ignore-this: 6d93691849d255c310b2af7098572ea8 - the names of the classes to be derived may be given qualified. - the functions from the Prelude internally used need not be in scope and won't clash with other bindings. ] [Moved Jhc.List.drop to module Jhc.Basics (since it is used in instance deriving) [email protected]**20120214222939 Ignore-this: f95d4818bad6d79d8fc7566ee0912714 ] [The typechecker now verifies that the main function has a type that can be unified with IO a. This is required by the Haskell 98 Report. [email protected]**20120211050446 Ignore-this: 8a1d8ca36929c0de0fb4357538ea6c5b Failing to do so allows both to accept invalid programs like: > main :: [()] > main = return () and to reject valid programs like: > main = return () ] [Improves the error message shown when a monomorphic pattern has a polymorphic type that cannot be defaulted. [email protected]**20120211045931 Ignore-this: efd70b7535eb0444148aabdbe96ed0b9 The previous error message seemed more like an internal error ("withDefaults.ambiguity: ...") ] [fix for building rts in different modes, profile,debug,windows John Meacham <[email protected]>**20120216201402 Ignore-this: 39b08c82b7239beaeaa6e77a3b986cd4 ] [move rest of rts into seperate c files rather than including it directly. John Meacham <[email protected]>**20120216090215 Ignore-this: d0bf719a38e306f78e182a5c0107573d ] [add pragmaExp to the lexer/parser John Meacham <[email protected]>**20120216044837 Ignore-this: 77393cb5bdd28fba526d57d26ac099b8 ] [update documentation with new extensions John Meacham <[email protected]>**20120214172359 Ignore-this: 2f412f29f20127ce3f97f200674ed8b6 ] [fixes for android John Meacham <[email protected]>**20120213150333 Ignore-this: cf6df59b212e3402ec21507410485270 ] [make += work with '-m' command line options John Meacham <[email protected]>**20120213102300 Ignore-this: 36cb4039cd34ba73d2cc973b7c00798b ] [move jhc_rts_alloc to gc_none John Meacham <[email protected]>**20120213100906 Ignore-this: 1c2e9028d72127acd5a448971266f627 ] [added rts/rts_support, cleaned up rts code. John Meacham <[email protected]>**20120213070644 Ignore-this: 79533860331fbd02057748e3d1b81666 ] [make 'Requires' a simple set, include the calling convention with the requirements. John Meacham <[email protected]>**20120212053838 Ignore-this: b7fa6f8ece79c96073d8638a876456de ] [move slub.c and jhc_jgc.* to rts directory John Meacham <[email protected]>**20120212040246 Ignore-this: a40354544b8908732c733bf8a38e7e68 ] [add unit tests for stableptr John Meacham <[email protected]>**20120212031148 Ignore-this: 17b41baeec806fb53ca2c10c6489097 ] [reorganize rts/ directory, add README for it John Meacham <[email protected]>**20120212022718 Ignore-this: c8a9f067696233958757830b62a7264b ] [add rts/test directory John Meacham <[email protected]>**20120212004706 Ignore-this: 1e6d0cb4ba809a1d6089d04704d5a60f ] [allow being explicit in export/import lists by specifying 'kind', 'class', 'type', or 'data'. add PTS rule to allow proper typing of Complex_ John Meacham <[email protected]>**20120211052157 Ignore-this: 12155286186022f896d3474a2bb5d23a ] [fix Options.hs makefile dependency John Meacham <[email protected]>**20120211024909 Ignore-this: a0742d7ce4eba41314741b6ca2d6498d ] [added user defined kind extension John Meacham <[email protected]>**20120211042248 Ignore-this: ded329985c5c81aa8c4612f7aa19559b ] [Add missing src/Options.hs to jhc tarball Sergei Trofimovich <[email protected]>**20120209065334 Ignore-this: dfc50115ee26986ab2d303a462cd29b9 ] [added mingw32-gcc to MINGW search Sergei Trofimovich <[email protected]>**20110414073938 Ignore-this: 87fa46f0e4532663a9d92930c9c38152 ] [add c-- types for complex and vector values John Meacham <[email protected]>**20120210051026 Ignore-this: 4a1e4c8cec01f73b75913622c22fa55 ] [add documentation for the multi-return ccall extension, clean up code. John Meacham <[email protected]>**20120209201351 Ignore-this: 47504b653ee9f71bde40e91959238292 ] [add extension to allow multiple return values from c functions John Meacham <[email protected]>**20120209142228 Ignore-this: 51e4a3f9ca80ff2eae7f21376f0a0992 ] [fix obscure error message for invalid instance reported by roman John Meacham <[email protected]>**20120209114221 Ignore-this: 98d60e20cb63caaebbe1269887160b9f ] [remove APrim type, use Prim directly, clean up corresponding cruft. John Meacham <[email protected]>**20120209104920 Ignore-this: 8a3fbeea72e7f52809a3468df2b8b228 ] [turn ExtType into a real abstract type John Meacham <[email protected]>**20120209100704 Ignore-this: c802a07fee0f2461cca19aa28f99ff61 ] [add 'capi' foreign function call type, simplify type of E.FromHs monad, check for more FFI related errors John Meacham <[email protected]>**20120209091611 Ignore-this: 1945b5336e6001d6da6cd63a77bd1efd ] [add md5lazyIO, check for bad paths in createTempFile John Meacham <[email protected]>**20120209091527 Ignore-this: f9e5f0dafc9615d5c5c50cb49829c5a5 ] [add foreign types, interpret Ptr when creating external C types John Meacham <[email protected]>**20120209090647 Ignore-this: c49bea3938e2edabda9d7528cfb1121a ] [Add some more exotic primitive ops, ffs,clz,ctz,byteswap,popcount,parity. John Meacham <[email protected]>**20120209070848 Ignore-this: b61b1c08db35ccad33f24536b99913df ] [jhc.spec fixes John Meacham <[email protected]>**20120209015329 Ignore-this: 64488edc34893a734f81b1c01c0b1ff4 ] [TAG 0.8.0 John Meacham <[email protected]>**20120208020026 Ignore-this: 2d0d963331a43650879ae72d81ff62e8 ] Patch bundle hash: fb94af87f8b461d128d19ae49cb58cef05b3d3ae
_______________________________________________ jhc mailing list [email protected] http://www.haskell.org/mailman/listinfo/jhc
