use of st.gravel.support.compiler.jvm.JVMType in project gravel by gravel-st.
the class JavaSystemMappingCompilerTools method createInvoke.
private Invoke createInvoke(Invoke_Factory invokeFactory, JVMDefinedObjectType _type, String _name, Method method) {
JVMType[] arguments = ArrayExtensions.collect_(method.getParameterTypes(), new Block1<JVMType, Class<?>>() {
@Override
public JVMType value_(Class<?> arg1) {
return jvmTypeForClass_(arg1);
}
});
JVMMethodType _aJVMMethodType = JVMMethodType.factory.returnType_arguments_(jvmTypeForClass_(method.getReturnType()), arguments);
return invokeFactory.ownerType_name_signature_(_type, _name, _aJVMMethodType);
}
use of st.gravel.support.compiler.jvm.JVMType in project gravel by gravel-st.
the class Store method effectStack_.
@Override
public JVMInstruction effectStack_(final JVMStack _aJVMStack) {
final JVMType _elemType;
_elemType = _aJVMStack.pop();
if (_elemType.isObjectType() || _elemType.isArrayType()) {
return AStore.factory.index_type_(_index, _type);
}
if (_elemType.isIntType()) {
return IStore.factory.index_type_(_index, _type);
}
st.gravel.support.jvm.ObjectExtensions.halt(this);
return this;
}
use of st.gravel.support.compiler.jvm.JVMType in project gravel by gravel-st.
the class DupX1 method effectStack_.
@Override
public JVMInstruction effectStack_(final JVMStack _aJVMStack) {
final JVMType _top;
final JVMType _next;
_top = _aJVMStack.pop();
_next = _aJVMStack.pop();
_aJVMStack.push_(_top);
_aJVMStack.push_(_next);
_aJVMStack.push_(_top);
return this;
}
use of st.gravel.support.compiler.jvm.JVMType in project gravel by gravel-st.
the class DupX2 method effectStack_.
@Override
public JVMInstruction effectStack_(final JVMStack _aJVMStack) {
final JVMType _p1;
final JVMType _p2;
final JVMType _p3;
_p1 = _aJVMStack.pop();
_p2 = _aJVMStack.pop();
_p3 = _aJVMStack.pop();
_aJVMStack.push_(_p1);
_aJVMStack.push_(_p3);
_aJVMStack.push_(_p2);
_aJVMStack.push_(_p1);
return this;
}
use of st.gravel.support.compiler.jvm.JVMType in project gravel by gravel-st.
the class IfThenElse method effectStack_.
@Override
public JVMInstruction effectStack_(final JVMStack _aJVMStack) {
final JVMType _testType;
_testType = _aJVMStack.pop();
if (_testType.isDynamicObjectType()) {
return IfThenElse.this.effectObjectTestStack_(_aJVMStack).pushTypeOnStack_(_aJVMStack);
}
if (_testType.isBooleanType()) {
return IfThenElse.this.effectBooleanTestStack_(_aJVMStack).pushTypeOnStack_(_aJVMStack);
}
st.gravel.support.jvm.ObjectExtensions.halt(this);
return this;
}
Aggregations