src/cpu/mips/vm/macroAssembler_mips.cpp

changeset 8006
b70d88852ac9
parent 8004
941851413ebf
child 8009
0477693968a6
     1.1 --- a/src/cpu/mips/vm/macroAssembler_mips.cpp	Wed Oct 25 17:43:22 2017 +0800
     1.2 +++ b/src/cpu/mips/vm/macroAssembler_mips.cpp	Wed Nov 08 09:28:23 2017 +0800
     1.3 @@ -1513,14 +1513,11 @@
     1.4  
     1.5    // Is marking active?
     1.6    if (in_bytes(PtrQueue::byte_width_of_active()) == 4) {
     1.7 -    //cmpl(in_progress, 0);
     1.8      lw(AT, in_progress);
     1.9    } else {
    1.10      assert(in_bytes(PtrQueue::byte_width_of_active()) == 1, "Assumption");
    1.11 -    //cmpb(in_progress, 0);
    1.12      lb(AT, in_progress);
    1.13    }
    1.14 -  //jcc(Assembler::equal, done);
    1.15    beq(AT, R0, done);
    1.16    nop();
    1.17  
    1.18 @@ -1530,8 +1527,6 @@
    1.19    }
    1.20  
    1.21    // Is the previous value null?
    1.22 -  //cmpptr(pre_val, (int32_t) NULL_WORD);
    1.23 -  //jcc(Assembler::equal, done);
    1.24    beq(pre_val, R0, done);
    1.25    nop();
    1.26  
    1.27 @@ -1539,40 +1534,27 @@
    1.28    // Is index == 0?
    1.29    // (The index field is typed as size_t.)
    1.30  
    1.31 -  //movptr(tmp, index);                   // tmp := *index_adr
    1.32    ld(tmp, index);
    1.33 -  //cmpptr(tmp, 0);                       // tmp == 0?
    1.34 -  //jcc(Assembler::equal, runtime);       // If yes, goto runtime
    1.35    beq(tmp, R0, runtime);
    1.36    nop();
    1.37  
    1.38 -  //subptr(tmp, wordSize);                // tmp := tmp - wordSize
    1.39 -  //movptr(index, tmp);                   // *index_adr := tmp
    1.40 -  //addptr(tmp, buffer);                  // tmp := tmp + *buffer_adr
    1.41    daddiu(tmp, tmp, -1 * wordSize);
    1.42    sd(tmp, index);
    1.43    ld(AT, buffer);
    1.44    daddu(tmp, tmp, AT);
    1.45  
    1.46    // Record the previous value
    1.47 -  //movptr(Address(tmp, 0), pre_val);
    1.48 -  //jmp(done);
    1.49    sd(pre_val, tmp, 0);
    1.50    beq(R0, R0, done);
    1.51    nop();
    1.52  
    1.53    bind(runtime);
    1.54    // save the live input values
    1.55 -  //if(tosca_live) push(rax);
    1.56 -  if(tosca_live) push(V0);
    1.57 -
    1.58 -  //if (obj != noreg && obj != rax)
    1.59 -  if (obj != noreg && obj != V0)
    1.60 -    push(obj);
    1.61 -
    1.62 -  //if (pre_val != rax)
    1.63 -  if (pre_val != V0)
    1.64 -    push(pre_val);
    1.65 +  if (tosca_live) push(V0);
    1.66 +
    1.67 +  if (obj != noreg && obj != V0) push(obj);
    1.68 +
    1.69 +  if (pre_val != V0) push(pre_val);
    1.70  
    1.71    // Calling the runtime using the regular call_VM_leaf mechanism generates
    1.72    // code (generated by InterpreterMacroAssember::call_VM_leaf_base)
    1.73 @@ -1589,11 +1571,8 @@
    1.74    NOT_LP64( push(thread); )
    1.75  
    1.76    if (expand_call) {
    1.77 -    //LP64_ONLY( assert(pre_val != c_rarg1, "smashed arg"); )
    1.78      LP64_ONLY( assert(pre_val != A1, "smashed arg"); )
    1.79 -    //pass_arg1(this, thread);
    1.80      if (thread != A1) move(A1, thread);
    1.81 -    //pass_arg0(this, pre_val);
    1.82      if (pre_val != A0) move(A0, pre_val);
    1.83      MacroAssembler::call_VM_leaf_base(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), 2);
    1.84    } else {
    1.85 @@ -1603,15 +1582,12 @@
    1.86    NOT_LP64( pop(thread); )
    1.87  
    1.88    // save the live input values
    1.89 -  //if (pre_val != rax)
    1.90    if (pre_val != V0)
    1.91      pop(pre_val);
    1.92  
    1.93 -  //if (obj != noreg && obj != rax)
    1.94    if (obj != noreg && obj != V0)
    1.95      pop(obj);
    1.96  
    1.97 -  //if(tosca_live) pop(rax);
    1.98    if(tosca_live) pop(V0);
    1.99  
   1.100    bind(done);
   1.101 @@ -1641,11 +1617,6 @@
   1.102    Label runtime;
   1.103  
   1.104    // Does store cross heap regions?
   1.105 -
   1.106 -  //movptr(tmp, store_addr);
   1.107 -  //xorptr(tmp, new_val);
   1.108 -  //shrptr(tmp, HeapRegion::LogOfHRGrainBytes);
   1.109 -  //jcc(Assembler::equal, done);
   1.110    xorr(AT, store_addr, new_val);
   1.111    dsrl(AT, AT, HeapRegion::LogOfHRGrainBytes);
   1.112    beq(AT, R0, done);
   1.113 @@ -1653,38 +1624,25 @@
   1.114    
   1.115  
   1.116    // crosses regions, storing NULL?
   1.117 -
   1.118 -  //cmpptr(new_val, (int32_t) NULL_WORD);
   1.119 -  //jcc(Assembler::equal, done);
   1.120    beq(new_val, R0, done);
   1.121    nop();
   1.122  
   1.123    // storing region crossing non-NULL, is card already dirty?
   1.124 -
   1.125    const Register card_addr = tmp;
   1.126    const Register cardtable = tmp2;
   1.127  
   1.128 -  //movptr(card_addr, store_addr);
   1.129 -  //shrptr(card_addr, CardTableModRefBS::card_shift);
   1.130    move(card_addr, store_addr);
   1.131    dsrl(card_addr, card_addr, CardTableModRefBS::card_shift);
   1.132    // Do not use ExternalAddress to load 'byte_map_base', since 'byte_map_base' is NOT
   1.133    // a valid address and therefore is not properly handled by the relocation code.
   1.134 -  //movptr(cardtable, (intptr_t)ct->byte_map_base);
   1.135 -  //addptr(card_addr, cardtable);
   1.136    set64(cardtable, (intptr_t)ct->byte_map_base);
   1.137    daddu(card_addr, card_addr, cardtable);
   1.138  
   1.139 -  //cmpb(Address(card_addr, 0), (int)G1SATBCardTableModRefBS::g1_young_card_val());
   1.140 -  //jcc(Assembler::equal, done);
   1.141    lb(AT, card_addr, 0);
   1.142    daddiu(AT, AT, -1 * (int)G1SATBCardTableModRefBS::g1_young_card_val());
   1.143    beq(AT, R0, done);
   1.144    nop();
   1.145  
   1.146 -  //membar(Assembler::Membar_mask_bits(Assembler::StoreLoad));
   1.147 -  //cmpb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val());
   1.148 -  //jcc(Assembler::equal, done);
   1.149    sync();
   1.150    lb(AT, card_addr, 0);
   1.151    daddiu(AT, AT, -1 * (int)(int)CardTableModRefBS::dirty_card_val());
   1.152 @@ -1694,15 +1652,9 @@
   1.153  
   1.154    // storing a region crossing, non-NULL oop, card is clean.
   1.155    // dirty card and log.
   1.156 -
   1.157 -  //movb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val());
   1.158    move(AT, (int)CardTableModRefBS::dirty_card_val()); 
   1.159    sb(AT, card_addr, 0);
   1.160  
   1.161 -  //cmpl(queue_index, 0);
   1.162 -  //jcc(Assembler::equal, runtime);
   1.163 -  //subl(queue_index, wordSize);
   1.164 -  //movptr(tmp2, buffer);
   1.165    lw(AT, queue_index);
   1.166    beq(AT, R0, runtime);
   1.167    nop();
   1.168 @@ -1710,20 +1662,14 @@
   1.169    sw(AT, queue_index);
   1.170    ld(tmp2, buffer);
   1.171  #ifdef _LP64
   1.172 -  //movslq(rscratch1, queue_index);
   1.173 -  //addq(tmp2, rscratch1);
   1.174 -  //movq(Address(tmp2, 0), card_addr);
   1.175    ld(AT, queue_index);
   1.176    daddu(tmp2, tmp2, AT);
   1.177    sd(card_addr, tmp2, 0);
   1.178  #else
   1.179 -  //addl(tmp2, queue_index);
   1.180 -  //movl(Address(tmp2, 0), card_addr);
   1.181    lw(AT, queue_index);
   1.182    addu32(tmp2, tmp2, AT);
   1.183    sw(card_addr, tmp2, 0);
   1.184  #endif
   1.185 -  //jmp(done);
   1.186    beq(R0, R0, done);
   1.187    nop();
   1.188  

mercurial