use of lucee.runtime.config.ConfigImpl in project Lucee by lucee.
the class LitStringImpl method _writeOut.
/**
* @see lucee.transformer.expression.Expression#_writeOut(org.objectweb.asm.commons.GeneratorAdapter, int)
*/
private static Type _writeOut(BytecodeContext bc, int mode, String str) throws TransformerException {
// write to a file instead to the bytecode
// str(0,10);
// print.ds(str);
int externalizeStringGTE = ((ConfigImpl) bc.getConfig()).getExternalizeStringGTE();
if (externalizeStringGTE > -1 && str.length() > externalizeStringGTE && StringUtil.indexOfIgnoreCase(bc.getMethod().getName(), "call") != -1) {
try {
GeneratorAdapter ga = bc.getAdapter();
Page page = bc.getPage();
Range range = page.registerString(bc, str);
if (range != null) {
ga.visitVarInsn(Opcodes.ALOAD, 0);
ga.visitVarInsn(Opcodes.ALOAD, 1);
ga.push(range.from);
ga.push(range.to);
ga.visitMethodInsn(Opcodes.INVOKEVIRTUAL, bc.getClassName(), "str", "(Llucee/runtime/PageContext;II)Ljava/lang/String;");
return Types.STRING;
}
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
}
}
if (toBig(str)) {
_toExpr(bc.getFactory(), str).writeOut(bc, mode);
} else {
bc.getAdapter().push(str);
}
return Types.STRING;
}
use of lucee.runtime.config.ConfigImpl in project Lucee by lucee.
the class DatasourceResourceProvider method getManager.
private DatasourceManagerImpl getManager() {
if (_manager == null) {
Config config = ThreadLocalPageContext.getConfig();
_manager = new DatasourceManagerImpl((ConfigImpl) config);
}
return _manager;
}
Aggregations