8214917: CTW testlibrary shouldn't ignore errors raised by the library itself
Reviewed-by: kvn, roland
This commit is contained in:
parent
bb6f1e7700
commit
5ff302e6bb
@ -403,7 +403,7 @@ MethodLivenessResult ciMethod::raw_liveness_at_bci(int bci) {
|
|||||||
// information.
|
// information.
|
||||||
MethodLivenessResult ciMethod::liveness_at_bci(int bci) {
|
MethodLivenessResult ciMethod::liveness_at_bci(int bci) {
|
||||||
MethodLivenessResult result = raw_liveness_at_bci(bci);
|
MethodLivenessResult result = raw_liveness_at_bci(bci);
|
||||||
if (CURRENT_ENV->should_retain_local_variables() || DeoptimizeALot || CompileTheWorld) {
|
if (CURRENT_ENV->should_retain_local_variables() || DeoptimizeALot) {
|
||||||
// Keep all locals live for the user's edification and amusement.
|
// Keep all locals live for the user's edification and amusement.
|
||||||
result.at_put_range(0, result.size(), true);
|
result.at_put_range(0, result.size(), true);
|
||||||
}
|
}
|
||||||
@ -1210,7 +1210,7 @@ bool ciMethod::is_klass_loaded(int refinfo_index, bool must_be_resolved) const {
|
|||||||
// ciMethod::check_call
|
// ciMethod::check_call
|
||||||
bool ciMethod::check_call(int refinfo_index, bool is_static) const {
|
bool ciMethod::check_call(int refinfo_index, bool is_static) const {
|
||||||
// This method is used only in C2 from InlineTree::ok_to_inline,
|
// This method is used only in C2 from InlineTree::ok_to_inline,
|
||||||
// and is only used under -Xcomp or -XX:CompileTheWorld.
|
// and is only used under -Xcomp.
|
||||||
// It appears to fail when applied to an invokeinterface call site.
|
// It appears to fail when applied to an invokeinterface call site.
|
||||||
// FIXME: Remove this method and resolve_method_statically; refactor to use the other LinkResolver entry points.
|
// FIXME: Remove this method and resolve_method_statically; refactor to use the other LinkResolver entry points.
|
||||||
VM_ENTRY_MARK;
|
VM_ENTRY_MARK;
|
||||||
|
@ -453,37 +453,6 @@ JImageLocationRef ClassLoader::jimage_find_resource(JImageFile* jf,
|
|||||||
return ((*JImageFindResource)(jf, module_name, get_jimage_version_string(), file_name, &size));
|
return ((*JImageFindResource)(jf, module_name, get_jimage_version_string(), file_name, &size));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PRODUCT
|
|
||||||
bool ctw_visitor(JImageFile* jimage,
|
|
||||||
const char* module_name, const char* version, const char* package,
|
|
||||||
const char* name, const char* extension, void* arg) {
|
|
||||||
if (strcmp(extension, "class") == 0) {
|
|
||||||
Thread* THREAD = Thread::current();
|
|
||||||
ResourceMark rm(THREAD);
|
|
||||||
char* path = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, JIMAGE_MAX_PATH);
|
|
||||||
jio_snprintf(path, JIMAGE_MAX_PATH - 1, "%s/%s.class", package, name);
|
|
||||||
ClassLoader::compile_the_world_in(path, *(Handle*)arg, THREAD);
|
|
||||||
return !HAS_PENDING_EXCEPTION;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClassPathImageEntry::compile_the_world(Handle loader, TRAPS) {
|
|
||||||
tty->print_cr("CompileTheWorld : Compiling all classes in %s", name());
|
|
||||||
tty->cr();
|
|
||||||
(*JImageResourceIterator)(_jimage, (JImageResourceVisitor_t)ctw_visitor, (void *)&loader);
|
|
||||||
if (HAS_PENDING_EXCEPTION) {
|
|
||||||
if (PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())) {
|
|
||||||
CLEAR_PENDING_EXCEPTION;
|
|
||||||
tty->print_cr("\nCompileTheWorld : Ran out of memory\n");
|
|
||||||
tty->print_cr("Increase class metadata storage if a limit was set");
|
|
||||||
} else {
|
|
||||||
tty->print_cr("\nCompileTheWorld : Unexpected exception occurred\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool ClassPathImageEntry::is_modules_image() const {
|
bool ClassPathImageEntry::is_modules_image() const {
|
||||||
return ClassLoader::is_modules_image(name());
|
return ClassLoader::is_modules_image(name());
|
||||||
}
|
}
|
||||||
@ -1751,247 +1720,6 @@ void ClassLoader::create_javabase() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PRODUCT
|
|
||||||
|
|
||||||
// CompileTheWorld
|
|
||||||
//
|
|
||||||
// Iterates over all class path entries and forces compilation of all methods
|
|
||||||
// in all classes found. Currently, only zip/jar archives are searched.
|
|
||||||
//
|
|
||||||
// The classes are loaded by the Java level bootstrap class loader, and the
|
|
||||||
// initializer is called. If DelayCompilationDuringStartup is true (default),
|
|
||||||
// the interpreter will run the initialization code. Note that forcing
|
|
||||||
// initialization in this way could potentially lead to initialization order
|
|
||||||
// problems, in which case we could just force the initialization bit to be set.
|
|
||||||
|
|
||||||
|
|
||||||
// We need to iterate over the contents of a zip/jar file, so we replicate the
|
|
||||||
// jzcell and jzfile definitions from zip_util.h but rename jzfile to real_jzfile,
|
|
||||||
// since jzfile already has a void* definition.
|
|
||||||
//
|
|
||||||
// Note that this is only used in debug mode.
|
|
||||||
//
|
|
||||||
// HotSpot integration note:
|
|
||||||
// Matches zip_util.h 1.14 99/06/01 from jdk1.3 beta H build
|
|
||||||
|
|
||||||
|
|
||||||
// JDK 1.3 version
|
|
||||||
typedef struct real_jzentry { /* Zip file entry */
|
|
||||||
char *name; /* entry name */
|
|
||||||
jint time; /* modification time */
|
|
||||||
jint size; /* size of uncompressed data */
|
|
||||||
jint csize; /* size of compressed data (zero if uncompressed) */
|
|
||||||
jint crc; /* crc of uncompressed data */
|
|
||||||
char *comment; /* optional zip file comment */
|
|
||||||
jbyte *extra; /* optional extra data */
|
|
||||||
jint pos; /* position of LOC header (if negative) or data */
|
|
||||||
} real_jzentry;
|
|
||||||
|
|
||||||
typedef struct real_jzfile { /* Zip file */
|
|
||||||
char *name; /* zip file name */
|
|
||||||
jint refs; /* number of active references */
|
|
||||||
jint fd; /* open file descriptor */
|
|
||||||
void *lock; /* read lock */
|
|
||||||
char *comment; /* zip file comment */
|
|
||||||
char *msg; /* zip error message */
|
|
||||||
void *entries; /* array of hash cells */
|
|
||||||
jint total; /* total number of entries */
|
|
||||||
unsigned short *table; /* Hash chain heads: indexes into entries */
|
|
||||||
jint tablelen; /* number of hash eads */
|
|
||||||
real_jzfile *next; /* next zip file in search list */
|
|
||||||
jzentry *cache; /* we cache the most recently freed jzentry */
|
|
||||||
/* Information on metadata names in META-INF directory */
|
|
||||||
char **metanames; /* array of meta names (may have null names) */
|
|
||||||
jint metacount; /* number of slots in metanames array */
|
|
||||||
/* If there are any per-entry comments, they are in the comments array */
|
|
||||||
char **comments;
|
|
||||||
} real_jzfile;
|
|
||||||
|
|
||||||
void ClassPathDirEntry::compile_the_world(Handle loader, TRAPS) {
|
|
||||||
// For now we only compile all methods in all classes in zip/jar files
|
|
||||||
tty->print_cr("CompileTheWorld : Skipped classes in %s", _dir);
|
|
||||||
tty->cr();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClassPathZipEntry::compile_the_world(Handle loader, TRAPS) {
|
|
||||||
real_jzfile* zip = (real_jzfile*) _zip;
|
|
||||||
tty->print_cr("CompileTheWorld : Compiling all classes in %s", zip->name);
|
|
||||||
tty->cr();
|
|
||||||
// Iterate over all entries in zip file
|
|
||||||
for (int n = 0; ; n++) {
|
|
||||||
real_jzentry * ze = (real_jzentry *)((*GetNextEntry)(_zip, n));
|
|
||||||
if (ze == NULL) break;
|
|
||||||
ClassLoader::compile_the_world_in(ze->name, loader, CHECK);
|
|
||||||
}
|
|
||||||
if (HAS_PENDING_EXCEPTION) {
|
|
||||||
if (PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())) {
|
|
||||||
CLEAR_PENDING_EXCEPTION;
|
|
||||||
tty->print_cr("\nCompileTheWorld : Ran out of memory\n");
|
|
||||||
tty->print_cr("Increase class metadata storage if a limit was set");
|
|
||||||
} else {
|
|
||||||
tty->print_cr("\nCompileTheWorld : Unexpected exception occurred\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClassLoader::compile_the_world() {
|
|
||||||
EXCEPTION_MARK;
|
|
||||||
HandleMark hm(THREAD);
|
|
||||||
ResourceMark rm(THREAD);
|
|
||||||
|
|
||||||
assert(has_jrt_entry(), "Compile The World not supported with exploded module build");
|
|
||||||
|
|
||||||
// Find bootstrap loader
|
|
||||||
Handle system_class_loader (THREAD, SystemDictionary::java_system_loader());
|
|
||||||
jlong start = os::javaTimeMillis();
|
|
||||||
|
|
||||||
// Compile the world for the modular java runtime image
|
|
||||||
_jrt_entry->compile_the_world(system_class_loader, CATCH);
|
|
||||||
|
|
||||||
// Iterate over all bootstrap class path appended entries
|
|
||||||
ClassPathEntry* e = _first_append_entry;
|
|
||||||
while (e != NULL) {
|
|
||||||
assert(!e->is_modules_image(), "A modular java runtime image is present on the list of appended entries");
|
|
||||||
e->compile_the_world(system_class_loader, CATCH);
|
|
||||||
e = e->next();
|
|
||||||
}
|
|
||||||
jlong end = os::javaTimeMillis();
|
|
||||||
tty->print_cr("CompileTheWorld : Done (%d classes, %d methods, " JLONG_FORMAT " ms)",
|
|
||||||
_compile_the_world_class_counter, _compile_the_world_method_counter, (end - start));
|
|
||||||
{
|
|
||||||
// Print statistics as if before normal exit:
|
|
||||||
extern void print_statistics();
|
|
||||||
print_statistics();
|
|
||||||
}
|
|
||||||
vm_exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int ClassLoader::_compile_the_world_class_counter = 0;
|
|
||||||
int ClassLoader::_compile_the_world_method_counter = 0;
|
|
||||||
static int _codecache_sweep_counter = 0;
|
|
||||||
|
|
||||||
// Filter out all exceptions except OOMs
|
|
||||||
static void clear_pending_exception_if_not_oom(TRAPS) {
|
|
||||||
if (HAS_PENDING_EXCEPTION &&
|
|
||||||
!PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())) {
|
|
||||||
CLEAR_PENDING_EXCEPTION;
|
|
||||||
}
|
|
||||||
// The CHECK at the caller will propagate the exception out
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns if the given method should be compiled when doing compile-the-world.
|
|
||||||
*
|
|
||||||
* TODO: This should be a private method in a CompileTheWorld class.
|
|
||||||
*/
|
|
||||||
static bool can_be_compiled(const methodHandle& m, int comp_level) {
|
|
||||||
assert(CompileTheWorld, "must be");
|
|
||||||
|
|
||||||
// It's not valid to compile a native wrapper for MethodHandle methods
|
|
||||||
// that take a MemberName appendix since the bytecode signature is not
|
|
||||||
// correct.
|
|
||||||
vmIntrinsics::ID iid = m->intrinsic_id();
|
|
||||||
if (MethodHandles::is_signature_polymorphic(iid) && MethodHandles::has_member_arg(iid)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return CompilationPolicy::can_be_compiled(m, comp_level);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
|
|
||||||
if (string_ends_with(name, ".class")) {
|
|
||||||
// We have a .class file
|
|
||||||
int len = (int)strlen(name);
|
|
||||||
char buffer[2048];
|
|
||||||
strncpy(buffer, name, len - 6);
|
|
||||||
buffer[len-6] = 0;
|
|
||||||
// If the file has a period after removing .class, it's not really a
|
|
||||||
// valid class file. The class loader will check everything else.
|
|
||||||
if (strchr(buffer, '.') == NULL) {
|
|
||||||
_compile_the_world_class_counter++;
|
|
||||||
if (_compile_the_world_class_counter > CompileTheWorldStopAt) return;
|
|
||||||
|
|
||||||
// Construct name without extension
|
|
||||||
TempNewSymbol sym = SymbolTable::new_symbol(buffer, CHECK);
|
|
||||||
// Use loader to load and initialize class
|
|
||||||
Klass* k = SystemDictionary::resolve_or_null(sym, loader, Handle(), THREAD);
|
|
||||||
if (k != NULL && !HAS_PENDING_EXCEPTION) {
|
|
||||||
k->initialize(THREAD);
|
|
||||||
}
|
|
||||||
bool exception_occurred = HAS_PENDING_EXCEPTION;
|
|
||||||
clear_pending_exception_if_not_oom(CHECK);
|
|
||||||
if (CompileTheWorldPreloadClasses && k != NULL) {
|
|
||||||
InstanceKlass* ik = InstanceKlass::cast(k);
|
|
||||||
ConstantPool::preload_and_initialize_all_classes(ik->constants(), THREAD);
|
|
||||||
if (HAS_PENDING_EXCEPTION) {
|
|
||||||
// If something went wrong in preloading we just ignore it
|
|
||||||
clear_pending_exception_if_not_oom(CHECK);
|
|
||||||
tty->print_cr("Preloading failed for (%d) %s", _compile_the_world_class_counter, buffer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_compile_the_world_class_counter >= CompileTheWorldStartAt) {
|
|
||||||
if (k == NULL || exception_occurred) {
|
|
||||||
// If something went wrong (e.g. ExceptionInInitializerError) we skip this class
|
|
||||||
tty->print_cr("CompileTheWorld (%d) : Skipping %s", _compile_the_world_class_counter, buffer);
|
|
||||||
} else {
|
|
||||||
tty->print_cr("CompileTheWorld (%d) : %s", _compile_the_world_class_counter, buffer);
|
|
||||||
// Preload all classes to get around uncommon traps
|
|
||||||
// Iterate over all methods in class
|
|
||||||
int comp_level = CompilationPolicy::policy()->initial_compile_level();
|
|
||||||
InstanceKlass* ik = InstanceKlass::cast(k);
|
|
||||||
for (int n = 0; n < ik->methods()->length(); n++) {
|
|
||||||
methodHandle m (THREAD, ik->methods()->at(n));
|
|
||||||
if (can_be_compiled(m, comp_level)) {
|
|
||||||
if (++_codecache_sweep_counter == CompileTheWorldSafepointInterval) {
|
|
||||||
// Give sweeper a chance to keep up with CTW
|
|
||||||
VM_CTWThreshold op;
|
|
||||||
VMThread::execute(&op);
|
|
||||||
_codecache_sweep_counter = 0;
|
|
||||||
}
|
|
||||||
// Force compilation
|
|
||||||
CompileBroker::compile_method(m, InvocationEntryBci, comp_level,
|
|
||||||
methodHandle(), 0, CompileTask::Reason_CTW, THREAD);
|
|
||||||
if (HAS_PENDING_EXCEPTION) {
|
|
||||||
clear_pending_exception_if_not_oom(CHECK);
|
|
||||||
tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name_and_sig_as_C_string());
|
|
||||||
} else {
|
|
||||||
_compile_the_world_method_counter++;
|
|
||||||
}
|
|
||||||
if (TieredCompilation && TieredStopAtLevel >= CompLevel_full_optimization) {
|
|
||||||
// Clobber the first compile and force second tier compilation
|
|
||||||
CompiledMethod* nm = m->code();
|
|
||||||
if (nm != NULL && !m->is_method_handle_intrinsic()) {
|
|
||||||
// Throw out the code so that the code cache doesn't fill up
|
|
||||||
nm->make_not_entrant();
|
|
||||||
}
|
|
||||||
CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_full_optimization,
|
|
||||||
methodHandle(), 0, CompileTask::Reason_CTW, THREAD);
|
|
||||||
if (HAS_PENDING_EXCEPTION) {
|
|
||||||
clear_pending_exception_if_not_oom(CHECK);
|
|
||||||
tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name_and_sig_as_C_string());
|
|
||||||
} else {
|
|
||||||
_compile_the_world_method_counter++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name_and_sig_as_C_string());
|
|
||||||
}
|
|
||||||
|
|
||||||
CompiledMethod* nm = m->code();
|
|
||||||
if (nm != NULL && !m->is_method_handle_intrinsic()) {
|
|
||||||
// Throw out the code so that the code cache doesn't fill up
|
|
||||||
nm->make_not_entrant();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif //PRODUCT
|
|
||||||
|
|
||||||
// Please keep following two functions at end of this file. With them placed at top or in middle of the file,
|
// Please keep following two functions at end of this file. With them placed at top or in middle of the file,
|
||||||
// they could get inlined by agressive compiler, an unknown trick, see bug 6966589.
|
// they could get inlined by agressive compiler, an unknown trick, see bug 6966589.
|
||||||
void PerfClassTraceTime::initialize() {
|
void PerfClassTraceTime::initialize() {
|
||||||
|
@ -60,8 +60,6 @@ public:
|
|||||||
// Attempt to locate file_name through this class path entry.
|
// Attempt to locate file_name through this class path entry.
|
||||||
// Returns a class file parsing stream if successfull.
|
// Returns a class file parsing stream if successfull.
|
||||||
virtual ClassFileStream* open_stream(const char* name, TRAPS) = 0;
|
virtual ClassFileStream* open_stream(const char* name, TRAPS) = 0;
|
||||||
// Debugging
|
|
||||||
NOT_PRODUCT(virtual void compile_the_world(Handle loader, TRAPS) = 0;)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ClassPathDirEntry: public ClassPathEntry {
|
class ClassPathDirEntry: public ClassPathEntry {
|
||||||
@ -75,8 +73,6 @@ class ClassPathDirEntry: public ClassPathEntry {
|
|||||||
ClassPathDirEntry(const char* dir);
|
ClassPathDirEntry(const char* dir);
|
||||||
virtual ~ClassPathDirEntry() {}
|
virtual ~ClassPathDirEntry() {}
|
||||||
ClassFileStream* open_stream(const char* name, TRAPS);
|
ClassFileStream* open_stream(const char* name, TRAPS);
|
||||||
// Debugging
|
|
||||||
NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -107,8 +103,6 @@ class ClassPathZipEntry: public ClassPathEntry {
|
|||||||
u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS);
|
u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS);
|
||||||
ClassFileStream* open_stream(const char* name, TRAPS);
|
ClassFileStream* open_stream(const char* name, TRAPS);
|
||||||
void contents_do(void f(const char* name, void* context), void* context);
|
void contents_do(void f(const char* name, void* context), void* context);
|
||||||
// Debugging
|
|
||||||
NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -126,9 +120,6 @@ public:
|
|||||||
ClassPathImageEntry(JImageFile* jimage, const char* name);
|
ClassPathImageEntry(JImageFile* jimage, const char* name);
|
||||||
virtual ~ClassPathImageEntry();
|
virtual ~ClassPathImageEntry();
|
||||||
ClassFileStream* open_stream(const char* name, TRAPS);
|
ClassFileStream* open_stream(const char* name, TRAPS);
|
||||||
|
|
||||||
// Debugging
|
|
||||||
NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// ModuleClassPathList contains a linked list of ClassPathEntry's
|
// ModuleClassPathList contains a linked list of ClassPathEntry's
|
||||||
@ -447,17 +438,6 @@ class ClassLoader: AllStatic {
|
|||||||
|
|
||||||
// Debugging
|
// Debugging
|
||||||
static void verify() PRODUCT_RETURN;
|
static void verify() PRODUCT_RETURN;
|
||||||
|
|
||||||
// Force compilation of all methods in all classes in bootstrap class path (stress test)
|
|
||||||
#ifndef PRODUCT
|
|
||||||
protected:
|
|
||||||
static int _compile_the_world_class_counter;
|
|
||||||
static int _compile_the_world_method_counter;
|
|
||||||
public:
|
|
||||||
static void compile_the_world();
|
|
||||||
static void compile_the_world_in(char* name, Handle loader, TRAPS);
|
|
||||||
static int compile_the_world_counter() { return _compile_the_world_class_counter; }
|
|
||||||
#endif //PRODUCT
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// PerfClassTraceTime is used to measure time for class loading related events.
|
// PerfClassTraceTime is used to measure time for class loading related events.
|
||||||
|
@ -1306,7 +1306,7 @@ nmethod* CompileBroker::compile_method(const methodHandle& method, int osr_bci,
|
|||||||
CompilationPolicy::policy()->delay_compilation(method());
|
CompilationPolicy::policy()->delay_compilation(method());
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
bool is_blocking = !directive->BackgroundCompilationOption || CompileTheWorld || ReplayCompiles;
|
bool is_blocking = !directive->BackgroundCompilationOption || ReplayCompiles;
|
||||||
compile_method_base(method, osr_bci, comp_level, hot_method, hot_count, compile_reason, is_blocking, THREAD);
|
compile_method_base(method, osr_bci, comp_level, hot_method, hot_count, compile_reason, is_blocking, THREAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2247,11 +2247,11 @@ void CompileBroker::handle_full_code_cache(int code_blob_type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
if (CompileTheWorld || ExitOnFullCodeCache) {
|
if (ExitOnFullCodeCache) {
|
||||||
codecache_print(/* detailed= */ true);
|
codecache_print(/* detailed= */ true);
|
||||||
before_exit(JavaThread::current());
|
before_exit(JavaThread::current());
|
||||||
exit_globals(); // will delete tty
|
exit_globals(); // will delete tty
|
||||||
vm_direct_exit(CompileTheWorld ? 0 : 1);
|
vm_direct_exit(1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (UseCodeCacheFlushing) {
|
if (UseCodeCacheFlushing) {
|
||||||
|
@ -314,9 +314,9 @@ bool CompilerConfig::check_args_consistency(bool status) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (BackgroundCompilation && (CompileTheWorld || ReplayCompiles)) {
|
if (BackgroundCompilation && ReplayCompiles) {
|
||||||
if (!FLAG_IS_DEFAULT(BackgroundCompilation)) {
|
if (!FLAG_IS_DEFAULT(BackgroundCompilation)) {
|
||||||
warning("BackgroundCompilation disabled due to CompileTheWorld or ReplayCompiles options.");
|
warning("BackgroundCompilation disabled due to ReplayCompiles option.");
|
||||||
}
|
}
|
||||||
FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
|
FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
|
||||||
}
|
}
|
||||||
|
@ -65,12 +65,6 @@ void JVMCICompiler::bootstrap(TRAPS) {
|
|||||||
// Nothing to do in -Xint mode
|
// Nothing to do in -Xint mode
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifndef PRODUCT
|
|
||||||
// We turn off CompileTheWorld so that compilation requests are not
|
|
||||||
// ignored during bootstrap or that JVMCI can be compiled by C1/C2.
|
|
||||||
FlagSetting ctwOff(CompileTheWorld, false);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_bootstrapping = true;
|
_bootstrapping = true;
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
HandleMark hm;
|
HandleMark hm;
|
||||||
|
@ -206,8 +206,6 @@ objArrayHandle CompilerToVM::initialize_intrinsics(TRAPS) {
|
|||||||
do_uintx_flag(CodeCacheSegmentSize) \
|
do_uintx_flag(CodeCacheSegmentSize) \
|
||||||
do_intx_flag(CodeEntryAlignment) \
|
do_intx_flag(CodeEntryAlignment) \
|
||||||
do_bool_flag(CompactFields) \
|
do_bool_flag(CompactFields) \
|
||||||
NOT_PRODUCT(do_intx_flag(CompileTheWorldStartAt)) \
|
|
||||||
NOT_PRODUCT(do_intx_flag(CompileTheWorldStopAt)) \
|
|
||||||
do_intx_flag(ContendedPaddingWidth) \
|
do_intx_flag(ContendedPaddingWidth) \
|
||||||
do_bool_flag(DontCompileHugeMethods) \
|
do_bool_flag(DontCompileHugeMethods) \
|
||||||
do_bool_flag(EagerJVMCI) \
|
do_bool_flag(EagerJVMCI) \
|
||||||
|
@ -2326,29 +2326,6 @@ void ConstantPool::patch_resolved_references(GrowableArray<Handle>* cp_patches)
|
|||||||
#endif // ASSERT
|
#endif // ASSERT
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PRODUCT
|
|
||||||
|
|
||||||
// CompileTheWorld support. Preload all classes loaded references in the passed in constantpool
|
|
||||||
void ConstantPool::preload_and_initialize_all_classes(ConstantPool* obj, TRAPS) {
|
|
||||||
guarantee(obj->is_constantPool(), "object must be constant pool");
|
|
||||||
constantPoolHandle cp(THREAD, (ConstantPool*)obj);
|
|
||||||
guarantee(cp->pool_holder() != NULL, "must be fully loaded");
|
|
||||||
|
|
||||||
for (int i = 0; i< cp->length(); i++) {
|
|
||||||
if (cp->tag_at(i).is_unresolved_klass()) {
|
|
||||||
// This will force loading of the class
|
|
||||||
Klass* klass = cp->klass_at(i, CHECK);
|
|
||||||
if (klass->is_instance_klass()) {
|
|
||||||
// Force initialization of class
|
|
||||||
InstanceKlass::cast(klass)->initialize(CHECK);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// Printing
|
// Printing
|
||||||
|
|
||||||
void ConstantPool::print_on(outputStream* st) const {
|
void ConstantPool::print_on(outputStream* st) const {
|
||||||
|
@ -938,11 +938,6 @@ class ConstantPool : public Metadata {
|
|||||||
void print_entry_on(int index, outputStream* st);
|
void print_entry_on(int index, outputStream* st);
|
||||||
|
|
||||||
const char* internal_name() const { return "{constant pool}"; }
|
const char* internal_name() const { return "{constant pool}"; }
|
||||||
|
|
||||||
#ifndef PRODUCT
|
|
||||||
// Compile the world support
|
|
||||||
static void preload_and_initialize_all_classes(ConstantPool* constant_pool, TRAPS);
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class SymbolHashMapEntry : public CHeapObj<mtSymbol> {
|
class SymbolHashMapEntry : public CHeapObj<mtSymbol> {
|
||||||
|
@ -288,8 +288,8 @@ bool InlineTree::should_not_inline(ciMethod *callee_method,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't use counts with -Xcomp or CTW
|
// don't use counts with -Xcomp
|
||||||
if (UseInterpreter && !CompileTheWorld) {
|
if (UseInterpreter) {
|
||||||
|
|
||||||
if (!callee_method->has_compiled_code() &&
|
if (!callee_method->has_compiled_code() &&
|
||||||
!callee_method->was_executed_more_than(0)) {
|
!callee_method->was_executed_more_than(0)) {
|
||||||
@ -364,9 +364,9 @@ bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!UseInterpreter || CompileTheWorld) &&
|
if (!UseInterpreter &&
|
||||||
is_init_with_ea(callee_method, caller_method, C)) {
|
is_init_with_ea(callee_method, caller_method, C)) {
|
||||||
// Escape Analysis stress testing when running Xcomp or CTW:
|
// Escape Analysis stress testing when running Xcomp:
|
||||||
// inline constructors even if they are not reached.
|
// inline constructors even if they are not reached.
|
||||||
} else if (forced_inline()) {
|
} else if (forced_inline()) {
|
||||||
// Inlining was forced by CompilerOracle, ciReplay or annotation
|
// Inlining was forced by CompilerOracle, ciReplay or annotation
|
||||||
@ -453,7 +453,7 @@ bool pass_initial_checks(ciMethod* caller_method, int caller_bci, ciMethod* call
|
|||||||
// Check if klass of callee_method is loaded
|
// Check if klass of callee_method is loaded
|
||||||
if( !callee_holder->is_loaded() ) return false;
|
if( !callee_holder->is_loaded() ) return false;
|
||||||
if( !callee_holder->is_initialized() ) return false;
|
if( !callee_holder->is_initialized() ) return false;
|
||||||
if( !UseInterpreter || CompileTheWorld /* running Xcomp or CTW */ ) {
|
if( !UseInterpreter ) /* running Xcomp */ {
|
||||||
// Checks that constant pool's call site has been visited
|
// Checks that constant pool's call site has been visited
|
||||||
// stricter than callee_holder->is_initialized()
|
// stricter than callee_holder->is_initialized()
|
||||||
ciBytecodeStream iter(caller_method);
|
ciBytecodeStream iter(caller_method);
|
||||||
|
@ -291,7 +291,7 @@ Node* CheckCastPPNode::Identity(PhaseGVN* phase) {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
// Toned down to rescue meeting at a Phi 3 different oops all implementing
|
// Toned down to rescue meeting at a Phi 3 different oops all implementing
|
||||||
// the same interface. CompileTheWorld starting at 502, kd12rc1.zip.
|
// the same interface.
|
||||||
return (phase->type(in(1)) == phase->type(this)) ? in(1) : this;
|
return (phase->type(in(1)) == phase->type(this)) ? in(1) : this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,8 +57,7 @@ ConNode *ConNode::make(const Type *t) {
|
|||||||
case T_NARROWKLASS: return new ConNKlassNode( t->is_narrowklass() );
|
case T_NARROWKLASS: return new ConNKlassNode( t->is_narrowklass() );
|
||||||
case T_METADATA: return new ConPNode( t->is_ptr() );
|
case T_METADATA: return new ConPNode( t->is_ptr() );
|
||||||
// Expected cases: TypePtr::NULL_PTR, any is_rawptr()
|
// Expected cases: TypePtr::NULL_PTR, any is_rawptr()
|
||||||
// Also seen: AnyPtr(TopPTR *+top); from command line:
|
// Also seen: AnyPtr(TopPTR *+top);
|
||||||
// r -XX:+PrintOpto -XX:CIStart=285 -XX:+CompileTheWorld -XX:CompileTheWorldStartAt=660
|
|
||||||
// %%%% Stop using TypePtr::NULL_PTR to represent nulls: use either TypeRawPtr::NULL_PTR
|
// %%%% Stop using TypePtr::NULL_PTR to represent nulls: use either TypeRawPtr::NULL_PTR
|
||||||
// or else TypeOopPtr::NULL_PTR. Then set Type::_basic_type[AnyPtr] = T_ILLEGAL
|
// or else TypeOopPtr::NULL_PTR. Then set Type::_basic_type[AnyPtr] = T_ILLEGAL
|
||||||
default:
|
default:
|
||||||
|
@ -437,8 +437,9 @@ JNI_ENTRY(jclass, jni_FindClass(JNIEnv *env, const char *name))
|
|||||||
// If we were the first invocation of jni_FindClass, we enable compilation again
|
// If we were the first invocation of jni_FindClass, we enable compilation again
|
||||||
// rather than just allowing invocation counter to overflow and decay.
|
// rather than just allowing invocation counter to overflow and decay.
|
||||||
// Controlled by flag DelayCompilationDuringStartup.
|
// Controlled by flag DelayCompilationDuringStartup.
|
||||||
if (first_time && !CompileTheWorld)
|
if (first_time) {
|
||||||
CompilationPolicy::completed_vm_startup();
|
CompilationPolicy::completed_vm_startup();
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
JNI_END
|
JNI_END
|
||||||
@ -3969,8 +3970,6 @@ static jint JNI_CreateJavaVM_inner(JavaVM **vm, void **penv, void *args) {
|
|||||||
post_thread_start_event(thread);
|
post_thread_start_event(thread);
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
// Check if we should compile all classes on bootclasspath
|
|
||||||
if (CompileTheWorld) ClassLoader::compile_the_world();
|
|
||||||
if (ReplayCompiles) ciReplay::replay(thread);
|
if (ReplayCompiles) ciReplay::replay(thread);
|
||||||
|
|
||||||
// Some platforms (like Win*) need a wrapper around these test
|
// Some platforms (like Win*) need a wrapper around these test
|
||||||
|
@ -420,7 +420,7 @@ nmethod* NonTieredCompPolicy::event(const methodHandle& method, const methodHand
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CompileTheWorld || ReplayCompiles) {
|
if (ReplayCompiles) {
|
||||||
// Don't trigger other compiles in testing mode
|
// Don't trigger other compiles in testing mode
|
||||||
if (bci == InvocationEntryBci) {
|
if (bci == InvocationEntryBci) {
|
||||||
reset_counter_for_invocation_event(method);
|
reset_counter_for_invocation_event(method);
|
||||||
|
@ -1320,16 +1320,6 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
|||||||
"Delay invoking the compiler until main application class is " \
|
"Delay invoking the compiler until main application class is " \
|
||||||
"loaded") \
|
"loaded") \
|
||||||
\
|
\
|
||||||
develop(bool, CompileTheWorld, false, \
|
|
||||||
"Compile all methods in all classes in bootstrap class path " \
|
|
||||||
"(stress test)") \
|
|
||||||
\
|
|
||||||
develop(bool, CompileTheWorldPreloadClasses, true, \
|
|
||||||
"Preload all classes used by a class before start loading") \
|
|
||||||
\
|
|
||||||
notproduct(intx, CompileTheWorldSafepointInterval, 100, \
|
|
||||||
"Force a safepoint every n compiles so sweeper can keep up") \
|
|
||||||
\
|
|
||||||
develop(bool, FillDelaySlots, true, \
|
develop(bool, FillDelaySlots, true, \
|
||||||
"Fill delay slots (on SPARC only)") \
|
"Fill delay slots (on SPARC only)") \
|
||||||
\
|
\
|
||||||
@ -2111,13 +2101,6 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
|||||||
experimental(bool, UseCriticalCMSThreadPriority, false, \
|
experimental(bool, UseCriticalCMSThreadPriority, false, \
|
||||||
"ConcurrentMarkSweep thread runs at critical scheduling priority")\
|
"ConcurrentMarkSweep thread runs at critical scheduling priority")\
|
||||||
\
|
\
|
||||||
/* compiler debugging */ \
|
|
||||||
notproduct(intx, CompileTheWorldStartAt, 1, \
|
|
||||||
"First class to consider when using +CompileTheWorld") \
|
|
||||||
\
|
|
||||||
notproduct(intx, CompileTheWorldStopAt, max_jint, \
|
|
||||||
"Last class to consider when using +CompileTheWorld") \
|
|
||||||
\
|
|
||||||
develop(intx, NewCodeParameter, 0, \
|
develop(intx, NewCodeParameter, 0, \
|
||||||
"Testing Only: Create a dedicated integer parameter before " \
|
"Testing Only: Create a dedicated integer parameter before " \
|
||||||
"putback") \
|
"putback") \
|
||||||
|
@ -386,7 +386,7 @@ nmethod* TieredThresholdPolicy::event(const methodHandle& method, const methodHa
|
|||||||
thread->is_interp_only_mode()) {
|
thread->is_interp_only_mode()) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (CompileTheWorld || ReplayCompiles) {
|
if (ReplayCompiles) {
|
||||||
// Don't trigger other compiles in testing mode
|
// Don't trigger other compiles in testing mode
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ SRC_FILES = $(shell find $(SRC_DIR) -name '*.java')
|
|||||||
LIB_FILES = $(shell find $(TESTLIBRARY_DIR)/jdk/test/lib/ \
|
LIB_FILES = $(shell find $(TESTLIBRARY_DIR)/jdk/test/lib/ \
|
||||||
$(TESTLIBRARY_DIR)/jdk/test/lib/process \
|
$(TESTLIBRARY_DIR)/jdk/test/lib/process \
|
||||||
$(TESTLIBRARY_DIR)/jdk/test/lib/util \
|
$(TESTLIBRARY_DIR)/jdk/test/lib/util \
|
||||||
-depth 1 -name '*.java')
|
-maxdepth 1 -name '*.java')
|
||||||
WB_SRC_FILES = $(shell find $(TESTLIBRARY_DIR)/sun/hotspot -name '*.java')
|
WB_SRC_FILES = $(shell find $(TESTLIBRARY_DIR)/sun/hotspot -name '*.java')
|
||||||
EXPORTS=--add-exports java.base/jdk.internal.jimage=ALL-UNNAMED \
|
EXPORTS=--add-exports java.base/jdk.internal.jimage=ALL-UNNAMED \
|
||||||
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
|
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
|
||||||
@ -69,7 +69,7 @@ $(DST_DIR):
|
|||||||
@mkdir -p $@
|
@mkdir -p $@
|
||||||
|
|
||||||
$(DST_DIR)/ctw.sh: $(DST_DIR)
|
$(DST_DIR)/ctw.sh: $(DST_DIR)
|
||||||
echo '$${JAVA_HOME}/bin/java $${JAVA_OPTIONS} $(EXPORTS) -jar -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar $$@' > $@
|
echo '$${JAVA_HOME}/bin/java $${JAVA_OPTIONS} $(EXPORTS) -XX:-UseCounterDecay -Xbatch "-XX:CompileCommand=exclude,java/lang/invoke/MethodHandle.*" -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar $$@' > $@
|
||||||
chmod a+x $@
|
chmod a+x $@
|
||||||
|
|
||||||
$(DST_DIR)/ctw.jar: filelist $(DST_DIR)/wb.jar
|
$(DST_DIR)/ctw.jar: filelist $(DST_DIR)/wb.jar
|
||||||
|
Loading…
Reference in New Issue
Block a user