src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/OopStorage.java
author jgeorge
Tue, 20 Mar 2018 11:24:32 +0530
changeset 49463 ccb003941743
parent 48787 7638bf98a312
permissions -rw-r--r--
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC Summary: Provide an improved heap summary for G1GC with parameters like 'capacity', 'used', 'free', etc with the 'universe' command, and introduce a new command 'g1regiondetails' to display the individual region details. Reviewed-by: sjohanss, minqi
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
48787
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
     1
/*
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
     2
 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
     4
 *
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
     7
 * published by the Free Software Foundation.
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
     8
 *
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    13
 * accompanied this code).
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    14
 *
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    18
 *
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    21
 * questions.
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    22
 *
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    23
 */
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    24
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    25
package sun.jvm.hotspot.gc.shared;
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    26
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    27
import java.util.*;
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    28
import sun.jvm.hotspot.debugger.*;
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    29
import sun.jvm.hotspot.runtime.*;
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    30
import sun.jvm.hotspot.types.*;
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    31
import sun.jvm.hotspot.utilities.*;
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    32
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    33
public class OopStorage extends VMObject {
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    34
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    35
  static {
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    36
    VM.registerVMInitializedObserver(new Observer() {
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    37
        public void update(Observable o, Object data) {
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    38
          initialize(VM.getVM().getTypeDataBase());
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    39
        }
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    40
      });
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    41
  }
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    42
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    43
  private static synchronized void initialize(TypeDataBase db) {
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    44
    Type type = db.lookupType("OopStorage");
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    45
  }
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    46
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    47
  public OopStorage(Address addr) {
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    48
    super(addr);
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    49
  }
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    50
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    51
  public boolean findOop(Address handle) {
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    52
    // TODO: walk OopStorage to find the Oop
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    53
    return false;
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    54
  }
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    55
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    56
  public void oopsDo(AddressVisitor visitor) {
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    57
    // TODO: Visit handles in OopStorage
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    58
  }
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents:
diff changeset
    59
}