Package org.jruby.ir
Class IRManager
java.lang.Object
org.jruby.ir.IRManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final booleanstatic final intstatic final booleanfinal ToggleBacktraceInstrfinal ToggleBacktraceInstrfinal Rubystatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(InstructionsListener listener) voidaddListener(IRScopeListener listener) voidaddListener(CompilerPassListener listener) getClosurePrefix(int closureId) getCompilerPasses(IRScope scope) getFalse()getInliningCompilerPasses(IRScope scope) getJITPasses(IRScope scope) getNil()getSafePasses(IRScope scope) getTrue()protected LineNumberInstr[]growLineNumbersPool(int index) protected TemporaryLocalVariable[]growTemporaryVariablePool(int index) loadInternalMethod(ThreadContext context, IRubyObject self, String method) needsBacktrace(boolean needsIt) newFixnum(long value) newLineNumber(int line) newTemporaryIntVariable(int index) Temporarily provided for loading/storing a normal local as int on JVM; interpreter will still box as Integer.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.protected voidFor scopes that don't require a dynamic scope we can run DCE and some other passes which cannot be stymied by escaped bindings.voidremoveListener(InstructionsListener listener) voidremoveListener(IRScopeListener listener) voidremoveListener(CompilerPassListener listener) static CompilerPassSchedulerschedulePasses(List<CompilerPass> passes) voidsetBuilderFactory(IRBuilderFactory builderFactory)
-
Field Details
-
SAFE_COMPILER_PASSES
- See Also:
-
DEFAULT_BUILD_PASSES
- See Also:
-
DEFAULT_JIT_PASSES
- See Also:
-
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
-
needsNoBacktrace
-
runtime
-
-
Constructor Details
-
IRManager
-
-
Method Details
-
setBuilderFactory
-
getBuilderFactory
-
getRuntime
-
getNil
-
getStandardError
-
getArrayClass
-
getObjectClass
-
getHashClass
-
getTrue
-
getFalse
-
getObject
-
needsBacktrace
-
schedulePasses
-
schedulePasses
-
getCompilerPasses
-
getInliningCompilerPasses
-
getJITPasses
-
getSafePasses
-
getListeners
-
getInstructionsListener
-
getIRScopeListener
-
addListener
-
removeListener
-
addListener
-
removeListener
-
addListener
-
getClosurePrefix
-
newFixnum
-
newLineNumber
-
getReceiveSelfInstr
-
growLineNumbersPool
-
removeListener
-
getMetaClassName
-
growTemporaryVariablePool
-
newTemporaryLocalVariable
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
Temporarily provided for loading/storing a normal local as int on JVM; interpreter will still box as Integer.- Parameters:
index-- Returns:
-
optimizeIfSimpleScope
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
-
loadInternalMethod
-
getSymbolClass
-