Search in sources :

Example 21 with JVMType

use of st.gravel.support.compiler.jvm.JVMType in project gravel by gravel-st.

the class JVMMethodType method descriptorOn_.

public JVMMethodType descriptorOn_(final StringBuilder _aStream) {
    _aStream.append('(');
    for (final JVMType _each : _arguments) {
        _each.descriptorOn_(_aStream);
    }
    _aStream.append(')');
    _returnType.descriptorOn_(_aStream);
    return this;
}
Also used : JVMType(st.gravel.support.compiler.jvm.JVMType)

Example 22 with JVMType

use of st.gravel.support.compiler.jvm.JVMType in project gravel by gravel-st.

the class JVMStack method popWide.

public JVMType popWide() {
    final JVMType _last;
    _last = _elements[_elements.length - 1];
    if (!_last.isWide()) {
        throw new RuntimeException("Cannot pop a small element");
    }
    _elements = st.gravel.support.jvm.ArrayExtensions.copyWithoutLast(_elements);
    return _last;
}
Also used : JVMType(st.gravel.support.compiler.jvm.JVMType)

Example 23 with JVMType

use of st.gravel.support.compiler.jvm.JVMType in project gravel by gravel-st.

the class JVMStack method popType_.

public JVMStack popType_(final JVMType _aJVMType) {
    final JVMType _last;
    _last = _aJVMType.isWide() ? this.popWide() : this.pop();
    st.gravel.support.jvm.ObjectExtensions.assert_(this, st.gravel.support.jvm.ObjectExtensions.equals_(_last, _aJVMType) || (st.gravel.support.jvm.ObjectExtensions.equals_(_last, JVMDynamicObjectType.factory.basicNew()) && st.gravel.support.jvm.ObjectExtensions.equals_(_aJVMType, JVMDefinedObjectType.factory.object())));
    return this;
}
Also used : JVMType(st.gravel.support.compiler.jvm.JVMType)

Example 24 with JVMType

use of st.gravel.support.compiler.jvm.JVMType in project gravel by gravel-st.

the class ObjectArrayStore method effectStack_.

@Override
public JVMInstruction effectStack_(final JVMStack _aJVMStack) {
    final JVMType _arrayType;
    final JVMType _valType;
    _valType = _aJVMStack.pop();
    st.gravel.support.jvm.ObjectExtensions.assert_(this, _valType.isObjectType());
    st.gravel.support.jvm.ObjectExtensions.assert_(this, _aJVMStack.pop().isIntType());
    _arrayType = _aJVMStack.pop();
    st.gravel.support.jvm.ObjectExtensions.assert_(this, _arrayType.isArrayType());
    st.gravel.support.jvm.ObjectExtensions.assert_(this, ((JVMArrayType) _arrayType).elementType().isObjectType());
    return this;
}
Also used : JVMType(st.gravel.support.compiler.jvm.JVMType) JVMArrayType(st.gravel.support.compiler.jvm.JVMArrayType)

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