8212603: Need to step over GC barriers in Node::eqv_uncast()

Reviewed-by: shade, kvn, eosterlund
This commit is contained in:
Roman Kennke 2018-10-18 21:14:49 +02:00
parent f7393a59d1
commit cb17e450b3
2 changed files with 10 additions and 4 deletions

View File

@ -899,6 +899,13 @@ Node* Node::uncast() const {
return (Node*) this;
}
bool Node::eqv_uncast(const Node* n) const {
BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
Node* obj1 = bs->step_over_gc_barrier(const_cast<Node*>(this));
Node* obj2 = bs->step_over_gc_barrier(const_cast<Node*>(n));
return (obj1->uncast() == obj2->uncast());
}
// Find out of current node that matches opcode.
Node* Node::find_out_with(int opcode) {
for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) {

View File

@ -457,10 +457,9 @@ protected:
// Strip away casting. (It is depth-limited.)
Node* uncast() const;
// Return whether two Nodes are equivalent, after stripping casting.
bool eqv_uncast(const Node* n) const {
return (this->uncast() == n->uncast());
}
// Return whether two Nodes are equivalent, after stripping casting
// and GC barriers.
bool eqv_uncast(const Node* n) const;
// Find out of current node that matches opcode.
Node* find_out_with(int opcode);