001/*
002 *  This file is part of the Jikes RVM project (http://jikesrvm.org).
003 *
004 *  This file is licensed to You under the Eclipse Public License (EPL);
005 *  You may not use this file except in compliance with the License. You
006 *  may obtain a copy of the License at
007 *
008 *      http://www.opensource.org/licenses/eclipse-1.0.php
009 *
010 *  See the COPYRIGHT.txt file distributed with this work for information
011 *  regarding copyright ownership.
012 */
013package org.jikesrvm.classloader;
014
015import org.jikesrvm.compilers.common.CompiledMethod;
016import org.jikesrvm.runtime.Entrypoints;
017
018/**
019 * An abstract method of a java class.
020 */
021public final class AbstractMethod extends RVMMethod {
022
023  /**
024   * Construct abstract method information
025   *
026   * @param declaringClass the TypeReference object of the class that declared this method
027   * @param memRef the canonical memberReference for this member.
028   * @param modifiers modifiers associated with this member.
029   * @param exceptionTypes exceptions thrown by this method.
030   * @param signature generic type of this method.
031   * @param annotations array of runtime visible annotations
032   * @param parameterAnnotations array of runtime visible parameter annotations
033   * @param annotationDefault value for this annotation that appears
034   */
035  AbstractMethod(TypeReference declaringClass, MemberReference memRef, short modifiers,
036                    TypeReference[] exceptionTypes, Atom signature, RVMAnnotation[] annotations,
037                    RVMAnnotation[][] parameterAnnotations, Object annotationDefault) {
038    super(declaringClass,
039          memRef,
040          modifiers,
041          exceptionTypes,
042          signature,
043          annotations,
044          parameterAnnotations,
045          annotationDefault);
046  }
047
048  /**
049   * By definition, abstract methods do not have associated code. Therefore,
050   * this method will return an error handling method from
051   * RuntimeEntrypoints that will raise an {@link AbstractMethodError}
052   * when it is invoked.
053   *
054   * @see org.jikesrvm.runtime.RuntimeEntrypoints
055   */
056  @Override
057  protected CompiledMethod genCode() {
058    Entrypoints.unexpectedAbstractMethodCallMethod.compile();
059    return Entrypoints.unexpectedAbstractMethodCallMethod.getCurrentCompiledMethod();
060  }
061}