Skip to content

Commit

Permalink
Introspection (part 3) (#109)
Browse files Browse the repository at this point in the history
Following on from #107 and #108, this PR updates the serialization layer
to store the set of functions along with associated type information.

Previously, the serialization layer would store a string identifier when
a function pointer was encountered, followed by additional objects if
the function was a closure. The deserialization layer relies on
information from the user/coroc (via `RegisterClosure`) as to which
functions are closures and what the layout of objects looks like in
memory. For an offline process to analyze durable coroutine state we
need to store this information alongside the state.

This PR updates the serialization to register functions/closures (and
types) as they're encountered in the object graph. Like types in #108,
functions are stored in an array where the index is used as a unique
identifier. When serializing functions/closures, the serialization layer
now stores the function ID (the index, not the name) as function
pointers are encountered, followed by closure objects. An offline
process now has the same information as the original program when it
comes to function types and closure memory layouts.
  • Loading branch information
chriso authored Nov 18, 2023
2 parents 355bffc + b819413 commit 5760ada
Show file tree
Hide file tree
Showing 11 changed files with 736 additions and 177 deletions.
96 changes: 60 additions & 36 deletions gen/proto/go/coroutine/v1/coroutine.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions gen/proto/go/coroutine/v1/coroutine_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

177 changes: 177 additions & 0 deletions gen/proto/go/coroutine/v1/function.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5760ada

Please sign in to comment.