Skip to content

fix: use runtime evm stack - #147

Merged
zoowii merged 5 commits into
DTVMStack:mainfrom
starwarfan:stack_fix
Nov 19, 2025
Merged

zoowii merged 5 commits into
DTVMStack:mainfrom
starwarfan:stack_fix

Conversation

@starwarfan

Copy link
Copy Markdown
Contributor

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

  • N
  • Y

2. What is the scope of this PR (e.g. component or file name):

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains CI/CD configuration changes
  • Contains documentation changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

6. Release note

None

Comment thread src/compiler/evm_frontend/evm_mir_compiler.cpp
Comment thread src/compiler/evm_frontend/evm_mir_compiler.cpp
setInsertBlock(PostBB);
}

void EVMMirBuilder::stackPush(Operand PushValue) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since many other opcodes also manipulate the stack, will other instructions need to be modified?

It would be good to document a proposed solution first.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Evaluate the proposal document. If it has a significant impact on performance and a large impact on the code base, can we statically analyze during compilation to detect situations where the stack depth of instructions cannot be determined, and then degrade to the interpreter?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll write a document first. If the backend can handle the mem2reg optimization well, I think most store and load instructions from same location would be eliminated in final output.

@zoowii
zoowii merged commit 82ebb9b into DTVMStack:main Nov 19, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants