src/share/vm/memory/barrierSet.cpp

changeset 1280
df6caf649ff7
parent 777
37f87013dfd8
child 1526
6aa7255741f3
     1.1 --- a/src/share/vm/memory/barrierSet.cpp	Fri Jul 10 16:01:20 2009 -0700
     1.2 +++ b/src/share/vm/memory/barrierSet.cpp	Tue Jul 14 15:40:39 2009 -0700
     1.3 @@ -25,12 +25,27 @@
     1.4  # include "incls/_precompiled.incl"
     1.5  # include "incls/_barrierSet.cpp.incl"
     1.6  
     1.7 -// count is in HeapWord's
     1.8 +// count is number of array elements being written
     1.9  void BarrierSet::static_write_ref_array_pre(HeapWord* start, size_t count) {
    1.10 -   Universe::heap()->barrier_set()->write_ref_array_pre(MemRegion(start, start + count));
    1.11 +  assert(count <= (size_t)max_intx, "count too large");
    1.12 +#if 0
    1.13 +  warning("Pre: \t" INTPTR_FORMAT "[" SIZE_FORMAT "]\t",
    1.14 +                   start,            count);
    1.15 +#endif
    1.16 +  if (UseCompressedOops) {
    1.17 +    Universe::heap()->barrier_set()->write_ref_array_pre((narrowOop*)start, (int)count);
    1.18 +  } else {
    1.19 +    Universe::heap()->barrier_set()->write_ref_array_pre(      (oop*)start, (int)count);
    1.20 +  }
    1.21  }
    1.22  
    1.23 -// count is in HeapWord's
    1.24 +// count is number of array elements being written
    1.25  void BarrierSet::static_write_ref_array_post(HeapWord* start, size_t count) {
    1.26 -   Universe::heap()->barrier_set()->write_ref_array_work(MemRegion(start, start + count));
    1.27 +  assert(count <= (size_t)max_intx, "count too large");
    1.28 +  HeapWord* end = start + objArrayOopDesc::array_size((int)count);
    1.29 +#if 0
    1.30 +  warning("Post:\t" INTPTR_FORMAT "[" SIZE_FORMAT "] : [" INTPTR_FORMAT","INTPTR_FORMAT")\t",
    1.31 +                   start,            count,              start,          end);
    1.32 +#endif
    1.33 +  Universe::heap()->barrier_set()->write_ref_array_work(MemRegion(start, end));
    1.34  }

mercurial