< prev index next >
src/hotspot/share/runtime/deoptimization.cpp
Print this page
rev 60254 : imported patch 8249192-dholmes-review
@@ -58,10 +58,11 @@
#include "runtime/fieldDescriptor.inline.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/jniHandles.inline.hpp"
+#include "runtime/monitorInfo.inline.hpp"
#include "runtime/safepointVerifiers.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/signature.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/thread.hpp"
@@ -216,10 +217,11 @@
}
return realloc_failures;
}
static void eliminate_locks(JavaThread* thread, GrowableArray<compiledVFrame*>* chunk, bool realloc_failures) {
+ HandleMark hm;
#ifndef PRODUCT
bool first = true;
#endif
for (int i = 0; i < chunk->length(); i++) {
compiledVFrame* cvf = chunk->at(i);
@@ -1357,24 +1359,24 @@
for (int i = 0; i < monitors->length(); i++) {
MonitorInfo* mon_info = monitors->at(i);
if (mon_info->eliminated()) {
assert(!mon_info->owner_is_scalar_replaced() || realloc_failures, "reallocation was missed");
if (!mon_info->owner_is_scalar_replaced()) {
- Handle obj(thread, mon_info->owner());
- markWord mark = obj->mark();
+ Handle obj_h = mon_info->owner_h();
+ markWord mark = obj_h->mark();
if (UseBiasedLocking && mark.has_bias_pattern()) {
// New allocated objects may have the mark set to anonymously biased.
// Also the deoptimized method may called methods with synchronization
// where the thread-local object is bias locked to the current thread.
assert(mark.is_biased_anonymously() ||
mark.biased_locker() == thread, "should be locked to current thread");
// Reset mark word to unbiased prototype.
markWord unbiased_prototype = markWord::prototype().set_age(mark.age());
- obj->set_mark(unbiased_prototype);
+ obj_h->set_mark(unbiased_prototype);
}
BasicLock* lock = mon_info->lock();
- ObjectSynchronizer::enter(obj, lock, thread);
+ ObjectSynchronizer::enter(obj_h, lock, thread);
assert(mon_info->owner()->is_locked(), "object must be locked now");
}
}
}
}
@@ -1494,15 +1496,14 @@
}
#endif
static void collect_monitors(compiledVFrame* cvf, GrowableArray<Handle>* objects_to_revoke) {
GrowableArray<MonitorInfo*>* monitors = cvf->monitors();
- Thread* thread = Thread::current();
for (int i = 0; i < monitors->length(); i++) {
MonitorInfo* mon_info = monitors->at(i);
if (!mon_info->eliminated() && mon_info->owner() != NULL) {
- objects_to_revoke->append(Handle(thread, mon_info->owner()));
+ objects_to_revoke->append(mon_info->owner_h());
}
}
}
static void get_monitors_from_stack(GrowableArray<Handle>* objects_to_revoke, JavaThread* thread, frame fr, RegisterMap* map) {
@@ -1533,10 +1534,12 @@
void Deoptimization::revoke_from_deopt_handler(JavaThread* thread, frame fr, RegisterMap* map) {
if (!UseBiasedLocking) {
return;
}
+ ResourceMark rm;
+ HandleMark hm;
GrowableArray<Handle>* objects_to_revoke = new GrowableArray<Handle>();
get_monitors_from_stack(objects_to_revoke, thread, fr, map);
int len = objects_to_revoke->length();
for (int i = 0; i < len; i++) {
< prev index next >