}
public void compile(ByteCompiler context, int operation)
{
Code code = context.getCode();
ConstantPool pool = code.getPool();
if (_class instanceof NativeJava) {
if (hasSplices()) {
code.getstatic(pool.addFieldRef(_class.getTypeRef(pool),
"__class__", "Lanvil/script/compiler/NativeClass;"));
code.aload_first();
context.compileArgumentList(getChilds(0));
code.invokevirtual(pool.addMethodRef(
"anvil/script/compiler/NativeClass", "newInstance",
"(Lanvil/script/Context;[Lanvil/core/Any;)Lanvil/core/Any;"));
} else {
context.compileCall(_constructor, getChilds(0));
}
} else {
int classindex = _class.getTypeRef(pool);
boolean has_splices = hasSplices();
if (has_splices) {
code.getstatic(pool.addFieldRef(classindex, "m_"+_constructor.getName(), "Lanvil/script/Function;"));
code.aload_first();
}
code.anew(classindex);
code.dup();
ClassType[] clazz_parents = _class.getEnclosingClasses();
int n = clazz_parents.length;
for(int i=0; i<n; i++) {
context.accessInstance(_context, clazz_parents[i]);
}
code.invokespecial(_class.getConstructorReference(pool));
if (has_splices) {
context.compileArgumentList(getChilds(0));
code.invokeinterface(pool.addInterfaceMethodRef("anvil/script/Function", "execute",
"(Lanvil/script/Context;Lanvil/core/Any;[Lanvil/core/Any;)Lanvil/core/Any;"));
} else {
context.compileArgumentList(_constructor, getChilds(0));
code.invokevirtual(_constructor.getTypeRef(pool));
}
}
if (operation == GET_BOOLEAN) {
context.any2boolean();
}