--- old/src/share/vm/compiler/abstractCompiler.hpp 2015-07-14 18:39:24.275577156 +0200 +++ new/src/share/vm/compiler/abstractCompiler.hpp 2015-07-14 18:39:23.927577146 +0200 @@ -66,6 +66,44 @@ virtual bool supports_osr () { return true; } virtual bool can_compile_method(methodHandle method) { return true; } + // Determine if the current compiler provides an intrinsic + // for method 'method'. An intrinsic is available if: + // - the intrinsic is enabled (by using the appropriate command-line flag) and + // - the platform on which the VM is running provides the instructions necessary + // for the compiler to generate the intrinsic code. + // + // An intrinsic can also be disabled using the DisableIntrinsic command-line + // flag. There are three ways to disable an intrinsic using the DisableIntrinsic + // flag: + // + // (1) -XX:DisableIntrinsic=_hashCode,_getClass + // Disables intrinsification of _hashCode and _getClass globally + // (i.e., the intrinsified version the methods will not be used at all). + // (2) -XX:CompileCommand=option,aClass::aMethod,DisableIntrinsic,_hashCode + // Disables intrinsification of _hashCode when it is called from + // aClass::aMethod (but not for any other call site of _hashCode) + // (3) -XX:CompileCommand=option,java.lang.ref.Reference::get,DisableIntrinsic,_Reference_get + // Some methods are not compiled by C2. Instead, the C2 compiler + // returns directly the intrinsified version of these methods. + // The command above forces C2 to compile _Reference_get, but + // allows using the intrinsified version of _Reference_get at all + // other call sites. + // + // From the above modes, (1) disable intrinsics globally, (2) and (3) + // disable intrinsics on a per-method basis. In cases (2) and (3) the + // compilation context is aClass::aMethod and java.lang.ref.Reference::get, + // respectively. + virtual bool is_intrinsic_available_for(methodHandle method, methodHandle compilation_context) { + return false; + } + + // Use the version of 'is_intrinsic_available_for' from below if usage of + // per-method DisableIntrinsic flag is not expected (or not relevant). The + // method below ignores all per-method usages of the DisableIntrinsic flag. + virtual bool is_intrinsic_available_for(methodHandle method) { + return false; + } + // Compiler type queries. bool is_c1() { return _type == c1; } bool is_c2() { return _type == c2; }