< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningData.java

Print this page




 137     }
 138 
 139     public static boolean isFreshInstantiation(ValueNode arg) {
 140         return (arg instanceof AbstractNewObjectNode) || (arg instanceof AllocatedObjectNode) || (arg instanceof VirtualObjectNode);
 141     }
 142 
 143     private String checkTargetConditionsHelper(ResolvedJavaMethod method, int invokeBci) {
 144         OptionValues options = rootGraph.getOptions();
 145         if (method == null) {
 146             return "the method is not resolved";
 147         } else if (method.isNative() && (!Intrinsify.getValue(options) || !InliningUtil.canIntrinsify(context.getReplacements(), method, invokeBci))) {
 148             return "it is a non-intrinsic native method";
 149         } else if (method.isAbstract()) {
 150             return "it is an abstract method";
 151         } else if (!method.getDeclaringClass().isInitialized()) {
 152             return "the method's class is not initialized";
 153         } else if (!method.canBeInlined()) {
 154             return "it is marked non-inlinable";
 155         } else if (countRecursiveInlining(method) > MaximumRecursiveInlining.getValue(options)) {
 156             return "it exceeds the maximum recursive inlining depth";


 157         } else {
 158             if (new OptimisticOptimizations(rootGraph.getProfilingInfo(method), options).lessOptimisticThan(context.getOptimisticOptimizations())) {
 159                 return "the callee uses less optimistic optimizations than caller";
 160             } else {
 161                 return null;
 162             }
 163         }
 164     }
 165 
 166     private boolean checkTargetConditions(Invoke invoke, ResolvedJavaMethod method) {
 167         final String failureMessage = checkTargetConditionsHelper(method, invoke.bci());
 168         if (failureMessage == null) {
 169             return true;
 170         } else {
 171             InliningUtil.traceNotInlinedMethod(invoke, inliningDepth(), method, failureMessage);
 172             invoke.asNode().graph().getInliningLog().addDecision(invoke, false, "InliningPhase", null, null, failureMessage);
 173             return false;
 174         }
 175     }
 176 




 137     }
 138 
 139     public static boolean isFreshInstantiation(ValueNode arg) {
 140         return (arg instanceof AbstractNewObjectNode) || (arg instanceof AllocatedObjectNode) || (arg instanceof VirtualObjectNode);
 141     }
 142 
 143     private String checkTargetConditionsHelper(ResolvedJavaMethod method, int invokeBci) {
 144         OptionValues options = rootGraph.getOptions();
 145         if (method == null) {
 146             return "the method is not resolved";
 147         } else if (method.isNative() && (!Intrinsify.getValue(options) || !InliningUtil.canIntrinsify(context.getReplacements(), method, invokeBci))) {
 148             return "it is a non-intrinsic native method";
 149         } else if (method.isAbstract()) {
 150             return "it is an abstract method";
 151         } else if (!method.getDeclaringClass().isInitialized()) {
 152             return "the method's class is not initialized";
 153         } else if (!method.canBeInlined()) {
 154             return "it is marked non-inlinable";
 155         } else if (countRecursiveInlining(method) > MaximumRecursiveInlining.getValue(options)) {
 156             return "it exceeds the maximum recursive inlining depth";
 157         } else if (!method.hasBytecodes()) {
 158             return "it has no bytecodes to inline";
 159         } else {
 160             if (new OptimisticOptimizations(rootGraph.getProfilingInfo(method), options).lessOptimisticThan(context.getOptimisticOptimizations())) {
 161                 return "the callee uses less optimistic optimizations than caller";
 162             } else {
 163                 return null;
 164             }
 165         }
 166     }
 167 
 168     private boolean checkTargetConditions(Invoke invoke, ResolvedJavaMethod method) {
 169         final String failureMessage = checkTargetConditionsHelper(method, invoke.bci());
 170         if (failureMessage == null) {
 171             return true;
 172         } else {
 173             InliningUtil.traceNotInlinedMethod(invoke, inliningDepth(), method, failureMessage);
 174             invoke.asNode().graph().getInliningLog().addDecision(invoke, false, "InliningPhase", null, null, failureMessage);
 175             return false;
 176         }
 177     }
 178 


< prev index next >