summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2022-05-30 16:41:24 +0800
committerGitHub <noreply@github.com>2022-05-30 10:41:24 +0200
commit004fc23a3fa79fc32e0fb5d4f438ddc22964b0da (patch)
treebd8ef4c23b731ec230c04aa4ab73a44981d397c2
parent14960fa754f42c820727bed9308e075b2cb923f6 (diff)
downloadNim-004fc23a3fa79fc32e0fb5d4f438ddc22964b0da.tar.gz
[vm] remove unused opcSubstr opcode (#19834)
remove unused opcSubstr
-rw-r--r--compiler/vm.nim8
-rw-r--r--compiler/vmdef.nim4
2 files changed, 2 insertions, 10 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim
index fa1c71c85..bbcff77ba 100644
--- a/compiler/vm.nim
+++ b/compiler/vm.nim
@@ -1185,14 +1185,6 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
     of opcContainsSet:
       decodeBC(rkInt)
       regs[ra].intVal = ord(inSet(regs[rb].node, regs[rc].regToNode))
-    of opcSubStr:
-      decodeBC(rkNode)
-      inc pc
-      assert c.code[pc].opcode == opcSubStr
-      let rd = c.code[pc].regA
-      createStr regs[ra]
-      regs[ra].node.strVal = substr(regs[rb].node.strVal,
-                                    regs[rc].intVal.int, regs[rd].intVal.int)
     of opcParseFloat:
       decodeBC(rkInt)
       inc pc
diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim
index ecdbeff89..c653501ca 100644
--- a/compiler/vmdef.nim
+++ b/compiler/vmdef.nim
@@ -102,7 +102,7 @@ type
     opcMulSet, opcPlusSet, opcMinusSet, opcConcatStr,
     opcContainsSet, opcRepr, opcSetLenStr, opcSetLenSeq,
     opcIsNil, opcOf, opcIs,
-    opcSubStr, opcParseFloat, opcConv, opcCast,
+    opcParseFloat, opcConv, opcCast,
     opcQuit, opcInvalidField,
     opcNarrowS, opcNarrowU,
     opcSignExtend,
@@ -306,7 +306,7 @@ proc registerCallback*(c: PCtx; name: string; callback: VmCallback): int {.disca
 const
   firstABxInstr* = opcTJmp
   largeInstrs* = { # instructions which use 2 int32s instead of 1:
-    opcSubStr, opcConv, opcCast, opcNewSeq, opcOf
+    opcConv, opcCast, opcNewSeq, opcOf
     }
   slotSomeTemp* = slotTempUnknown
   relativeJumps* = {opcTJmp, opcFJmp, opcJmp, opcJmpBack}