Skip to content

fix: recursive generation of basic blocks#29

Merged
JuliaPoo merged 1 commit intopylbbvfrom
fix/recursive_generation
Jun 12, 2023
Merged

fix: recursive generation of basic blocks#29
JuliaPoo merged 1 commit intopylbbvfrom
fix/recursive_generation

Conversation

@Fidget-Spinner
Copy link
Copy Markdown

@Fidget-Spinner Fidget-Spinner commented Jun 11, 2023

Closes #28

This allows basic blocks to not be generated contiguously. It does so by adding another CACHE entry to allow for jumping to a new successive basic block.

@Fidget-Spinner Fidget-Spinner requested a review from JuliaPoo June 11, 2023 12:32
@Fidget-Spinner
Copy link
Copy Markdown
Author

Fidget-Spinner commented Jun 11, 2023

Great. Now help(1) fails with a different error (a broken assertion). This is because of an inconsistency of states when entering and leaving a recursive function. Basically the following happens:

1st call to f (lasti saved as the tier 1 instruction)
2nd call to f (recursive)
...
nth call to f(lasti saved as the tier 2 instruction)
... bubbles back up
leaves 2nd call to f
leaves 1st call to f (lasti now out of sync since it is tier 1 instruction but actually tier 2 instruction is already available)

We are making progress. I need to fix this somewhere else.

Tracked in #30.

@JuliaPoo
Copy link
Copy Markdown

This is great ^-^

@JuliaPoo JuliaPoo merged commit 33988cf into pylbbv Jun 12, 2023
@Fidget-Spinner Fidget-Spinner deleted the fix/recursive_generation branch June 12, 2023 15:30
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.

recursive calls break one of our codegen invariants

2 participants