# HG changeset patch # User Bernhard Urban # Date 1379745135 -7200 # Node ID bf7f09417f76e199d59bd4fb2d9a91e46cf9e0c1 # Parent a27fcd6707250de541de3d858edd81f401d370b7 move MemoryMap to API package diff -r a27fcd670725 -r bf7f09417f76 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MemoryMap.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MemoryMap.java Sat Sep 21 08:32:15 2013 +0200 @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2013, 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.api.meta; + +public interface MemoryMap { + + T getLastLocationAccess(LocationIdentity locationIdentity); +} diff -r a27fcd670725 -r bf7f09417f76 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MemoryMap.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MemoryMap.java Sat Sep 21 08:19:19 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2013, 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. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.nodes; - -import com.oracle.graal.api.meta.*; -import com.oracle.graal.graph.*; - -public interface MemoryMap { - - Node getLastLocationAccess(LocationIdentity locationIdentity); -} diff -r a27fcd670725 -r bf7f09417f76 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MemoryState.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MemoryState.java Sat Sep 21 08:19:19 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MemoryState.java Sat Sep 21 08:32:15 2013 +0200 @@ -22,14 +22,15 @@ */ package com.oracle.graal.nodes; +import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; public class MemoryState extends VirtualState { - private MemoryMap memoryMap; + private MemoryMap memoryMap; @Input private Node object; - public MemoryState(MemoryMap memoryMap, FixedNode object) { + public MemoryState(MemoryMap memoryMap, FixedNode object) { this.memoryMap = memoryMap; this.object = object; } @@ -38,7 +39,7 @@ return object; } - public MemoryMap getMemoryMap() { + public MemoryMap getMemoryMap() { return memoryMap; } diff -r a27fcd670725 -r bf7f09417f76 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java Sat Sep 21 08:19:19 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java Sat Sep 21 08:32:15 2013 +0200 @@ -27,6 +27,7 @@ import java.util.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.PhiNode.PhiType; import com.oracle.graal.nodes.extended.*; @@ -37,7 +38,7 @@ public class FloatingReadPhase extends Phase { - public static class MemoryMapImpl implements MemoryMap { + public static class MemoryMapImpl implements MemoryMap { private IdentityHashMap lastMemorySnapshot; diff -r a27fcd670725 -r bf7f09417f76 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InstanceOfSnippetsTemplates.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InstanceOfSnippetsTemplates.java Sat Sep 21 08:19:19 2013 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InstanceOfSnippetsTemplates.java Sat Sep 21 08:32:15 2013 +0200 @@ -206,7 +206,7 @@ } @Override - public void replace(ValueNode oldNode, ValueNode newNode, MemoryMap mmap) { + public void replace(ValueNode oldNode, ValueNode newNode, MemoryMap mmap) { assert newNode instanceof PhiNode; assert oldNode == instanceOf; newNode.inferStamp(); @@ -238,7 +238,7 @@ } @Override - public void replace(ValueNode oldNode, ValueNode newNode, MemoryMap mmap) { + public void replace(ValueNode oldNode, ValueNode newNode, MemoryMap mmap) { assert newNode instanceof PhiNode; assert oldNode == instanceOf; newNode.inferStamp(); diff -r a27fcd670725 -r bf7f09417f76 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Sat Sep 21 08:19:19 2013 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Sat Sep 21 08:32:15 2013 +0200 @@ -648,7 +648,7 @@ /** * mapping of killing locations to memory checkpoints (nodes). */ - private MemoryMap memoryMap; + private MemoryMap memoryMap; /** * Gets the instantiation-time bindings to this template's parameters. @@ -742,7 +742,7 @@ /** * Replaces all usages of {@code oldNode} with direct or indirect usages of {@code newNode}. */ - void replace(ValueNode oldNode, ValueNode newNode, MemoryMap mmap); + void replace(ValueNode oldNode, ValueNode newNode, MemoryMap mmap); } /** @@ -752,7 +752,7 @@ public static final UsageReplacer DEFAULT_REPLACER = new UsageReplacer() { @Override - public void replace(ValueNode oldNode, ValueNode newNode, MemoryMap mmap) { + public void replace(ValueNode oldNode, ValueNode newNode, MemoryMap mmap) { oldNode.replaceAtUsages(newNode); if (mmap == null || newNode == null) { return; @@ -774,7 +774,7 @@ } }; - private class DuplicateMapper implements MemoryMap { + private class DuplicateMapper implements MemoryMap { Map duplicates; StartNode replaceeStart; @@ -860,7 +860,7 @@ returnValue = (ValueNode) duplicates.get(returnNode.result()); } Node returnDuplicate = duplicates.get(returnNode); - MemoryMap mmap = new DuplicateMapper(duplicates, replaceeGraph.start()); + MemoryMap mmap = new DuplicateMapper(duplicates, replaceeGraph.start()); if (returnValue == null && replacee.usages().isNotEmpty() && replacee instanceof MemoryCheckpoint) { replacer.replace(replacee, (ValueNode) returnDuplicate.predecessor(), mmap); } else {