This gist shares an experiment on an alternative implementation for JUMPDEST analysis.
Some quick notes:
- The linked branch passes all
go test ./...
tests. - I'm not opening a PR since I'm not sure yet this might be convincing (explaining why below).
The main idea is to minimize the amount of bitwise operations by switching from a vector of byte
to uint64
. Using byte
means that PUSHN
where N
is greater than 8 will have to span multiple bytes, thus requiring "internal loops".
Using uint64
means having more space to resolve any PUSHN
in a single write attempt with at most one overflow without today's 2^16+2^8
decomposition.