diff --git a/src/share/vm/classfile/classFileParser.cpp b/src/share/vm/classfile/classFileParser.cpp index ad11f2005dfe397a00acc10a8e2734b729ee50e9..373ca0ae8ffea7bf078683c1f35d1ec9edab29f7 100644 --- a/src/share/vm/classfile/classFileParser.cpp +++ b/src/share/vm/classfile/classFileParser.cpp @@ -436,14 +436,19 @@ constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) { ref_index, CHECK_(nullHandle)); break; case JVM_REF_invokeVirtual: - case JVM_REF_invokeStatic: - case JVM_REF_invokeSpecial: case JVM_REF_newInvokeSpecial: check_property( tag.is_method(), "Invalid constant pool index %u in class file %s (not a method)", ref_index, CHECK_(nullHandle)); break; + case JVM_REF_invokeStatic: + case JVM_REF_invokeSpecial: + check_property( + tag.is_method() || tag.is_interface_method(), + "Invalid constant pool index %u in class file %s (not a method)", + ref_index, CHECK_(nullHandle)); + break; case JVM_REF_invokeInterface: check_property( tag.is_interface_method(), @@ -3837,7 +3842,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name, } if (TraceClassLoadingPreorder) { - tty->print("[Loading %s", name->as_klass_external_name()); + tty->print("[Loading %s", (name != NULL) ? name->as_klass_external_name() : "NoName"); if (cfs->source() != NULL) tty->print(" from %s", cfs->source()); tty->print_cr("]"); } diff --git a/src/share/vm/classfile/genericSignatures.cpp b/src/share/vm/classfile/genericSignatures.cpp index 3b0ffbd334900c5a2ef3ff5039860a8eecf1de58..33fbca051b7aeb5c5ada0f07740ca3043bb92e7f 100644 --- a/src/share/vm/classfile/genericSignatures.cpp +++ b/src/share/vm/classfile/genericSignatures.cpp @@ -268,8 +268,15 @@ ClassDescriptor* ClassDescriptor::parse_generic_signature( Klass* outer = SystemDictionary::find( outer_name, class_loader, protection_domain, CHECK_NULL); if (outer == NULL && !THREAD->is_Compiler_thread()) { - outer = SystemDictionary::resolve_super_or_fail(original_name, - outer_name, class_loader, protection_domain, false, CHECK_NULL); + if (outer_name == ik->super()->name()) { + outer = SystemDictionary::resolve_super_or_fail(original_name, outer_name, + class_loader, protection_domain, + false, CHECK_NULL); + } + else { + outer = SystemDictionary::resolve_or_fail(outer_name, class_loader, + protection_domain, false, CHECK_NULL); + } } InstanceKlass* outer_ik; diff --git a/src/share/vm/interpreter/linkResolver.cpp b/src/share/vm/interpreter/linkResolver.cpp index 9f0a15448123fcc69907521af394402d9e143924..b0bd678b597b7b3c868776af526fefdb166ba690 100644 --- a/src/share/vm/interpreter/linkResolver.cpp +++ b/src/share/vm/interpreter/linkResolver.cpp @@ -1014,13 +1014,28 @@ void LinkResolver::runtime_resolve_interface_method(CallInfo& result, methodHand resolved_method->name(), resolved_method->signature())); } - // check if public - if (!sel_method->is_public()) { - ResourceMark rm(THREAD); - THROW_MSG(vmSymbols::java_lang_IllegalAccessError(), - Method::name_and_sig_as_C_string(recv_klass(), - sel_method->name(), - sel_method->signature())); + // check access + if (sel_method->method_holder()->is_interface()) { + // Method holder is an interface. Throw Illegal Access Error if sel_method + // is neither public nor private. + if (!(sel_method->is_public() || sel_method->is_private())) { + ResourceMark rm(THREAD); + THROW_MSG(vmSymbols::java_lang_IllegalAccessError(), + Method::name_and_sig_as_C_string(recv_klass(), + sel_method->name(), + sel_method->signature())); + } + } + else { + // Method holder is a class. Throw Illegal Access Error if sel_method + // is not public. + if (!sel_method->is_public()) { + ResourceMark rm(THREAD); + THROW_MSG(vmSymbols::java_lang_IllegalAccessError(), + Method::name_and_sig_as_C_string(recv_klass(), + sel_method->name(), + sel_method->signature())); + } } // check if abstract if (check_null_and_abstract && sel_method->is_abstract()) { diff --git a/src/share/vm/prims/methodHandles.cpp b/src/share/vm/prims/methodHandles.cpp index 54881388bd15a0a7468fa244a684806e11089f3c..322404b85d580e61e42876942df2b5fa7ee42199 100644 --- a/src/share/vm/prims/methodHandles.cpp +++ b/src/share/vm/prims/methodHandles.cpp @@ -187,6 +187,11 @@ oop MethodHandles::init_method_MemberName(oop mname_oop, Method* m, bool do_disp flags |= IS_CONSTRUCTOR | (JVM_REF_invokeSpecial << REFERENCE_KIND_SHIFT); } else if (mods.is_static()) { flags |= IS_METHOD | (JVM_REF_invokeStatic << REFERENCE_KIND_SHIFT); + // Check if this method is a lambda method that is generated as + // private static method. + if (m->is_private() && m->method_holder()->is_interface()) { + vmindex = klassItable::compute_itable_index(m); + } } else if (receiver_limit != mklass && !receiver_limit->is_subtype_of(mklass)) { return NULL; // bad receiver limit diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp index 6db5ff5820d0431c5b298502572c08bc76aee0fa..236a12726247125668918f3d751cce52ec9526a1 100644 --- a/src/share/vm/runtime/arguments.cpp +++ b/src/share/vm/runtime/arguments.cpp @@ -1901,7 +1901,7 @@ bool Arguments::check_vm_args_consistency() { // Divide by bucket size to prevent a large size from causing rollover when // calculating amount of memory needed to be allocated for the String table. - status = status && verify_interval(StringTableSize, defaultStringTableSize, + status = status && verify_interval(StringTableSize, minimumStringTableSize, (max_uintx / StringTable::bucket_size()), "StringTable size"); if (MinHeapFreeRatio > MaxHeapFreeRatio) { diff --git a/src/share/vm/services/memBaseline.hpp b/src/share/vm/services/memBaseline.hpp index c409ec3face44d3f5db3a29ee14c72b0c45e46a2..fc878160ea37f630b31265b226d5d8e027960657 100644 --- a/src/share/vm/services/memBaseline.hpp +++ b/src/share/vm/services/memBaseline.hpp @@ -133,7 +133,7 @@ typedef struct _memType2Name { // This class aggregates malloc'd records by memory type -class MallocMem : public _ValueObj { +class MallocMem VALUE_OBJ_CLASS_SPEC { private: MEMFLAGS _type; @@ -211,7 +211,7 @@ class ArenaMem : public MallocMem { }; // This class aggregates virtual memory by its memory type -class VMMem : public _ValueObj { +class VMMem VALUE_OBJ_CLASS_SPEC { private: MEMFLAGS _type; @@ -296,7 +296,7 @@ class BaselineComparisonReporter; * aggregates memory usage by callsites when detail tracking * is on. */ -class MemBaseline : public _ValueObj { +class MemBaseline VALUE_OBJ_CLASS_SPEC { friend class BaselineReporter; friend class BaselineComparisonReporter; diff --git a/src/share/vm/services/memPtr.hpp b/src/share/vm/services/memPtr.hpp index e1c852ac7ba915437c73cf0841c4f57e80e8a1f9..d98ca80c4579ce0c47ed1ffbc58add0d7e18442a 100644 --- a/src/share/vm/services/memPtr.hpp +++ b/src/share/vm/services/memPtr.hpp @@ -89,7 +89,7 @@ class SequenceGenerator : AllStatic { * the memory pointer either points to a malloc'd * memory block, or a mmap'd memory block */ -class MemPointer : public _ValueObj { +class MemPointer VALUE_OBJ_CLASS_SPEC { public: MemPointer(): _addr(0) { } MemPointer(address addr): _addr(addr) { } diff --git a/src/share/vm/services/memSnapshot.hpp b/src/share/vm/services/memSnapshot.hpp index 7d31c7386fec449ffa42f922eed3764581f93e7c..cf6236d420234204e25a5f57f1e7cbb067a4527e 100644 --- a/src/share/vm/services/memSnapshot.hpp +++ b/src/share/vm/services/memSnapshot.hpp @@ -308,7 +308,7 @@ class VMRecordIterator : public MemPointerArrayIterator { } }; -class StagingArea : public _ValueObj { +class StagingArea VALUE_OBJ_CLASS_SPEC { private: MemPointerArray* _malloc_data; MemPointerArray* _vm_data; diff --git a/src/share/vm/services/memTrackWorker.hpp b/src/share/vm/services/memTrackWorker.hpp index 964aad31db8284902dca9223f2709733773c8696..5d49ae1938e96544c7e9603a8670f5ff6efe7842 100644 --- a/src/share/vm/services/memTrackWorker.hpp +++ b/src/share/vm/services/memTrackWorker.hpp @@ -32,7 +32,7 @@ // Maximum MAX_GENERATIONS generation data can be tracked. #define MAX_GENERATIONS 512 -class GenerationData : public _ValueObj { +class GenerationData VALUE_OBJ_CLASS_SPEC { private: int _number_of_classes; MemRecorder* _recorder_list; diff --git a/src/share/vm/utilities/globalDefinitions.hpp b/src/share/vm/utilities/globalDefinitions.hpp index 52258981857ae8fcdb6289fbf3fd57fd3db8ba52..5609ffdf431402dbd9cb0c0e763583124c7e076c 100644 --- a/src/share/vm/utilities/globalDefinitions.hpp +++ b/src/share/vm/utilities/globalDefinitions.hpp @@ -328,9 +328,10 @@ const int max_method_code_size = 64*K - 1; // JVM spec, 2nd ed. section 4.8.1 ( //---------------------------------------------------------------------------------------------------- -// Minimum StringTableSize value +// Default and minimum StringTableSize values -const int defaultStringTableSize=1009; +const int defaultStringTableSize = NOT_LP64(1009) LP64_ONLY(60013); +const int minimumStringTableSize=1009; //----------------------------------------------------------------------------------------------------