diff src/share/vm/classfile/javaClasses.cpp @ 3900:a32de5085326

7079673: JSR 292: C1 should inline bytecoded method handle adapters Reviewed-by: never
author twisti
date Thu, 01 Sep 2011 01:31:25 -0700
parents 0b80db433fcb
children c26de9aef2ed
line wrap: on
line diff
--- a/src/share/vm/classfile/javaClasses.cpp	Wed Aug 31 16:46:11 2011 -0700
+++ b/src/share/vm/classfile/javaClasses.cpp	Thu Sep 01 01:31:25 2011 -0700
@@ -28,6 +28,7 @@
 #include "classfile/vmSymbols.hpp"
 #include "code/debugInfo.hpp"
 #include "code/pcDesc.hpp"
+#include "compiler/compilerOracle.hpp"
 #include "interpreter/interpreter.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
@@ -2674,6 +2675,17 @@
   if (k != NULL) {
     compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_lang_invoke_MethodHandle_signature());
   }
+
+  // Disallow compilation of CallSite.setTargetNormal and CallSite.setTargetVolatile
+  // (For C2:  keep this until we have throttling logic for uncommon traps.)
+  if (k != NULL) {
+    instanceKlass* ik = instanceKlass::cast(k);
+    methodOop m_normal   = ik->lookup_method(vmSymbols::setTargetNormal_name(),   vmSymbols::setTarget_signature());
+    methodOop m_volatile = ik->lookup_method(vmSymbols::setTargetVolatile_name(), vmSymbols::setTarget_signature());
+    guarantee(m_normal && m_volatile, "must exist");
+    m_normal->set_not_compilable_quietly();
+    m_volatile->set_not_compilable_quietly();
+  }
 }
 
 oop java_lang_invoke_CallSite::target(oop site) {