RFR: 8278141: LIR_OpLoadKlass::_info shadows the field of the same name from LIR_Op

Aleksey Shipilev shade at openjdk.java.net
Thu Dec 2 12:37:43 UTC 2021


SoundCloud complains about code added in [JDK-8277417](https://bugs.openjdk.java.net/browse/JDK-8277417):
 Field "_info" shadows a field of the same name in base class "LIR_Op"


class LIR_OpLoadKlass: public LIR_Op {
  friend class LIR_OpVisitState;

 private:
  LIR_Opr _obj;
  CodeEmitInfo* _info; <--- here


>From the look of it, it seems risky to have two inconsistent fields here. Depending on which base class we use to access it, we might have different `_info`-s referenced. @rkennke, that was not intentional, was it? I don't see the mentions of this oddity in the original PR.

The fix is to push `CodeEmitInfo` to super-class `LIR_Op`, and use it from there.

Additional testing:
 - [x] Linux x86_64 fastdebug `tier1`
 - [x] Linux x86_64 fastdebug `tier2`

-------------

Commit messages:
 - Fix

Changes: https://git.openjdk.java.net/jdk/pull/6669/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6669&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8278141
  Stats: 4 lines in 1 file changed: 0 ins; 2 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6669.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6669/head:pull/6669

PR: https://git.openjdk.java.net/jdk/pull/6669


More information about the hotspot-compiler-dev mailing list