src/share/vm/aot/aotCodeHeap.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/aot/aotCodeHeap.cpp Wed Feb 8 13:50:01 2017
--- new/src/share/vm/aot/aotCodeHeap.cpp Wed Feb 8 13:50:00 2017
*** 1,7 ****
--- 1,7 ----
/*
! * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 38,48 ****
--- 38,48 ----
bool AOTLib::_narrow_oop_shift_initialized = false;
int AOTLib::_narrow_oop_shift = 0;
int AOTLib::_narrow_klass_shift = 0;
address AOTLib::load_symbol(const char *name) {
! address symbol = (address) dlsym(_dl_handle, name);
! address symbol = (address) os::dll_lookup(_dl_handle, name);
if (symbol == NULL) {
tty->print_cr("Shared file %s error: missing %s", _name, name);
vm_exit(1);
}
return symbol;
*** 222,241 ****
--- 222,240 ----
_class_count = _lib->header()->_class_count;
_method_count = _lib->header()->_method_count;
// Collect metaspace info: names -> address in .got section
- _metaspace_names = (const char*) _lib->load_symbol("JVM.metaspace.names");
- _method_metadata = (address) _lib->load_symbol("JVM.method.metadata");
_methods_offsets = (address) _lib->load_symbol("JVM.methods.offsets");
! _klasses_offsets = (address) _lib->load_symbol("JVM.klasses.offsets");
! _dependencies = (address) _lib->load_symbol("JVM.klasses.dependencies");
! _klasses_offsets = (address) _lib->load_symbol("JVM.kls.offsets");
! _dependencies = (address) _lib->load_symbol("JVM.kls.dependencies");
_code_space = (address) _lib->load_symbol("JVM.text");
// First cell is number of elements.
! jlong* got_sect;
_metaspace_got = (Metadata**) _lib->load_symbol("JVM.metaspace.got");
! _metaspace_got = (Metadata**) _lib->load_symbol("JVM.meta.got");
_metaspace_got_size = _lib->header()->_metaspace_got_size;
_metadata_got = (Metadata**) _lib->load_symbol("JVM.metadata.got");
_metadata_got_size = _lib->header()->_metadata_got_size;
*** 247,257 ****
--- 246,256 ----
// code segments table
_code_segments = (address) _lib->load_symbol("JVM.code.segments");
// method state
- _method_state = (jlong*) _lib->load_symbol("JVM.method.state");
// Create a table for mapping classes
_classes = NEW_C_HEAP_ARRAY(AOTClass, _class_count, mtCode);
memset(_classes, 0, _class_count * sizeof(AOTClass));
*** 336,346 ****
--- 335,345 ----
ResourceMark rm;
for (int i = T_BOOLEAN; i <= T_CONFLICT; i++) {
BasicType t = (BasicType)i;
if (is_java_primitive(t)) {
const Klass* arr_klass = Universe::typeArrayKlassObj(t);
! AOTKlassData* klass_data = (AOTKlassData*) dlsym(_lib->dl_handle(), arr_klass->signature_name());
! AOTKlassData* klass_data = (AOTKlassData*) os::dll_lookup(_lib->dl_handle(), arr_klass->signature_name());
if (klass_data != NULL) {
// Set both GOT cells, resolved and initialized klass pointers.
// _got_index points to second cell - resolved klass pointer.
_metaspace_got[klass_data->_got_index-1] = (Metadata*)arr_klass; // Initialized
_metaspace_got[klass_data->_got_index ] = (Metadata*)arr_klass; // Resolved
*** 389,405 ****
--- 388,400 ----
}
}
#define SET_AOT_GLOBAL_SYMBOL_VALUE(AOTSYMNAME, AOTSYMTYPE, VMSYMVAL) \
{ \
! char* error; \
! /* Clear any existing error */ \
! dlerror(); \
AOTSYMTYPE * adr = (AOTSYMTYPE *) dlsym(_lib->dl_handle(), AOTSYMNAME); \
/* Check for any dlsym lookup error */ \
error = dlerror(); \
guarantee(error == NULL, "%s", error); \
! AOTSYMTYPE * adr = (AOTSYMTYPE *) os::dll_lookup(_lib->dl_handle(), AOTSYMNAME); \
! /* Check for a lookup error */ \
! guarantee(adr != NULL, "AOT Symbol not found %s", AOTSYMNAME); \
*adr = (AOTSYMTYPE) VMSYMVAL; \
}
void AOTCodeHeap::link_graal_runtime_symbols() {
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_monitorenter", address, JVMCIRuntime::monitorenter);
*** 610,620 ****
--- 605,615 ----
return m;
}
AOTKlassData* AOTCodeHeap::find_klass(InstanceKlass* ik) {
ResourceMark rm;
! AOTKlassData* klass_data = (AOTKlassData*) dlsym(_lib->dl_handle(), ik->signature_name());
! AOTKlassData* klass_data = (AOTKlassData*) os::dll_lookup(_lib->dl_handle(), ik->signature_name());
return klass_data;
}
bool AOTCodeHeap::is_dependent_method(Klass* dependee, AOTCompiledMethod* aot) {
InstanceKlass *dependee_ik = InstanceKlass::cast(dependee);
src/share/vm/aot/aotCodeHeap.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File