src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java
author kbarrett
Tue, 21 Nov 2017 09:47:55 -0500
changeset 48787 7638bf98a312
parent 47216 71c04702a3d5
permissions -rw-r--r--
8194312: Support parallel and concurrent JNI global handle processing Summary: Add OopStorage, change JNI gloabl/weak to use OopStorage. Reviewed-by: coleenp, sspitsyn, eosterlund
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
48787
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
     2
 * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
package sun.jvm.hotspot.utilities;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
import java.io.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
import sun.jvm.hotspot.code.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
import sun.jvm.hotspot.debugger.*;
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 13728
diff changeset
    30
import sun.jvm.hotspot.gc.shared.*;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
import sun.jvm.hotspot.interpreter.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
import sun.jvm.hotspot.runtime.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
import sun.jvm.hotspot.memory.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
/** This class attempts to describe possible locations of pointers in
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
    the VM. */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
public class PointerLocation {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  //////////////////////////////////////////////////////////////////
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
  //                                                              //
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
  // These are package private to simplify the implementation and //
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  // interaction with PointerFinder                               //
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  //                                                              //
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  //////////////////////////////////////////////////////////////////
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
  Address addr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  CollectedHeap heap;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  Generation gen;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  // If UseTLAB was enabled and the pointer was found in a
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  // currently-active TLAB, these will be set
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  boolean inTLAB;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  JavaThread tlabThread;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  ThreadLocalAllocBuffer tlab;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  // Generated code locations
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  boolean inInterpreter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  boolean inCodeCache;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  // FIXME: add other locations like VTableStubs, StubRoutines, maybe
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  // even "on thread x's stack"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  InterpreterCodelet interpreterCodelet;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  CodeBlob blob;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  // FIXME: add more detail about CodeBlob
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5547
diff changeset
    67
  boolean inBlobCode;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  boolean inBlobData;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  boolean inBlobOops;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  boolean inBlobUnknownLocation;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
48787
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
    72
  boolean inStrongGlobalJNIHandles;
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
    73
  boolean inWeakGlobalJNIHandles;
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
    74
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  boolean inLocalJNIHandleBlock;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  JNIHandleBlock handleBlock;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  sun.jvm.hotspot.runtime.Thread handleThread;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  public PointerLocation(Address addr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
    this.addr = addr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  public boolean isInHeap() {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6418
diff changeset
    84
    return (heap != null || (gen != null));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  public boolean isInNewGen() {
31358
693058672cc6 8077842: Remove the level parameter passed around in GenCollectedHeap
jwilhelm
parents: 30764
diff changeset
    88
    return ((gen != null) && (gen == ((GenCollectedHeap)heap).getGen(0)));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  public boolean isInOldGen() {
31358
693058672cc6 8077842: Remove the level parameter passed around in GenCollectedHeap
jwilhelm
parents: 30764
diff changeset
    92
    return ((gen != null) && (gen == ((GenCollectedHeap)heap).getGen(1)));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  public boolean inOtherGen() {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6418
diff changeset
    96
    return (!isInNewGen() && !isInOldGen());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  /** Only valid if isInHeap() */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  public Generation getGeneration() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
      return gen;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  /** This may be true if isInNewGen is also true */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  public boolean isInTLAB() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
    return inTLAB;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  /** Only valid if isInTLAB() returns true */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  public JavaThread getTLABThread() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
    return tlabThread;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  /** Only valid if isInTLAB() returns true */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  public ThreadLocalAllocBuffer getTLAB() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
    return tlab;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  public boolean isInInterpreter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
    return inInterpreter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  /** For now, only valid if isInInterpreter is true */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  public InterpreterCodelet getInterpreterCodelet() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
    return interpreterCodelet;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  public boolean isInCodeCache() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
    return inCodeCache;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  /** For now, only valid if isInCodeCache is true */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  public CodeBlob getCodeBlob() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
    return blob;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5547
diff changeset
   137
  public boolean isInBlobCode() {
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5547
diff changeset
   138
    return inBlobCode;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  public boolean isInBlobData() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
    return inBlobData;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  public boolean isInBlobOops() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
    return inBlobOops;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  public boolean isInBlobUnknownLocation() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
    return inBlobUnknownLocation;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
48787
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   153
  public boolean isInStrongGlobalJNIHandles() {
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   154
    return inStrongGlobalJNIHandles;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
48787
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   157
  public boolean isInWeakGlobalJNIHandles() {
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   158
    return inWeakGlobalJNIHandles;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  public boolean isInLocalJNIHandleBlock() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
    return inLocalJNIHandleBlock;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
48787
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   165
  /** Only valid if isInLocalJNIHandleBlock is true */
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  public JNIHandleBlock getJNIHandleBlock() {
48787
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   167
    assert isInLocalJNIHandleBlock();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
    return handleBlock;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
  /** Only valid if isInLocalJNIHandleBlock is true */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
  public sun.jvm.hotspot.runtime.Thread getJNIHandleThread() {
48787
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   173
    assert isInLocalJNIHandleBlock();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
    return handleThread;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  public boolean isUnknown() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
    return (!(isInHeap() || isInInterpreter() || isInCodeCache() ||
48787
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   179
              isInStrongGlobalJNIHandles() || isInWeakGlobalJNIHandles() || isInLocalJNIHandleBlock()));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  public String toString() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
    printOn(new PrintStream(bos));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
    return bos.toString();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  public void print() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
    printOn(System.out);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
  public void printOn(PrintStream tty) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
    tty.print("Address ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
    if (addr == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
      tty.print("0x0");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
      tty.print(addr.toString());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
    tty.print(": ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
    if (isInHeap()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
      if (isInTLAB()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
        tty.print("In thread-local allocation buffer for thread \"" +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
                  getTLABThread().getThreadName() + "\" (");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
        getTLABThread().printThreadIDOn(tty);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
        tty.print(") ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
        getTLAB().printOn(tty);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
      } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
        if (isInNewGen()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
          tty.print("In new generation ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
        } else if (isInOldGen()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
          tty.print("In old generation ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
        } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
          tty.print("In unknown section of Java heap");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
        if (getGeneration() != null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
          getGeneration().printOn(tty);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
    } else if (isInInterpreter()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
      tty.println("In interpreter codelet \"" + interpreterCodelet.getDescription() + "\"");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
      interpreterCodelet.printOn(tty);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
    } else if (isInCodeCache()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
      CodeBlob b = getCodeBlob();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
      tty.print("In ");
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5547
diff changeset
   225
      if (isInBlobCode()) {
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5547
diff changeset
   226
        tty.print("code");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
      } else if (isInBlobData()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
        tty.print("data");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
      } else if (isInBlobOops()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
        tty.print("oops");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
      } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
        if (Assert.ASSERTS_ENABLED) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
          Assert.that(isInBlobUnknownLocation(), "Should have known location in CodeBlob");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
        tty.print("unknown location");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
      tty.print(" in ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
      b.printOn(tty);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
      // FIXME: add more detail
48787
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   241
    } else if (isInStrongGlobalJNIHandles()) {
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   242
      tty.print("In JNI strong global");
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   243
    } else if (isInWeakGlobalJNIHandles()) {
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   244
      tty.print("In JNI weak global");
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   245
    } else if (isInLocalJNIHandleBlock()) {
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   246
      tty.print("In thread-local");
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   247
      tty.print(" JNI handle block (" + handleBlock.top() + " handle slots present)");
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   248
      if (handleThread.isJavaThread()) {
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   249
        tty.print(" for JavaThread ");
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   250
        ((JavaThread) handleThread).printThreadIDOn(tty);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
      } else {
48787
7638bf98a312 8194312: Support parallel and concurrent JNI global handle processing
kbarrett
parents: 47216
diff changeset
   252
        tty.print(" for a non-Java Thread");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
      // This must be last
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
      if (Assert.ASSERTS_ENABLED) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
        Assert.that(isUnknown(), "Should have unknown location");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
      tty.print("In unknown location");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
}