WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

remove Owned variant of DecoratorStorage  #2411

@huitseeker

Description

@huitseeker

Removing decorator_store from the nodes is definitely the ultimate goal of this refactoring series. The main obstacle is that we still need the Owned variant for three key scenarios:

  1. Deserialization - Nodes come back from disk/storage with Owned decorators
  2. Round-trip conversions - Node → Builder → Node transformations needed for forest operations like merge and rewrite
  3. Testing - Tests need to create nodes without requiring a full forest

We explored eliminating Owned from add_to_forest() (see the branch linked in this above conversation), but that doesn't solve the three cases above.

This is part of a larger refactoring tracked in #1497. That refactoring would eliminate the need for DecoratorStore in nodes entirely by storing everything in a centralized arena.

The path forward is likely:

  1. Complete this PR series to hoist decorators to the forest (done after this PR),
  2. Implement DebugInfo struct (Investigate removing Decorator in favor of a new DebugInfo #1776),
  3. Break backwards-compatible serialization to split decorator info (Allow to truncate decorator data when serializing MAST #1580).
  4. Rewrite the assembler's recursive descent, and refactor to fully commit to decorator info (Performance of current decorator representation #1497) which would remove decorator_store from nodes

So yes, it's absolutely the goal, but it's a multi-step process.

Originally posted by @huitseeker in #2323 (comment)

Sub-issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions