hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java
author kvn
Thu, 27 May 2010 18:01:56 -0700
changeset 5694 1e0532a6abff
parent 670 ddf3e9583f2f
child 5702 201c5cde25bb
permissions -rw-r--r--
6916623: Align object to 16 bytes to use Compressed Oops with java heap up to 64Gb Summary: Added new product ObjectAlignmentInBytes flag to control object alignment. Reviewed-by: twisti, ysr, iveresov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
670
ddf3e9583f2f 6719955: Update copyright year
xdono
parents: 360
diff changeset
     2
 * Copyright 2000-2008 Sun Microsystems, Inc.  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
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
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.oops;
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 java.util.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
import sun.jvm.hotspot.utilities.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
import sun.jvm.hotspot.debugger.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
import sun.jvm.hotspot.runtime.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
import sun.jvm.hotspot.types.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
import sun.jvm.hotspot.memory.CompactingPermGenGen;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
// Oop represents the superclass for all types of
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
// objects in the HotSpot object heap.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
public class Oop {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  static {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
    VM.registerVMInitializedObserver(new Observer() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
        public void update(Observable o, Object data) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
          initialize(VM.getVM().getTypeDataBase());
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
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
    Type type  = db.lookupType("oopDesc");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
    mark       = new CIntField(type.getCIntegerField("_mark"), 0);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    50
    klass      = new OopField(type.getOopField("_metadata._klass"), 0);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    51
    compressedKlass  = new NarrowOopField(type.getOopField("_metadata._compressed_klass"), 0);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
    headerSize = type.getSize();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  private OopHandle  handle;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  private ObjectHeap heap;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  Oop(OopHandle handle, ObjectHeap heap) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
    this.handle = handle;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
    this.heap   = heap;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  ObjectHeap getHeap()   { return heap; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  /** Should not be used or needed by most clients outside this
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
      package; is needed, however, by {@link
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
      sun.jvm.hotspot.utilities.MarkBits}. */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  public OopHandle getHandle() { return handle; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  private static long headerSize;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    71
  public  static long getHeaderSize() { return headerSize; } // Header size in bytes.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  private static CIntField mark;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  private static OopField  klass;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    75
  private static NarrowOopField compressedKlass;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  public boolean isShared() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
    return CompactingPermGenGen.isShared(handle);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  public boolean isSharedReadOnly() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
    return CompactingPermGenGen.isSharedReadOnly(handle);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  public boolean isSharedReadWrite() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
    return CompactingPermGenGen.isSharedReadWrite(handle);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  // Accessors for declared fields
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  public Mark  getMark()   { return new Mark(getHandle()); }
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    91
  public Klass getKlass() {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    92
    if (VM.getVM().isCompressedOopsEnabled()) {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    93
      return (Klass) compressedKlass.getValue(this);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    94
    } else {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    95
      return (Klass) klass.getValue(this);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    96
    }
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    97
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  public boolean isA(Klass k) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
    return getKlass().isSubtypeOf(k);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  // Returns the byte size of this object
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  public long getObjectSize() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
    Klass k = getKlass();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
    if (k instanceof InstanceKlass) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
        return ((InstanceKlass)k).getSizeHelper()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
            * VM.getVM().getAddressSize();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
    // If it is not an instance, this method should be replaced.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
    return getHeaderSize();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  // Type test operations
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  public boolean isInstance()          { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  public boolean isInstanceRef()       { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  public boolean isArray()             { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  public boolean isObjArray()          { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  public boolean isTypeArray()         { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  public boolean isSymbol()            { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  public boolean isKlass()             { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  public boolean isThread()            { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  public boolean isMethod()            { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  public boolean isMethodData()        { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  public boolean isConstantPool()      { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  public boolean isConstantPoolCache() { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  public boolean isCompiledICHolder()  { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  // Align the object size.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  public static long alignObjectSize(long size) {
5694
1e0532a6abff 6916623: Align object to 16 bytes to use Compressed Oops with java heap up to 64Gb
kvn
parents: 670
diff changeset
   131
    return VM.getVM().alignUp(size, VM.getVM().getMinObjAlignmentInBytes());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  // All vm's align longs, so pad out certain offsets.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  public static long alignObjectOffset(long offset) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
    return VM.getVM().alignUp(offset, VM.getVM().getBytesPerLong());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  public boolean equals(Object obj) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
    if (obj != null && (obj instanceof Oop)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
      return getHandle().equals(((Oop) obj).getHandle());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
    return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
 }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  public int hashCode() { return getHandle().hashCode(); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
  /** Identity hash in the target VM */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  public long identityHash() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
    Mark mark = getMark();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
    if (mark.isUnlocked() && (!mark.hasNoHash())) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
      return (int) mark.hash();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
    } else if (mark.isMarked()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
      return (int) mark.hash();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
      return slowIdentityHash();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  public long slowIdentityHash() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
    return VM.getVM().getObjectSynchronizer().identityHashValueFor(this);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  public void iterate(OopVisitor visitor, boolean doVMFields) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
    visitor.setObj(this);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
    visitor.prologue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
    iterateFields(visitor, doVMFields);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
    visitor.epilogue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
  void iterateFields(OopVisitor visitor, boolean doVMFields) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
    if (doVMFields) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
      visitor.doCInt(mark, true);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   174
      if (VM.getVM().isCompressedOopsEnabled()) {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   175
        visitor.doOop(compressedKlass, true);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   176
      } else {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   177
        visitor.doOop(klass, true);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   178
      }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
    }
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 void print()      { printOn(System.out); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
  public void printValue() { printValueOn(System.out); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  public void printRaw()   { printRawOn(System.out); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  public static void printOopValueOn(Oop obj, PrintStream tty) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
    if (obj == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
      tty.print("null");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
      obj.printValueOn(tty);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
      tty.print(" @ " + obj.getHandle());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
  public static void printOopAddressOn(Oop obj, PrintStream tty) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
    if (obj == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
      tty.print("null");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
      tty.print(obj.getHandle().toString());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
  public void printOn(PrintStream tty) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
    OopPrinter printer = new OopPrinter(tty);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
    iterate(printer, true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
  public void printValueOn(PrintStream tty) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
    try {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
      tty.print("Oop for " + getKlass().getName().asString());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
    } catch (java.lang.NullPointerException e) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
      tty.print("Oop");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
  public void printRawOn(PrintStream tty) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
    tty.print("Dumping raw memory for ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
    printValueOn(tty);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
    tty.println();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
    long size = getObjectSize() * 4;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
    for (long i = 0; i < size; i += 4) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
      long memVal = getHandle().getCIntegerAt(i, 4, true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
      tty.println(Long.toHexString(memVal));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
  public boolean verify() { return true;}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
  // Package-private routine to speed up ObjectHeap.newOop
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
  static OopHandle getKlassForOopHandle(OopHandle handle) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
    if (handle == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
      return null;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
    }
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   234
    if (VM.getVM().isCompressedOopsEnabled()) {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   235
      return handle.getCompOopHandleAt(compressedKlass.getOffset());
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   236
    } else {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   237
      return handle.getOopHandleAt(klass.getOffset());
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   238
    }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
};