1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-05 13:51:09 -07:00

Merging from honeybee

Copied from Perforce
 Change: 18866
 ServerID: perforce.ravenbrook.com
This commit is contained in:
David Jones 1997-10-02 12:04:19 +01:00
parent 8986c2e45c
commit eec86d7eb7
12 changed files with 175 additions and 173 deletions

View file

@ -1,6 +1,6 @@
/* impl.c.arena: ARENA IMPLEMENTATION
*
* $HopeName: MMsrc!arena.c(trunk.8) $
* $HopeName: MMsrc!arena.c(trunk.9) $
* Copyright (C) 1997 The Harlequin Group Limited. All rights reserved.
*
* .readership: Any MPS developer
@ -40,7 +40,7 @@
/* finalization */
#include "poolmrg.h"
SRCID(arena, "$HopeName: MMsrc!arena.c(trunk.8) $");
SRCID(arena, "$HopeName: MMsrc!arena.c(trunk.9) $");
/* All static data objects are declared here. See .static */
@ -110,6 +110,7 @@ Bool ArenaCheck(Arena arena)
/* no check possible on arena->pollThreshold */
CHECKL(BoolCheck(arena->insidePoll));
CHECKL(BoolCheck(arena->clamped));
/* no check on arena->actionInterval */
CHECKL(arena->allocTime >= 0.0);
@ -232,6 +233,7 @@ void ArenaInit(Arena arena, ArenaClass class)
arena->shCache[i] = (Seg)0;
arena->pollThreshold = (Size)0;
arena->insidePoll = FALSE;
arena->clamped = FALSE;
/* design.mps.arena.poll.interval */
arena->actionInterval = ARENA_POLL_MAX;
arena->epoch = (Epoch)0; /* impl.c.ld */
@ -513,6 +515,9 @@ void ArenaPoll(Arena arena)
AVERT(Arena, arena);
if(arena->clamped)
return;
size = ArenaCommitted(arena);
if(arena->insidePoll || size < arena->pollThreshold)
return;

View file

@ -1,6 +1,6 @@
/* impl.c.awlut: POOL CLASS AWL UNIT TEST
*
* $HopeName: MMsrc!awlut.c(trunk.7) $
* $HopeName: MMsrc!awlut.c(trunk.8) $
* Copyright (C) 1997 The Harlequin Group Limited. All rights reserved.
*
* READERSHIP
@ -40,8 +40,9 @@ static mps_word_t bogus_class;
static mps_word_t wrapper_wrapper[] = {
(mps_word_t)wrapper_wrapper, /* wrapper */
(mps_word_t)&bogus_class, /* class */
3<<2|2, /* F */
1<<(MPS_WORD_WIDTH - 8), /* V */
0, /* Extra word */
4<<2|2, /* F */
2<<(MPS_WORD_WIDTH - 8), /* V */
1<<2|1, /* VL */
1 /* patterns */
};
@ -50,16 +51,18 @@ static mps_word_t wrapper_wrapper[] = {
static mps_word_t string_wrapper[] = {
(mps_word_t)wrapper_wrapper, /* wrapper */
(mps_word_t)&bogus_class, /* class */
0, /* extra word */
0, /* F */
1<<(MPS_WORD_WIDTH - 8)|3<<3|4, /* V */
2<<(MPS_WORD_WIDTH - 8)|3<<3|4, /* V */
1 /* VL */
};
static mps_word_t table_wrapper[] = {
(mps_word_t)wrapper_wrapper, /* wrapper */
(mps_word_t)&bogus_class, /* class */
0, /* extra word */
1<<2|1, /* F */
1<<(MPS_WORD_WIDTH - 8)|2, /* V */
2<<(MPS_WORD_WIDTH - 8)|2, /* V */
1 /* VL */
};
@ -104,7 +107,7 @@ static mps_word_t *alloc_table(unsigned long n, mps_ap_t ap)
size_t objsize;
void *p;
mps_word_t *object;
objsize = (3 + n) * sizeof(mps_word_t);
objsize = (4 + n) * sizeof(mps_word_t);
objsize = (objsize + MPS_PF_ALIGN-1)/MPS_PF_ALIGN*MPS_PF_ALIGN;
do {
unsigned long i;

View file

@ -1,6 +1,6 @@
# impl.gmk.comm: COMMON GNUMAKEFILE FRAGMENT
#
# $HopeName: MMsrc!comm.gmk(trunk.19) $
# $HopeName: MMsrc!comm.gmk(trunk.20) $
# Copyright (C) 1995,1996,1997 Harlequin Group, all rights reserved
#
# DESCRIPTION
@ -146,6 +146,14 @@ CFCE = -DCONFIG_VAR_CE $(CFLAGSCOOL) $(CFLAGSEXTERNAL)
CFWI = -DCONFIG_VAR_WI -DNDEBUG $(CFLAGSHOT) $(CFLAGSINTERNAL)
# == Common definitions ==
# %%PART: Add your part here, unless it's platform-specific
# These values are defined here because they have no variation between
# platforms.
FMTDY = fmtdy.c fmtdytst.c
# These map the source file lists onto object files and dependency files
# in the platform/variety directory.
#
@ -182,6 +190,8 @@ endif
endif
TESTLIBOBJ = $(TESTLIB:%.c=$(PFM)/$(VARIETY)/%.o)
TESTLIBDEP = $(TESTLIB:%.c=$(PFM)/$(VARIETY)/%.d)
FMTDYOBJ = $(FMTDY:%.c=$(PFM)/$(VARIETY)/%.o)
FMTDYDEP = $(FMTDY:%.c=$(PFM)/$(VARIETY)/%.d)
endif
# Bind CFLAGS to the appropriate set of flags for the variety.
@ -281,8 +291,7 @@ $(PFM)/$(VARIETY)/mpmconft: $(PFM)/$(VARIETY)/mpmconft.o \
$(MPMOBJ)
$(PFM)/$(VARIETY)/finalcv: $(PFM)/$(VARIETY)/finalcv.o \
$(PFM)/$(VARIETY)/fmtdy.o \
$(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(FMTDYOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/locv: $(PFM)/$(VARIETY)/locv.o \
$(MPMOBJ) $(LOOBJ) $(TESTLIBOBJ)
@ -294,23 +303,19 @@ $(PFM)/$(VARIETY)/lockcov: $(PFM)/$(VARIETY)/lockcov.o \
$(MPMOBJ)
$(PFM)/$(VARIETY)/mpsicv: $(PFM)/$(VARIETY)/mpsicv.o \
$(PFM)/$(VARIETY)/fmtdy.o \
$(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(FMTDYOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/amcss: $(PFM)/$(VARIETY)/amcss.o \
$(PFM)/$(VARIETY)/fmtdy.o \
$(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(FMTDYOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/amsss: $(PFM)/$(VARIETY)/amsss.o \
$(PFM)/$(VARIETY)/fmtdy.o \
$(MPMOBJ) $(AMSOBJ) $(TESTLIBOBJ)
$(FMTDYOBJ) $(MPMOBJ) $(AMSOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/awlut: $(PFM)/$(VARIETY)/awlut.o \
$(PFM)/$(VARIETY)/fmtdy.o \
$(MPMOBJ) $(LOOBJ) $(AWLOBJ) $(TESTLIBOBJ)
$(FMTDYOBJ) $(MPMOBJ) $(LOOBJ) $(AWLOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/dwstress: $(PFM)/$(VARIETY)/dwstress.o \
$(MPMOBJ) $(AMCOBJ) $(DWOBJ) $(TESTLIBOBJ)
$(FMTDYOBJ) $(MPMOBJ) $(AMCOBJ) $(DWOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/poolncv: $(PFM)/$(VARIETY)/poolncv.o \
$(MPMOBJ) $(TESTLIBOBJ) $(POOLNOBJ) $(ARENAANOBJ)
@ -377,7 +382,7 @@ ifdef VARIETY
ifdef TARGET
# %%PART: Add the dependency file macro for the new part here.
include $(MPMDEP) $(AMSDEP) $(AMCDEP) $(LODEP) $(SWDEP) \
$(AWLDEP) $(DWDEP) $(POOLNDEP) $(ARENAANDEP) $(TESTLIBDEP)
$(AWLDEP) $(DWDEP) $(POOLNDEP) $(TESTLIBDEP) $(FMTDYDEP) $(ARENAANDEP)
endif
endif

View file

@ -1,6 +1,6 @@
# ==== SECOND COMMON FRAGMENT FOR PLATFORMS USING MV AND NMAKE
#
# $HopeName: MMsrc!commpost.nmk(trunk.12) $
# $HopeName: MMsrc!commpost.nmk(trunk.13) $
# Copyright(C) 1997 Harlequin Group, all rights reserved
#
# DESCRIPTION
@ -74,7 +74,8 @@ variety: $(PFM)\$(VARIETY)\$(TARGET)
!IFDEF VARIETY
$(PFM)\$(VARIETY)\finalcv.exe: $(PFM)\$(VARIETY)\finalcv.obj \
$(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(DWOBJ) $(MRGOBJ) $(TESTLIBOBJ)
$(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(DWOBJ) $(DWTESTOBJ) \
$(MRGOBJ) $(TESTLIBOBJ)
$(PFM)\$(VARIETY)\mpmconft.exe: $(PFM)\$(VARIETY)\mpmconft.obj \
$(MPMOBJ) $(PLINTHOBJ)
@ -92,13 +93,16 @@ $(PFM)\$(VARIETY)\qs.exe: $(PFM)\$(VARIETY)\qs.obj \
$(AMCOBJ) $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
$(PFM)\$(VARIETY)\amcss.exe: $(PFM)\$(VARIETY)\amcss.obj \
$(MPMOBJ) $(AMCOBJ) $(PLINTHOBJ) $(DWOBJ) $(TESTLIBOBJ)
$(MPMOBJ) $(AMCOBJ) $(PLINTHOBJ) $(DWOBJ) $(DWTESTOBJ) \
$(TESTLIBOBJ)
$(PFM)\$(VARIETY)\amsss.exe: $(PFM)\$(VARIETY)\amsss.obj \
$(MPMOBJ) $(AMSOBJ) $(PLINTHOBJ) $(DWOBJ) $(TESTLIBOBJ)
$(MPMOBJ) $(AMSOBJ) $(PLINTHOBJ) $(DWOBJ) $(DWTESTOBJ) \
$(TESTLIBOBJ)
$(PFM)\$(VARIETY)\mpsicv.exe: $(PFM)\$(VARIETY)\mpsicv.obj \
$(MPMOBJ) $(AMCOBJ) $(PLINTHOBJ) $(DWOBJ) $(TESTLIBOBJ)
$(MPMOBJ) $(AMCOBJ) $(PLINTHOBJ) $(DWOBJ) $(DWTESTOBJ) \
$(TESTLIBOBJ)
$(PFM)\$(VARIETY)\dwstress.exe: $(PFM)\$(VARIETY)\dwstress.obj \
$(DWOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ)

View file

@ -1,6 +1,6 @@
/* impl.c.fmtdy: DYLAN OBJECT FORMAT IMPLEMENTATION
*
* $HopeName: MMsrc!fmtdy.c(trunk.11) $
* $HopeName: MMsrc!fmtdy.c(trunk.12) $
* Copyright (C) 1996,1997 Harlequin Group, all rights reserved.
*
* All objects, B:
@ -21,20 +21,22 @@
*
* W WW pointer to wrapper wrapper
* W+1 class DylanWorks class pointer (traceable)
* W+2 (FL << 2) | FF fixed part length and format
* W+3 (VS << 3) | VF variable part format and element size
* W+4 (WT << 2) | 1 tagged pattern vector length
* W+5 pattern 0 patterns for fixed part fields
* W+5+WT-1 pattern WT-1
* W+2 subtype_mask DylanWorks subtype_mask (untraceable)
* W+3 (FL << 2) | FF fixed part length and format
* W+4 (VS << 3) | VF variable part format and element size
* W+5 (WT << 2) | 1 tagged pattern vector length
* W+6 pattern 0 patterns for fixed part fields
* W+6+WT-1 pattern WT-1
*
* The wrapper wrapper, WW:
*
* WW WW WW is it's own wrapper
* WW+1 class DylanWorks class of wrappers
* WW+2 (3 << 2) | 2 wrappers have three patterned fields
* WW+3 (0 << 3) | 0 wrappers have a non-traceable vector
* WW+4 (1 << 2) | 1 one pattern word follows
* WW+5 0b001 only field 0 is traceable
* WW+2 subtype_mask DylanWorks subtype_mask for WW
* WW+3 (4 << 2) | 2 wrappers have four patterned fields
* WW+4 (0 << 3) | 0 wrappers have a non-traceable vector
* WW+5 (1 << 2) | 1 one pattern word follows
* WW+6 0b001 only field 0 is traceable
*
* .improve.abstract.access: There are severe common subexpression
* problems. In particular, code for accessing subfields in the
@ -72,7 +74,7 @@
#ifndef NDEBUG
static int dylan_wrapper_check(mps_word_t *w)
int dylan_wrapper_check(mps_word_t *w)
{
mps_word_t *ww;
mps_word_t vh;
@ -93,34 +95,36 @@ static int dylan_wrapper_check(mps_word_t *w)
* run-time, it would be possible to know the address of a unique
* wrapper wrapper and check that instead. */
assert(w[0] != 0);
assert((w[0] & 3) == 0); /* wrapper wrapper is aligned */
ww = (mps_word_t *)w[0];
assert(ww[0] == w[0]); /* wrapper wrapper is own wrapper */
assert(ww[1] != 0); /* wrapper class exists */
assert((ww[1] & 3) == 0); /* wrapper class is aligned */
assert(ww[2] == ((3 << 2) | 2)); /* three fields with patterns */
assert((ww[3] & 0x00ffffff) == 0);/* non-traceable vector */
assert(((ww[3] >> (MPS_WORD_WIDTH - 8)) & 0xff) == 1 ||
((ww[3] >> (MPS_WORD_WIDTH - 8)) & 0xff) == 0); /* version 0 or 1 */
assert(ww[4] == ((1 << 2) | 1)); /* one pattern word in wrapper wrapper */
assert(ww[5] == 1); /* first field traceable */
assert(w[WW] != 0);
assert((w[WW] & 3) == 0); /* wrapper wrapper is aligned */
ww = (mps_word_t *)w[WW];
assert(ww[WW] == w[WW]); /* wrapper wrapper is own wrapper */
assert(ww[WC] != 0); /* wrapper class exists */
assert((ww[WC] & 3) == 0); /* wrapper class is aligned */
assert(ww[WF] == (((WS - 1) << 2) | 2)); /* fields with patterns */
assert((ww[WV] & 0x00ffffff) == 0);/* non-traceable vector */
/* Code in this file only works for version 2 */
assert(((ww[WV] >> (MPS_WORD_WIDTH - 8)) & 0xff) == 2);
assert(ww[WS] == ((1 << 2) | 1)); /* one pattern word in wrapper wrapper */
/* The first field is traceable, the second field can be traced, */
/* but doesn't need to be. */
assert((ww[WP] == 1) || (ww[WP] == 3));
/* Unpack the wrapper. */
class = w[1]; /* class */
fh = w[2]; /* fixed part header word */
class = w[WC]; /* class */
fh = w[WF]; /* fixed part header word */
fl = fh >> 2; /* fixed part length */
ff = fh & 3; /* fixed part format code */
vh = w[3]; /* variable part header */
vh = w[WV]; /* variable part header */
version = (vh >> (MPS_WORD_WIDTH - 8)) & 0xff;
assert(version == 0 || version == 1);
assert(version == 2); /* Code in this file only works for version 2 */
reserved = (vh >> 8) & 0xff;
assert(reserved == 0);
vb = (vh >> 16) & 0xff;
es = (vh & 0xff) >> 3;/* element size */
vf = vh & 7; /* variable part format code */
vt = w[4]; /* vector total word (Dylan-tagged) */
vt = w[WS]; /* vector total word (Dylan-tagged) */
t = vt >> 2; /* vector total length */
/* The second word is the class of the wrapped object. */
@ -174,7 +178,7 @@ static int dylan_wrapper_check(mps_word_t *w)
/* The patterns are random bits, so we can't check them. However, */
/* the left-over bits in the last pattern should be zero. */
assert(ff != 2 || (w[4+t] >> ((fh>>2) & (MPS_WORD_WIDTH-1))) == 0);
assert(ff != 2 || (w[WS+t] >> ((fh>>2) & (MPS_WORD_WIDTH-1))) == 0);
return 1;
}
@ -358,7 +362,7 @@ static mps_res_t dylan_scan1(mps_ss_t mps_ss, mps_addr_t *object_io)
/* Fixed Part */
fh = w[2];
fh = w[WF];
fl = fh >> 2; /* get the fixed part length */
/* It might be worth inlining common cases here, for example, */
@ -377,7 +381,7 @@ static mps_res_t dylan_scan1(mps_ss_t mps_ss, mps_addr_t *object_io)
break;
case 2: /* patterns */
res = dylan_scan_pat(mps_ss, p, q, &w[5], w[4]>>2);
res = dylan_scan_pat(mps_ss, p, q, &w[WP], w[WS]>>2);
if(res) return res;
break;
@ -389,7 +393,7 @@ static mps_res_t dylan_scan1(mps_ss_t mps_ss, mps_addr_t *object_io)
}
/* Variable Part */
vh = w[3];
vh = w[WV];
vf = vh & 7; /* get variable part format */
if(vf != 7)
{
@ -496,7 +500,7 @@ static mps_res_t dylan_scan1_weak(mps_ss_t mps_ss, mps_addr_t *object_io)
++p; /* skip header */
fword = w[2];
fword = w[WF];
fl = fword >> 2;
/* weak vectors should have at least one fixed field */
/* (for assoc field) */
@ -509,7 +513,7 @@ static mps_res_t dylan_scan1_weak(mps_ss_t mps_ss, mps_addr_t *object_io)
assoc = (mps_addr_t *)p[0];
vword = w[3];
vword = w[WV];
vf = vword & 7;
vl = (mps_word_t)p[fl] >> 2;
@ -579,9 +583,9 @@ static mps_addr_t dylan_skip(mps_addr_t object)
assert(dylan_wrapper_check(w));
++p;
p += w[2] >> 2; /* skip fixed part fields */
p += w[WF] >> 2; /* skip fixed part fields */
vh = w[3];
vh = w[WV];
vf = vh & 7; /* get variable part format */
if(vf != 7)
{
@ -664,7 +668,7 @@ static void dylan_no_fwd(mps_addr_t old, mps_addr_t new)
notreached();
}
static void dylan_pad(mps_addr_t addr, size_t size)
void dylan_pad(mps_addr_t addr, size_t size)
{
mps_word_t *p;
@ -715,86 +719,6 @@ mps_fmt_A_s *dylan_fmt_A_weak(void)
return &dylan_fmt_A_weak_s;
}
/* Format Test Code */
static mps_word_t *ww = NULL;
static mps_word_t *tvw;
mps_res_t dylan_init(mps_addr_t addr, size_t size,
mps_addr_t *refs, size_t nr_refs)
{
/* Make sure the size is aligned. */
assert((size & (ALIGN-1)) == 0);
if(ww == NULL) {
ww = malloc(sizeof(mps_word_t) * 6);
if(ww == NULL) return MPS_RES_MEMORY;
tvw = malloc(sizeof(mps_word_t) * 5);
if(tvw == NULL) {
free(ww);
return MPS_RES_MEMORY;
}
/* Build a wrapper wrapper. */
ww[0] = (mps_word_t)ww;
ww[1] = (mps_word_t)ww; /* dummy class */
ww[2] = (3 << 2) | 2;
ww[3] = (0 << 3) | 0;
ww[4] = (1 << 2) | 1;
ww[5] = 1;
/* Build a wrapper for traceable vectors. */
tvw[0] = (mps_word_t)ww;
tvw[1] = (mps_word_t)ww; /* dummy class */
tvw[2] = 0; /* no fixed part */
tvw[3] = 2; /* traceable variable part */
tvw[4] = 1; /* no patterns */
}
/* If there is enough room, make a vector, otherwise just */
/* make a padding object. */
if(size >= sizeof(mps_word_t) * 2) {
mps_word_t *p = (mps_word_t *)addr;
mps_word_t i, t = (size / sizeof(mps_word_t)) - 2;
p[0] = (mps_word_t)tvw; /* install vector wrapper */
p[1] = (t << 2) | 1; /* tag the vector length */
for(i = 0; i < t; ++i)
p[2+i] = (mps_word_t)refs[rand() % nr_refs];
} else
dylan_pad(addr, size);
return MPS_RES_OK;
}
void dylan_write(mps_addr_t addr, mps_addr_t *refs, size_t nr_refs)
{
mps_word_t *p = (mps_word_t *)addr;
/* If the object is a vector, update a random entry. */
if(p[0] == (mps_word_t)tvw) {
mps_word_t t = p[1] >> 2;
if(t > 0)
p[2 + (rand() % t)] =
(mps_word_t)refs[rand() % nr_refs];
}
}
mps_addr_t dylan_read(mps_addr_t addr)
{
mps_word_t *p = (mps_word_t *)addr;
/* If the object is a vector, return a random entry. */
if(p[0] == (mps_word_t)tvw) {
mps_word_t t = p[1] >> 2;
if(t > 0)
return (mps_addr_t)p[2 + (rand() % t)];
}
return addr;
}
mps_bool_t dylan_check(mps_addr_t addr)
{
assert(addr != 0);
@ -805,3 +729,4 @@ mps_bool_t dylan_check(mps_addr_t addr)
unused(addr);
return 1;
}

View file

@ -1,6 +1,6 @@
/* impl.h.fmtdy: DYLAN OBJECT FORMAT
*
* $HopeName: MMsrc!fmtdy.h(trunk.2) $
* $HopeName: MMsrc!fmtdy.h(trunk.3) $
* Copyright (C) 1997 Harlequin Group, all rights reserved
*/
@ -21,5 +21,19 @@ extern void dylan_write(mps_addr_t addr,
mps_addr_t *refs, size_t nr_refs);
extern mps_addr_t dylan_read(mps_addr_t addr);
extern mps_bool_t dylan_check(mps_addr_t addr);
extern void dylan_pad(mps_addr_t addr, size_t size);
extern int dylan_wrapper_check(mps_word_t *w);
#define WW 0
#define WC 1
#define WM 2
#define WF 3
#define WV 4
#define WS 5
#define WP 6
#define BASIC_WRAPPER_SIZE WS
#define ALIGN sizeof(mps_word_t)
#endif /* fmtdy_h */

View file

@ -1,6 +1,6 @@
/* impl.h.mps: HARLEQUIN MEMORY POOL SYSTEM C INTERFACE
*
* $HopeName: MMsrc!mps.h(trunk.26) $
* $HopeName: MMsrc!mps.h(trunk.27) $
* Copyright (C) 1997 The Harlequin Group Limited. All rights reserved.
*
* .readership: customers, MPS developers.
@ -177,6 +177,10 @@ extern void mps_arena_clamp(mps_arena_t);
extern void mps_arena_release(mps_arena_t);
extern void mps_arena_park(mps_arena_t);
extern mps_res_t mps_arena_collect(mps_arena_t);
extern void mps_space_clamp(mps_space_t);
extern void mps_space_release(mps_space_t);
extern void mps_space_park(mps_space_t);
extern mps_res_t mps_space_collect(mps_space_t);
extern mps_res_t mps_arena_create(mps_arena_t *, mps_arena_class_t, ...);
extern mps_res_t mps_arena_create_v(mps_arena_t *, mps_arena_class_t, va_list);

View file

@ -1,6 +1,6 @@
/* impl.c.mpsi: MEMORY POOL SYSTEM C INTERFACE LAYER
*
* $HopeName: MMsrc!mpsi.c(trunk.31) $
* $HopeName: MMsrc!mpsi.c(trunk.32) $
* Copyright (C) 1997 The Harlequin Group Limited. All rights reserved.
*
* .purpose: This code bridges between the MPS interface to C,
@ -52,7 +52,7 @@
#include "mps.h"
#include "mpsavm.h" /* only for mps_space_create */
SRCID(mpsi, "$HopeName: MMsrc!mpsi.c(trunk.31) $");
SRCID(mpsi, "$HopeName: MMsrc!mpsi.c(trunk.32) $");
/* mpsi_check -- check consistency of interface mappings
@ -213,6 +213,7 @@ size_t mps_space_committed(mps_space_t mps_space)
return mps_arena_committed(mps_space);
}
void mps_arena_clamp(mps_arena_t mps_arena)
{
Arena arena = (Arena)mps_arena;
@ -220,7 +221,14 @@ void mps_arena_clamp(mps_arena_t mps_arena)
ArenaClamp(arena);
ArenaLeave(arena);
}
/* for backward compatibility */
void mps_space_clamp(mps_space_t mps_space)
{
mps_arena_clamp(mps_space);
}
void mps_arena_release(mps_arena_t mps_arena)
{
Arena arena = (Arena)mps_arena;
@ -228,7 +236,14 @@ void mps_arena_release(mps_arena_t mps_arena)
ArenaRelease(arena);
ArenaLeave(arena);
}
/* for backward compatibility */
void mps_space_release(mps_space_t mps_space)
{
mps_arena_release(mps_space);
}
void mps_arena_park(mps_space_t mps_space)
{
Arena arena = (Arena)mps_space;
@ -236,7 +251,14 @@ void mps_arena_park(mps_space_t mps_space)
ArenaPark(arena);
ArenaLeave(arena);
}
/* for backward compatibility */
void mps_space_park(mps_space_t mps_space)
{
mps_arena_park(mps_space);
}
mps_res_t mps_arena_collect(mps_space_t mps_space)
{
Res res;
@ -246,7 +268,13 @@ mps_res_t mps_arena_collect(mps_space_t mps_space)
ArenaLeave(arena);
return res;
}
/* for backward compatibility */
mps_res_t mps_space_collect(mps_space_t mps_space)
{
return mps_arena_collect(mps_space);
}
/* mps_arena_create -- create an arena object */

View file

@ -1,6 +1,6 @@
/* impl.c.poolawl: AUTOMATIC WEAK LINKED POOL CLASS
*
* $HopeName: MMsrc!poolawl.c(trunk.21) $
* $HopeName: MMsrc!poolawl.c(trunk.22) $
* Copyright (C) 1997 The Harlequin Group Limited. All rights reserved.
*
* READERSHIP
@ -16,7 +16,7 @@
#include "mpm.h"
#include "mpscawl.h"
SRCID(poolawl, "$HopeName: MMsrc!poolawl.c(trunk.21) $");
SRCID(poolawl, "$HopeName: MMsrc!poolawl.c(trunk.22) $");
#define AWLSig ((Sig)0x519b7a37) /* SIGPooLAWL */
@ -422,7 +422,7 @@ static Bool AWLDependentObject(Addr *objReturn, Addr parent)
AVER(wrapper[0] != 0);
/* check wrapper wrapper is wrapper wrapper wrapper */
AVER(wrapper[0] == ((Word *)wrapper[0])[0]);
fword = wrapper[2];
fword = wrapper[3];
ff = fword & 3;
/* Traceable Fixed part */
AVER(ff == 1);

View file

@ -2,7 +2,7 @@
*
* MANUAL RANK GUARDIAN POOL
*
* $HopeName: MMsrc!poolmrg.c(trunk.17) $
* $HopeName: MMsrc!poolmrg.c(trunk.18) $
* Copyright (C) 1997 The Harlequin Group Limited. All rights reserved.
*
* READERSHIP
@ -26,7 +26,7 @@
#include "mpm.h"
#include "poolmrg.h"
SRCID(poolmrg, "$HopeName: MMsrc!poolmrg.c(trunk.17) $");
SRCID(poolmrg, "$HopeName: MMsrc!poolmrg.c(trunk.18) $");
/* Types */
@ -446,18 +446,19 @@ static Res MRGGroupScan(ScanState ss, MRGGroup group, MRG mrg)
for(i=0; i < nGuardians; ++i) {
refPart = refPartOfIndex(group, i);
/* Not worth checking whether the reference is free, because */
/* the zone check will discard that case cheaply. */
/* .ref.direct: We can access the reference directly */
/* because we are in a scan and the shield is exposed. */
if(TRACE_FIX1(ss, refPart->ref)) {
res = TRACE_FIX2(ss, &(refPart->ref));
if(res != ResOK)
return res;
if(ss->rank == RankFINAL && !ss->wasMarked) { /* .improve.rank */
MRGFinalize(arena, group, i);
/* free guardians are not scanned */
if(MRGLinkOfRefPart(refPart, arena)->state != MRGGuardianFREE) {
ss->wasMarked = TRUE;
/* .ref.direct: We can access the reference directly */
/* because we are in a scan and the shield is exposed. */
if(TRACE_FIX1(ss, refPart->ref)) {
res = TRACE_FIX2(ss, &(refPart->ref));
if(res != ResOK)
return res;
if(ss->rank == RankFINAL && !ss->wasMarked) { /* .improve.rank */
MRGFinalize(arena, group, i);
}
}
}
}

View file

@ -1,16 +1,16 @@
# impl.s.sso1al: STACK SCANNING FOR DIGITAL UNIX / ALPHA
#
# $HopeName$
# $HopeName: MMsrc!sso1al.s(trunk.1) $
# Copyright (C) 1997 Harlequin Group, all rights reserved
#
# .readership: Any MPS developer that is prepared to read Alpha
# assembly code in DIGITAL UNIX 'as' syntax.
#
# See design.mps.sso1al for the design.
# See design.mps.sso1al for the design (exists).
.globl StackScan
.globl TraceScanAreaTagged
.globl TraceScanArea
.ent StackScan
StackScan:
@ -28,13 +28,13 @@ stq $14,48($sp)
stq $15,56($sp)
.prologue 1
# bis $31,$16,$16 1st arg to TraceScanAreaTagged is same as our 1st arg
# bis $31,$16,$16 1st arg to TraceScanArea is same as our 1st arg
bis $31,$17,$18 # area to be scanned is from $sp to StackBot
bis $31,$sp,$17
jsr $26,TraceScanAreaTagged
jsr $26,TraceScanArea
ldgp $gp,0($26)
# our result is TraceScanAreaTagged's result, so leave $0 untouched
# our result is TraceScanArea's result, so leave $0 untouched
ldq $26,0($sp)
lda $sp,+64($sp)

View file

@ -1,6 +1,6 @@
# ==== NTI3MV NMAKE FILE ====
#
# $HopeName: MMsrc!w3i3mv.nmk(trunk.44) $
# $HopeName: MMsrc!w3i3mv.nmk(trunk.45) $
#
# Copyright (C) 1995,1996,1997 Harlequin Group, all rights reserved
#
@ -25,6 +25,7 @@ AMS = <poolams>
AWL = <poolawl>
LO = <lo>
DW = <fmtdy>
DWTEST = <fmtdytst>
POOLN = <pooln>
ARENAAN = <arenaan>
TESTLIB = <testlib>
@ -62,6 +63,8 @@ LOOBJ0 = $(LO:<=w3i3mv\he\)
LOOBJ = $(LOOBJ0:>=.obj)
DWOBJ0 = $(DW:<=w3i3mv\he\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