runtime: eagerly mark Boehm global roots

This commit is contained in:
Jake Bailey
2026-08-07 11:24:01 -07:00
committed by Ron Evans
parent 829fe514cc
commit 160372b93a
4 changed files with 8 additions and 33 deletions
-2
View File
@@ -19,8 +19,6 @@ declare ptr @runtime.gcGlobalRoot(i32)
declare i32 @runtime.gcGlobalRootSize(i32)
declare ptr @runtime.gcGlobalRootValues()
; Generic function that returns a pointer (that must be tracked).
define ptr @getPointer() {
ret ptr @someGlobal
-6
View File
@@ -9,7 +9,6 @@ target triple = "wasm32-unknown-unknown-wasm"
@ptrArrayGlobal = global [8 x ptr] zeroinitializer
@constantPtrGlobal = constant ptr @someGlobal
@runtime.gcGlobalRoots = internal constant [4 x { ptr, i32 }] [{ ptr, i32 } { ptr @ptrGlobal, i32 4 }, { ptr, i32 } { ptr @structGlobal, i32 4 }, { ptr, i32 } { ptr getelementptr (i8, ptr @structGlobal, i32 8), i32 8 }, { ptr, i32 } { ptr @ptrArrayGlobal, i32 32 }]
@runtime.gcGlobalRootValueArray = internal global [12 x i32] zeroinitializer
declare void @runtime.trackPointer(ptr nocapture readonly)
@@ -36,11 +35,6 @@ entry:
ret i32 %3
}
define ptr @runtime.gcGlobalRootValues() {
entry:
ret ptr @runtime.gcGlobalRootValueArray
}
define ptr @getPointer() {
ret ptr @someGlobal
}