hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp
changeset 7904 e90e097fced4
parent 7397 5b173b4ca846
child 13195 be27e1b6a4b9
equal deleted inserted replaced
7903:c694e52ff9cb 7904:e90e097fced4
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   350   }
   350   }
   351 
   351 
   352   // The following methods are useful and optimized for a
   352   // The following methods are useful and optimized for a
   353   // general, non-contiguous space.
   353   // general, non-contiguous space.
   354 
   354 
   355   // The given arguments are required to be the starts of adjacent ("blk1"
       
   356   // before "blk2") well-formed blocks covered by "this".  After this call,
       
   357   // they should be considered to form one block.
       
   358   virtual void join_blocks(HeapWord* blk1, HeapWord* blk2);
       
   359 
       
   360   // Given a block [blk_start, blk_start + full_blk_size), and
   355   // Given a block [blk_start, blk_start + full_blk_size), and
   361   // a left_blk_size < full_blk_size, adjust the BOT to show two
   356   // a left_blk_size < full_blk_size, adjust the BOT to show two
   362   // blocks [blk_start, blk_start + left_blk_size) and
   357   // blocks [blk_start, blk_start + left_blk_size) and
   363   // [blk_start + left_blk_size, blk_start + full_blk_size).
   358   // [blk_start + left_blk_size, blk_start + full_blk_size).
   364   // It is assumed (and verified in the non-product VM) that the
   359   // It is assumed (and verified in the non-product VM) that the
   427 
   422 
   428   inline void verify_single_block(HeapWord* blk, size_t size) {
   423   inline void verify_single_block(HeapWord* blk, size_t size) {
   429     verify_single_block(blk, blk + size);
   424     verify_single_block(blk, blk + size);
   430   }
   425   }
   431 
   426 
       
   427   // Used by region verification. Checks that the contents of the
       
   428   // BOT reflect that there's a single object that spans the address
       
   429   // range [obj_start, obj_start + word_size); returns true if this is
       
   430   // the case, returns false if it's not.
       
   431   bool verify_for_object(HeapWord* obj_start, size_t word_size) const;
       
   432 
   432   // Verify that the given block is before _unallocated_block
   433   // Verify that the given block is before _unallocated_block
   433   inline void verify_not_unallocated(HeapWord* blk_start,
   434   inline void verify_not_unallocated(HeapWord* blk_start,
   434                                      HeapWord* blk_end) const {
   435                                      HeapWord* blk_end) const {
   435     if (BlockOffsetArrayUseUnallocatedBlock) {
   436     if (BlockOffsetArrayUseUnallocatedBlock) {
   436       assert(blk_start < blk_end, "Block inconsistency?");
   437       assert(blk_start < blk_end, "Block inconsistency?");
   442     verify_not_unallocated(blk, blk + size);
   443     verify_not_unallocated(blk, blk + size);
   443   }
   444   }
   444 
   445 
   445   void check_all_cards(size_t left_card, size_t right_card) const;
   446   void check_all_cards(size_t left_card, size_t right_card) const;
   446 
   447 
   447   virtual void set_for_starts_humongous(HeapWord* new_end);
   448   virtual void print_on(outputStream* out) PRODUCT_RETURN;
   448 };
   449 };
   449 
   450 
   450 // A subtype of BlockOffsetArray that takes advantage of the fact
   451 // A subtype of BlockOffsetArray that takes advantage of the fact
   451 // that its underlying space is a ContiguousSpace, so that its "active"
   452 // that its underlying space is a ContiguousSpace, so that its "active"
   452 // region can be more efficiently tracked (than for a non-contiguous space).
   453 // region can be more efficiently tracked (than for a non-contiguous space).
   492   }
   493   }
   493 
   494 
   494   HeapWord* block_start_unsafe(const void* addr);
   495   HeapWord* block_start_unsafe(const void* addr);
   495   HeapWord* block_start_unsafe_const(const void* addr) const;
   496   HeapWord* block_start_unsafe_const(const void* addr) const;
   496 
   497 
   497   virtual void set_for_starts_humongous(HeapWord* new_end);
   498   void set_for_starts_humongous(HeapWord* new_top);
       
   499 
       
   500   virtual void print_on(outputStream* out) PRODUCT_RETURN;
   498 };
   501 };
   499 
   502 
   500 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_HPP
   503 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_HPP