src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp

changeset 3181
c63b928b212b
parent 2314
f95d63e2154a
child 6876
710a3c8b516e
equal deleted inserted replaced
3180:81aa07130d30 3181:c63b928b212b
100 set_top(NULL); 100 set_top(NULL);
101 101
102 _state = flushed; 102 _state = flushed;
103 } 103 }
104 104
105 bool PSPromotionLAB::unallocate_object(oop obj) { 105 bool PSPromotionLAB::unallocate_object(HeapWord* obj, size_t obj_size) {
106 assert(Universe::heap()->is_in(obj), "Object outside heap"); 106 assert(Universe::heap()->is_in(obj), "Object outside heap");
107 107
108 if (contains(obj)) { 108 if (contains(obj)) {
109 HeapWord* object_end = (HeapWord*)obj + obj->size(); 109 HeapWord* object_end = obj + obj_size;
110 assert(object_end <= top(), "Object crosses promotion LAB boundary"); 110 assert(object_end == top(), "Not matching last allocation");
111 111
112 if (object_end == top()) { 112 set_top(obj);
113 set_top((HeapWord*)obj); 113 return true;
114 return true;
115 }
116 } 114 }
117 115
118 return false; 116 return false;
119 } 117 }
120 118

mercurial