115 * Add the given floating node to the graph.
116 *
117 * @param node The floating node to be added.
118 */
119 public void addFloatingNode(ValueNode node, @SuppressWarnings("unused") String cause) {
120 add("add floating node", graph -> {
121 graph.addWithoutUniqueWithInputs(node);
122 });
123 }
124
125 /**
126 * Sets the phi node's input at the given index to the given value, adding new phi inputs as
127 * needed.
128 *
129 * @param node The phi node whose input should be changed.
130 * @param index The index of the phi input to be changed.
131 * @param value The new value for the phi input.
132 */
133 public void initializePhiInput(PhiNode node, int index, ValueNode value) {
134 add("set phi input", (graph, obsoleteNodes) -> {
135 assert node.isAlive() && index >= 0;
136 node.initializeValueAt(index, graph.addOrUniqueWithInputs(value));
137 });
138 }
139
140 /**
141 * Adds a virtual object's state to the given frame state. If the given reusedVirtualObjects set
142 * contains the virtual object then old states for this object will be removed.
143 *
144 * @param node The frame state to which the state should be added.
145 * @param state The virtual object state to add.
146 */
147 public void addVirtualMapping(FrameState node, EscapeObjectState state) {
148 add("add virtual mapping", new Effect() {
149 @Override
150 public void apply(StructuredGraph graph, ArrayList<Node> obsoleteNodes) {
151 if (node.isAlive()) {
152 assert !state.isDeleted();
153 FrameState stateAfter = node;
154 for (int i = 0; i < stateAfter.virtualObjectMappingCount(); i++) {
155 if (stateAfter.virtualObjectMappingAt(i).object() == state.object()) {
|
115 * Add the given floating node to the graph.
116 *
117 * @param node The floating node to be added.
118 */
119 public void addFloatingNode(ValueNode node, @SuppressWarnings("unused") String cause) {
120 add("add floating node", graph -> {
121 graph.addWithoutUniqueWithInputs(node);
122 });
123 }
124
125 /**
126 * Sets the phi node's input at the given index to the given value, adding new phi inputs as
127 * needed.
128 *
129 * @param node The phi node whose input should be changed.
130 * @param index The index of the phi input to be changed.
131 * @param value The new value for the phi input.
132 */
133 public void initializePhiInput(PhiNode node, int index, ValueNode value) {
134 add("set phi input", (graph, obsoleteNodes) -> {
135 assert node.isAlive() && index >= 0 : node;
136 node.initializeValueAt(index, graph.addOrUniqueWithInputs(value));
137 });
138 }
139
140 /**
141 * Adds a virtual object's state to the given frame state. If the given reusedVirtualObjects set
142 * contains the virtual object then old states for this object will be removed.
143 *
144 * @param node The frame state to which the state should be added.
145 * @param state The virtual object state to add.
146 */
147 public void addVirtualMapping(FrameState node, EscapeObjectState state) {
148 add("add virtual mapping", new Effect() {
149 @Override
150 public void apply(StructuredGraph graph, ArrayList<Node> obsoleteNodes) {
151 if (node.isAlive()) {
152 assert !state.isDeleted();
153 FrameState stateAfter = node;
154 for (int i = 0; i < stateAfter.virtualObjectMappingCount(); i++) {
155 if (stateAfter.virtualObjectMappingAt(i).object() == state.object()) {
|