mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-01 03:30:34 +00:00
Merge
This commit is contained in:
commit
4e05c8c099
@ -459,9 +459,9 @@ final class CompilerToVM {
|
||||
native long getLocalVariableTableStart(HotSpotResolvedJavaMethodImpl method);
|
||||
|
||||
/**
|
||||
* Determines if {@code method} should not be inlined or compiled.
|
||||
* Sets flags on {@code method} indicating that it should never be inlined or compiled by the VM.
|
||||
*/
|
||||
native void doNotInlineOrCompile(HotSpotResolvedJavaMethodImpl method);
|
||||
native void setNotInlineableOrCompileable(HotSpotResolvedJavaMethodImpl method);
|
||||
|
||||
/**
|
||||
* Invalidates the profiling information for {@code method} and (re)initializes it such that
|
||||
|
||||
@ -57,9 +57,9 @@ public interface HotSpotResolvedJavaMethod extends ResolvedJavaMethod {
|
||||
boolean hasReservedStackAccess();
|
||||
|
||||
/**
|
||||
* Manually adds a DontInline annotation to this method.
|
||||
* Sets flags on {@code method} indicating that it should never be inlined or compiled by the VM.
|
||||
*/
|
||||
void setNotInlineable();
|
||||
void setNotInlineableOrCompileable();
|
||||
|
||||
/**
|
||||
* Returns true if this method is one of the special methods that is ignored by security stack
|
||||
|
||||
@ -318,10 +318,10 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp
|
||||
}
|
||||
|
||||
/**
|
||||
* Manually adds a DontInline annotation to this method.
|
||||
* Sets flags on {@code method} indicating that it should never be inlined or compiled by the VM.
|
||||
*/
|
||||
public void setNotInlineable() {
|
||||
compilerToVM().doNotInlineOrCompile(this);
|
||||
public void setNotInlineableOrCompileable() {
|
||||
compilerToVM().setNotInlineableOrCompileable(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@ -5250,12 +5250,30 @@ void Parker::unpark() {
|
||||
int os::fork_and_exec(char* cmd) {
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
DWORD exit_code;
|
||||
|
||||
char * cmd_string;
|
||||
char * cmd_prefix = "cmd /C ";
|
||||
size_t len = strlen(cmd) + strlen(cmd_prefix) + 1;
|
||||
cmd_string = NEW_C_HEAP_ARRAY_RETURN_NULL(char, len, mtInternal);
|
||||
if (cmd_string == NULL) {
|
||||
return -1;
|
||||
}
|
||||
cmd_string[0] = '\0';
|
||||
strcat(cmd_string, cmd_prefix);
|
||||
strcat(cmd_string, cmd);
|
||||
|
||||
// now replace all '\n' with '&'
|
||||
char * substring = cmd_string;
|
||||
while ((substring = strchr(substring, '\n')) != NULL) {
|
||||
substring[0] = '&';
|
||||
substring++;
|
||||
}
|
||||
memset(&si, 0, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
memset(&pi, 0, sizeof(pi));
|
||||
BOOL rslt = CreateProcess(NULL, // executable name - use command line
|
||||
cmd, // command line
|
||||
cmd_string, // command line
|
||||
NULL, // process security attribute
|
||||
NULL, // thread security attribute
|
||||
TRUE, // inherits system handles
|
||||
@ -5269,17 +5287,17 @@ int os::fork_and_exec(char* cmd) {
|
||||
// Wait until child process exits.
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
|
||||
DWORD exit_code;
|
||||
GetExitCodeProcess(pi.hProcess, &exit_code);
|
||||
|
||||
// Close process and thread handles.
|
||||
CloseHandle(pi.hProcess);
|
||||
CloseHandle(pi.hThread);
|
||||
|
||||
return (int)exit_code;
|
||||
} else {
|
||||
return -1;
|
||||
exit_code = -1;
|
||||
}
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, cmd_string);
|
||||
return (int)exit_code;
|
||||
}
|
||||
|
||||
bool os::find(address addr, outputStream* st) {
|
||||
|
||||
@ -67,7 +67,7 @@ FileBuff::FileBuff( BufferedFile *fptr, ArchDesc& archDesc) : _fp(fptr), _AD(arc
|
||||
//------------------------------~FileBuff--------------------------------------
|
||||
// Nuke the FileBuff
|
||||
FileBuff::~FileBuff() {
|
||||
delete _bigbuf;
|
||||
delete[] _bigbuf;
|
||||
}
|
||||
|
||||
//------------------------------get_line----------------------------------------
|
||||
|
||||
@ -337,15 +337,12 @@ void Dictionary::add_klass(Symbol* class_name, ClassLoaderData* loader_data,
|
||||
DictionaryEntry* Dictionary::get_entry(int index, unsigned int hash,
|
||||
Symbol* class_name,
|
||||
ClassLoaderData* loader_data) {
|
||||
DEBUG_ONLY(_lookup_count++);
|
||||
for (DictionaryEntry* entry = bucket(index);
|
||||
entry != NULL;
|
||||
entry = entry->next()) {
|
||||
if (entry->hash() == hash && entry->equals(class_name, loader_data)) {
|
||||
DEBUG_ONLY(bucket_count_hit(index));
|
||||
return entry;
|
||||
}
|
||||
DEBUG_ONLY(_lookup_length++);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -548,114 +545,24 @@ void Dictionary::print(bool details) {
|
||||
tty->cr();
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
void Dictionary::printPerformanceInfoDetails() {
|
||||
if (log_is_enabled(Info, hashtables)) {
|
||||
ResourceMark rm;
|
||||
|
||||
log_info(hashtables)(" ");
|
||||
log_info(hashtables)("Java system dictionary (table_size=%d, classes=%d)",
|
||||
table_size(), number_of_entries());
|
||||
log_info(hashtables)("1st number: the bucket index");
|
||||
log_info(hashtables)("2nd number: the hit percentage for this bucket");
|
||||
log_info(hashtables)("3rd number: the entry's index within this bucket");
|
||||
log_info(hashtables)("4th number: the hash index of this entry");
|
||||
log_info(hashtables)(" ");
|
||||
|
||||
// find top buckets with highest lookup count
|
||||
#define TOP_COUNT 16
|
||||
int topItemsIndicies[TOP_COUNT];
|
||||
for (int i = 0; i < TOP_COUNT; i++) {
|
||||
topItemsIndicies[i] = i;
|
||||
}
|
||||
double total = 0.0;
|
||||
for (int i = 0; i < table_size(); i++) {
|
||||
// find the total count number, so later on we can
|
||||
// express bucket lookup count as a percentage of all lookups
|
||||
unsigned value = bucket_hits(i);
|
||||
total += value;
|
||||
|
||||
// find the top entry with min value
|
||||
int min_index = 0;
|
||||
unsigned min_value = bucket_hits(topItemsIndicies[min_index]);
|
||||
for (int j = 1; j < TOP_COUNT; j++) {
|
||||
unsigned top_value = bucket_hits(topItemsIndicies[j]);
|
||||
if (top_value < min_value) {
|
||||
min_value = top_value;
|
||||
min_index = j;
|
||||
}
|
||||
}
|
||||
// if the bucket loookup value is bigger than the top buckets min
|
||||
// move that bucket index into the top list
|
||||
if (value > min_value) {
|
||||
topItemsIndicies[min_index] = i;
|
||||
}
|
||||
}
|
||||
|
||||
for (int index = 0; index < table_size(); index++) {
|
||||
double percentage = 100.0 * (double)bucket_hits(index)/total;
|
||||
int chain = 0;
|
||||
for (DictionaryEntry* probe = bucket(index);
|
||||
probe != NULL;
|
||||
probe = probe->next()) {
|
||||
Klass* e = probe->klass();
|
||||
ClassLoaderData* loader_data = probe->loader_data();
|
||||
bool is_defining_class =
|
||||
(loader_data == e->class_loader_data());
|
||||
log_info(hashtables)("%4d: %5.2f%%: %3d: %10u: %s, loader %s",
|
||||
index, percentage, chain, probe->hash(), e->external_name(),
|
||||
(loader_data != NULL) ? loader_data->loader_name() : "NULL");
|
||||
|
||||
chain++;
|
||||
}
|
||||
if (chain == 0) {
|
||||
log_info(hashtables)("%4d:", index+1);
|
||||
}
|
||||
}
|
||||
log_info(hashtables)(" ");
|
||||
|
||||
// print out the TOP_COUNT of buckets with highest lookup count (unsorted)
|
||||
log_info(hashtables)("Top %d buckets:", TOP_COUNT);
|
||||
for (int i = 0; i < TOP_COUNT; i++) {
|
||||
log_info(hashtables)("%4d: hits %5.2f%%",
|
||||
topItemsIndicies[i],
|
||||
100.0*(double)bucket_hits(topItemsIndicies[i])/total);
|
||||
}
|
||||
}
|
||||
void DictionaryEntry::verify() {
|
||||
Klass* e = klass();
|
||||
ClassLoaderData* cld = loader_data();
|
||||
guarantee(e->is_instance_klass(),
|
||||
"Verify of system dictionary failed");
|
||||
// class loader must be present; a null class loader is the
|
||||
// boostrap loader
|
||||
guarantee(cld != NULL || DumpSharedSpaces ||
|
||||
cld->class_loader() == NULL ||
|
||||
cld->class_loader()->is_instance(),
|
||||
"checking type of class_loader");
|
||||
e->verify();
|
||||
verify_protection_domain_set();
|
||||
}
|
||||
#endif // ASSERT
|
||||
|
||||
void Dictionary::verify() {
|
||||
guarantee(number_of_entries() >= 0, "Verify of system dictionary failed");
|
||||
|
||||
int element_count = 0;
|
||||
for (int index = 0; index < table_size(); index++) {
|
||||
for (DictionaryEntry* probe = bucket(index);
|
||||
probe != NULL;
|
||||
probe = probe->next()) {
|
||||
Klass* e = probe->klass();
|
||||
ClassLoaderData* loader_data = probe->loader_data();
|
||||
guarantee(e->is_instance_klass(),
|
||||
"Verify of system dictionary failed");
|
||||
// class loader must be present; a null class loader is the
|
||||
// boostrap loader
|
||||
guarantee(loader_data != NULL || DumpSharedSpaces ||
|
||||
loader_data->class_loader() == NULL ||
|
||||
loader_data->class_loader()->is_instance(),
|
||||
"checking type of class_loader");
|
||||
e->verify();
|
||||
probe->verify_protection_domain_set();
|
||||
element_count++;
|
||||
}
|
||||
}
|
||||
guarantee(number_of_entries() == element_count,
|
||||
"Verify of system dictionary failed");
|
||||
#ifdef ASSERT
|
||||
if (!verify_lookup_length((double)number_of_entries() / table_size(), "System Dictionary")) {
|
||||
this->printPerformanceInfoDetails();
|
||||
}
|
||||
#endif // ASSERT
|
||||
|
||||
verify_table<DictionaryEntry>("System Dictionary");
|
||||
_pd_cache_table->verify();
|
||||
}
|
||||
|
||||
|
||||
@ -211,6 +211,8 @@ class DictionaryEntry : public HashtableEntry<InstanceKlass*, mtClass> {
|
||||
}
|
||||
st->print_cr("pd set count = #%d", count);
|
||||
}
|
||||
|
||||
void verify();
|
||||
};
|
||||
|
||||
// Entry in a SymbolPropertyTable, mapping a single Symbol*
|
||||
|
||||
@ -510,18 +510,7 @@ void ModuleEntry::print(outputStream* st) {
|
||||
}
|
||||
|
||||
void ModuleEntryTable::verify() {
|
||||
int element_count = 0;
|
||||
for (int i = 0; i < table_size(); i++) {
|
||||
for (ModuleEntry* probe = bucket(i);
|
||||
probe != NULL;
|
||||
probe = probe->next()) {
|
||||
probe->verify();
|
||||
element_count++;
|
||||
}
|
||||
}
|
||||
guarantee(number_of_entries() == element_count,
|
||||
"Verify of Module Entry Table failed");
|
||||
DEBUG_ONLY(verify_lookup_length((double)number_of_entries() / table_size(), "Module Entry Table"));
|
||||
verify_table<ModuleEntry>("Module Entry Table");
|
||||
}
|
||||
|
||||
void ModuleEntry::verify() {
|
||||
|
||||
@ -350,18 +350,7 @@ void PackageEntry::print(outputStream* st) {
|
||||
}
|
||||
|
||||
void PackageEntryTable::verify() {
|
||||
int element_count = 0;
|
||||
for (int index = 0; index < table_size(); index++) {
|
||||
for (PackageEntry* probe = bucket(index);
|
||||
probe != NULL;
|
||||
probe = probe->next()) {
|
||||
probe->verify();
|
||||
element_count++;
|
||||
}
|
||||
}
|
||||
guarantee(number_of_entries() == element_count,
|
||||
"Verify of Package Entry Table failed");
|
||||
DEBUG_ONLY(verify_lookup_length((double)number_of_entries() / table_size(), "Package Entry Table"));
|
||||
verify_table<PackageEntry>("Package Entry Table");
|
||||
}
|
||||
|
||||
void PackageEntry::verify() {
|
||||
|
||||
@ -97,18 +97,7 @@ void ProtectionDomainCacheEntry::print() {
|
||||
#endif
|
||||
|
||||
void ProtectionDomainCacheTable::verify() {
|
||||
int element_count = 0;
|
||||
for (int index = 0; index < table_size(); index++) {
|
||||
for (ProtectionDomainCacheEntry* probe = bucket(index);
|
||||
probe != NULL;
|
||||
probe = probe->next()) {
|
||||
probe->verify();
|
||||
element_count++;
|
||||
}
|
||||
}
|
||||
guarantee(number_of_entries() == element_count,
|
||||
"Verify of protection domain cache table failed");
|
||||
DEBUG_ONLY(verify_lookup_length((double)number_of_entries() / table_size(), "Domain Cache Table"));
|
||||
verify_table<ProtectionDomainCacheEntry>("Protection Domain Table");
|
||||
}
|
||||
|
||||
void ProtectionDomainCacheEntry::verify() {
|
||||
|
||||
@ -630,7 +630,7 @@ JVMCIEnv::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler, Hand
|
||||
if (nm != NULL && env == NULL) {
|
||||
DirectiveSet* directive = DirectivesStack::getMatchingDirective(method, compiler);
|
||||
bool printnmethods = directive->PrintAssemblyOption || directive->PrintNMethodsOption;
|
||||
if (printnmethods || PrintDebugInfo || PrintRelocations || PrintDependencies || PrintExceptionHandlers) {
|
||||
if (!printnmethods && (PrintDebugInfo || PrintRelocations || PrintDependencies || PrintExceptionHandlers)) {
|
||||
nm->print_nmethod(printnmethods);
|
||||
}
|
||||
DirectivesStack::release(directive);
|
||||
|
||||
@ -1003,7 +1003,7 @@ C2V_VMENTRY(jlong, getMaxCallTargetOffset, (JNIEnv*, jobject, jlong addr))
|
||||
return -1;
|
||||
C2V_END
|
||||
|
||||
C2V_VMENTRY(void, doNotInlineOrCompile,(JNIEnv *, jobject, jobject jvmci_method))
|
||||
C2V_VMENTRY(void, setNotInlineableOrCompileable,(JNIEnv *, jobject, jobject jvmci_method))
|
||||
methodHandle method = CompilerToVM::asMethod(jvmci_method);
|
||||
method->set_not_c1_compilable();
|
||||
method->set_not_c2_compilable();
|
||||
@ -1770,7 +1770,7 @@ JNINativeMethod CompilerToVM::methods[] = {
|
||||
{CC "getImplementor", CC "(" HS_RESOLVED_KLASS ")" HS_RESOLVED_KLASS, FN_PTR(getImplementor)},
|
||||
{CC "getStackTraceElement", CC "(" HS_RESOLVED_METHOD "I)" STACK_TRACE_ELEMENT, FN_PTR(getStackTraceElement)},
|
||||
{CC "methodIsIgnoredBySecurityStackWalk", CC "(" HS_RESOLVED_METHOD ")Z", FN_PTR(methodIsIgnoredBySecurityStackWalk)},
|
||||
{CC "doNotInlineOrCompile", CC "(" HS_RESOLVED_METHOD ")V", FN_PTR(doNotInlineOrCompile)},
|
||||
{CC "setNotInlineableOrCompileable", CC "(" HS_RESOLVED_METHOD ")V", FN_PTR(setNotInlineableOrCompileable)},
|
||||
{CC "isCompilable", CC "(" HS_RESOLVED_METHOD ")Z", FN_PTR(isCompilable)},
|
||||
{CC "hasNeverInlineDirective", CC "(" HS_RESOLVED_METHOD ")Z", FN_PTR(hasNeverInlineDirective)},
|
||||
{CC "shouldInlineMethod", CC "(" HS_RESOLVED_METHOD ")Z", FN_PTR(shouldInlineMethod)},
|
||||
|
||||
@ -126,6 +126,8 @@ DEF_HANDLE(typeArray , is_typeArray_noinline )
|
||||
|
||||
// Metadata Handles. Unlike oop Handles these are needed to prevent metadata
|
||||
// from being reclaimed by RedefineClasses.
|
||||
// Metadata Handles should be passed around as const references to avoid copy construction
|
||||
// and destruction for parameters.
|
||||
|
||||
// Specific Handles for different oop types
|
||||
#define DEF_METADATA_HANDLE(name, type) \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -24,7 +24,11 @@
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "classfile/altHashing.hpp"
|
||||
#include "classfile/dictionary.hpp"
|
||||
#include "classfile/javaClasses.inline.hpp"
|
||||
#include "classfile/moduleEntry.hpp"
|
||||
#include "classfile/packageEntry.hpp"
|
||||
#include "classfile/protectionDomainCache.hpp"
|
||||
#include "classfile/stringTable.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "memory/filemap.hpp"
|
||||
@ -276,14 +280,22 @@ template <class T, MEMFLAGS F> void Hashtable<T, F>::print() {
|
||||
}
|
||||
|
||||
|
||||
template <MEMFLAGS F> void BasicHashtable<F>::verify() {
|
||||
int count = 0;
|
||||
for (int i = 0; i < table_size(); i++) {
|
||||
for (BasicHashtableEntry<F>* p = bucket(i); p != NULL; p = p->next()) {
|
||||
++count;
|
||||
template <MEMFLAGS F>
|
||||
template <class T> void BasicHashtable<F>::verify_table(const char* table_name) {
|
||||
int element_count = 0;
|
||||
int max_bucket_count = 0;
|
||||
for (int index = 0; index < table_size(); index++) {
|
||||
int bucket_count = 0;
|
||||
for (T* probe = (T*)bucket(index); probe != NULL; probe = probe->next()) {
|
||||
probe->verify();
|
||||
bucket_count++;
|
||||
}
|
||||
element_count += bucket_count;
|
||||
max_bucket_count = MAX2(max_bucket_count, bucket_count);
|
||||
}
|
||||
assert(count == number_of_entries(), "number of hashtable entries incorrect");
|
||||
guarantee(number_of_entries() == element_count,
|
||||
"Verify of %s failed", table_name);
|
||||
DEBUG_ONLY(verify_lookup_length(max_bucket_count, table_name));
|
||||
}
|
||||
|
||||
|
||||
@ -291,18 +303,12 @@ template <MEMFLAGS F> void BasicHashtable<F>::verify() {
|
||||
|
||||
#ifdef ASSERT
|
||||
|
||||
template <MEMFLAGS F> bool BasicHashtable<F>::verify_lookup_length(double load, const char *table_name) {
|
||||
if ((!_lookup_warning) && (_lookup_count != 0)
|
||||
&& ((double)_lookup_length / (double)_lookup_count > load * 2.0)) {
|
||||
warning("Performance bug: %s lookup_count=%d "
|
||||
"lookup_length=%d average=%lf load=%f",
|
||||
table_name, _lookup_count, _lookup_length,
|
||||
(double)_lookup_length / _lookup_count, load);
|
||||
_lookup_warning = true;
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
// Assert if the longest bucket is 10x longer than the average bucket size.
|
||||
// Could change back to a warning, but warnings are not noticed.
|
||||
template <MEMFLAGS F> void BasicHashtable<F>::verify_lookup_length(int max_bucket_count, const char *table_name) {
|
||||
log_info(hashtables)("%s max bucket size %d element count %d table size %d", table_name,
|
||||
max_bucket_count, _number_of_entries, _table_size);
|
||||
assert (max_bucket_count < ((1 + number_of_entries()/table_size())*10), "Table is unbalanced");
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -344,3 +350,8 @@ template class HashtableEntry<Symbol*, mtTracing>;
|
||||
template class BasicHashtable<mtTracing>;
|
||||
#endif
|
||||
template class BasicHashtable<mtCompiler>;
|
||||
|
||||
template void BasicHashtable<mtClass>::verify_table<DictionaryEntry>(char const*);
|
||||
template void BasicHashtable<mtModule>::verify_table<ModuleEntry>(char const*);
|
||||
template void BasicHashtable<mtModule>::verify_table<PackageEntry>(char const*);
|
||||
template void BasicHashtable<mtClass>::verify_table<ProtectionDomainCacheEntry>(char const*);
|
||||
|
||||
@ -124,17 +124,9 @@ private:
|
||||
// Instance variable
|
||||
BasicHashtableEntry<F>* _entry;
|
||||
|
||||
#ifdef ASSERT
|
||||
private:
|
||||
unsigned _hits;
|
||||
public:
|
||||
unsigned hits() { return _hits; }
|
||||
void count_hit() { _hits++; }
|
||||
#endif
|
||||
|
||||
public:
|
||||
// Accessing
|
||||
void clear() { _entry = NULL; DEBUG_ONLY(_hits = 0); }
|
||||
void clear() { _entry = NULL; }
|
||||
|
||||
// The following methods use order access methods to avoid race
|
||||
// conditions in multiprocessor systems.
|
||||
@ -179,10 +171,7 @@ private:
|
||||
protected:
|
||||
|
||||
#ifdef ASSERT
|
||||
bool _lookup_warning;
|
||||
mutable int _lookup_count;
|
||||
mutable int _lookup_length;
|
||||
bool verify_lookup_length(double load, const char *table_name);
|
||||
void verify_lookup_length(int max_bucket_count, const char *table_name);
|
||||
#endif
|
||||
|
||||
void initialize(int table_size, int entry_size, int number_of_entries);
|
||||
@ -232,16 +221,7 @@ public:
|
||||
|
||||
int number_of_entries() { return _number_of_entries; }
|
||||
|
||||
void verify() PRODUCT_RETURN;
|
||||
|
||||
#ifdef ASSERT
|
||||
void bucket_count_hit(int i) const {
|
||||
_buckets[i].count_hit();
|
||||
}
|
||||
unsigned bucket_hits(int i) const {
|
||||
return _buckets[i].hits();
|
||||
}
|
||||
#endif
|
||||
template <class T> void verify_table(const char* table_name) PRODUCT_RETURN;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -64,11 +64,6 @@ template <MEMFLAGS F> inline void BasicHashtable<F>::initialize(int table_size,
|
||||
_first_free_entry = NULL;
|
||||
_end_block = NULL;
|
||||
_number_of_entries = number_of_entries;
|
||||
#ifdef ASSERT
|
||||
_lookup_warning = false;
|
||||
_lookup_count = 0;
|
||||
_lookup_length = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1396,6 +1396,8 @@ void VMError::report_and_die(int id, const char* message, const char* detail_fmt
|
||||
out.print_raw ("/bin/sh -c ");
|
||||
#elif defined(SOLARIS)
|
||||
out.print_raw ("/usr/bin/sh -c ");
|
||||
#elif defined(WINDOWS)
|
||||
out.print_raw ("cmd /C ");
|
||||
#endif
|
||||
out.print_raw ("\"");
|
||||
out.print_raw (cmd);
|
||||
|
||||
@ -215,8 +215,8 @@ public class CompilerToVMHelper {
|
||||
return CTVM.getLocalVariableTableStart((HotSpotResolvedJavaMethodImpl)method);
|
||||
}
|
||||
|
||||
public static void doNotInlineOrCompile(HotSpotResolvedJavaMethod method) {
|
||||
CTVM.doNotInlineOrCompile((HotSpotResolvedJavaMethodImpl)method);
|
||||
public static void setNotInlineableOrCompileable(HotSpotResolvedJavaMethod method) {
|
||||
CTVM.setNotInlineableOrCompileable((HotSpotResolvedJavaMethodImpl)method);
|
||||
}
|
||||
|
||||
public static void reprofile(HotSpotResolvedJavaMethod method) {
|
||||
|
||||
@ -71,10 +71,10 @@ public class DoNotInlineOrCompileTest {
|
||||
boolean hasNeverInlineDirective = CompilerToVMHelper.hasNeverInlineDirective(method);
|
||||
Asserts.assertFalse(hasNeverInlineDirective, "Unexpected initial " +
|
||||
"value of property 'hasNeverInlineDirective'");
|
||||
CompilerToVMHelper.doNotInlineOrCompile(method);
|
||||
CompilerToVMHelper.setNotInlineableOrCompileable(method);
|
||||
hasNeverInlineDirective = CompilerToVMHelper.hasNeverInlineDirective(method);
|
||||
Asserts.assertTrue(hasNeverInlineDirective, aMethod
|
||||
+ " : hasNeverInlineDirective is false even after doNotInlineOrCompile'");
|
||||
+ " : hasNeverInlineDirective is false even after setNotInlineableOrCompileable'");
|
||||
}
|
||||
|
||||
private static List<Executable> createTestCases() {
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
* jdk.internal.vm.ci/jdk.vm.ci.amd64
|
||||
* jdk.internal.vm.ci/jdk.vm.ci.sparc
|
||||
* @compile CodeInstallationTest.java TestHotSpotVMConfig.java NativeCallTest.java TestAssembler.java sparc/SPARCTestAssembler.java amd64/AMD64TestAssembler.java
|
||||
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Xbootclasspath/a:. jdk.vm.ci.code.test.NativeCallTest
|
||||
* @run junit/othervm/native -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Xbootclasspath/a:. jdk.vm.ci.code.test.NativeCallTest
|
||||
*/
|
||||
package jdk.vm.ci.code.test;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 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
|
||||
@ -23,11 +23,11 @@
|
||||
|
||||
/*
|
||||
* @test TestOnOutOfMemoryError
|
||||
* @summary Test using -XX:OnOutOfMemoryError=<cmd>
|
||||
* @summary Test using single and multiple -XX:OnOutOfMemoryError=<cmd>
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @run main TestOnOutOfMemoryError
|
||||
* @bug 8078470
|
||||
* @bug 8078470 8177522
|
||||
*/
|
||||
|
||||
import jdk.test.lib.process.ProcessTools;
|
||||
@ -44,13 +44,22 @@ public class TestOnOutOfMemoryError {
|
||||
}
|
||||
|
||||
// else this is the main test
|
||||
String msg = "Test Succeeded";
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:OnOutOfMemoryError=echo " + msg,
|
||||
String msg1 = "Test1 Succeeded";
|
||||
String msg2 = "Test2 Succeeded";
|
||||
ProcessBuilder pb_single = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:OnOutOfMemoryError=echo " + msg1,
|
||||
TestOnOutOfMemoryError.class.getName(),
|
||||
"throwOOME");
|
||||
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
ProcessBuilder pb_multiple = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:OnOutOfMemoryError=echo " + msg1,
|
||||
"-XX:OnOutOfMemoryError=echo " + msg2,
|
||||
TestOnOutOfMemoryError.class.getName(),
|
||||
"throwOOME");
|
||||
|
||||
OutputAnalyzer output_single = new OutputAnalyzer(pb_single.start());
|
||||
|
||||
OutputAnalyzer output_multiple = new OutputAnalyzer(pb_multiple.start());
|
||||
|
||||
/* Actual output should look like this:
|
||||
#
|
||||
@ -64,8 +73,13 @@ public class TestOnOutOfMemoryError {
|
||||
So we don't want to match on the "# Executing ..." line, and they
|
||||
both get written to stdout.
|
||||
*/
|
||||
output.shouldContain("Requested array size exceeds VM limit");
|
||||
output.stdoutShouldMatch("^" + msg); // match start of line only
|
||||
output_single.shouldContain("Requested array size exceeds VM limit");
|
||||
output_single.stdoutShouldMatch("^" + msg1); // match start of line only
|
||||
|
||||
output_multiple.shouldContain("Requested array size exceeds VM limit");
|
||||
output_multiple.stdoutShouldMatch("^" + msg1); // match start of line only
|
||||
output_multiple.stdoutShouldMatch("^" + msg2); // match start of line only
|
||||
|
||||
System.out.println("PASSED");
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.compiler
|
||||
* @run main NoClassDefFoundMsg
|
||||
* @run main/native NoClassDefFoundMsg
|
||||
*/
|
||||
|
||||
import jdk.test.lib.InMemoryJavaCompiler;
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @summary Verifies the JVMTI GetAllModules API
|
||||
* @library /test/lib
|
||||
* @run main/othervm -agentlib:JvmtiGetAllModulesTest JvmtiGetAllModulesTest
|
||||
* @run main/othervm/native -agentlib:JvmtiGetAllModulesTest JvmtiGetAllModulesTest
|
||||
*
|
||||
*/
|
||||
import java.lang.module.ModuleReference;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user