< prev index next >

src/hotspot/share/interpreter/oopMapCache.cpp

Print this page
@@ -231,12 +231,14 @@
  
  class MaskFillerForNative: public NativeSignatureIterator {
   private:
    uintptr_t * _mask;                             // the bit mask to be filled
    int         _size;                             // the mask size in bits
+   int         _num_oops;
  
    void set_one(int i) {
+     _num_oops++;
      i *= InterpreterOopMap::bits_per_entry;
      assert(0 <= i && i < _size, "offset out of bounds");
      _mask[i / BitsPerWord] |= (((uintptr_t) 1 << InterpreterOopMap::oop_bit_number) << (i % BitsPerWord));
    }
  

@@ -250,18 +252,21 @@
    void pass_object()                             { set_one(offset()); }
  
    MaskFillerForNative(const methodHandle& method, uintptr_t* mask, int size) : NativeSignatureIterator(method) {
      _mask   = mask;
      _size   = size;
+     _num_oops = 0;
      // initialize with 0
      int i = (size + BitsPerWord - 1) / BitsPerWord;
      while (i-- > 0) _mask[i] = 0;
    }
  
    void generate() {
      iterate();
    }
+ 
+   int num_oops() { return _num_oops; }
  };
  
  bool OopMapCacheEntry::verify_mask(CellTypeState* vars, CellTypeState* stack, int max_locals, int stack_top) {
    // Check mask includes map
    VerifyClosure blk(this);

@@ -316,10 +321,11 @@
    set_mask_size(mh->size_of_parameters() * bits_per_entry);
    allocate_bit_mask();
    // fill mask for parameters
    MaskFillerForNative mf(mh, bit_mask(), mask_size());
    mf.generate();
+   _num_oops = mf.num_oops();
  }
  
  
  void OopMapCacheEntry::fill(const methodHandle& method, int bci) {
    // Flush entry to deallocate an existing entry
< prev index next >