hotspot/src/share/vm/memory/genCollectedHeap.cpp
changeset 24424 2658d7834c6e
parent 24353 148147d21135
child 24941 4ebbe176a7b1
equal deleted inserted replaced
24358:8528b67f6562 24424:2658d7834c6e
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2014, 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.
   792 }
   792 }
   793 
   793 
   794 bool GenCollectedHeap::is_in_young(oop p) {
   794 bool GenCollectedHeap::is_in_young(oop p) {
   795   bool result = ((HeapWord*)p) < _gens[_n_gens - 1]->reserved().start();
   795   bool result = ((HeapWord*)p) < _gens[_n_gens - 1]->reserved().start();
   796   assert(result == _gens[0]->is_in_reserved(p),
   796   assert(result == _gens[0]->is_in_reserved(p),
   797          err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, (void*)p));
   797          err_msg("incorrect test - result=%d, p=" INTPTR_FORMAT, result, p2i((void*)p)));
   798   return result;
   798   return result;
   799 }
   799 }
   800 
   800 
   801 // Returns "TRUE" iff "p" points into the committed areas of the heap.
   801 // Returns "TRUE" iff "p" points into the committed areas of the heap.
   802 bool GenCollectedHeap::is_in(const void* p) const {
   802 bool GenCollectedHeap::is_in(const void* p) const {
  1065 
  1065 
  1066 void GenCollectedHeap::verify(bool silent, VerifyOption option /* ignored */) {
  1066 void GenCollectedHeap::verify(bool silent, VerifyOption option /* ignored */) {
  1067   for (int i = _n_gens-1; i >= 0; i--) {
  1067   for (int i = _n_gens-1; i >= 0; i--) {
  1068     Generation* g = _gens[i];
  1068     Generation* g = _gens[i];
  1069     if (!silent) {
  1069     if (!silent) {
  1070       gclog_or_tty->print(g->name());
  1070       gclog_or_tty->print("%s", g->name());
  1071       gclog_or_tty->print(" ");
  1071       gclog_or_tty->print(" ");
  1072     }
  1072     }
  1073     g->verify();
  1073     g->verify();
  1074   }
  1074   }
  1075   if (!silent) {
  1075   if (!silent) {
  1268   // provided the underlying platform provides such a time source
  1268   // provided the underlying platform provides such a time source
  1269   // (and it is bug free). So we still have to guard against getting
  1269   // (and it is bug free). So we still have to guard against getting
  1270   // back a time later than 'now'.
  1270   // back a time later than 'now'.
  1271   jlong retVal = now - tolgc_cl.time();
  1271   jlong retVal = now - tolgc_cl.time();
  1272   if (retVal < 0) {
  1272   if (retVal < 0) {
  1273     NOT_PRODUCT(warning("time warp: "INT64_FORMAT, retVal);)
  1273     NOT_PRODUCT(warning("time warp: "INT64_FORMAT, (int64_t) retVal);)
  1274     return 0;
  1274     return 0;
  1275   }
  1275   }
  1276   return retVal;
  1276   return retVal;
  1277 }
  1277 }