src/hotspot/cpu/x86/stubGenerator_x86_64.cpp
changeset 49164 7e958a8ebcd3
parent 48807 fd8ccb37fce9
child 49347 edb65305d3ac
child 56276 ee5e58456be5
equal deleted inserted replaced
49163:580bb0b85f63 49164:7e958a8ebcd3
    23  */
    23  */
    24 
    24 
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "asm/macroAssembler.hpp"
    26 #include "asm/macroAssembler.hpp"
    27 #include "asm/macroAssembler.inline.hpp"
    27 #include "asm/macroAssembler.inline.hpp"
       
    28 #include "ci/ciUtilities.hpp"
       
    29 #include "gc/shared/cardTable.hpp"
       
    30 #include "gc/shared/cardTableModRefBS.hpp"
    28 #include "interpreter/interpreter.hpp"
    31 #include "interpreter/interpreter.hpp"
    29 #include "nativeInst_x86.hpp"
    32 #include "nativeInst_x86.hpp"
    30 #include "oops/instanceOop.hpp"
    33 #include "oops/instanceOop.hpp"
    31 #include "oops/method.hpp"
    34 #include "oops/method.hpp"
    32 #include "oops/objArrayKlass.hpp"
    35 #include "oops/objArrayKlass.hpp"
  1230            __ popa();
  1233            __ popa();
  1231 
  1234 
  1232            __ bind(filtered);
  1235            __ bind(filtered);
  1233         }
  1236         }
  1234          break;
  1237          break;
  1235       case BarrierSet::CardTableForRS:
  1238       case BarrierSet::CardTableModRef:
  1236       case BarrierSet::CardTableExtension:
       
  1237       case BarrierSet::ModRef:
       
  1238         break;
  1239         break;
  1239       default:
  1240       default:
  1240         ShouldNotReachHere();
  1241         ShouldNotReachHere();
  1241 
  1242 
  1242     }
  1243     }
  1270           }
  1271           }
  1271           __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post), 2);
  1272           __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post), 2);
  1272           __ popa();
  1273           __ popa();
  1273         }
  1274         }
  1274         break;
  1275         break;
  1275       case BarrierSet::CardTableForRS:
  1276       case BarrierSet::CardTableModRef:
  1276       case BarrierSet::CardTableExtension:
       
  1277         {
  1277         {
  1278           CardTableModRefBS* ct = barrier_set_cast<CardTableModRefBS>(bs);
       
  1279           assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
       
  1280 
       
  1281           Label L_loop, L_done;
  1278           Label L_loop, L_done;
  1282           const Register end = count;
  1279           const Register end = count;
  1283 
  1280 
  1284           __ testl(count, count);
  1281           __ testl(count, count);
  1285           __ jcc(Assembler::zero, L_done); // zero count - nothing to do
  1282           __ jcc(Assembler::zero, L_done); // zero count - nothing to do
  1286 
  1283 
  1287           __ leaq(end, Address(start, count, TIMES_OOP, 0));  // end == start+count*oop_size
  1284           __ leaq(end, Address(start, count, TIMES_OOP, 0));  // end == start+count*oop_size
  1288           __ subptr(end, BytesPerHeapOop); // end - 1 to make inclusive
  1285           __ subptr(end, BytesPerHeapOop); // end - 1 to make inclusive
  1289           __ shrptr(start, CardTableModRefBS::card_shift);
  1286           __ shrptr(start, CardTable::card_shift);
  1290           __ shrptr(end,   CardTableModRefBS::card_shift);
  1287           __ shrptr(end,   CardTable::card_shift);
  1291           __ subptr(end, start); // end --> cards count
  1288           __ subptr(end, start); // end --> cards count
  1292 
  1289 
  1293           int64_t disp = (int64_t) ct->byte_map_base;
  1290           int64_t disp = ci_card_table_address_as<int64_t>();
  1294           __ mov64(scratch, disp);
  1291           __ mov64(scratch, disp);
  1295           __ addptr(start, scratch);
  1292           __ addptr(start, scratch);
  1296         __ BIND(L_loop);
  1293         __ BIND(L_loop);
  1297           __ movb(Address(start, count, Address::times_1), 0);
  1294           __ movb(Address(start, count, Address::times_1), 0);
  1298           __ decrement(count);
  1295           __ decrement(count);