diff src/share/vm/utilities/taskqueue.hpp @ 845:df6caf649ff7

6700789: G1: Enable use of compressed oops with G1 heaps Summary: Modifications to G1 so as to allow the use of compressed oops. Reviewed-by: apetrusenko, coleenp, jmasa, kvn, never, phh, tonyp
author ysr
date Tue, 14 Jul 2009 15:40:39 -0700
parents 0fbdb4381b99
children 3ee342e25e57
line wrap: on
line diff
--- a/src/share/vm/utilities/taskqueue.hpp	Fri Jul 10 16:01:20 2009 -0700
+++ b/src/share/vm/utilities/taskqueue.hpp	Tue Jul 14 15:40:39 2009 -0700
@@ -560,8 +560,14 @@
 class StarTask {
   void*  _holder;        // either union oop* or narrowOop*
  public:
-  StarTask(narrowOop *p) { _holder = (void *)((uintptr_t)p | COMPRESSED_OOP_MASK); }
-  StarTask(oop *p)       { _holder = (void*)p; }
+  StarTask(narrowOop* p) {
+    assert(((uintptr_t)p & COMPRESSED_OOP_MASK) == 0, "Information loss!");
+    _holder = (void *)((uintptr_t)p | COMPRESSED_OOP_MASK);
+  }
+  StarTask(oop* p)       {
+    assert(((uintptr_t)p & COMPRESSED_OOP_MASK) == 0, "Information loss!");
+    _holder = (void*)p;
+  }
   StarTask()             { _holder = NULL; }
   operator oop*()        { return (oop*)_holder; }
   operator narrowOop*()  {