< prev index next >

src/share/vm/gc/parallel/objectStartArray.hpp

Print this page
rev 9978 : 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
Summary: Fix remaining issues after 8146401. Also fix windows VS2010 linkage problem (g1OopClosures.hpp).
Reviewed-by: stefank, mgerdin
   1 /*
   2  * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 122 #define assert_covered_region_contains(addr)                                                                 \
 123         assert(_covered_region.contains(addr),                                                               \
 124                #addr " (" PTR_FORMAT ") is not in covered region [" PTR_FORMAT ", " PTR_FORMAT "]",          \
 125                p2i(addr), p2i(_covered_region.start()), p2i(_covered_region.end()))
 126 
 127   void allocate_block(HeapWord* p) {
 128     assert_covered_region_contains(p);
 129     jbyte* block = block_for_addr(p);
 130     HeapWord* block_base = addr_for_block(block);
 131     size_t offset = pointer_delta(p, block_base, sizeof(HeapWord*));
 132     assert(offset < 128, "Sanity");
 133     // When doing MT offsets, we can't assert this.
 134     //assert(offset > *block, "Found backwards allocation");
 135     *block = (jbyte)offset;
 136   }
 137 
 138   // Optimized for finding the first object that crosses into
 139   // a given block. The blocks contain the offset of the last
 140   // object in that block. Scroll backwards by one, and the first
 141   // object hit should be at the beginning of the block
 142   HeapWord* object_start(HeapWord* addr) const {
 143     assert_covered_region_contains(addr);
 144     jbyte* block = block_for_addr(addr);
 145     HeapWord* scroll_forward = offset_addr_for_block(block--);
 146     while (scroll_forward > addr) {
 147       scroll_forward = offset_addr_for_block(block--);
 148     }
 149 
 150     HeapWord* next = scroll_forward;
 151     while (next <= addr) {
 152       scroll_forward = next;
 153       next += oop(next)->size();
 154     }
 155     assert(scroll_forward <= addr, "wrong order for current and arg");
 156     assert(addr <= next, "wrong order for arg and next");
 157     return scroll_forward;
 158   }
 159 
 160   bool is_block_allocated(HeapWord* addr) {
 161     assert_covered_region_contains(addr);
 162     jbyte* block = block_for_addr(addr);
 163     if (*block == clean_block)
 164       return false;
 165 
 166     return true;
 167   }
 168 #undef assert_covered_region_contains
 169 
 170   // Return true if an object starts in the range of heap addresses.
 171   // If an object starts at an address corresponding to
 172   // "start", the method will return true.
 173   bool object_starts_in_range(HeapWord* start_addr, HeapWord* end_addr) const;
 174 };
 175 
 176 #endif // SHARE_VM_GC_PARALLEL_OBJECTSTARTARRAY_HPP
   1 /*
   2  * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 122 #define assert_covered_region_contains(addr)                                                                 \
 123         assert(_covered_region.contains(addr),                                                               \
 124                #addr " (" PTR_FORMAT ") is not in covered region [" PTR_FORMAT ", " PTR_FORMAT "]",          \
 125                p2i(addr), p2i(_covered_region.start()), p2i(_covered_region.end()))
 126 
 127   void allocate_block(HeapWord* p) {
 128     assert_covered_region_contains(p);
 129     jbyte* block = block_for_addr(p);
 130     HeapWord* block_base = addr_for_block(block);
 131     size_t offset = pointer_delta(p, block_base, sizeof(HeapWord*));
 132     assert(offset < 128, "Sanity");
 133     // When doing MT offsets, we can't assert this.
 134     //assert(offset > *block, "Found backwards allocation");
 135     *block = (jbyte)offset;
 136   }
 137 
 138   // Optimized for finding the first object that crosses into
 139   // a given block. The blocks contain the offset of the last
 140   // object in that block. Scroll backwards by one, and the first
 141   // object hit should be at the beginning of the block
 142   inline HeapWord* object_start(HeapWord* addr) const;
















 143 
 144   bool is_block_allocated(HeapWord* addr) {
 145     assert_covered_region_contains(addr);
 146     jbyte* block = block_for_addr(addr);
 147     if (*block == clean_block)
 148       return false;
 149 
 150     return true;
 151   }

 152 
 153   // Return true if an object starts in the range of heap addresses.
 154   // If an object starts at an address corresponding to
 155   // "start", the method will return true.
 156   bool object_starts_in_range(HeapWord* start_addr, HeapWord* end_addr) const;
 157 };
 158 
 159 #endif // SHARE_VM_GC_PARALLEL_OBJECTSTARTARRAY_HPP
< prev index next >