hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java
author kvn
Tue, 09 Jun 2009 16:19:10 -0700
changeset 3171 aa289b22b577
parent 1 489c9b5090e2
child 3600 27aa4477d039
child 3261 c7d5aae8d3f7
permissions -rw-r--r--
6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14 Summary: Disable escape analysis when jvmti/debugger is used. Add support for EA ibto SA. Reviewed-by: never
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2000-2005 Sun Microsystems, Inc.  All Rights Reserved.
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.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
3171
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    30
import sun.jvm.hotspot.debugger.*;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
import sun.jvm.hotspot.oops.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
import sun.jvm.hotspot.runtime.*;
3171
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    33
import sun.jvm.hotspot.utilities.*;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
/** ScopeDescs contain the information that makes source-level
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
    debugging of nmethods possible; each scopeDesc describes a method
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
    activation */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
public class ScopeDesc {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
  /** NMethod information */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
  private NMethod code;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  private Method  method;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  private int     bci;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  /** Decoding offsets */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  private int     decodeOffset;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
  private int     senderDecodeOffset;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  private int     localsDecodeOffset;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  private int     expressionsDecodeOffset;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  private int     monitorsDecodeOffset;
3171
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    50
  /** Scalar replaced bjects pool */
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    51
  private List    objects; // ArrayList<ScopeValue>
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    52
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  public ScopeDesc(NMethod code, int decodeOffset) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
    this.code = code;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
    this.decodeOffset = decodeOffset;
3171
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    57
    this.objects      = decodeObjectValues(DebugInformationRecorder.SERIALIZED_NULL);
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    58
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    59
    // Decode header
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    60
    DebugInfoReadStream stream  = streamAt(decodeOffset);
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    61
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    62
    senderDecodeOffset = stream.readInt();
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    63
    method = (Method) VM.getVM().getObjectHeap().newOop(stream.readOopHandle());
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    64
    bci    = stream.readBCI();
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    65
    // Decode offsets for body and sender
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    66
    localsDecodeOffset      = stream.readInt();
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    67
    expressionsDecodeOffset = stream.readInt();
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    68
    monitorsDecodeOffset    = stream.readInt();
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    69
  }
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    70
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    71
  public ScopeDesc(NMethod code, int decodeOffset, int objectDecodeOffset) {
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    72
    this.code = code;
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    73
    this.decodeOffset = decodeOffset;
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
    74
    this.objects      = decodeObjectValues(objectDecodeOffset);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
    // Decode header
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
    DebugInfoReadStream stream  = streamAt(decodeOffset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
    senderDecodeOffset = stream.readInt();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
    method = (Method) VM.getVM().getObjectHeap().newOop(stream.readOopHandle());
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
    bci    = stream.readBCI();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
    // Decode offsets for body and sender
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
    localsDecodeOffset      = stream.readInt();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
    expressionsDecodeOffset = stream.readInt();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
    monitorsDecodeOffset    = stream.readInt();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  public NMethod getNMethod() { return code; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  public Method getMethod() { return method; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  public int    getBCI()    { return bci;    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  /** Returns a List&lt;ScopeValue&gt; */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  public List getLocals() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
    return decodeScopeValues(localsDecodeOffset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  /** Returns a List&lt;ScopeValue&gt; */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  public List getExpressions() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
    return decodeScopeValues(expressionsDecodeOffset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  /** Returns a List&lt;MonitorValue&gt; */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  public List getMonitors() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
    return decodeMonitorValues(monitorsDecodeOffset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
3171
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   107
  /** Returns a List&lt;MonitorValue&gt; */
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   108
  public List getObjects() {
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   109
    return objects;
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   110
  }
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   111
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  /** Stack walking. Returns null if this is the outermost scope. */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  public ScopeDesc sender() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
    if (isTop()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
      return null;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
    return new ScopeDesc(code, senderDecodeOffset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  /** Returns where the scope was decoded */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  public int getDecodeOffset() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
    return decodeOffset;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  /** Tells whether sender() returns null */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  public boolean isTop() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
    return (senderDecodeOffset == DebugInformationRecorder.SERIALIZED_NULL);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  public boolean equals(Object arg) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
    if (arg == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
      return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
    if (!(arg instanceof ScopeDesc)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
      return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
    ScopeDesc sd = (ScopeDesc) arg;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
    return (sd.method.equals(method) && (sd.bci == bci));
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 void printValue() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
    printValueOn(System.out);
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 void printValueOn(PrintStream tty) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
    tty.print("ScopeDesc for ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
    method.printValueOn(tty);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
    tty.println(" @bci " + bci);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  // FIXME: add more accessors
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  //--------------------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  // Internals only below this point
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  private DebugInfoReadStream streamAt(int decodeOffset) {
3171
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   162
    return new DebugInfoReadStream(code, decodeOffset, objects);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
  /** Returns a List&lt;ScopeValue&gt; or null if no values were present */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  private List decodeScopeValues(int decodeOffset) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
    if (decodeOffset == DebugInformationRecorder.SERIALIZED_NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
      return null;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
    DebugInfoReadStream stream = streamAt(decodeOffset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
    int length = stream.readInt();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
    List res = new ArrayList(length);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
    for (int i = 0; i < length; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
      res.add(ScopeValue.readFrom(stream));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
    return res;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
  /** Returns a List&lt;MonitorValue&gt; or null if no values were present */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
  private List decodeMonitorValues(int decodeOffset) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
    if (decodeOffset == DebugInformationRecorder.SERIALIZED_NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
      return null;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
    DebugInfoReadStream stream = streamAt(decodeOffset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
    int length = stream.readInt();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
    List res = new ArrayList(length);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
    for (int i = 0; i < length; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
      res.add(new MonitorValue(stream));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
    return res;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  }
3171
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   192
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   193
  /** Returns a List&lt;ObjectValue&gt; or null if no values were present */
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   194
  private List decodeObjectValues(int decodeOffset) {
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   195
    if (decodeOffset == DebugInformationRecorder.SERIALIZED_NULL) {
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   196
      return null;
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   197
    }
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   198
    List res = new ArrayList();
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   199
    DebugInfoReadStream stream = new DebugInfoReadStream(code, decodeOffset, res);
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   200
    int length = stream.readInt();
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   201
    for (int i = 0; i < length; i++) {
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   202
      // Objects values are pushed to 'res' array during read so that
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   203
      // object's fields could reference it (OBJECT_ID_CODE).
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   204
      ScopeValue.readFrom(stream);
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   205
      // res.add(ScopeValue.readFrom(stream));
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   206
    }
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   207
    Assert.that(res.size() == length, "inconsistent debug information");
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   208
    return res;
aa289b22b577 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 1
diff changeset
   209
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
}