Revert "bugfix: emulated thread vars used in combination with the mark & sweep GC"
This reverts commit 420789c278.
This commit is contained in:
parent
ede5ce9ac1
commit
75c586bbe1
3 changed files with 4 additions and 11 deletions
|
|
@ -12,10 +12,10 @@
|
||||||
|
|
||||||
# included from cgen.nim
|
# included from cgen.nim
|
||||||
|
|
||||||
proc emulatedThreadVars(): bool =
|
proc emulatedThreadVars(): bool {.inline.} =
|
||||||
result = {optThreads, optTlsEmulation} <= gGlobalOptions
|
result = {optThreads, optTlsEmulation} <= gGlobalOptions
|
||||||
|
|
||||||
proc accessThreadLocalVar(p: BProc, s: PSym) =
|
proc AccessThreadLocalVar(p: BProc, s: PSym) =
|
||||||
if emulatedThreadVars() and not p.ThreadVarAccessed:
|
if emulatedThreadVars() and not p.ThreadVarAccessed:
|
||||||
p.ThreadVarAccessed = true
|
p.ThreadVarAccessed = true
|
||||||
p.module.usesThreadVars = true
|
p.module.usesThreadVars = true
|
||||||
|
|
|
||||||
|
|
@ -127,22 +127,18 @@ proc genTraverseProc(m: BModule, typ: PType, reason: TTypeInfoReason): PRope =
|
||||||
m.s[cfsProcHeaders].appf("$1;$n", header)
|
m.s[cfsProcHeaders].appf("$1;$n", header)
|
||||||
m.s[cfsProcs].app(generatedProc)
|
m.s[cfsProcs].app(generatedProc)
|
||||||
|
|
||||||
|
|
||||||
proc genTraverseProcForGlobal(m: BModule, s: PSym): PRope =
|
proc genTraverseProcForGlobal(m: BModule, s: PSym): PRope =
|
||||||
discard genTypeInfo(m, s.loc.t)
|
discard genTypeInfo(m, s.loc.t)
|
||||||
|
|
||||||
var c: TTraversalClosure
|
var c: TTraversalClosure
|
||||||
var p = newProc(nil, m)
|
var p = newProc(nil, m)
|
||||||
var sLoc = s.loc.r
|
|
||||||
result = getGlobalTempName()
|
result = getGlobalTempName()
|
||||||
|
|
||||||
if sfThread in s.flags and emulatedThreadVars():
|
|
||||||
accessThreadLocalVar(p, s)
|
|
||||||
sLoc = con("NimTV->", sLoc)
|
|
||||||
|
|
||||||
c.visitorFrmt = "#nimGCvisit((void*)$1, 0);$n"
|
c.visitorFrmt = "#nimGCvisit((void*)$1, 0);$n"
|
||||||
c.p = p
|
c.p = p
|
||||||
let header = ropef("N_NIMCALL(void, $1)()", result)
|
let header = ropef("N_NIMCALL(void, $1)()", result)
|
||||||
genTraverseProc(c, sLoc, s.loc.t)
|
genTraverseProc(c, s.loc.r, s.loc.t)
|
||||||
|
|
||||||
let generatedProc = ropef("$1 {$n$2$3$4}$n",
|
let generatedProc = ropef("$1 {$n$2$3$4}$n",
|
||||||
[header, p.s(cpsLocals), p.s(cpsInit), p.s(cpsStmts)])
|
[header, p.s(cpsLocals), p.s(cpsInit), p.s(cpsStmts)])
|
||||||
|
|
|
||||||
|
|
@ -284,9 +284,6 @@ proc genLineDir(p: BProc, t: PNode) =
|
||||||
linefmt(p, cpsStmts, "nimln($1, $2);$n",
|
linefmt(p, cpsStmts, "nimln($1, $2);$n",
|
||||||
line.toRope, t.info.quotedFilename)
|
line.toRope, t.info.quotedFilename)
|
||||||
|
|
||||||
proc accessThreadLocalVar(p: BProc, s: PSym)
|
|
||||||
proc emulatedThreadVars(): bool {.inline.}
|
|
||||||
|
|
||||||
include "ccgtypes.nim"
|
include "ccgtypes.nim"
|
||||||
|
|
||||||
# ------------------------------ Manager of temporaries ------------------
|
# ------------------------------ Manager of temporaries ------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue