hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
changeset 11580 05e16a45f0f3
parent 11578 fc6f77eca886
child 11581 b1afc51ad34e
equal deleted inserted replaced
11579:6c94c23b3199 11580:05e16a45f0f3
  1057       }
  1057       }
  1058     }
  1058     }
  1059 
  1059 
  1060     if (result != NULL) {
  1060     if (result != NULL) {
  1061       if (g1_policy()->need_to_start_conc_mark("concurrent humongous allocation")) {
  1061       if (g1_policy()->need_to_start_conc_mark("concurrent humongous allocation")) {
  1062         // We need to release the Heap_lock before we try to call collect
  1062         // We need to release the Heap_lock before we try to call collect().
       
  1063         // The result will not be stored in any object before this method
       
  1064         // returns, so the GC might miss it. Thus, we create a handle to the result
       
  1065         // and fake an object at that place.
       
  1066         CollectedHeap::fill_with_object(result, word_size, false);
       
  1067         Handle h((oop)result);
  1063         collect(GCCause::_g1_humongous_allocation);
  1068         collect(GCCause::_g1_humongous_allocation);
       
  1069         assert(result == (HeapWord*)h(), "Humongous objects should not be moved by collections");
  1064       }
  1070       }
  1065       return result;
  1071       return result;
  1066     }
  1072     }
  1067 
  1073 
  1068     if (should_try_gc) {
  1074     if (should_try_gc) {