Search in sources :

Example 6 with JVMType

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);
}
Also used : JVMType(st.gravel.support.compiler.jvm.JVMType) JVMClass(st.gravel.support.compiler.jvm.JVMClass) ObjectClass(st.gravel.support.jvm.ObjectClass) JVMMethodType(st.gravel.support.compiler.jvm.JVMMethodType)

Example 7 with JVMType

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;
}
Also used : JVMType(st.gravel.support.compiler.jvm.JVMType)

Example 8 with JVMType

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;
}
Also used : JVMType(st.gravel.support.compiler.jvm.JVMType)

Example 9 with JVMType

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;
}
Also used : JVMType(st.gravel.support.compiler.jvm.JVMType)

Example 10 with JVMType

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;
}
Also used : JVMType(st.gravel.support.compiler.jvm.JVMType)

Aggregations

JVMType (st.gravel.support.compiler.jvm.JVMType)24 ArrayList (java.util.ArrayList)4 List (java.util.List)3 BigInteger (java.math.BigInteger)2 JVMInstruction (st.gravel.support.compiler.jvm.JVMInstruction)2 JVMLocalDeclaration (st.gravel.support.compiler.jvm.JVMLocalDeclaration)2 JVMVariable (st.gravel.support.compiler.jvm.JVMVariable)2 TypeCast (st.gravel.support.compiler.ast.TypeCast)1 BlockInnerClass (st.gravel.support.compiler.jvm.BlockInnerClass)1 BlockSendArgument (st.gravel.support.compiler.jvm.BlockSendArgument)1 JVMArrayType (st.gravel.support.compiler.jvm.JVMArrayType)1 JVMClass (st.gravel.support.compiler.jvm.JVMClass)1 JVMMethodType (st.gravel.support.compiler.jvm.JVMMethodType)1 Load (st.gravel.support.compiler.jvm.Load)1 ObjectClass (st.gravel.support.jvm.ObjectClass)1