diff -r 0bd600d6d77b -r ce9a710b0f63 src/share/vm/classfile/symbolTable.hpp --- a/src/share/vm/classfile/symbolTable.hpp Fri May 05 06:07:11 2017 -0700 +++ b/src/share/vm/classfile/symbolTable.hpp Mon May 15 12:20:15 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -124,8 +124,11 @@ static volatile int _parallel_claimed_idx; - // Release any dead symbols - static void buckets_unlink(int start_idx, int end_idx, int* processed, int* removed, size_t* memory_total); + typedef SymbolTable::BucketUnlinkContext BucketUnlinkContext; + // Release any dead symbols. Unlinked bucket entries are collected in the given + // context to be freed later. + // This allows multiple threads to work on the table at once. + static void buckets_unlink(int start_idx, int end_idx, BucketUnlinkContext* context, size_t* memory_total); public: enum { symbol_alloc_batch_size = 8, @@ -274,9 +277,13 @@ // Apply the give oop closure to the entries to the buckets // in the range [start_idx, end_idx). static void buckets_oops_do(OopClosure* f, int start_idx, int end_idx); + + typedef StringTable::BucketUnlinkContext BucketUnlinkContext; // Unlink or apply the give oop closure to the entries to the buckets - // in the range [start_idx, end_idx). - static void buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed); + // in the range [start_idx, end_idx). Unlinked bucket entries are collected in the given + // context to be freed later. + // This allows multiple threads to work on the table at once. + static void buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, BucketUnlinkContext* context); StringTable() : RehashableHashtable((int)StringTableSize, sizeof (HashtableEntry)) {}