Skip to content
This repository has been archived by the owner on Oct 18, 2021. It is now read-only.

Improvements to foreign codegen #138

Merged
merged 7 commits into from Nov 27, 2018
Merged

Improvements to foreign codegen #138

merged 7 commits into from Nov 27, 2018

Conversation

SquidDev
Copy link
Member

@SquidDev SquidDev commented Nov 25, 2018

  • Emit foreign literals inline, rather than adding a new upvalue.
  • Inline trivial foreign functions. For now this'll be those which refer to each variable exactly once, in order they are passed, though this could be extended in the future.
  • Use the postprocessor system for emitting foreign expressions on demand, rather than unconditionally.

Previously we would only skip other variables. We extend this to skip
any trivial expression, which means we don't end up emitting quite so
many absurd temporaries.
We now store any "pending" builtins within the TopEmitState, and emit
them once the main body has been emitted, using the Postprocess pass.
@SquidDev SquidDev changed the title [WIP] Improvements to foreign codegen Improvements to foreign codegen Nov 25, 2018
@plt-amy plt-amy merged commit 6a144ba into master Nov 27, 2018
@SquidDev SquidDev deleted the feature/foreign-codegen branch November 27, 2018 17:46
@SquidDev
Copy link
Member Author

plt-amy pushed a commit that referenced this pull request Jan 12, 2020
* Prepare for some basic inlining of foreign declarations

* Allow variable binds to skip trivial expressions too.

Previously we would only skip other variables. We extend this to skip
any trivial expression, which means we don't end up emitting quite so
many absurd temporaries.

* Rewrite the system for generating builtins

We now store any "pending" builtins within the TopEmitState, and emit
them once the main body has been emitted, using the Postprocess pass.

* Run foreign values and constructors through the new builtin system

* Hlinty hlints

* Add a primitive inliner for Lua statements

* Allow inlining statements too
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants