annotate agent/src/share/classes/sun/jvm/hotspot/oops/DataLayout.java @ 5981:4bec1b1f7b33

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