comparison src/share/vm/utilities/taskqueue.hpp @ 113:ba764ed4b6f2

6420645: Create a vm that uses compressed oops for up to 32gb heapsizes Summary: Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
author coleenp
date Sun, 13 Apr 2008 17:43:42 -0400
parents a61af66fc99e
children d1605aabd0a1 37f87013dfd8
comparison
equal deleted inserted replaced
110:a49a647afe9a 113:ba764ed4b6f2
488 488
489 typedef oop Task; 489 typedef oop Task;
490 typedef GenericTaskQueue<Task> OopTaskQueue; 490 typedef GenericTaskQueue<Task> OopTaskQueue;
491 typedef GenericTaskQueueSet<Task> OopTaskQueueSet; 491 typedef GenericTaskQueueSet<Task> OopTaskQueueSet;
492 492
493 typedef oop* StarTask; 493
494 #define COMPRESSED_OOP_MASK 1
495
496 // This is a container class for either an oop* or a narrowOop*.
497 // Both are pushed onto a task queue and the consumer will test is_narrow()
498 // to determine which should be processed.
499 class StarTask {
500 void* _holder; // either union oop* or narrowOop*
501 public:
502 StarTask(narrowOop *p) { _holder = (void *)((uintptr_t)p | COMPRESSED_OOP_MASK); }
503 StarTask(oop *p) { _holder = (void*)p; }
504 StarTask() { _holder = NULL; }
505 operator oop*() { return (oop*)_holder; }
506 operator narrowOop*() {
507 return (narrowOop*)((uintptr_t)_holder & ~COMPRESSED_OOP_MASK);
508 }
509
510 // Operators to preserve const/volatile in assignments required by gcc
511 void operator=(const volatile StarTask& t) volatile { _holder = t._holder; }
512
513 bool is_narrow() const {
514 return (((uintptr_t)_holder & COMPRESSED_OOP_MASK) != 0);
515 }
516 };
517
494 typedef GenericTaskQueue<StarTask> OopStarTaskQueue; 518 typedef GenericTaskQueue<StarTask> OopStarTaskQueue;
495 typedef GenericTaskQueueSet<StarTask> OopStarTaskQueueSet; 519 typedef GenericTaskQueueSet<StarTask> OopStarTaskQueueSet;
496 520
497 typedef size_t ChunkTask; // index for chunk 521 typedef size_t ChunkTask; // index for chunk
498 typedef GenericTaskQueue<ChunkTask> ChunkTaskQueue; 522 typedef GenericTaskQueue<ChunkTask> ChunkTaskQueue;