RFR: 8338623: StackCounter adding extraneous slots for receiver invoke instructions

Chen Liang liach at openjdk.org
Tue Aug 20 05:40:57 UTC 2024


StackCounter was adding return type slots before deducting receiver slot, so code like

int b() { return this.hashCode(); }

will be counted as having a max stack of 2. Avoid this problem by only calling `addStackSlot` once for each instruction.

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

Commit messages:
 - 8338623: StackCounter adding extraneous slots for receiver invoke instructions

Changes: https://git.openjdk.org/jdk/pull/20637/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20637&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8338623
  Stats: 34 lines in 2 files changed: 29 ins; 1 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/20637.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20637/head:pull/20637

PR: https://git.openjdk.org/jdk/pull/20637


More information about the core-libs-dev mailing list