Mercurial > hg > truffle
comparison graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/InstalledCode.java @ 9023:f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Thu, 11 Apr 2013 17:36:46 +0200 |
parents | 8d6ea1915d42 |
children | 64dcb92ee75a |
comparison
equal
deleted
inserted
replaced
9002:7844a36d0216 | 9023:f94bb5d20e5d |
---|---|
29 * meantime. | 29 * meantime. |
30 */ | 30 */ |
31 public interface InstalledCode { | 31 public interface InstalledCode { |
32 | 32 |
33 /** | 33 /** |
34 * Exception thrown by the runtime in case an invalidated machine code is called. | |
35 */ | |
36 public abstract class MethodInvalidatedException extends RuntimeException { | |
37 | |
38 private static final long serialVersionUID = -3540232440794244844L; | |
39 } | |
40 | |
41 /** | |
42 * Returns the method (if any) to which the installed code belongs. | 34 * Returns the method (if any) to which the installed code belongs. |
43 */ | 35 */ |
44 ResolvedJavaMethod getMethod(); | 36 ResolvedJavaMethod getMethod(); |
45 | 37 |
46 /** | 38 /** |
59 * happen due to deopt, etc.) | 51 * happen due to deopt, etc.) |
60 */ | 52 */ |
61 boolean isValid(); | 53 boolean isValid(); |
62 | 54 |
63 /** | 55 /** |
56 * Invalidates this installed code such that any subsequent invocation will throw an | |
57 * {@link InvalidInstalledCodeException}. | |
58 */ | |
59 void invalidate(); | |
60 | |
61 /** | |
64 * Executes the installed code with three object arguments. | 62 * Executes the installed code with three object arguments. |
65 * | 63 * |
66 * @param arg1 the first argument | 64 * @param arg1 the first argument |
67 * @param arg2 the second argument | 65 * @param arg2 the second argument |
68 * @param arg3 the third argument | 66 * @param arg3 the third argument |
69 * @return the value returned by the executed code | 67 * @return the value returned by the executed code |
70 */ | 68 */ |
71 Object execute(Object arg1, Object arg2, Object arg3); | 69 Object execute(Object arg1, Object arg2, Object arg3) throws InvalidInstalledCodeException; |
72 | 70 |
73 /** | 71 /** |
74 * Executes the installed code with a variable number of arguments. | 72 * Executes the installed code with a variable number of arguments. |
75 * | 73 * |
76 * @param args the array of object arguments | 74 * @param args the array of object arguments |
77 * @return the value returned by the executed code | 75 * @return the value returned by the executed code |
78 */ | 76 */ |
79 Object executeVarargs(Object... args); | 77 Object executeVarargs(Object... args) throws InvalidInstalledCodeException; |
80 } | 78 } |