< prev index next >

src/hotspot/share/opto/bytecodeInfo.cpp

Print this page
@@ -209,10 +209,17 @@
      fail_msg = "native method";
    } else if (callee_method->dont_inline()) {
      fail_msg = "don't inline by annotation";
    }
  
+   // Don't inline a method that changes Thread.currentThread() except
+   // into another method that is annotated @ChangesCurrentThread.
+   if (callee_method->changes_current_thread()
+       && ! C->method()->changes_current_thread()) {
+     fail_msg = "method changes current thread";
+   }
+ 
    // one more inlining restriction
    if (fail_msg == NULL && callee_method->has_unloaded_classes_in_signature()) {
      fail_msg = "unloaded signature classes";
    }
  
< prev index next >