aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm')
-rw-r--r--core/vm/sqlvm/runtime/jumptable.go26
-rw-r--r--core/vm/sqlvm/runtime/runtime.go4
2 files changed, 27 insertions, 3 deletions
diff --git a/core/vm/sqlvm/runtime/jumptable.go b/core/vm/sqlvm/runtime/jumptable.go
index 5ce6d9a8a..415a4e62b 100644
--- a/core/vm/sqlvm/runtime/jumptable.go
+++ b/core/vm/sqlvm/runtime/jumptable.go
@@ -1,6 +1,32 @@
package runtime
var jumpTable = [256]OpFunction{
+ // 0x10
+ ADD: opAdd,
+ MUL: opMul,
+ SUB: opSub,
+ DIV: opDiv,
+ MOD: opMod,
+
+ // 0x20
+ LT: opLt,
+ GT: opGt,
+ EQ: opEq,
+ AND: opAnd,
+ OR: opOr,
+ NOT: opNot,
+ UNION: opUnion,
+ INTXN: opIntxn,
+ LIKE: opLike,
+
+ // 0x40
+ ZIP: opZip,
+ FIELD: opField,
+ PRUNE: opPrune,
+ SORT: opSort,
+ FILTER: opFilter,
+ CAST: opCast,
+
// 0x60
LOAD: opLoad,
}
diff --git a/core/vm/sqlvm/runtime/runtime.go b/core/vm/sqlvm/runtime/runtime.go
index 5cae111c9..3b6d49a72 100644
--- a/core/vm/sqlvm/runtime/runtime.go
+++ b/core/vm/sqlvm/runtime/runtime.go
@@ -14,9 +14,7 @@ func Run(stateDB vm.StateDB, ins []Instruction, registers []*Operand) (ret []byt
in.Input[i] = registers[in.Input[i].RegisterIndex]
}
}
- opFunc := jumpTable[in.Op]
- loadRegister(in.Input, registers)
- errCode := opFunc(&common.Context{}, in.Input, registers, in.Output)
+ errCode := jumpTable[in.Op](&common.Context{}, in.Input, registers, in.Output)
if errCode != nil {
err = se.Error{
Position: in.Position,