comparison src/cpu/x86/vm/c1_CodeStubs_x86.cpp @ 3335:49d67a090fe2

Merge
author never
date Mon, 02 May 2011 10:51:36 -0700
parents 527b586edf24
children cec1757a0134
comparison
equal deleted inserted replaced
3334:b21ecca7ccc4 3335:49d67a090fe2
464 464
465 ///////////////////////////////////////////////////////////////////////////// 465 /////////////////////////////////////////////////////////////////////////////
466 #ifndef SERIALGC 466 #ifndef SERIALGC
467 467
468 void G1PreBarrierStub::emit_code(LIR_Assembler* ce) { 468 void G1PreBarrierStub::emit_code(LIR_Assembler* ce) {
469 469 // At this point we know that marking is in progress.
470 // At this point we know that marking is in progress 470 // If do_load() is true then we have to emit the
471 // load of the previous value; otherwise it has already
472 // been loaded into _pre_val.
471 473
472 __ bind(_entry); 474 __ bind(_entry);
473 assert(pre_val()->is_register(), "Precondition."); 475 assert(pre_val()->is_register(), "Precondition.");
474 476
475 Register pre_val_reg = pre_val()->as_register(); 477 Register pre_val_reg = pre_val()->as_register();
476 478
477 ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/); 479 if (do_load()) {
480 ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/);
481 }
478 482
479 __ cmpptr(pre_val_reg, (int32_t) NULL_WORD); 483 __ cmpptr(pre_val_reg, (int32_t) NULL_WORD);
480 __ jcc(Assembler::equal, _continuation); 484 __ jcc(Assembler::equal, _continuation);
481 ce->store_parameter(pre_val()->as_register(), 0); 485 ce->store_parameter(pre_val()->as_register(), 0);
482 __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::g1_pre_barrier_slow_id))); 486 __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::g1_pre_barrier_slow_id)));
483 __ jmp(_continuation); 487 __ jmp(_continuation);
484 488
489 }
490
491 void G1UnsafeGetObjSATBBarrierStub::emit_code(LIR_Assembler* ce) {
492 // At this point we know that offset == referent_offset.
493 //
494 // So we might have to emit:
495 // if (src == null) goto continuation.
496 //
497 // and we definitely have to emit:
498 // if (klass(src).reference_type == REF_NONE) goto continuation
499 // if (!marking_active) goto continuation
500 // if (pre_val == null) goto continuation
501 // call pre_barrier(pre_val)
502 // goto continuation
503 //
504 __ bind(_entry);
505
506 assert(src()->is_register(), "sanity");
507 Register src_reg = src()->as_register();
508
509 if (gen_src_check()) {
510 // The original src operand was not a constant.
511 // Generate src == null?
512 __ cmpptr(src_reg, (int32_t) NULL_WORD);
513 __ jcc(Assembler::equal, _continuation);
514 }
515
516 // Generate src->_klass->_reference_type == REF_NONE)?
517 assert(tmp()->is_register(), "sanity");
518 Register tmp_reg = tmp()->as_register();
519
520 __ load_klass(tmp_reg, src_reg);
521
522 Address ref_type_adr(tmp_reg, instanceKlass::reference_type_offset_in_bytes() + sizeof(oopDesc));
523 __ cmpl(ref_type_adr, REF_NONE);
524 __ jcc(Assembler::equal, _continuation);
525
526 // Is marking active?
527 assert(thread()->is_register(), "precondition");
528 Register thread_reg = thread()->as_pointer_register();
529
530 Address in_progress(thread_reg, in_bytes(JavaThread::satb_mark_queue_offset() +
531 PtrQueue::byte_offset_of_active()));
532
533 if (in_bytes(PtrQueue::byte_width_of_active()) == 4) {
534 __ cmpl(in_progress, 0);
535 } else {
536 assert(in_bytes(PtrQueue::byte_width_of_active()) == 1, "Assumption");
537 __ cmpb(in_progress, 0);
538 }
539 __ jcc(Assembler::equal, _continuation);
540
541 // val == null?
542 assert(val()->is_register(), "Precondition.");
543 Register val_reg = val()->as_register();
544
545 __ cmpptr(val_reg, (int32_t) NULL_WORD);
546 __ jcc(Assembler::equal, _continuation);
547
548 ce->store_parameter(val()->as_register(), 0);
549 __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::g1_pre_barrier_slow_id)));
550 __ jmp(_continuation);
485 } 551 }
486 552
487 jbyte* G1PostBarrierStub::_byte_map_base = NULL; 553 jbyte* G1PostBarrierStub::_byte_map_base = NULL;
488 554
489 jbyte* G1PostBarrierStub::byte_map_base_slow() { 555 jbyte* G1PostBarrierStub::byte_map_base_slow() {