jruby/docs BETA
Navigation
org.jruby.ir 21
C Compiler
C Counter
C IRClassBody
C IRClosure
C IREvalScript
E IRFlags
C IRFor
C IRManager
C IRMetaClassBody
C IRMethod
C IRModuleBody
C IRScope
E IRScopeType
C IRScriptBody
C IRTranslator
C IRVisitor
A Interp
A JIT
E OpClass
E Operation
C Tuple
IRMethod — members 12+
F isInstanceMethod() boolean
C new(manager, lexical_parent, defn, name, is_instance_method, line_number, static_scope, coverage_mode)
M argument_descriptors() ArgumentDescriptor[]
C argument_descriptors=(arg_desc)
M built_interpreter_context() InterpreterContext
M built_interpreter_context_for_java_constructor() ExitableInterpreterContext
M get_local_variable(name, scope_depth) LocalVariable
M has_been_built?() boolean
M lazily_acquire_interpreter_context() InterpreterContext
M method_data() MethodData
M prepare_for_compilation() BasicBlock[]
M scope_type() IRScopeType
from IRScope
F LOG Logger
F compilable Compilable
M accesses_parents_local_variables() boolean
C add_closure(closure)
M allocate_interpreter_context(instructions, temp_variable_count, flags) InterpreterContext
M allocate_interpreter_context(instructions, temp_variable_count, flags) InterpreterContext
M any_uses_eval() boolean
M ast() Object
M build_jvm_exception_table(fic) Label>
M byte_name() ByteList
C byte_name=(name)
M can_capture_callers_binding() boolean
M can_receive_breaks() boolean
M can_receive_nonlocal_returns() boolean
C capture_parent_refinements(context)
C cleanup_after_execution()
M closures() IRClosure>
M correct_variable_depth_for_for_loops_for_encoding(depth) int
M coverage_mode() int
C coverage_mode=(coverage_mode)
M debug_output() String
M dump_to_igv() IGVDumper
M dynamic_scope() DynamicScope
M encoding() Encoding
M equals(other) boolean
M executed_passes() CompilerPass>
M executes_once() boolean
M execution_context() FullInterpreterContext
M file() String
C file_name=(filename)
M full_interpreter_context() FullInterpreterContext
M fully_qualified_name() String
M get_new_label(prefix) Label
M get_new_local_variable(name, scope_depth) LocalVariable
M has_break_instructions?() boolean
C has_flip_flops=(has_flip_flops)
M has_flip_flops?() boolean
M has_loops?() boolean
M has_non_local_returns?() boolean
M hash_code() int
M id() String
C inline_method(method_to_inline, metaclass, callsite_id, class_token, clone_host)
C inline_method_compiled(method_to_inline, impl_class, callsite_id, class_token, clone_host)
C inline_method_jit(method_to_inline, impl_class, callsite_id, class_token, clone_host)
M inlining_allowed() boolean
M interpreter_context() InterpreterContext
M is_nested_in_closure(closure) boolean
M is_scope_contained_by(parent_scope) boolean
M lexical_parent() IRScope
M lexical_scopes() IRScope>
M line() int
M local_variables() LocalVariable>
M lookup_existing_l_var(name) LocalVariable
M manager() IRManager
M maybe_using_refinements() boolean
M module_body?() boolean
M name() RubySymbol
M nearest_method() IRMethod
M nearest_module_referencing_scope_depth() int
M nearest_non_closurelike_scope() IRScope
M nearest_top_local_variable_scope() IRScope
M needs_code_coverage() boolean
M new_label() Label
M next_closure_id() int
M next_label_index() int
C next_label_index=(index)
M non_singleton_class_body?() boolean
M optimized_interpreter_context() FullInterpreterContext
M parent_maybe_using_refinements() boolean
C persist_scope_flags(file)
C persist_scope_header(file)
M prepare_full_build() FullInterpreterContext
M receives_closure_arg() boolean
M receives_keyword_args() boolean
C remove_closure(closure)
M root_lexical_scope() IRScope
M ruby2_keywords?() boolean
M scope_id() int
M script_scope?() boolean
M self() Variable
C set_accesses_parents_local_variables()
C set_can_capture_callers_binding()
C set_can_receive_breaks()
C set_can_receive_nonlocal_returns()
C set_has_break_instructions()
C set_has_loops()
C set_has_non_local_returns()
C set_is_maybe_using_refinements()
C set_needs_code_coverage()
C set_receives_closure_arg()
C set_receives_keyword_args()
C set_ruby2_keywords()
C set_uses_eval()
C set_uses_super()
C set_uses_z_super()
M static_scope() StaticScope
M to_string() String
M to_string_compile_form() String
M to_string_instrs() String
M top_local_variable_scope?() boolean
M uses_eval() boolean
M uses_super() boolean
M uses_z_super() boolean
M where_flip_flop_state_variable_is?() boolean
M within_end?() boolean
M within_method?() boolean

org.jruby.ir.IRMethod

class extends IRScope 12 members

Fields

fieldtypenote
isInstanceMethod boolean

Constructors

new

new ( IRManager manager, IRScope lexical_parent, LazyMethodDefinition defn, ByteList name, boolean is_instance_method, int line_number, StaticScope static_scope, int coverage_mode )
Java: <init>(org.jruby.ir.IRManager manager, org.jruby.ir.IRScope lexicalParent, org.jruby.ir.builder.LazyMethodDefinition defn, org.jruby.util.ByteList name, boolean isInstanceMethod, int lineNumber, org.jruby.parser.StaticScope staticScope, int coverageMode)

Instance Methods

argument_descriptors

ArgumentDescriptor[] argument_descriptors ( )
Java: getArgumentDescriptors() · also: get_argument_descriptors

argument_descriptors=

argument_descriptors= ( ArgumentDescriptor[] arg_desc )
Java: setArgumentDescriptors(org.jruby.runtime.ArgumentDescriptor[] argDesc) · also: set_argument_descriptors

Set upon completion of IRBuild of this IRMethod.

built_interpreter_context

InterpreterContext built_interpreter_context ( )
Java: builtInterpreterContext()

built_interpreter_context_for_java_constructor

ExitableInterpreterContext built_interpreter_context_for_java_constructor ( )
Java: builtInterpreterContextForJavaConstructor()

initialize methods in reified Java types will try and dispatch to the Java base classes constructor when the Ruby in the initialize: a) The super call is still valid in terms of Java (e.g. you cannot access self/this before the super call b) We can detect the validity of 'a'. Limitations like super in all paths of branches is not supported (for now). In cases where no super exists or it is unsupported we will return a normal interpreter (and a warning when unsupported):

Returns: appropriate interpretercontext

get_local_variable

LocalVariable get_local_variable ( RubySymbol name, int scope_depth )
Java: getLocalVariable(org.jruby.RubySymbol name, int scopeDepth)

has_been_built?

boolean has_been_built? ( )
Java: hasBeenBuilt() · also: has_been_built

lazily_acquire_interpreter_context

InterpreterContext lazily_acquire_interpreter_context ( )
Java: lazilyAcquireInterpreterContext()

method_data

MethodData method_data ( )
Java: getMethodData() · also: get_method_data

prepare_for_compilation

BasicBlock[] prepare_for_compilation ( )
Java: prepareForCompilation()

scope_type

IRScopeType scope_type ( )
Java: getScopeType() · also: get_scope_type

Inherited

from IRScope

fieldtypenote
LOG Logger
compilable Compilable

accesses_parents_local_variables

boolean accesses_parents_local_variables ( )
Java: accessesParentsLocalVariables()

add_closure

add_closure ( IRClosure closure )
Java: addClosure(org.jruby.ir.IRClosure closure)

allocate_interpreter_context

InterpreterContext allocate_interpreter_context ( List<Instr> instructions, int temp_variable_count, EnumSet<IRFlags> flags )
Java: allocateInterpreterContext(List<org.jruby.ir.instructions.Instr> instructions, int tempVariableCount, EnumSet<org.jruby.ir.IRFlags> flags)

Make version specific to scope which needs it (e.g. Closure vs non-closure).

allocate_interpreter_context

InterpreterContext allocate_interpreter_context ( Supplier<List<Instr>> instructions, int temp_variable_count, EnumSet<IRFlags> flags )
Java: allocateInterpreterContext(java.util.function.Supplier<List<org.jruby.ir.instructions.Instr>> instructions, int tempVariableCount, EnumSet<org.jruby.ir.IRFlags> flags)

Make version specific to scope which needs it (e.g. Closure vs non-closure).

any_uses_eval

boolean any_uses_eval ( )
Java: anyUsesEval()

ast

Object ast ( )
Java: getAST() · also: get_ast

build_jvm_exception_table

Map<BasicBlock,Label> build_jvm_exception_table ( FullInterpreterContext fic )
Java: buildJVMExceptionTable(org.jruby.ir.interpreter.FullInterpreterContext fic)

byte_name

ByteList byte_name ( )
Java: getByteName() · also: get_byte_name

byte_name=

byte_name= ( ByteList name )
Java: setByteName(org.jruby.util.ByteList name) · also: set_byte_name

can_capture_callers_binding

boolean can_capture_callers_binding ( )
Java: canCaptureCallersBinding()

can_receive_breaks

boolean can_receive_breaks ( )
Java: canReceiveBreaks()

can_receive_nonlocal_returns

boolean can_receive_nonlocal_returns ( )
Java: canReceiveNonlocalReturns()

capture_parent_refinements

capture_parent_refinements ( ThreadContext context )
Java: captureParentRefinements(org.jruby.runtime.ThreadContext context)

Duplicate the parent scope's refinements overlay to get a moment-in-time snapshot.

cleanup_after_execution

cleanup_after_execution ( )
Java: cleanupAfterExecution()

We are done with execution of this scope and we can cleanup some amount of things in this scope which will no longer be used. Sub-classes will be the deciders of what is no longer needed. An example, to illustrate the complexity of cleanup: A class with no nested closures can remove any ICs created and can remove some other infomrational data structures like allocated variables unless closures do exist and then the ICs must stay for when closures JIT.

closures

Collection<IRClosure> closures ( )
Java: getClosures() · also: get_closures

correct_variable_depth_for_for_loops_for_encoding

int correct_variable_depth_for_for_loops_for_encoding ( int depth )
Java: correctVariableDepthForForLoopsForEncoding(int depth)

coverage_mode

int coverage_mode ( )
Java: getCoverageMode() · also: get_coverage_mode

coverage_mode=

coverage_mode= ( int coverage_mode )
Java: setCoverageMode(int coverageMode) · also: set_coverage_mode

debug_output

String debug_output ( )
Java: debugOutput()

dump_to_igv

IGVDumper dump_to_igv ( )
Java: dumpToIGV()

dynamic_scope

DynamicScope dynamic_scope ( )
Java: getDynamicScope() · also: get_dynamic_scope

encoding

Encoding encoding ( )
Java: getEncoding() · also: get_encoding

equals

boolean equals ( Object other )
Java: equals(Object other)

executed_passes

List<CompilerPass> executed_passes ( )
Java: getExecutedPasses() · also: get_executed_passes

executes_once

boolean executes_once ( )
Java: executesOnce()

execution_context

FullInterpreterContext execution_context ( )
Java: getExecutionContext() · also: get_execution_context

file

String file ( )
Java: getFile() · also: get_file

file_name=

file_name= ( String filename )
Java: setFileName(String filename) · also: set_file_name

full_interpreter_context

FullInterpreterContext full_interpreter_context ( )
Java: getFullInterpreterContext() · also: get_full_interpreter_context

fully_qualified_name

String fully_qualified_name ( )
Java: getFullyQualifiedName() · also: get_fully_qualified_name

get_new_label

Label get_new_label ( String prefix )
Java: getNewLabel(String prefix)

get_new_local_variable

LocalVariable get_new_local_variable ( RubySymbol name, int scope_depth )
Java: getNewLocalVariable(org.jruby.RubySymbol name, int scopeDepth)

has_break_instructions?

boolean has_break_instructions? ( )
Java: hasBreakInstructions() · also: has_break_instructions

has_flip_flops=

has_flip_flops= ( boolean has_flip_flops )
Java: setHasFlipFlops(boolean hasFlipFlops) · also: set_has_flip_flops

has_flip_flops?

boolean has_flip_flops? ( )
Java: hasFlipFlops() · also: has_flip_flops

has_loops?

boolean has_loops? ( )
Java: hasLoops() · also: has_loops

has_non_local_returns?

boolean has_non_local_returns? ( )
Java: hasNonLocalReturns() · also: has_non_local_returns

hash_code

int hash_code ( )
Java: hashCode()

id

String id ( )
Java: getId() · also: get_id

inline_method

inline_method ( IRMethod method_to_inline, RubyModule metaclass, long callsite_id, int class_token, boolean clone_host )
Java: inlineMethod(org.jruby.ir.IRMethod methodToInline, org.jruby.RubyModule metaclass, long callsiteId, int classToken, boolean cloneHost)

inline_method_compiled

inline_method_compiled ( IRMethod method_to_inline, RubyModule impl_class, long callsite_id, int class_token, boolean clone_host )
Java: inlineMethodCompiled(org.jruby.ir.IRMethod methodToInline, org.jruby.RubyModule implClass, long callsiteId, int classToken, boolean cloneHost)

inline_method_jit

inline_method_jit ( IRMethod method_to_inline, RubyModule impl_class, long callsite_id, int class_token, boolean clone_host )
Java: inlineMethodJIT(org.jruby.ir.IRMethod methodToInline, org.jruby.RubyModule implClass, long callsiteId, int classToken, boolean cloneHost)

inlining_allowed

boolean inlining_allowed ( )
Java: inliningAllowed()

interpreter_context

InterpreterContext interpreter_context ( )
Java: getInterpreterContext() · also: get_interpreter_context

is_nested_in_closure

boolean is_nested_in_closure ( IRClosure closure )
Java: isNestedInClosure(org.jruby.ir.IRClosure closure)

is_scope_contained_by

boolean is_scope_contained_by ( IRScope parent_scope )
Java: isScopeContainedBy(org.jruby.ir.IRScope parentScope)

returns whether this scope is contained by the parentScope parameter. For simplicity a scope is considered to contain itself.

nametypedescription
parent_scopeorg.jruby.ir.IRScopewe want to see if it contains this scope

Returns: true if this scope is contained by parentScope.

lexical_parent

IRScope lexical_parent ( )
Java: getLexicalParent() · also: get_lexical_parent

Returns the lexical scope that contains this scope definition

lexical_scopes

List<IRScope> lexical_scopes ( )
Java: getLexicalScopes() · also: get_lexical_scopes

line

int line ( )
Java: getLine() · also: get_line

local_variables

Map<RubySymbol,LocalVariable> local_variables ( )
Java: getLocalVariables() · also: get_local_variables

Get the local variables for this scope. This should only be used by persistence layer.

lookup_existing_l_var

LocalVariable lookup_existing_l_var ( RubySymbol name )
Java: lookupExistingLVar(org.jruby.RubySymbol name)

manager

IRManager manager ( )
Java: getManager() · also: get_manager

maybe_using_refinements

boolean maybe_using_refinements ( )
Java: maybeUsingRefinements()

module_body?

boolean module_body? ( )
Java: isModuleBody() · also: is_module_body

Does this scope represent a module body?

name

RubySymbol name ( )
Java: getName() · also: get_name

nearest_method

IRMethod nearest_method ( )
Java: getNearestMethod() · also: get_nearest_method

nearest_module_referencing_scope_depth

int nearest_module_referencing_scope_depth ( )
Java: getNearestModuleReferencingScopeDepth() · also: get_nearest_module_referencing_scope_depth

Returns the nearest scope which we can extract a live module from. If this returns null (like for evals), then it means it cannot be statically determined.

nearest_non_closurelike_scope

IRScope nearest_non_closurelike_scope ( )
Java: getNearestNonClosurelikeScope() · also: get_nearest_non_closurelike_scope

nearest_top_local_variable_scope

IRScope nearest_top_local_variable_scope ( )
Java: getNearestTopLocalVariableScope() · also: get_nearest_top_local_variable_scope

needs_code_coverage

boolean needs_code_coverage ( )
Java: needsCodeCoverage()

new_label

Label new_label ( )
Java: getNewLabel() · also: get_new_label

next_closure_id

int next_closure_id ( )
Java: getNextClosureId() · also: get_next_closure_id

next_label_index

int next_label_index ( )
Java: getNextLabelIndex() · also: get_next_label_index

next_label_index=

next_label_index= ( int index )
Java: setNextLabelIndex(int index) · also: set_next_label_index

non_singleton_class_body?

boolean non_singleton_class_body? ( )
Java: isNonSingletonClassBody() · also: is_non_singleton_class_body

Is this IRClassBody but not IRMetaClassBody?

optimized_interpreter_context

FullInterpreterContext optimized_interpreter_context ( )
Java: getOptimizedInterpreterContext() · also: get_optimized_interpreter_context

parent_maybe_using_refinements

boolean parent_maybe_using_refinements ( )
Java: parentMaybeUsingRefinements()

persist_scope_flags

persist_scope_flags ( IRWriterEncoder file )
Java: persistScopeFlags(org.jruby.ir.persistence.IRWriterEncoder file)

persist_scope_header

persist_scope_header ( IRWriterEncoder file )
Java: persistScopeHeader(org.jruby.ir.persistence.IRWriterEncoder file)

prepare_full_build

FullInterpreterContext prepare_full_build ( )
Java: prepareFullBuild()

This initializes a more complete(full) InterpreterContext which if used in mixed mode will be used by the JIT and if used in pure-interpreted mode it will be used by an interpreter engine.

receives_closure_arg

boolean receives_closure_arg ( )
Java: receivesClosureArg()

receives_keyword_args

boolean receives_keyword_args ( )
Java: receivesKeywordArgs()

remove_closure

remove_closure ( IRClosure closure )
Java: removeClosure(org.jruby.ir.IRClosure closure)

root_lexical_scope

IRScope root_lexical_scope ( )
Java: getRootLexicalScope() · also: get_root_lexical_scope

Returns the top level scope

ruby2_keywords?

boolean ruby2_keywords? ( )
Java: isRuby2Keywords() · also: is_ruby2_keywords

scope_id

int scope_id ( )
Java: getScopeId() · also: get_scope_id

script_scope?

boolean script_scope? ( )
Java: isScriptScope() · also: is_script_scope

Is this an eval script or a regular file script?

self

Variable self ( )
Java: getSelf() · also: get_self

set_accesses_parents_local_variables

set_accesses_parents_local_variables ( )
Java: setAccessesParentsLocalVariables()

set_can_capture_callers_binding

set_can_capture_callers_binding ( )
Java: setCanCaptureCallersBinding()

set_can_receive_breaks

set_can_receive_breaks ( )
Java: setCanReceiveBreaks()

set_can_receive_nonlocal_returns

set_can_receive_nonlocal_returns ( )
Java: setCanReceiveNonlocalReturns()

set_has_break_instructions

set_has_break_instructions ( )
Java: setHasBreakInstructions()

set_has_loops

set_has_loops ( )
Java: setHasLoops()

set_has_non_local_returns

set_has_non_local_returns ( )
Java: setHasNonLocalReturns()

set_is_maybe_using_refinements

set_is_maybe_using_refinements ( )
Java: setIsMaybeUsingRefinements()

set_needs_code_coverage

set_needs_code_coverage ( )
Java: setNeedsCodeCoverage()

set_receives_closure_arg

set_receives_closure_arg ( )
Java: setReceivesClosureArg()

set_receives_keyword_args

set_receives_keyword_args ( )
Java: setReceivesKeywordArgs()

set_ruby2_keywords

set_ruby2_keywords ( )
Java: setRuby2Keywords()

set_uses_eval

set_uses_eval ( )
Java: setUsesEval()

set_uses_super

set_uses_super ( )
Java: setUsesSuper()

set_uses_z_super

set_uses_z_super ( )
Java: setUsesZSuper()

static_scope

StaticScope static_scope ( )
Java: getStaticScope() · also: get_static_scope

to_string

String to_string ( )
Java: toString()

to_string_compile_form

String to_string_compile_form ( )
Java: toStringCompileForm()

to_string_instrs

String to_string_instrs ( )
Java: toStringInstrs()

top_local_variable_scope?

boolean top_local_variable_scope? ( )
Java: isTopLocalVariableScope() · also: is_top_local_variable_scope

uses_eval

boolean uses_eval ( )
Java: usesEval()

uses_super

boolean uses_super ( )
Java: usesSuper()

uses_z_super

boolean uses_z_super ( )
Java: usesZSuper()

where_flip_flop_state_variable_is?

boolean where_flip_flop_state_variable_is? ( )
Java: isWhereFlipFlopStateVariableIs() · also: is_where_flip_flop_state_variable_is

within_end?

boolean within_end? ( )
Java: isWithinEND() · also: is_within_end

within_method?

boolean within_method? ( )
Java: isWithinMethod() · also: is_within_method