Package org.jruby.ir

Class IRManager

java.lang.Object
org.jruby.ir.IRManager

public class IRManager extends Object
  • Field Details

    • SAFE_COMPILER_PASSES

      public static final String SAFE_COMPILER_PASSES
      See Also:
    • DEFAULT_BUILD_PASSES

      public static final String DEFAULT_BUILD_PASSES
      See Also:
    • DEFAULT_JIT_PASSES

      public static final String DEFAULT_JIT_PASSES
      See Also:
    • DEFAULT_INLINING_COMPILER_PASSES

      public static final String DEFAULT_INLINING_COMPILER_PASSES
      See Also:
    • IR_INLINER

      public static final boolean IR_INLINER
    • IR_INLINER_THRESHOLD

      public static final int IR_INLINER_THRESHOLD
    • IR_INLINER_VERBOSE

      public static final boolean IR_INLINER_VERBOSE
    • needsBacktrace

      public final ToggleBacktraceInstr needsBacktrace
    • needsNoBacktrace

      public final ToggleBacktraceInstr needsNoBacktrace
    • runtime

      public final Ruby runtime
  • Constructor Details

  • Method Details

    • setBuilderFactory

      public void setBuilderFactory(IRBuilderFactory builderFactory)
    • getBuilderFactory

      public IRBuilderFactory getBuilderFactory()
    • getRuntime

      public Ruby getRuntime()
    • getNil

      public Nil getNil()
    • getStandardError

      public StandardError getStandardError()
    • getArrayClass

      public BuiltinClass getArrayClass()
    • getObjectClass

      public BuiltinClass getObjectClass()
    • getHashClass

      public BuiltinClass getHashClass()
    • getTrue

      public Boolean getTrue()
    • getFalse

      public Boolean getFalse()
    • getObject

      public IRModuleBody getObject()
    • needsBacktrace

      public ToggleBacktraceInstr needsBacktrace(boolean needsIt)
    • schedulePasses

      public CompilerPassScheduler schedulePasses()
    • schedulePasses

      public static CompilerPassScheduler schedulePasses(List<CompilerPass> passes)
    • getCompilerPasses

      public List<CompilerPass> getCompilerPasses(IRScope scope)
    • getInliningCompilerPasses

      public List<CompilerPass> getInliningCompilerPasses(IRScope scope)
    • getJITPasses

      public List<CompilerPass> getJITPasses(IRScope scope)
    • getSafePasses

      public List<CompilerPass> getSafePasses(IRScope scope)
    • getListeners

      public Set<CompilerPassListener> getListeners()
    • getInstructionsListener

      public InstructionsListener getInstructionsListener()
    • getIRScopeListener

      public IRScopeListener getIRScopeListener()
    • addListener

      public void addListener(CompilerPassListener listener)
    • removeListener

      public void removeListener(CompilerPassListener listener)
    • addListener

      public void addListener(InstructionsListener listener)
    • removeListener

      public void removeListener(InstructionsListener listener)
    • addListener

      public void addListener(IRScopeListener listener)
    • getClosurePrefix

      public String getClosurePrefix(int closureId)
    • newFixnum

      public Fixnum newFixnum(long value)
    • newLineNumber

      public LineNumberInstr newLineNumber(int line)
    • getReceiveSelfInstr

      public ReceiveSelfInstr getReceiveSelfInstr()
    • growLineNumbersPool

      protected LineNumberInstr[] growLineNumbersPool(int index)
    • removeListener

      public void removeListener(IRScopeListener listener)
    • getMetaClassName

      public RubySymbol getMetaClassName()
    • growTemporaryVariablePool

      protected TemporaryLocalVariable[] growTemporaryVariablePool(int index)
    • newTemporaryLocalVariable

      public TemporaryLocalVariable newTemporaryLocalVariable(int index)
      Temporary local variables are immutable and always start from a low index value and increment up to a higher index value per scope. So we can share these and store the ones in a simple list. If hard pinning is ever an issue we can periodically evict the list and start over at the cost of more live objects but this list cache reduces a simple empty Rails app console from over 140K instances to about 1200 instances.
    • newTemporaryIntVariable

      public TemporaryLocalVariable newTemporaryIntVariable(int index)
      Temporarily provided for loading/storing a normal local as int on JVM; interpreter will still box as Integer.
      Parameters:
      index -
      Returns:
    • optimizeIfSimpleScope

      protected void optimizeIfSimpleScope(FullInterpreterContext fic)
      For scopes that don't require a dynamic scope we can run DCE and some other passes which cannot be stymied by escaped bindings.
    • getInstanceConfig

      public RubyInstanceConfig getInstanceConfig()
    • loadInternalMethod

      public IRMethod loadInternalMethod(ThreadContext context, IRubyObject self, String method)
    • getSymbolClass

      public BuiltinClass getSymbolClass()