> In `LoadNode::Ideal_load_common`, the code checks whether the address type is 
> either an oopptr or a narrowoop, then casts it to `TypePtr` and checks the 
> offset.
> 
> However, a narrowoop is not a pointer: casting to `TypePtr` asserts that the 
> type's base is between `AnyPtr` and `AryKlassPtr`, while `isa_narrowoop()` 
> checks for `NarrowOop` base. These are mutually exclusive, so 
> `isa_narrowoop()` can never be true here without triggering the cast 
> assertion.
> 
> Since the address of a load must be a pointer (a narrow oop would need to be 
> decoded first), the `isa_narrowoop()` check is redundant and can be safely 
> removed.
> 
> Testing:
> - Ran `tier1` and `tier2` hotspot compiler tests.
> - Built and ran with `-XX:+UseCompressedOops` and `-XX:-UseCompressedOops` to 
> exercise both oop and narrow oop paths.
> 
> 
> 
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

xiaotaonan has updated the pull request incrementally with one additional 
commit since the last revision:

  fix: Modify according to the review comments.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/34156/files
  - new: https://git.openjdk.org/jdk/pull/34156/files/4a1a6b26..aa0b101a

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=34156&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=34156&range=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/34156.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/34156/head:pull/34156

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

Reply via email to