Mercurial > hg > graal-jvmci-8
annotate graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java @ 12484:2d8a8980eda8
Canonicalize DynamicDeoptimize nodes back to Deoptimize when used with a constant reason&action
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Thu, 17 Oct 2013 18:18:05 +0200 |
parents | f53dc8bbb88c |
children | 38b84d5a66fd |
rev | line source |
---|---|
5509
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved. |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
4 * |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
8 * |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
14 * |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
18 * |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
21 * questions. |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
22 */ |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
23 package com.oracle.graal.api.meta; |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
5535
e624cded7986
Moving methods from RiRuntime to MetaAccessProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5509
diff
changeset
|
25 import java.lang.reflect.*; |
e624cded7986
Moving methods from RiRuntime to MetaAccessProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5509
diff
changeset
|
26 |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
6328
diff
changeset
|
27 /** |
12045
0fc653a9e019
made GraalCodeCacheProvider independent of CodeCacheProvider and renamed the former to LoweringProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
11839
diff
changeset
|
28 * Provides access to the metadata of a class typically provided in a class file. |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
6328
diff
changeset
|
29 */ |
5509
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
30 public interface MetaAccessProvider { |
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
31 |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
6328
diff
changeset
|
32 /** |
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
6328
diff
changeset
|
33 * Returns the resolved Java type representing a given Java class. |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7359
diff
changeset
|
34 * |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
6328
diff
changeset
|
35 * @param clazz the Java class object |
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
6328
diff
changeset
|
36 * @return the resolved Java type object |
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
6328
diff
changeset
|
37 */ |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7359
diff
changeset
|
38 ResolvedJavaType lookupJavaType(Class<?> clazz); |
5535
e624cded7986
Moving methods from RiRuntime to MetaAccessProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5509
diff
changeset
|
39 |
e624cded7986
Moving methods from RiRuntime to MetaAccessProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5509
diff
changeset
|
40 /** |
6442
45f682f7fea8
Add MetaAccessProvider.getResolvedJavaField to convert from reflection field to metadata field
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6329
diff
changeset
|
41 * Provides the {@link ResolvedJavaMethod} for a {@link Method} obtained via reflection. |
5535
e624cded7986
Moving methods from RiRuntime to MetaAccessProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5509
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:
6442
diff
changeset
|
43 ResolvedJavaMethod lookupJavaMethod(Method reflectionMethod); |
5535
e624cded7986
Moving methods from RiRuntime to MetaAccessProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5509
diff
changeset
|
44 |
e624cded7986
Moving methods from RiRuntime to MetaAccessProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5509
diff
changeset
|
45 /** |
7044
34753b057324
added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
7015
diff
changeset
|
46 * Provides the {@link ResolvedJavaMethod} for a {@link Constructor} obtained via reflection. |
34753b057324
added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
7015
diff
changeset
|
47 */ |
34753b057324
added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
7015
diff
changeset
|
48 ResolvedJavaMethod lookupJavaConstructor(Constructor reflectionConstructor); |
34753b057324
added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
7015
diff
changeset
|
49 |
34753b057324
added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
7015
diff
changeset
|
50 /** |
6442
45f682f7fea8
Add MetaAccessProvider.getResolvedJavaField to convert from reflection field to metadata field
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6329
diff
changeset
|
51 * Provides the {@link ResolvedJavaField} for a {@link Field} obtained via reflection. |
45f682f7fea8
Add MetaAccessProvider.getResolvedJavaField to convert from reflection field to metadata field
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6329
diff
changeset
|
52 */ |
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:
6442
diff
changeset
|
53 ResolvedJavaField lookupJavaField(Field reflectionField); |
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:
6442
diff
changeset
|
54 |
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:
6442
diff
changeset
|
55 /** |
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:
6442
diff
changeset
|
56 * Returns the resolved Java type of the given {@link Constant} object. |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7359
diff
changeset
|
57 * |
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:
6442
diff
changeset
|
58 * @return {@code null} if {@code constant.isNull() || !constant.kind.isObject()} |
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:
6442
diff
changeset
|
59 */ |
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:
6442
diff
changeset
|
60 ResolvedJavaType lookupJavaType(Constant constant); |
6442
45f682f7fea8
Add MetaAccessProvider.getResolvedJavaField to convert from reflection field to metadata field
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6329
diff
changeset
|
61 |
45f682f7fea8
Add MetaAccessProvider.getResolvedJavaField to convert from reflection field to metadata field
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6329
diff
changeset
|
62 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7359
diff
changeset
|
63 * Parses a <a |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7359
diff
changeset
|
64 * href="http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.3">method |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7359
diff
changeset
|
65 * descriptor</a> into a {@link Signature}. The behavior of this method is undefined if the |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7359
diff
changeset
|
66 * method descriptor is not well formed. |
7359
6a16788a29a6
added API method for parsing a valid Method Descriptor string (JVMS 4.3.3) into a Signature object
Doug Simon <doug.simon@oracle.com>
parents:
7044
diff
changeset
|
67 */ |
6a16788a29a6
added API method for parsing a valid Method Descriptor string (JVMS 4.3.3) into a Signature object
Doug Simon <doug.simon@oracle.com>
parents:
7044
diff
changeset
|
68 Signature parseMethodDescriptor(String methodDescriptor); |
6a16788a29a6
added API method for parsing a valid Method Descriptor string (JVMS 4.3.3) into a Signature object
Doug Simon <doug.simon@oracle.com>
parents:
7044
diff
changeset
|
69 |
6a16788a29a6
added API method for parsing a valid Method Descriptor string (JVMS 4.3.3) into a Signature object
Doug Simon <doug.simon@oracle.com>
parents:
7044
diff
changeset
|
70 /** |
11839
0e2cceed1caf
Temporarily move encodeDeoptActionAndReason to MetaAccessProvider
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11682
diff
changeset
|
71 * Encodes a deoptimization action and a deoptimization reason in an integer value. |
0e2cceed1caf
Temporarily move encodeDeoptActionAndReason to MetaAccessProvider
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11682
diff
changeset
|
72 * |
0e2cceed1caf
Temporarily move encodeDeoptActionAndReason to MetaAccessProvider
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11682
diff
changeset
|
73 * @return the encoded value as an integer |
0e2cceed1caf
Temporarily move encodeDeoptActionAndReason to MetaAccessProvider
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11682
diff
changeset
|
74 */ |
0e2cceed1caf
Temporarily move encodeDeoptActionAndReason to MetaAccessProvider
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11682
diff
changeset
|
75 Constant encodeDeoptActionAndReason(DeoptimizationAction action, DeoptimizationReason reason); |
12484
2d8a8980eda8
Canonicalize DynamicDeoptimize nodes back to Deoptimize when used with a constant reason&action
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
12362
diff
changeset
|
76 |
2d8a8980eda8
Canonicalize DynamicDeoptimize nodes back to Deoptimize when used with a constant reason&action
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
12362
diff
changeset
|
77 DeoptimizationReason decodeDeoptReason(Constant constant); |
2d8a8980eda8
Canonicalize DynamicDeoptimize nodes back to Deoptimize when used with a constant reason&action
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
12362
diff
changeset
|
78 |
2d8a8980eda8
Canonicalize DynamicDeoptimize nodes back to Deoptimize when used with a constant reason&action
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
12362
diff
changeset
|
79 DeoptimizationAction decodeDeoptAction(Constant constant); |
5509
6ed763809de7
Added new projects graal.api.code and graal.api.interpreter
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
80 } |