ORC: prepare for another patent-pending optimization (#15996)
* ORC: prepare for another patent-pending optimization * bugfix * '=copy' for refs can take a cyclic parameter for more ORC optimizations * ORC: exploit the common 'it = it.next' pattern * can't hurt to check for nil * use an algorithm that is not obviously broken * restore the test case * final cleanups for --gc:orc
This commit is contained in:
parent
baaa19b927
commit
b9eb91cbb5
7 changed files with 147 additions and 39 deletions
|
|
@ -70,10 +70,12 @@ template color(c): untyped = c.rc and colorMask
|
|||
template setColor(c, col) =
|
||||
c.rc = c.rc and not colorMask or col
|
||||
|
||||
proc nimIncRefCyclic(p: pointer) {.compilerRtl, inl.} =
|
||||
proc nimIncRefCyclic(p: pointer; cyclic: bool) {.compilerRtl, inl.} =
|
||||
let h = head(p)
|
||||
inc h.rc, rcIncrement
|
||||
|
||||
proc nimMarkCyclic(p: pointer) {.compilerRtl, inl.} = discard
|
||||
|
||||
type
|
||||
GcEnv = object
|
||||
traceStack: CellSeq
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue