Java Code Examples for org.objectweb.asm.Opcodes#AASTORE

The following examples show how to use org.objectweb.asm.Opcodes#AASTORE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ManagedStrategyTransformer.java    From lin-check with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void visitInsn(int opcode) {
    switch (opcode) {
    case Opcodes.AALOAD:
    case Opcodes.LALOAD:
    case Opcodes.FALOAD:
    case Opcodes.DALOAD:
    case Opcodes.IALOAD:
        invokeBeforeSharedVariableRead();
        break;
    case Opcodes.AASTORE:
    case Opcodes.IASTORE:
    case Opcodes.LASTORE:
    case Opcodes.FASTORE:
    case Opcodes.DASTORE:
        invokeBeforeSharedVariableWrite();
        break;
    }
    super.visitInsn(opcode);
}
 
Example 2
Source File: MethodHookInjector.java    From Hook-Manager with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void visitCode()
{
	super.visitCode();
	if(methodData.hasHookAt(HookPosition.METHOD_START))
	{
		HookData hookData = methodData.getHook(HookPosition.METHOD_START);
		super.visitLdcInsn(className + "." + methodName + "|start");
		
		if(hookData.collectsParams())
		{
			super.visitIntInsn(Opcodes.BIPUSH, paramCount);
			super.visitTypeInsn(Opcodes.ANEWARRAY, "java/lang/Object");
			for(byte i = 0; i < paramCount; i++)
			{
				super.visitInsn(Opcodes.DUP);
				super.visitIntInsn(Opcodes.BIPUSH, i);
				super.visitVarInsn(Opcodes.ALOAD, i);
				super.visitInsn(Opcodes.AASTORE);
			}
		}
		
		// TODO: Custom class path
		super.visitMethodInsn(Opcodes.INVOKESTATIC,
			"tk/wurst_client/hooks/HookManager", "hook",
			"(Ljava/lang/String;"
				+ (hookData.collectsParams() ? "[Ljava/lang/Object;" : "")
				+ ")V", false);
	}
}
 
Example 3
Source File: MethodHookInjector.java    From Hook-Manager with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void visitInsn(int opcode)
{
	if(methodData.hasHookAt(HookPosition.METHOD_END) && opcode >= 172
		&& opcode <= 177)
	{
		HookData hookData = methodData.getHook(HookPosition.METHOD_END);
		super.visitLdcInsn(className + "." + methodName + "|end");
		
		if(hookData.collectsParams())
		{
			
			super.visitIntInsn(Opcodes.BIPUSH, paramCount);
			super.visitTypeInsn(Opcodes.ANEWARRAY, "java/lang/Object");
			for(byte i = 0; i < paramCount; i++)
			{
				super.visitInsn(Opcodes.DUP);
				super.visitIntInsn(Opcodes.BIPUSH, i);
				super.visitVarInsn(Opcodes.ALOAD, i);
				super.visitInsn(Opcodes.AASTORE);
			}
		}
		
		// TODO: Custom class path
		super.visitMethodInsn(Opcodes.INVOKESTATIC,
			"tk/wurst_client/hooks/HookManager", "hook",
			"(Ljava/lang/String;"
				+ (hookData.collectsParams() ? "[Ljava/lang/Object;" : "")
				+ ")V", false);
	}
	super.visitInsn(opcode);
}
 
Example 4
Source File: InstructionAssembler.java    From es6draft with MIT License 5 votes vote down vote up
public final void astore(Type type) {
    switch (type.getOpcode(Opcodes.IASTORE)) {
    case Opcodes.IASTORE:
        iastore();
        return;
    case Opcodes.LASTORE:
        lastore();
        return;
    case Opcodes.FASTORE:
        fastore();
        return;
    case Opcodes.DASTORE:
        dastore();
        return;
    case Opcodes.AASTORE:
        aastore();
        return;
    case Opcodes.BASTORE:
        bastore();
        return;
    case Opcodes.CASTORE:
        castore();
        return;
    case Opcodes.SASTORE:
        sastore();
        return;
    default:
        throw new IllegalArgumentException();
    }
}
 
Example 5
Source File: ArrayFactory.java    From byte-buddy with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public int getStorageOpcode() {
    return Opcodes.AASTORE;
}