-
Notifications
You must be signed in to change notification settings - Fork 7
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
Rework TracedAOTBlock
enum.
#978
Conversation
We will soon be recording not just "blocks", so rename the enum to something a little less inaccurate. This is a mechanical renaming with no effect on behaviour.
This is a mechanical renaming with no effect on behaviour.
This reflects the change of the enum element.
This is a mechanical renaming with no effect on behaviour.
This reflects the change of the enum element.
We don't use this currently, but we know that one day we might, so forcing us to think about this now will make it more likely that adding it later will be relatively simple.
These methods undermine the type safety of enums, turning what should be static checks into run-time panics.
@@ -79,7 +79,7 @@ impl JITCLLVM { | |||
Arc::new(JITCLLVM) | |||
} | |||
|
|||
fn encode_trace(&self, irtrace: &Vec<TracedAOTBlock>) -> (Vec<*const i8>, Vec<usize>, usize) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ProcessedItem
is such a generic name.
At least with TracedAOTBlock
we know the granularity of what we are working with (blocks).
Honestly, I'd rather keep the old name and just know that when you trace an AOT block it can include promotions, although I'm guessing that you will object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I see that later ProcessedItem
will become an enum. I this case I agree that TracedAOTBlock
is no longer a good name, but I still think ProcessedItem
is not a good name.
How about one of the following:
AOTObservation
AOTTraceEvent
AOTEvent
TraceEvent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe call the enum TraceAction
or similar, and give the variants verb names, like ExecuteBlock
and ObservePromotion
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The enum can't have "AOT" in the name. TraceAction
could work with Block
and Promotion
? [Execute
and in particular Observe
seem like padding to me.]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would be more descriptive than ProcessedItem
, so if you are happy, so am I :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a92f1fe changes the enum name (I think the enum variant names are probably OK for now as-is). If you do like this, it'll have to stay as a separate commit as rebasing this earlier will be a nightmare. [In other words: this PR could be merged as-is if -- and only if! -- you like the PR.]
This LGTM. Ready for merge I think then? |
Yes merge as-is please. |
@ptersilie this is what you were seeing yesterday? I think maybe the import semantics changed and/or rustc now reports more unused imports than before? Is it just a matter of killing the imports? |
Yes these are the same errors I got on my PR #975. I couldn't reproduce them locally but maybe that's because my rust version isn't up to date. Will try again with a newer rust. |
Can confirm that after updating rust this fails on my local machine too. |
OK, so someone should raise a PR that fixes this in isolation. Any takers? |
Working on it. |
https://github.com/ykjit/yk/pull/979/files should fix this. |
Can someone kick this one? |
This PR reworks (and renames) the
TracedAOTBlock
enum. My initial aim was to make it plausible for this to record in-band promotion (e.g .PTWRITE
) but as I looked in more depth I realised there were more things we could improve, including extra documentation (63589b9) and improving static guarantees (cb56456).