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

Remove the three-pass codegen step. #277

Merged
merged 1 commit into from Dec 1, 2018

Conversation

@dvander
Copy link
Member

dvander commented Nov 26, 2018

Code generation happens in three full passes over the assembly stream.
The first pass collects label addresses. The second pass generates code.
The final pass generates data. This is unnecessary; the first pass can
be eliminated via a lazy back-patch list. The last two passes can be
combined into one.

Copy link
Member

Headline left a comment

One question inline

@@ -384,32 +391,41 @@ static void do_call(CellWriter* writer, AsmReader* reader, cell opcode)
writer->append(sym->addr());
}

static void write_label(CellWriter* writer, int index)

This comment has been minimized.

Copy link
@Headline

Headline Nov 30, 2018

Member

Is there any reason this isn't a member of CellWriter?

This comment has been minimized.

Copy link
@dvander

dvander Dec 1, 2018

Author Member

Good call, done.

Code generation happens in three full passes over the assembly stream.
The first pass collects label addresses. The second pass generates code.
The final pass generates data. This is unnecessary; the first pass can
be eliminated via a lazy back-patch list. The last two passes can be
combined into one.
@dvander dvander force-pushed the asmone branch from 6f01c5f to aa2b827 Dec 1, 2018
@dvander dvander merged commit 765d3d7 into master Dec 1, 2018
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@dvander dvander deleted the asmone branch Dec 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.