--- old/src/share/vm/opto/compile.hpp 2015-07-13 18:44:15.543641041 +0200 +++ new/src/share/vm/opto/compile.hpp 2015-07-13 18:44:15.255641033 +0200 @@ -1234,6 +1234,13 @@ CallGenerator* find_intrinsic(ciMethod* m, bool is_virtual); // query fn void register_intrinsic(CallGenerator* cg); // update fn + // Returns true if the intrinsic for method 'method' will perform a virtual dispatch. + static bool intrinsic_does_virtual_dispatch_for(Method* method); + + // A return value larger than 0 indicates that the intrinsic for method + // 'method' requires predicated logic. + static int intrinsic_predicates_needed_for(Method* method); + #ifndef PRODUCT static juint _intrinsic_hist_count[vmIntrinsics::ID_LIMIT]; static jubyte _intrinsic_hist_flags[vmIntrinsics::ID_LIMIT]; @@ -1259,6 +1266,23 @@ bool is_virtual, int flags) PRODUCT_RETURN0; static void print_intrinsic_statistics() PRODUCT_RETURN; + // An intrinsic is available if: + // - the intrinsic is enabled (by using the appropriate command-line flag) and + // - the intrinsic is supported by the VM (i.e., the platform on which the VM is + // running provides the instructions necessary for the C2 compiler to generate + // the intrinsic). + // + // The method 'is_intrinsic_available_for' returns true if the current + // platform provides an intrinsic for the method, for the compilation context, and + // for the dispatch mode (virtual or non-virtual) given as parameter. + // + // The parameter 'compilation_context' indicates the context in which 'method' + // is attempted to be intrinsified; 'compilation_context' is either a method + // that is calling 'method' or it is 'method' itself. The parameter + // 'compilation_context' is necessary to implement support for the + // DisableIntrinsic flag. + static bool is_intrinsic_available_for(Method* method, Method* compilation_context, bool is_virtual); + // Graph verification code // Walk the node list, verifying that there is a one-to-one // correspondence between Use-Def edges and Def-Use edges