File: frame.c

package info (click to toggle)
nickle 2.77-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,612 kB
  • ctags: 3,746
  • sloc: ansic: 26,986; yacc: 1,873; sh: 954; lex: 884; makefile: 225
file content (50 lines) | stat: -rw-r--r-- 1,072 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* $Header$ */

/*
 * Copyright © 1988-2004 Keith Packard and Bart Massey.
 * All Rights Reserved.  See the file COPYING in this directory
 * for licensing information.
 */

#include	"nickle.h"

static void
FrameMark (void *object)
{
    Frame   *frame = object;

    do
    {
	MemReference (frame->staticLink);
	MemReference (frame->function);
	MemReference (frame->frame);
	MemReference (frame->statics);
	MemReference (frame->saveObj);
	frame = frame->previous;
    } while (MemReferenceNoRecurse (frame) == 0);
}

DataType FrameType = { FrameMark, 0, "FrameType" };

FramePtr
NewFrame (Value		function,
	  FramePtr	previous,
	  FramePtr	staticLink,
	  BoxTypesPtr	dynamics,
	  BoxPtr	statics)
{
    ENTER ();
    FramePtr	frame;

    frame = ALLOCATE (&FrameType, sizeof (Frame));
    frame->previous = previous;
    frame->staticLink = staticLink;
    frame->function = function;
    frame->savePc = 0;
    frame->saveObj = 0;
    frame->statics = statics;
    frame->frame = 0;
    if (dynamics)
	frame->frame = NewTypedBox (False, dynamics);
    RETURN (frame);
}