runtime: precisely scan Wasm globals

This commit is contained in:
Jake Bailey
2026-08-07 10:32:00 -07:00
committed by Ron Evans
parent a7360d5ad3
commit 829fe514cc
11 changed files with 345 additions and 5 deletions
+11
View File
@@ -5,11 +5,22 @@ target triple = "wasm32-unknown-unknown-wasm"
@someGlobal = global i8 3
@ptrGlobal = global ptr null
@arrGlobal = global [8 x i8] zeroinitializer
@structGlobal = global {ptr, i32, [2 x ptr]} zeroinitializer
@ptrArrayGlobal = global [8 x ptr] zeroinitializer
@constantPtrGlobal = constant ptr @someGlobal
declare void @runtime.trackPointer(ptr nocapture readonly)
declare noalias nonnull ptr @runtime.alloc(i32, ptr)
declare i32 @runtime.gcGlobalRootCount()
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