Top Fields Constructors Methods
org.jruby.ir.interpreter

public Class Interpreter

extends IRTranslator<IRubyObject, IRubyObject>
Class Inheritance
Imports
java.io.ByteArrayOutputStream, org.jruby.EvalType, .ParseResult, .Ruby, .RubyModule, .RubyString, org.jruby.ir.IRManager, .IREvalScript, .IRScope, .IRScriptBody, .IRTranslator, org.jruby.ir.builder.IRBuilder, org.jruby.ir.operands.IRException, org.jruby.ir.persistence.IRDumper, org.jruby.ir.runtime.IRBreakJump, .IRRuntimeHelpers, org.jruby.parser.StaticScope, org.jruby.runtime.Binding, .Block, .DynamicScope, .Frame, .ThreadContext, .Visibility, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.scope.ManyVarsDynamicScope, org.jruby.util.log.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
pack-priv static int
public static final Logger
public static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
private static IRubyObject
evalCommon(ThreadContext context, DynamicScope evalScope, IRubyObject self, IRubyObject src, String file, int lineNumber, String name, Block blockArg, EvalType evalType, boolean bindingGiven)

public static String
evalName(String file, int line)

public static IRubyObject

Returns:

An IRubyObject result from the evaluation
evalSimple
(ThreadContext
the current thread's context
context
,
RubyModule under, IRubyObject
the self to evaluate under
self
,
RubyString
The string containing the text to be evaluated
src
,
String
The filename to use when reporting errors during the evaluation
file
,
int
that the eval supposedly starts from
lineNumber
,
EvalType evalType)

Evaluate the given string.

public static IRubyObject

Returns:

An IRubyObject result from the evaluation
evalWithBinding
(ThreadContext
the thread context for the current thread
context
,
IRubyObject
the self against which eval was called; used as self in the eval in 1.9 mode
self
,
IRubyObject
The string containing the text to be evaluated
src
,
Binding
The binding object under which to perform the evaluation
binding
,
boolean bindingGiven)

Evaluate the given string under the specified binding object.

protected IRubyObject
public static IRubyObject
INTERPRET_BLOCK(ThreadContext context, Block block, IRubyObject self, InterpreterContext ic, IRubyObject[] args, String name, Block blockArg)

public static IRubyObject
public static IRubyObject
public static IRubyObject
INTERPRET_METACLASS(ThreadContext context, IRScope body, RubyModule clazz, String name, Visibility visibility)

public static IRubyObject
INTERPRET_METHOD(ThreadContext context, IRScope body, RubyModule implClass, IRubyObject self, String name, IRubyObject[] args, Block block)

public static IRubyObject
INTERPRET_METHOD(ThreadContext context, IRScope body, RubyModule implClass, IRubyObject self, String name, Block block)

public static IRubyObject
INTERPRET_METHOD(ThreadContext context, IRScope body, RubyModule implClass, IRubyObject self, String name, IRubyObject arg0, Block block)

public static IRubyObject
INTERPRET_METHOD(ThreadContext context, IRScope body, RubyModule implClass, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, Block block)

public static IRubyObject
INTERPRET_METHOD(ThreadContext context, IRScope body, RubyModule implClass, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)

public static IRubyObject
public static IRubyObject
private static IRubyObject
interpretFrameScope(ThreadContext context, Block selfBlock, IRScope body, RubyModule clazz, DynamicScope parentScope, Visibility visibility, IRubyObject self, String frameName, String passedName, IRubyObject[] args, Block block)

public static void
public static void
preFrameScope(InterpreterContext ic, ThreadContext context, IRubyObject self, String name, Block block, RubyModule implClass, DynamicScope parentScope, Visibility visibility)

private static InterpreterContext
prepareIC(ThreadContext context, DynamicScope evalScope, IRubyObject src, String file, int lineNumber, EvalType evalType, boolean bindingGiven)

Inherited from org.jruby.ir.IRTranslator:
execute

Field Detail

interpInstrsCountback to summary
pack-priv static int interpInstrsCount
LOGback to summary
public static final Logger LOG
ROOTback to summary
public static final String ROOT

Constructor Detail

Interpreterback to summary
public Interpreter()

Method Detail

dumpStatsback to summary
public static void dumpStats()
evalCommonback to summary
private static IRubyObject evalCommon(ThreadContext context, DynamicScope evalScope, IRubyObject self, IRubyObject src, String file, int lineNumber, String name, Block blockArg, EvalType evalType, boolean bindingGiven)
evalNameback to summary
public static String evalName(String file, int line)
evalSimpleback to summary
public static IRubyObject evalSimple(ThreadContext context, RubyModule under, IRubyObject self, RubyString src, String file, int lineNumber, EvalType evalType)

Evaluate the given string.

Parameters
context:ThreadContext

the current thread's context

self:IRubyObject

the self to evaluate under

src:RubyString

The string containing the text to be evaluated

file:String

The filename to use when reporting errors during the evaluation

lineNumber:int

that the eval supposedly starts from

Returns:IRubyObject

An IRubyObject result from the evaluation

evalWithBindingback to summary
public static IRubyObject evalWithBinding(ThreadContext context, IRubyObject self, IRubyObject src, Binding binding, boolean bindingGiven)

Evaluate the given string under the specified binding object. If the binding is not a Proc or Binding object (RubyProc or RubyBinding) throw an appropriate type error.

Parameters
context:ThreadContext

the thread context for the current thread

self:IRubyObject

the self against which eval was called; used as self in the eval in 1.9 mode

src:IRubyObject

The string containing the text to be evaluated

binding:Binding

The binding object under which to perform the evaluation

Returns:IRubyObject

An IRubyObject result from the evaluation

executeback to summary
protected IRubyObject execute(ThreadContext context, IRScriptBody irScope, IRubyObject self)

Implements abstract org.jruby.ir.IRTranslator.execute.

Annotations
@Override
INTERPRET_BLOCKback to summary
public static IRubyObject INTERPRET_BLOCK(ThreadContext context, Block block, IRubyObject self, InterpreterContext ic, IRubyObject[] args, String name, Block blockArg)
INTERPRET_CLASSback to summary
public static IRubyObject INTERPRET_CLASS(ThreadContext context, IRScope body, RubyModule clazz, String name)
INTERPRET_EVALback to summary
public static IRubyObject INTERPRET_EVAL(ThreadContext context, IRubyObject self, InterpreterContext ic, RubyModule clazz, IRubyObject[] args, String name, Block blockArg)
INTERPRET_METACLASSback to summary
public static IRubyObject INTERPRET_METACLASS(ThreadContext context, IRScope body, RubyModule clazz, String name, Visibility visibility)
INTERPRET_METHODback to summary
public static IRubyObject INTERPRET_METHOD(ThreadContext context, IRScope body, RubyModule implClass, IRubyObject self, String name, IRubyObject[] args, Block block)
INTERPRET_METHODback to summary
public static IRubyObject INTERPRET_METHOD(ThreadContext context, IRScope body, RubyModule implClass, IRubyObject self, String name, Block block)
INTERPRET_METHODback to summary
public static IRubyObject INTERPRET_METHOD(ThreadContext context, IRScope body, RubyModule implClass, IRubyObject self, String name, IRubyObject arg0, Block block)
INTERPRET_METHODback to summary
public static IRubyObject INTERPRET_METHOD(ThreadContext context, IRScope body, RubyModule implClass, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, Block block)
INTERPRET_METHODback to summary
public static IRubyObject INTERPRET_METHOD(ThreadContext context, IRScope body, RubyModule implClass, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
INTERPRET_MODULEback to summary
public static IRubyObject INTERPRET_MODULE(ThreadContext context, IRScope body, RubyModule clazz, String name)
INTERPRET_ROOTback to summary
public static IRubyObject INTERPRET_ROOT(ThreadContext context, IRubyObject self, InterpreterContext ic, RubyModule clazz, String name)
interpretFrameScopeback to summary
private static IRubyObject interpretFrameScope(ThreadContext context, Block selfBlock, IRScope body, RubyModule clazz, DynamicScope parentScope, Visibility visibility, IRubyObject self, String frameName, String passedName, IRubyObject[] args, Block block)
postFrameScopeback to summary
public static void postFrameScope(InterpreterContext ic, ThreadContext context)
preFrameScopeback to summary
public static void preFrameScope(InterpreterContext ic, ThreadContext context, IRubyObject self, String name, Block block, RubyModule implClass, DynamicScope parentScope, Visibility visibility)
prepareICback to summary
private static InterpreterContext prepareIC(ThreadContext context, DynamicScope evalScope, IRubyObject src, String file, int lineNumber, EvalType evalType, boolean bindingGiven)