| 1 |
// Copyright 2025 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
//go:build !goexperiment.greenteagc |
| 6 |
|
| 7 |
package runtime |
| 8 |
|
| 9 |
import "internal/runtime/gc" |
| 10 |
|
| 11 |
func (s *mspan) markBitsForIndex(objIndex uintptr) markBits { |
| 12 |
bytep, mask := s.gcmarkBits.bitp(objIndex) |
| 13 |
return markBits{bytep, mask, objIndex} |
| 14 |
} |
| 15 |
|
| 16 |
func (s *mspan) markBitsForBase() markBits { |
| 17 |
return markBits{&s.gcmarkBits.x, uint8(1), 0} |
| 18 |
} |
| 19 |
|
| 20 |
func tryDeferToSpanScan(p uintptr, gcw *gcWork) bool { |
| 21 |
return false |
| 22 |
} |
| 23 |
|
| 24 |
func (s *mspan) initInlineMarkBits() { |
| 25 |
} |
| 26 |
|
| 27 |
func (s *mspan) moveInlineMarks(to *gcBits) { |
| 28 |
throw("unimplemented") |
| 29 |
} |
| 30 |
|
| 31 |
func gcUsesSpanInlineMarkBits(_ uintptr) bool { |
| 32 |
return false |
| 33 |
} |
| 34 |
|
| 35 |
func (s *mspan) inlineMarkBits() *spanInlineMarkBits { |
| 36 |
return nil |
| 37 |
} |
| 38 |
|
| 39 |
func (s *mspan) scannedBitsForIndex(objIndex uintptr) markBits { |
| 40 |
throw("unimplemented") |
| 41 |
return markBits{} |
| 42 |
} |
| 43 |
|
| 44 |
type spanInlineMarkBits struct { |
| 45 |
} |
| 46 |
|
| 47 |
func (q *spanInlineMarkBits) tryAcquire() bool { |
| 48 |
return false |
| 49 |
} |
| 50 |
|
| 51 |
type spanQueue struct { |
| 52 |
_ uint32 // To match alignment padding requirements for atomically-accessed variables in workType. |
| 53 |
} |
| 54 |
|
| 55 |
func (q *spanQueue) empty() bool { |
| 56 |
return true |
| 57 |
} |
| 58 |
|
| 59 |
func (q *spanQueue) size() int { |
| 60 |
return 0 |
| 61 |
} |
| 62 |
|
| 63 |
type localSpanQueue struct { |
| 64 |
} |
| 65 |
|
| 66 |
func (q *localSpanQueue) drain() bool { |
| 67 |
return false |
| 68 |
} |
| 69 |
|
| 70 |
func (q *localSpanQueue) empty() bool { |
| 71 |
return true |
| 72 |
} |
| 73 |
|
| 74 |
type objptr uintptr |
| 75 |
|
| 76 |
func (w *gcWork) tryGetSpan(steal bool) objptr { |
| 77 |
return 0 |
| 78 |
} |
| 79 |
|
| 80 |
func scanSpan(p objptr, gcw *gcWork) { |
| 81 |
throw("unimplemented") |
| 82 |
} |
| 83 |
|
| 84 |
type sizeClassScanStats struct { |
| 85 |
sparseObjsScanned uint64 |
| 86 |
} |
| 87 |
|
| 88 |
func dumpScanStats() { |
| 89 |
var sparseObjsScanned uint64 |
| 90 |
for _, stats := range memstats.lastScanStats { |
| 91 |
sparseObjsScanned += stats.sparseObjsScanned |
| 92 |
} |
| 93 |
print("scan: total ", sparseObjsScanned, " objs\n") |
| 94 |
for i, stats := range memstats.lastScanStats { |
| 95 |
if stats == (sizeClassScanStats{}) { |
| 96 |
continue |
| 97 |
} |
| 98 |
if i == 0 { |
| 99 |
print("scan: class L ") |
| 100 |
} else { |
| 101 |
print("scan: class ", gc.SizeClassToSize[i], "B ") |
| 102 |
} |
| 103 |
print(stats.sparseObjsScanned, " objs\n") |
| 104 |
} |
| 105 |
} |
| 106 |
|
| 107 |
func (w *gcWork) flushScanStats(dst *[gc.NumSizeClasses]sizeClassScanStats) { |
| 108 |
for i := range w.stats { |
| 109 |
dst[i].sparseObjsScanned += w.stats[i].sparseObjsScanned |
| 110 |
} |
| 111 |
clear(w.stats[:]) |
| 112 |
} |