JDK-8011858 : Use Compile::live_nodes() instead of Compile::unique() in appropriate places
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-04-10
  • Updated: 2016-01-14
  • Resolved: 2015-08-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u72Fixed 9 b79Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
In places where C2 iterates over live nodes use live_nodes():

-  GrowableArray <Node *> nstack(C->unique());
+  GrowableArray <Node *> nstack(C->live_nodes());


Comments
Keep unique() if it is used to allocate an array/list were elements are reference by node's _idx. Use live_nodes() if it is used for stack like structures allocation where we want to estimate its size.
02-07-2013

What about the places where we use "unique() >> 3"? And the node limit check currently does both: assert(Compile::current()->unique() < (INT_MAX - 1), "Node limit exceeded INT_MAX"); assert(Compile::current()->live_nodes() < (uint)MaxNodeLimit, "Live Node limit exceeded limit");
02-07-2013

Also we need to restore bailout with reasonable nodes count limit and use live_nodes for that. After 7092905 changes we have UINT_MAX which leads to timeouts and OOM when C2 goes berserk (hits a bug): Node::verify_construction() { - assert(Compile::current()->unique() < (uint)MaxNodeLimit, "Node limit exceeded"); + assert(Compile::current()->unique() < (UINT_MAX - 1), "Node limit exceeded UINT_MAX");
10-04-2013