Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OBS, wip, this is nowhere near ready for merging
This is an experimental stack layout, using an underlying
arena
ofuint256.Int
. The actual stacks that are used during execution uses the stack-arena for storage.At this point, I'm still experimenting with who shoud hold what, e.g. if both the arena and stack-instances need to keep track of
top
. Right now the arena has atop
, and the stacks have abottom
and asize
.I have also not implemented the
grow
ing of the arena. Possibly, there will be anensureCapacity
method which ensures that there's room for at least1
more item (any evm operation grows the stack at most by 1) - and the methods that expand the stack by1
are the only ones that need ever invoke it.Since the elements are
uint256.Int
, we should avoid giving out pointers to the elements. Thepeek
method does so, which is "unsafe", but thepeek
was only ever meant for evm operations to modify a stack item directly, without popping/pushing. Thepeek
ed references are not held more than a very brief time, so it should be ok.Posting it here for eyes / suggestions / discussions.