<init>()addUsedVariables(List<org.jruby.ir.operands.Variable> l)retrieve(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, org.jruby.parser.StaticScope currScope, org.jruby.runtime.DynamicScope currDynScope, Object[] temp)toString()| field | type | note |
|---|---|---|
| EMPTY_ARRAY | Operand[] |
canCopyPropagate()Can we replace every use of a variable 'v' that contains the value of this operand with the operand itself? This takes importance when there are at least two uses of 'v' within this scope. Ex: v = [1,2,3]; x = v; y = v In this case, we cannot replace the occurrences of 'v' because we would then get x = [1,2,3]; y = [1,2,3] which would then result in two different array objects being constructed instead of a single one.
Returns: true if it is safe to copy-propagate the operand.
isFalseyImmediate() · also: is_falsey_immediatehasKnownValue() · also: has_known_valueDo we know the value of this operand at compile-time? If we do then it may be possible to constant propagate (one case: We also know it is also an ImmutableLiteral).
Returns: true if a known compile-time value.
isTruthyImmediate() · also: is_truthy_immediateReturns true if this is an immediate value that will always be considered truthy (true, numbers, etc)