Skip to content

Optimize type(C).creationCode.length / runtimeCode.length #70

@vladimirradosavljevic

Description

@vladimirradosavljevic

Currently, type(C).creationCode.length and type(C).runtimeCode.length cause construction of a bytes array containing the contract bytecode, only to read its length.

This is unnecessary, as we can use yul.datasize. Possible implementations:

  • Detect the pattern in the FE and emit yul.datasize.
  • Add MLIR folding: sol.length(sol.object_code) -> yul.datasize.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions