Skip to content

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

Draft
wants to merge 182 commits into
base: master
Choose a base branch
from

Conversation

harkal
Copy link
Collaborator

@harkal harkal commented Jul 18, 2025

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

Put a link to a cute animal picture inside the parenthesis-->

@harkal harkal changed the title refactor[venom]: Refactor assembler and *more* refactor[venom]: Refactor assembler and more Jul 18, 2025
@harkal harkal changed the title refactor[venom]: Refactor assembler and more refactor[venom]: refactor assembler and *more* Jul 18, 2025
class DATA_ITEM:
data: bytes | Label

def __repr__(self) -> str:

Check notice

Code scanning / CodeQL

Explicit returns mixed with implicit (fall through) returns Note

Mixing implicit and explicit returns may indicate an error as implicit returns always return None.


# 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

The class 'TaggedInstruction' does not override
'__eq__'
, but adds the new attribute
error_msg
.
The class 'TaggedInstruction' does not override
'__eq__'
, but adds the new attribute
pc_debugger
.
The class 'TaggedInstruction' does not override
'__eq__'
, but adds the new attribute
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

The global variable '_const_label_counter' is not used.
@@ -5,7 +5,7 @@

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

'ConstRef' may not be defined if module
vyper.venom.basicblock
is imported before module
vyper.venom.memory_location
, as the
definition
of ConstRef occurs after the cyclic
import
of vyper.venom.memory_location.
@@ -5,7 +5,7 @@

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

'IRLabel' may not be defined if module
vyper.venom.basicblock
is imported before module
vyper.venom.memory_location
, as the
definition
of IRLabel occurs after the cyclic
import
of vyper.venom.memory_location.
@@ -5,7 +5,7 @@

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

'IRLiteral' may not be defined if module
vyper.venom.basicblock
is imported before module
vyper.venom.memory_location
, as the
definition
of IRLiteral occurs after the cyclic
import
of vyper.venom.memory_location.
@@ -5,7 +5,7 @@

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

'IROperand' may not be defined if module
vyper.venom.basicblock
is imported before module
vyper.venom.memory_location
, as the
definition
of IROperand occurs after the cyclic
import
of vyper.venom.memory_location.
@@ -5,7 +5,7 @@

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

'IRVariable' may not be defined if module
vyper.venom.basicblock
is imported before module
vyper.venom.memory_location
, as the
definition
of IRVariable occurs after the cyclic
import
of vyper.venom.memory_location.
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