Skip to content

Commit 6d7e9b9

Browse files
committed
core/vm/runtime: minor cleanup
1 parent 726db0d commit 6d7e9b9

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

core/vm/runtime/runtime_test.go

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -442,30 +442,22 @@ func BenchmarkSimpleLoop(b *testing.B) {
442442
// Call identity, and pop return value
443443
staticCallIdentity := p.
444444
StaticCall(nil, 0x4, 0, 0, 0, 0).
445-
Op(vm.POP). // pop return value
446-
Jump(lbl). // jump to label
447-
Bytecode()
445+
Op(vm.POP).Jump(lbl).Bytecode() // pop return value and jump to label
448446

449447
p, lbl = program.New().Jumpdest()
450448
callIdentity := p.
451449
Call(nil, 0x4, 0, 0, 0, 0, 0).
452-
Op(vm.POP). // pop return value
453-
Jump(lbl). // jump to label
454-
Bytecode()
450+
Op(vm.POP).Jump(lbl).Bytecode() // pop return value and jump to label
455451

456452
p, lbl = program.New().Jumpdest()
457453
callInexistant := p.
458454
Call(nil, 0xff, 0, 0, 0, 0, 0).
459-
Op(vm.POP). // pop return value
460-
Jump(lbl). // jump to label
461-
Bytecode()
455+
Op(vm.POP).Jump(lbl).Bytecode() // pop return value and jump to label
462456

463457
p, lbl = program.New().Jumpdest()
464458
callEOA := p.
465459
Call(nil, 0xE0, 0, 0, 0, 0, 0). // call addr of EOA
466-
Op(vm.POP). // pop return value
467-
Jump(lbl). // jump to label
468-
Bytecode()
460+
Op(vm.POP).Jump(lbl).Bytecode() // pop return value and jump to label
469461

470462
p, lbl = program.New().Jumpdest()
471463
// Push as if we were making call, then pop it off again, and loop
@@ -485,9 +477,7 @@ func BenchmarkSimpleLoop(b *testing.B) {
485477
p, lbl = program.New().Jumpdest()
486478
callRevertingContractWithInput := p.
487479
Call(nil, 0xee, 0, 0, 0x20, 0x0, 0x0).
488-
Op(vm.POP).
489-
Jump(lbl).
490-
Bytecode()
480+
Op(vm.POP).Jump(lbl).Bytecode() // pop return value and jump to label
491481

492482
//tracer := logger.NewJSONLogger(nil, os.Stdout)
493483
//Execute(loopingCode, nil, &Config{

0 commit comments

Comments
 (0)