Mercurial > hg > graal-jvmci-8
changeset 12342:ccef6e165e8b
Merge
author | tschatzl |
---|---|
date | Fri, 27 Sep 2013 13:41:07 +0200 |
parents | bc918fd1e584 (diff) 4fa18058548e (current diff) |
children | d55c004e1d4d |
files | |
diffstat | 2 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/vm/memory/metaspace.cpp Fri Sep 27 11:18:26 2013 +0200 +++ b/src/share/vm/memory/metaspace.cpp Fri Sep 27 13:41:07 2013 +0200 @@ -3104,7 +3104,7 @@ MetaWord* Metaspace::allocate(size_t word_size, MetadataType mdtype) { // DumpSharedSpaces doesn't use class metadata area (yet) // Also, don't use class_vsm() unless UseCompressedClassPointers is true. - if (mdtype == ClassType && using_class_space()) { + if (is_class_space_allocation(mdtype)) { return class_vsm()->allocate(word_size); } else { return vsm()->allocate(word_size); @@ -3252,8 +3252,8 @@ MetaspaceAux::dump(gclog_or_tty); } // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support - const char* space_string = (mdtype == ClassType) ? "Compressed class space" : - "Metadata space"; + const char* space_string = is_class_space_allocation(mdtype) ? "Compressed class space" : + "Metadata space"; report_java_out_of_memory(space_string); if (JvmtiExport::should_post_resource_exhausted()) { @@ -3261,7 +3261,7 @@ JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR, space_string); } - if (mdtype == ClassType) { + if (is_class_space_allocation(mdtype)) { THROW_OOP_0(Universe::out_of_memory_error_class_metaspace()); } else { THROW_OOP_0(Universe::out_of_memory_error_metaspace());
--- a/src/share/vm/memory/metaspace.hpp Fri Sep 27 11:18:26 2013 +0200 +++ b/src/share/vm/memory/metaspace.hpp Fri Sep 27 13:41:07 2013 +0200 @@ -235,6 +235,9 @@ return NOT_LP64(false) LP64_ONLY(UseCompressedClassPointers && !DumpSharedSpaces); } + static bool is_class_space_allocation(MetadataType mdType) { + return mdType == ClassType && using_class_space(); + } }; class MetaspaceAux : AllStatic {