public abstract class IRBytecodeAdapter
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
IRBytecodeAdapter.BlockPassType |
Modifier and Type | Field and Description |
---|---|
SkinnyMethodAdapter |
adapter |
int |
ipc |
static int |
MAX_ARGUMENTS |
protected com.headius.invokebinder.Signature |
signature |
Constructor and Description |
---|
IRBytecodeAdapter(SkinnyMethodAdapter adapter,
com.headius.invokebinder.Signature signature,
org.jruby.ir.targets.ClassData classData) |
Modifier and Type | Method and Description |
---|---|
abstract void |
array(int length)
Construct an Array from elements on stack.
|
void |
bfalse(org.objectweb.asm.Label label) |
void |
branchIfNil(org.objectweb.asm.Label label)
Branch to label if value at top of stack is nil
stack: obj to check for nilness
|
void |
branchIfTruthy(org.objectweb.asm.Label target) |
void |
btrue(org.objectweb.asm.Label label) |
static void |
cacheCallSite(SkinnyMethodAdapter method,
java.lang.String className,
java.lang.String siteName,
java.lang.String scopeFieldName,
CallBase call)
Utility to lazily construct and cache a call site object.
|
abstract void |
callEqq(EQQInstr call)
Perform a === call appropriate for a case/when statement.
|
abstract void |
checkpoint()
Perform a thread event checkpoint.
|
void |
endMethod() |
org.jruby.ir.targets.ClassData |
getClassData() |
abstract void |
getField(java.lang.String name)
Load instance variable from self.
|
abstract void |
getGlobalVariable(java.lang.String name,
java.lang.String file,
int line)
Retrieve a global variable with the given name.
|
java.lang.String |
getUniqueSiteName(java.lang.String name) |
void |
goTo(org.objectweb.asm.Label label) |
abstract void |
hash(int length)
Construct a Hash from elements on stack.
|
abstract void |
inheritanceSearchConst(java.lang.String name,
boolean noPrivateConsts)
Lookup a constant from a given class or module.
|
abstract void |
invokeArrayDeref(java.lang.String file,
int line,
CallBase call)
Invoke the array dereferencing method ([]) on an object other than self.
|
abstract void |
invokeClassSuper(java.lang.String file,
int line,
java.lang.String name,
int arity,
boolean hasClosure,
boolean[] splatmap)
Invoke a superclass method from a class context.
|
void |
invokeHelper(java.lang.String name,
java.lang.Class... x) |
void |
invokeHelper(java.lang.String name,
java.lang.String sig) |
abstract void |
invokeInstanceSuper(java.lang.String file,
int line,
java.lang.String name,
int arity,
boolean hasClosure,
boolean[] splatmap)
Invoke a superclass method from an instance context.
|
void |
invokeIRHelper(java.lang.String name,
java.lang.String sig) |
abstract void |
invokeOther(java.lang.String file,
int line,
java.lang.String scopeFieldName,
CallBase call,
int arity)
Invoke a method on an object other than self.
|
abstract void |
invokeOtherOneFixnum(java.lang.String file,
int line,
CallBase call,
long fixnum)
Invoke a fixnum-receiving method on an object other than self.
|
abstract void |
invokeOtherOneFloat(java.lang.String file,
int line,
CallBase call,
double flote)
Invoke a float-receiving method on an object other than self.
|
abstract void |
invokeSelf(java.lang.String file,
int line,
java.lang.String scopeFieldName,
CallBase call,
int arity)
Invoke a method on self.
|
void |
invokeStatic(org.objectweb.asm.Type type,
org.objectweb.asm.commons.Method method) |
abstract void |
invokeUnresolvedSuper(java.lang.String file,
int line,
java.lang.String name,
int arity,
boolean hasClosure,
boolean[] splatmap)
Invoke a superclass method from an unresolved context.
|
void |
invokeVirtual(org.objectweb.asm.Type type,
org.objectweb.asm.commons.Method method) |
abstract void |
invokeZSuper(java.lang.String file,
int line,
java.lang.String name,
int arity,
boolean hasClosure,
boolean[] splatmap)
Invoke a superclass method from a zsuper in a block.
|
abstract void |
kwargsHash(int length)
Construct a Hash based on keyword arguments pasesd to this method, for use in zsuper
Stack required: context, kwargs hash to dup, remaining elements of hash
|
abstract void |
lexicalSearchConst(java.lang.String name)
Lookup a constant from a lexical scope.
|
void |
loadArgs() |
void |
loadBlock() |
void |
loadContext() |
void |
loadFrameClass() |
void |
loadFrameName() |
void |
loadLocal(int i) |
abstract void |
loadRuntime()
Push the JRuby runtime on the stack.
|
void |
loadSelf() |
void |
loadSelfBlock() |
void |
loadStaticScope() |
void |
mark(org.objectweb.asm.Label label) |
org.objectweb.asm.Label |
newLabel() |
int |
newLocal(java.lang.String name,
org.objectweb.asm.Type type) |
void |
poll() |
abstract void |
prepareBlock(org.objectweb.asm.Handle handle,
Signature signature,
java.lang.String className)
Prepare a block for a subsequent call.
|
abstract void |
pushBignum(java.math.BigInteger bigint)
Load a Bignum onto the stack.
|
abstract void |
pushBoolean(boolean b)
Load a boolean onto the stack.
|
abstract void |
pushByteList(ByteList bl)
Stack required: none
|
abstract void |
pushDRegexp(java.lang.Runnable callback,
RegexpOptions options,
int arity)
Build a dynamic regexp.
|
abstract void |
pushEncoding(org.jcodings.Encoding encoding)
Push an encoding on the stack.
|
abstract void |
pushFixnum(long l)
Stack required: none
|
abstract void |
pushFloat(double d)
Stack required: none
|
abstract void |
pushFrozenString(ByteList bl,
int cr,
java.lang.String path,
int line)
Stack required: none
|
void |
pushHandle(org.objectweb.asm.Handle handle) |
abstract void |
pushNil()
Load nil onto the stack.
|
void |
pushObjectClass() |
abstract void |
pushRegexp(ByteList source,
int options)
Build and save a literal regular expression.
|
abstract void |
pushString(ByteList bl,
int cr)
Stack required: none
|
abstract void |
pushSymbol(ByteList bytes)
Push a symbol on the stack.
|
abstract void |
pushSymbolProc(java.lang.String id)
Push a Symbol.to_proc on the stack.
|
void |
pushUndefined() |
abstract void |
putField(java.lang.String name)
Store instance variable into self.
|
void |
returnValue() |
abstract void |
searchConst(java.lang.String name,
boolean noPrivateConsts)
Lookup a constant from current context.
|
abstract void |
searchModuleForConst(java.lang.String name,
boolean noPrivateConsts,
boolean callConstMissing)
Lookup a constant from current module.
|
abstract void |
setGlobalVariable(java.lang.String name,
java.lang.String file,
int line)
Set the global variable with the given name to the value on stack.
|
void |
startMethod() |
void |
storeArgs() |
void |
storeLocal(int i) |
void |
storeSelf() |
abstract void |
yield(boolean unwrap)
Yield argument list to a block.
|
abstract void |
yieldSpecific()
Yield to a block.
|
abstract void |
yieldValues(int arity)
Yield a number of flat arguments to a block.
|
public static final int MAX_ARGUMENTS
public SkinnyMethodAdapter adapter
protected final com.headius.invokebinder.Signature signature
public int ipc
public IRBytecodeAdapter(SkinnyMethodAdapter adapter, com.headius.invokebinder.Signature signature, org.jruby.ir.targets.ClassData classData)
public static void cacheCallSite(SkinnyMethodAdapter method, java.lang.String className, java.lang.String siteName, java.lang.String scopeFieldName, CallBase call)
method
- the SkinnyMethodAdapter to that's generating the containing method bodyclassName
- the name of the class in which the field will residesiteName
- the unique name of the site, used for the fieldcall
- of we are making a callsite for.public java.lang.String getUniqueSiteName(java.lang.String name)
public org.jruby.ir.targets.ClassData getClassData()
public void startMethod()
public void endMethod()
public void loadLocal(int i)
public void loadContext()
public void loadSelfBlock()
public void loadStaticScope()
public void loadSelf()
public void loadArgs()
public void loadBlock()
public void loadFrameClass()
public void loadFrameName()
public void storeSelf()
public void storeArgs()
public void storeLocal(int i)
public void invokeVirtual(org.objectweb.asm.Type type, org.objectweb.asm.commons.Method method)
public void invokeStatic(org.objectweb.asm.Type type, org.objectweb.asm.commons.Method method)
public void invokeHelper(java.lang.String name, java.lang.String sig)
public void invokeHelper(java.lang.String name, java.lang.Class... x)
public void invokeIRHelper(java.lang.String name, java.lang.String sig)
public void goTo(org.objectweb.asm.Label label)
public void branchIfTruthy(org.objectweb.asm.Label target)
public void branchIfNil(org.objectweb.asm.Label label)
public void bfalse(org.objectweb.asm.Label label)
public void btrue(org.objectweb.asm.Label label)
public void poll()
public void pushObjectClass()
public void pushUndefined()
public void pushHandle(org.objectweb.asm.Handle handle)
public void mark(org.objectweb.asm.Label label)
public void returnValue()
public int newLocal(java.lang.String name, org.objectweb.asm.Type type)
public org.objectweb.asm.Label newLabel()
public abstract void pushFixnum(long l)
l
- long value to push as a Fixnumpublic abstract void pushFloat(double d)
d
- double value to push as a Floatpublic abstract void pushString(ByteList bl, int cr)
bl
- ByteList for the String to pushpublic abstract void pushFrozenString(ByteList bl, int cr, java.lang.String path, int line)
bl
- ByteList for the String to pushpublic abstract void pushByteList(ByteList bl)
bl
- ByteList to pushpublic abstract void pushRegexp(ByteList source, int options)
options
- options for the regexppublic abstract void pushDRegexp(java.lang.Runnable callback, RegexpOptions options, int arity)
options
- options for the regexparity
- number of Strings passed inpublic abstract void pushSymbol(ByteList bytes)
bytes
- the ByteList for the symbolpublic abstract void pushSymbolProc(java.lang.String id)
id
- raw id string for the symbol.public abstract void loadRuntime()
public abstract void pushEncoding(org.jcodings.Encoding encoding)
encoding
- the encoding to pushpublic abstract void invokeOther(java.lang.String file, int line, java.lang.String scopeFieldName, CallBase call, int arity)
call
- the call to be invokedpublic abstract void invokeArrayDeref(java.lang.String file, int line, CallBase call)
file
- line
- public abstract void invokeOtherOneFixnum(java.lang.String file, int line, CallBase call, long fixnum)
public abstract void invokeOtherOneFloat(java.lang.String file, int line, CallBase call, double flote)
public abstract void invokeSelf(java.lang.String file, int line, java.lang.String scopeFieldName, CallBase call, int arity)
file
- the filename of the script making this callline
- the line number where this call appearscall
- to be invoked on selfarity
- of the call.public abstract void invokeInstanceSuper(java.lang.String file, int line, java.lang.String name, int arity, boolean hasClosure, boolean[] splatmap)
file
- the filename of the script making this callline
- the line number where this call appearsname
- name of the method to invokearity
- arity of the arguments on the stackhasClosure
- whether a block is passedsplatmap
- a map of arguments to be splatted back into arg listpublic abstract void invokeClassSuper(java.lang.String file, int line, java.lang.String name, int arity, boolean hasClosure, boolean[] splatmap)
file
- the filename of the script making this callline
- the line number where this call appearsname
- name of the method to invokearity
- arity of the arguments on the stackhasClosure
- whether a block is passedsplatmap
- a map of arguments to be splatted back into arg listpublic abstract void invokeUnresolvedSuper(java.lang.String file, int line, java.lang.String name, int arity, boolean hasClosure, boolean[] splatmap)
file
- the filename of the script making this callline
- the line number where this call appearsname
- name of the method to invokearity
- arity of the arguments on the stackhasClosure
- whether a block is passedsplatmap
- a map of arguments to be splatted back into arg listpublic abstract void invokeZSuper(java.lang.String file, int line, java.lang.String name, int arity, boolean hasClosure, boolean[] splatmap)
file
- the filename of the script making this callline
- the line number where this call appearsname
- name of the method to invokearity
- arity of the arguments on the stackhasClosure
- whether a block is passedsplatmap
- a map of arguments to be splatted back into arg listpublic abstract void searchConst(java.lang.String name, boolean noPrivateConsts)
name
- name of the constantnoPrivateConsts
- whether to ignore private constantspublic abstract void searchModuleForConst(java.lang.String name, boolean noPrivateConsts, boolean callConstMissing)
name
- name of the constantnoPrivateConsts
- whether to ignore private constantspublic abstract void inheritanceSearchConst(java.lang.String name, boolean noPrivateConsts)
name
- name of the constantnoPrivateConsts
- whether to ignore private constantspublic abstract void lexicalSearchConst(java.lang.String name)
name
- name of the constantpublic abstract void pushNil()
public abstract void pushBoolean(boolean b)
b
- the boolean to pushpublic abstract void pushBignum(java.math.BigInteger bigint)
bigint
- the value of the Bignum to pushpublic abstract void putField(java.lang.String name)
name
- name of variable to storepublic abstract void getField(java.lang.String name)
name
- name of variable to loadpublic abstract void array(int length)
length
- number of elementspublic abstract void hash(int length)
length
- number of element pairspublic abstract void kwargsHash(int length)
length
- number of element pairspublic abstract void checkpoint()
public abstract void getGlobalVariable(java.lang.String name, java.lang.String file, int line)
public abstract void setGlobalVariable(java.lang.String name, java.lang.String file, int line)
public abstract void yield(boolean unwrap)
public abstract void yieldSpecific()
public abstract void yieldValues(int arity)
public abstract void prepareBlock(org.objectweb.asm.Handle handle, Signature signature, java.lang.String className)
public abstract void callEqq(EQQInstr call)
Copyright © 2001-2018 JRuby. All Rights Reserved.