comparison 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
comparison
equal deleted inserted replaced
839:bb18957ad21e 845:df6caf649ff7
558 // Both are pushed onto a task queue and the consumer will test is_narrow() 558 // Both are pushed onto a task queue and the consumer will test is_narrow()
559 // to determine which should be processed. 559 // to determine which should be processed.
560 class StarTask { 560 class StarTask {
561 void* _holder; // either union oop* or narrowOop* 561 void* _holder; // either union oop* or narrowOop*
562 public: 562 public:
563 StarTask(narrowOop *p) { _holder = (void *)((uintptr_t)p | COMPRESSED_OOP_MASK); } 563 StarTask(narrowOop* p) {
564 StarTask(oop *p) { _holder = (void*)p; } 564 assert(((uintptr_t)p & COMPRESSED_OOP_MASK) == 0, "Information loss!");
565 _holder = (void *)((uintptr_t)p | COMPRESSED_OOP_MASK);
566 }
567 StarTask(oop* p) {
568 assert(((uintptr_t)p & COMPRESSED_OOP_MASK) == 0, "Information loss!");
569 _holder = (void*)p;
570 }
565 StarTask() { _holder = NULL; } 571 StarTask() { _holder = NULL; }
566 operator oop*() { return (oop*)_holder; } 572 operator oop*() { return (oop*)_holder; }
567 operator narrowOop*() { 573 operator narrowOop*() {
568 return (narrowOop*)((uintptr_t)_holder & ~COMPRESSED_OOP_MASK); 574 return (narrowOop*)((uintptr_t)_holder & ~COMPRESSED_OOP_MASK);
569 } 575 }