src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DataLayout.java
author shade
Sun, 07 Apr 2019 13:28:18 +0200
changeset 54449 ac4b327623f6
parent 50577 bf7e2684cd0a
permissions -rw-r--r--
8221917: serviceability/sa/TestPrintMdo.java fails on 32-bit platforms Reviewed-by: cjplummer, dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
     1
/*
54449
ac4b327623f6 8221917: serviceability/sa/TestPrintMdo.java fails on 32-bit platforms
shade
parents: 50577
diff changeset
     2
 * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
12265
bc2565f91b58 7156960: Incorrect copyright headers in parts of the Serviceability agent
minqi
parents: 10547
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
     4
 *
12265
bc2565f91b58 7156960: Incorrect copyright headers in parts of the Serviceability agent
minqi
parents: 10547
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
bc2565f91b58 7156960: Incorrect copyright headers in parts of the Serviceability agent
minqi
parents: 10547
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
bc2565f91b58 7156960: Incorrect copyright headers in parts of the Serviceability agent
minqi
parents: 10547
diff changeset
     7
 * published by the Free Software Foundation.
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
     8
 *
12265
bc2565f91b58 7156960: Incorrect copyright headers in parts of the Serviceability agent
minqi
parents: 10547
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
bc2565f91b58 7156960: Incorrect copyright headers in parts of the Serviceability agent
minqi
parents: 10547
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bc2565f91b58 7156960: Incorrect copyright headers in parts of the Serviceability agent
minqi
parents: 10547
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
bc2565f91b58 7156960: Incorrect copyright headers in parts of the Serviceability agent
minqi
parents: 10547
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
bc2565f91b58 7156960: Incorrect copyright headers in parts of the Serviceability agent
minqi
parents: 10547
diff changeset
    13
 * accompanied this code).
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    14
 *
12265
bc2565f91b58 7156960: Incorrect copyright headers in parts of the Serviceability agent
minqi
parents: 10547
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
bc2565f91b58 7156960: Incorrect copyright headers in parts of the Serviceability agent
minqi
parents: 10547
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
bc2565f91b58 7156960: Incorrect copyright headers in parts of the Serviceability agent
minqi
parents: 10547
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    18
 *
12265
bc2565f91b58 7156960: Incorrect copyright headers in parts of the Serviceability agent
minqi
parents: 10547
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
bc2565f91b58 7156960: Incorrect copyright headers in parts of the Serviceability agent
minqi
parents: 10547
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
bc2565f91b58 7156960: Incorrect copyright headers in parts of the Serviceability agent
minqi
parents: 10547
diff changeset
    21
 * questions.
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    22
 *
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    23
 */
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    24
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    25
package sun.jvm.hotspot.oops;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    26
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    27
import java.io.*;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    28
import java.util.*;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    29
import sun.jvm.hotspot.debugger.*;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    30
import sun.jvm.hotspot.runtime.*;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    31
import sun.jvm.hotspot.types.*;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    32
import sun.jvm.hotspot.utilities.*;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    33
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    34
public class DataLayout {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    35
  public static final int noTag = 0;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    36
  public static final int bitDataTag = 1;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    37
  public static final int counterDataTag = 2;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    38
  public static final int jumpDataTag= 3;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    39
  public static final int receiverTypeDataTag = 4;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    40
  public static final int virtualCallDataTag = 5;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    41
  public static final int retDataTag = 6;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    42
  public static final int branchDataTag = 7;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    43
  public static final int multiBranchDataTag = 8;
24476
912595db2e75 8026694: New type profiling points break compilation replay
roland
parents: 13728
diff changeset
    44
  public static final int argInfoDataTag = 9;
912595db2e75 8026694: New type profiling points break compilation replay
roland
parents: 13728
diff changeset
    45
  public static final int callTypeDataTag = 10;
912595db2e75 8026694: New type profiling points break compilation replay
roland
parents: 13728
diff changeset
    46
  public static final int virtualCallTypeDataTag = 11;
912595db2e75 8026694: New type profiling points break compilation replay
roland
parents: 13728
diff changeset
    47
  public static final int parametersTypeDataTag = 12;
912595db2e75 8026694: New type profiling points break compilation replay
roland
parents: 13728
diff changeset
    48
  public static final int speculativeTrapDataTag = 13;
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    49
50577
bf7e2684cd0a 8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents: 47216
diff changeset
    50
  // The trap state breaks down as [recompile:1 | reason:31].
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    51
  // This further breakdown is defined in deoptimization.cpp.
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    52
  // See Deoptimization.trapStateReason for an assert that
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    53
  // trapBits is big enough to hold reasons < reasonRecordedLimit.
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    54
  //
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    55
  // The trapState is collected only if ProfileTraps is true.
50577
bf7e2684cd0a 8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents: 47216
diff changeset
    56
  public static final int trapBits = 1+31;  // 31: enough to distinguish [0..reasonRecordedLimit].
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    57
  public static final int trapMask = Bits.rightNBits(trapBits);
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    58
  public static final int firstFlag = 0;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    59
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    60
  private Address data;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    61
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    62
  private int offset;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    63
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    64
  public DataLayout(MethodData d, int o) {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12265
diff changeset
    65
    data = d.getAddress();
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    66
    offset = o;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    67
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    68
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    69
  public DataLayout(Address d, int o) {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    70
    data = d;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    71
    offset = o;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    72
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    73
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    74
  public int dp() { return offset; }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    75
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    76
  private int getU11(int at) {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    77
    return data.getJByteAt(offset + at) & 0xff;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    78
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    79
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    80
  private int getU22(int at) {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    81
    return data.getJShortAt(offset + at) & 0xffff;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    82
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    83
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    84
  int cellAt(int index) {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    85
    // Cells are intptr_t sized but only contain ints as raw values
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    86
    return (int)data.getCIntegerAt(offset + cellOffset(index), MethodData.cellSize, false);
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    87
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    88
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    89
  public Address addressAt(int index) {
24476
912595db2e75 8026694: New type profiling points break compilation replay
roland
parents: 13728
diff changeset
    90
    return data.getAddressAt(offset + cellOffset(index));
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    91
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    92
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    93
  // Every data layout begins with a header.  This header
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    94
  // contains a tag, which is used to indicate the size/layout
50577
bf7e2684cd0a 8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents: 47216
diff changeset
    95
  // of the data, 8 bits of flags, which can be used in any way,
bf7e2684cd0a 8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents: 47216
diff changeset
    96
  // 32 bits of trap history (none/one reason/many reasons),
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    97
  // and a bci, which is used to tie this piece of data to a
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    98
  // specific bci in the bytecodes.
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
    99
  // union {
50577
bf7e2684cd0a 8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents: 47216
diff changeset
   100
  //   u8 _bits;
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   101
  //   struct {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   102
  //     u1 _tag;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   103
  //     u1 _flags;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   104
  //     u2 _bci;
50577
bf7e2684cd0a 8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents: 47216
diff changeset
   105
  //     u4 _traps;
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   106
  //   } _struct;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   107
  // } _header;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   108
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   109
  // Some types of data layouts need a length field.
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   110
  static boolean needsArrayLen(int tag) {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   111
    return (tag == multiBranchDataTag);
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   112
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   113
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   114
  public static final int counterIncrement = 1;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   115
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   116
  // Size computation
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   117
  static int headerSizeInBytes() {
50577
bf7e2684cd0a 8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents: 47216
diff changeset
   118
    return MethodData.cellSize * headerSizeInCells();
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   119
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   120
  static int headerSizeInCells() {
50577
bf7e2684cd0a 8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents: 47216
diff changeset
   121
      return VM.getVM().isLP64() ? 1 : 2;
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   122
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   123
24476
912595db2e75 8026694: New type profiling points break compilation replay
roland
parents: 13728
diff changeset
   124
  static public int computeSizeInBytes(int cellCount) {
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   125
    return headerSizeInBytes() + cellCount * MethodData.cellSize;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   126
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   127
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   128
  // Initialization
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   129
  // void initialize(int tag, int bci, int cellCount);
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   130
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   131
  // Accessors
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   132
  public int tag() {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   133
    return getU11(0);
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   134
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   135
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   136
  // Return a few bits of trap state.  Range is [0..trapMask].
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   137
  // The state tells if traps with zero, one, or many reasons have occurred.
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   138
  // It also tells whether zero or many recompilations have occurred.
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   139
  // The associated trap histogram in the MDO itself tells whether
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   140
  // traps are common or not.  If a BCI shows that a trap X has
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   141
  // occurred, and the MDO shows N occurrences of X, we make the
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   142
  // simplifying assumption that all N occurrences can be blamed
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   143
  // on that BCI.
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   144
  int trapState() {
50577
bf7e2684cd0a 8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents: 47216
diff changeset
   145
    return data.getJIntAt(offset+4);
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   146
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   147
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   148
  int flags() {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   149
    return getU11(1);
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   150
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   151
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   152
  int bci() {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   153
    return getU22(2);
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   154
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   155
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   156
  boolean flagAt(int flagNumber) {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   157
    // assert(flagNumber < flagLimit, "oob");
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   158
    return (flags() & (0x1 << flagNumber)) != 0;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   159
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   160
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   161
  // Low-level support for code generation.
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   162
  static int headerOffset() {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   163
    return 0;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   164
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   165
  static int tagOffset() {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   166
    return 0;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   167
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   168
  static int flagsOffset() {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   169
    return 1;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   170
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   171
  static int bciOffset() {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   172
    return 2;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   173
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   174
  public static int cellOffset(int index) {
54449
ac4b327623f6 8221917: serviceability/sa/TestPrintMdo.java fails on 32-bit platforms
shade
parents: 50577
diff changeset
   175
    return (headerSizeInCells() + index) * MethodData.cellSize;
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   176
  }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   177
  // // Return a value which, when or-ed as a byte into _flags, sets the flag.
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   178
  // static int flagNumberToByteConstant(int flagNumber) {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   179
  //   assert(0 <= flagNumber && flagNumber < flagLimit, "oob");
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   180
  //   DataLayout temp; temp.setHeader(0);
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   181
  //   temp.setFlagAt(flagNumber);
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   182
  //   return temp._header._struct._flags;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   183
  // }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   184
  // // Return a value which, when or-ed as a word into _header, sets the flag.
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   185
  // static intptrT flagMaskToHeaderMask(int byteConstant) {
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   186
  //   DataLayout temp; temp.setHeader(0);
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   187
  //   temp._header._struct._flags = byteConstant;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   188
  //   return temp._header._bits;
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   189
  // }
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents:
diff changeset
   190
}