< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/ReplaceConstantNodesPhase.java

Print this page
rev 56282 : [mq]: graal

*** 1,7 **** /* ! * Copyright (c) 2016, 2018, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2016, 2019, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 30,39 **** --- 30,40 ---- import java.util.HashSet; import java.util.List; import jdk.internal.vm.compiler.collections.EconomicMap; + import jdk.internal.vm.compiler.collections.Equivalence; import org.graalvm.compiler.core.common.cfg.BlockMap; import org.graalvm.compiler.core.common.type.ObjectStamp; import org.graalvm.compiler.core.common.type.Stamp; import org.graalvm.compiler.core.common.type.StampFactory; import org.graalvm.compiler.debug.GraalError;
*** 316,326 **** private static void tryToReplaceWithExisting(StructuredGraph graph, ConstantNode node) { ScheduleResult schedule = graph.getLastSchedule(); NodeMap<Block> nodeToBlock = schedule.getNodeToBlockMap(); BlockMap<List<Node>> blockToNodes = schedule.getBlockToNodesMap(); ! EconomicMap<Block, Node> blockToExisting = EconomicMap.create(); for (Node n : node.usages().filter(n -> isReplacementNode(n))) { blockToExisting.put(nodeToBlock.get(n), n); } for (Node use : node.usages().filter(n -> !isReplacementNode(n)).snapshot()) { boolean replaced = false; --- 317,327 ---- private static void tryToReplaceWithExisting(StructuredGraph graph, ConstantNode node) { ScheduleResult schedule = graph.getLastSchedule(); NodeMap<Block> nodeToBlock = schedule.getNodeToBlockMap(); BlockMap<List<Node>> blockToNodes = schedule.getBlockToNodesMap(); ! EconomicMap<Block, Node> blockToExisting = EconomicMap.create(Equivalence.IDENTITY); for (Node n : node.usages().filter(n -> isReplacementNode(n))) { blockToExisting.put(nodeToBlock.get(n), n); } for (Node use : node.usages().filter(n -> !isReplacementNode(n)).snapshot()) { boolean replaced = false;
< prev index next >