src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
changeset 49722 a47d1e21b3f1
parent 48969 7eb296a8ce2c
child 50113 caf115bb98ad
equal deleted inserted replaced
49721:ea0cc7c74e75 49722:a47d1e21b3f1
     1 /*
     1 /*
     2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2017, 2018 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.
    29 #include "gc/g1/g1FullGCCompactionPoint.hpp"
    29 #include "gc/g1/g1FullGCCompactionPoint.hpp"
    30 #include "gc/g1/g1FullGCCompactTask.hpp"
    30 #include "gc/g1/g1FullGCCompactTask.hpp"
    31 #include "gc/g1/heapRegion.inline.hpp"
    31 #include "gc/g1/heapRegion.inline.hpp"
    32 #include "gc/shared/gcTraceTime.inline.hpp"
    32 #include "gc/shared/gcTraceTime.inline.hpp"
    33 #include "logging/log.hpp"
    33 #include "logging/log.hpp"
       
    34 #include "oops/oop.inline.hpp"
    34 #include "utilities/ticks.inline.hpp"
    35 #include "utilities/ticks.inline.hpp"
    35 
    36 
    36 class G1ResetHumongousClosure : public HeapRegionClosure {
    37 class G1ResetHumongousClosure : public HeapRegionClosure {
    37   G1CMBitMap* _bitmap;
    38   G1CMBitMap* _bitmap;
    38 
    39 
    45       if (current->is_starts_humongous()) {
    46       if (current->is_starts_humongous()) {
    46         oop obj = oop(current->bottom());
    47         oop obj = oop(current->bottom());
    47         if (_bitmap->is_marked(obj)) {
    48         if (_bitmap->is_marked(obj)) {
    48           // Clear bitmap and fix mark word.
    49           // Clear bitmap and fix mark word.
    49           _bitmap->clear(obj);
    50           _bitmap->clear(obj);
    50           obj->init_mark();
    51           obj->init_mark_raw();
    51         } else {
    52         } else {
    52           assert(current->is_empty(), "Should have been cleared in phase 2.");
    53           assert(current->is_empty(), "Should have been cleared in phase 2.");
    53         }
    54         }
    54       }
    55       }
    55       current->reset_during_compaction();
    56       current->reset_during_compaction();
    68 
    69 
    69   // copy object and reinit its mark
    70   // copy object and reinit its mark
    70   HeapWord* obj_addr = (HeapWord*) obj;
    71   HeapWord* obj_addr = (HeapWord*) obj;
    71   assert(obj_addr != destination, "everything in this pass should be moving");
    72   assert(obj_addr != destination, "everything in this pass should be moving");
    72   Copy::aligned_conjoint_words(obj_addr, destination, size);
    73   Copy::aligned_conjoint_words(obj_addr, destination, size);
    73   oop(destination)->init_mark();
    74   oop(destination)->init_mark_raw();
    74   assert(oop(destination)->klass() != NULL, "should have a class");
    75   assert(oop(destination)->klass() != NULL, "should have a class");
    75 
    76 
    76   return size;
    77   return size;
    77 }
    78 }
    78 
    79