@@ -168,6 +168,11 @@ typedef struct _gcpage_t {
168
168
#define REGION_COUNT 8
169
169
170
170
typedef struct {
171
+ // Page layout:
172
+ // Padding: GC_PAGE_OFFSET
173
+ // Blocks: osize * n
174
+ // Tag: sizeof_jl_taggedvalue_t
175
+ // Data: <= osize - sizeof_jl_taggedvalue_t
171
176
char pages [REGION_PG_COUNT ][GC_PAGE_SZ ]; // must be first, to preserve page alignment
172
177
uint32_t freemap [REGION_PG_COUNT /32 ];
173
178
gcpage_t meta [REGION_PG_COUNT ];
@@ -449,29 +454,31 @@ static uint64_t total_fin_time=0;
449
454
int sweeping = 0 ;
450
455
451
456
/*
452
- The state transition looks like :
453
-
454
- <-[quicksweep]--
455
- <-[sweep]--- |
456
- | |
457
- ---> GC_QUEUED <---[sweep && age>promotion]--------
458
- | | ^ |
459
- | [mark] | |
460
- [sweep] | [write barrier] |
461
- | v | |
462
- ----- GC_MARKED <-------- |
463
- | | |
464
- --[quicksweep]-- |
465
- | === above this line objects are old
466
- ----[new]------> GC_CLEAN ------[mark]--------> GC_MARKED_NOESC
467
- | ^ ^ | |
468
- | | | | |
469
- <---[sweep]-------- | ------[sweep && age<=promotion]--- |
470
- | |
471
- --[quicksweep && age<=promotion]------
457
+ * The state transition looks like :
458
+ *
459
+ * ([(quick)sweep] means either a sweep or a quicksweep)
460
+ *
461
+ * <-[(quick)sweep]-
462
+ * |
463
+ * ---> GC_QUEUED <--[(quick)sweep && age>promotion]--
464
+ * | | ^ |
465
+ * | [mark] | |
466
+ * [sweep] | [write barrier] |
467
+ * | v | |
468
+ * ----- GC_MARKED <-------- |
469
+ * | | |
470
+ * --[quicksweep]-- |
471
+ * |
472
+ * ========= above this line objects are old ========= |
473
+ * |
474
+ * ----[new]------> GC_CLEAN ------[mark]--------> GC_MARKED_NOESC
475
+ * | ^ |
476
+ * <-[(quick)sweep]--- | |
477
+ * --[(quick)sweep && age<=promotion]---
472
478
*/
473
479
474
- // A quick sweep is a sweep where sweep_mask == GC_MARKED_NOESC. It means we won't touch GC_MARKED objects.
480
+ // A quick sweep is a sweep where sweep_mask == GC_MARKED_NOESC.
481
+ // It means we won't touch GC_MARKED objects (old gen).
475
482
476
483
// When a reachable object has survived more than PROMOTE_AGE+1 collections
477
484
// it is tagged with GC_QUEUED during sweep and will be promoted on next mark
0 commit comments