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     */
013    package org.jikesrvm.adaptive;
014    
015    import org.jikesrvm.classloader.RVMField;
016    import org.jikesrvm.classloader.NormalMethod;
017    import static org.jikesrvm.runtime.EntrypointHelper.getField;
018    import static org.jikesrvm.runtime.EntrypointHelper.getMethod;
019    
020    /**
021     * Entrypoints that are valid when the build includes the adaptive optimization system.
022     */
023    public interface AosEntrypoints {
024      NormalMethod osrGetRefAtMethod =
025          getMethod(org.jikesrvm.osr.ObjectHolder.class, "getRefAt", "(II)Ljava/lang/Object;");
026      NormalMethod osrCleanRefsMethod = getMethod(org.jikesrvm.osr.ObjectHolder.class, "cleanRefs", "(I)V");
027      RVMField methodListenerNumSamplesField =
028          getField(org.jikesrvm.adaptive.measurements.listeners.MethodListener.class, "numSamples", int.class);
029      RVMField edgeListenerUpdateCalledField =
030          getField(org.jikesrvm.adaptive.measurements.listeners.EdgeListener.class, "updateCalled", int.class);
031      RVMField edgeListenerSamplesTakenField =
032          getField(org.jikesrvm.adaptive.measurements.listeners.EdgeListener.class, "samplesTaken", int.class);
033      RVMField yieldCountListenerNumYieldsField =
034          getField(org.jikesrvm.adaptive.measurements.listeners.YieldCounterListener.class, "numYields", int.class);
035      RVMField counterArrayManagerCounterArraysField =
036          getField(org.jikesrvm.adaptive.measurements.instrumentation.CounterArrayManager.class, "counterArrays", double[][].class);
037      RVMField invocationCountsField =
038          getField(org.jikesrvm.adaptive.recompilation.InvocationCounts.class, "counts", int[].class);
039      NormalMethod invocationCounterTrippedMethod =
040          getMethod(org.jikesrvm.adaptive.recompilation.InvocationCounts.class, "counterTripped", "(I)V");
041      RVMField globalCBSField =
042          getField(org.jikesrvm.adaptive.recompilation.instrumentation.CounterBasedSampling.class, "globalCounter", int.class);
043      RVMField threadCBSField = getField(org.jikesrvm.scheduler.RVMThread.class, "thread_cbs_counter", int.class);
044      RVMField cbsResetValueField =
045          getField(org.jikesrvm.adaptive.recompilation.instrumentation.CounterBasedSampling.class, "resetValue", int.class);
046      RVMField specializedMethodsField =
047          getField(org.jikesrvm.compilers.opt.specialization.SpecializedMethodPool.class,
048                   "specializedMethods",
049                   org.jikesrvm.ArchitectureSpecific.CodeArray[].class);
050    }