hotspot/src/share/vm/runtime/deoptimization.cpp
changeset 46271 979ebd346ecf
parent 42040 70ec5a09a0d5
child 46289 1904e7ec236e
--- a/hotspot/src/share/vm/runtime/deoptimization.cpp	Tue Feb 14 20:00:28 2017 -0800
+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp	Wed Feb 15 22:59:57 2017 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, 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
@@ -451,7 +451,6 @@
   // Compute whether the root vframe returns a float or double value.
   BasicType return_type;
   {
-    HandleMark hm;
     methodHandle method(thread, array->element(0)->method());
     Bytecode_invoke invoke = Bytecode_invoke_check(method, array->element(0)->bci());
     return_type = invoke.is_valid() ? invoke.result_type() : T_ILLEGAL;
@@ -799,7 +798,7 @@
 
 #if defined(COMPILER2) || INCLUDE_JVMCI
 bool Deoptimization::realloc_objects(JavaThread* thread, frame* fr, GrowableArray<ScopeValue*>* objects, TRAPS) {
-  Handle pending_exception(thread->pending_exception());
+  Handle pending_exception(THREAD, thread->pending_exception());
   const char* exception_file = thread->exception_file();
   int exception_line = thread->exception_line();
   thread->clear_pending_exception();
@@ -1109,7 +1108,7 @@
     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 = Handle(mon_info->owner());
+        Handle obj(thread, mon_info->owner());
         markOop mark = obj->mark();
         if (UseBiasedLocking && mark->has_bias_pattern()) {
           // New allocated objects may have the mark set to anonymously biased.
@@ -1246,10 +1245,11 @@
 
 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(mon_info->owner()));
+      objects_to_revoke->append(Handle(thread, mon_info->owner()));
     }
   }
 }