RFR: 8281195: Mistakenly used logging causes significant overhead in interpreter

Aleksey Shipilev shade at openjdk.java.net
Mon Feb 7 16:15:09 UTC 2022


On Mon, 7 Feb 2022 13:32:13 GMT, Alexey Pavlyutkin <duke at openjdk.java.net> wrote:

> Fixes
> 
> `bool OopMapCacheEntry::verify_mask(CellTypeState* vars, CellTypeState* stack, int max_locals, int stack_top)`
> 
> eliminating frequent generation of log messages with no respect of logging configuration
> 
> Verification: N/A (the issue does not have an observable effect)
> 
> Regression: hotspot_compiler (20.04 on amd64 )

Looks interesting. Does this only affect debug builds? I see the only call to `verify_mask` is from `OopMapCacheEntry::set_mask`, and it is under `assert`.

src/hotspot/share/interpreter/oopMapCache.cpp line 282:

> 280:   bool const is_log_enabled = log_type::is_enabled();
> 281:   static const log_type log;
> 282:   LogStream st(log);

Isn't this just:


  const bool log = log_is_enabled(Trace, interpreter, oopmap);
  LogStream st(Log(interpreter, oopmap)::trace());

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

Changes requested by shade (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7367


More information about the hotspot-runtime-dev mailing list