On Thu, 5 Sep 2024 13:40:51 GMT, Claes Redestad <redes...@openjdk.org> wrote:
>> C2 needs 10000 calls to inline this method, so wenshao is worried. However, >> this method call is almost always followed by a huge switch to handle >> different opcode, so I doubt how much of a difference inlining brings. >> >> But wenshao discovered that this method has too many field gets; I should >> indeed convert them to local variable access if possible. > > Yes, things like storing `endBci()` to a local variable can be great if it > both reduces code size and improves interpreter/C1 speed - but don't over-do > it as it's likely never-ending work for a kind of optimizations leyden might > make pointless. It is not necessary to use RawBytecodeHelper in the StackMapGenerator#detectFrameOffsets method. It may be better to operate directly on the `byte[] bytecode`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20863#discussion_r1745608455