hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeBlob.java
author never
Mon, 05 Sep 2011 17:09:05 -0700
changeset 10517 f92c9ff3a15f
parent 9946 b3d5b50e2289
child 13391 30245956af37
permissions -rw-r--r--
7051798: SA-JDI: NPE in Frame.addressOfStackSlot(Frame.java:244) Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
9946
b3d5b50e2289 7045513: JSR 292 inlining causes crashes in methodHandleWalk.cpp
never
parents: 6418
diff changeset
     2
 * Copyright (c) 2000, 2011, 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.code;
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
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
import sun.jvm.hotspot.asm.x86.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
import sun.jvm.hotspot.compiler.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
import sun.jvm.hotspot.debugger.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
import sun.jvm.hotspot.runtime.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
import sun.jvm.hotspot.types.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
import sun.jvm.hotspot.utilities.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
public class CodeBlob extends VMObject {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
  private static AddressField  nameField;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  private static CIntegerField sizeField;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
  private static CIntegerField headerSizeField;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
  private static CIntegerField relocationSizeField;
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
    42
  private static CIntegerField contentOffsetField;
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
    43
  private static CIntegerField codeOffsetField;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  private static CIntegerField frameCompleteOffsetField;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  private static CIntegerField dataOffsetField;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
  private static CIntegerField frameSizeField;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  private static AddressField  oopMapsField;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  // Only used by server compiler on x86; computed over in SA rather
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  // than relying on computation in target VM
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  private static final int     NOT_YET_COMPUTED = -2;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  private static final int     UNDEFINED        = -1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  private              int     linkOffset       = NOT_YET_COMPUTED;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  private static       int     matcherInterpreterFramePointerReg;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  static {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
    VM.registerVMInitializedObserver(new Observer() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
        public void update(Observable o, Object data) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
          initialize(VM.getVM().getTypeDataBase());
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
      });
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  private static void initialize(TypeDataBase db) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
    Type type = db.lookupType("CodeBlob");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
    nameField                = type.getAddressField("_name");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
    sizeField                = type.getCIntegerField("_size");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
    headerSizeField          = type.getCIntegerField("_header_size");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
    relocationSizeField      = type.getCIntegerField("_relocation_size");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
    frameCompleteOffsetField = type.getCIntegerField("_frame_complete_offset");
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
    72
    contentOffsetField       = type.getCIntegerField("_content_offset");
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
    73
    codeOffsetField          = type.getCIntegerField("_code_offset");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
    dataOffsetField          = type.getCIntegerField("_data_offset");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
    frameSizeField           = type.getCIntegerField("_frame_size");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
    oopMapsField             = type.getAddressField("_oop_maps");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
    if (VM.getVM().isServerCompiler()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
      matcherInterpreterFramePointerReg =
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
        db.lookupIntConstant("Matcher::interpreter_frame_pointer_reg").intValue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  public CodeBlob(Address addr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
    super(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  // Typing
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  public boolean isBufferBlob()         { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  public boolean isNMethod()            { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  public boolean isRuntimeStub()        { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  public boolean isDeoptimizationStub() { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  public boolean isUncommonTrapStub()   { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  public boolean isExceptionStub()      { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  public boolean isSafepointStub()      { return false; }
9946
b3d5b50e2289 7045513: JSR 292 inlining causes crashes in methodHandleWalk.cpp
never
parents: 6418
diff changeset
    96
  public boolean isRicochetBlob()       { return false; }
b3d5b50e2289 7045513: JSR 292 inlining causes crashes in methodHandleWalk.cpp
never
parents: 6418
diff changeset
    97
  public boolean isAdapterBlob()        { return false; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  // Fine grain nmethod support: isNmethod() == isJavaMethod() || isNativeMethod() || isOSRMethod()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  public boolean isJavaMethod()         { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  public boolean isNativeMethod()       { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  /** On-Stack Replacement method */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  public boolean isOSRMethod()          { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
10517
f92c9ff3a15f 7051798: SA-JDI: NPE in Frame.addressOfStackSlot(Frame.java:244)
never
parents: 9946
diff changeset
   105
  public NMethod asNMethodOrNull() {
f92c9ff3a15f 7051798: SA-JDI: NPE in Frame.addressOfStackSlot(Frame.java:244)
never
parents: 9946
diff changeset
   106
    if (isNMethod()) return (NMethod)this;
f92c9ff3a15f 7051798: SA-JDI: NPE in Frame.addressOfStackSlot(Frame.java:244)
never
parents: 9946
diff changeset
   107
    return null;
f92c9ff3a15f 7051798: SA-JDI: NPE in Frame.addressOfStackSlot(Frame.java:244)
never
parents: 9946
diff changeset
   108
  }
f92c9ff3a15f 7051798: SA-JDI: NPE in Frame.addressOfStackSlot(Frame.java:244)
never
parents: 9946
diff changeset
   109
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  // Boundaries
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  public Address headerBegin() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
    return addr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  public Address headerEnd() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
    return addr.addOffsetTo(headerSizeField.getValue(addr));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  // FIXME: add RelocInfo
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  //  public RelocInfo relocationBegin();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  //  public RelocInfo relocationEnd();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   123
  public Address contentBegin() {
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   124
    return headerBegin().addOffsetTo(contentOffsetField.getValue(addr));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   127
  public Address contentEnd() {
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   128
    return headerBegin().addOffsetTo(dataOffsetField.getValue(addr));
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   129
  }
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   130
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   131
  public Address codeBegin() {
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   132
    return headerBegin().addOffsetTo(contentOffsetField.getValue(addr));
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   133
  }
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   134
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   135
  public Address codeEnd() {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
    return headerBegin().addOffsetTo(dataOffsetField.getValue(addr));
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 Address dataBegin() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
    return headerBegin().addOffsetTo(dataOffsetField.getValue(addr));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
  public Address dataEnd() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
    return headerBegin().addOffsetTo(sizeField.getValue(addr));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  // Offsets
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   148
  public int getRelocationOffset() { return (int) headerSizeField   .getValue(addr); }
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   149
  public int getContentOffset()    { return (int) contentOffsetField.getValue(addr); }
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   150
  public int getCodeOffset()       { return (int) codeOffsetField   .getValue(addr); }
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   151
  public int getDataOffset()       { return (int) dataOffsetField   .getValue(addr); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
  // Sizes
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   154
  public int getSize()             { return (int) sizeField      .getValue(addr);     }
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   155
  public int getHeaderSize()       { return (int) headerSizeField.getValue(addr);     }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
  // FIXME: add getRelocationSize()
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   157
  public int getContentSize()      { return (int) contentEnd().minus(contentBegin()); }
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   158
  public int getCodeSize()         { return (int) codeEnd()   .minus(codeBegin());    }
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   159
  public int getDataSize()         { return (int) dataEnd()   .minus(dataBegin());    }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  // Containment
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   162
  public boolean blobContains(Address addr)    { return headerBegin() .lessThanOrEqual(addr) && dataEnd()   .greaterThan(addr); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  // FIXME: add relocationContains
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   164
  public boolean contentContains(Address addr) { return contentBegin().lessThanOrEqual(addr) && contentEnd().greaterThan(addr); }
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   165
  public boolean codeContains(Address addr)    { return codeBegin()   .lessThanOrEqual(addr) && codeEnd()   .greaterThan(addr); }
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   166
  public boolean dataContains(Address addr)    { return dataBegin()   .lessThanOrEqual(addr) && dataEnd()   .greaterThan(addr); }
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   167
  public boolean contains(Address addr)        { return contentContains(addr);                                                  }
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   168
  public boolean isFrameCompleteAt(Address a)  { return codeContains(a) && a.minus(codeBegin()) >= frameCompleteOffsetField.getValue(addr); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
  // Reclamation support (really only used by the nmethods, but in order to get asserts to work
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
  // in the CodeCache they are defined virtual here)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
  public boolean isZombie()             { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  public boolean isLockedByVM()         { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
  /** OopMap for frame; can return null if none available */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
  public OopMapSet getOopMaps() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
    Address oopMapsAddr = oopMapsField.getValue(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
    if (oopMapsAddr == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
      return null;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
    return new OopMapSet(oopMapsAddr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
  // FIXME: not yet implementable
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  //  void set_oop_maps(OopMapSet* p);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  public OopMap getOopMapForReturnAddress(Address returnAddress, boolean debugging) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
    Address pc = returnAddress;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
    if (Assert.ASSERTS_ENABLED) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
      Assert.that(getOopMaps() != null, "nope");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
    }
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   191
    return getOopMaps().findMapAtOffset(pc.minus(codeBegin()), debugging);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
  //  virtual void preserve_callee_argument_oops(frame fr, const RegisterMap* reg_map, void f(oop*)) { ShouldNotReachHere(); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
  //  FIXME;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  /** NOTE: this returns a size in BYTES in this system! */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
  public long getFrameSize() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
    return VM.getVM().getAddressSize() * frameSizeField.getValue(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
  // Returns true, if the next frame is responsible for GC'ing oops passed as arguments
10517
f92c9ff3a15f 7051798: SA-JDI: NPE in Frame.addressOfStackSlot(Frame.java:244)
never
parents: 9946
diff changeset
   203
  public boolean callerMustGCArguments() { return false; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  public String getName() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
    return CStringUtilities.getString(nameField.getValue(addr));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  // FIXME: NOT FINISHED
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
  // FIXME: add more accessors
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  public void print() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
    printOn(System.out);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
  public void printOn(PrintStream tty) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
    tty.print(getName());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
    printComponentsOn(tty);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
  protected void printComponentsOn(PrintStream tty) {
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   223
    tty.println(" content: [" + contentBegin() + ", " + contentEnd() + "), " +
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5702
diff changeset
   224
                " code: [" + codeBegin() + ", " + codeEnd() + "), " +
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
                " data: [" + dataBegin() + ", " + dataEnd() + "), " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
                " frame size: " + getFrameSize());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
}