--- old/src/share/vm/classfile/vmSymbols.hpp 2015-07-15 14:28:23.548238255 +0200 +++ new/src/share/vm/classfile/vmSymbols.hpp 2015-07-15 14:28:23.468238253 +0200 @@ -658,7 +658,10 @@ // annotation. If CheckIntrinsics is enabled, the VM performs the following // checks when a class C is loaded: (1) all intrinsics defined by the VM for // class C are present in the loaded class file and are marked; -// (2) an intrinsic is defined by the VM for all marked methods of class C. +// (2) an intrinsic is defined by the VM for all marked methods of class C; +// (3) check for orphan methods in class C (i.e., methods for which the VM +// declares an intrinsic but that are not declared for the loaded class C. +// Check (3) is available only in debug builds. // // If a mismatch is detected for a method, the VM behaves differently depending // on the type of build. A fastdebug build exits and reports an error on a mismatch. --- old/src/share/vm/runtime/globals.hpp 2015-07-15 14:28:23.580238256 +0200 +++ new/src/share/vm/runtime/globals.hpp 2015-07-15 14:28:23.472238253 +0200 @@ -4130,14 +4130,18 @@ "Use the FP register for holding the frame pointer " \ "and not as a general purpose register.") \ \ - diagnostic(bool, CheckIntrinsics, trueInDebug, \ + diagnostic(bool, CheckIntrinsics, true, \ "When a class C is loaded, check that " \ "(1) all intrinsics defined by the VM for class C are present "\ "in the loaded class file and are marked with the " \ - "@HotSpotIntrinsicCandidate annotation and also that " \ + "@HotSpotIntrinsicCandidate annotation, that " \ "(2) there is an intrinsic registered for all loaded methods " \ "that are annotated with the @HotSpotIntrinsicCandidate " \ - "annotation.") + "annotation, and that " \ + "(3) no orphan methods exist for class C (i.e., methods for " \ + "which the VM declares an intrinsic but that are not declared "\ + "in the loaded class C. " \ + "Check (3) is available only in debug builds.") /* * Macros for factoring of globals --- old/src/share/vm/classfile/classFileParser.cpp 2015-07-15 14:28:23.612238257 +0200 +++ new/src/share/vm/classfile/classFileParser.cpp 2015-07-15 14:28:23.500238254 +0200 @@ -4172,10 +4172,13 @@ } } +#ifdef ASSERT if (CheckIntrinsics) { // Check for orphan methods in the current class. A method m // of a class C is orphan if an intrinsic is defined for method m, // but class C does not declare m. + // The check is potentially expensive, therefore it is available + // only in debug builds. for (int id = vmIntrinsics::FIRST_ID; id < (int)vmIntrinsics::ID_LIMIT; id++) { if (id == vmIntrinsics::_compiledLambdaForm) { @@ -4211,8 +4214,10 @@ } } } +#endif // ASSERT } + if (cached_class_file != NULL) { // JVMTI: we have an InstanceKlass now, tell it about the cached bytes this_klass->set_cached_class_file(cached_class_file);