org.jruby.compiler.impl
Class MethodBodyCompiler

java.lang.Object
  extended by org.jruby.compiler.impl.BaseBodyCompiler
      extended by org.jruby.compiler.impl.RootScopedBodyCompiler
          extended by org.jruby.compiler.impl.MethodBodyCompiler
All Implemented Interfaces:
BodyCompiler

public class MethodBodyCompiler
extends RootScopedBodyCompiler

MethodBodyCompiler is the base compiler for all method bodies.


Field Summary
protected  java.lang.String rubyName
           
protected  boolean specificArity
           
 
Fields inherited from class org.jruby.compiler.impl.BaseBodyCompiler
argParamCount, currentLoopLabels, inNestedMethod, inspector, invocationCompiler, method, methodName, redoJump, scope, scopeEnd, scopeStart, script, variableCompiler
 
Constructor Summary
MethodBodyCompiler(StandardASMCompiler scriptCompiler, java.lang.String rubyName, java.lang.String javaName, ASTInspector inspector, StaticScope scope)
           
 
Method Summary
 void beginMethod(CompilerCallback args, StaticScope scope)
           
protected  void createVariableCompiler()
           
 void endBody()
          End compilation for the method associated with the specified token.
protected  java.lang.String getSignature()
           
 void issueBreakEvent(CompilerCallback value)
           
 void issueNextEvent(CompilerCallback value)
           
 void issueRedoEvent()
           
 void performReturn()
          Return the current value on the top of the stack, taking into consideration surrounding blocks.
 
Methods inherited from class org.jruby.compiler.impl.RootScopedBodyCompiler
outline
 
Methods inherited from class org.jruby.compiler.impl.BaseBodyCompiler
aliasGlobal, appendToArray, appendToObjectArray, aprintln, aryToAry, assignClassVariable, assignClassVariable, assignConstantInCurrent, assignConstantInModule, assignConstantInObject, assignGlobalVariable, assignGlobalVariable, assignInstanceVariable, assignInstanceVariable, asString, attached, backref, backrefMethod, beginChainedMethod, callZSuper, chainToMethod, checkIsExceptionHandled, checkWhenWithSplat, clearErrorInfo, compileSequencedConditional, concatArrays, concatObjectArrays, consumeCurrentValue, convertToJavaArray, createEmptyArray, createEmptyHash, createNewArray, createNewArray, createNewBignum, createNewClosure, createNewClosure19, createNewEndBlock, createNewFixnum, createNewFloat, createNewForLoop, createNewHash, createNewLambda, createNewRange, createNewRegexp, createNewString, createNewString, createNewSymbol, createNewSymbol, createObjectArray, createObjectArray, declareClassVariable, declareClassVariable, defineAlias, defineClass, defineModule, defineNewMethod, duplicateCurrentValue, ensureMultipleAssignableRubyArray, ensureRubyArray, forEachInValueArray, forEachInValueArray, getClosureIndex, getCompiledClass, getDynamicScopeIndex, getExceptionIndex, getFirstTempIndex, getFrameKlazz, getFrameName, getInstanceVariable, getInvocationCompiler, getNewEnding, getNewEnsureName, getNewRescueName, getNilIndex, getPreviousExceptionIndex, getRuntimeIndex, getScriptCompiler, getVariableCompiler, getVarsArrayIndex, getVisibilityFor, go, hasBlock, ifNotNull, ifNotSuperMethodBound, ifNull, ifSingleton, inDefined, invokeIRubyObject, invokeRuby, invokeThreadContext, invokeUtilityMethod, isCaptured, isClassVarDefined, isConstantBranch, isConstantDefined, isGlobalDefined, isInstanceOf, isInstanceVariableDefined, isMethodBound, isNil, isNotProtected, isNull, isPrivate, issueLoopBreak, issueLoopNext, issueLoopRedo, issueRetryEvent, lineNumber, literalSwitch, loadBlock, loadClass, loadCurrentModule, loadException, loadFalse, loadFilename, loadNil, loadNull, loadObject, loadRuntime, loadSelf, loadStandardError, loadThis, loadThreadContext, loadTrue, match, match2, match3, metaclass, negateCurrentValue, notIsModuleAndClassVarDefined, nthRef, nullToNil, outDefined, performBackref, performBooleanBranch, performBooleanLoop, performBooleanLoopLight, performBooleanLoopSafe, performEnsure, performLogicalAnd, performLogicalOr, performRescue, performRescueLight, pollThreadEvents, println, protect, pushNull, pushString, rescue, rethrowException, rethrowIfSystemExit, retrieveClassVariable, retrieveConstant, retrieveConstantFromModule, retrieveConstantFromObject, retrieveGlobalVariable, retrieveInstanceVariable, retrieveSelf, retrieveSelfClass, reverseValues, runBeginBlock, selfIsKindOf, setEnding, setFilePosition, setLinePosition, shouldUseBoxedArgs, singlifySplattedValue, splatCurrentValue, storeExceptionInErrorInfo, stringOrNil, superClass, swapValues, toJavaString, typeCheckBranch, undefMethod, unwrapPassedBlock, unwrapRaiseException, wrapJavaException, wrapJavaObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

specificArity

protected boolean specificArity

rubyName

protected java.lang.String rubyName
Constructor Detail

MethodBodyCompiler

public MethodBodyCompiler(StandardASMCompiler scriptCompiler,
                          java.lang.String rubyName,
                          java.lang.String javaName,
                          ASTInspector inspector,
                          StaticScope scope)
Method Detail

getSignature

protected java.lang.String getSignature()
Overrides:
getSignature in class RootScopedBodyCompiler

createVariableCompiler

protected void createVariableCompiler()
Overrides:
createVariableCompiler in class RootScopedBodyCompiler

beginMethod

public void beginMethod(CompilerCallback args,
                        StaticScope scope)
Overrides:
beginMethod in class RootScopedBodyCompiler

endBody

public void endBody()
Description copied from interface: BodyCompiler
End compilation for the method associated with the specified token. This should close out all structures created for compilation of the method.

Specified by:
endBody in interface BodyCompiler
Overrides:
endBody in class RootScopedBodyCompiler

performReturn

public void performReturn()
Description copied from interface: BodyCompiler
Return the current value on the top of the stack, taking into consideration surrounding blocks.

Specified by:
performReturn in interface BodyCompiler
Overrides:
performReturn in class RootScopedBodyCompiler

issueBreakEvent

public void issueBreakEvent(CompilerCallback value)
Specified by:
issueBreakEvent in interface BodyCompiler
Overrides:
issueBreakEvent in class RootScopedBodyCompiler

issueNextEvent

public void issueNextEvent(CompilerCallback value)
Specified by:
issueNextEvent in interface BodyCompiler
Overrides:
issueNextEvent in class RootScopedBodyCompiler

issueRedoEvent

public void issueRedoEvent()
Specified by:
issueRedoEvent in interface BodyCompiler
Overrides:
issueRedoEvent in class RootScopedBodyCompiler


Copyright © 2002-2007 JRuby Team. All Rights Reserved.