|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jruby.compiler.impl.BaseBodyCompiler
public abstract class BaseBodyCompiler
BaseBodyCompiler encapsulates all common behavior between BodyCompiler implementations.
| Field Summary | |
|---|---|
protected int |
argParamCount
|
protected org.objectweb.asm.Label[] |
currentLoopLabels
|
protected boolean |
inNestedMethod
|
protected ASTInspector |
inspector
|
protected InvocationCompiler |
invocationCompiler
|
protected SkinnyMethodAdapter |
method
|
protected java.lang.String |
methodName
|
protected org.objectweb.asm.Label |
redoJump
|
protected java.lang.String |
rubyName
|
protected StaticScope |
scope
|
protected org.objectweb.asm.Label |
scopeEnd
|
protected org.objectweb.asm.Label |
scopeStart
|
protected StandardASMCompiler |
script
|
protected VariableCompiler |
variableCompiler
|
| Constructor Summary | |
|---|---|
BaseBodyCompiler(StandardASMCompiler scriptCompiler,
java.lang.String methodName,
java.lang.String rubyName,
ASTInspector inspector,
StaticScope scope)
|
|
| Method Summary | |
|---|---|
void |
aliasGlobal(java.lang.String newName,
java.lang.String oldName)
|
void |
appendToArray()
|
void |
appendToObjectArray()
|
void |
aprintln()
For logging, println the object reference currently atop the stack |
void |
argsCat()
Pass two stack elements, converting the first to an array, to the "argsCat" utility method. |
void |
argsPush()
Pass two stack elements, the first an array, to the "argsPush" utility method. |
void |
aryToAry()
|
void |
assignClassVariable(java.lang.String name)
|
void |
assignClassVariable(java.lang.String name,
CompilerCallback value)
|
void |
assignConstantInCurrent(java.lang.String name)
|
void |
assignConstantInModule(java.lang.String name)
|
void |
assignConstantInObject(java.lang.String name)
|
void |
assignGlobalVariable(java.lang.String name)
Assign the top of the stack to the global variable with the specified name. |
void |
assignGlobalVariable(java.lang.String name,
CompilerCallback value)
Assign the top of the stack to the global variable with the specified name. |
void |
assignInstanceVariable(java.lang.String name)
Assign the value on top of the stack to the instance variable with the specified name on the current "self". |
void |
assignInstanceVariable(java.lang.String name,
CompilerCallback value)
Assign the value on top of the stack to the instance variable with the specified name on the current "self". |
void |
asString()
|
void |
attached()
|
void |
backref()
Push the current back reference |
void |
backrefMethod(java.lang.String methodName)
Call a static helper method on RubyRegexp with the current backref |
void |
beginChainedMethod()
|
abstract void |
beginMethod(CompilerCallback args,
StaticScope scope)
|
void |
callZSuper(CompilerCallback closure)
|
BodyCompiler |
chainToMethod(java.lang.String methodName)
|
void |
checkIsExceptionHandled(ArgumentsCallback rescueArgs)
|
void |
checkWhenWithSplat()
|
void |
clearErrorInfo()
|
void |
compileSequencedConditional(CompilerCallback inputValue,
FastSwitchType fastSwitchType,
java.util.Map<CompilerCallback,int[]> switchCases,
java.util.List<ArgumentsCallback> conditionals,
java.util.List<CompilerCallback> bodies,
CompilerCallback fallback)
|
void |
concatArrays()
|
void |
concatObjectArrays()
|
void |
consumeCurrentValue()
As code executes, values are assumed to be "generated", often by being pushed on to some execution stack. |
void |
convertToJavaArray()
|
void |
createEmptyArray()
Create an empty Ruby array |
void |
createEmptyHash()
Create an empty Ruby Hash object and put a reference on top of the stack. |
void |
createNewArray(boolean lightweight)
Given an aggregated set of objects (likely created through a call to createObjectArray) create a Ruby array object. |
void |
createNewArray(java.lang.Object[] sourceArray,
ArrayCallback callback,
boolean lightweight)
Construct a Ruby array given an array of objects to feed to an ArrayCallback to construct the elements of the array. |
void |
createNewBignum(java.math.BigInteger value)
Generate a new "Bignum" value. |
void |
createNewClosure(java.lang.String file,
int line,
StaticScope scope,
int arity,
CompilerCallback body,
CompilerCallback args,
boolean hasMultipleArgsHead,
NodeType argsNodeId,
ASTInspector inspector)
Create a new closure (block) using the given lexical scope information, call arity, and body generated by the body callback. |
void |
createNewClosure19(java.lang.String file,
int line,
StaticScope scope,
int arity,
CompilerCallback body,
CompilerCallback args,
boolean hasMultipleArgsHead,
NodeType argsNodeId,
java.lang.String parameterList,
ASTInspector inspector)
Create a new closure (block) using the given lexical scope information, call arity, and body generated by the body callback. |
void |
createNewEndBlock(CompilerCallback body)
|
void |
createNewFixnum(long value)
Generate a new "Fixnum" value. |
void |
createNewFloat(double value)
Generate a new "Float" value. |
void |
createNewForLoop(int arity,
CompilerCallback body,
CompilerCallback args,
boolean hasMultipleArgsHead,
NodeType argsNodeId,
ASTInspector inspector)
Create a new closure (block) for a for loop with the given call arity and body generated by the body callback. |
void |
createNewHash(java.lang.Object elements,
ArrayCallback callback,
int keyCount)
Create a new hash by calling back to the specified ArrayCallback. |
void |
createNewHash19(java.lang.Object elements,
ArrayCallback callback,
int keyCount)
|
void |
createNewLambda(CompilerCallback closure)
Create a new literal lambda. |
void |
createNewLiteralArray(java.lang.Object[] sourceArray,
ArrayCallback callback,
boolean lightweight)
Construct a Ruby array given an array of objects to feed to an ArrayCallback to construct the elements of the array. |
void |
createNewLiteralHash(java.lang.Object elements,
ArrayCallback callback,
int keyCount)
Create a new hash by calling back to the specified ArrayCallback. |
void |
createNewRange(CompilerCallback beginEndCallback,
boolean isExclusive)
Create a new range. |
void |
createNewRegexp(org.jruby.util.ByteList value,
int options)
|
void |
createNewRegexp(CompilerCallback createStringCallback,
int options)
|
void |
createNewString(ArrayCallback callback,
int count)
Generate a new dynamic "String" value. |
void |
createNewString(org.jruby.util.ByteList value,
int codeRange)
Generate a new "String" value. |
void |
createNewSymbol(ArrayCallback callback,
int count)
|
void |
createNewSymbol(java.lang.String name)
Generate a new "Symbol" value (or fetch the existing one). |
void |
createObjectArray(int elementCount)
Combine the top |
void |
createObjectArray(java.lang.Object[] sourceArray,
ArrayCallback callback)
|
protected abstract void |
createVariableCompiler()
|
void |
declareClassVariable(java.lang.String name)
|
void |
declareClassVariable(java.lang.String name,
CompilerCallback value)
|
void |
defineAlias(CompilerCallback args)
Define an alias for a new name to an existing oldName'd method. |
void |
defineClass(java.lang.String name,
StaticScope staticScope,
CompilerCallback superCallback,
CompilerCallback pathCallback,
CompilerCallback bodyCallback,
CompilerCallback receiverCallback,
ASTInspector inspector)
|
void |
definedCall(java.lang.String name)
Check defined?() for a Call |
void |
definedNot()
Check defined?() for a Not. |
void |
defineModule(java.lang.String name,
StaticScope staticScope,
CompilerCallback pathCallback,
CompilerCallback bodyCallback,
ASTInspector inspector)
|
void |
defineNewMethod(java.lang.String name,
int methodArity,
StaticScope scope,
CompilerCallback body,
CompilerCallback args,
CompilerCallback receiver,
ASTInspector inspector,
boolean root,
java.lang.String filename,
int line,
java.lang.String parameterDesc)
Define a new method with the given name, arity, local variable count, and body callback. |
void |
duplicateCurrentValue()
Push a copy the topmost value on the stack. |
abstract void |
endBody()
End compilation for the method associated with the specified token. |
void |
ensureMultipleAssignableRubyArray(boolean masgnHasHead)
Ensures that the present value is an IRubyObject[] by wrapping it with one or coercing it if it is not. |
void |
ensureRubyArray()
Ensures that the present value is an IRubyObject[] by wrapping it with one if it is not. |
void |
forEachInValueArray(int start,
int count,
java.lang.Object source,
ArrayCallback callback,
CompilerCallback argsCallback)
Given an IRubyObject[] on the stack (or otherwise available as the present object) call back to the provided ArrayCallback 'callback' for 'count' elements, starting with 'start'. |
void |
forEachInValueArray(int start,
int preCount,
java.lang.Object preSource,
int postCount,
java.lang.Object postSource,
ArrayCallback callback,
CompilerCallback argsCallback)
Given an IRubyObject[] on the stack (or otherwise available as the present object) call back to the provided ArrayCallback 'callback' for 'count' elements, starting with 'start'. |
protected int |
getActualArgsCount(StaticScope scope)
|
protected int |
getClosureIndex()
|
void |
getCompiledClass()
|
protected int |
getDynamicScopeIndex()
|
protected int |
getExceptionIndex()
|
protected int |
getFirstTempIndex()
|
void |
getFrameKlazz()
|
void |
getFrameName()
|
void |
getInstanceVariable(java.lang.String name)
|
InvocationCompiler |
getInvocationCompiler()
|
java.lang.String |
getNativeMethodName()
|
java.lang.Object |
getNewEnding()
|
protected java.lang.String |
getNewEnsureName()
|
protected java.lang.String |
getNewRescueName()
|
protected int |
getPreviousExceptionIndex()
|
java.lang.String |
getRubyName()
|
StandardASMCompiler |
getScriptCompiler()
|
protected abstract java.lang.String |
getSignature()
|
VariableCompiler |
getVariableCompiler()
|
protected int |
getVarsArrayIndex()
|
void |
getVisibilityFor(java.lang.String name)
|
void |
go(java.lang.Object gotoToken)
|
void |
hasBlock(BranchCallback trueBranch,
BranchCallback falseBranch)
|
void |
ifNotNull(java.lang.Object gotoToken)
|
void |
ifNotSuperMethodBound(java.lang.Object token)
|
void |
ifNull(java.lang.Object gotoToken)
|
void |
ifSingleton(java.lang.Object gotoToken)
|
void |
inDefined()
|
void |
invokeIRubyObject(java.lang.String methodName,
java.lang.String signature)
|
void |
invokeRuby(java.lang.String methodName,
java.lang.String signature)
|
void |
invokeThreadContext(java.lang.String methodName,
java.lang.String signature)
|
void |
invokeUtilityMethod(java.lang.String methodName,
java.lang.String signature)
This is for utility methods used by the compiler, to reduce the amount of code generation necessary. |
void |
isCaptured(int number,
BranchCallback trueBranch,
BranchCallback falseBranch)
|
void |
isClassVarDefined(java.lang.String name,
BranchCallback trueBranch,
BranchCallback falseBranch)
|
void |
isConstantBranch(BranchCallback setup,
java.lang.String name)
|
void |
isConstantDefined(java.lang.String name,
BranchCallback trueBranch,
BranchCallback falseBranch)
|
void |
isGlobalDefined(java.lang.String name,
BranchCallback trueBranch,
BranchCallback falseBranch)
|
void |
isInstanceOf(java.lang.Class clazz,
BranchCallback trueBranch,
BranchCallback falseBranch)
|
void |
isInstanceVariableDefined(java.lang.String name,
BranchCallback trueBranch,
BranchCallback falseBranch)
|
void |
isMethodBound(java.lang.String name,
BranchCallback trueBranch,
BranchCallback falseBranch)
|
void |
isNil(BranchCallback trueBranch,
BranchCallback falseBranch)
|
void |
isNotProtected(java.lang.Object gotoToken,
int toConsume)
|
void |
isNull(BranchCallback trueBranch,
BranchCallback falseBranch)
|
void |
isPrivate(java.lang.Object gotoToken,
int toConsume)
|
void |
issueLoopBreak()
|
void |
issueLoopNext()
|
void |
issueLoopRedo()
|
void |
issueRetryEvent()
|
void |
lineNumber(ISourcePosition position)
This method provides a way to specify a line number for the current piece of code being compiled. |
void |
literal(java.lang.String value)
|
void |
literalSwitch(int[] cases,
java.lang.Object[] bodies,
ArrayCallback arrayCallback,
CompilerCallback defaultCallback)
|
void |
loadBlock()
|
void |
loadClass(java.lang.String name)
|
void |
loadCurrentModule()
|
void |
loadEncoding(org.jcodings.Encoding encoding)
Load the specified encoding. |
void |
loadException()
|
void |
loadFalse()
Load a Ruby "false" value on top of the stack. |
void |
loadFilename()
|
void |
loadNil()
Load a Ruby "nil" value on top of the stack. |
void |
loadNull()
|
void |
loadObject()
Load the Object class |
void |
loadRuntime()
|
void |
loadSelf()
|
void |
loadStandardError()
|
void |
loadThis()
|
void |
loadThreadContext()
|
void |
loadTrue()
Load a Ruby "true" value on top of the stack. |
void |
match()
|
void |
match2(CompilerCallback value)
|
void |
match2Capture(CompilerCallback value,
int[] scopeOffsets)
|
void |
match3()
|
void |
metaclass()
|
void |
negateCurrentValue()
Perform a logical Ruby "not" operation on the value on top of the stack, leaving the negated result. |
void |
notIsModuleAndClassVarDefined(java.lang.String name,
java.lang.Object gotoToken)
|
void |
nthRef(int match)
|
void |
nullToNil()
|
void |
outDefined()
|
abstract BaseBodyCompiler |
outline(java.lang.String methodName)
|
void |
performBackref(char type)
|
void |
performBooleanBranch(BranchCallback trueBranch,
BranchCallback falseBranch)
Perform a boolean branch operation based on the Ruby "true" value of the top value on the stack. |
void |
performBooleanLoop(BranchCallback condition,
BranchCallback body,
boolean checkFirst)
Perform a boolean loop using the given condition-calculating branch and body branch. |
void |
performBooleanLoopLight(BranchCallback condition,
BranchCallback body,
boolean checkFirst)
Perform a boolean loop using the given condition-calculating branch and body branch. |
void |
performBooleanLoopSafe(BranchCallback condition,
BranchCallback body,
boolean checkFirst)
Perform a boolean loop using the given condition-calculating branch and body branch. |
void |
performEnsure(BranchCallback regularCode,
BranchCallback protectedCode)
|
void |
performLogicalAnd(BranchCallback longBranch)
Perform a logical short-circuited Ruby "and" operation, using Ruby notions of true and false. |
void |
performLogicalOr(BranchCallback longBranch)
Perform a logical short-circuited Ruby "or" operation, using Ruby notions of true and false. |
void |
performRescue(BranchCallback regularCode,
BranchCallback rubyCatchCode,
BranchCallback rubyElseCode,
boolean needsRetry)
|
void |
performRescueLight(BranchCallback regularCode,
BranchCallback rubyCatchCode,
BranchCallback rubyElseCode,
boolean needsRetry)
|
void |
pollThreadEvents()
|
void |
preMultiAssign(int head,
boolean args)
|
void |
println()
|
void |
protect(BranchCallback regularCode,
BranchCallback protectedCode,
java.lang.Class ret)
Makes sure that the code in protectedCode will always run after regularCode. |
void |
pushByteList(org.jruby.util.ByteList byteList)
|
void |
pushNull()
|
void |
pushString(java.lang.String str)
|
void |
raiseTypeError(java.lang.String msg)
|
void |
rescue(BranchCallback regularCode,
java.lang.Class exception,
BranchCallback catchCode,
java.lang.Class ret)
|
void |
rethrowException()
|
void |
rethrowIfSystemExit()
|
void |
retrieveClassVariable(java.lang.String name)
|
void |
retrieveConstant(java.lang.String name)
Retrieve the constant with the specified name available at the current point in the program's execution. |
void |
retrieveConstantFromModule(java.lang.String name)
Retreive a named constant from the RubyModule/RubyClass that's just been pushed. |
void |
retrieveConstantFromObject(java.lang.String name)
Retreive a named constant from the RubyModule/RubyClass that's just been pushed. |
void |
retrieveGlobalVariable(java.lang.String name)
Retrieve the global variable with the specified name to the top of the stack. |
void |
retrieveInstanceVariable(java.lang.String name)
Retrieve the instance variable with the given name, based on the current "self". |
void |
retrieveSelf()
Retrieve the current "self" and put a reference on top of the stack. |
void |
retrieveSelfClass()
Retrieve the current "self" object's metaclass and put a reference on top of the stack |
void |
reverseValues(int count)
Reverse the top n values on the stack. |
void |
runBeginBlock(StaticScope scope,
CompilerCallback body)
|
void |
selfIsKindOf(java.lang.Object gotoToken)
|
void |
setEnding(java.lang.Object endingToken)
|
void |
setFilePosition(ISourcePosition position)
|
void |
setLinePosition(ISourcePosition position)
|
protected boolean |
shouldUseBoxedArgs(StaticScope scope)
|
void |
singlifySplattedValue()
Given a splatted value, extract a single value. |
void |
singlifySplattedValue19()
1.9 version of singlifySplattedValue. |
void |
splatCurrentValue(java.lang.String methodName)
Convert the current value into a "splatted value" suitable for passing as method arguments or disassembling into multiple variables. |
void |
storeExceptionInErrorInfo()
|
void |
stringOrNil()
|
void |
superClass()
|
void |
swapValues()
Swap the top and second values on the stack. |
void |
toJavaString()
|
void |
traceClass()
|
void |
traceEnd()
|
void |
traceLine()
|
void |
typeCheckBranch(java.lang.Class type,
BranchCallback trueCallback,
BranchCallback falseCallback)
|
void |
undefMethod(CompilerCallback nameArg)
|
void |
unwrapPassedBlock()
|
void |
unwrapRaiseException()
|
void |
wrapJavaException()
|
void |
wrapJavaObject()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jruby.compiler.BodyCompiler |
|---|
isSimpleRoot, issueBreakEvent, issueNextEvent, issueRedoEvent, performReturn |
| Field Detail |
|---|
protected SkinnyMethodAdapter method
protected VariableCompiler variableCompiler
protected InvocationCompiler invocationCompiler
protected int argParamCount
protected org.objectweb.asm.Label[] currentLoopLabels
protected org.objectweb.asm.Label scopeStart
protected org.objectweb.asm.Label scopeEnd
protected org.objectweb.asm.Label redoJump
protected boolean inNestedMethod
protected StaticScope scope
protected ASTInspector inspector
protected java.lang.String methodName
protected java.lang.String rubyName
protected StandardASMCompiler script
| Constructor Detail |
|---|
public BaseBodyCompiler(StandardASMCompiler scriptCompiler,
java.lang.String methodName,
java.lang.String rubyName,
ASTInspector inspector,
StaticScope scope)
| Method Detail |
|---|
public java.lang.String getNativeMethodName()
getNativeMethodName in interface BodyCompilerpublic java.lang.String getRubyName()
protected boolean shouldUseBoxedArgs(StaticScope scope)
protected int getActualArgsCount(StaticScope scope)
protected abstract java.lang.String getSignature()
protected abstract void createVariableCompiler()
public abstract void beginMethod(CompilerCallback args,
StaticScope scope)
public abstract void endBody()
BodyCompiler
endBody in interface BodyCompilerpublic BodyCompiler chainToMethod(java.lang.String methodName)
chainToMethod in interface BodyCompilerpublic void beginChainedMethod()
public abstract BaseBodyCompiler outline(java.lang.String methodName)
outline in interface BodyCompilerpublic StandardASMCompiler getScriptCompiler()
public void lineNumber(ISourcePosition position)
BodyCompiler
lineNumber in interface BodyCompilerposition - The ISourcePosition information to use.public void loadThreadContext()
public void loadSelf()
loadSelf in interface BodyCompilerprotected int getClosureIndex()
protected int getPreviousExceptionIndex()
protected int getDynamicScopeIndex()
protected int getVarsArrayIndex()
protected int getFirstTempIndex()
protected int getExceptionIndex()
public void loadThis()
public void loadRuntime()
public void loadBlock()
public void loadNil()
BodyCompiler
loadNil in interface BodyCompilerpublic void loadNull()
loadNull in interface BodyCompilerpublic void loadObject()
BodyCompiler
loadObject in interface BodyCompiler
public void invokeUtilityMethod(java.lang.String methodName,
java.lang.String signature)
public void invokeThreadContext(java.lang.String methodName,
java.lang.String signature)
public void invokeRuby(java.lang.String methodName,
java.lang.String signature)
public void invokeIRubyObject(java.lang.String methodName,
java.lang.String signature)
public void consumeCurrentValue()
BodyCompiler
consumeCurrentValue in interface BodyCompilerpublic void duplicateCurrentValue()
BodyCompiler
duplicateCurrentValue in interface BodyCompilerpublic void swapValues()
BodyCompiler
swapValues in interface BodyCompilerpublic void reverseValues(int count)
BodyCompiler
reverseValues in interface BodyCompilercount - The number of values to reverse.public void retrieveSelf()
BodyCompiler
retrieveSelf in interface BodyCompilerpublic void retrieveSelfClass()
BodyCompiler
retrieveSelfClass in interface BodyCompilerpublic VariableCompiler getVariableCompiler()
getVariableCompiler in interface BodyCompilerpublic InvocationCompiler getInvocationCompiler()
getInvocationCompiler in interface BodyCompilerpublic void assignConstantInCurrent(java.lang.String name)
assignConstantInCurrent in interface BodyCompilerpublic void assignConstantInModule(java.lang.String name)
assignConstantInModule in interface BodyCompilerpublic void assignConstantInObject(java.lang.String name)
assignConstantInObject in interface BodyCompilerpublic void retrieveConstant(java.lang.String name)
BodyCompiler
retrieveConstant in interface BodyCompilername - The name of the constantpublic void retrieveConstantFromModule(java.lang.String name)
BodyCompiler
retrieveConstantFromModule in interface BodyCompilername - The name of the constantpublic void retrieveConstantFromObject(java.lang.String name)
BodyCompiler
retrieveConstantFromObject in interface BodyCompilername - The name of the constantpublic void retrieveClassVariable(java.lang.String name)
retrieveClassVariable in interface BodyCompilerpublic void assignClassVariable(java.lang.String name)
assignClassVariable in interface BodyCompiler
public void assignClassVariable(java.lang.String name,
CompilerCallback value)
assignClassVariable in interface BodyCompilerpublic void declareClassVariable(java.lang.String name)
declareClassVariable in interface BodyCompiler
public void declareClassVariable(java.lang.String name,
CompilerCallback value)
declareClassVariable in interface BodyCompilerpublic void createNewFloat(double value)
BodyCompiler
createNewFloat in interface BodyCompilerpublic void createNewFixnum(long value)
BodyCompiler
createNewFixnum in interface BodyCompilerpublic void createNewBignum(java.math.BigInteger value)
BodyCompiler
createNewBignum in interface BodyCompiler
public void createNewString(ArrayCallback callback,
int count)
BodyCompiler
createNewString in interface BodyCompiler
public void createNewSymbol(ArrayCallback callback,
int count)
createNewSymbol in interface BodyCompiler
public void createNewString(org.jruby.util.ByteList value,
int codeRange)
BodyCompiler
createNewString in interface BodyCompilerpublic void createNewSymbol(java.lang.String name)
BodyCompiler
createNewSymbol in interface BodyCompilerpublic void createNewArray(boolean lightweight)
BodyCompiler
createNewArray in interface BodyCompiler
public void createNewArray(java.lang.Object[] sourceArray,
ArrayCallback callback,
boolean lightweight)
BodyCompiler
createNewArray in interface BodyCompilersourceArray - The objects that will be used to construct elementscallback - The callback to which to pass the objectslightweight - Whether the array should be lightweight
public void createNewLiteralArray(java.lang.Object[] sourceArray,
ArrayCallback callback,
boolean lightweight)
BodyCompiler
createNewLiteralArray in interface BodyCompilersourceArray - The objects that will be used to construct elementscallback - The callback to which to pass the objectslightweight - Whether the array should be lightweightpublic void createEmptyArray()
BodyCompiler
createEmptyArray in interface BodyCompiler
public void createObjectArray(java.lang.Object[] sourceArray,
ArrayCallback callback)
createObjectArray in interface BodyCompilerpublic void createObjectArray(int elementCount)
BodyCompilerelementCountelements into a single element, generally an array or similar construct. The specified number of elements are consumed and an aggregate element remains.
createObjectArray in interface BodyCompilerelementCount - The number of elements to consumepublic void createEmptyHash()
BodyCompiler
createEmptyHash in interface BodyCompiler
public void createNewHash(java.lang.Object elements,
ArrayCallback callback,
int keyCount)
BodyCompiler
createNewHash in interface BodyCompilerelements - An object holding the elements from which to create the Hash.callback - An ArrayCallback implementation to which the elements array and iteration counts
are passed in sequence.keyCount - the total count of key-value pairs to be constructed from the elements collection.
public void createNewLiteralHash(java.lang.Object elements,
ArrayCallback callback,
int keyCount)
BodyCompiler
createNewLiteralHash in interface BodyCompilerelements - An object holding the elements from which to create the Hash.callback - An ArrayCallback implementation to which the elements array and iteration counts
are passed in sequence.keyCount - the total count of key-value pairs to be constructed from the elements collection.
public void createNewHash19(java.lang.Object elements,
ArrayCallback callback,
int keyCount)
createNewHash19 in interface BodyCompilerCreate new hash running in ruby 1.9 compat version.
public void createNewRange(CompilerCallback beginEndCallback,
boolean isExclusive)
BodyCompiler
createNewRange in interface BodyCompilerisExclusive - Whether the range is exclusive or not (inclusive)public void createNewLambda(CompilerCallback closure)
BodyCompiler
createNewLambda in interface BodyCompiler
public void performBooleanBranch(BranchCallback trueBranch,
BranchCallback falseBranch)
BodyCompiler
performBooleanBranch in interface BodyCompilertrueBranch - The callback for generating code for the "true" conditionfalseBranch - The callback for generating code for the "false" conditionpublic void performLogicalAnd(BranchCallback longBranch)
BodyCompiler
performLogicalAnd in interface BodyCompilerlongBranch - The branch to execute if the "and" operation does not short-circuit.public void performLogicalOr(BranchCallback longBranch)
BodyCompiler
performLogicalOr in interface BodyCompilerlongBranch - The branch to execute if the "or" operation does not short-circuit.
public void performBooleanLoopSafe(BranchCallback condition,
BranchCallback body,
boolean checkFirst)
BodyCompiler
performBooleanLoopSafe in interface BodyCompilercondition - The code to execute for calculating the loop condition. A Ruby true result will
cause the body to be executed again.body - The body to executed for the loop.checkFirst - whether to check the condition the first time through or not.
public void performBooleanLoop(BranchCallback condition,
BranchCallback body,
boolean checkFirst)
BodyCompiler
performBooleanLoop in interface BodyCompilercondition - The code to execute for calculating the loop condition. A Ruby true result will
cause the body to be executed again.body - The body to executed for the loop.checkFirst - whether to check the condition the first time through or not.
public void performBooleanLoopLight(BranchCallback condition,
BranchCallback body,
boolean checkFirst)
BodyCompiler
performBooleanLoopLight in interface BodyCompilercondition - The code to execute for calculating the loop condition. A Ruby true result will
cause the body to be executed again.body - The body to executed for the loop.checkFirst - whether to check the condition the first time through or not.
public void createNewClosure(java.lang.String file,
int line,
StaticScope scope,
int arity,
CompilerCallback body,
CompilerCallback args,
boolean hasMultipleArgsHead,
NodeType argsNodeId,
ASTInspector inspector)
BodyCompiler
createNewClosure in interface BodyCompiler
public void createNewClosure19(java.lang.String file,
int line,
StaticScope scope,
int arity,
CompilerCallback body,
CompilerCallback args,
boolean hasMultipleArgsHead,
NodeType argsNodeId,
java.lang.String parameterList,
ASTInspector inspector)
BodyCompiler
createNewClosure19 in interface BodyCompiler
public void runBeginBlock(StaticScope scope,
CompilerCallback body)
runBeginBlock in interface BodyCompiler
public void createNewForLoop(int arity,
CompilerCallback body,
CompilerCallback args,
boolean hasMultipleArgsHead,
NodeType argsNodeId,
ASTInspector inspector)
BodyCompiler
createNewForLoop in interface BodyCompilerpublic void createNewEndBlock(CompilerCallback body)
createNewEndBlock in interface BodyCompilerpublic void getCompiledClass()
public void println()
public void defineAlias(CompilerCallback args)
BodyCompiler
defineAlias in interface BodyCompilerpublic void literal(java.lang.String value)
literal in interface BodyCompilerpublic void loadFalse()
BodyCompiler
loadFalse in interface BodyCompilerpublic void loadTrue()
BodyCompiler
loadTrue in interface BodyCompilerpublic void loadCurrentModule()
loadCurrentModule in interface BodyCompilerpublic void retrieveInstanceVariable(java.lang.String name)
BodyCompiler
retrieveInstanceVariable in interface BodyCompilername - The name of the instance variable to retrieve.public void assignInstanceVariable(java.lang.String name)
BodyCompiler
assignInstanceVariable in interface BodyCompilername - The name of the value to assign.
public void assignInstanceVariable(java.lang.String name,
CompilerCallback value)
BodyCompiler
assignInstanceVariable in interface BodyCompilername - The name of the value to assign.value - A callback for compiling the value to assignpublic void retrieveGlobalVariable(java.lang.String name)
BodyCompiler
retrieveGlobalVariable in interface BodyCompilername - The name of the global variable.public void assignGlobalVariable(java.lang.String name)
BodyCompiler
assignGlobalVariable in interface BodyCompilername - The name of the global variable.
public void assignGlobalVariable(java.lang.String name,
CompilerCallback value)
BodyCompiler
assignGlobalVariable in interface BodyCompilername - The name of the global variable.value - The callback to compile the value to assignpublic void negateCurrentValue()
BodyCompiler
negateCurrentValue in interface BodyCompilerpublic void splatCurrentValue(java.lang.String methodName)
BodyCompiler
splatCurrentValue in interface BodyCompilerpublic void singlifySplattedValue()
BodyCompiler
singlifySplattedValue in interface BodyCompilerpublic void singlifySplattedValue19()
BodyCompiler
singlifySplattedValue19 in interface BodyCompilerpublic void aryToAry()
aryToAry in interface BodyCompilerpublic void ensureRubyArray()
BodyCompiler
ensureRubyArray in interface BodyCompilerpublic void ensureMultipleAssignableRubyArray(boolean masgnHasHead)
BodyCompiler
ensureMultipleAssignableRubyArray in interface BodyCompiler
public void forEachInValueArray(int start,
int count,
java.lang.Object source,
ArrayCallback callback,
CompilerCallback argsCallback)
BodyCompiler
forEachInValueArray in interface BodyCompiler
public void forEachInValueArray(int start,
int preCount,
java.lang.Object preSource,
int postCount,
java.lang.Object postSource,
ArrayCallback callback,
CompilerCallback argsCallback)
BodyCompiler
forEachInValueArray in interface BodyCompilerpublic void asString()
asString in interface BodyCompilerpublic void toJavaString()
toJavaString in interface BodyCompilerpublic void nthRef(int match)
nthRef in interface BodyCompilerpublic void match()
match in interface BodyCompilerpublic void match2(CompilerCallback value)
match2 in interface BodyCompiler
public void match2Capture(CompilerCallback value,
int[] scopeOffsets)
match2Capture in interface BodyCompilerpublic void match3()
match3 in interface BodyCompiler
public void createNewRegexp(org.jruby.util.ByteList value,
int options)
createNewRegexp in interface BodyCompiler
public void createNewRegexp(CompilerCallback createStringCallback,
int options)
createNewRegexp in interface BodyCompilerpublic void pollThreadEvents()
pollThreadEvents in interface BodyCompilerpublic void nullToNil()
nullToNil in interface BodyCompiler
public void isInstanceOf(java.lang.Class clazz,
BranchCallback trueBranch,
BranchCallback falseBranch)
isInstanceOf in interface BodyCompiler
public void isCaptured(int number,
BranchCallback trueBranch,
BranchCallback falseBranch)
isCaptured in interface BodyCompilerpublic void backref()
BodyCompiler
backref in interface BodyCompilerpublic void backrefMethod(java.lang.String methodName)
BodyCompiler
backrefMethod in interface BodyCompilerpublic void issueLoopBreak()
public void issueLoopNext()
public void issueLoopRedo()
protected java.lang.String getNewEnsureName()
public void protect(BranchCallback regularCode,
BranchCallback protectedCode,
java.lang.Class ret)
BodyCompiler
protect in interface BodyCompiler
public void performEnsure(BranchCallback regularCode,
BranchCallback protectedCode)
performEnsure in interface BodyCompilerprotected java.lang.String getNewRescueName()
public void storeExceptionInErrorInfo()
storeExceptionInErrorInfo in interface BodyCompilerpublic void clearErrorInfo()
clearErrorInfo in interface BodyCompiler
public void rescue(BranchCallback regularCode,
java.lang.Class exception,
BranchCallback catchCode,
java.lang.Class ret)
rescue in interface BodyCompiler
public void performRescue(BranchCallback regularCode,
BranchCallback rubyCatchCode,
BranchCallback rubyElseCode,
boolean needsRetry)
performRescue in interface BodyCompiler
public void performRescueLight(BranchCallback regularCode,
BranchCallback rubyCatchCode,
BranchCallback rubyElseCode,
boolean needsRetry)
performRescueLight in interface BodyCompilerpublic void wrapJavaException()
wrapJavaException in interface BodyCompilerpublic void wrapJavaObject()
public void inDefined()
inDefined in interface BodyCompilerpublic void outDefined()
outDefined in interface BodyCompilerpublic void stringOrNil()
stringOrNil in interface BodyCompilerpublic void pushNull()
pushNull in interface BodyCompilerpublic void pushString(java.lang.String str)
pushString in interface BodyCompilerpublic void pushByteList(org.jruby.util.ByteList byteList)
pushByteList in interface BodyCompiler
public void isMethodBound(java.lang.String name,
BranchCallback trueBranch,
BranchCallback falseBranch)
isMethodBound in interface BodyCompiler
public void hasBlock(BranchCallback trueBranch,
BranchCallback falseBranch)
hasBlock in interface BodyCompiler
public void isGlobalDefined(java.lang.String name,
BranchCallback trueBranch,
BranchCallback falseBranch)
isGlobalDefined in interface BodyCompiler
public void isConstantDefined(java.lang.String name,
BranchCallback trueBranch,
BranchCallback falseBranch)
isConstantDefined in interface BodyCompiler
public void isInstanceVariableDefined(java.lang.String name,
BranchCallback trueBranch,
BranchCallback falseBranch)
isInstanceVariableDefined in interface BodyCompiler
public void isClassVarDefined(java.lang.String name,
BranchCallback trueBranch,
BranchCallback falseBranch)
isClassVarDefined in interface BodyCompilerpublic java.lang.Object getNewEnding()
getNewEnding in interface BodyCompiler
public void isNil(BranchCallback trueBranch,
BranchCallback falseBranch)
isNil in interface BodyCompiler
public void isNull(BranchCallback trueBranch,
BranchCallback falseBranch)
isNull in interface BodyCompilerpublic void ifNull(java.lang.Object gotoToken)
ifNull in interface BodyCompilerpublic void ifNotNull(java.lang.Object gotoToken)
ifNotNull in interface BodyCompilerpublic void setEnding(java.lang.Object endingToken)
setEnding in interface BodyCompilerpublic void go(java.lang.Object gotoToken)
go in interface BodyCompiler
public void isConstantBranch(BranchCallback setup,
java.lang.String name)
isConstantBranch in interface BodyCompilerpublic void metaclass()
metaclass in interface BodyCompilerpublic void aprintln()
BodyCompiler
aprintln in interface BodyCompilerpublic void getVisibilityFor(java.lang.String name)
getVisibilityFor in interface BodyCompiler
public void isPrivate(java.lang.Object gotoToken,
int toConsume)
isPrivate in interface BodyCompiler
public void isNotProtected(java.lang.Object gotoToken,
int toConsume)
isNotProtected in interface BodyCompilerpublic void selfIsKindOf(java.lang.Object gotoToken)
selfIsKindOf in interface BodyCompiler
public void notIsModuleAndClassVarDefined(java.lang.String name,
java.lang.Object gotoToken)
notIsModuleAndClassVarDefined in interface BodyCompilerpublic void ifSingleton(java.lang.Object gotoToken)
ifSingleton in interface BodyCompilerpublic void getInstanceVariable(java.lang.String name)
getInstanceVariable in interface BodyCompilerpublic void getFrameName()
getFrameName in interface BodyCompilerpublic void getFrameKlazz()
getFrameKlazz in interface BodyCompilerpublic void superClass()
superClass in interface BodyCompilerpublic void attached()
attached in interface BodyCompilerpublic void ifNotSuperMethodBound(java.lang.Object token)
ifNotSuperMethodBound in interface BodyCompilerpublic void concatArrays()
concatArrays in interface BodyCompilerpublic void concatObjectArrays()
public void appendToArray()
appendToArray in interface BodyCompilerpublic void appendToObjectArray()
appendToObjectArray in interface BodyCompilerpublic void convertToJavaArray()
convertToJavaArray in interface BodyCompiler
public void aliasGlobal(java.lang.String newName,
java.lang.String oldName)
aliasGlobal in interface BodyCompilerpublic void raiseTypeError(java.lang.String msg)
raiseTypeError in interface BodyCompilerpublic void undefMethod(CompilerCallback nameArg)
undefMethod in interface BodyCompiler
public void defineClass(java.lang.String name,
StaticScope staticScope,
CompilerCallback superCallback,
CompilerCallback pathCallback,
CompilerCallback bodyCallback,
CompilerCallback receiverCallback,
ASTInspector inspector)
defineClass in interface BodyCompiler
public void defineModule(java.lang.String name,
StaticScope staticScope,
CompilerCallback pathCallback,
CompilerCallback bodyCallback,
ASTInspector inspector)
defineModule in interface BodyCompilerpublic void unwrapPassedBlock()
unwrapPassedBlock in interface BodyCompilerpublic void performBackref(char type)
performBackref in interface BodyCompilerpublic void callZSuper(CompilerCallback closure)
callZSuper in interface BodyCompilerpublic void checkIsExceptionHandled(ArgumentsCallback rescueArgs)
checkIsExceptionHandled in interface BodyCompilerpublic void rethrowException()
rethrowException in interface BodyCompilerpublic void loadClass(java.lang.String name)
loadClass in interface BodyCompilerpublic void loadStandardError()
loadStandardError in interface BodyCompilerpublic void unwrapRaiseException()
unwrapRaiseException in interface BodyCompilerpublic void loadException()
loadException in interface BodyCompilerpublic void setFilePosition(ISourcePosition position)
setFilePosition in interface BodyCompilerpublic void setLinePosition(ISourcePosition position)
setLinePosition in interface BodyCompilerpublic void checkWhenWithSplat()
checkWhenWithSplat in interface BodyCompilerpublic void issueRetryEvent()
issueRetryEvent in interface BodyCompiler
public void defineNewMethod(java.lang.String name,
int methodArity,
StaticScope scope,
CompilerCallback body,
CompilerCallback args,
CompilerCallback receiver,
ASTInspector inspector,
boolean root,
java.lang.String filename,
int line,
java.lang.String parameterDesc)
BodyCompiler
defineNewMethod in interface BodyCompilerpublic void rethrowIfSystemExit()
rethrowIfSystemExit in interface BodyCompiler
public void literalSwitch(int[] cases,
java.lang.Object[] bodies,
ArrayCallback arrayCallback,
CompilerCallback defaultCallback)
literalSwitch in interface BodyCompiler
public void typeCheckBranch(java.lang.Class type,
BranchCallback trueCallback,
BranchCallback falseCallback)
typeCheckBranch in interface BodyCompilerpublic void loadFilename()
loadFilename in interface BodyCompiler
public void compileSequencedConditional(CompilerCallback inputValue,
FastSwitchType fastSwitchType,
java.util.Map<CompilerCallback,int[]> switchCases,
java.util.List<ArgumentsCallback> conditionals,
java.util.List<CompilerCallback> bodies,
CompilerCallback fallback)
compileSequencedConditional in interface BodyCompilerpublic void traceLine()
traceLine in interface BodyCompilerpublic void traceClass()
traceClass in interface BodyCompilerpublic void traceEnd()
traceEnd in interface BodyCompiler
public void preMultiAssign(int head,
boolean args)
preMultiAssign in interface BodyCompilerpublic void argsPush()
BodyCompiler
argsPush in interface BodyCompilerpublic void argsCat()
BodyCompiler
argsCat in interface BodyCompilerpublic void loadEncoding(org.jcodings.Encoding encoding)
BodyCompiler
loadEncoding in interface BodyCompilerpublic void definedCall(java.lang.String name)
BodyCompiler
definedCall in interface BodyCompilerpublic void definedNot()
BodyCompiler
definedNot in interface BodyCompiler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||