< prev index next > src/hotspot/share/cds/lambdaFormInvokers.cpp
Print this page
*
*/
#include "precompiled.hpp"
#include "cds/archiveBuilder.hpp"
+ #include "cds/cdsConfig.hpp"
#include "cds/lambdaFormInvokers.hpp"
#include "cds/metaspaceShared.hpp"
#include "cds/regeneratedClasses.hpp"
#include "classfile/classFileStream.hpp"
#include "classfile/classLoadInfo.hpp"
log_info(cds)("Regenerate MethodHandle Holder classes...done");
}
};
void LambdaFormInvokers::regenerate_holder_classes(TRAPS) {
+ if (!CDSConfig::is_dumping_regenerated_lambdaform_invokers()) {
+ return;
+ }
PrintLambdaFormMessage plm;
if (_lambdaform_lines == nullptr || _lambdaform_lines->length() == 0) {
log_info(cds)("Nothing to regenerate for holder classes");
return;
}
int len = h_bytes->length();
// make a copy of class bytes so GC will not affect us.
char *buf = NEW_RESOURCE_ARRAY(char, len);
memcpy(buf, (char*)h_bytes->byte_at_addr(0), len);
ClassFileStream st((u1*)buf, len, nullptr);
! regenerate_class(class_name, st, CHECK);
}
}
}
void LambdaFormInvokers::regenerate_class(char* class_name, ClassFileStream& st, TRAPS) {
int len = h_bytes->length();
// make a copy of class bytes so GC will not affect us.
char *buf = NEW_RESOURCE_ARRAY(char, len);
memcpy(buf, (char*)h_bytes->byte_at_addr(0), len);
ClassFileStream st((u1*)buf, len, nullptr);
! if (!CDSConfig::is_dumping_invokedynamic() /* work around JDK-8310831 */) {
+ regenerate_class(class_name, st, CHECK);
+ }
}
}
}
void LambdaFormInvokers::regenerate_class(char* class_name, ClassFileStream& st, TRAPS) {
log_info(cds, lambda)("Regenerated class %s, old: " INTPTR_FORMAT " new: " INTPTR_FORMAT,
class_name, p2i(klass), p2i(result));
}
void LambdaFormInvokers::dump_static_archive_invokers() {
+ if (CDSConfig::is_dumping_preimage_static_archive() ||
+ CDSConfig::is_dumping_final_static_archive()) {
+ // This function writes the "names" of the invokers.
+ // This is not supported in new CDS workflow for now.
+ return;
+ }
+
if (_lambdaform_lines != nullptr && _lambdaform_lines->length() > 0) {
int count = 0;
int len = _lambdaform_lines->length();
for (int i = 0; i < len; i++) {
char* str = _lambdaform_lines->at(i);
< prev index next >