annotate graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/AbstractMemoryCheckpointNode.java @ 3179:b9439feeec65

NodeArray uses modCount to assert in Iterators, variableInputs is now protected so that each Node class using it needs to export it explicitly (and thus give it a name)
author Lukas Stadler <lukas.stadler@jku.at>
date Thu, 07 Jul 2011 14:33:57 +0200
parents 3ada297d75ed
children d95db56f8deb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3069
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
1 /*
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
4 *
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
7 * published by the Free Software Foundation.
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
8 *
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
13 * accompanied this code).
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
14 *
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
18 *
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
21 * questions.
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
22 */
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
23 package com.oracle.max.graal.compiler.ir;
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
24
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
25 import java.util.*;
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
26
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
27 import com.oracle.max.graal.graph.*;
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
28 import com.sun.cri.ci.*;
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
29
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
30
3074
45ba159b4bd1 Added memory dependencies.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3070
diff changeset
31 public abstract class AbstractMemoryCheckpointNode extends StateSplit {
3069
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
32
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
33 private static final int SUCCESSOR_COUNT = 0;
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
34 private static final int INPUT_COUNT = 0;
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
35
3074
45ba159b4bd1 Added memory dependencies.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3070
diff changeset
36 public AbstractMemoryCheckpointNode(Graph graph) {
3069
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
37 this(CiKind.Illegal, 0, 0, graph);
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
38 }
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
39
3074
45ba159b4bd1 Added memory dependencies.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3070
diff changeset
40 public AbstractMemoryCheckpointNode(CiKind result, int inputCount, int successorCount, Graph graph) {
3069
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
41 super(result, inputCount + INPUT_COUNT, successorCount + SUCCESSOR_COUNT, graph);
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
42 }
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
43
3075
3ada297d75ed Towards new memory dependence graph.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3074
diff changeset
44 @Override
3ada297d75ed Towards new memory dependence graph.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3074
diff changeset
45 public Map<Object, Object> getDebugProperties() {
3ada297d75ed Towards new memory dependence graph.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3074
diff changeset
46 Map<Object, Object> debugProperties = super.getDebugProperties();
3ada297d75ed Towards new memory dependence graph.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3074
diff changeset
47 debugProperties.put("memoryCheckpoint", "true");
3ada297d75ed Towards new memory dependence graph.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3074
diff changeset
48 return debugProperties;
3ada297d75ed Towards new memory dependence graph.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3074
diff changeset
49 }
3ada297d75ed Towards new memory dependence graph.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3074
diff changeset
50
3069
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
51 public List<Node> mergedNodes() {
3179
b9439feeec65 NodeArray uses modCount to assert in Iterators, variableInputs is now protected so that each Node class using it needs to export it explicitly (and thus give it a name)
Lukas Stadler <lukas.stadler@jku.at>
parents: 3075
diff changeset
52 return variableInputs();
3069
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
53 }
6202a6bb6726 Restructure memory lowering code.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
54 }