JDK-8198308 : Remove symbolic constant badOopVal and macro definition badOop from globalDefinitions.hpp
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 10
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2018-02-16
  • Updated: 2019-01-15
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.
Other
tbdUnresolved
Related Reports
Relates :  
Description
Questionable remaining use of badOopVal, potential for removal.

share/utilities/globalDefinitions.hpp:const intptr_t badOopVal        = -1;                       // generic "bad oop" value
share/utilities/globalDefinitions.hpp:#define       badOop            (cast_to_oop(::badOopVal))
share/code/compiledIC.cpp:  assert (cache == NULL || cache != (Metadata*)badOopVal, "invalid metadata");

Comments
badOop seems to be unused, and could just be deleted. That would leave only one use of badOopVal, in an assert in CompiledIC::internal_set_ic_destination (compiledIC.cpp). It's not clear how that case would actually arise to trigger the assert, so maybe this use isn't needed. Indeed, the values here aren't oops at all, but are expected to be some kind of metadata, so perhaps this is a permgen holdover. Eliminating badOopVal here would render it unused too.
19-02-2018