Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ftype-scheme-object-pointer and related foreign-pointer extensions #897

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions boot/pb/equates.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* equates.h for Chez Scheme Version 10.2.0-pre-release.1 */
/* equates.h for Chez Scheme Version 10.2.0-pre-release.2 */

/* Do not edit this file. It is automatically generated and */
/* specifically tailored to the version of Chez Scheme named */
Expand Down Expand Up @@ -1015,7 +1015,7 @@ typedef uint64_t U64;
#define rtd_sealed 0x4
#define sbwp (ptr)0x4E
#define scaled_shot_1_shot_flag -0x8
#define scheme_version 0xA020001
#define scheme_version 0xA020002
#define seginfo_generation_disp 0x1
#define seginfo_list_bits_disp 0x8
#define seginfo_space_disp 0x0
Expand Down
54 changes: 54 additions & 0 deletions boot/pb/gc-ocd.inc
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,15 @@ static void sweep(thread_gc *tgc, ptr p, IGEN from_g)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
relocate_impure(&obj, from_g);
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
relocate_pure(&(RECORDDESCPM(rtd)));
Expand Down Expand Up @@ -1258,6 +1267,15 @@ static void sweep_object_in_old(thread_gc *tgc, ptr p)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
relocate_indirect(obj);
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
relocate_pure(&(RECORDDESCPM(rtd)));
Expand Down Expand Up @@ -1837,6 +1855,15 @@ static IGEN sweep_dirty_object(thread_gc *tgc, ptr p, IGEN youngest)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
relocate_dirty(&obj, youngest);
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
{
Expand Down Expand Up @@ -2095,6 +2122,15 @@ static void sweep_record(thread_gc *tgc, ptr p, IGEN from_g)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
relocate_impure(&obj, from_g);
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
relocate_pure(&(RECORDDESCPM(rtd)));
Expand Down Expand Up @@ -2157,6 +2193,15 @@ static IGEN sweep_dirty_record(thread_gc *tgc, ptr p, IGEN youngest)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
relocate_dirty(&obj, youngest);
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
{
Expand Down Expand Up @@ -3580,6 +3625,15 @@ static IBOOL object_directly_refers_to_self(ptr p)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
if (p == obj) return 1;
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
if (p == RECORDDESCPM(rtd)) return 1;
Expand Down
67 changes: 67 additions & 0 deletions boot/pb/gc-oce.inc
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,15 @@ static void sweep(thread_gc *tgc, ptr p, IGEN from_g)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
relocate_impure(&obj, from_g);
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
relocate_pure(&(RECORDDESCPM(rtd)));
Expand Down Expand Up @@ -1381,6 +1390,15 @@ static void sweep_object_in_old(thread_gc *tgc, ptr p)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
relocate_indirect(obj);
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
relocate_pure(&(RECORDDESCPM(rtd)));
Expand Down Expand Up @@ -1961,6 +1979,15 @@ static IGEN sweep_dirty_object(thread_gc *tgc, ptr p, IGEN youngest)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
relocate_dirty(&obj, youngest);
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
{
Expand Down Expand Up @@ -2221,6 +2248,15 @@ static void sweep_record(thread_gc *tgc, ptr p, IGEN from_g)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
relocate_impure(&obj, from_g);
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
relocate_pure(&(RECORDDESCPM(rtd)));
Expand Down Expand Up @@ -2285,6 +2321,15 @@ static IGEN sweep_dirty_record(thread_gc *tgc, ptr p, IGEN youngest)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
relocate_dirty(&obj, youngest);
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
{
Expand Down Expand Up @@ -3823,6 +3868,15 @@ static IBOOL object_directly_refers_to_self(ptr p)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
if (p == obj) return 1;
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
if (p == RECORDDESCPM(rtd)) return 1;
Expand Down Expand Up @@ -4151,6 +4205,19 @@ static void measure(thread_gc *tgc, ptr p)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
{ /* measure */
ptr r_p = obj;
if (!FIXMEDIATE(r_p))
push_measure(tgc, r_p);
}
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
{
Expand Down
54 changes: 54 additions & 0 deletions boot/pb/gc-par.inc
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,15 @@ static void sweep(thread_gc *tgc, ptr p, IGEN from_g)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
relocate_impure(&obj, from_g);
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
seginfo* pm_si = SegInfo((ptr_get_segment(num)));
Expand Down Expand Up @@ -1262,6 +1271,15 @@ static void sweep_object_in_old(thread_gc *tgc, ptr p)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
relocate_indirect(obj);
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
relocate_pure(&(RECORDDESCPM(rtd)));
Expand Down Expand Up @@ -1841,6 +1859,15 @@ static IGEN sweep_dirty_object(thread_gc *tgc, ptr p, IGEN youngest)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
relocate_dirty(&obj, youngest);
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
{
Expand Down Expand Up @@ -2109,6 +2136,15 @@ static void sweep_record(thread_gc *tgc, ptr p, IGEN from_g)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
relocate_impure(&obj, from_g);
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
seginfo* pm_si = SegInfo((ptr_get_segment(num)));
Expand Down Expand Up @@ -2180,6 +2216,15 @@ static IGEN sweep_dirty_record(thread_gc *tgc, ptr p, IGEN youngest)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
relocate_dirty(&obj, youngest);
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
{
Expand Down Expand Up @@ -3621,6 +3666,15 @@ static IBOOL object_directly_refers_to_self(ptr p)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
if (p == obj) return 1;
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
if (p == RECORDDESCPM(rtd)) return 1;
Expand Down
9 changes: 9 additions & 0 deletions boot/pb/heapcheck.inc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ static void check_object(ptr p, uptr seg, ISPC s_in, IBOOL aftergc)
}
}
}
else if (num == Strue)
{
uptr offset = (uptr)(*((pp + 1)));
{
ptr obj = TO_PTR((((uptr)(*(pp))) - offset));
check_pointer(&(obj), 0, 0, p, seg, s_in, aftergc);
*(pp) = TO_PTR((((uptr)obj) + offset));
}
}
else
{
check_pointer(&(num), 0, 0, p, seg, s_in, aftergc);
Expand Down
Binary file modified boot/pb/petite.boot
Binary file not shown.
Binary file modified boot/pb/scheme.boot
Binary file not shown.
4 changes: 2 additions & 2 deletions boot/pb/scheme.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* scheme.h for Chez Scheme Version 10.2.0-pre-release.1 (pb) */
/* scheme.h for Chez Scheme Version 10.2.0-pre-release.2 (pb) */

/* Do not edit this file. It is automatically generated and */
/* specifically tailored to the version of Chez Scheme named */
Expand Down Expand Up @@ -40,7 +40,7 @@
#endif

/* Chez Scheme Version and machine type */
#define VERSION "10.2.0-pre-release.1"
#define VERSION "10.2.0-pre-release.2"
#define MACHINE_TYPE "pb"

/* Integer typedefs */
Expand Down
Loading