1 /* 2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 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 #ifndef SHARE_VM_AOT_AOTLOADER_HPP 25 #define SHARE_VM_AOT_AOTLOADER_HPP 26 27 #include "runtime/globals_extension.hpp" 28 29 class AOTCodeHeap; 30 class CodeBlob; 31 template <class T> class GrowableArray; 32 class instanceKlassHandle; 33 class InstanceKlass; 34 class JavaThread; 35 class Metadata; 36 class OopClosure; 37 38 class AOTLoader { 39 private: 40 #if INCLUDE_AOT 41 static GrowableArray<AOTCodeHeap*>* _heaps; 42 #endif 43 static bool load_library(const char* name, bool exit_on_error); 44 45 public: 46 #if INCLUDE_AOT 47 static GrowableArray<AOTCodeHeap*>* heaps(); 48 static int heaps_count(); 49 static void add_heap(AOTCodeHeap *heap); 50 #endif 51 static void initialize() NOT_AOT({ FLAG_SET_ERGO(bool, UseAOT, false); }); 52 53 static void universe_init() NOT_AOT_RETURN; 54 static void set_narrow_klass_shift() NOT_AOT_RETURN; 55 static bool contains(address p) NOT_AOT({ return false; }); 56 static void load_for_klass(const instanceKlassHandle& kh, Thread* thread) NOT_AOT_RETURN; 57 static bool find_klass(InstanceKlass* ik) NOT_AOT({ return false; }); 58 static uint64_t get_saved_fingerprint(InstanceKlass* ik) NOT_AOT({ return 0; }); 59 static void oops_do(OopClosure* f) NOT_AOT_RETURN; 60 static void metadata_do(void f(Metadata*)) NOT_AOT_RETURN; 61 static address exception_begin(JavaThread* thread, CodeBlob* blob, address return_address) NOT_AOT({ return NULL; }); 62 63 NOT_PRODUCT( static void print_statistics() NOT_AOT_RETURN; ) 64 65 #ifdef HOTSWAP 66 // Flushing and deoptimization in case of evolution 67 static void flush_evol_dependents_on(const instanceKlassHandle& dependee) NOT_AOT_RETURN; 68 #endif // HOTSWAP 69 70 }; 71 72 #endif // SHARE_VM_AOT_AOTLOADER_HPP