RFR: 8304996: Add missing HandleMarks [v2]
David Holmes
dholmes at openjdk.org
Thu Mar 30 01:15:18 UTC 2023
On Thu, 30 Mar 2023 00:46:08 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> What are the rules for using HandleMarks? In the HotSpot code, there are plenty of cases where we create a HandleMark without creating any Handles in the immediately following code. There are also plenty of cases where Handles are created in functions that do not have any HandleMarks.
@coleenp has a lot to say on this but basically HM's should appear along-side the code that creates the Handles. Unless you return a Handle from a function, there should generally be a HM in the function. There is a lot of code that doesn't follow this. Partly I think this is because we have some high-on-the-stack HMs or HandleMarkCleaners that hide the creation of Handles without a local HandleMark. Conversely if new code uses existing code that doesn't have a HM and gets an error, then the typical response is to put a HM in the new code - especially because that only affects the new change, whereas putting a HM lower-down could be seen as disruptive etc.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13215#issuecomment-1489543752
More information about the hotspot-runtime-dev
mailing list