Questions about using `assert` in Java

Andrew Luo andrewluotechnologies at outlook.com
Tue Jul 18 03:03:02 UTC 2023


Thanks, I see.  Then I wonder if we should consider the size of a function with assertions removed when making JIT inline decisions?  Since at JIT time I presume whether assertions are turned on or off is known – or is it too inefficient to calculate this metric?

Thanks,
-Andrew

From: Daohan Qu <quadhier at outlook.com>
Sent: Monday, July 17, 2023 7:55 PM
To: Andrew Luo <andrewluotechnologies at outlook.com>; core-libs-dev at openjdk.org
Subject: 答复: Questions about using `assert` in Java

> This makes me wonder if it is worth introducing a compiler flag
> that would omit assert statements from the compiled bytecode
> for this scenario.

Hi Andrew,

Maybe the first one of this FAQ could answer your question:

https://docs.oracle.com/javase/8/docs/technotes/guides/language/assert.html#design-faq-enable-disable

- Daohan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20230718/05ab35a6/attachment-0001.htm>


More information about the core-libs-dev mailing list