Skip to content
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

Fix globbed read/import bugs #449

Merged
merged 8 commits into from
Jun 4, 2024
Merged

Fix globbed read/import bugs #449

merged 8 commits into from
Jun 4, 2024

Commits on May 28, 2024

  1. Split MemberNode into (Regular/Shared)MemberNode

    SharedMemberNode enables generating non-constant object members
    at run time without generating an unbounded number of Truffle root nodes.
    translatenix authored and bioball committed May 28, 2024
    Configuration menu
    Copy the full SHA
    f5042c8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    879d853 View commit details
    Browse the repository at this point in the history
  3. Introduce VmObjectBuilder

    Introduce VmObjectBuilder, a uniform way to build `VmObject`s
    whose `ObjectMember`s are determined at run time.
    Replace some manual object building code with VmObjectBuilder.
    Add some assertions to fix IntelliJ warnings.
    translatenix authored and bioball committed May 28, 2024
    Configuration menu
    Copy the full SHA
    8742111 View commit details
    Browse the repository at this point in the history
  4. Improve implementation of globbed read/import nodes

    - Leverage SharedMemberNode to have a single Truffle root node per globbed
      read/import expression instead of one root node per resolved glob element.
    - Remove caching in ReadGlobNode because it only works correctly if glob pattern is a string *constant*.
    - Remove caching in StaticReadNode (now ReadGlobElementNode/ImportGlobElementNode)
      because it seems unnecessary and the implementation doesn't look quite right.
    translatenix authored and bioball committed May 28, 2024
    Configuration menu
    Copy the full SHA
    a8b7047 View commit details
    Browse the repository at this point in the history
  5. Simplify code

    translatenix authored and bioball committed May 28, 2024
    Configuration menu
    Copy the full SHA
    5b9e27d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f307a45 View commit details
    Browse the repository at this point in the history
  7. Fix caching of globbed reads

    Problem:
    The result of a globbed read depends not only on the glob pattern but also on the current module URI.
    However, ResourceManager does not take this into account when caching globbed reads, causing wrong results.
    
    Changes:
    - Cache globbed reads per read expression.
      This is also how globbed imports are cached, except that import URIs are constant.
    - Make ReadGlobNode and ImportGlobNode code as similar as possible.
    - Reduce code duplication by inheriting from AbstractReadNode.
    - Add some tests.
    translatenix authored and bioball committed May 28, 2024
    Configuration menu
    Copy the full SHA
    5fba868 View commit details
    Browse the repository at this point in the history
  8. Address comments per review

    * Defer initialization of shared member node, add @child annotations
    * Reduce footprint of truffle boundaries
    * Revert bugfix when reflecting upon modules with globbed imports
    bioball committed May 28, 2024
    Configuration menu
    Copy the full SHA
    e2a4604 View commit details
    Browse the repository at this point in the history