-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Don't use pkgimage for package if any includes fall in tracked path for coverage or alloc tracking #48183
Closed
IanButterworth
wants to merge
3
commits into
JuliaLang:master
from
IanButterworth:ib/pkgimage_coverage
Closed
Don't use pkgimage for package if any includes fall in tracked path for coverage or alloc tracking #48183
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -599,20 +599,20 @@ JL_DLLEXPORT uint8_t jl_cache_flags(void) | |
{ | ||
// OOICCDDP | ||
uint8_t flags = 0; | ||
flags |= (jl_options.use_pkgimages & 1); // 0-bit | ||
// don't use use_pkgimages here because no outputo overrides it | ||
flags |= ((jl_options.outputo == NULL || jl_options.outputo[0] == '\0') | 1); // 0-bit | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems a bit odd... Are you missing the negation? And |
||
flags |= (jl_options.debug_level & 3) << 1; // 1-2 bit | ||
flags |= (jl_options.check_bounds & 3) << 3; // 3-4 bit | ||
flags |= (jl_options.can_inline & 1) << 5; // 5-bit | ||
flags |= (jl_options.opt_level & 3) << OPT_LEVEL; // 6-7 bit | ||
return flags; | ||
} | ||
|
||
JL_DLLEXPORT uint8_t jl_match_cache_flags(uint8_t flags) | ||
JL_DLLEXPORT uint8_t jl_match_cache_flags(uint8_t cache_flags, uint8_t current_flags) | ||
{ | ||
// 1. Check which flags are relevant | ||
uint8_t current_flags = jl_cache_flags(); | ||
uint8_t supports_pkgimage = (current_flags & 1); | ||
uint8_t is_pkgimage = (flags & 1); | ||
uint8_t is_pkgimage = (cache_flags & 1); | ||
|
||
// For .ji packages ignore other flags | ||
if (!supports_pkgimage && !is_pkgimage) { | ||
|
@@ -621,12 +621,12 @@ JL_DLLEXPORT uint8_t jl_match_cache_flags(uint8_t flags) | |
|
||
// 2. Check all flags, execept opt level must be exact | ||
uint8_t mask = (1 << OPT_LEVEL)-1; | ||
if ((flags & mask) != (current_flags & mask)) | ||
if ((cache_flags & mask) != (current_flags & mask)) | ||
return 0; | ||
// 3. allow for higher optimization flags in cache | ||
flags >>= OPT_LEVEL; | ||
cache_flags >>= OPT_LEVEL; | ||
current_flags >>= OPT_LEVEL; | ||
return flags >= current_flags; | ||
return cache_flags >= current_flags; | ||
} | ||
|
||
// "magic" string and version header of .ji file | ||
|
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.
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.
Can we avoid a magic number here? Maybe
CacheFlags(current_flags, pkgimage=no)
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.
current_flags
needs to be passed into the c funcjl_match_cache_flags
so I didn't think the transform should be done to the julia structThere 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 struct is the only thing in Julia that knows the position of the bits. I am trying to avoid a circumstance where we move the bits around and forget to update this.