From 90bcdbd15fe7211377f6f6812a2b562c17995d65 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Thu, 21 Sep 2023 14:47:06 +0000 Subject: [PATCH] 8316581: Improve performance of Symbol::print_value_on() Reviewed-by: shade, coleenp, dholmes --- src/hotspot/share/oops/symbol.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/hotspot/share/oops/symbol.cpp b/src/hotspot/share/oops/symbol.cpp index f77d69fe3d4..cbb51e1bb90 100644 --- a/src/hotspot/share/oops/symbol.cpp +++ b/src/hotspot/share/oops/symbol.cpp @@ -22,7 +22,6 @@ * */ - #include "precompiled.hpp" #include "cds/metaspaceShared.hpp" #include "classfile/altHashing.hpp" @@ -390,11 +389,9 @@ void Symbol::print() const { print_on(tty); } // The print_value functions are present in all builds, to support the // disassembler and error reporting. void Symbol::print_value_on(outputStream* st) const { - st->print("'"); - for (int i = 0; i < utf8_length(); i++) { - st->print("%c", char_at(i)); - } - st->print("'"); + st->print_raw("'", 1); + st->print_raw((const char*)base(), utf8_length()); + st->print_raw("'", 1); } void Symbol::print_value() const { print_value_on(tty); }