On Thu, 4 May 2023 17:17:19 GMT, Andrew Dinn <ad...@openjdk.org> wrote:

>> This small change ensures that repeated bytecode rewrites necessitated by 
>> class pool index updates are applied cumulatively when updating the method 
>> line number table. The current code applies each change to the original 
>> table which means only the last one is applied (and even then with the wrong 
>> adjustment).
>
> @coleenp @plummercj Any chance of feedback or a review for this patch?

> @adinn Looking at the closely related code, is the same problem present for 
> `adjust_exception_table` & `adjust_local_var_table`? Both appear to always 
> reach for the original value from the method, though unlike the line number 
> table, there's no member variable cached in the Relocator for either of them.

@DanHeidinga  I also thought that at first -- but it turns out the answer is 
no. Those other cases are different because the relocator directly updates the 
relevant offsets in the data located at the end of the ConstMethod. The line 
number table needs to be uncompressed and recompressed at each update, possibly 
ending up with a different size compressed array. So, the changes need to 
accumulate in a succession of compressed arrays held in the relocator the last 
of which gets recombined with the new version of the method  when the method 
clone eventually happens.

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

PR Comment: https://git.openjdk.org/jdk/pull/13795#issuecomment-1535867925

Reply via email to