Search in sources :

Example 6 with Local

use of org.powermock.api.mockito.repackaged.cglib.core.Local in project powermock by powermock.

the class ParallelSorterEmitter method generateSwap.

private void generateSwap(final Object[] arrays) {
    CodeEmitter e = begin_method(Constants.ACC_PUBLIC, SWAP, null);
    for (int i = 0; i < arrays.length; i++) {
        Type type = Type.getType(arrays[i].getClass());
        Type component = TypeUtils.getComponentType(type);
        Local T = e.make_local(type);
        e.load_this();
        e.getfield(getFieldName(i));
        e.store_local(T);
        e.load_local(T);
        e.load_arg(0);
        e.load_local(T);
        e.load_arg(1);
        e.array_load(component);
        e.load_local(T);
        e.load_arg(1);
        e.load_local(T);
        e.load_arg(0);
        e.array_load(component);
        e.array_store(component);
        e.array_store(component);
    }
    e.return_value();
    e.end_method();
}
Also used : CodeEmitter(org.powermock.api.mockito.repackaged.cglib.core.CodeEmitter) Type(org.powermock.api.mockito.repackaged.asm.Type) Local(org.powermock.api.mockito.repackaged.cglib.core.Local)

Aggregations

Local (org.powermock.api.mockito.repackaged.cglib.core.Local)6 CodeEmitter (org.powermock.api.mockito.repackaged.cglib.core.CodeEmitter)5 MethodInfo (org.powermock.api.mockito.repackaged.cglib.core.MethodInfo)3 Label (org.powermock.api.mockito.repackaged.asm.Label)2 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Map (java.util.Map)1 Type (org.powermock.api.mockito.repackaged.asm.Type)1 Block (org.powermock.api.mockito.repackaged.cglib.core.Block)1 ClassInfo (org.powermock.api.mockito.repackaged.cglib.core.ClassInfo)1 Signature (org.powermock.api.mockito.repackaged.cglib.core.Signature)1