Commit 564f5f62 authored by sewardj's avatar sewardj

[project @ 2000-02-25 10:53:53 by sewardj]

Nuke PTR_ON_HEAP and all associated ifdeffery; we always need it.
parent f1b1d5f0
/* ../options.h. Generated automatically by configure. */
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
* Configuration options * Configuration options
* *
* Most configuration options are arguments to the configure script
* (try running "configure --help"). The following options are either
* experimental or require changes to "Prelude.hs", the standard libraries
* and demos and therefore cannot be modified using the configure script.
* Most users should leave them alone!
*
* Copyright (c) The University of Nottingham and Yale University, 1994-1997. * Copyright (c) The University of Nottingham and Yale University, 1994-1997.
* All rights reserved. See NOTICE for details and conditions of use etc... * All rights reserved. See NOTICE for details and conditions of use etc...
* Hugs version 1.4, December 1997 * Hugs version 1.4, December 1997
* *
* $RCSfile: options.h,v $ * $RCSfile: options.h,v $
* $Revision: 1.16 $ * $Revision: 1.17 $
* $Date: 2000/01/06 11:57:11 $ * $Date: 2000/02/25 10:53:53 $
* ------------------------------------------------------------------------*/ * ------------------------------------------------------------------------*/
...@@ -158,12 +152,6 @@ ...@@ -158,12 +152,6 @@
*/ */
#define DYN_TABLES SMALL_HUGS #define DYN_TABLES SMALL_HUGS
/* Define this to include support for storing pointers in the heap.
* This is required by the code generator (which has to store
* pointers to AsmObjects).
*/
#define PTR_ON_HEAP 1
/* Should quantifiers be displayed in error messages. /* Should quantifiers be displayed in error messages.
* Warning: not consistently used. * Warning: not consistently used.
*/ */
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
* included in the distribution. * included in the distribution.
* *
* $RCSfile: storage.c,v $ * $RCSfile: storage.c,v $
* $Revision: 1.45 $ * $Revision: 1.46 $
* $Date: 2000/02/24 17:26:12 $ * $Date: 2000/02/25 10:53:54 $
* ------------------------------------------------------------------------*/ * ------------------------------------------------------------------------*/
#include "prelude.h" #include "prelude.h"
...@@ -2445,7 +2445,9 @@ Int n; { ...@@ -2445,7 +2445,9 @@ Int n; {
} }
#if SIZEOF_VOID_P == SIZEOF_INT #if SIZEOF_VOID_P == SIZEOF_INT
typedef union {Int i; Ptr p;} IntOrPtr; typedef union {Int i; Ptr p;} IntOrPtr;
Cell mkPtr(p) Cell mkPtr(p)
Ptr p; Ptr p;
{ {
...@@ -2462,6 +2464,7 @@ Cell c; ...@@ -2462,6 +2464,7 @@ Cell c;
x.i = snd(c); x.i = snd(c);
return x.p; return x.p;
} }
Cell mkCPtr(p) Cell mkCPtr(p)
Ptr p; Ptr p;
{ {
...@@ -2478,8 +2481,11 @@ Cell c; ...@@ -2478,8 +2481,11 @@ Cell c;
x.i = snd(c); x.i = snd(c);
return x.p; return x.p;
} }
#elif SIZEOF_VOID_P == 2*SIZEOF_INT #elif SIZEOF_VOID_P == 2*SIZEOF_INT
typedef union {struct {Int i1; Int i2;} i; Ptr p;} IntOrPtr; typedef union {struct {Int i1; Int i2;} i; Ptr p;} IntOrPtr;
Cell mkPtr(p) Cell mkPtr(p)
Ptr p; Ptr p;
{ {
...@@ -2497,23 +2503,32 @@ Cell c; ...@@ -2497,23 +2503,32 @@ Cell c;
x.i.i2 = intOf(snd(snd(c))); x.i.i2 = intOf(snd(snd(c)));
return x.p; return x.p;
} }
#else
#warning "type Addr not supported on this architecture - don't use it" Cell mkCPtr(p)
Cell mkPtr(p)
Ptr p; Ptr p;
{ {
ERRMSG(0) "mkPtr: type Addr not supported on this architecture" IntOrPtr x;
EEND; x.p = p;
return pair(CPTRCELL,pair(mkInt(x.i.i1),mkInt(x.i.i2)));
} }
Ptr ptrOf(c) Ptr cptrOf(c)
Cell c; Cell c;
{ {
ERRMSG(0) "ptrOf: type Addr not supported on this architecture" IntOrPtr x;
EEND; assert(fst(c) == CPTRCELL);
x.i.i1 = intOf(fst(snd(c)));
x.i.i2 = intOf(snd(snd(c)));
return x.p;
} }
#else
#error "Can't implement mkPtr/ptrOf on this architecture."
#endif #endif
String stringNegate( s ) String stringNegate( s )
String s; String s;
{ {
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
* included in the distribution. * included in the distribution.
* *
* $RCSfile: storage.h,v $ * $RCSfile: storage.h,v $
* $Revision: 1.28 $ * $Revision: 1.29 $
* $Date: 2000/02/24 14:09:14 $ * $Date: 2000/02/25 10:53:54 $
* ------------------------------------------------------------------------*/ * ------------------------------------------------------------------------*/
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
...@@ -140,6 +140,10 @@ extern Cell whatIs Args((Cell)); ...@@ -140,6 +140,10 @@ extern Cell whatIs Args((Cell));
* and string text etc. * and string text etc.
* ------------------------------------------------------------------------*/ * ------------------------------------------------------------------------*/
#if !defined(SIZEOF_VOID_P) || !defined(SIZEOF_INT)
#error SIZEOF_VOID_P or SIZEOF_INT is not defined
#endif
#define TAGMIN 1 /* Box and constructor cell tag values */ #define TAGMIN 1 /* Box and constructor cell tag values */
#define BCSTAG 30 /* Box=TAGMIN..BCSTAG-1 */ #define BCSTAG 30 /* Box=TAGMIN..BCSTAG-1 */
#define isTag(c) (TAGMIN<=(c) && (c)<SPECMIN) /* Tag cell values */ #define isTag(c) (TAGMIN<=(c) && (c)<SPECMIN) /* Tag cell values */
...@@ -157,14 +161,14 @@ extern Cell whatIs Args((Cell)); ...@@ -157,14 +161,14 @@ extern Cell whatIs Args((Cell));
#define ADDPAT 11 /* (_+k) pattern discr: snd :: Int */ #define ADDPAT 11 /* (_+k) pattern discr: snd :: Int */
#define FLOATCELL 15 /* Floating Pt literal: snd :: Text */ #define FLOATCELL 15 /* Floating Pt literal: snd :: Text */
#define BIGCELL 16 /* Integer literal: snd :: Text */ #define BIGCELL 16 /* Integer literal: snd :: Text */
#if PTR_ON_HEAP
#define PTRCELL 17 /* C Heap Pointer snd :: Ptr */ #define PTRCELL 17 /* C Heap Pointer snd :: Ptr */
#define CPTRCELL 21 /* Native code pointer snd :: Ptr */
#if IPARAM #if IPARAM
#define IPCELL 19 /* Imp Param Cell: snd :: Text */ #define IPCELL 19 /* Imp Param Cell: snd :: Text */
#define IPVAR 20 /* ?x: snd :: Text */ #define IPVAR 20 /* ?x: snd :: Text */
#endif #endif
#define CPTRCELL 21 /* Native code pointer snd :: Ptr */
#endif
#if TREX #if TREX
#define EXTCOPY 22 /* Copy of an Ext: snd :: Text */ #define EXTCOPY 22 /* Copy of an Ext: snd :: Text */
#endif #endif
...@@ -214,14 +218,12 @@ extern Text textOf Args((Cell)); ...@@ -214,14 +218,12 @@ extern Text textOf Args((Cell));
#define stringToBignum(s) pair(BIGCELL,findText(s)) #define stringToBignum(s) pair(BIGCELL,findText(s))
#define bignumToString(b) textToStr(snd(b)) #define bignumToString(b) textToStr(snd(b))
#if PTR_ON_HEAP
#define isPtr(c) (isPair(c) && fst(c)==PTRCELL) #define isPtr(c) (isPair(c) && fst(c)==PTRCELL)
extern Cell mkPtr Args((Ptr)); extern Cell mkPtr Args((Ptr));
extern Ptr ptrOf Args((Cell)); extern Ptr ptrOf Args((Cell));
#define isCPtr(c) (isPair(c) && fst(c)==CPTRCELL) #define isCPtr(c) (isPair(c) && fst(c)==CPTRCELL)
extern Cell mkCPtr Args((Ptr)); extern Cell mkCPtr Args((Ptr));
extern Ptr cptrOf Args((Cell)); extern Ptr cptrOf Args((Cell));
#endif
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
* Constructor cell tags are used as the fst element of a pair to indicate * Constructor cell tags are used as the fst element of a pair to indicate
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment