From 2925a47ae6aaa8e93117a29b018582540bf55856 Mon Sep 17 00:00:00 2001 From: Clyybber Date: Thu, 26 Mar 2020 16:18:45 +0100 Subject: Fix vm.nim for --gc:arc (#13741) * koch boot --gc:arc now passes the nim stage ... but generates invalid C code * Move it closer to where its used * Try something else * Poor mans var * Use UncheckedArray instead --- compiler/vmdef.nim | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'compiler/vmdef.nim') diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim index 176558eac..7b51c626d 100644 --- a/compiler/vmdef.nim +++ b/compiler/vmdef.nim @@ -212,6 +212,18 @@ type slotTempComplex, # some complex temporary (s.node field is used) slotTempPerm # slot is temporary but permanent (hack) + TRegisterKind* = enum + rkNone, rkNode, rkInt, rkFloat, rkRegisterAddr, rkNodeAddr + TFullReg* = object # with a custom mark proc, we could use the same + # data representation as LuaJit (tagged NaNs). + case kind*: TRegisterKind + of rkNone: nil + of rkInt: intVal*: BiggestInt + of rkFloat: floatVal*: BiggestFloat + of rkNode: node*: PNode + of rkRegisterAddr: regAddr*: ptr TFullReg + of rkNodeAddr: nodeAddr*: ptr PNode + PProc* = ref object blocks*: seq[TBlock] # blocks; temp data structure sym*: PSym @@ -220,7 +232,7 @@ type VmArgs* = object ra*, rb*, rc*: Natural - slots*: pointer + slots*: ptr UncheckedArray[TFullReg] currentException*: PNode currentLineInfo*: TLineInfo VmCallback* = proc (args: VmArgs) {.closure.} -- cgit 1.4.1-2-gfad0