generate method dispatchers prior to code-gen #734
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Move the method dispatcher generation out of the code generators (
cgen
and
jsgen
) and into the orchestrators. This is another step towardsunifying the backend processing.
Methods are now also subject to dead-code elimination, meaning that if
none of the methods attached to an object hierarchy are called, no code
will be generated for them.
Details
The dispatchers do not appear in calls prior to
transf
, so the DCEimplementation used by IC backend cannot analyze them. For this reason,
cgen
continues to special-case methods.In addition, remove the unused
objHasKidsValid
enum value.Future Direction
Given that all backends need to generate method dispatchers, this step
(lowering methods into procedures) should happen through some common
facility in the future.