Does Java JIT compiler remove method's call without side effects? -
i have simple method check if input string valid xpath
private boolean isxpath(string value) { boolean isxpath = true; try { xpath xpath = xpathfactory.newinstance().newxpath(); xpath.compile(value); } catch (xpathexpressionexception e) { isxpath = false; } return isxpath; }
can sure jit compiler won't remove code inside try
block, because of has no side effects? or has (possible exception)?
dead code eliminatino not side-effects, using result of computation. since method returns isxpath
, cannot derived without executing try
block, impossible jit compiler eliminate it.
Comments
Post a Comment