All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.artemis.weaver.optimizer.SystemMethodVisitor Maven / Gradle / Ivy

There is a newer version: 2.3.0
Show newest version
package com.artemis.weaver.optimizer;

import com.artemis.meta.ClassMetadata;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;

public class SystemMethodVisitor extends MethodVisitor implements Opcodes {

	private final ClassMetadata meta;

	public SystemMethodVisitor(MethodVisitor mv, ClassMetadata meta) {
		super(ASM5, mv);
		this.meta = meta;
	}

	@Override
	public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {
		if (opcode == INVOKESPECIAL) {
			EntitySystemType resolved = EntitySystemType.resolve(owner);
			if (resolved != null) {
				owner = resolved.replacedSuperName;
			}
		}
		
		mv.visitMethodInsn(opcode, owner, name, desc, itf);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy