[Truffle] Make global variables constants if they are rarely changed#3977
Merged
[Truffle] Make global variables constants if they are rarely changed#3977
Conversation
| public static final Option<Integer> TRUFFLE_BIND_CACHE = integer(TRUFFLE, "truffle.bind.cache", TRUFFLE_DEFAULT_CACHE.load(), "Cache size of test for being able to bind a method to a module."); | ||
| public static final Option<Integer> TRUFFLE_CONSTANT_CACHE = integer(TRUFFLE, "truffle.constant.cache", TRUFFLE_DEFAULT_CACHE.load(), "Constant cache size."); | ||
| public static final Option<Integer> TRUFFLE_INSTANCE_VARIABLE_CACHE = integer(TRUFFLE, "truffle.instance_variable.cache", TRUFFLE_DEFAULT_CACHE.load(), "Instance variable cache size."); | ||
| public static final Option<Integer> TRUFFLE_GLOBAL_VARIABLE_CACHE = integer(TRUFFLE, "truffle.global_variable.cache", 10, "Maximum number of times a global variable can be changed to be considered constant."); |
Member
Author
There was a problem hiding this comment.
JRuby classic uses 100 here (see above), but that seems potentially too many deopts.
Contributor
There was a problem hiding this comment.
This should perhaps be called _INVALIDATIONS and .invalidations as it isn't the size of a cache, like the other _CACHE variable are.
83d301d to
6bfe25e
Compare
Contributor
|
lgtm. |
6bfe25e to
e04278d
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
@jruby/truffle @thedarkone So here is my attempt to make global variables constants if they are not changed too often. The logic is unfortunately more complex than I expected, so I would appreciate a review 😃