Skip to content

Commit 84c5db5

Browse files
hydaikaralabe
authored andcommitted
core/vm: remove JIT VM codes (#16362)
1 parent 23ac783 commit 84c5db5

File tree

7 files changed

+9
-434
lines changed

7 files changed

+9
-434
lines changed

core/vm/doc.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,8 @@
1717
/*
1818
Package vm implements the Ethereum Virtual Machine.
1919
20-
The vm package implements two EVMs, a byte code VM and a JIT VM. The BC
21-
(Byte Code) VM loops over a set of bytes and executes them according to the set
22-
of rules defined in the Ethereum yellow paper. When the BC VM is invoked it
23-
invokes the JIT VM in a separate goroutine and compiles the byte code in JIT
24-
instructions.
25-
26-
The JIT VM, when invoked, loops around a set of pre-defined instructions until
27-
it either runs of gas, causes an internal error, returns or stops.
28-
29-
The JIT optimiser attempts to pre-compile instructions in to chunks or segments
30-
such as multiple PUSH operations and static JUMPs. It does this by analysing the
31-
opcodes and attempts to match certain regions to known sets. Whenever the
32-
optimiser finds said segments it creates a new instruction and replaces the
33-
first occurrence in the sequence.
20+
The vm package implements one EVM, a byte code VM. The BC (Byte Code) VM loops
21+
over a set of bytes and executes them according to the set of rules defined
22+
in the Ethereum yellow paper.
3423
*/
3524
package vm

core/vm/instructions_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type twoOperandTest struct {
3232

3333
func testTwoOperandOp(t *testing.T, tests []twoOperandTest, opFn func(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error)) {
3434
var (
35-
env = NewEVM(Context{}, nil, params.TestChainConfig, Config{EnableJit: false, ForceJit: false})
35+
env = NewEVM(Context{}, nil, params.TestChainConfig, Config{})
3636
stack = newstack()
3737
pc = uint64(0)
3838
)
@@ -68,7 +68,7 @@ func testTwoOperandOp(t *testing.T, tests []twoOperandTest, opFn func(pc *uint64
6868

6969
func TestByteOp(t *testing.T) {
7070
var (
71-
env = NewEVM(Context{}, nil, params.TestChainConfig, Config{EnableJit: false, ForceJit: false})
71+
env = NewEVM(Context{}, nil, params.TestChainConfig, Config{})
7272
stack = newstack()
7373
)
7474
tests := []struct {
@@ -198,7 +198,7 @@ func TestSLT(t *testing.T) {
198198

199199
func opBenchmark(bench *testing.B, op func(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error), args ...string) {
200200
var (
201-
env = NewEVM(Context{}, nil, params.TestChainConfig, Config{EnableJit: false, ForceJit: false})
201+
env = NewEVM(Context{}, nil, params.TestChainConfig, Config{})
202202
stack = newstack()
203203
)
204204
// convert args

core/vm/interpreter.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ import (
2828
type Config struct {
2929
// Debug enabled debugging Interpreter options
3030
Debug bool
31-
// EnableJit enabled the JIT VM
32-
EnableJit bool
33-
// ForceJit forces the JIT VM
34-
ForceJit bool
3531
// Tracer is the op code logger
3632
Tracer Tracer
3733
// NoRecursion disabled Interpreter call, callcode,
@@ -47,7 +43,7 @@ type Config struct {
4743

4844
// Interpreter is used to run Ethereum based contracts and will utilise the
4945
// passed evmironment to query external sources for state information.
50-
// The Interpreter will run the byte code VM or JIT VM based on the passed
46+
// The Interpreter will run the byte code VM based on the passed
5147
// configuration.
5248
type Interpreter struct {
5349
evm *EVM

core/vm/logger_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type dummyStateDB struct {
4848

4949
func TestStoreCapture(t *testing.T) {
5050
var (
51-
env = NewEVM(Context{}, nil, params.TestChainConfig, Config{EnableJit: false, ForceJit: false})
51+
env = NewEVM(Context{}, nil, params.TestChainConfig, Config{})
5252
logger = NewStructLogger(nil)
5353
mem = NewMemory()
5454
stack = newstack()

core/vm/runtime/runtime.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ type Config struct {
4141
GasLimit uint64
4242
GasPrice *big.Int
4343
Value *big.Int
44-
DisableJit bool // "disable" so it's enabled by default
4544
Debug bool
4645
EVMConfig vm.Config
4746

@@ -92,8 +91,7 @@ func setDefaults(cfg *Config) {
9291
// It returns the EVM's return value, the new state and an error if it failed.
9392
//
9493
// Executes sets up a in memory, temporarily, environment for the execution of
95-
// the given code. It enabled the JIT by default and make sure that it's restored
96-
// to it's original state afterwards.
94+
// the given code. It makes sure that it's restored to it's original state afterwards.
9795
func Execute(code, input []byte, cfg *Config) ([]byte, *state.StateDB, error) {
9896
if cfg == nil {
9997
cfg = new(Config)

0 commit comments

Comments
 (0)