提交 399491d1 编写于 作者: R roland

8174164: SafePointNode::_replaced_nodes breaks with irreducible loops

Reviewed-by: kvn
上级 6ccb2ca8
......@@ -449,8 +449,8 @@ public:
void delete_replaced_nodes() {
_replaced_nodes.reset();
}
void apply_replaced_nodes() {
_replaced_nodes.apply(this);
void apply_replaced_nodes(uint idx) {
_replaced_nodes.apply(this, idx);
}
void merge_replaced_nodes_with(SafePointNode* sfpt) {
_replaced_nodes.merge_with(sfpt->_replaced_nodes);
......
......@@ -1048,7 +1048,7 @@ void Parse::do_exits() {
kit.make_dtrace_method_exit(method());
}
if (_replaced_nodes_for_exceptions) {
kit.map()->apply_replaced_nodes();
kit.map()->apply_replaced_nodes(_new_idx);
}
// Done with exception-path processing.
ex_map = kit.make_exception_state(ex_oop);
......@@ -1069,7 +1069,7 @@ void Parse::do_exits() {
_exits.add_exception_state(ex_map);
}
}
_exits.map()->apply_replaced_nodes();
_exits.map()->apply_replaced_nodes(_new_idx);
}
//-----------------------------create_entry_map-------------------------------
......
......@@ -91,13 +91,17 @@ void ReplacedNodes::reset() {
}
// Perfom node replacement (used when returning to caller)
void ReplacedNodes::apply(Node* n) {
void ReplacedNodes::apply(Node* n, uint idx) {
if (is_empty()) {
return;
}
for (int i = 0; i < _replaced_nodes->length(); i++) {
ReplacedNode replaced = _replaced_nodes->at(i);
n->replace_edge(replaced.initial(), replaced.improved());
// Only apply if improved node was created in a callee to avoid
// issues with irreducible loops in the caller
if (replaced.improved()->_idx >= idx) {
n->replace_edge(replaced.initial(), replaced.improved());
}
}
}
......
......@@ -71,7 +71,7 @@ class ReplacedNodes VALUE_OBJ_CLASS_SPEC {
void record(Node* initial, Node* improved);
void transfer_from(const ReplacedNodes& other, uint idx);
void reset();
void apply(Node* n);
void apply(Node* n, uint idx);
void merge_with(const ReplacedNodes& other);
bool is_empty() const;
void dump(outputStream *st) const;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册