73 oop PSPromotionManager::copy_to_survivor_space(oop o) { |
73 oop PSPromotionManager::copy_to_survivor_space(oop o) { |
74 assert(PSScavenge::should_scavenge(&o), "Sanity"); |
74 assert(PSScavenge::should_scavenge(&o), "Sanity"); |
75 |
75 |
76 oop new_obj = NULL; |
76 oop new_obj = NULL; |
77 |
77 |
78 #ifdef MIPS |
78 #if defined MIPS && !defined ZERO |
79 if (UseSyncLevel >= 2000) OrderAccess::fence(); |
79 if (UseSyncLevel >= 2000) OrderAccess::fence(); |
80 #endif |
80 #endif |
81 |
81 |
82 // NOTE! We must be very careful with any methods that access the mark |
82 // NOTE! We must be very careful with any methods that access the mark |
83 // in o. There may be multiple threads racing on it, and it may be forwarded |
83 // in o. There may be multiple threads racing on it, and it may be forwarded |
84 // at any time. Do not use oop methods for accessing the mark! |
84 // at any time. Do not use oop methods for accessing the mark! |
85 markOop test_mark = o->mark(); |
85 markOop test_mark = o->mark(); |
86 |
86 |
87 #ifdef MIPS |
87 #if defined MIPS && !defined ZERO |
88 if (UseSyncLevel >= 2000) OrderAccess::fence(); |
88 if (UseSyncLevel >= 2000) OrderAccess::fence(); |
89 #endif |
89 #endif |
90 |
90 |
91 // The same test as "o->is_forwarded()" |
91 // The same test as "o->is_forwarded()" |
92 if (!test_mark->is_marked()) { |
92 if (!test_mark->is_marked()) { |
179 |
179 |
180 assert(new_obj != NULL, "allocation should have succeeded"); |
180 assert(new_obj != NULL, "allocation should have succeeded"); |
181 |
181 |
182 // Copy obj |
182 // Copy obj |
183 Copy::aligned_disjoint_words((HeapWord*)o, (HeapWord*)new_obj, new_obj_size); |
183 Copy::aligned_disjoint_words((HeapWord*)o, (HeapWord*)new_obj, new_obj_size); |
184 #ifdef MIPS |
184 #if defined MIPS && !defined ZERO |
185 if (UseSyncLevel >= 2000) OrderAccess::fence(); |
185 if (UseSyncLevel >= 2000) OrderAccess::fence(); |
186 #endif |
186 #endif |
187 |
187 |
188 // Now we have to CAS in the header. |
188 // Now we have to CAS in the header. |
189 if (o->cas_forward_to(new_obj, test_mark)) { |
189 if (o->cas_forward_to(new_obj, test_mark)) { |
230 |
230 |
231 // don't update this before the unallocation! |
231 // don't update this before the unallocation! |
232 new_obj = o->forwardee(); |
232 new_obj = o->forwardee(); |
233 } |
233 } |
234 |
234 |
235 #ifdef MIPS |
235 #if defined MIPS && !defined ZERO |
236 if (UseSyncLevel >= 2000) OrderAccess::fence(); |
236 if (UseSyncLevel >= 2000) OrderAccess::fence(); |
237 #endif |
237 #endif |
238 } else { |
238 } else { |
239 assert(o->is_forwarded(), "Sanity"); |
239 assert(o->is_forwarded(), "Sanity"); |
240 new_obj = o->forwardee(); |
240 new_obj = o->forwardee(); |