Skip to content

Remove the three-pass codegen step.#277

Merged
dvander merged 1 commit into
masterfrom
asmone
Dec 1, 2018
Merged

Remove the three-pass codegen step.#277
dvander merged 1 commit into
masterfrom
asmone

Conversation

@dvander

@dvander dvander commented Nov 26, 2018

Copy link
Copy Markdown
Member

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.

@Headline Headline left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question inline

Comment thread compiler/assembler.cpp Outdated
writer->append(sym->addr());
}

static void write_label(CellWriter* writer, int index)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 merged commit 765d3d7 into master Dec 1, 2018
@dvander dvander deleted the asmone branch December 1, 2018 18:33
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.

2 participants