Package org.jruby.ast.executable
Class RuntimeCache
java.lang.Object
org.jruby.ast.executable.RuntimeCache
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal RubyRegexp
cacheRegexp
(int index, RubyRegexp regexp) Deprecated.final RubyRegexp
cacheRegexp
(int index, RubyString pattern, int options) Deprecated.final BigInteger
getBigInteger
(int index, String pattern) final ByteList
getByteList
(int index) final CallSite
getCallSite
(int index) final IRubyObject
getConstant
(ThreadContext context, StaticScope scope, String name, int index) final IRubyObject
getConstantDefined
(ThreadContext context, StaticScope scope, String name, int index) final IRubyObject
getConstantFrom
(RubyModule target, ThreadContext context, String name, int index) final org.jcodings.Encoding
getEncoding
(int index) final RubyFixnum
getFixnum
(ThreadContext context, int index, int value) final RubyFixnum
getFixnum
(ThreadContext context, int index, long value) final RubyFloat
getFloat
(ThreadContext context, int index, double value) final RubyString
getFrozenString
(ThreadContext context, int bytelistIndex, int stringIndex, int codeRange) getMethod
(ThreadContext context, RubyClass selfType, int index, String methodName) getMethod
(ThreadContext context, IRubyObject self, int index, String methodName) getMethodEntry
(ThreadContext context, RubyClass selfType, int index, String methodName) final RubyRegexp
getRegexp
(int index) final RubyRegexp
getRegexp
(ThreadContext context, int index, ByteList pattern, int options) final StaticScope
getScope
(int index) final StaticScope
getScope
(ThreadContext context, StaticScope parent, String varNamesDescriptor, int index) final RubyString
getString
(ThreadContext context, int index, int codeRange) final RubySymbol
getSymbol
(ThreadContext context, int index, String name, String encodingName) getValue
(ThreadContext context, StaticScope scope, String name, int index) getValueFrom
(RubyModule target, ThreadContext context, String name, int index) final IRubyObject
getVariable
(ThreadContext context, int index, String name, IRubyObject object) final IRubyObject
getVariableDefined
(ThreadContext context, int index, String name, IRubyObject object) final void
initBigIntegers
(int size) final void
initCallSites
(int size) final void
initConstants
(int size) final org.jcodings.Encoding[]
initEncodings
(int size) final void
initFixnums
(int size) final void
initFloats
(int size) final void
initFromDescriptor
(String descriptor) Given a packed descriptor listing methods and their type, populate the call site cache.final RubyString[]
initFrozenStrings
(int size) final void
initMethodCache
(int size) final void
initOthers
(String descriptor) Given a packed descriptor of other cache sizes, construct the cache arrays The format of the descriptor is the actual size cast to char in this order: scopeCount inheritedSymbolCount inheritedFixnumCount inheritedConstantCount inheritedRegexpCount inheritedBigIntegerCount inheritedVariableReaderCount inheritedVariableWriterCount inheritedBlockBodyCount inheritedBlockCallbackCount inheritedMethodCount inheritedStringCountfinal void
initRegexps
(int size) final void
initScopes
(int size) final ByteList[]
initStrings
(int size) final void
initSymbols
(int size) final void
initVariableReaders
(int size) final void
initVariableWriters
(int size) reCache
(ThreadContext context, StaticScope scope, String name, int index) reCacheFrom
(RubyModule target, ThreadContext context, String name, int index) searchWithCache
(RubyClass clazz, int index, String name1) searchWithCache
(RubyClass clazz, int index, String name1, String name2) searchWithCache
(RubyClass clazz, int index, String name1, String name2, String name3) searchWithCache
(RubyClass clazz, int index, String name1, String name2, String name3, String name4, String name5) searchWithCache
(RubyClass clazz, int index, String name1, String name2, String name3, String name4, String name5, String name6) searchWithCache
(RubyClass clazz, int index, String name1, String name2, String name3, String name4, String name5, String name6, String name7) searchWithCache
(RubyClass clazz, int index, String name1, String name2, String name3, String name4, String name5, String name6, String name7, String name8) searchWithCache
(IRubyObject obj, int index, String name1) searchWithCache
(IRubyObject obj, int index, String name1, String name2) searchWithCache
(IRubyObject obj, int index, String name1, String name2, String name3) searchWithCache
(IRubyObject obj, int index, String name1, String name2, String name3, String name4) searchWithCache
(IRubyObject obj, int index, String name1, String name2, String name3, String name4, String name5) searchWithCache
(IRubyObject obj, int index, String name1, String name2, String name3, String name4, String name5, String name6) searchWithCache
(IRubyObject obj, int index, String name1, String name2, String name3, String name4, String name5, String name6, String name7) searchWithCache
(IRubyObject obj, int index, String name1, String name2, String name3, String name4, String name5, String name6, String name7, String name8) final DynamicMethod
searchWithCacheNoMethodMissing
(IRubyObject obj, int index, String name1) final DynamicMethod
searchWithCacheNoMethodMissing
(IRubyObject obj, int index, String name1, String name2) final IRubyObject
setVariable
(int index, String name, IRubyObject object, IRubyObject value)
-
Field Details
-
scopes
-
callSites
-
methodCache
-
symbols
-
byteLists
-
frozenStrings
-
encodings
public org.jcodings.Encoding[] encodings -
fixnums
-
floats
-
regexps
-
bigIntegers
-
variableReaders
-
variableWriters
-
constants
-
-
Constructor Details
-
RuntimeCache
public RuntimeCache()
-
-
Method Details
-
getScope
public final StaticScope getScope(ThreadContext context, StaticScope parent, String varNamesDescriptor, int index) -
getScope
-
getCallSite
-
getSymbol
public final RubySymbol getSymbol(ThreadContext context, int index, String name, String encodingName) -
getString
-
getFrozenString
public final RubyString getFrozenString(ThreadContext context, int bytelistIndex, int stringIndex, int codeRange) -
getByteList
-
getEncoding
public final org.jcodings.Encoding getEncoding(int index) -
getFixnum
-
getFixnum
-
getFloat
-
getRegexp
-
getRegexp
-
cacheRegexp
@Deprecated(since="10.0") public final RubyRegexp cacheRegexp(int index, RubyString pattern, int options) Deprecated. -
cacheRegexp
Deprecated. -
getBigInteger
-
getVariable
public final IRubyObject getVariable(ThreadContext context, int index, String name, IRubyObject object) -
getVariableDefined
public final IRubyObject getVariableDefined(ThreadContext context, int index, String name, IRubyObject object) -
setVariable
-
initScopes
public final void initScopes(int size) -
initCallSites
public final void initCallSites(int size) -
initFromDescriptor
Given a packed descriptor listing methods and their type, populate the call site cache. The format of the methods portion of the descriptor is name1;type1;name2;type2 where type1 and type2 are a single capital letter N, F, V, or S for the four main call types. After the method portion, the other cache sizes are provided as a packed String of char values representing the numeric sizes. @see RuntimeCache#initOthers.- Parameters:
descriptor
- The descriptor to use for populating call sites and caches
-
initOthers
Given a packed descriptor of other cache sizes, construct the cache arrays The format of the descriptor is the actual size cast to char in this order:- scopeCount
- inheritedSymbolCount
- inheritedFixnumCount
- inheritedConstantCount
- inheritedRegexpCount
- inheritedBigIntegerCount
- inheritedVariableReaderCount
- inheritedVariableWriterCount
- inheritedBlockBodyCount
- inheritedBlockCallbackCount
- inheritedMethodCount
- inheritedStringCount
- Parameters:
descriptor
- The descriptor to use for preparing caches
-
initSymbols
public final void initSymbols(int size) -
initStrings
-
initFrozenStrings
-
initEncodings
public final org.jcodings.Encoding[] initEncodings(int size) -
initFixnums
public final void initFixnums(int size) -
initFloats
public final void initFloats(int size) -
initRegexps
public final void initRegexps(int size) -
initBigIntegers
public final void initBigIntegers(int size) -
initConstants
public final void initConstants(int size) -
initVariableReaders
public final void initVariableReaders(int size) -
initVariableWriters
public final void initVariableWriters(int size) -
initMethodCache
public final void initMethodCache(int size) -
getConstant
public final IRubyObject getConstant(ThreadContext context, StaticScope scope, String name, int index) -
getConstantDefined
public final IRubyObject getConstantDefined(ThreadContext context, StaticScope scope, String name, int index) -
getValue
-
reCache
-
getConstantFrom
public final IRubyObject getConstantFrom(RubyModule target, ThreadContext context, String name, int index) -
getValueFrom
-
reCacheFrom
-
getMethod
public DynamicMethod getMethod(ThreadContext context, RubyClass selfType, int index, String methodName) -
getMethod
public DynamicMethod getMethod(ThreadContext context, IRubyObject self, int index, String methodName) -
getMethodEntry
public CacheEntry getMethodEntry(ThreadContext context, RubyClass selfType, int index, String methodName) -
searchWithCacheNoMethodMissing
-
searchWithCacheNoMethodMissing
public final DynamicMethod searchWithCacheNoMethodMissing(IRubyObject obj, int index, String name1, String name2) -
searchWithCache
-
searchWithCache
-
searchWithCache
public DynamicMethod searchWithCache(RubyClass clazz, int index, String name1, String name2, String name3) -
searchWithCache
-
searchWithCache
-
searchWithCache
-
searchWithCache
-
searchWithCache
-
searchWithCache
-
searchWithCache
-
searchWithCache
public DynamicMethod searchWithCache(IRubyObject obj, int index, String name1, String name2, String name3) -
searchWithCache
public DynamicMethod searchWithCache(IRubyObject obj, int index, String name1, String name2, String name3, String name4) -
searchWithCache
public DynamicMethod searchWithCache(IRubyObject obj, int index, String name1, String name2, String name3, String name4, String name5) -
searchWithCache
public DynamicMethod searchWithCache(IRubyObject obj, int index, String name1, String name2, String name3, String name4, String name5, String name6) -
searchWithCache
public DynamicMethod searchWithCache(IRubyObject obj, int index, String name1, String name2, String name3, String name4, String name5, String name6, String name7) -
searchWithCache
public DynamicMethod searchWithCache(IRubyObject obj, int index, String name1, String name2, String name3, String name4, String name5, String name6, String name7, String name8)
-