summary refs log tree commit diff stats
path: root/compiler/vmdef.nim
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2020-03-26 16:18:45 +0100
committerGitHub <noreply@github.com>2020-03-26 15:18:45 +0000
commit2925a47ae6aaa8e93117a29b018582540bf55856 (patch)
tree8c6322832e996d1e27d79840a69ed2e4c7d388e3 /compiler/vmdef.nim
parent6162da812af822f739dd00bb1b6c12658a89c669 (diff)
downloadNim-2925a47ae6aaa8e93117a29b018582540bf55856.tar.gz
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
Diffstat (limited to 'compiler/vmdef.nim')
-rw-r--r--compiler/vmdef.nim14
1 files changed, 13 insertions, 1 deletions
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.}