# HG changeset patch # User Thomas Wuerthinger # Date 1339191316 -7200 # Node ID 80371cc2256dcfd3a5d64fb0d2ab6bdd03b917c0 # Parent 1c4af0e7517f9397186643ebd401b3beaf58adce Renaming RiCompiledMethod => InstalledCode. diff -r 1c4af0e7517f -r 80371cc2256d graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiDebugInfo.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiDebugInfo.java Fri Jun 08 23:28:45 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiDebugInfo.java Fri Jun 08 23:35:16 2012 +0200 @@ -24,8 +24,6 @@ import java.io.*; -import com.oracle.graal.api.meta.*; - /** * Represents the debugging information for a particular place in the code, * which includes the code position, a reference map, and deoptimization information. diff -r 1c4af0e7517f -r 80371cc2256d graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RiRuntime.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RiRuntime.java Fri Jun 08 23:28:45 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RiRuntime.java Fri Jun 08 23:35:16 2012 +0200 @@ -41,7 +41,7 @@ * @param code the code that should be disassembled * @return a disassembly. This will be of length 0 if the runtime does not support disassembling. */ - String disassemble(RiCodeInfo code, CiTargetMethod tm); + String disassemble(CodeInfo code, CiTargetMethod tm); /** * Returns the disassembly of the given method in a {@code javap}-like format. @@ -92,7 +92,7 @@ * Ignored if null, otherwise the info is written to index 0 of this array. * @return a reference to the compiled and ready-to-run code */ - RiCompiledMethod addMethod(RiResolvedMethod method, CiTargetMethod code, RiCodeInfo[] info); + RiCompiledMethod addMethod(RiResolvedMethod method, CiTargetMethod code, CodeInfo[] info); /** * Encodes a deoptimization action and a deoptimization reason in an integer value. diff -r 1c4af0e7517f -r 80371cc2256d graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/CodeInfo.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/CodeInfo.java Fri Jun 08 23:35:16 2012 +0200 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.api.meta; + +/** + * Represents some code installed in the code cache of the runtime. + * This encapsulated details are only for informational purposes. + * At any time, the runtime may invalidate the underlying code (e.g. due to deopt etc). + */ +public interface CodeInfo { + + /** + * Gets the start address of this installed code. + */ + long start(); + + /** + * Gets a copy of this installed code. + */ + byte[] code(); + + /** + * Gets the method (if any) from which this installed code was compiled. + */ + RiResolvedMethod method(); +} diff -r 1c4af0e7517f -r 80371cc2256d graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiCodeInfo.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiCodeInfo.java Fri Jun 08 23:28:45 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.api.meta; - -/** - * Represents some code installed in the code cache of the runtime. - * This encapsulated details are only for informational purposes. - * At any time, the runtime may invalidate the underlying code (e.g. due to deopt etc). - */ -public interface RiCodeInfo { - - /** - * Gets the start address of this installed code. - */ - long start(); - - /** - * Gets a copy of this installed code. - */ - byte[] code(); - - /** - * Gets the method (if any) from which this installed code was compiled. - */ - RiResolvedMethod method(); -} diff -r 1c4af0e7517f -r 80371cc2256d graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Fri Jun 08 23:28:45 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Fri Jun 08 23:35:16 2012 +0200 @@ -151,7 +151,7 @@ Debug.scope("CodeInstall", new Object[] {new DebugDumpScope(String.valueOf(id), true), compiler.getCompiler(), method}, new Runnable() { @Override public void run() { - final RiCodeInfo[] info = Debug.isDumpEnabled() ? new RiCodeInfo[1] : null; + final CodeInfo[] info = Debug.isDumpEnabled() ? new CodeInfo[1] : null; compiler.getRuntime().installMethod(method, tm, info); if (info != null) { Debug.dump(info[0], "After code installation"); diff -r 1c4af0e7517f -r 80371cc2256d graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCodeInfo.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCodeInfo.java Fri Jun 08 23:28:45 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCodeInfo.java Fri Jun 08 23:35:16 2012 +0200 @@ -27,9 +27,9 @@ import com.oracle.graal.hotspot.*; /** - * Implementation of {@link RiCodeInfo} for HotSpot. + * Implementation of {@link CodeInfo} for HotSpot. */ -public class HotSpotCodeInfo extends CompilerObject implements RiCodeInfo { +public class HotSpotCodeInfo extends CompilerObject implements CodeInfo { private static final long serialVersionUID = -6766490427732498354L; diff -r 1c4af0e7517f -r 80371cc2256d graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java Fri Jun 08 23:28:45 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java Fri Jun 08 23:35:16 2012 +0200 @@ -81,7 +81,7 @@ } @Override - public String disassemble(RiCodeInfo info, CiTargetMethod tm) { + public String disassemble(CodeInfo info, CiTargetMethod tm) { byte[] code = info.code(); CiTarget target = compiler.getTarget(); HexCodeFile hcf = new HexCodeFile(code, info.start(), target.arch.name, target.wordSize * 8); @@ -465,7 +465,7 @@ return (RiResolvedMethod) compiler.getCompilerToVM().getRiMethod(reflectionMethod); } - private static HotSpotCodeInfo makeInfo(RiResolvedMethod method, CiTargetMethod code, RiCodeInfo[] info) { + private static HotSpotCodeInfo makeInfo(RiResolvedMethod method, CiTargetMethod code, CodeInfo[] info) { HotSpotCodeInfo hsInfo = null; if (info != null && info.length > 0) { hsInfo = new HotSpotCodeInfo(code, (HotSpotMethodResolved) method); @@ -474,13 +474,13 @@ return hsInfo; } - public void installMethod(RiResolvedMethod method, CiTargetMethod code, RiCodeInfo[] info) { + public void installMethod(RiResolvedMethod method, CiTargetMethod code, CodeInfo[] info) { HotSpotCodeInfo hsInfo = makeInfo(method, code, info); compiler.getCompilerToVM().installMethod(new HotSpotTargetMethod((HotSpotMethodResolved) method, code), true, hsInfo); } @Override - public RiCompiledMethod addMethod(RiResolvedMethod method, CiTargetMethod code, RiCodeInfo[] info) { + public RiCompiledMethod addMethod(RiResolvedMethod method, CiTargetMethod code, CodeInfo[] info) { HotSpotCodeInfo hsInfo = makeInfo(method, code, info); return compiler.getCompilerToVM().installMethod(new HotSpotTargetMethod((HotSpotMethodResolved) method, code), false, hsInfo); } diff -r 1c4af0e7517f -r 80371cc2256d graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java Fri Jun 08 23:28:45 2012 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java Fri Jun 08 23:35:16 2012 +0200 @@ -140,7 +140,7 @@ } else if (object instanceof CiTargetMethod) { final CiTargetMethod tm = (CiTargetMethod) object; final byte[] code = Arrays.copyOf(tm.targetCode(), tm.targetCodeSize()); - RiCodeInfo info = new RiCodeInfo() { + CodeInfo info = new CodeInfo() { public RiResolvedMethod method() { return null; } @@ -152,8 +152,8 @@ } }; cfgPrinter.printMachineCode(runtime.disassemble(info, tm), message); - } else if (object instanceof RiCodeInfo) { - cfgPrinter.printMachineCode(runtime.disassemble((RiCodeInfo) object, null), message); + } else if (object instanceof CodeInfo) { + cfgPrinter.printMachineCode(runtime.disassemble((CodeInfo) object, null), message); } else if (object instanceof Interval[]) { cfgPrinter.printIntervals(message, (Interval[]) object); diff -r 1c4af0e7517f -r 80371cc2256d graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java --- a/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java Fri Jun 08 23:28:45 2012 +0200 +++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java Fri Jun 08 23:35:16 2012 +0200 @@ -160,7 +160,7 @@ return Debug.scope("CodeInstall", new Object[] {method}, new Callable() { @Override public RiCompiledMethod call() throws Exception { - final RiCodeInfo[] info = Debug.isDumpEnabled() ? new RiCodeInfo[1] : null; + final CodeInfo[] info = Debug.isDumpEnabled() ? new CodeInfo[1] : null; RiCompiledMethod installedMethod = runtime.addMethod(method, tm, info); if (info != null) { Debug.dump(info[0], "After code installation"); diff -r 1c4af0e7517f -r 80371cc2256d src/share/vm/classfile/vmSymbols.hpp --- a/src/share/vm/classfile/vmSymbols.hpp Fri Jun 08 23:28:45 2012 +0200 +++ b/src/share/vm/classfile/vmSymbols.hpp Fri Jun 08 23:35:16 2012 +0200 @@ -352,7 +352,7 @@ template(forObject_name, "forObject") \ template(callbackInternal_name, "callbackInternal") \ template(callback_signature, "(Ljava/lang/Object;)Ljava/lang/Object;") \ - template(MethodInvalidatedException, "com/oracle/graal/api/meta/RiCompiledMethod$MethodInvalidatedException") \ + template(MethodInvalidatedException, "com/oracle/graal/api/meta/InstalledCode$MethodInvalidatedException") \ \ \ /* common method and field names */ \ diff -r 1c4af0e7517f -r 80371cc2256d src/share/vm/graal/graalCompilerToVM.cpp --- a/src/share/vm/graal/graalCompilerToVM.cpp Fri Jun 08 23:28:45 2012 +0200 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Fri Jun 08 23:35:16 2012 +0200 @@ -897,7 +897,7 @@ HotSpotCodeInfo::set_start(info, (jlong) nm->code_begin()); } - // if install_code is true then we installed the code into the given method, no need to return an RiCompiledMethod + // if install_code is true then we installed the code into the given method, no need to return an InstalledCode if (!install_code && nm != NULL) { instanceKlass::cast(HotSpotCompiledMethod::klass())->initialize(CHECK_NULL); Handle obj = instanceKlass::cast(HotSpotCompiledMethod::klass())->allocate_permanent_instance(CHECK_NULL);