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

com.maxifier.mxcache.transform.IgnoreTransformGenerator Maven / Gradle / Ivy

/*
 * Copyright (c) 2008-2014 Maxifier Ltd. All Rights Reserved.
 */
package com.maxifier.mxcache.transform;

import com.maxifier.mxcache.asm.Type;
import com.maxifier.mxcache.asm.commons.GeneratorAdapter;
import com.maxifier.mxcache.util.ClassGenerator;

/**
 * @author Alexander Kochurov ([email protected])
 */
public final class IgnoreTransformGenerator extends ScalarTransformGenerator {
    private static final TransformGenerator INSTANCE = new IgnoreTransformGenerator();

    public static TransformGenerator getInstance() {
        return INSTANCE;
    }

    private IgnoreTransformGenerator() {
    }

    @Override
    public void generateForward(Type thisType, int fieldIndex, GeneratorAdapter method) {
        if (thisType.getSize() == 2) {
            method.pop2();
        } else {
            method.pop();
        }
    }

    @Override
    public void generateBackward(Type thisType, int fieldIndex, GeneratorAdapter method) {
        throw new UnsupportedOperationException();
    }

    @Override
    public void generateFields(Type thisType, int fieldIndex, ClassGenerator writer) {
    }

    @Override
    public void generateAcquire(Type thisType, int fieldIndex, GeneratorAdapter ctor, int contextLocal) {
    }

    @Override
    public int getFieldCount() {
        return 0;
    }

    @Override
    public Class getTransformedType(Class in) {
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy