aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroland <unknown>2019-05-21 09:08:01 +0200
committerbell-sw <liberica@bell-sw.com>2019-10-23 16:22:26 +0300
commitd59b0da51e4c3026707bc87de6b2485ec58a58de (patch)
tree5ffb15826017bb593c3e8766736e4bc5d11dc59f
parentce2d3fab87218670fad07601402003ba91031bd1 (diff)
downloadjdk8u_hotspot-d59b0da51e4c3026707bc87de6b2485ec58a58de.tar.gz
8224580: Matcher can cause oop field/array element to be reloaded
Reviewed-by: neliasso, rkennke, dlong
-rw-r--r--src/share/vm/opto/matcher.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/share/vm/opto/matcher.cpp b/src/share/vm/opto/matcher.cpp
index b4dda4803..965f1a952 100644
--- a/src/share/vm/opto/matcher.cpp
+++ b/src/share/vm/opto/matcher.cpp
@@ -2043,6 +2043,12 @@ void Matcher::find_shared( Node *n ) {
// Node is shared and has no reason to clone. Flag it as shared.
// This causes it to match into a register for the sharing.
set_shared(n); // Flag as shared and
+ if (n->is_DecodeNarrowPtr()) {
+ // Oop field/array element loads must be shared but since
+ // they are shared through a DecodeN they may appear to have
+ // a single use so force sharing here.
+ set_shared(n->in(1));
+ }
mstack.pop(); // remove node from stack
continue;
}
@@ -2165,13 +2171,6 @@ void Matcher::find_shared( Node *n ) {
continue; // for(int i = ...)
}
- if( mop == Op_AddP && m->in(AddPNode::Base)->is_DecodeNarrowPtr()) {
- // Bases used in addresses must be shared but since
- // they are shared through a DecodeN they may appear
- // to have a single use so force sharing here.
- set_shared(m->in(AddPNode::Base)->in(1));
- }
-
// if 'n' and 'm' are part of a graph for BMI instruction, clone this node.
#ifdef X86
if (UseBMI1Instructions && is_bmi_pattern(n, m)) {