-
-
Notifications
You must be signed in to change notification settings - Fork 865
refactor[venom]: refactor assembler and *more* #4717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
explicit Label/PUSHLABEL instructions.
class DATA_ITEM: | ||
data: bytes | Label | ||
|
||
def __repr__(self) -> str: |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
|
||
|
||
# a string (assembly instruction) but with additional metadata from the source code | ||
class TaggedInstruction(str): |
Check warning
Code scanning / CodeQL
`__eq__` not overridden when adding attributes Warning
'__eq__'
error_msg
The class 'TaggedInstruction' does not override
'__eq__'
pc_debugger
The class 'TaggedInstruction' does not override
'__eq__'
ast_source
"""Generate a unique label name for an unresolved constant.""" | ||
global _const_label_counter | ||
label = f"__const_{_const_label_counter}" | ||
_const_label_counter += 1 |
Check notice
Code scanning / CodeQL
Unused global variable Note
from vyper.evm.address_space import MEMORY, STORAGE, TRANSIENT, AddrSpace | ||
from vyper.exceptions import CompilerPanic | ||
from vyper.venom.basicblock import IRLiteral, IROperand, IRVariable | ||
from vyper.venom.basicblock import ConstRef, IRLabel, IRLiteral, IROperand, IRVariable |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
vyper.venom.basicblock
vyper.venom.memory_location
definition
import
from vyper.evm.address_space import MEMORY, STORAGE, TRANSIENT, AddrSpace | ||
from vyper.exceptions import CompilerPanic | ||
from vyper.venom.basicblock import IRLiteral, IROperand, IRVariable | ||
from vyper.venom.basicblock import ConstRef, IRLabel, IRLiteral, IROperand, IRVariable |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
vyper.venom.basicblock
vyper.venom.memory_location
definition
import
from vyper.evm.address_space import MEMORY, STORAGE, TRANSIENT, AddrSpace | ||
from vyper.exceptions import CompilerPanic | ||
from vyper.venom.basicblock import IRLiteral, IROperand, IRVariable | ||
from vyper.venom.basicblock import ConstRef, IRLabel, IRLiteral, IROperand, IRVariable |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
vyper.venom.basicblock
vyper.venom.memory_location
definition
import
from vyper.evm.address_space import MEMORY, STORAGE, TRANSIENT, AddrSpace | ||
from vyper.exceptions import CompilerPanic | ||
from vyper.venom.basicblock import IRLiteral, IROperand, IRVariable | ||
from vyper.venom.basicblock import ConstRef, IRLabel, IRLiteral, IROperand, IRVariable |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
vyper.venom.basicblock
vyper.venom.memory_location
definition
import
from vyper.evm.address_space import MEMORY, STORAGE, TRANSIENT, AddrSpace | ||
from vyper.exceptions import CompilerPanic | ||
from vyper.venom.basicblock import IRLiteral, IROperand, IRVariable | ||
from vyper.venom.basicblock import ConstRef, IRLabel, IRLiteral, IROperand, IRVariable |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
vyper.venom.basicblock
vyper.venom.memory_location
definition
import
empty db constructor jump error test add PC_RESET instruction pc reset stuff cleanup basicblock parser tag handling enhance unresolved constant check in VenomCompiler add CFG normalization check refactor stack handling refactor VenomCompiler to differentiate between constant references and labels in assembly generation import PC_RESET handle PC_RESET in resolve_symbols runtime actual position handling fix symbol map updates implement _resolve_push_ofst_value function for PUSH_OFST offset resolution
# Process global label expressions that were stored separately | ||
for name, expr in list(self.ctx.const_expressions.items()): | ||
if name.startswith("_global_label_"): | ||
label_name = name[len("_global_label_") :] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe str.remove_prefix
What I did
How I did it
How to verify it
Commit message
Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)
Description for the changelog
Cute Animal Picture