src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java	Mon Aug 28 14:09:44 2017
--- new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java	Mon Aug 28 14:09:44 2017

*** 705,718 **** --- 705,730 ---- arguments[0] = graphBuilderContext.nullCheckedValue(arguments[0]); predecessor = graphBuilderContext.lastInstr; } } + LoopScope inlineLoopScope = createInitialLoopScope(inlineScope, predecessor); + + /* + * The GraphEncoder assigns parameters a nodeId immediately after the fixed nodes. + * Initializing createdNodes here avoid decoding and immediately replacing the + * ParameterNodes. + */ + int firstArgumentNodeId = inlineScope.maxFixedNodeOrderId + 1; + for (int i = 0; i < arguments.length; i++) { + inlineLoopScope.createdNodes[firstArgumentNodeId + i] = arguments[i]; + } + /* * Do the actual inlining by returning the initial loop scope for the inlined method scope. */ ! return createInitialLoopScope(inlineScope, predecessor); ! return inlineLoopScope; } @Override protected void finishInlining(MethodScope is) { PEMethodScope inlineScope = (PEMethodScope) is;
*** 1026,1038 **** --- 1038,1048 ---- Node node = n; if (node instanceof ParameterNode) { ParameterNode param = (ParameterNode) node; if (methodScope.isInlinedMethod()) { ! Node result = methodScope.arguments[param.index()]; assert result != null; return result; ! throw GraalError.shouldNotReachHere("Parameter nodes are already registered when the inlined scope is created"); } else if (parameterPlugin != null) { assert !methodScope.isInlinedMethod(); GraphBuilderContext graphBuilderContext = new PENonAppendGraphBuilderContext(methodScope, null); Node result = parameterPlugin.interceptParameter(graphBuilderContext, param.index(),

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File