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 #include "precompiled.hpp"
25
26 #include "aot/aotCodeHeap.hpp"
27 #include "aot/aotLoader.hpp"
28 #include "classfile/javaAssertions.hpp"
29 #include "gc/g1/heapRegion.hpp"
30 #include "gc/shared/gcLocker.hpp"
31 #include "interpreter/abstractInterpreter.hpp"
32 #include "jvmci/compilerRuntime.hpp"
33 #include "jvmci/jvmciRuntime.hpp"
34 #include "oops/method.hpp"
35 #include "runtime/os.hpp"
36 #include "runtime/sharedRuntime.hpp"
37 #include "runtime/vm_operations.hpp"
38
39 bool AOTLib::_narrow_oop_shift_initialized = false;
40 int AOTLib::_narrow_oop_shift = 0;
41 int AOTLib::_narrow_klass_shift = 0;
42
43 address AOTLib::load_symbol(const char *name) {
44 address symbol = (address) os::dll_lookup(_dl_handle, name);
45 if (symbol == NULL) {
46 tty->print_cr("Shared file %s error: missing %s", _name, name);
47 vm_exit(1);
48 }
512 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_stub_routines_throw_delayed_StackOverflowError_entry", address, StubRoutines::_throw_delayed_StackOverflowError_entry);
513
514 }
515
516 void AOTCodeHeap::link_os_symbols() {
517 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_os_javaTimeMillis", address, os::javaTimeMillis);
518 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_os_javaTimeNanos", address, os::javaTimeNanos);
519 }
520
521 /*
522 * Link any global symbols in precompiled DSO with dlopen() _dl_handle
523 * dso_handle.
524 */
525
526 void AOTCodeHeap::link_global_lib_symbols() {
527 if (!_lib_symbols_initialized) {
528 _lib_symbols_initialized = true;
529
530 CollectedHeap* heap = Universe::heap();
531 CardTableModRefBS* ct = (CardTableModRefBS*)(heap->barrier_set());
532 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_card_table_address", address, ct->byte_map_base);
533 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_heap_top_address", address, (heap->supports_inline_contig_alloc() ? heap->top_addr() : NULL));
534 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_heap_end_address", address, (heap->supports_inline_contig_alloc() ? heap->end_addr() : NULL));
535 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_polling_page", address, os::get_polling_page());
536 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_narrow_klass_base_address", address, Universe::narrow_klass_base());
537 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_narrow_oop_base_address", address, Universe::narrow_oop_base());
538 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_log_of_heap_region_grain_bytes", int, HeapRegion::LogOfHRGrainBytes);
539 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_inline_contiguous_allocation_supported", bool, heap->supports_inline_contig_alloc());
540 link_shared_runtime_symbols();
541 link_stub_routines_symbols();
542 link_os_symbols();
543 link_graal_runtime_symbols();
544
545 // Link primitive array klasses.
546 link_primitive_array_klasses();
547 }
548 }
549
550 #ifndef PRODUCT
551 int AOTCodeHeap::klasses_seen = 0;
552 int AOTCodeHeap::aot_klasses_found = 0;
|
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 #include "precompiled.hpp"
25
26 #include "aot/aotCodeHeap.hpp"
27 #include "aot/aotLoader.hpp"
28 #include "classfile/javaAssertions.hpp"
29 #include "gc/shared/cardTable.hpp"
30 #include "gc/shared/cardTableModRefBS.hpp"
31 #include "gc/g1/heapRegion.hpp"
32 #include "gc/shared/gcLocker.hpp"
33 #include "interpreter/abstractInterpreter.hpp"
34 #include "jvmci/compilerRuntime.hpp"
35 #include "jvmci/jvmciRuntime.hpp"
36 #include "oops/method.hpp"
37 #include "runtime/os.hpp"
38 #include "runtime/sharedRuntime.hpp"
39 #include "runtime/vm_operations.hpp"
40
41 bool AOTLib::_narrow_oop_shift_initialized = false;
42 int AOTLib::_narrow_oop_shift = 0;
43 int AOTLib::_narrow_klass_shift = 0;
44
45 address AOTLib::load_symbol(const char *name) {
46 address symbol = (address) os::dll_lookup(_dl_handle, name);
47 if (symbol == NULL) {
48 tty->print_cr("Shared file %s error: missing %s", _name, name);
49 vm_exit(1);
50 }
514 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_stub_routines_throw_delayed_StackOverflowError_entry", address, StubRoutines::_throw_delayed_StackOverflowError_entry);
515
516 }
517
518 void AOTCodeHeap::link_os_symbols() {
519 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_os_javaTimeMillis", address, os::javaTimeMillis);
520 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_os_javaTimeNanos", address, os::javaTimeNanos);
521 }
522
523 /*
524 * Link any global symbols in precompiled DSO with dlopen() _dl_handle
525 * dso_handle.
526 */
527
528 void AOTCodeHeap::link_global_lib_symbols() {
529 if (!_lib_symbols_initialized) {
530 _lib_symbols_initialized = true;
531
532 CollectedHeap* heap = Universe::heap();
533 CardTableModRefBS* ct = (CardTableModRefBS*)(heap->barrier_set());
534 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_card_table_address", address, ct->card_table()->byte_map_base());
535 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_heap_top_address", address, (heap->supports_inline_contig_alloc() ? heap->top_addr() : NULL));
536 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_heap_end_address", address, (heap->supports_inline_contig_alloc() ? heap->end_addr() : NULL));
537 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_polling_page", address, os::get_polling_page());
538 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_narrow_klass_base_address", address, Universe::narrow_klass_base());
539 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_narrow_oop_base_address", address, Universe::narrow_oop_base());
540 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_log_of_heap_region_grain_bytes", int, HeapRegion::LogOfHRGrainBytes);
541 SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_inline_contiguous_allocation_supported", bool, heap->supports_inline_contig_alloc());
542 link_shared_runtime_symbols();
543 link_stub_routines_symbols();
544 link_os_symbols();
545 link_graal_runtime_symbols();
546
547 // Link primitive array klasses.
548 link_primitive_array_klasses();
549 }
550 }
551
552 #ifndef PRODUCT
553 int AOTCodeHeap::klasses_seen = 0;
554 int AOTCodeHeap::aot_klasses_found = 0;
|