6459085: naked pointer subtractions in class data sharing code
authorxlu
Mon, 18 Aug 2008 14:53:36 -0700
changeset 995 1a961ad82730
parent 994 c2cebe40575d
child 996 7565d0510bb6
6459085: naked pointer subtractions in class data sharing code Reviewed-by: jcoomes
hotspot/make/linux/makefiles/vm.make
hotspot/src/share/vm/memory/dump.cpp
--- a/hotspot/make/linux/makefiles/vm.make	Fri Aug 15 10:08:20 2008 -0700
+++ b/hotspot/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/hotspot/src/share/vm/memory/dump.cpp	Fri Aug 15 10:08:20 2008 -0700
+++ b/hotspot/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();