Mercurial > hg > truffle
annotate src/share/vm/graal/graalEnv.hpp @ 19579:3df56ce39922
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Tue, 24 Feb 2015 12:33:32 +0100 |
parents | fb38e004503c |
children | 29916dcee0b8 |
rev | line source |
---|---|
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
4 * |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
8 * |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
14 * |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
18 * |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
21 * questions. |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
22 * |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
23 */ |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
25 #ifndef SHARE_VM_GRAAL_GRAALENV_HPP |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
26 #define SHARE_VM_GRAAL_GRAALENV_HPP |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
27 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
28 #include "classfile/systemDictionary.hpp" |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
29 #include "code/debugInfoRec.hpp" |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
30 #include "code/dependencies.hpp" |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
31 #include "code/exceptionHandlerTable.hpp" |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
32 #include "compiler/oopMap.hpp" |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
33 #include "runtime/thread.hpp" |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
34 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
35 class CompileTask; |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
36 |
7126
ce248dc0a656
removed all Graal modifications to ci and c1
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
37 // Bring the Graal compiler thread into the VM state. |
ce248dc0a656
removed all Graal modifications to ci and c1
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
38 #define GRAAL_VM_ENTRY_MARK \ |
ce248dc0a656
removed all Graal modifications to ci and c1
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
39 JavaThread* thread = JavaThread::current(); \ |
ce248dc0a656
removed all Graal modifications to ci and c1
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
40 ThreadInVMfromNative __tiv(thread); \ |
ce248dc0a656
removed all Graal modifications to ci and c1
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
41 ResetNoHandleMark rnhm; \ |
ce248dc0a656
removed all Graal modifications to ci and c1
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
42 HandleMarkCleaner __hm(thread); \ |
ce248dc0a656
removed all Graal modifications to ci and c1
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
43 Thread* THREAD = thread; \ |
ce248dc0a656
removed all Graal modifications to ci and c1
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
44 debug_only(VMNativeEntryWrapper __vew;) |
ce248dc0a656
removed all Graal modifications to ci and c1
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
45 |
ce248dc0a656
removed all Graal modifications to ci and c1
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
46 #define GRAAL_EXCEPTION_CONTEXT \ |
ce248dc0a656
removed all Graal modifications to ci and c1
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
47 JavaThread* thread=JavaThread::current(); \ |
ce248dc0a656
removed all Graal modifications to ci and c1
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
48 Thread* THREAD = thread; |
ce248dc0a656
removed all Graal modifications to ci and c1
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
49 |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
50 // |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
51 // This class is the top level broker for requests from the compiler |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
52 // to the VM. |
19321
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
53 class GraalEnv : StackObj { |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
54 CI_PACKAGE_ACCESS_TO |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
55 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
56 friend class CompileBroker; |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
57 friend class Dependencies; // for get_object, during logging |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
58 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
59 public: |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
60 |
7089
af30115c9d0e
added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
Doug Simon <doug.simon@oracle.com>
parents:
7000
diff
changeset
|
61 enum CodeInstallResult { |
af30115c9d0e
added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
Doug Simon <doug.simon@oracle.com>
parents:
7000
diff
changeset
|
62 ok, |
af30115c9d0e
added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
Doug Simon <doug.simon@oracle.com>
parents:
7000
diff
changeset
|
63 dependencies_failed, |
10540
0ba44a5a8420
Add sanity check to avoid overwriting the reserved code buffer for very large methods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9191
diff
changeset
|
64 cache_full, |
0ba44a5a8420
Add sanity check to avoid overwriting the reserved code buffer for very large methods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9191
diff
changeset
|
65 code_too_large |
7089
af30115c9d0e
added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
Doug Simon <doug.simon@oracle.com>
parents:
7000
diff
changeset
|
66 }; |
af30115c9d0e
added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
Doug Simon <doug.simon@oracle.com>
parents:
7000
diff
changeset
|
67 |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
68 // Look up a klass by name from a particular class loader (the accessor's). |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
69 // If require_local, result must be defined in that class loader, or NULL. |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
70 // If !require_local, a result from remote class loader may be reported, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
71 // if sufficient class loader constraints exist such that initiating |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
72 // a class loading request from the given loader is bound to return |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
73 // the class defined in the remote loader (or throw an error). |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
74 // |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
75 // Return an unloaded klass if !require_local and no class at all is found. |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
76 // |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
77 // The CI treats a klass as loaded if it is consistently defined in |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
78 // another loader, even if it hasn't yet been loaded in all loaders |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
79 // that could potentially see it via delegation. |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
80 static KlassHandle get_klass_by_name(KlassHandle& accessing_klass, |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
81 Symbol* klass_name, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
82 bool require_local); |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
83 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
84 // Constant pool access. |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
85 static KlassHandle get_klass_by_index(constantPoolHandle& cpool, |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
86 int klass_index, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
87 bool& is_accessible, |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
88 KlassHandle& loading_klass); |
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
89 static void get_field_by_index(instanceKlassHandle& loading_klass, fieldDescriptor& fd, |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
90 int field_index); |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
91 static methodHandle get_method_by_index(constantPoolHandle& cpool, |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
92 int method_index, Bytecodes::Code bc, |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
93 instanceKlassHandle& loading_klass); |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
94 |
19321
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
95 GraalEnv(CompileTask* task, int system_dictionary_modification_counter); |
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
96 |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
97 private: |
19321
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
98 CompileTask* _task; |
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
99 int _system_dictionary_modification_counter; |
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
100 |
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
101 // Cache JVMTI state |
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
102 bool _jvmti_can_hotswap_or_post_breakpoint; |
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
103 bool _jvmti_can_access_local_variables; |
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
104 bool _jvmti_can_post_on_exceptions; |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
105 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
106 // Implementation methods for loading and constant pool access. |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
107 static KlassHandle get_klass_by_name_impl(KlassHandle& accessing_klass, |
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
108 constantPoolHandle& cpool, |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
109 Symbol* klass_name, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
110 bool require_local); |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
111 static KlassHandle get_klass_by_index_impl(constantPoolHandle& cpool, |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
112 int klass_index, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
113 bool& is_accessible, |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
114 KlassHandle& loading_klass); |
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
115 static void get_field_by_index_impl(instanceKlassHandle& loading_klass, fieldDescriptor& fd, |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
116 int field_index); |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
117 static methodHandle get_method_by_index_impl(constantPoolHandle& cpool, |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
118 int method_index, Bytecodes::Code bc, |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
119 instanceKlassHandle& loading_klass); |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
120 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
121 // Helper methods |
6948
e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents:
5747
diff
changeset
|
122 static bool check_klass_accessibility(KlassHandle accessing_klass, KlassHandle resolved_klass); |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
123 static methodHandle lookup_method(instanceKlassHandle& accessor, |
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
124 instanceKlassHandle& holder, |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
125 Symbol* name, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
126 Symbol* sig, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
127 Bytecodes::Code bc); |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
128 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
129 private: |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
130 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
131 // Is this thread currently in the VM state? |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
132 static bool is_in_vm(); |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
133 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
134 // Helper routine for determining the validity of a compilation |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
135 // with respect to concurrent class loading. |
19487
fb38e004503c
moved creation of String for detailed dependency failure message outside of no safepoint region
Doug Simon <doug.simon@oracle.com>
parents:
19426
diff
changeset
|
136 static bool check_for_system_dictionary_modification(Dependencies* target, Handle compiled_code, GraalEnv* env, char** failure_detail); |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
137 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
138 public: |
19321
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
139 CompileTask* task() { return _task; } |
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
140 |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
141 // Register the result of a compilation. |
7089
af30115c9d0e
added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
Doug Simon <doug.simon@oracle.com>
parents:
7000
diff
changeset
|
142 static GraalEnv::CodeInstallResult register_method( |
af30115c9d0e
added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
Doug Simon <doug.simon@oracle.com>
parents:
7000
diff
changeset
|
143 methodHandle& target, |
af30115c9d0e
added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
Doug Simon <doug.simon@oracle.com>
parents:
7000
diff
changeset
|
144 nmethod*& nm, |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
145 int entry_bci, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
146 CodeOffsets* offsets, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
147 int orig_pc_offset, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
148 CodeBuffer* code_buffer, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
149 int frame_words, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
150 OopMapSet* oop_map_set, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
151 ExceptionHandlerTable* handler_table, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
152 AbstractCompiler* compiler, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
153 DebugInformationRecorder* debug_info, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
154 Dependencies* dependencies, |
19321
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
155 GraalEnv* env, |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
156 int compile_id, |
6948
e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents:
5747
diff
changeset
|
157 bool has_unsafe_access, |
8215
b89a97928e72
Implement weak reference semantics for HotSpotInstalledCode in the default method installation case. Add new boolean[] array as parameter to the code installation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7935
diff
changeset
|
158 Handle installed_code, |
19426
dd8989d5547f
provide more detail when Graal code installation fails due to a failed dependency check
Doug Simon <doug.simon@oracle.com>
parents:
19321
diff
changeset
|
159 Handle compiled_code, |
13641
5a9afbf72714
Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13170
diff
changeset
|
160 Handle speculation_log); |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
161 |
7094
eec7173947a1
removed remaining use of the C++ "compiler interface" (i.e. ci) by Graal for installing dependencies
Doug Simon <doug.simon@oracle.com>
parents:
7089
diff
changeset
|
162 // converts the Klass* representing the holder of a method into a |
eec7173947a1
removed remaining use of the C++ "compiler interface" (i.e. ci) by Graal for installing dependencies
Doug Simon <doug.simon@oracle.com>
parents:
7089
diff
changeset
|
163 // InstanceKlass*. This is needed since the holder of a method in |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
164 // the bytecodes could be an array type. Basically this converts |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
165 // array types into java/lang/Object and other types stay as they are. |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
166 static instanceKlassHandle get_instance_klass_for_declared_method_holder(KlassHandle& klass); |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
167 }; |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
168 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
169 #endif // SHARE_VM_GRAAL_GRAALENV_HPP |