Integrated: 8286180: Enable construction of LogStreamImpl from LogMessageImpl

Johan Sjölén duke at openjdk.java.net
Mon May 30 16:57:49 UTC 2022


On Tue, 17 May 2022 12:55:35 GMT, Johan Sjölén <duke at openjdk.java.net> wrote:

> May I please have a review of this PR which adds non-interleaving log streams to UL?
> 
> In `LogMessageImpl` I remove templates and instead directly store a reference to `LogTagSet` and change `LogTagHandle` to be consistent (from pointer to reference) with `LogMessageImpl`.
> 
> Adding a non-interleaving log stream enables UL to replace two patterns found in HotSpot:
> 
> 1. `ttyLocker` + `(x)tty`
> Instead of taking the global tty lock in order to ensure non-interleaving logs we can now make a `NonInterleavingLogstream` and pass that around to various `print_on(outputStream*)` functions.
> 
> 2. `stringStream` + `outputStream*`
> In order to avoid taking the lock and being able to take arbitrary output streams a `stringStream` is created and finally printed through `print_raw(ss.as_string())`. This however requires a `ResourceMark`, which `NonInterleavingLogStream` does not require.
> 
> Passes tier 1.

This pull request has now been integrated.

Changeset: b2ba9fc9
Author:    Johan Sjölén <johan.sjolen at oracle.com>
Committer: Stefan Karlsson <stefank at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/b2ba9fc9f696fe3d452ad809d540f4618f5f215a
Stats:     260 lines in 6 files changed: 150 ins; 29 del; 81 mod

8286180: Enable construction of LogStreamImpl from LogMessageImpl

Reviewed-by: dholmes, stefank

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

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


More information about the hotspot-runtime-dev mailing list