[project @ 1999-04-27 10:59:29 by sewardj]
authorsewardj <unknown>
Tue, 27 Apr 1999 10:59:31 +0000 (10:59 +0000)
committersewardj <unknown>
Tue, 27 Apr 1999 10:59:31 +0000 (10:59 +0000)
Minor mods to make STG Hugs compile out-of-the-box.

ghc/includes/ClosureMacros.h
ghc/interpreter/Makefile
ghc/interpreter/version.h
ghc/rts/Schedule.c

index fca822f..4f170ca 100644 (file)
@@ -1,5 +1,5 @@
 /* ----------------------------------------------------------------------------
- * $Id: ClosureMacros.h,v 1.11 1999/04/23 13:54:12 simonm Exp $
+ * $Id: ClosureMacros.h,v 1.12 1999/04/27 10:59:30 sewardj Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -367,5 +367,7 @@ SET_STATIC_HDR(PrelBase_CZh_closure,PrelBase_CZh_info,costCentreStack,const);
 #define bcoConstFloat( bco, i )  (PK_FLT(stgCast(StgWord*,(bco)->payload+(bco)->n_ptrs+i)))
 #define bcoConstDouble( bco, i ) (PK_DBL(stgCast(StgWord*,(bco)->payload+(bco)->n_ptrs+i)))
 #define bcoInstr( bco, i )       (stgCast(StgWord8*,      ((bco)->payload+(bco)->n_ptrs+(bco)->n_words))[i])
+static __inline__ StgInt bcoInstr16 ( StgBCO* bco, unsigned int i )
+{ StgInt x = (bcoInstr(bco,i) << 8) + bcoInstr(bco,i+1); return x; }
 
 #endif /* CLOSUREMACROS_H */
index b6452f2..45b574b 100644 (file)
@@ -1,6 +1,6 @@
 
 # ----------------------------------------------------------------------------- #
-# $Id: Makefile,v 1.7 1999/04/27 10:06:47 sewardj Exp $                         #
+# $Id: Makefile,v 1.8 1999/04/27 10:59:29 sewardj Exp $                         #
 # ----------------------------------------------------------------------------- #
 
 TOP = ../..
@@ -42,7 +42,7 @@ nHandle.so:
        gcc -O -fPIC -shared -o nHandle.so nHandle.c
 
 $(TOP)/ghc/rts/libHSrts.a:
-       (cd $(TOP)/ghc/rts ; make clean ; make)
+       (cd $(TOP)/ghc/rts ; make clean ; make EXTRA_CC_OPTS=-I$(GHC_DIR)/interpreter)
 
 cleanish:
        /bin/rm *.o
@@ -53,7 +53,7 @@ snapshot:
              ../rts/Assembler.c ../rts/Evaluator.c ../rts/Disassembler.c \
              ../rts/ForeignCall.c ../rts/Printer.c ../rts/QueueTemplate.h \
              ../includes/options.h ../includes/Assembler.h nHandle.c \
-             ../includes/Assembler.h ../rts/Bytecodes.h \
+             ../includes/Assembler.h ../rts/Bytecodes.h ../includes/ClosureMacros.h \
              lib/*.hs runnofib runallnofib
 
 
index 5345d73..2834344 100644 (file)
@@ -13,6 +13,6 @@
 #if MAJOR_RELEASE
 #define HUGS_VERSION "January 1998 "
 #else
-#define HUGS_VERSION "STG-98 proto "
+#define HUGS_VERSION "STG 27 Apr 99"
 #endif
 
index 165b61f..09aeb15 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.19 1999/03/20 17:33:07 sof Exp $
+ * $Id: Schedule.c,v 1.20 1999/04/27 10:59:31 sewardj Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -520,8 +520,13 @@ threadStackOverflow(StgTSO *tso)
     printStackChunk(tso->sp, stg_min(tso->stack+tso->stack_size, 
                                     tso->sp+64));
 #endif
+#ifdef INTERPRETER
+    fprintf(stderr, "fatal: stack overflow in Hugs; aborting\n" );
+    exit(1);
+#else
     /* Send this thread the StackOverflow exception */
     raiseAsync(tso, (StgClosure *)&stackOverflow_closure);
+#endif
     return tso;
   }