8216427: ciMethodData::load_extra_data() does not always unpack the last entry
authoreosterlund
Tue, 15 Jan 2019 09:44:18 +0100
changeset 53307 b5281bf751ea
parent 53306 8e260023fc53
child 53308 1884ecc20c38
8216427: ciMethodData::load_extra_data() does not always unpack the last entry Reviewed-by: thartmann, kvn
src/hotspot/share/ci/ciMethodData.cpp
--- a/src/hotspot/share/ci/ciMethodData.cpp	Mon Jan 14 15:07:22 2019 +0100
+++ b/src/hotspot/share/ci/ciMethodData.cpp	Tue Jan 15 09:44:18 2019 +0100
@@ -168,9 +168,12 @@
     // in the prepare_metadata call above) as we translate the copy:
     // update the copy as we go.
     int tag = dp_src->tag();
-    if (tag != DataLayout::arg_info_data_tag) {
-      memcpy(dp_dst, dp_src, ((intptr_t)MethodData::next_extra(dp_src)) - ((intptr_t)dp_src));
+    size_t entry_size = DataLayout::header_size_in_bytes();
+    if (tag != DataLayout::no_tag) {
+      ProfileData* src_data = dp_src->data_in();
+      entry_size = src_data->size_in_bytes();
     }
+    memcpy(dp_dst, dp_src, entry_size);
 
     switch(tag) {
     case DataLayout::speculative_trap_data_tag: {