Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mNSetType magic and associated VM opcode #269

Merged
merged 1 commit into from
Apr 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/ast/ast_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ type
mNctPut, mNctLen, mNctGet, mNctHasNext, mNctNext,

mNIntVal, mNFloatVal, mNSymbol, mNIdent, mNGetType, mNStrVal, mNSetIntVal,
mNSetFloatVal, mNSetSymbol, mNSetIdent, mNSetType, mNSetStrVal, mNLineInfo,
mNSetFloatVal, mNSetSymbol, mNSetIdent, mNSetStrVal, mNLineInfo,
mNNewNimNode, mNCopyNimNode, mNCopyNimTree, mStrToIdent, mNSigHash, mNSizeOf,
mNBindSym, mNCallSite,
mEqIdent, mEqNimrodNode, mSameNodeType, mGetImpl, mNGenSym,
Expand Down
12 changes: 0 additions & 12 deletions compiler/vm/vm.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2168,18 +2168,6 @@ proc rawExecute(c: var TCtx, pc: var int, tos: var StackFrameIndex): TFullReg =
dest.ident = regs[rb].node.ident
else:
raiseVmError(reportStr(rsemVmFieldNotFound, "ident"))
of opcNSetType:
decodeB(rkNode)
let b = regs[rb].node
internalAssert(
c.config,
b.kind == nkSym and b.sym.kind == skType,
"Canot set type to a non-skType symbol")

internalAssert(
c.config, regs[ra].node != nil, "Target node must not be nil")

regs[ra].node.typ = b.sym.typ
of opcNSetStrVal:
decodeB(rkNode)
var dest = regs[ra].node
Expand Down
2 changes: 1 addition & 1 deletion compiler/vm/vm_enums.nim
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ type
opcNGetSize,

opcNSetIntVal,
opcNSetFloatVal, opcNSetSymbol, opcNSetIdent, opcNSetType, opcNSetStrVal,
opcNSetFloatVal, opcNSetSymbol, opcNSetIdent, opcNSetStrVal,
opcNNewNimNode, opcNCopyNimNode, opcNCopyNimTree, opcNDel, opcGenSym,

opcNccValue, opcNccInc, opcNcsAdd, opcNcsIncl, opcNcsLen, opcNcsAt,
Expand Down
3 changes: 0 additions & 3 deletions compiler/vm/vmgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1359,9 +1359,6 @@ proc genMagic(c: var TCtx; n: PNode; dest: var TDest; m: TMagic) =
of mNSetIdent:
unused(c, n, dest)
genBinaryStmt(c, n, opcNSetIdent)
of mNSetType:
unused(c, n, dest)
genBinaryStmt(c, n, opcNSetType)
of mNSetStrVal:
unused(c, n, dest)
genBinaryStmt(c, n, opcNSetStrVal)
Expand Down