hotspot/src/share/vm/c1/c1_Runtime1.cpp
changeset 36345 72e6d0ac646b
parent 35606 d873b64009cc
child 36350 29d8bb1668f5
--- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp	Tue Mar 01 18:29:20 2016 +0000
+++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp	Fri Feb 26 09:13:22 2016 -0800
@@ -1502,21 +1502,23 @@
   nm->make_not_entrant();
 
   methodHandle m(nm->method());
-  MethodData* mdo = m->method_data();
+  if (ProfileInterpreter) {
+    MethodData* mdo = m->method_data();
 
-  if (mdo == NULL && !HAS_PENDING_EXCEPTION) {
-    // Build an MDO.  Ignore errors like OutOfMemory;
-    // that simply means we won't have an MDO to update.
-    Method::build_interpreter_method_data(m, THREAD);
-    if (HAS_PENDING_EXCEPTION) {
-      assert((PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())), "we expect only an OOM error here");
-      CLEAR_PENDING_EXCEPTION;
+    if (mdo == NULL && !HAS_PENDING_EXCEPTION) {
+      // Build an MDO.  Ignore errors like OutOfMemory;
+      // that simply means we won't have an MDO to update.
+      Method::build_interpreter_method_data(m, THREAD);
+      if (HAS_PENDING_EXCEPTION) {
+        assert((PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())), "we expect only an OOM error here");
+        CLEAR_PENDING_EXCEPTION;
+      }
+      mdo = m->method_data();
     }
-    mdo = m->method_data();
-  }
 
-  if (mdo != NULL) {
-    mdo->inc_trap_count(Deoptimization::Reason_none);
+    if (mdo != NULL) {
+      mdo->inc_trap_count(Deoptimization::Reason_none);
+    }
   }
 
   if (TracePredicateFailedTraps) {