diff src/share/vm/prims/jni.cpp @ 237:1fdb98a17101

6716785: implicit null checks not triggering with CompressedOops Summary: allocate alignment-sized page(s) below java heap so that memory accesses at heap_base+1page give signal and cause an implicit null check Reviewed-by: kvn, jmasa, phh, jcoomes
author coleenp
date Sat, 19 Jul 2008 17:38:22 -0400
parents 9c2ecc2ffb12
children 24fda36852ce
line wrap: on
line diff
--- a/src/share/vm/prims/jni.cpp	Fri Jul 11 01:14:44 2008 -0700
+++ b/src/share/vm/prims/jni.cpp	Sat Jul 19 17:38:22 2008 -0400
@@ -2173,8 +2173,7 @@
     size_t size = os::vm_allocation_granularity();
     bad_address = os::reserve_memory(size);
     if (bad_address != NULL) {
-      os::commit_memory(bad_address, size);
-      os::protect_memory(bad_address, size);
+      os::protect_memory(bad_address, size, os::MEM_PROT_READ);
     }
   }
   return bad_address;