diff 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
line wrap: on
line diff
--- 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);