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.adaptive.measurements.instrumentation; 014 015import org.jikesrvm.VM; 016import org.jikesrvm.adaptive.measurements.Reportable; 017import org.jikesrvm.compilers.opt.InstrumentedEventCounterManager; 018 019/** 020 * An instance of this class is used to store method counters. It is 021 * initialized at startup, and instrumentation phase 022 * InsertMethodInvocationCounter inserts instrumentation that 023 * writes into this data. 024 */ 025public final class MethodInvocationCounterData extends ManagedCounterData implements Reportable { 026 027 /** 028 * @param manager The manager that will provide the counter space 029 */ 030 MethodInvocationCounterData(InstrumentedEventCounterManager manager) { 031 super(manager); 032 } 033 034 /** 035 * Called on system exit 036 */ 037 @Override 038 public void report() { 039 super.report(new MethodNameFunction()); 040 } 041 042 @Override 043 public void reset() { 044 if (VM.VerifyAssertions) { 045 VM._assert(VM.NOT_REACHED, "TODO: implement reset for BasicBlockCounterDatabase"); 046 } 047 } 048 049} 050 051