< prev index next >

src/cpu/x86/vm/macroAssembler_x86.cpp

Print this page
rev 11463 : Backport Traversal GC


4178 
4179   Label done;
4180   Label runtime;
4181 
4182   assert(pre_val != noreg, "check this code");
4183 
4184   if (obj != noreg) {
4185     assert_different_registers(obj, pre_val, tmp);
4186     assert(pre_val != rax, "check this code");
4187   }
4188 
4189   Address in_progress(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
4190                                        PtrQueue::byte_offset_of_active()));
4191   Address index(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
4192                                        PtrQueue::byte_offset_of_index()));
4193   Address buffer(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
4194                                        PtrQueue::byte_offset_of_buf()));
4195 
4196   if (UseShenandoahGC) {
4197     Address gc_state(thread, in_bytes(JavaThread::gc_state_offset()));
4198     testb(gc_state, ShenandoahHeap::MARKING);
4199     jcc(Assembler::zero, done);
4200   } else {
4201     assert(UseG1GC, "Should be");
4202     // Is marking active?
4203     if (in_bytes(PtrQueue::byte_width_of_active()) == 4) {
4204       cmpl(in_progress, 0);
4205     } else {
4206       assert(in_bytes(PtrQueue::byte_width_of_active()) == 1, "Assumption");
4207       cmpb(in_progress, 0);
4208     }
4209     jcc(Assembler::equal, done);
4210   }
4211 
4212   // Do we need to load the previous value?
4213   if (obj != noreg) {
4214     load_heap_oop(pre_val, Address(obj, 0));
4215   }
4216 
4217   // Is the previous value null?
4218   cmpptr(pre_val, (int32_t) NULL_WORD);




4178 
4179   Label done;
4180   Label runtime;
4181 
4182   assert(pre_val != noreg, "check this code");
4183 
4184   if (obj != noreg) {
4185     assert_different_registers(obj, pre_val, tmp);
4186     assert(pre_val != rax, "check this code");
4187   }
4188 
4189   Address in_progress(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
4190                                        PtrQueue::byte_offset_of_active()));
4191   Address index(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
4192                                        PtrQueue::byte_offset_of_index()));
4193   Address buffer(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
4194                                        PtrQueue::byte_offset_of_buf()));
4195 
4196   if (UseShenandoahGC) {
4197     Address gc_state(thread, in_bytes(JavaThread::gc_state_offset()));
4198     testb(gc_state, ShenandoahHeap::MARKING | ShenandoahHeap::TRAVERSAL);
4199     jcc(Assembler::zero, done);
4200   } else {
4201     assert(UseG1GC, "Should be");
4202     // Is marking active?
4203     if (in_bytes(PtrQueue::byte_width_of_active()) == 4) {
4204       cmpl(in_progress, 0);
4205     } else {
4206       assert(in_bytes(PtrQueue::byte_width_of_active()) == 1, "Assumption");
4207       cmpb(in_progress, 0);
4208     }
4209     jcc(Assembler::equal, done);
4210   }
4211 
4212   // Do we need to load the previous value?
4213   if (obj != noreg) {
4214     load_heap_oop(pre_val, Address(obj, 0));
4215   }
4216 
4217   // Is the previous value null?
4218   cmpptr(pre_val, (int32_t) NULL_WORD);


< prev index next >