# HG changeset patch # User Thomas Wuerthinger # Date 1421766563 -3600 # Node ID 9536c47658a227c8bcdf6c9cfc5399a3222e9547 # Parent 91fee1fab96dc6be72f3b832583b75ac11dba104 Introduce new option InlineDuringParsing. diff -r 91fee1fab96d -r 9536c47658a2 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/GraalOptions.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/GraalOptions.java Thu Jan 22 11:16:26 2015 +0100 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/GraalOptions.java Tue Jan 20 16:09:23 2015 +0100 @@ -60,6 +60,9 @@ @Option(help = "Graphs with less than this number of nodes are trivial and therefore always inlined.", type = OptionType.Expert) public static final OptionValue TrivialInliningSize = new OptionValue<>(10); + @Option(help = "Inlines trivial methods during parsing of the bytecodes.", type = OptionType.Expert) + public static final StableOptionValue InlineDuringParsing = new StableOptionValue<>(false); + @Option(help = "Inlining is explored up to this number of nodes in the graph for each call site.", type = OptionType.Expert) public static final OptionValue MaximumInliningSize = new OptionValue<>(300); diff -r 91fee1fab96d -r 9536c47658a2 graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Thu Jan 22 11:16:26 2015 +0100 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Tue Jan 20 16:09:23 2015 +0100 @@ -738,6 +738,12 @@ } } + if (GraalOptions.InlineDuringParsing.getValue() && invokeKind.isDirect() && targetMethod.canBeInlined() && targetMethod.hasBytecodes()) { + if (targetMethod.getCode().length <= GraalOptions.TrivialInliningSize.getValue()) { + System.out.println("could inline trivial: " + targetMethod); + } + } + MethodCallTargetNode callTarget = currentGraph.add(createMethodCallTarget(invokeKind, targetMethod, args, returnType)); // be conservative if information was not recorded (could result in endless @@ -1210,8 +1216,7 @@ protected void iterateBytecodesForBlock(BciBlock block) { if (block.isLoopHeader) { // Create the loop header block, which later will merge the backward branches of - // the - // loop. + // the loop. AbstractEndNode preLoopEnd = currentGraph.add(new EndNode()); LoopBeginNode loopBegin = currentGraph.add(new LoopBeginNode()); lastInstr.setNext(preLoopEnd);