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


Method Summary
 void allocateSharedBindingScope(IRMethod method)
           
 Block getBlock()
           
 ThreadContext getContext()
           
 RubyException getException()
           
 Frame getFrame()
           
 java.lang.Object getLocalVariable(int offset)
          public Object getLocalVariable(String name); public Object setLocalVariable(String name, Object value);
 Label getMethodExitLabel()
           
 java.lang.Object getParameter(int offset)
           
 int getParameterCount()
           
 IRubyObject[] getParametersFrom(int argIndex)
           
 java.lang.Object getRenamedVariable(int offset)
           
 java.lang.Object getReturnValue()
           
 Ruby getRuntime()
           
 java.lang.Object getSelf()
           
 DynamicScope getSharedBindingScope()
           
 java.lang.Object getSharedBindingVariable(int bindingSlot)
           
 java.lang.Object getTemporaryVariable(int offset)
           
 boolean hasAllocatedDynamicScope()
           
 void setBlock(Block block)
           
 void setDynamicScope(DynamicScope s)
           
 void setException(RubyException e)
           
 void setFrame(Frame currentFrame)
           
 java.lang.Object setLocalVariable(int offset, java.lang.Object value)
           
 void setMethodExitLabel(Label l)
           
 java.lang.Object setRenamedVariable(int offset, java.lang.Object value)
           
 void setReturnValue(java.lang.Object returnValue)
           
 void setSharedBindingVariable(int bindingSlot, java.lang.Object value)
           
 java.lang.Object setTemporaryVariable(int offset, java.lang.Object value)
           
 void updateRenamedVariablesCount(int n)
           
 

Method Detail

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.