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.specialization; 014 015import org.jikesrvm.classloader.NormalMethod; 016import org.jikesrvm.compilers.common.CompiledMethod; 017 018interface SpecializationContext { 019 020 /** 021 * Finds or creates a specialized version of source for this 022 * context. Do NOT compile it immediately. However, DO 023 * allocate an spmd if needed. 024 * 025 * @param source the method that needs a specialized version 026 * @return the created specialized method 027 */ 028 SpecializedMethod findOrCreateSpecializedVersion(NormalMethod source); 029 030 /** 031 * Generates code for a specialized version of source in this 032 * context. 033 * 034 * @param source the method whose specialized version will be 035 * compiled 036 * @return the compiled method associated with the specialized method 037 * version 038 */ 039 CompiledMethod specialCompile(NormalMethod source); 040}