src/share/vm/oops/cpCache.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/oops/cpCache.cpp	Wed Dec  3 11:53:49 2014
--- new/src/share/vm/oops/cpCache.cpp	Wed Dec  3 11:53:49 2014

*** 285,297 **** --- 285,301 ---- // Competing writers must acquire exclusive access via a lock. // A losing writer waits on the lock until the winner writes f1 and leaves // the lock, so that when the losing writer returns, he can use the linked // cache entry. // Use the lock from the metaspace for this, which cannot stop for safepoint. Mutex* metaspace_lock = cpool->pool_holder()->class_loader_data()->metaspace_lock(); MutexLockerEx ml(metaspace_lock, Mutex::_no_safepoint_check_flag); + objArrayHandle resolved_references = cpool->resolved_references(); + // Use the resolved_references() lock for this cpCache entry. + // resolved_references are created for all classes with Invokedynamic, MethodHandle + // or MethodType constant pool cache entries. + assert(resolved_references() != NULL, + "a resolved_references array should have been created for this class"); + ObjectLocker ol(resolved_references, Thread::current()); if (!is_f1_null()) { return; } const methodHandle adapter = call_info.resolved_method();
*** 334,344 **** --- 338,347 ---- // not '(Ljava/lang/String;)Ljava/util/List;'. // The fact that String and List are involved is encoded in the MethodType in refs[f2]. // This allows us to create fewer Methods, while keeping type safety. // objArrayHandle resolved_references = cpool->resolved_references(); // Store appendix, if any. if (has_appendix) { const int appendix_index = f2_as_index() + _indy_resolved_references_appendix_offset; assert(appendix_index >= 0 && appendix_index < resolved_references->length(), "oob"); assert(resolved_references->obj_at(appendix_index) == NULL, "init just once");

src/share/vm/oops/cpCache.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File