Skip to content

Commit

Permalink
vm: Remove mStaticExec and opcGorge (#909)
Browse files Browse the repository at this point in the history
## Summary
* Remove `mStaticExec` and `opcGorge` as only the csources compiler
  needs to have them in order to bootstrap 

## Details
* Follow up to 'vm: convert gorge and staticExec to vmops #878'
  • Loading branch information
Clyybber authored Sep 16, 2023
1 parent d8c7505 commit f98ba58
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions compiler/ast/ast_query.nim
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ proc isSinkType*(t: PType): bool {.inline.} =
t.kind == tySink

const magicsThatCanRaise* = {
mNone, mSlurp, mStaticExec, mParseExprToAst, mParseStmtToAst, mEcho,
mNone, mSlurp, mParseExprToAst, mParseStmtToAst, mEcho,
mChckRange }

proc canRaiseConservative*(fn: PNode): bool =
Expand Down Expand Up @@ -757,4 +757,4 @@ iterator forLoopDefs*(forStmt: PNode): PNode =
for j in 0..<(n.len - 1):
yield n[j]
else:
yield n
yield n
3 changes: 1 addition & 2 deletions compiler/ast/ast_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,6 @@ type
mLow, mHigh, mSizeOf, mAlignOf, mOffsetOf, mTypeTrait,
mIs, mOf, mAddr, mType, mTypeOf,
mPlugin, mEcho, mShallowCopy, mSlurp,
mStaticExec ## deprecated, remove me
mStatic,
mParseExprToAst, mParseStmtToAst, mExpandToAst, mQuoteAst,
mInc, mDec, mOrd,
Expand Down Expand Up @@ -1862,4 +1861,4 @@ proc `comment=`*(n: PNode, a: string) =

proc setUseIc*(useIc: bool) = gconfig.useIc = useIc

func isNil*(id: LibId): bool = id.index == 0
func isNil*(id: LibId): bool = id.index == 0
4 changes: 2 additions & 2 deletions compiler/backend/jsgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1999,7 +1999,7 @@ proc genMagic(p: PProc, n: CgNode, r: var TCompRes) =
of mDefault: genDefault(p, n, r)
of mWasMoved: genReset(p, n)
of mEcho: genEcho(p, n, r)
of mNLen..mNError, mSlurp, mStaticExec:
of mNLen..mNError, mSlurp:
localReport(p.config, n.info, reportSym(
rsemConstExpressionExpected, n[0].sym))

Expand Down Expand Up @@ -2536,4 +2536,4 @@ proc genTopLevelStmt*(globals: PGlobals, m: BModule, body: sink Body) =
p.g.code.add(p.body)

proc wholeCode*(globals: PGlobals): Rope =
result = globals.typeInfo & globals.constants & globals.code
result = globals.typeInfo & globals.constants & globals.code
2 changes: 0 additions & 2 deletions compiler/vm/vm.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2630,8 +2630,6 @@ proc rawExecute(c: var TCtx, pc: var int): YieldReason =
checkHandle(regs[rb])
regs[ra].strVal = opSlurp($regs[rb].strVal, c.debug[pc],
c.module, c.config)
of opcGorge:
unreachable("no longer an opcode/magic")

of opcParseExprToAst, opcParseStmtToAst:
decodeBC(rkNimNode)
Expand Down
1 change: 0 additions & 1 deletion compiler/vm/vm_enums.nim
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ type
opcNctPut, opcNctLen, opcNctGet, opcNctHasNext, opcNctNext, opcNodeId,

opcSlurp,
opcGorge, ## deprecated to be removed
opcParseExprToAst,
opcParseStmtToAst,
opcNGetLineInfo, opcNSetLineInfo,
Expand Down
1 change: 0 additions & 1 deletion compiler/vm/vmgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1939,7 +1939,6 @@ proc genMagic(c: var TCtx; n: CgNode; dest: var TDest; m: TMagic) =
c.gABC(n, opcTypeTrait, dest, tmp)
c.freeTemp(tmp)
of mSlurp: genUnaryABC(c, n, dest, opcSlurp)
of mStaticExec: unreachable("no longer a magic")
of mNLen: genUnaryABI(c, n, dest, opcLenSeq, nimNodeFlag)
of mGetImpl: genUnaryABC(c, n, dest, opcGetImpl)
of mGetImplTransf: genUnaryABC(c, n, dest, opcGetImplTransf)
Expand Down

0 comments on commit f98ba58

Please sign in to comment.