comparison graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java @ 18912:9536c47658a2

Introduce new option InlineDuringParsing.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 20 Jan 2015 16:09:23 +0100
parents f57d86eb036f
children 0607cc136dd5
comparison
equal deleted inserted replaced
18911:91fee1fab96d 18912:9536c47658a2
736 JavaTypeProfile profile = profilingInfo.getTypeProfile(bci()); 736 JavaTypeProfile profile = profilingInfo.getTypeProfile(bci());
737 args[0] = TypeProfileProxyNode.proxify(args[0], profile); 737 args[0] = TypeProfileProxyNode.proxify(args[0], profile);
738 } 738 }
739 } 739 }
740 740
741 if (GraalOptions.InlineDuringParsing.getValue() && invokeKind.isDirect() && targetMethod.canBeInlined() && targetMethod.hasBytecodes()) {
742 if (targetMethod.getCode().length <= GraalOptions.TrivialInliningSize.getValue()) {
743 System.out.println("could inline trivial: " + targetMethod);
744 }
745 }
746
741 MethodCallTargetNode callTarget = currentGraph.add(createMethodCallTarget(invokeKind, targetMethod, args, returnType)); 747 MethodCallTargetNode callTarget = currentGraph.add(createMethodCallTarget(invokeKind, targetMethod, args, returnType));
742 748
743 // be conservative if information was not recorded (could result in endless 749 // be conservative if information was not recorded (could result in endless
744 // recompiles otherwise) 750 // recompiles otherwise)
745 if (graphBuilderConfig.omitAllExceptionEdges() || (optimisticOpts.useExceptionProbability() && profilingInfo.getExceptionSeen(bci()) == TriState.FALSE)) { 751 if (graphBuilderConfig.omitAllExceptionEdges() || (optimisticOpts.useExceptionProbability() && profilingInfo.getExceptionSeen(bci()) == TriState.FALSE)) {
1208 1214
1209 @Override 1215 @Override
1210 protected void iterateBytecodesForBlock(BciBlock block) { 1216 protected void iterateBytecodesForBlock(BciBlock block) {
1211 if (block.isLoopHeader) { 1217 if (block.isLoopHeader) {
1212 // Create the loop header block, which later will merge the backward branches of 1218 // Create the loop header block, which later will merge the backward branches of
1213 // the 1219 // the loop.
1214 // loop.
1215 AbstractEndNode preLoopEnd = currentGraph.add(new EndNode()); 1220 AbstractEndNode preLoopEnd = currentGraph.add(new EndNode());
1216 LoopBeginNode loopBegin = currentGraph.add(new LoopBeginNode()); 1221 LoopBeginNode loopBegin = currentGraph.add(new LoopBeginNode());
1217 lastInstr.setNext(preLoopEnd); 1222 lastInstr.setNext(preLoopEnd);
1218 // Add the single non-loop predecessor of the loop header. 1223 // Add the single non-loop predecessor of the loop header.
1219 loopBegin.addForwardEnd(preLoopEnd); 1224 loopBegin.addForwardEnd(preLoopEnd);