Mercurial > hg > truffle
annotate src/share/vm/graal/graalEnv.hpp @ 21195:a4b60873851b
LIRKind: add #merge().
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Thu, 23 Apr 2015 11:30:06 +0200 |
parents | 29916dcee0b8 |
children |
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, |
19766
29916dcee0b8
Verify dependencies when assertions are enabled
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
19487
diff
changeset
|
64 dependencies_invalid, |
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
|
65 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
|
66 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
|
67 }; |
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
|
68 |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
69 // 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
|
70 // 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
|
71 // 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
|
72 // 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
|
73 // 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
|
74 // 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
|
75 // |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
76 // 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
|
77 // |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
78 // 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
|
79 // 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
|
80 // that could potentially see it via delegation. |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
81 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
|
82 Symbol* klass_name, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
83 bool require_local); |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
84 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
85 // Constant pool access. |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
86 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
|
87 int klass_index, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
88 bool& is_accessible, |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
89 KlassHandle& loading_klass); |
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
90 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
|
91 int field_index); |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
92 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
|
93 int method_index, Bytecodes::Code bc, |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
94 instanceKlassHandle& loading_klass); |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
95 |
19321
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
96 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
|
97 |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
98 private: |
19321
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
99 CompileTask* _task; |
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
100 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
|
101 |
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
102 // 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
|
103 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
|
104 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
|
105 bool _jvmti_can_post_on_exceptions; |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
106 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
107 // 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
|
108 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
|
109 constantPoolHandle& cpool, |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
110 Symbol* klass_name, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
111 bool require_local); |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
112 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
|
113 int klass_index, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
114 bool& is_accessible, |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
115 KlassHandle& loading_klass); |
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
116 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
|
117 int field_index); |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
118 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
|
119 int method_index, Bytecodes::Code bc, |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
120 instanceKlassHandle& loading_klass); |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
121 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
122 // 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
|
123 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
|
124 static methodHandle lookup_method(instanceKlassHandle& accessor, |
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3661
diff
changeset
|
125 instanceKlassHandle& holder, |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
126 Symbol* name, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
127 Symbol* sig, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
128 Bytecodes::Code bc); |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
129 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
130 private: |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
131 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
132 // Is this thread currently in the VM state? |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
133 static bool is_in_vm(); |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
134 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
135 // 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
|
136 // with respect to concurrent class loading. |
19766
29916dcee0b8
Verify dependencies when assertions are enabled
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
19487
diff
changeset
|
137 static GraalEnv::CodeInstallResult check_for_system_dictionary_modification(Dependencies* target, Handle compiled_code, |
29916dcee0b8
Verify dependencies when assertions are enabled
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
19487
diff
changeset
|
138 GraalEnv* env, char** failure_detail); |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
139 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
140 public: |
19321
98592ae4b1fa
only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents:
14172
diff
changeset
|
141 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
|
142 |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
143 // 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
|
144 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
|
145 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
|
146 nmethod*& nm, |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
147 int entry_bci, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
148 CodeOffsets* offsets, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
149 int orig_pc_offset, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
150 CodeBuffer* code_buffer, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
151 int frame_words, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
152 OopMapSet* oop_map_set, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
153 ExceptionHandlerTable* handler_table, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
154 AbstractCompiler* compiler, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
155 DebugInformationRecorder* debug_info, |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
156 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
|
157 GraalEnv* env, |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
158 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
|
159 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
|
160 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
|
161 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
|
162 Handle speculation_log); |
3635
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
163 |
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
|
164 // 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
|
165 // 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
|
166 // 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
|
167 // 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
|
168 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
|
169 }; |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
170 |
cb1181db8bec
Initial port of ciEnv to graalEnv.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
171 #endif // SHARE_VM_GRAAL_GRAALENV_HPP |