Package org.jruby.ir
Class IRManager
java.lang.Object
org.jruby.ir.IRManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final String[]private final List<CompilerPass>private final RubyInstanceConfigprivate final CompilerPassstatic final Stringstatic final Stringstatic final Stringprivate final CompilerPassListenerprivate intprivate final Booleanprivate static final intprivate final Fixnum[]private final List<CompilerPass>private InstructionsListenerstatic final booleanstatic final intstatic final booleanprivate IRScopeListenerprivate final List<CompilerPass>private LineNumberInstr[]final ToggleBacktraceInstrfinal ToggleBacktraceInstrprivate final Nilprivate final IRModuleBodyprivate static final ByteListprivate final CompilerPassprivate final CompilerPassprivate final Set<CompilerPassListener>private final ReceiveSelfInstrfinal Rubystatic final Stringprivate final List<CompilerPass>private final StandardErrorprivate TemporaryLocalVariable[]private final Boolean -
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) 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.private Nodeparse(ThreadContext context, FileResource file, String fileName) voidremoveListener(InstructionsListener listener) voidremoveListener(IRScopeListener listener) voidremoveListener(CompilerPassListener listener) static CompilerPassSchedulerschedulePasses(List<CompilerPass> passes)
-
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 -
deadCodeEliminationPass
-
optimizeDynScopesPass
-
optimizeDelegationPass
-
OBJECT
-
dummyMetaClassCount
private int dummyMetaClassCount -
object
-
nil
-
tru
-
fals
-
standardError
-
needsBacktrace
-
needsNoBacktrace
-
passListeners
-
defaultListener
-
instrsListener
-
irScopeListener
-
compilerPasses
-
inliningCompilerPasses
-
jitPasses
-
safePasses
-
config
-
runtime
-
CLOSURE_PREFIX_CACHE_SIZE
private static final int CLOSURE_PREFIX_CACHE_SIZE- See Also:
-
closurePrefixCache
-
FIXNUM_CACHE_HALF_SIZE
private static final int FIXNUM_CACHE_HALF_SIZE- See Also:
-
fixnums
-
receiveSelfInstr
-
lineNumbers
-
temporaryLocalVariables
-
-
Constructor Details
-
IRManager
-
-
Method Details
-
getRuntime
-
getNil
-
getStandardError
-
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. -
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
-
parse
- Throws:
IOException
-