Search in sources :

Example 1 with OptimizerFactory.getThreadAccessorOptimizer

use of org.mvel2.optimizers.OptimizerFactory.getThreadAccessorOptimizer in project mvel by mikebrock.

the class Union method getReducedValueAccelerated.

public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
    if (accessor != null) {
        return accessor.getValue(main.getReducedValueAccelerated(ctx, thisValue, factory), thisValue, factory);
    } else {
        try {
            AccessorOptimizer o = OptimizerFactory.getThreadAccessorOptimizer();
            accessor = o.optimizeAccessor(getCurrentThreadParserContext(), expr, start, offset, main.getReducedValueAccelerated(ctx, thisValue, factory), thisValue, factory, false, main.getEgressType());
            return o.getResultOptPass();
        } finally {
            OptimizerFactory.clearThreadAccessorOptimizer();
        }
    }
}
Also used : AccessorOptimizer(org.mvel2.optimizers.AccessorOptimizer)

Example 2 with OptimizerFactory.getThreadAccessorOptimizer

use of org.mvel2.optimizers.OptimizerFactory.getThreadAccessorOptimizer in project mvel by mvel.

the class InlineCollectionNode method getReducedValueAccelerated.

public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
    if (accessor != null) {
        return accessor.getValue(ctx, thisValue, factory);
    } else {
        try {
            AccessorOptimizer ao = OptimizerFactory.getThreadAccessorOptimizer();
            if (collectionGraph == null)
                parseGraph(true, null, null);
            accessor = ao.optimizeCollection(pCtx, collectionGraph, egressType, expr, trailingStart, trailingOffset, ctx, thisValue, factory);
            egressType = ao.getEgressType();
            return accessor.getValue(ctx, thisValue, factory);
        } finally {
            OptimizerFactory.clearThreadAccessorOptimizer();
        }
    }
}
Also used : AccessorOptimizer(org.mvel2.optimizers.AccessorOptimizer)

Example 3 with OptimizerFactory.getThreadAccessorOptimizer

use of org.mvel2.optimizers.OptimizerFactory.getThreadAccessorOptimizer in project mvel by mvel.

the class Union method getReducedValueAccelerated.

public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
    if (accessor != null) {
        return accessor.getValue(main.getReducedValueAccelerated(ctx, thisValue, factory), thisValue, factory);
    } else {
        try {
            AccessorOptimizer o = OptimizerFactory.getThreadAccessorOptimizer();
            accessor = o.optimizeAccessor(pCtx, expr, start, offset, main.getReducedValueAccelerated(ctx, thisValue, factory), thisValue, factory, false, main.getEgressType());
            return o.getResultOptPass();
        } finally {
            OptimizerFactory.clearThreadAccessorOptimizer();
        }
    }
}
Also used : AccessorOptimizer(org.mvel2.optimizers.AccessorOptimizer)

Example 4 with OptimizerFactory.getThreadAccessorOptimizer

use of org.mvel2.optimizers.OptimizerFactory.getThreadAccessorOptimizer in project mvel by mikebrock.

the class InlineCollectionNode method getReducedValueAccelerated.

public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
    if (accessor != null) {
        return accessor.getValue(ctx, thisValue, factory);
    } else {
        try {
            AccessorOptimizer ao = OptimizerFactory.getThreadAccessorOptimizer();
            if (collectionGraph == null)
                parseGraph(true, null, null);
            accessor = ao.optimizeCollection(AbstractParser.getCurrentThreadParserContext(), collectionGraph, egressType, expr, trailingStart, trailingOffset, ctx, thisValue, factory);
            egressType = ao.getEgressType();
            return accessor.getValue(ctx, thisValue, factory);
        } finally {
            OptimizerFactory.clearThreadAccessorOptimizer();
        }
    }
}
Also used : AccessorOptimizer(org.mvel2.optimizers.AccessorOptimizer)

Aggregations

AccessorOptimizer (org.mvel2.optimizers.AccessorOptimizer)4