diff src/share/vm/oops/instanceOop.hpp @ 165:437d03ea40b1

6703888: Compressed Oops: use the 32-bits gap after klass in a object Summary: Use the gap also for a narrow oop field and a boxing object value. Reviewed-by: coleenp, never
author kvn
date Wed, 21 May 2008 16:31:35 -0700
parents ba764ed4b6f2
children d1605aabd0a1
line wrap: on
line diff
--- a/src/share/vm/oops/instanceOop.hpp	Wed May 21 13:46:23 2008 -0700
+++ b/src/share/vm/oops/instanceOop.hpp	Wed May 21 16:31:35 2008 -0700
@@ -39,14 +39,7 @@
 
   static bool contains_field_offset(int offset, int nonstatic_field_size) {
     int base_in_bytes = base_offset_in_bytes();
-    if (UseCompressedOops) {
-      return (offset >= base_in_bytes &&
-              // field can be embedded in header, or is after header.
-              (offset < (int)sizeof(instanceOopDesc) ||
-              (offset-(int)sizeof(instanceOopDesc))/wordSize < nonstatic_field_size));
-    } else {
-      return (offset >= base_in_bytes &&
-              (offset-base_in_bytes)/wordSize < nonstatic_field_size);
-    }
+    return (offset >= base_in_bytes &&
+            (offset-base_in_bytes) < nonstatic_field_size * heapOopSize);
   }
 };