hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp
changeset 11753 c9e420473a11
parent 11174 fccee5238e70
child 13728 882756847a04
equal deleted inserted replaced
11718:eefb2f895ca1 11753:c9e420473a11
     1 /*
     1 /*
     2  * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2002, 2012, 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.
    49 void ScavengeRootsTask::do_it(GCTaskManager* manager, uint which) {
    49 void ScavengeRootsTask::do_it(GCTaskManager* manager, uint which) {
    50   assert(Universe::heap()->is_gc_active(), "called outside gc");
    50   assert(Universe::heap()->is_gc_active(), "called outside gc");
    51 
    51 
    52   PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which);
    52   PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which);
    53   PSScavengeRootsClosure roots_closure(pm);
    53   PSScavengeRootsClosure roots_closure(pm);
       
    54   PSPromoteRootsClosure  roots_to_old_closure(pm);
    54 
    55 
    55   switch (_root_type) {
    56   switch (_root_type) {
    56     case universe:
    57     case universe:
    57       Universe::oops_do(&roots_closure);
    58       Universe::oops_do(&roots_closure);
    58       break;
    59       break;
    89       break;
    90       break;
    90 
    91 
    91 
    92 
    92     case code_cache:
    93     case code_cache:
    93       {
    94       {
    94         CodeBlobToOopClosure each_scavengable_code_blob(&roots_closure, /*do_marking=*/ true);
    95         CodeBlobToOopClosure each_scavengable_code_blob(&roots_to_old_closure, /*do_marking=*/ true);
    95         CodeCache::scavenge_root_nmethods_do(&each_scavengable_code_blob);
    96         CodeCache::scavenge_root_nmethods_do(&each_scavengable_code_blob);
    96       }
    97       }
    97       break;
    98       break;
    98 
    99 
    99     default:
   100     default: