1 /* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 * Copyright (C) 1997-2000 NEC Research Institute.
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
9 GC_frameIndex
getFrameIndexFromReturnAddress (GC_state s
, GC_returnAddress ra
) {
12 res
= s
->returnAddressToFrameIndex (ra
);
14 fprintf (stderr
, FMTFI
" = getFrameIndexFromReturnAddress ("FMTRA
")\n",
19 GC_frameLayout
getFrameLayoutFromFrameIndex (GC_state s
, GC_frameIndex findex
) {
20 GC_frameLayout layout
;
23 fprintf (stderr
, "findex = "FMTFI
" frameLayoutsLength = %"PRIu32
"\n",
24 findex
, s
->frameLayoutsLength
);
25 assert (findex
< s
->frameLayoutsLength
);
26 layout
= &(s
->frameLayouts
[findex
]);
27 assert (layout
->size
> 0);
31 GC_frameLayout
getFrameLayoutFromReturnAddress (GC_state s
, GC_returnAddress ra
) {
32 GC_frameLayout layout
;
35 findex
= getFrameIndexFromReturnAddress (s
, ra
);
36 layout
= getFrameLayoutFromFrameIndex(s
, findex
);