Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/hotspot/share/cds/aotMetaspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1345,11 +1345,6 @@ bool AOTMetaspace::try_link_class(JavaThread* current, InstanceKlass* ik) {
}

void VM_PopulateDumpSharedSpace::dump_java_heap_objects() {
if (CDSConfig::is_valhalla_preview()) {
log_info(cds)("Archived java heap is not yet supported with Valhalla preview");
return;
}

if (CDSConfig::is_dumping_heap()) {
HeapShared::write_heap(&_heap_info);
} else {
Expand Down
6 changes: 1 addition & 5 deletions src/hotspot/share/cds/cdsConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ void CDSConfig::ergo_init_classic_archive_paths() {
}

void CDSConfig::check_internal_module_property(const char* key, const char* value) {
if (Arguments::is_incompatible_cds_internal_module_property(key) && !Arguments::patching_migrated_classes(key, value)) {
if (Arguments::is_incompatible_cds_internal_module_property(key)) {
stop_using_optimized_module_handling();
aot_log_info(aot)("optimized module handling: disabled due to incompatible property: %s=%s", key, value);
}
Expand Down Expand Up @@ -981,10 +981,6 @@ bool CDSConfig::are_vm_options_incompatible_with_dumping_heap() {
}

bool CDSConfig::is_dumping_heap() {
if (is_valhalla_preview()) {
// Not working yet -- e.g., HeapShared::oop_hash() needs to be implemented for value oops
return false;
}
if (!(is_dumping_classic_static_archive() || is_dumping_final_static_archive())
|| are_vm_options_incompatible_with_dumping_heap()
|| _disable_heap_dumping) {
Expand Down
6 changes: 0 additions & 6 deletions src/hotspot/share/cds/heapShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2090,12 +2090,6 @@ void HeapShared::archive_object_subgraphs(ArchivableStaticFieldInfo fields[],
ArchivableStaticFieldInfo* info = &fields[i];
const char* klass_name = info->klass_name;

if (CDSConfig::is_valhalla_preview() && strcmp(klass_name, "jdk/internal/module/ArchivedModuleGraph") == 0) {
// FIXME -- ArchivedModuleGraph doesn't work when java.base is patched with valhalla classes.
i++;
continue;
}

start_recording_subgraph(info->klass, klass_name, is_full_module_graph);

// If you have specified consecutive fields of the same klass in
Expand Down
10 changes: 9 additions & 1 deletion src/hotspot/share/classfile/systemDictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,15 @@ ClassLoaderData* SystemDictionary::register_loader(Handle class_loader, bool cre
bool created = false;
ClassLoaderData* cld = ClassLoaderDataGraph::find_or_create(class_loader, created);
if (created && Arguments::enable_preview()) {
add_migrated_value_classes(cld);
if (CDSConfig::is_using_aot_linked_classes() && java_system_loader() == nullptr) {
// We are inside AOTLinkedClassBulkLoader::preload_classes().
//
// AOTLinkedClassBulkLoader will automatically initiate the loading of all archived
// public classes from the boot loader into platform/system loaders, so there's
// no need to call add_migrated_value_classes().
} else {
add_migrated_value_classes(cld);
}
}
return cld;
}
Expand Down
14 changes: 1 addition & 13 deletions src/hotspot/share/runtime/arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,18 +364,6 @@ bool Arguments::internal_module_property_helper(const char* property, bool check
return false;
}

bool Arguments::patching_migrated_classes(const char* property, const char* value) {
if (strncmp(property, MODULE_PROPERTY_PREFIX, MODULE_PROPERTY_PREFIX_LEN) == 0) {
const char* property_suffix = property + MODULE_PROPERTY_PREFIX_LEN;
if (matches_property_suffix(property_suffix, PATCH, PATCH_LEN)) {
if (strcmp(value, "java.base-valueclasses.jar")) {
return true;
}
}
}
return false;
}

// Process java launcher properties.
void Arguments::process_sun_java_launcher_properties(JavaVMInitArgs* args) {
// See if sun.java.launcher is defined.
Expand Down Expand Up @@ -2089,7 +2077,7 @@ int Arguments::process_patch_mod_option(const char* patch_mod_tail) {
// Temporary system property to disable preview patching and enable the new preview mode
// feature for testing/development. Once the preview mode feature is finished, the value
// will be always 'true' and this code, and all related dead-code can be removed.
#define DISABLE_PREVIEW_PATCHING_DEFAULT false
#define DISABLE_PREVIEW_PATCHING_DEFAULT true

bool Arguments::disable_preview_patching() {
const char* prop = get_property("DISABLE_PREVIEW_PATCHING");
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/runtime/arguments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ class Arguments : AllStatic {

static bool is_internal_module_property(const char* option);
static bool is_incompatible_cds_internal_module_property(const char* property);
static bool patching_migrated_classes(const char* property, const char* value);

// Miscellaneous System property value getter and setters.
static void set_dll_dir(const char *value) { _sun_boot_library_path->set_value(value); }
Expand Down
14 changes: 14 additions & 0 deletions src/hotspot/share/runtime/sharedRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2936,6 +2936,19 @@ void CompiledEntrySignature::compute_calling_conventions(bool init) {
GrowableArray<Method*>* supers = get_supers();
for (int i = 0; i < supers->length(); ++i) {
Method* super_method = supers->at(i);
if (AOTCodeCache::is_using_adapter() && super_method->adapter()->get_sig_cc() == nullptr) {
// Calling conventions have to be regenerated at runtime and are accessed through method adapters,
// which are archived in the AOT code cache. If the adapters are not regenerated, the
// calling conventions should be regenerated here.
CompiledEntrySignature ces(super_method);
ces.compute_calling_conventions();
if (ces.has_scalarized_args()) {
// Save a C heap allocated version of the scalarized signature and store it in the adapter
GrowableArray<SigEntry>* heap_sig = new (mtInternal) GrowableArray<SigEntry>(ces.sig_cc()->length(), mtInternal);
heap_sig->appendAll(ces.sig_cc());
super_method->adapter()->set_sig_cc(heap_sig);
}
}
if (super_method->is_scalarized_arg(arg_num)) {
scalar_super = true;
} else {
Expand Down Expand Up @@ -3390,6 +3403,7 @@ void AdapterHandlerEntry::remove_unshareable_info() {
#endif // ASSERT
_adapter_blob = nullptr;
_linked = false;
_sig_cc = nullptr;
}

class CopyAdapterTableToArchive : StackObj {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public boolean isPreviewModeEnabled() {
// Temporary system property to disable preview patching and enable the new preview mode
// feature for testing/development. Once the preview mode feature is finished, the value
// will be always 'true' and this code, and all related dead-code can be removed.
private static final boolean DISABLE_PREVIEW_PATCHING_DEFAULT = false;
private static final boolean DISABLE_PREVIEW_PATCHING_DEFAULT = true;
private static final boolean DISABLE_PREVIEW_PATCHING = Boolean.parseBoolean(
System.getProperty(
"DISABLE_PREVIEW_PATCHING",
Expand Down