[Pkg-haskell-commits] darcs: lvmrun: Initial check-in
Joachim Breitner
mail at joachim-breitner.de
Fri Oct 24 20:16:51 UTC 2014
Fri Oct 24 20:15:39 UTC 2014 Joachim Breitner <mail at joachim-breitner.de>
* Initial check-in
A ./CREDITS.txt
A ./Fornothing.hs
A ./LICENSE.txt
A ./Makefile
A ./Setup.hs
A ./common/
A ./common/alloc.h
A ./common/bytes.h
A ./common/config.h
A ./common/custom.h
A ./common/fail.h
A ./common/fixed.h
A ./common/memory.h
A ./common/misc.h
A ./common/mlvalues.h
A ./config/
A ./config/cl-i386-pc-windows/
A ./config/cl-i386-pc-windows/m.h
A ./config/cl-i386-pc-windows/makefile
A ./config/cl-i386-pc-windows/s.h
A ./config/tests/
A ./config/tests/ansi.c
A ./config/tests/bool.c
A ./config/tests/cdecl.c
A ./config/tests/config.guess
A ./config/tests/config.guess.old
A ./config/tests/config.sub
A ./config/tests/const.c
A ./config/tests/dblalign.c
A ./config/tests/endian.c
A ./config/tests/hasgot
A ./config/tests/int64.c
A ./config/tests/int64align.c
A ./config/tests/labels.c
A ./config/tests/longlong.c
A ./config/tests/runtest
A ./config/tests/searchpath
A ./config/tests/sigjmpbuf.c
A ./config/tests/signals.c
A ./config/tests/sizeint.c
A ./config/tests/sizelong.c
A ./config/tests/sizelongp.c
A ./config/tests/sizes.c
A ./config/tests/sizeshort.c
A ./config/tests/stdcall.c
A ./config/tests/vsnprintf.c
A ./configure
A ./debian/
A ./debian/changelog
A ./debian/compat
A ./debian/control
A ./debian/copyright
A ./debian/haskell-lvmrun-utils.install
A ./debian/rules
A ./debian/source/
A ./debian/source/format
A ./debian/watch
A ./heap/
A ./heap/alloc.c
A ./heap/bytes.c
A ./heap/compact.c
A ./heap/compact.h
A ./heap/custom.c
A ./heap/finalise.c
A ./heap/finalise.h
A ./heap/fixed.c
A ./heap/freelist.c
A ./heap/freelist.h
A ./heap/gc.h
A ./heap/gc_ctrl.c
A ./heap/gc_ctrl.h
A ./heap/globroots.c
A ./heap/globroots.h
A ./heap/heap.h
A ./heap/heapfast.h
A ./heap/major_gc.c
A ./heap/major_gc.h
A ./heap/memory.c
A ./heap/minor_gc.c
A ./heap/minor_gc.h
A ./heap/roots.c
A ./heap/roots.h
A ./heap/weak.c
A ./heap/weak.h
A ./lvmrun.cabal
A ./notes.txt
A ./prim/
A ./prim/primio.c
A ./prim/primio.h
A ./prim/primitives.h
A ./prim/primmagic.c
A ./prim/prims.c
A ./prim/prims.h
A ./prim/primstring.c
A ./prim/primstring.h
A ./prim/primsys.c
A ./prim/primsys.h
A ./runtime.dsp
A ./runtime.dsw
Fri Oct 24 20:15:39 UTC 2014 Joachim Breitner <mail at joachim-breitner.de>
* Initial check-in
diff -rN -u old-lvmrun/common/alloc.h new-lvmrun/common/alloc.h
--- old-lvmrun/common/alloc.h 1970-01-01 00:00:00.000000000 +0000
+++ new-lvmrun/common/alloc.h 2014-10-24 20:16:50.874258662 +0000
@@ -0,0 +1,49 @@
+/***********************************************************************/
+/* */
+/* Objective Caml */
+/* */
+/* Xavier Leroy and Damien Doligez, INRIA Rocquencourt */
+/* */
+/* Copyright 1996 Institut National de Recherche en Informatique et */
+/* en Automatique. All rights reserved. This file is distributed */
+/* under the terms of the GNU Library General Public License. */
+/* */
+/***********************************************************************/
+
+/***---------------------------------------------------------------------
+ Modified and adapted for the Lazy Virtual Machine by Daan Leijen.
+ Modifications copyright 2001, Daan Leijen. This (modified) file is
+ distributed under the terms of the GNU Library General Public License.
+---------------------------------------------------------------------***/
+
+/* $Id: alloc.h 177 2002-11-15 16:21:56Z cvs-3 $ */
+
+#ifndef _alloc_
+#define _alloc_
+
+#include "mlvalues.h"
+
+
+value alloc (mlsize_t, tag_t);
+value alloc_major (mlsize_t, tag_t);
+value alloc_small (mlsize_t, tag_t);
+value alloc_tuple (mlsize_t);
+value alloc_string (mlsize_t);
+value alloc_string_major (mlsize_t);
+value copy_string (const char *);
+value copy_string_array (const char **);
+value copy_double (double);
+value copy_int32 (int32); /* defined in [ints.c] */
+value copy_int64 (int64); /* defined in [ints.c] */
+value copy_nativeint (long); /* defined in [ints.c] */
+value alloc_array (value (*funct) (const char *), const char ** array);
+
+typedef void (*final_fun)(value);
+value alloc_final (mlsize_t /*size in words*/,
+ final_fun, /*finalization function*/
+ mlsize_t, /*resources consumed*/
+ mlsize_t /*max resources*/);
+
+int convert_flag_list (value, int *);
+
+#endif /* _alloc_ */
diff -rN -u old-lvmrun/common/bytes.h new-lvmrun/common/bytes.h
--- old-lvmrun/common/bytes.h 1970-01-01 00:00:00.000000000 +0000
+++ new-lvmrun/common/bytes.h 2014-10-24 20:16:50.874258662 +0000
@@ -0,0 +1,25 @@
+/*-----------------------------------------------------------------------
+ The Lazy Virtual Machine.
+
+ Daan Leijen.
+
+ Copyright 2001, Daan Leijen. All rights reserved. This file is
+ distributed under the terms of the GNU Library General Public License.
+-----------------------------------------------------------------------*/
+
+/* $Id: bytes.h 177 2002-11-15 16:21:56Z cvs-3 $ */
+
+#ifndef _bytes_
+#define _bytes_
+
+#include "mlvalues.h"
+#include "custom.h"
+
+#define Bytes_val(v) (((char**)(Data_custom_val(v)))[0])
+#define Void_bytes_val(v) (((void**)(Data_custom_val(v)))[0])
+
+value alloc_bytes( asize_t size );
+value bytes_of_string( value s );
+struct custom_operations bytes_ops;
+
+#endif /* _bytes_ */
diff -rN -u old-lvmrun/common/config.h new-lvmrun/common/config.h
--- old-lvmrun/common/config.h 1970-01-01 00:00:00.000000000 +0000
+++ new-lvmrun/common/config.h 2014-10-24 20:16:50.874258662 +0000
@@ -0,0 +1,197 @@
+/**----------------------------------------------------------------------
+ The Lazy Virtual Machine.
+
+ Daan Leijen.
+
+ Copyright 2001, Daan Leijen. This file is distributed under the terms
+ of the GNU Library General Public License. This file is based on the
+ original Objective Caml source copyrighted by INRIA Rocquencourt.
+----------------------------------------------------------------------**/
+
+/***********************************************************************/
+/* */
+/* Objective Caml */
+/* */
+/* Xavier Leroy and Damien Doligez, INRIA Rocquencourt */
+/* */
+/* Copyright 1996 Institut National de Recherche en Informatique et */
+/* en Automatique. All rights reserved. This file is distributed */
+/* under the terms of the GNU Library General Public License. */
+/* */
+/***********************************************************************/
+
+/* $Id: config.h 177 2002-11-15 16:21:56Z cvs-3 $ */
+
+#ifndef _config_
+#define _config_
+
+#include <m.h>
+#include <s.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+#define in const
+#define out
+#define inout
+
+/* typedef short int16; */ /* FIXME -- not true on the Cray T3E */
+/* typedef unsigned short uint16; */ /* FIXME -- not true on the Cray T3E */
+
+#if SIZEOF_INT == 4
+typedef int int32;
+typedef unsigned int uint32;
+#elif SIZEOF_LONG == 4
+typedef long int32;
+typedef unsigned long uint32;
+#elif SIZEOF_SHORT == 4
+typedef short int32;
+typedef unsigned short uint32;
+#endif
+
+#if defined(ARCH_INT64) && defined(ARCH_UINT64)
+typedef ARCH_INT64 int64;
+typedef ARCH_UINT64 uint64;
+#else
+/* Int64.t will not be supported, and operations over it are not defined,
+ but we must define the types int64 and uint64 as 64-bit placeholders. */
+typedef struct { uint32 a, b; } uint64;
+typedef uint64 int64;
+#endif
+
+
+/* Code fixups */
+#if defined(ARCH64) && !defined(ARCH_CODE32)
+ #define FIXUP_OFFSET
+#endif
+
+
+#if defined(FIXUP_OFFSET)
+ extern char* fixup_base;
+ #define Ptr_fixup(f) (fixup_base + (f))
+#else
+ #define Ptr_fixup(f) ((char*)(f))
+#endif
+
+#define Fixup_ptr(p) ((char*)(p) - fixup_base)
+#define Valptr_fixup(f) ((value*)(Ptr_fixup(f)))
+#define Val_fixup(f) ((value)(Ptr_fixup(f)))
+#define Code_fixup(f) ((opcode_t*)(Ptr_fixup(f)))
+
+/* Booleans */
+
+#if !defined(HAS_BOOL)
+typedef int bool;
+#define true 1
+#define false 0
+#endif
+
+
+/* Library dependencies */
+
+#ifdef HAS_MEMMOVE
+#undef bcopy
+#define bcopy(src,dst,len) memmove((dst), (src), (len))
+#else
+#ifdef HAS_BCOPY
+/* Nothing to do */
+#else
+#undef bcopy
+#define bcopy(src,dst,len) memmov((dst), (src), (len))
+#define USING_MEMMOV
+#endif
+#endif
+
+/* We use threaded code interpretation if the compiler provides labels
+ as first-class values (GCC 2.x).
+*/
+
+#if defined(HAS_LABEL_VALUES) && !defined(DEBUG)
+ #define THREADED_CODE
+ #if defined(ARCH64) && !defined(ARCH_CODE32)
+ #define THREADED_OFFSET
+ #endif
+#endif
+
+#ifdef __GNUC__
+#define UNUSED __attribute__((unused))
+#else
+#define UNUSED
+#endif
+
+/* units: use 1000 instead of 1024 to avoid possibly bad effects on direct-mapped cache */
+#define Kilo (1000L)
+#define Mega (Kilo*Kilo)
+#define Giga (Kilo*Mega)
+
+
+/* Maximal string buffer size on stack */
+#define MAXSTR 512
+#define MAXVAR MAXSTR
+#define MAXNAME 128
+
+/* Maximal path length */
+#if defined(_MAX_PATH)
+# define MAXPATH _MAX_PATH
+#elif defined(MAX_PATH)
+# define MAXPATH MAX_PATH
+#elif defined(MAXPATHLEN)
+# define MAXPATH MAXPATHLEN
+#elif defined(PATH_MAX)
+# define MAXPATH PATH_MAX
+#else
+# define MAXPATH 512
+#endif
+
+/* File and path seperators */
+#if defined(OS_WINDOWS)
+# define FILESEP '\\'
+# define PATHSEP ';'
+#elif defined(OS_CYGWIN)
+# define FILESEP '/'
+# define PATHSEP ';'
+#else
+# define FILESEP '/'
+# define PATHSEP ':'
+#endif
+
+/* Do not change this definition. */
+#define Page_bsize (1 << Page_log)
+
+/* Memory model parameters */
+
+/* The size of a page for memory management (in bytes) is [1 << Page_log].
+ It must be a multiple of [sizeof (long)]. */
+#define Page_log 12 /* A page is 4 kilobytes. */
+
+/* Maximum size of a block allocated in the young generation (words). */
+/* Must be > 4 */
+#define Max_young_wosize 256
+
+/* Minimum size of the minor zone (words).
+ This must be at least [Max_young_wosize + 1]. */
+#define Minor_heap_min_wsize (2*Max_young_wosize)
+
+/* Maximum size of the minor zone (words).
+ Must be greater than or equal to [Minor_heap_min].
+*/
+#define Minor_heap_max_wsize (1 << 28)
+
+/* Minimum size increment when growing the heap (words).
+ Must be a multiple of [Page_size / sizeof (value)]. */
+#define Heap_chunk_min_wsize (Wsize_bsize(Page_bsize))
+
+/* Maximum size of a contiguous piece of the heap (words).
+ Must be greater than or equal to [Heap_chunk_min].
+ Must be greater than or equal to [Bhsize_wosize (Max_wosize)]. */
+#define Heap_chunk_max_wsize (Bhsize_wosize (Max_wosize))
+
+
+/*----------------------------------------------------------------------
+ LVM evaluator configuration options
+----------------------------------------------------------------------*/
+#define LVM_UPDATE_INPLACE /* try to update in place */
+#define LVM_UPDATE_CON_INPLACE /* even try to copy constructors to update in place (instead of indirection) */
+#define LVM_CHECK_BOUNDS /* check bounds on operations */
+
+
+#endif /* _config_ */
diff -rN -u old-lvmrun/common/custom.h new-lvmrun/common/custom.h
--- old-lvmrun/common/custom.h 1970-01-01 00:00:00.000000000 +0000
+++ new-lvmrun/common/custom.h 2014-10-24 20:16:50.878258662 +0000
@@ -0,0 +1,55 @@
+/***********************************************************************/
+/* */
+/* Objective Caml */
+/* */
+/* Manuel Serrano and Xavier Leroy, INRIA Rocquencourt */
+/* */
+/* Copyright 2000 Institut National de Recherche en Informatique et */
+/* en Automatique. All rights reserved. This file is distributed */
+/* under the terms of the GNU Library General Public License. */
+/* */
+/***********************************************************************/
+
+/***---------------------------------------------------------------------
+ Modified and adapted for the Lazy Virtual Machine by Daan Leijen.
+ Modifications copyright 2001, Daan Leijen. This (modified) file is
+ distributed under the terms of the GNU Library General Public License.
+---------------------------------------------------------------------***/
+
+/* $Id: custom.h 177 2002-11-15 16:21:56Z cvs-3 $ */
+
+#ifndef _custom_
+#define _custom_
+
+struct custom_operations {
+ char *identifier;
+ void (*finalize)(value v);
+ int (*compare)(value v1, value v2);
+ long (*hash)(value v);
+ void (*serialize)(value v,
+ /*out*/ unsigned long * wsize_32 /*size in bytes*/,
+ /*out*/ unsigned long * wsize_64 /*size in bytes*/);
+ unsigned long (*deserialize)(void * dst);
+};
+
+#define custom_finalize_default NULL
+extern int custom_compare_default(value v1, value v2);
+#define custom_hash_default NULL
+extern void custom_serialize_default(value v, unsigned long * wsize_32,
+ unsigned long * wsize_64);
+#define custom_deserialize_default NULL
+
+#define Custom_ops_val(v) (*((struct custom_operations **) (v)))
+
+value alloc_custom(struct custom_operations * ops,
+ unsigned long size, /*size in bytes*/
+ mlsize_t mem, /*resources consumed*/
+ mlsize_t max /*max resources*/);
+
+void register_custom_operations(struct custom_operations * ops);
+struct custom_operations * find_custom_operations(char * ident);
+struct custom_operations * final_custom_operations(void (*fn)(value));
+
+void init_custom_operations(void);
+
+#endif
diff -rN -u old-lvmrun/common/fail.h new-lvmrun/common/fail.h
--- old-lvmrun/common/fail.h 1970-01-01 00:00:00.000000000 +0000
+++ new-lvmrun/common/fail.h 2014-10-24 20:16:50.878258662 +0000
@@ -0,0 +1,124 @@
+/**----------------------------------------------------------------------
+ The Lazy Virtual Machine.
+
+ Daan Leijen.
+
+ Copyright 2001, Daan Leijen. This file is distributed under the terms
+ of the GNU Library General Public License. This file is based on the
+ original Objective Caml source copyrighted by INRIA Rocquencourt.
+----------------------------------------------------------------------**/
+
+/***********************************************************************/
+/* */
+/* Objective Caml */
+/* */
+/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
+/* */
+/* Copyright 1996 Institut National de Recherche en Informatique et */
+/* en Automatique. All rights reserved. This file is distributed */
+/* under the terms of the GNU Library General Public License. */
+/* */
+/***********************************************************************/
+
+/* $Id: fail.h 193 2002-11-28 14:53:58Z cvs-3 $ */
+
+#ifndef _fail_h
+#define _fail_h
+
+#include "mlvalues.h"
+
+/*----------------------------------------------------------------------
+ exception tags
+----------------------------------------------------------------------*/
+enum exn_tag {
+ Exn_async_heap_overflow,
+ Exn_async_stack_overflow,
+ Exn_async_signal,
+ Exn_runtime,
+ Exn_arithmetic,
+ Exn_system,
+ Exn_invalid_arg,
+ Exn_assert,
+ Exn_not_found,
+ Exn_user,
+ Exn_count
+};
+
+enum exn_runtime {
+ Exn_failed_pattern,
+ Exn_blackhole,
+ Exn_out_of_bounds,
+ Exn_exit,
+ Exn_invalid_opcode,
+ Exn_load_error,
+ Exn_runtime_error,
+ Exn_runtime_count
+};
+
+enum exn_system {
+ Exn_eof,
+ Exn_system_blocked_io,
+ Exn_system_error,
+ Exn_system_count
+};
+
+
+enum exn_arithmetic {
+ /* IEEE 754 floating point exceptions (and sticky tags) */
+ Fpe_invalid,
+ Fpe_zerodivide,
+ Fpe_overflow,
+ Fpe_underflow,
+ Fpe_inexact,
+ Fpe_denormal,
+
+ /* integer arithmetic, [Int_underflow] is used for negative overflows */
+ Int_zerodivide,
+ Int_overflow,
+ Int_underflow,
+
+ /* other floating point exceptions. [Fpe_error] is a general floating point error */
+ Fpe_error,
+ Fpe_unemulated,
+ Fpe_sqrtneg,
+ Fpe_logneg,
+ Fpe_stackoverflow,
+ Fpe_stackunderflow,
+
+ Fpe_count
+};
+
+
+bool is_async_exception( enum exn_tag tag );
+
+enum exn_field {
+ Field_exn_val1,
+ Field_exn_val2,
+};
+
+
+/*----------------------------------------------------------------------
+ raise exceptions
+----------------------------------------------------------------------*/
+void fatal_uncaught_exception( value exn ) Noreturn;
+
+void raise_invalid_argument (const char *) Noreturn;
+void raise_user(const char *, ...) Noreturn;
+void raise_internal( const char*, ... ) Noreturn;
+
+void raise_out_of_memory (unsigned long size) Noreturn;
+void raise_stack_overflow (unsigned long size) Noreturn;
+void raise_signal( int sig) Noreturn;
+void raise_sys_error(int err, const char* msg) Noreturn;
+void raise_sys_blocked_io (void) Noreturn;
+void raise_invalid_opcode( long opcode ) Noreturn;
+void raise_module(const char* name, const char* msg, ...) Noreturn;
+
+void raise_exn( enum exn_tag exn ) Noreturn;
+void raise_exn_str( enum exn_tag exn, const char* msg ) Noreturn;
+
+void raise_arithmetic_exn( enum exn_arithmetic tag ) Noreturn;
+void raise_runtime_exn_1( enum exn_runtime, value v ) Noreturn;
+void raise_eof_exn(void) Noreturn;
+
+#endif /* _fail_h */
diff -rN -u old-lvmrun/common/fixed.h new-lvmrun/common/fixed.h
--- old-lvmrun/common/fixed.h 1970-01-01 00:00:00.000000000 +0000
+++ new-lvmrun/common/fixed.h 2014-10-24 20:16:50.878258662 +0000
@@ -0,0 +1,32 @@
+/*-----------------------------------------------------------------------
+ The Lazy Virtual Machine.
+
+ Daan Leijen.
+
+ Copyright 2001, Daan Leijen. All rights reserved. This file is
+ distributed under the terms of the GNU Library General Public License.
+-----------------------------------------------------------------------*/
+
+/* $Id: */
+
+#ifndef _fixed_h
+#define _fixed_h
+
+/*----------------------------------------------------------------------
+ Fixed blocks.
+ These blocks are traced by the garbage collector but can not be moved.
+ They are implemented with custom blocks.
+----------------------------------------------------------------------*/
+struct fixed_block {
+ struct fixed_block* next;
+ size_t size;
+ value data[1];
+};
+
+value alloc_fixed( size_t size );
+
+#define Fixed_block_val(v) (((struct fixed_block**)Data_custom_val(v))[0])
+#define Field_fixed(v,i) (Fixed_block_val(v)->data[i])
+#define Wosize_fixed(v) (Fixed_block_val(v)->size)
+
+#endif /* _fixed_h */
diff -rN -u old-lvmrun/common/memory.h new-lvmrun/common/memory.h
--- old-lvmrun/common/memory.h 1970-01-01 00:00:00.000000000 +0000
+++ new-lvmrun/common/memory.h 2014-10-24 20:16:50.878258662 +0000
@@ -0,0 +1,351 @@
+/***********************************************************************/
+/* */
+/* Objective Caml */
+/* */
+/* Damien Doligez, projet Para, INRIA Rocquencourt */
+/* */
+/* Copyright 1996 Institut National de Recherche en Informatique et */
+/* en Automatique. All rights reserved. This file is distributed */
+/* under the terms of the GNU Library General Public License. */
+/* */
+/***********************************************************************/
+
+/***---------------------------------------------------------------------
+ Modified and adapted for the Lazy Virtual Machine by Daan Leijen.
+ Modifications copyright 2001, Daan Leijen. This (modified) file is
+ distributed under the terms of the GNU Library General Public License.
+---------------------------------------------------------------------***/
+
+/* $Id: memory.h 177 2002-11-15 16:21:56Z cvs-3 $ */
+
+/* Allocation macros and functions */
+
+#ifndef _memory_
+#define _memory_
+
+#include "mlvalues.h"
+
+value alloc_shr (mlsize_t, tag_t);
+void adjust_gc_speed (mlsize_t, mlsize_t);
+void modify (value *, value);
+void initialize (value *, value);
+value check_urgent_gc (value);
+void * stat_alloc (asize_t); /* Size in bytes. */
+void stat_free (void *);
+void * stat_resize (void *, asize_t); /* Size in bytes. */
+char *alloc_for_heap (asize_t request); /* Size in bytes. */
+void free_for_heap (char *mem);
+int add_to_heap (char *mem);
+color_t allocation_color (void *hp);
+void check_heap_size(void);
+/* void shrink_heap (char *); Only used in compact.c */
+
+#ifdef NATIVE_CODE
+#define Garbage_collection_function garbage_collection
+#else
+#define Garbage_collection_function minor_collection
+#endif
+
+#ifdef DEBUG
+#define DEBUG_clear(result, wosize) { \
+ wsize_t __DEBUG_i; \
+ for (__DEBUG_i = 0; __DEBUG_i < wosize; ++ __DEBUG_i){ \
+ Field (result, __DEBUG_i) = Debug_uninit_minor; \
+ } \
+}
+#else
+#define DEBUG_clear(result, wosize)
+#endif
+
+/*---[...incomplete...]
More information about the Pkg-haskell-commits
mailing list