# HG changeset patch # User Thomas Wuerthinger # Date 1433109477 -7200 # Node ID 45dea3e241694d9c945f9a665ccd352eeeae0ea9 # Parent 993853d22c14156864d7d008e5883845fb828a4a Enable inlining during parsing by default. diff -r 993853d22c14 -r 45dea3e24169 graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeParser.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeParser.java Sun May 31 23:20:24 2015 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeParser.java Sun May 31 23:57:57 2015 +0200 @@ -77,7 +77,7 @@ public static final OptionValue TraceBytecodeParserLevel = new OptionValue<>(0); @Option(help = "Inlines trivial methods during bytecode parsing.", type = OptionType.Expert)// - public static final StableOptionValue InlineDuringParsing = new StableOptionValue<>(false); + public static final StableOptionValue InlineDuringParsing = new StableOptionValue<>(true); @Option(help = "Inlines intrinsic methods during bytecode parsing.", type = OptionType.Expert)// public static final StableOptionValue InlineIntrinsicsDuringParsing = new StableOptionValue<>(true); diff -r 993853d22c14 -r 45dea3e24169 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/CompiledExceptionHandlerTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/CompiledExceptionHandlerTest.java Sun May 31 23:20:24 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/CompiledExceptionHandlerTest.java Sun May 31 23:57:57 2015 +0200 @@ -48,8 +48,8 @@ return graph; } - private static void raiseException(String s) { - throw new RuntimeException(s); + private static void raiseExceptionSimple(String s) { + throw new RuntimeException("Raising exception with message \"" + s + "\""); } @Test @@ -67,7 +67,7 @@ public static String test1Snippet(String message) { if (message != null) { try { - raiseException(message); + raiseExceptionSimple(message); } catch (Exception e) { return message + e.getMessage(); } diff -r 993853d22c14 -r 45dea3e24169 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InlineDuringParsingPlugin.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InlineDuringParsingPlugin.java Sun May 31 23:20:24 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InlineDuringParsingPlugin.java Sun May 31 23:57:57 2015 +0200 @@ -33,9 +33,14 @@ @Override public InlineInfo shouldInlineInvoke(GraphBuilderContext b, ResolvedJavaMethod method, ValueNode[] args, JavaType returnType) { - if (method.hasBytecodes() && !method.isSynchronized() && method.getCode().length <= TrivialInliningSize.getValue() && b.getDepth() < InlineDuringParsingMaxDepth.getValue()) { + if (method.hasBytecodes() && method.canBeInlined() && !method.isSynchronized() && checkSize(method, args) && b.getDepth() < InlineDuringParsingMaxDepth.getValue()) { return new InlineInfo(method, false); } return null; } + + private static boolean checkSize(ResolvedJavaMethod method, @SuppressWarnings("unused") ValueNode[] args) { + int bonus = 1; + return method.getCode().length <= TrivialInliningSize.getValue() * bonus; + } }