12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 #include "precompiled.hpp"
25
26 #include "aot/aotCodeHeap.hpp"
27 #include "aot/aotLoader.inline.hpp"
28 #include "jvmci/jvmciRuntime.hpp"
29 #include "oops/method.hpp"
30 #include "prims/jvm.h"
31 #include "runtime/os.hpp"
32
33 GrowableArray<AOTCodeHeap*>* AOTLoader::_heaps = new(ResourceObj::C_HEAP, mtCode) GrowableArray<AOTCodeHeap*> (2, true);
34 GrowableArray<AOTLib*>* AOTLoader::_libraries = new(ResourceObj::C_HEAP, mtCode) GrowableArray<AOTLib*> (2, true);
35
36 // Iterate over all AOT CodeHeaps
37 #define FOR_ALL_AOT_HEAPS(heap) for (GrowableArrayIterator<AOTCodeHeap*> heap = heaps()->begin(); heap != heaps()->end(); ++heap)
38 // Iterate over all AOT Libraries
39 #define FOR_ALL_AOT_LIBRARIES(lib) for (GrowableArrayIterator<AOTLib*> lib = libraries()->begin(); lib != libraries()->end(); ++lib)
40
41 void AOTLoader::load_for_klass(InstanceKlass* ik, Thread* thread) {
42 if (UseAOT) {
43 FOR_ALL_AOT_HEAPS(heap) {
44 (*heap)->load_klass_data(ik, thread);
45 }
46 }
47 }
48
49 uint64_t AOTLoader::get_saved_fingerprint(InstanceKlass* ik) {
50 FOR_ALL_AOT_HEAPS(heap) {
51 AOTKlassData* klass_data = (*heap)->find_klass(ik);
95 // make non entrant and mark for deoptimization
96 FOR_ALL_AOT_HEAPS(heap) {
97 (*heap)->flush_evol_dependents_on(dependee);
98 }
99 Deoptimization::deoptimize_dependents();
100 }
101
102 /**
103 * List of core modules for which we search for shared libraries.
104 */
105 static const char* modules[] = {
106 "java.base",
107 "java.logging",
108 "jdk.compiler",
109 "jdk.scripting.nashorn",
110 "jdk.internal.vm.ci",
111 "jdk.internal.vm.compiler"
112 };
113
114 void AOTLoader::initialize() {
115 if (FLAG_IS_DEFAULT(UseAOT) && AOTLibrary != NULL) {
116 // Don't need to set UseAOT on command line when AOTLibrary is specified
117 FLAG_SET_DEFAULT(UseAOT, true);
118 }
119 if (UseAOT) {
120 // EagerInitialization is not compatible with AOT
121 if (EagerInitialization) {
122 if (PrintAOT) {
123 warning("EagerInitialization is not compatible with AOT (switching AOT off)");
124 }
125 FLAG_SET_DEFAULT(UseAOT, false);
126 return;
127 }
128
129 // -Xint is not compatible with AOT
130 if (Arguments::is_interpreter_only()) {
131 if (PrintAOT) {
132 warning("-Xint is not compatible with AOT (switching AOT off)");
133 }
134 FLAG_SET_DEFAULT(UseAOT, false);
|
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 #include "precompiled.hpp"
25
26 #include "aot/aotCodeHeap.hpp"
27 #include "aot/aotLoader.inline.hpp"
28 #include "jvmci/jvmciRuntime.hpp"
29 #include "oops/method.hpp"
30 #include "prims/jvm.h"
31 #include "runtime/os.hpp"
32 #include "runtime/timerTrace.hpp"
33
34 GrowableArray<AOTCodeHeap*>* AOTLoader::_heaps = new(ResourceObj::C_HEAP, mtCode) GrowableArray<AOTCodeHeap*> (2, true);
35 GrowableArray<AOTLib*>* AOTLoader::_libraries = new(ResourceObj::C_HEAP, mtCode) GrowableArray<AOTLib*> (2, true);
36
37 // Iterate over all AOT CodeHeaps
38 #define FOR_ALL_AOT_HEAPS(heap) for (GrowableArrayIterator<AOTCodeHeap*> heap = heaps()->begin(); heap != heaps()->end(); ++heap)
39 // Iterate over all AOT Libraries
40 #define FOR_ALL_AOT_LIBRARIES(lib) for (GrowableArrayIterator<AOTLib*> lib = libraries()->begin(); lib != libraries()->end(); ++lib)
41
42 void AOTLoader::load_for_klass(InstanceKlass* ik, Thread* thread) {
43 if (UseAOT) {
44 FOR_ALL_AOT_HEAPS(heap) {
45 (*heap)->load_klass_data(ik, thread);
46 }
47 }
48 }
49
50 uint64_t AOTLoader::get_saved_fingerprint(InstanceKlass* ik) {
51 FOR_ALL_AOT_HEAPS(heap) {
52 AOTKlassData* klass_data = (*heap)->find_klass(ik);
96 // make non entrant and mark for deoptimization
97 FOR_ALL_AOT_HEAPS(heap) {
98 (*heap)->flush_evol_dependents_on(dependee);
99 }
100 Deoptimization::deoptimize_dependents();
101 }
102
103 /**
104 * List of core modules for which we search for shared libraries.
105 */
106 static const char* modules[] = {
107 "java.base",
108 "java.logging",
109 "jdk.compiler",
110 "jdk.scripting.nashorn",
111 "jdk.internal.vm.ci",
112 "jdk.internal.vm.compiler"
113 };
114
115 void AOTLoader::initialize() {
116 TraceTime timer("AOT initialization", TRACETIME_LOG(Info, aot, startuptime));
117
118 if (FLAG_IS_DEFAULT(UseAOT) && AOTLibrary != NULL) {
119 // Don't need to set UseAOT on command line when AOTLibrary is specified
120 FLAG_SET_DEFAULT(UseAOT, true);
121 }
122 if (UseAOT) {
123 // EagerInitialization is not compatible with AOT
124 if (EagerInitialization) {
125 if (PrintAOT) {
126 warning("EagerInitialization is not compatible with AOT (switching AOT off)");
127 }
128 FLAG_SET_DEFAULT(UseAOT, false);
129 return;
130 }
131
132 // -Xint is not compatible with AOT
133 if (Arguments::is_interpreter_only()) {
134 if (PrintAOT) {
135 warning("-Xint is not compatible with AOT (switching AOT off)");
136 }
137 FLAG_SET_DEFAULT(UseAOT, false);
|