public void loadLocal(Type type, int index) { super.visitVarInsn(type.getOpcode(ILOAD), index); }
public void arrayLoad(Type type) { super.visitInsn(type.getOpcode(IALOAD)); }
public void storeLocal(Type type, int index) { super.visitVarInsn(type.getOpcode(ISTORE), index); }
public void returnValue() { super.visitInsn(returnType.getOpcode(IRETURN)); }
public void arrayStore(Type type) { super.visitInsn(type.getOpcode(IASTORE)); }
private void generateThreadLocalPut(FieldDescriptor fd) { if (isClassInitializer) { super.visitVarInsn(Type.getType(fd.desc).getOpcode(Opcodes.ISTORE), fd.var); fd.initialized = true; } else { String fieldName = BTRACE_FIELD_PREFIX + fd.name; box(fd.desc); super.visitFieldInsn(GETSTATIC, className, fieldName, JAVA_LANG_THREAD_LOCAL_DESC); visitInsn(SWAP); visitMethodInsn(INVOKEVIRTUAL, JAVA_LANG_THREAD_LOCAL, JAVA_LANG_THREAD_LOCAL_SET, JAVA_LANG_THREAD_LOCAL_SET_DESC); } }
private void generateThreadLocalGet(FieldDescriptor fd) { if (isClassInitializer) { if (fd.initialized) { super.visitVarInsn(Type.getType(fd.desc).getOpcode(Opcodes.ILOAD), fd.var); } else if (fd.value != null) { visitLdcInsn(fd.value); } else { defaultValue(fd.desc); } } else { String fieldName = BTRACE_FIELD_PREFIX + fd.name; super.visitFieldInsn(GETSTATIC, className, fieldName, JAVA_LANG_THREAD_LOCAL_DESC); visitMethodInsn(INVOKEVIRTUAL, JAVA_LANG_THREAD_LOCAL, JAVA_LANG_THREAD_LOCAL_GET, JAVA_LANG_THREAD_LOCAL_GET_DESC); unbox(fd.desc); } }
setFrameLocal(local, t); mv.visitVarInsn(type.getOpcode(Opcodes.ISTORE), local); newLocalIndices.add(local); return local;