< prev index next >


Print this page


@@ -1,8 +1,8 @@
  * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018 SAP SE. All rights reserved.
+ * Copyright (c) 2018, 2019 SAP SE. All rights reserved.
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -45,10 +45,12 @@
   enum blobType {
     noType = 0,             // must be! due to initialization by memset to zero
     // The nMethod_* values correspond to the CompiledMethod enum values.
     // We can't use the CompiledMethod values 1:1 because we depend on noType == 0.
     nMethod_inconstruction, // under construction. Very soon, the type will transition to "in_use".
+                            // can't be observed while holding Compile_lock and CodeCache_lock simultaneously.
+                            // left in here for completeness (and to document we spent a thought).
     nMethod_inuse,          // executable. This is the "normal" state for a nmethod.
     nMethod_notused,        // assumed inactive, marked not entrant. Could be revived if necessary.
     nMethod_notentrant,     // no new activations allowed, marked for deoptimization. Old activations may still exist.
                             // Will transition to "zombie" after all activations are gone.
     nMethod_zombie,         // No more activations exist, ready for purge (remove from code cache).

@@ -93,10 +95,13 @@
   static void print_space_single(outputStream *ast, unsigned short space);
   static void print_age_single(outputStream *ast, unsigned int age);
   static void print_line_delim(outputStream* out, bufferedStream *sst, char* low_bound, unsigned int ix, unsigned int gpl);
   static void print_line_delim(outputStream* out, outputStream *sst, char* low_bound, unsigned int ix, unsigned int gpl);
   static blobType get_cbType(CodeBlob* cb);
+  static bool blob_access_is_safe(CodeBlob* this_blob);
+  static bool nmethod_access_is_safe(nmethod* nm);
+  static bool holding_required_locks();
   static void discard(outputStream* out, CodeHeap* heap);
   static void aggregate(outputStream* out, CodeHeap* heap, size_t granularity);
   static void print_usedSpace(outputStream* out, CodeHeap* heap);

@@ -162,15 +167,19 @@
 //  of this TopSizeBlk struct. It collects all information we need to
 //  know about those largest blocks.
 //  All TopSizeBlks of a heap segment are stored in the related TopSizeArray.
 struct TopSizeBlk : public CHeapObj<mtCode> {
   HeapBlock*     start;       // address of block
+  const char*    blob_name;    // name of blob (mostly: name_and_sig of nmethod)
   unsigned int   len;          // length of block, in _segment_size units. Will never overflow int.
   unsigned int   index;        // ordering index, 0 is largest block
                                // contains array index of next smaller block
                                // -1 indicates end of list
+  unsigned int   nm_size;      // nmeethod total size (if nmethod, 0 otherwise)
+  int            temperature;  // nmethod temperature (if nmethod, 0 otherwise)
   CompLevel      level;        // optimization level (see globalDefinitions.hpp)
   u2             compiler;     // compiler which generated this blob
   u2             type;         // blob type

@@ -213,11 +222,10 @@
     bool          segment_granules;
     unsigned int  nBlocks_t1;
     unsigned int  nBlocks_t2;
     unsigned int  nBlocks_alive;
     unsigned int  nBlocks_dead;
-    unsigned int  nBlocks_inconstr;
     unsigned int  nBlocks_unloaded;
     unsigned int  nBlocks_stub;
     // FreeBlk data
     unsigned int  alloc_freeBlocks;
     // UsedBlk data
< prev index next >