Package st.gravel.support.compiler.jvm

Examples of st.gravel.support.compiler.jvm.JVMType


    _instructions.add(_anInstruction.effectStack_(_stack));
    return this;
  }

  public JVMMethodCompiler ensureCast_(final JVMType _aType) {
    final JVMType _lastType;
    JVMType _temp1 = _lastType = _stack.peek();
    if (!st.gravel.support.jvm.ObjectExtensions.equals_(_temp1, _aType)) {
      JVMMethodCompiler.this.emit_(_lastType.newCastInstructionTo_(_aType));
    }
    return this;
  }
View Full Code Here


    return this;
  }

  @Override
  public JVMMethodCompiler visitFieldWriteNode_(final FieldWriteNode _aNode) {
    final JVMType _fieldType;
    this.visit_(_aNode.owner());
    this.visit_(_aNode.value());
    _fieldType = TypeNodeToJVMTypeConverter.factory.namespace_(_parent.namespace()).visit_(_aNode.type());
    this.ensureCast_(_fieldType);
    this.emit_(DupX1.factory.basicNew());
View Full Code Here

  public JVMType peek_(final int _anInteger) {
    return _elements[(_elements.length - (_anInteger - 1)) - 1];
  }

  public JVMType pop() {
    final JVMType _last;
    _last = _elements[_elements.length - 1];
    if (_last.isWide()) {
      throw new RuntimeException("Cannot pop a wide element");
    }
    _elements = st.gravel.support.jvm.ArrayExtensions.copyWithoutLast(_elements);
    return _last;
  }
View Full Code Here

    st.gravel.support.jvm.ObjectExtensions.assert_(this, st.gravel.support.jvm.IntegerExtensions.equals_(this.size(), 1));
    return this.pop();
  }

  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;
  }
View Full Code Here

    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;
  }

  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;
  }
View Full Code Here

    }
  }

  @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);
View Full Code Here

    }
  }

  @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;
  }
View Full Code Here

    }
  }

  @Override
  public JVMInstruction effectStack_(final JVMStack _aJVMStack) {
    final JVMType _aReceiverType;
    final JVMType[] _anArray;
    _anArray = st.gravel.support.jvm.ArrayExtensions.reverse(new st.gravel.core.Interval(1, _numArgs).collect_(new st.gravel.support.jvm.Block1<JVMType, Integer>() {

      @Override
      public JVMType value_(final Integer _i) {
        return (JVMType) _aJVMStack.pop();
      }
    }));
    _aReceiverType = _aJVMStack.pop();
    st.gravel.support.jvm.ObjectExtensions.assert_(this, _aReceiverType.isObjectType());
    _aJVMStack.push_(this.type());
    return this.withReceiverType_argumentTypes_(_aReceiverType, _anArray);
  }
View Full Code Here

      throw new RuntimeException(e);
    }
  }

  public IfBooleanValueThenElse effectBooleanTestStack_(final JVMStack _aJVMStack) {
    final JVMType _commonType;
    _commonType = _trueFrame.type().commonSuperTypeWith_(_falseFrame.type());
    return IfBooleanValueThenElse.factory.trueFrame_falseFrame_(_trueFrame.withReturnType_(_commonType), _falseFrame.withReturnType_(_commonType));
  }
View Full Code Here

    _commonType = _trueFrame.type().commonSuperTypeWith_(_falseFrame.type());
    return IfBooleanValueThenElse.factory.trueFrame_falseFrame_(_trueFrame.withReturnType_(_commonType), _falseFrame.withReturnType_(_commonType));
  }

  public IfBooleanObjectThenElse effectObjectTestStack_(final JVMStack _aJVMStack) {
    final JVMType _commonType;
    _commonType = _trueFrame.type().commonSuperTypeWith_(_falseFrame.type());
    return IfBooleanObjectThenElse.factory.trueFrame_falseFrame_(_trueFrame.withReturnType_(_commonType), _falseFrame.withReturnType_(_commonType));
  }
View Full Code Here

TOP

Related Classes of st.gravel.support.compiler.jvm.JVMType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.