< prev index next >

src/share/vm/runtime/heapMonitoring.cpp

Print this page
rev 13139 : [mq]: heap7
rev 13140 : [mq]: heapz8

@@ -43,11 +43,11 @@
   // handle this by hand instead of having this in the destructor. There are
   // cases where the struct is on the stack but holding heap data not to be
   // freed.
   static void free_data(StackTraceData *data) {
     if (data->trace != NULL) {
-      FREE_C_HEAP_ARRAY(jvmtiCallFrame, data->trace->frames);
+      FREE_C_HEAP_ARRAY(jvmtiFrameInfo, data->trace->frames);
       FREE_C_HEAP_OBJ(data->trace);
     }
     delete data;
   }
 };

@@ -441,19 +441,19 @@
                                   const StackTraceData *from) {
   const jvmtiStackTrace *src = from->trace;
   *to = *src;
 
   to->frames =
-      NEW_C_HEAP_ARRAY(jvmtiCallFrame, MaxStackDepth, mtInternal);
+      NEW_C_HEAP_ARRAY(jvmtiFrameInfo, MaxStackDepth, mtInternal);
 
   if (to->frames == NULL) {
     return false;
   }
 
   memcpy(to->frames,
          src->frames,
-         sizeof(jvmtiCallFrame) * MaxStackDepth);
+         sizeof(jvmtiFrameInfo) * MaxStackDepth);
   return true;
 }
 
 // Called by the outside world; returns a copy of the stack traces
 // (because we could be replacing them as the user handles them).

@@ -562,11 +562,11 @@
   jint trace_count = traces->trace_count;
   jvmtiStackTrace *stack_traces = traces->stack_traces;
 
   for (jint i = 0; i < trace_count; i++) {
     jvmtiStackTrace *current_trace = stack_traces + i;
-    FREE_C_HEAP_ARRAY(jvmtiCallFrame, current_trace->frames);
+    FREE_C_HEAP_ARRAY(jvmtiFrameInfo, current_trace->frames);
   }
 
   FREE_C_HEAP_ARRAY(jvmtiStackTrace, traces->stack_traces);
   traces->trace_count = 0;
   traces->stack_traces = NULL;

@@ -602,14 +602,10 @@
   JavaThread *t = static_cast<JavaThread *>(Thread::current());
   _rnd = static_cast<uint32_t>(reinterpret_cast<uintptr_t>(t));
   if (_rnd == 0) {
     _rnd = 1;
   }
-  for (int i = 0; i < 20; i++) {
-    _rnd = next_random(_rnd);
-  }
-
   _enabled = true;
 }
 
 void HeapMonitoring::stop_profiling() {
   _enabled = false;

@@ -675,31 +671,30 @@
     jvmtiStackTrace *trace = NEW_C_HEAP_OBJ(jvmtiStackTrace, mtInternal);
     if (trace == NULL) {
       return;
     }
 
-    jvmtiCallFrame *frames =
-        NEW_C_HEAP_ARRAY(jvmtiCallFrame, MaxStackDepth, mtInternal);
+    jvmtiFrameInfo *frames =
+        NEW_C_HEAP_ARRAY(jvmtiFrameInfo, MaxStackDepth, mtInternal);
 
     if (frames == NULL) {
       FREE_C_HEAP_OBJ(trace);
       return;
     }
 
     trace->frames = frames;
-    trace->env_id = (JavaThread::current())->jni_environment();
     trace->thread_id = SharedRuntime::get_java_tid(thread);
     trace->size = byte_size;
     trace->frame_count = 0;
 
     if (thread->has_last_Java_frame()) { // just to be safe
       vframeStream vfst(thread, true);
       int count = 0;
       while (!vfst.at_end() && count < MaxStackDepth) {
         Method* m = vfst.method();
-        frames[count].bci = vfst.bci();
-        frames[count].method_id = m->jmethod_id();
+        frames[count].location = vfst.bci();
+        frames[count].method = m->jmethod_id();
         count++;
 
         vfst.next();
       }
       trace->frame_count = count;

@@ -710,11 +705,11 @@
       StackTraceStorage::storage()->add_trace(trace, o);
       return;
     }
 
     // Failure!
-    FREE_C_HEAP_ARRAY(jvmtiCallFrame, trace->frames);
+    FREE_C_HEAP_ARRAY(jvmtiFrameInfo, trace->frames);
     FREE_C_HEAP_OBJ(trace);
     return;
   } else {
     // There is something like 64K worth of allocation before the VM
     // initializes.  This is just in the interests of not slowing down
< prev index next >