--- old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileInvokeNode.java 2017-11-03 23:56:42.200257094 -0700 +++ new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileInvokeNode.java 2017-11-03 23:56:41.872242416 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,6 +37,15 @@ super(TYPE, method, freqLog, probabilityLog); } + @Override + protected boolean canBeMergedWith(ProfileNode p) { + if (p instanceof ProfileInvokeNode) { + ProfileInvokeNode that = (ProfileInvokeNode) p; + return this.method.equals(that.method); + } + return false; + } + /** * Gathers all the {@link ProfileInvokeNode}s that are inputs to the * {@linkplain StructuredGraph#getNodes() live nodes} in a given graph.