Package org.mvel2.optimizers.impl.asm
Class ASMAccessorOptimizer
java.lang.Object
org.mvel2.compiler.AbstractParser
org.mvel2.optimizers.AbstractOptimizer
org.mvel2.optimizers.impl.asm.ASMAccessorOptimizer
- All Implemented Interfaces:
Serializable,Parser,AccessorOptimizer
Implementation of the MVEL Just-in-Time (JIT) compiler for Property Accessors using the ASM bytecode
engineering library.
- See Also:
-
Field Summary
Fields inherited from class org.mvel2.optimizers.AbstractOptimizer
BEAN, COL, collection, currType, METH, nullSafe, staticAccess, tkStart, WITHFields inherited from class org.mvel2.compiler.AbstractParser
CLASS_LITERALS, compileMode, cursor, debugSymbols, dStack, end, expr, fields, GET, GET_OR_CREATE, greedy, lastLineStart, lastNode, lastWasComment, lastWasIdentifier, lastWasLineLabel, lastWasVar, length, LEVEL_0_PROPERTY_ONLY, LEVEL_1_BASIC_LANG, LEVEL_2_MULTI_STATEMENT, LEVEL_3_ITERATION, LEVEL_4_ASSIGNMENT, LEVEL_5_CONTROL_FLOW, line, literalOnly, LITERALS, OP_CONTINUE, OP_NOT_LITERAL, OP_OVERFLOW, OP_RESET_FRAME, OP_TERMINATE, OPERATORS, pCtx, REMOVE, SET, splitAccumulator, st, start, stk -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidarrayStore(Class cls) static MVELClassLoadergetName()voidinit()booleanoptimizeAccessor(ParserContext pCtx, char[] property, int start, int offset, Object staticContext, Object thisRef, VariableResolverFactory factory, boolean root, Class ingressType) optimizeCollection(ParserContext pCtx, Object o, Class type, char[] property, int start, int offset, Object ctx, Object thisRef, VariableResolverFactory factory) optimizeObjectCreation(ParserContext pCtx, char[] property, int start, int offset, Object ctx, Object thisRef, VariableResolverFactory factory) optimizeSetAccessor(ParserContext pCtx, char[] property, int start, int offset, Object ctx, Object thisRef, VariableResolverFactory factory, boolean rootThisRef, Object value, Class ingressType) static voidstatic inttoPrimitiveTypeOperand(Class<?> c) Gets the ASM instruction operand for the given primitive type.voidwrapRuntimeConverstion(Class toType) Methods inherited from class org.mvel2.optimizers.AbstractOptimizer
capture, findLastUnion, nextSubToken, scanTo, tryStaticAccess, whiteSpaceSkipMethods inherited from class org.mvel2.compiler.AbstractParser
addFatalError, addFatalError, arithmeticFunctionReduction, captureIdentifier, captureToEOS, captureToEOSorEOL, captureToEOT, captureToNextTokenJunction, expectEOS, expectNextChar_IW, getCursor, getExpression, handleSubstatement, handleUnion, ifThenElseBlockContinues, incNextNonBlank, isArithmeticOperator, isNextIdentifier, isNextIdentifierOrLiteral, isStatementNotManuallyTerminated, lastNonWhite, loadLanguageFeaturesByLevel, lookAhead, lookAhead, lookBehind, lookToLast, nextNonBlank, nextToken, nextTokenSkipSymbols, reduce, setExpression, setExpression, setLanguageLevel, setupParser, skipWhitespace, tokenContinues, trimLeft, trimRight, trimWhitespace
-
Constructor Details
-
ASMAccessorOptimizer
public ASMAccessorOptimizer()
-
-
Method Details
-
optimizeAccessor
public Accessor optimizeAccessor(ParserContext pCtx, char[] property, int start, int offset, Object staticContext, Object thisRef, VariableResolverFactory factory, boolean root, Class ingressType) - Specified by:
optimizeAccessorin interfaceAccessorOptimizer
-
optimizeSetAccessor
public Accessor optimizeSetAccessor(ParserContext pCtx, char[] property, int start, int offset, Object ctx, Object thisRef, VariableResolverFactory factory, boolean rootThisRef, Object value, Class ingressType) - Specified by:
optimizeSetAccessorin interfaceAccessorOptimizer
-
setMVELClassLoader
-
getMVELClassLoader
-
init
public void init()- Specified by:
initin interfaceAccessorOptimizer
-
getName
-
getResultOptPass
- Specified by:
getResultOptPassin interfaceAccessorOptimizer
-
toPrimitiveTypeOperand
Gets the ASM instruction operand for the given primitive type. Will throw IllegalStateException if the type is not primitive.- Parameters:
c- The class representing the primitive type.- Returns:
- The operand
-
arrayStore
-
wrapRuntimeConverstion
-
optimizeCollection
public Accessor optimizeCollection(ParserContext pCtx, Object o, Class type, char[] property, int start, int offset, Object ctx, Object thisRef, VariableResolverFactory factory) - Specified by:
optimizeCollectionin interfaceAccessorOptimizer
-
optimizeObjectCreation
public Accessor optimizeObjectCreation(ParserContext pCtx, char[] property, int start, int offset, Object ctx, Object thisRef, VariableResolverFactory factory) - Specified by:
optimizeObjectCreationin interfaceAccessorOptimizer
-
getEgressType
- Specified by:
getEgressTypein interfaceAccessorOptimizer
-
isLiteralOnly
public boolean isLiteralOnly()- Specified by:
isLiteralOnlyin interfaceAccessorOptimizer
-