diff src/share/vm/graal/graalCodeInstaller.cpp @ 9807:d552919fbb05

Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
author Doug Simon <doug.simon@oracle.com>
date Thu, 23 May 2013 23:23:03 +0200
parents c4b1aa93b9af
children 4d5872186e76
line wrap: on
line diff
--- a/src/share/vm/graal/graalCodeInstaller.cpp	Thu May 23 18:14:59 2013 +0200
+++ b/src/share/vm/graal/graalCodeInstaller.cpp	Thu May 23 23:23:03 2013 +0200
@@ -410,6 +410,9 @@
 
   // (very) conservative estimate: each site needs a constant section entry
   _constants_size = _sites->length() * (BytesPerLong*2);
+#ifndef PRODUCT
+  _comments = (arrayOop) HotSpotCompiledCode::comments(compiled_code);
+#endif
 
   _next_call_type = MARK_INVOKE_INVALID;
 }
@@ -463,6 +466,19 @@
       fatal("unexpected Site subclass");
     }
   }
+
+#ifndef PRODUCT
+  if (_comments != NULL) {
+    oop* comments = (oop*) _comments->base(T_OBJECT);
+    for (int i = 0; i < _comments->length(); i++) {
+      oop comment = comments[i];
+      assert(comment->is_a(HotSpotCompiledCode_Comment::klass()), "cce");
+      jint offset = HotSpotCompiledCode_Comment::pcOffset(comment);
+      char* text = java_lang_String::as_utf8_string(HotSpotCompiledCode_Comment::text(comment));
+      buffer.block_comment(offset, text);
+    }
+  }
+#endif
 }
 
 void CodeInstaller::assumption_MethodContents(Handle assumption) {