RFR: 8295060: Port PrintDeoptimizationDetails to UL
David Holmes
dholmes at openjdk.org
Thu Oct 13 02:27:04 UTC 2022
On Wed, 12 Oct 2022 08:28:56 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> ?? I only see one usage in the switch statement so don't understand why this is not inline as normal logging code would be.
>
> I should've said "crosses initialization error", not "crossing."
>
> Check out this SO question: https://stackoverflow.com/questions/11578936/getting-a-bunch-of-crosses-initialization-error
>
> So `LogTarget(Debug, deoptimization) lt;` is the error here. I *think* that we can inline it if we introduce a surrounding scope, is that preferable to you?
>
> So:
>
>
> case T_OBJECT:
> *addr = value->get_int(T_OBJECT);
> { // Scope off LogTarget
> LogTarget(Debug, deoptimization) lt;
> if (lt.is_enabled()) {
> LogStream ls(lt);
> ls.print(" - Reconstructed expression %d (OBJECT): ", i);
> oop o = cast_to_oop((address)(*addr));
> if (o == NULL) {
> ls.print_cr("NULL");
> } else {
> ResourceMark rm;
> ls.print_raw_cr(o->klass()->name()->as_C_string());
> }
> }
> }
Yes adding the scope is fine and preferable. Thanks.
-------------
PR: https://git.openjdk.org/jdk/pull/10645
More information about the hotspot-dev
mailing list