United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6587322 dtrace probe object__alloc doesn't fire in some situations on amd64
JDK-6587322 : dtrace probe object__alloc doesn't fire in some situations on amd64

Details
Type:
Bug
Submit Date:
2007-07-31
Status:
Closed
Updated Date:
2011-04-19
Project Name:
JDK
Resolved Date:
2011-04-19
Component:
hotspot
OS:
solaris
Sub-Component:
runtime
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
6u3
Fixed Versions:

Related Reports
Backport:
Backport:

Sub Tasks

Description
In the interpreter code, templateTable_amd64.cpp, function: void
TemplateTable::_new(), line:3335-3342 contains the code for DTrace of
object allocation. But if the code fall into the previous if-branch
(line:3302), it will jump to the line: 3352, which will not report the
object allocation to DTrace. 

This is sponsored bug (fix). Originator/submitter is: Neo Jia <###@###.###>

                                    

Comments
EVALUATION

i486 and sparc code have code to call probe in right place, and this code is misplaced for amd64.
                                     
2007-07-31
SUGGESTED FIX

Index: templateTable_amd64.cpp
===================================================================
--- templateTable_amd64.cpp	(revision 211)
+++ templateTable_amd64.cpp	(working copy)
@@ -3327,18 +3327,19 @@
               (intptr_t) markOopDesc::prototype()); // header (address 0x1)
     }
     __ movq(Address(rax, oopDesc::klass_offset_in_bytes()), rsi);  // klass
+
+    {
+      SkipIfEqual skip(_masm, &DTraceAllocProbes, false);
+      // Trigger dtrace event for fastpath
+      __ push(atos); // save the return value
+      __ call_VM_leaf(
+        CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), rax);
+      __ pop(atos); // restore the return value
+    }
+
     __ jmp(done);
   }
 
-  {
-    SkipIfEqual skip(_masm, &DTraceAllocProbes, false);
-    // Trigger dtrace event for fastpath
-    __ push(atos); // save the return value
-    __ call_VM_leaf(
-         CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), rax);
-    __ pop(atos); // restore the return value
-  }
-
   // slow case
   __ bind(slow_case);
   __ get_constant_pool(c_rarg1);
                                     
2007-07-31
EVALUATION

ChangeSet=http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/455df1b81409,ChangeRequest=6587322
                                     
2010-02-09



Hardware and Software, Engineered to Work Together