Skip to content

refactor: remove dead AST splitting code and fix misleading fallback message#484

Merged
fglock merged 3 commits intomasterfrom
docs/destroy-weaken-support
Apr 10, 2026
Merged

refactor: remove dead AST splitting code and fix misleading fallback message#484
fglock merged 3 commits intomasterfrom
docs/destroy-weaken-support

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented Apr 10, 2026

Summary

  • Delete 3 dead Java files: DepthFirstLiteralRefactorVisitor, LargeNodeRefactorer, ControlFlowFinder (1,087 lines)
  • Strip dead methods from LargeBlockRefactorer (501 → 127 lines) and BlockRefactor (140 → 31 lines)
  • Remove dead cachedHasAnyControlFlow field from AbstractNode, dead annotation flags (queuedForRefactor, chunkAlreadyRefactored)
  • Fix misleading "after AST splitting" in interpreter fallback message — no splitting actually occurs, only whole-block wrapping
  • Clean up stale imports/javadoc in BytecodeSizeEstimator, ListNode, HashLiteralNode, ArrayLiteralNode, BlockNode
  • Update large-code-refactoring.md and STATUS.md to reflect actual behavior

Net: 16 files changed, +37 -1,687 lines.

Test plan

  • make passes (build + all unit tests)
  • Verified fallback message: JPERL_SHOW_FALLBACK=1 ./jperl shows "Note: Method too large, using interpreter backend."
  • Verified Tier 1 wrapping still works (N=1500 compiles natively, N=1700 falls back to interpreter — same as before)
  • No remaining references to deleted code in Java source

Generated with Devin

fglock and others added 3 commits April 10, 2026 22:24
DESTROY and weaken/isweak/unweaken are now implemented (PR #464 merged).
Update all documentation that previously listed these as unsupported:

- changelog.md: move from WIP to released features
- feature-matrix.md: mark DESTROY as supported, remove from unsupported list
- roadmap.md: mark DESTROY and weak references as completed
- relation-perlito.md: update JVM limitations paragraph
- AGENTS.md: remove "on feature/destroy-weaken branch" qualifier
- blog post README: update Moo results to 841/841

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Verify all 6 architecture docs + README against source code
- Fix wrong file paths in control-flow.md (packages reorganized)
- Add missing RETURN control flow type and non-local map/grep return
- Remove all stale TABLESWITCH references (actual: conditional branches)
- Rewrite large-code-refactoring.md: was describing non-existent retry
  architecture; now documents actual two-tier strategy (proactive block
  refactoring + interpreter fallback)
- Fix lexical-pragmas.md: wrong stack types, non-existent StrictOptions
  class, missing warning stacks and CompilerFlagNode fields
- Fix dynamic-scope.md: wrong DeferBlock types, missing implementors,
  missing blessId/reset-to-undef in save
- Fix block-dispatcher-optimization.md: wrong per-site bytecode size,
  missing Dereference.java as implementation file
- Fix weaken-destroy.md: wrong pop/shift deferred decrement claim,
  wrong code ref birth-tracking path, wrong type check order
- Update inline-cache.md and method-call-optimization.md status:
  inline caching IS implemented in RuntimeCode.java
- Move unimplemented design docs to dev/design/
- Add dev/architecture/ to make check-links target
- Fix 2 broken doc links (warnings-scope.md -> lexical-warnings.md)
- Fix 3 stale Java code comments (WeakRefRegistry, RuntimeScalar,
  DestroyDispatch)
- Add RuntimeList, org.perlonjava.app to README overview
- All links clean (368 checked, 0 errors), make passes

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…message

Remove dead code from the large-code refactoring subsystem:
- Delete DepthFirstLiteralRefactorVisitor (never called)
- Delete LargeNodeRefactorer (only called from dead code)
- Delete ControlFlowFinder (only used by dead code)
- Strip dead methods from LargeBlockRefactorer: forceRefactorForCodegen(),
  trySmartChunking(), findChunkStartByEstimatedSize(), shouldBreakChunk(),
  processPendingRefactors(), and associated fields
- Strip dead methods from BlockRefactor: buildNestedStructure(),
  createBlockNode(), wrapInListNode()
- Remove dead cachedHasAnyControlFlow field from AbstractNode
- Remove dead queuedForRefactor/chunkAlreadyRefactored annotation flags

Fix misleading "after AST splitting" in interpreter fallback message.
No AST splitting actually occurs — the system only does whole-block wrapping.
New message: "Note: Method too large, using interpreter backend."

Clean up stale javadoc references to deleted classes in
BytecodeSizeEstimator, ListNode, HashLiteralNode, ArrayLiteralNode,
BlockNode.

Update architecture doc and STATUS.md to reflect actual behavior.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@fglock fglock force-pushed the docs/destroy-weaken-support branch from bfd4b44 to 8139c8c Compare April 10, 2026 20:24
@fglock fglock merged commit 00c0dde into master Apr 10, 2026
2 checks passed
@fglock fglock deleted the docs/destroy-weaken-support branch April 10, 2026 20:32
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.

1 participant