Package st.gravel.support.compiler.ast

Examples of st.gravel.support.compiler.ast.AbstractMethodMapping


    return lookupMethod(receiverClass, selector);
  }

  public MethodHandle lookupMethod(Class receiverClass, String selector) {
    Reference reference = Reference.factory.value_(lookupStart);
    AbstractMethodMapping mapping = ImageBootstrapper.systemMapping
        .superMethodMappingFor_methodName_(reference, selector);
    if (mapping == null) {
      if (selector.equals("doesNotUnderstand_"))
        throw new RuntimeException("Can't find DNU method");
      return wrapDNUHandle(lookupMethod(receiverClass,
          "doesNotUnderstand_"));
    }
    MethodHandle methodHandle;
    try {
      Method method = MethodTools.searchForMethod(
          mapping.definingClass(), selector, type.parameterArray(),
          true);

      if (method != null) {
        return mapping.methodHandle().asType(type);
      }
      methodHandle = lookup.findSpecial(mapping.definingClass(),
          selector, type.dropParameterTypes(0, 1), lookup.lookupClass());
    } catch (NoSuchMethodException | IllegalAccessException r) {

      try {
        methodHandle = lookup.findStatic(mapping.definingClass(),
            selector, type);
      } catch (NoSuchMethodException | IllegalAccessException e) {

        throw new RuntimeException(e);
      }
View Full Code Here


    }
  }

  public AbstractMethodMapping extensionMethodMappingAt_ifAbsent_(final st.gravel.core.Symbol _aSymbol, final st.gravel.support.jvm.Block0<AbstractMethodMapping> _aBlock) {
    for (final ExtensionClassPartMapping _ex : _extensions) {
      final AbstractMethodMapping _m;
      _m = _ex.methodMappingAt_ifAbsent_(_aSymbol, ((st.gravel.support.jvm.Block0<AbstractMethodMapping>) (new st.gravel.support.jvm.Block0<AbstractMethodMapping>() {

        @Override
        public AbstractMethodMapping value() {
          return (AbstractMethodMapping) null;
View Full Code Here

      @Override
      public Object value_value_(final String _methodName, final Integer _numArgs) {
        final st.gravel.core.Symbol _sel;
        _sel = _selectorConverter.functionNameAsSelector_(_methodName);
        if (_allSelectors[0].contains(_sel)) {
          final AbstractMethodMapping _methodMapping;
          _methodMapping = _systemMapping.methodMappingFrom_selector_(_superMapping[0], _sel);
          if ((_methodMapping != null) && (_methodMapping.methodNode() != null)) {
            return _aBlock.value_(_methodMapping.methodNode());
          }
        }
        return SystemMappingUpdater.this;
      }
    });
View Full Code Here

    _sel = _selectorConverter.functionNameAsSelector_(_methodName);
    return this.methodHandleFrom_selector_(_classMapping, _sel);
  }

  public java.lang.invoke.MethodHandle methodHandleFrom_selector_(final ClassMapping _classMapping, final st.gravel.core.Symbol _sel) {
    final AbstractMethodMapping _methodMapping;
    _methodMapping = this.methodMappingFrom_selector_(_classMapping, _sel);
    if (_methodMapping == null) {
      return null;
    }
    return _methodMapping.methodHandle();
  }
View Full Code Here

    return _classMapping.methodMappingAt_ifAbsent_(_sel, ((st.gravel.support.jvm.Block0<AbstractMethodMapping>) (new st.gravel.support.jvm.Block0<AbstractMethodMapping>() {

      @Override
      public AbstractMethodMapping value() {
        final Reference _superclassReference;
        AbstractMethodMapping _mapping;
        _superclassReference = _classMapping.superclassReferenceForMethodLookup();
        if (_superclassReference == null) {
          _mapping = null;
        } else {
          _mapping = SystemMapping.this.methodMappingFrom_selector_(((ClassMapping) SystemMapping.this.classMappingAtReference_(_superclassReference)), _sel);
View Full Code Here

TOP

Related Classes of st.gravel.support.compiler.ast.AbstractMethodMapping

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.