Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vm: rework the exception handling #1061

Merged
merged 13 commits into from
Feb 5, 2024
9 changes: 9 additions & 0 deletions compiler/vm/packed_env.nim
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ type

code*: seq[TInstr]
debug*: seq[uint32] # Packed version of `TCtx.debug`. Indices into `infos`
ehTable*: seq[HandlerTableEntry]
ehCode*: seq[EhInstr]

# rtti related data:
nimNodes: seq[PackedNodeLite]
Expand Down Expand Up @@ -928,6 +930,9 @@ func storeEnv*(enc: var PackedEncoder, dst: var PackedEnv, c: TCtx) =
mapList(dst.debug, c.debug, d):
dst.infos.getOrIncl(d).uint32

dst.ehTable = c.ehTable
dst.ehCode = c.ehCode

mapList(dst.files, c.config.m.fileInfos, fi):
fi.fullPath.string

Expand Down Expand Up @@ -960,6 +965,8 @@ proc writeToFile*(p: PackedEnv, file: AbsoluteFile): RodFileError =
f.storePrim p.entryPoint
f.storeSeq p.code
f.storeSeq p.debug
f.storeSeq p.ehTable
f.storeSeq p.ehCode

f.storeSection symsSection
f.store p.infos
Expand Down Expand Up @@ -1002,6 +1009,8 @@ proc readFromFile*(p: var PackedEnv, file: AbsoluteFile): RodFileError =
f.loadPrim p.entryPoint
f.loadSeq p.code
f.loadSeq p.debug
f.loadSeq p.ehTable
f.loadSeq p.ehCode

f.loadSection symsSection
f.load p.infos
Expand Down
Loading
Loading