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.compilers.opt.escape; 014 015import org.jikesrvm.classloader.RVMMethod; 016import org.jikesrvm.util.ImmutableEntryHashMapRVM; 017 018/** 019 * Class that holds method summary information. 020 * This class is a Singleton. 021 * 022 * <p> This database holds summaries: 023 * <ul> 024 * <li>MethodSummary, indexed by RVMMethod 025 * </ul> 026 */ 027class SummaryDatabase { 028 029 public static synchronized MethodSummary findMethodSummary(RVMMethod m) { 030 return hash.get(m); 031 } 032 033 public static synchronized MethodSummary findOrCreateMethodSummary(RVMMethod m) { 034 MethodSummary result = findMethodSummary(m); 035 if (result == null) { 036 result = new MethodSummary(m); 037 hash.put(m, result); 038 } 039 return result; 040 } 041 042 private static final ImmutableEntryHashMapRVM<RVMMethod, MethodSummary> hash = 043 new ImmutableEntryHashMapRVM<RVMMethod, MethodSummary>(); 044}