Class RuntimeCache

java.lang.Object
org.jruby.ast.executable.RuntimeCache

public class RuntimeCache extends Object
  • Field Details

  • Constructor Details

    • RuntimeCache

      public RuntimeCache()
  • Method Details

    • getScope

      public final StaticScope getScope(ThreadContext context, StaticScope parent, String varNamesDescriptor, int index)
    • getScope

      public final StaticScope getScope(int index)
    • getCallSite

      public final CallSite getCallSite(int index)
    • getSymbol

      public final RubySymbol getSymbol(ThreadContext context, int index, String name, String encodingName)
    • getString

      public final RubyString getString(ThreadContext context, int index, int codeRange)
    • getFrozenString

      public final RubyString getFrozenString(ThreadContext context, int bytelistIndex, int stringIndex, int codeRange)
    • getByteList

      public final ByteList getByteList(int index)
    • getEncoding

      public final org.jcodings.Encoding getEncoding(int index)
    • getFixnum

      public final RubyFixnum getFixnum(ThreadContext context, int index, int value)
    • getFixnum

      public final RubyFixnum getFixnum(ThreadContext context, int index, long value)
    • getFloat

      public final RubyFloat getFloat(ThreadContext context, int index, double value)
    • getRegexp

      public final RubyRegexp getRegexp(ThreadContext context, int index, ByteList pattern, int options)
    • getRegexp

      public final RubyRegexp getRegexp(int index)
    • cacheRegexp

      public final RubyRegexp cacheRegexp(int index, RubyString pattern, int options)
    • cacheRegexp

      public final RubyRegexp cacheRegexp(int index, RubyRegexp regexp)
    • getBigInteger

      public final BigInteger getBigInteger(int index, String pattern)
    • 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)
    • getValue

      private final IRubyObject getValue(ThreadContext context, int index, String name, IRubyObject object)
    • warnAboutUninitializedIvar

      private void warnAboutUninitializedIvar(Ruby runtime, String name)
    • setVariable

      public final IRubyObject setVariable(int index, String name, IRubyObject object, IRubyObject value)
    • initScopes

      public final void initScopes(int size)
    • initCallSites

      public final void initCallSites(int size)
    • initFromDescriptor

      public final void initFromDescriptor(String descriptor)
      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

      public 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:
      1. scopeCount
      2. inheritedSymbolCount
      3. inheritedFixnumCount
      4. inheritedConstantCount
      5. inheritedRegexpCount
      6. inheritedBigIntegerCount
      7. inheritedVariableReaderCount
      8. inheritedVariableWriterCount
      9. inheritedBlockBodyCount
      10. inheritedBlockCallbackCount
      11. inheritedMethodCount
      12. inheritedStringCount