annotate graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/InstalledCode.java @ 6539:2463eb24b644

Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
author Christian Wimmer <christian.wimmer@oracle.com>
date Tue, 09 Oct 2012 15:23:38 -0700
parents 4241af3ec314
children 5e3d1a68664e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
5855
0278da961319 moved InstalledCode from graal.api.meta to graal.api.code
Doug Simon <doug.simon@oracle.com>
parents: 5541
diff changeset
23 package com.oracle.graal.api.code;
0278da961319 moved InstalledCode from graal.api.meta to graal.api.code
Doug Simon <doug.simon@oracle.com>
parents: 5541
diff changeset
24
0278da961319 moved InstalledCode from graal.api.meta to graal.api.code
Doug Simon <doug.simon@oracle.com>
parents: 5541
diff changeset
25 import com.oracle.graal.api.meta.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
26
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
27 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
28 * Represents a compiled instance of a method. It may have been invalidated or removed in the meantime.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
29 */
5538
e18ba36bfebc Renamed RiConstant => Constant.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5507
diff changeset
30 public interface InstalledCode {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
31
6331
4241af3ec314 More comments on InstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5855
diff changeset
32 /**
4241af3ec314 More comments on InstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5855
diff changeset
33 * Exception thrown by the runtime in case an invalidated machine code is called.
4241af3ec314 More comments on InstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5855
diff changeset
34 */
4993
897b7d18bebc added RiCompiledMethod.execute and the required VM infrastructure
Lukas Stadler <lukas.stadler@jku.at>
parents: 4199
diff changeset
35 public abstract class MethodInvalidatedException extends RuntimeException {
897b7d18bebc added RiCompiledMethod.execute and the required VM infrastructure
Lukas Stadler <lukas.stadler@jku.at>
parents: 4199
diff changeset
36
897b7d18bebc added RiCompiledMethod.execute and the required VM infrastructure
Lukas Stadler <lukas.stadler@jku.at>
parents: 4199
diff changeset
37 private static final long serialVersionUID = -3540232440794244844L;
897b7d18bebc added RiCompiledMethod.execute and the required VM infrastructure
Lukas Stadler <lukas.stadler@jku.at>
parents: 4199
diff changeset
38 }
897b7d18bebc added RiCompiledMethod.execute and the required VM infrastructure
Lukas Stadler <lukas.stadler@jku.at>
parents: 4199
diff changeset
39
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
40 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41 * Returns the method to which the compiled code belongs.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
42 */
6539
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 6331
diff changeset
43 ResolvedJavaMethod getMethod();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
44
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
45 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
46 * @return true if the code represented by this object is still valid, false otherwise (may happen due to deopt, etc.)
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
48 boolean isValid();
4993
897b7d18bebc added RiCompiledMethod.execute and the required VM infrastructure
Lukas Stadler <lukas.stadler@jku.at>
parents: 4199
diff changeset
49
6331
4241af3ec314 More comments on InstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5855
diff changeset
50 /**
4241af3ec314 More comments on InstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5855
diff changeset
51 * Executes the installed code with three object arguments.
4241af3ec314 More comments on InstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5855
diff changeset
52 * @param arg1 the first argument
4241af3ec314 More comments on InstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5855
diff changeset
53 * @param arg2 the second argument
4241af3ec314 More comments on InstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5855
diff changeset
54 * @param arg3 the third argument
4241af3ec314 More comments on InstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5855
diff changeset
55 * @return the value returned by the executed code
4241af3ec314 More comments on InstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5855
diff changeset
56 */
4993
897b7d18bebc added RiCompiledMethod.execute and the required VM infrastructure
Lukas Stadler <lukas.stadler@jku.at>
parents: 4199
diff changeset
57 Object execute(Object arg1, Object arg2, Object arg3);
5246
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 4993
diff changeset
58
6331
4241af3ec314 More comments on InstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5855
diff changeset
59 /**
4241af3ec314 More comments on InstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5855
diff changeset
60 * Executes the installed code with a variable number of arguments.
4241af3ec314 More comments on InstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5855
diff changeset
61 * @param args the array of object arguments
4241af3ec314 More comments on InstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5855
diff changeset
62 * @return the value returned by the executed code
4241af3ec314 More comments on InstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5855
diff changeset
63 */
5246
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 4993
diff changeset
64 Object executeVarargs(Object... args);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
65 }