changeset 290:6e76352f1f62

6459085: naked pointer subtractions in class data sharing code Reviewed-by: jcoomes
author xlu
date Mon, 18 Aug 2008 14:53:36 -0700
parents 3529d0e8d09c
children 70c4fb9cf899
files make/linux/makefiles/vm.make src/share/vm/memory/dump.cpp
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/make/linux/makefiles/vm.make	Fri Aug 15 10:08:20 2008 -0700
+++ b/make/linux/makefiles/vm.make	Mon Aug 18 14:53:36 2008 -0700
@@ -195,7 +195,7 @@
               if [ $$? = 0 ] ; then					\
 		/usr/bin/chcon -t textrel_shlib_t $@;                   \
 		if [ $$? != 0 ]; then                                   \
-		  echo "ERROR: Cannot chcon $@"; exit 1;                \
+		  echo "ERROR: Cannot chcon $@";			\
 		fi							\
 	      fi							\
 	    fi                                                          \
--- a/src/share/vm/memory/dump.cpp	Fri Aug 15 10:08:20 2008 -0700
+++ b/src/share/vm/memory/dump.cpp	Mon Aug 18 14:53:36 2008 -0700
@@ -1200,10 +1200,12 @@
     mapinfo->write_space(CompactingPermGenGen::rw, _rw_space, false);
     _rw_space->set_saved_mark();
     mapinfo->write_region(CompactingPermGenGen::md, _md_vs->low(),
-                          md_top - _md_vs->low(), SharedMiscDataSize,
+                          pointer_delta(md_top, _md_vs->low(), sizeof(char)),
+                          SharedMiscDataSize,
                           false, false);
     mapinfo->write_region(CompactingPermGenGen::mc, _mc_vs->low(),
-                          mc_top - _mc_vs->low(), SharedMiscCodeSize,
+                          pointer_delta(mc_top, _mc_vs->low(), sizeof(char)),
+                          SharedMiscCodeSize,
                           true, true);
 
     // Pass 2 - write data.
@@ -1212,10 +1214,12 @@
     mapinfo->write_space(CompactingPermGenGen::ro, _ro_space, true);
     mapinfo->write_space(CompactingPermGenGen::rw, _rw_space, false);
     mapinfo->write_region(CompactingPermGenGen::md, _md_vs->low(),
-                          md_top - _md_vs->low(), SharedMiscDataSize,
+                          pointer_delta(md_top, _md_vs->low(), sizeof(char)),
+                          SharedMiscDataSize,
                           false, false);
     mapinfo->write_region(CompactingPermGenGen::mc, _mc_vs->low(),
-                          mc_top - _mc_vs->low(), SharedMiscCodeSize,
+                          pointer_delta(mc_top, _mc_vs->low(), sizeof(char)),
+                          SharedMiscCodeSize,
                           true, true);
     mapinfo->close();