Integrated: 8270333: -XX:+VerifyStringTableAtExit should not do linear search

Ioi Lam iklam at openjdk.java.net
Thu Jul 15 05:18:18 UTC 2021


On Wed, 14 Jul 2021 02:34:19 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> The implementation of `-XX:+VerifyStringTableAtExit` used a linear search to check for duplicated strings in the interned string table. This would be excessively slow if there were more than a few thousand strings.
> 
> This PR uses a hashtable so we can avoid doing a linear search. The table is sized such that each bucket has 8 items on average.
> 
> Since this code is executed only for verification, I added a new `java_lang_String::hash_code_noupdate(oop)` function, so we can avoid causing side effects.

This pull request has now been integrated.

Changeset: 1ebd9469
Author:    Ioi Lam <iklam at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/1ebd9469db1adada9f5ad41f8599e9458da58399
Stats:     45 lines in 3 files changed: 24 ins; 8 del; 13 mod

8270333: -XX:+VerifyStringTableAtExit should not do linear search

Reviewed-by: dholmes, minqi

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

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


More information about the hotspot-runtime-dev mailing list