--- old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EATestBase.java 2019-03-28 07:36:53.260519643 +0100 +++ new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EATestBase.java 2019-03-28 07:36:52.876517076 +0100 @@ -152,13 +152,17 @@ Assert.assertEquals(expectedConstantResult, returnNode.result().asConstant()); } } - int newInstanceCount = graph.getNodes().filter(isA(NewInstanceNode.class).or(NewArrayNode.class).or(AllocatedObjectNode.class)).count(); + int newInstanceCount = getAllocationCount(); Assert.assertEquals("Expected allocation count does not match", expectedAllocationCount, newInstanceCount); if (expectedAllocationCount == 0) { Assert.assertTrue("Unexpected CommitAllocationNode", graph.getNodes().filter(CommitAllocationNode.class).isEmpty()); } } + protected int getAllocationCount() { + return graph.getNodes().filter(isA(NewInstanceNode.class).or(NewArrayNode.class).or(AllocatedObjectNode.class)).count(); + } + @SuppressWarnings("try") protected void prepareGraph(String snippet, boolean iterativeEscapeAnalysis) { ResolvedJavaMethod method = getResolvedJavaMethod(snippet);