8139595: MethodHandles::remove_dependent_nmethod is not MT safe

Reviewed-by: jrose, coleenp
This commit is contained in:
Vladimir Ivanov 2015-11-18 03:03:43 +03:00
parent f0c12f35cb
commit 1cfbe2dec5
12 changed files with 574 additions and 491 deletions

View file

@ -28,6 +28,7 @@
#include "classfile/stringTable.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/debugInfo.hpp"
#include "code/dependencyContext.hpp"
#include "code/pcDesc.hpp"
#include "interpreter/interpreter.hpp"
#include "memory/oopFactory.hpp"
@ -3216,14 +3217,16 @@ void java_lang_invoke_MethodHandleNatives_CallSiteContext::compute_offsets() {
}
}
nmethodBucket* java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(oop call_site) {
DependencyContext java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(oop call_site) {
assert(java_lang_invoke_MethodHandleNatives_CallSiteContext::is_instance(call_site), "");
return (nmethodBucket*) (address) call_site->long_field(_vmdependencies_offset);
}
void java_lang_invoke_MethodHandleNatives_CallSiteContext::set_vmdependencies(oop call_site, nmethodBucket* context) {
assert(java_lang_invoke_MethodHandleNatives_CallSiteContext::is_instance(call_site), "");
call_site->long_field_put(_vmdependencies_offset, (jlong) (address) context);
intptr_t* vmdeps_addr = (intptr_t*)call_site->address_field_addr(_vmdependencies_offset);
#ifndef ASSERT
DependencyContext dep_ctx(vmdeps_addr);
#else
// Verify that call_site isn't moved during DependencyContext lifetime.
DependencyContext dep_ctx(vmdeps_addr, Handle(call_site));
#endif // ASSERT
return dep_ctx;
}
// Support for java_security_AccessControlContext