JDK-6892186 : SA does not dump debug info for scalar replaced objects.
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs17,6u18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris,windows_xp
  • CPU: x86
  • Submitted: 2009-10-15
  • Updated: 2010-12-22
  • Resolved: 2009-11-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u21Fixed 7Fixed hs17Fixed
Related Reports
Duplicate :  
Description
SA does not dump debug info for scalar replaced objects in codecache dump:

 0xfa8d207b:    call	0xfa8ab060
static int test() @0xb65b3110 of public class sleep @0xb65b3160 @ bci = 18, line = 15
locals ([0], unknown scope value sun.jvm.hotspot.code.ObjectValue@9980d5) ([1], oop 0xb65b32b0) ([2], illegal) 
monitors (owner = oop 0xb65b32b0, lock = stack[16], normal) 
OopMap: 

Here is simple test:

public class sleep {
 int iii;
 public static void main(String[] args) throws Exception {
     int ii = 0;
     for (int i = 0; i < 2000000; i++) {
         ii += test2();
     }
 }
 static int test2() throws Exception {
     return test();
 }
 static int test() throws Exception {
     sleep sl = new sleep();
     synchronized (sleep.class) {
         sleep.class.wait(1);
     }
     return sl.iii;
 }
}

% java -XX:CompileThreshold=1000 sleep &
% pwd
<hotspot_rep>/agent/make
% sh clhsdbproc.sh <pid>
% dumpcodecache >ccdump.txt

Node: the instruction "dumpcodecache" will be implemented by this bug fix.

With the fix the dump will be:

0xfa8d207b:    call	0xfa8ab060
            static int test() @0xb65b3110 of public class sleep @0xb65b3160 @ bci = 18, line = 15
            locals ([0], #ScObj0) ([1], oop 0xb65b32b0) ([2], illegal) 
            monitors (owner = oop 0xb65b32b0, lock = stack[16], normal) 
            #ScObj0 sleep{ [iii :0]=#int 0 }
            OopMap:

Comments
PUBLIC COMMENTS Problem: Part of these changes are from Tom's SA disassembler work. Dumping nmethods with scalar replaced objects results in exceptions from the SA since it was not implemented. Solution: Implement scalar replaced objects debug info dump in SA. Fix PrintOptoAssembly output for such info since it was not correct. Add missing NULL checks in SA dump code. Reformat SA debug info output to easy read. Add "dumpcodecache" instruction to SA to dump all nmethods in codecache. Here is OptoAssembly output: 177 CALL,static java.lang.Object::wait # sleep::test @ bci:126 L[0]=#ScObj0 L[1]=#ScObj1 L[2]=#ScObj2 L[3]=#ScObj3 L[4]=#ScObj4 L[5]=#Ptr0x080cffd8 L[6]=_ MON-BOX0=esp+32 MON-OBJ[0]=#Ptr0x080cffd8 # ScObj0 sleep={ [iii :0]=#12 } # ScObj1 int[2]={ [0]=#0 , [1]=#34 } # ScObj2 sleep[2]={ [0]=#ScObj0 , [1]=esp + #12 } # ScObj3 int[2][]={ [0]=esp + #16 , [1]=#ScObj1 } # ScObj4 sleep[2][]={ [0]=esp + #8 , [1]=#ScObj2 } # OopMap{[8]=Oop [12]=Oop [16]=Oop [20]=Derived_oop_[8] off=380} here is SA: 0xfa4d24b7: call 0xfa4d0dd0 static int test() @0xb61b3228 of public class sleep @0xb61b3278 @ bci = 126, line = 31 locals ([0], #ScObj0) ([1], #ScObj1) ([2], #ScObj2) ([3], #ScObj3) ([4], #ScObj4) ([5], oop 0xb61b33c8) ([6], illegal) monitors (owner = oop 0xb61b33c8, lock = stack[32], normal) ScObj0 sleep={ [iii :0]=(#int 12) } ScObj1 int[2]={ [0]=(#int 0) [1]=(#int 34) } ScObj2 sleep[2]={ [0]=(##ScObj0) [1]=(#stack[12], oop) } ScObj3 int[2][]={ [0]=(#stack[16], oop) [1]=(##ScObj1) } ScObj4 sleep[2][]={ [0]=(#stack[8], oop) [1]=(##ScObj2) } OopMap: Oops:[8] [12] [16] Derived oops:[20] = [8] and here the java source: sleep sl = new sleep(); sl.iii = 12; int[] ia = new int[2]; ia[1] = 34; sleep[] sa = new sleep[2]; sa[0] = sl; sa[1] = new sleep(); sa[1].iii = 56; int[][] ia2 = new int[2][]; ia2[0] = new int[1]; ia2[1] = ia; ia2[0][0] = 78; sleep[][] sa2 = new sleep[2][]; sa2[0] = new sleep[1]; sa2[1] = sa; sa2[0][0] = new sleep(); sa2[0][0].iii = 90; synchronized (sleep.class) { sleep.class.wait(1); }
21-10-2009

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/873ec3787992
21-10-2009