Package org.jruby.runtime.opto
Class ConstantCache
java.lang.Object
org.jruby.runtime.opto.ConstantCache
A tuple representing the data needed to verify a cached constant:
The value of the constant
The generation of the constant's invalidator at the time of caching
The constant's invalidator
(Optional) the hashcode of the module form which the constant was cache
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstantCache(IRubyObject value, Object generation, Invalidator invalidator) Construct a new ConstantCache with the given elements.ConstantCache(IRubyObject value, Object generation, Invalidator invalidator, int targetHash) Construct a new ConstantCache with the given elements. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisCached(ConstantCache cache) Check if the given ConstantCache is non-null and valid.static booleanisCachedFrom(RubyModule target, ConstantCache cache) Check if the given ConstantCache is non-null and valid, given the target module.
-
Field Details
-
value
-
generation
-
invalidator
-
id
public final int id
-
-
Constructor Details
-
ConstantCache
Construct a new ConstantCache with the given elements.- Parameters:
value-generation-invalidator-targetHash-
-
ConstantCache
Construct a new ConstantCache with the given elements.- Parameters:
value-generation-invalidator-
-
-
Method Details
-
isCachedFrom
Check if the given ConstantCache is non-null and valid, given the target module. This method is static to ensure it is inlinable as trivially as possible. -
isCached
Check if the given ConstantCache is non-null and valid. This method is static to ensure it is inlinable as trivially as possible.
-