org.jruby.interpreter
Interface InterpreterContext
- All Known Implementing Classes:
- NaiveInterpreterContext
public interface InterpreterContext
Meant as a simple interface for all the various methods we will want
the interpreter to have without having to commit to many technical details.
For example if we add primitive variable operations then we will need to
add setters which are unboxed. The ability to get and set in multiple ways
will mean a proliferation of methods to support this without needing to
make huge changes to operands or instructions (other than calling the new
method on this context).
This is also a interface by matter of moving forward. This could all also
be right on InterpretedIRMethod, but by having an interface the compiler
can "cheat" initially and use the same context for some of the more difficult
parts until it finds the best way.
SSS: InterpreterContext is actually the closure environment
getParameter
java.lang.Object getParameter(int offset)
getParameterCount
int getParameterCount()
getReturnValue
java.lang.Object getReturnValue()
setReturnValue
void setReturnValue(java.lang.Object returnValue)
getTemporaryVariable
java.lang.Object getTemporaryVariable(int offset)
setTemporaryVariable
java.lang.Object setTemporaryVariable(int offset,
java.lang.Object value)
getLocalVariable
java.lang.Object getLocalVariable(int offset)
- public Object getLocalVariable(String name);
public Object setLocalVariable(String name, Object value);
setLocalVariable
java.lang.Object setLocalVariable(int offset,
java.lang.Object value)
updateRenamedVariablesCount
void updateRenamedVariablesCount(int n)
getRenamedVariable
java.lang.Object getRenamedVariable(int offset)
setRenamedVariable
java.lang.Object setRenamedVariable(int offset,
java.lang.Object value)
setDynamicScope
void setDynamicScope(DynamicScope s)
allocateSharedBindingScope
void allocateSharedBindingScope(IRMethod method)
getSharedBindingScope
DynamicScope getSharedBindingScope()
hasAllocatedDynamicScope
boolean hasAllocatedDynamicScope()
getSharedBindingVariable
java.lang.Object getSharedBindingVariable(int bindingSlot)
setSharedBindingVariable
void setSharedBindingVariable(int bindingSlot,
java.lang.Object value)
getBlock
Block getBlock()
setBlock
void setBlock(Block block)
getSelf
java.lang.Object getSelf()
getContext
ThreadContext getContext()
getRuntime
Ruby getRuntime()
setFrame
void setFrame(Frame currentFrame)
getFrame
Frame getFrame()
getParametersFrom
IRubyObject[] getParametersFrom(int argIndex)
setMethodExitLabel
void setMethodExitLabel(Label l)
getMethodExitLabel
Label getMethodExitLabel()
setException
void setException(RubyException e)
getException
RubyException getException()
Copyright © 2002-2009 JRuby Team. All Rights Reserved.