Modifier and Type | Class and Description |
---|---|
pack-priv static class | InvokerBytecodeGenerator.
The BytecodeGenerationException. |
pack-priv static class |
Modifier and Type | Field and Description |
---|---|
private static final String | |
private final List | |
private final String | |
private static final String | |
private ClassWriter | cw
ASM bytecode generation. |
pack-priv static final String | |
private static final HashMap | DUMP_CLASS_FILES_COUNTERS
instance counters for dumped classes |
pack-priv static final String | |
pack-priv static final String | |
private static final Class | |
pack-priv static final String | |
pack-priv static final String | INVOKER_SUPER_NAME
Name of its super class |
private final String | |
private final MethodType | |
private final LambdaForm | |
private Class | lastClass
Single element internal class name lookup cache. |
private String | |
private static final String | |
pack-priv static final String | |
private static final String | |
private static final String | |
private static final String | |
private static final String | |
private static final String | |
private Class | |
private int[] | localsMap
Info about local variables in compiled lambda form |
private static final MethodHandles. | |
private static final String | |
private static final MemberName. | |
private static final String | MH
Define class names for convenience. |
private static final String | |
private static final String | |
private static final String | |
private MethodVisitor | |
private final String | name
Name of new class |
private static final String | |
private static final String | |
private static final String | |
private static final Class |
Access | Constructor and Description |
---|---|
private | InvokerBytecodeGenerator(LambdaForm lambdaForm, int localsMapSize, String name, String invokerName, MethodType invokerType)
Main constructor; other constructors delegate to this one. |
private | InvokerBytecodeGenerator(String name, String invokerName, MethodType invokerType)
For generating LambdaForm interpreter entry points. |
private | InvokerBytecodeGenerator(String name, LambdaForm form, MethodType invokerType)
For generating customized code for a single LambdaForm. |
pack-priv | InvokerBytecodeGenerator(String name, String invokerName, LambdaForm form, MethodType invokerType)
For generating customized code for a single LambdaForm. |
Modifier and Type | Method and Description |
---|---|
pack-priv void | |
private int | |
private byte | |
private boolean | |
private void | |
private boolean | |
pack-priv static boolean | |
pack-priv String | |
private Object | classDataValues()
Returns the class data object that will be passed to `Lookup.defineHiddenClassWithClassData`. |
private ClassWriter | |
pack-priv static String | |
pack-priv static void | |
private static String | |
private void | |
pack-priv void | |
pack-priv void | |
pack-priv void | |
pack-priv void | |
private void | |
private void | |
private void | |
private LambdaForm. | |
private void | |
private void | |
private static void | |
private void | emitImplicitConversion(LambdaForm.
type of value present on stack ptype,type of value required on stack pclass, Object compile-time representation of value on stack (Node, constant) or null if none arg)Emit an implicit conversion for an argument which must be of the given pclass. |
pack-priv void | |
private void | |
private LambdaForm. | |
private void | emitLoopHandleInvoke(LambdaForm.
|
private void | |
private void | |
private void | |
private void | |
private void | |
private void | |
private void | |
private void | |
private void | emitReturnInsn(LambdaForm.
Emits an actual return instruction conforming to the given return type. |
private LambdaForm. | emitSelectAlternative(LambdaForm.
Emit bytecode for the selectAlternative idiom. |
pack-priv void | |
pack-priv void | emitStaticInvoke(MemberName member, LambdaForm.
Emit an invoke for the given name, using the MemberName directly. |
private void | |
private void | |
private LambdaForm. | |
private LambdaForm. | |
private void | emitUnboxing(Wrapper
wrapper type class to unbox. wrapper)Emit an unboxing call (plus preceding checkcast). |
private void | |
private void | |
private int | |
pack-priv static MemberName | generateCustomizedCode(LambdaForm form, MethodType invokerType)
Generate customized bytecode for a given LambdaForm. |
private byte[] | |
pack-priv static MemberName | generateLambdaFormInterpreterEntryPoint(MethodType mt)
Generate bytecode for a LambdaForm.vmentry which calls interpretWithArguments. |
private byte[] | |
pack-priv static MemberName | |
private byte[] | |
private String | |
pack-priv static boolean | |
pack-priv static boolean | |
pack-priv static boolean | |
private static boolean | |
pack-priv static boolean | |
private int | |
private MemberName | |
private static MethodHandles. | |
private static MemberName | |
private static String | |
private void | |
private void | |
private static int | |
pack-priv int | |
private static MemberName | |
private static MemberName | |
pack-priv void | |
private int | |
private byte[] |
CLASS_PREFIX | back to summary |
---|---|
private static final String CLASS_PREFIX |
classData | back to summary |
---|---|
private final List<InvokerBytecodeGenerator. |
className | back to summary |
---|---|
private final String className |
CLS | back to summary |
---|---|
private static final String CLS |
cw | back to summary |
---|---|
private ClassWriter cw ASM bytecode generation. |
DONTINLINE_SIG | back to summary |
---|---|
pack-priv static final String DONTINLINE_SIG |
DUMP_CLASS_FILES_COUNTERS | back to summary |
---|---|
private static final HashMap<String, Integer> DUMP_CLASS_FILES_COUNTERS instance counters for dumped classes |
FORCEINLINE_SIG | back to summary |
---|---|
pack-priv static final String FORCEINLINE_SIG |
HIDDEN_SIG | back to summary |
---|---|
pack-priv static final String HIDDEN_SIG |
HOST_CLASS | back to summary |
---|---|
private static final Class<?> HOST_CLASS |
INJECTEDPROFILE_SIG | back to summary |
---|---|
pack-priv static final String INJECTEDPROFILE_SIG |
INVOKER_SUPER_NAME | back to summary |
---|---|
pack-priv static final String INVOKER_SUPER_NAME Name of its super class |
invokerName | back to summary |
---|---|
private final String invokerName |
invokerType | back to summary |
---|---|
private final MethodType invokerType |
lambdaForm | back to summary |
---|---|
private final LambdaForm lambdaForm |
lastClass | back to summary |
---|---|
private Class<?> lastClass Single element internal class name lookup cache. |
lastInternalName | back to summary |
---|---|
private String lastInternalName |
LF | back to summary |
---|---|
private static final String LF |
LF_COMPILED_SIG | back to summary |
---|---|
pack-priv static final String LF_COMPILED_SIG |
LF_SIG | back to summary |
---|---|
private static final String LF_SIG |
LFN | back to summary |
---|---|
private static final String LFN |
LFN_SIG | back to summary |
---|---|
private static final String LFN_SIG |
LL_SIG | back to summary |
---|---|
private static final String LL_SIG |
LLV_SIG | back to summary |
---|---|
private static final String LLV_SIG |
localClasses | back to summary |
---|---|
private Class<?>[] localClasses |
localsMap | back to summary |
---|---|
private int[] localsMap Info about local variables in compiled lambda form |
LOOKUP | back to summary |
---|---|
private static final MethodHandles. |
LOOP_CLAUSES | back to summary |
---|---|
private static final String LOOP_CLAUSES |
MEMBERNAME_FACTORY | back to summary |
---|---|
private static final MemberName. |
MH | back to summary |
---|---|
private static final String MH Define class names for convenience. |
MH_SIG | back to summary |
---|---|
private static final String MH_SIG |
MHARY2 | back to summary |
---|---|
private static final String MHARY2 |
MHI | back to summary |
---|---|
private static final String MHI |
mv | back to summary |
---|---|
private MethodVisitor mv |
name | back to summary |
---|---|
private final String name Name of new class |
OBJ | back to summary |
---|---|
private static final String OBJ |
OBJARY | back to summary |
---|---|
private static final String OBJARY |
SOURCE_PREFIX | back to summary |
---|---|
private static final String SOURCE_PREFIX |
STATICALLY_INVOCABLE_PACKAGES | back to summary |
---|---|
private static final Class<?>[] STATICALLY_INVOCABLE_PACKAGES |
InvokerBytecodeGenerator | back to summary |
---|---|
private InvokerBytecodeGenerator(LambdaForm lambdaForm, int localsMapSize, String name, String invokerName, MethodType invokerType) Main constructor; other constructors delegate to this one. |
InvokerBytecodeGenerator | back to summary |
---|---|
private InvokerBytecodeGenerator(String name, String invokerName, MethodType invokerType) For generating LambdaForm interpreter entry points. |
InvokerBytecodeGenerator | back to summary |
---|---|
private InvokerBytecodeGenerator(String name, LambdaForm form, MethodType invokerType) For generating customized code for a single LambdaForm. |
InvokerBytecodeGenerator | back to summary |
---|---|
pack-priv InvokerBytecodeGenerator(String name, String invokerName, LambdaForm form, MethodType invokerType) For generating customized code for a single LambdaForm. |
addMethod | back to summary |
---|---|
pack-priv void addMethod() |
arrayInsnOpcode | back to summary |
---|---|
private int arrayInsnOpcode(byte tcode, int aaop) throws InternalError |
arrayTypeCode | back to summary |
---|---|
private byte arrayTypeCode(Wrapper elementType) |
assertStaticType | back to summary |
---|---|
private boolean assertStaticType(Class<?> cls, LambdaForm. Update localClasses type map. Return true if the information is already present. |
bogusMethod | back to summary |
---|---|
private void bogusMethod(Object os) Emit a bogus method that just loads some string constants. This is to get the constants into the constant pool for debugging purposes. |
checkActualReceiver | back to summary |
---|---|
private boolean checkActualReceiver() Generates code to check that actual receiver and LambdaForm matches |
checkClassName | back to summary |
---|---|
pack-priv static boolean checkClassName(String cn) |
classData | back to summary |
---|---|
pack-priv String classData(Object arg) |
classDataValues | back to summary |
---|---|
private Object classDataValues() Returns the class data object that will be passed to `Lookup.defineHiddenClassWithClassData`.
The classData is loaded in the |
classFilePrologue | back to summary |
---|---|
private ClassWriter classFilePrologue() Set up class file generation. |
className | back to summary |
---|---|
pack-priv static String className(String cn) |
clinit | back to summary |
---|---|
pack-priv static void clinit(ClassWriter cw, String className, List<InvokerBytecodeGenerator. |
debugString | back to summary |
---|---|
private static String debugString(Object arg) |
emitAloadInsn | back to summary |
---|---|
private void emitAloadInsn(int index) |
emitArrayLength | back to summary |
---|---|
pack-priv void emitArrayLength(LambdaForm. |
emitArrayLoad | back to summary |
---|---|
pack-priv void emitArrayLoad(LambdaForm. |
emitArrayOp | back to summary |
---|---|
pack-priv void emitArrayOp(LambdaForm. |
emitArrayStore | back to summary |
---|---|
pack-priv void emitArrayStore(LambdaForm. |
emitAstoreInsn | back to summary |
---|---|
private void emitAstoreInsn(int index) |
emitBoxing | back to summary |
---|---|
private void emitBoxing(Wrapper wrapper) Emit a boxing call.
|
emitConst | back to summary |
---|---|
private void emitConst(Object con) |
emitGuardWithCatch | back to summary |
---|---|
private LambdaForm. Emit bytecode for the guardWithCatch idiom. The pattern looks like (Cf. MethodHandleImpl.makeGuardWithCatch): It is compiled into bytecode equivalent of the following code:
|
emitI2X | back to summary |
---|---|
private void emitI2X(Wrapper type) |
emitIconstInsn | back to summary |
---|---|
private void emitIconstInsn(final int cst) |
emitIconstInsn | back to summary |
---|---|
private static void emitIconstInsn(MethodVisitor mv, int cst) |
emitImplicitConversion | back to summary |
---|---|
private void emitImplicitConversion(LambdaForm. Emit an implicit conversion for an argument which must be of the given pclass. This is usually a no-op, except when pclass is a subword type or a reference other than Object or an interface.
|
emitInvoke | back to summary |
---|---|
pack-priv void emitInvoke(LambdaForm. Emit an invoke for the given name. |
emitLoadInsn | back to summary |
---|---|
private void emitLoadInsn(LambdaForm. |
emitLoop | back to summary |
---|---|
private LambdaForm. Emit bytecode for the loop idiom. The pattern looks like (Cf. MethodHandleImpl.loop):
It is compiled into bytecode equivalent to the code seen in
Bytecode generation applies an unrolling scheme to enable better bytecode generation regarding local state type
handling. The generated bytecode will have the following form (
The
The
|
emitLoopHandleInvoke | back to summary |
---|---|
private void emitLoopHandleInvoke(LambdaForm. |
emitPopInsn | back to summary |
---|---|
private void emitPopInsn(LambdaForm. |
emitPrimCast | back to summary |
---|---|
private void emitPrimCast(Wrapper from, Wrapper to) Emit a type conversion bytecode casting from "from" to "to". |
emitPushArgument | back to summary |
---|---|
private void emitPushArgument(LambdaForm. |
emitPushArgument | back to summary |
---|---|
private void emitPushArgument(Class<?> ptype, Object arg) |
emitPushArguments | back to summary |
---|---|
private void emitPushArguments(LambdaForm. |
emitPushClauseArray | back to summary |
---|---|
private void emitPushClauseArray(int clauseDataSlot, int which) |
emitReferenceCast | back to summary |
---|---|
private void emitReferenceCast(Class<?> cls, Object arg) |
emitReturn | back to summary |
---|---|
private void emitReturn(LambdaForm. Emits a return statement from a LF invoker. If required, the result type is cast to the correct return type. |
emitReturnInsn | back to summary |
---|---|
private void emitReturnInsn(LambdaForm. Emits an actual return instruction conforming to the given return type. |
emitSelectAlternative | back to summary |
---|---|
private LambdaForm. Emit bytecode for the selectAlternative idiom. The pattern looks like (Cf. MethodHandleImpl.makeGuardWithTest):
|
emitStaticInvoke | back to summary |
---|---|
pack-priv void emitStaticInvoke(LambdaForm. |
emitStaticInvoke | back to summary |
---|---|
pack-priv void emitStaticInvoke(MemberName member, LambdaForm. Emit an invoke for the given name, using the MemberName directly. |
emitStoreInsn | back to summary |
---|---|
private void emitStoreInsn(LambdaForm. |
emitStoreResult | back to summary |
---|---|
private void emitStoreResult(LambdaForm. Store the name to its local, if necessary. |
emitTableSwitch | back to summary |
---|---|
private LambdaForm. |
emitTryFinally | back to summary |
---|---|
private LambdaForm. Emit bytecode for the tryFinally idiom. The pattern looks like (Cf. MethodHandleImpl.makeTryFinally):
It is compiled into bytecode equivalent to the following code:
Specifically, the bytecode will have the following form (the stack effects are given for the beginnings of
blocks, and for the situations after executing the given instruction - the code will have a slightly different
shape if the return type is * = depends on whether the return type takes up 2 stack slots. |
emitUnboxing | back to summary |
---|---|
private void emitUnboxing(Wrapper wrapper) Emit an unboxing call (plus preceding checkcast).
|
emitX2I | back to summary |
---|---|
private void emitX2I(Wrapper type) |
emitZero | back to summary |
---|---|
private void emitZero(LambdaForm. |
extendLocalsMap | back to summary |
---|---|
private int extendLocalsMap(Class<?>[] types) |
generateCustomizedCode | back to summary |
---|---|
pack-priv static MemberName generateCustomizedCode(LambdaForm form, MethodType invokerType) Generate customized bytecode for a given LambdaForm. |
generateCustomizedCodeBytes | back to summary |
---|---|
private byte[] generateCustomizedCodeBytes() Generate an invoker method for the passed |
generateLambdaFormInterpreterEntryPoint | back to summary |
---|---|
pack-priv static MemberName generateLambdaFormInterpreterEntryPoint(MethodType mt) Generate bytecode for a LambdaForm.vmentry which calls interpretWithArguments. |
generateLambdaFormInterpreterEntryPointBytes | back to summary |
---|---|
private byte[] generateLambdaFormInterpreterEntryPointBytes() |
generateNamedFunctionInvoker | back to summary |
---|---|
pack-priv static MemberName generateNamedFunctionInvoker(MethodTypeForm typeForm) Generate bytecode for a NamedFunction invoker. |
generateNamedFunctionInvokerImpl | back to summary |
---|---|
private byte[] generateNamedFunctionInvokerImpl(MethodTypeForm typeForm) |
getInternalName | back to summary |
---|---|
private String getInternalName(Class<?> c) |
isStaticallyInvocable | back to summary |
---|---|
pack-priv static boolean isStaticallyInvocable(LambdaForm. |
isStaticallyInvocable | back to summary |
---|---|
pack-priv static boolean isStaticallyInvocable(LambdaForm. |
isStaticallyInvocable | back to summary |
---|---|
pack-priv static boolean isStaticallyInvocable(MemberName member) |
isStaticallyInvocableType | back to summary |
---|---|
private static boolean isStaticallyInvocableType(MethodType mtype) |
isStaticallyNameable | back to summary |
---|---|
pack-priv static boolean isStaticallyNameable(Class<?> cls) |
loadInsnOpcode | back to summary |
---|---|
private int loadInsnOpcode(LambdaForm. |
loadMethod | back to summary |
---|---|
private MemberName loadMethod(byte[] classFile) Extract the MemberName of a newly-defined method. |
lookup | back to summary |
---|---|
private static MethodHandles. |
lookupPregenerated | back to summary |
---|---|
private static MemberName lookupPregenerated(LambdaForm form, MethodType invokerType) |
makeDumpableClassName | back to summary |
---|---|
private static String makeDumpableClassName(String className) |
methodEpilogue | back to summary |
---|---|
private void methodEpilogue() Tear down class file generation. |
methodPrologue | back to summary |
---|---|
private void methodPrologue() |
popInsnOpcode | back to summary |
---|---|
private static int popInsnOpcode(LambdaForm. |
refKindOpcode | back to summary |
---|---|
pack-priv int refKindOpcode(byte refKind) |
resolveFrom | back to summary |
---|---|
private static MemberName resolveFrom(String name, MethodType type, Class<?> holder) |
resolveInvokerMember | back to summary |
---|---|
private static MemberName resolveInvokerMember(Class<?> invokerClass, String name, MethodType type) |
setClassWriter | back to summary |
---|---|
pack-priv void setClassWriter(ClassWriter cw) |
storeInsnOpcode | back to summary |
---|---|
private int storeInsnOpcode(LambdaForm. |
toByteArray | back to summary |
---|---|
private byte[] toByteArray() |
Access | Constructor and Description |
---|---|
pack-priv |
BytecodeGenerationException | back to summary |
---|---|
pack-priv BytecodeGenerationException(Exception cause) |
Modifier and Type | Field and Description |
---|---|
pack-priv final String | |
pack-priv final String | |
pack-priv final Object |
Access | Constructor and Description |
---|---|
pack-priv |
desc | back to summary |
---|---|
pack-priv final String desc |
name | back to summary |
---|---|
pack-priv final String name |
value | back to summary |
---|---|
pack-priv final Object value |
ClassData | back to summary |
---|---|
pack-priv ClassData(String name, String desc, Object value) |
name | back to summary |
---|---|
public String name() |
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
|