annotate src/share/vm/ci/ciStreams.cpp @ 2357:8033953d67ff

7012648: move JSR 292 to package java.lang.invoke and adjust names Summary: package and class renaming only; delete unused methods and classes Reviewed-by: twisti
author jrose
date Fri, 11 Mar 2011 22:34:57 -0800
parents f95d63e2154a
children 1d7922586cf6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
2357
8033953d67ff 7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents: 1972
diff changeset
2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1138
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1138
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1138
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
26 #include "ci/ciCPCache.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
27 #include "ci/ciCallSite.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
28 #include "ci/ciConstant.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
29 #include "ci/ciField.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
30 #include "ci/ciStreams.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
31 #include "ci/ciUtilities.hpp"
0
a61af66fc99e Initial load
duke
parents:
diff changeset
32
a61af66fc99e Initial load
duke
parents:
diff changeset
33 // ciExceptionHandlerStream
a61af66fc99e Initial load
duke
parents:
diff changeset
34 //
a61af66fc99e Initial load
duke
parents:
diff changeset
35 // Walk over some selected set of a methods exception handlers.
a61af66fc99e Initial load
duke
parents:
diff changeset
36
a61af66fc99e Initial load
duke
parents:
diff changeset
37 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
38 // ciExceptionHandlerStream::count
a61af66fc99e Initial load
duke
parents:
diff changeset
39 //
a61af66fc99e Initial load
duke
parents:
diff changeset
40 // How many exception handlers are there in this stream?
a61af66fc99e Initial load
duke
parents:
diff changeset
41 //
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // Implementation note: Compiler2 needs this functionality, so I had
a61af66fc99e Initial load
duke
parents:
diff changeset
43 int ciExceptionHandlerStream::count() {
a61af66fc99e Initial load
duke
parents:
diff changeset
44 int save_pos = _pos;
a61af66fc99e Initial load
duke
parents:
diff changeset
45 int save_end = _end;
a61af66fc99e Initial load
duke
parents:
diff changeset
46
a61af66fc99e Initial load
duke
parents:
diff changeset
47 int count = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49 _pos = -1;
a61af66fc99e Initial load
duke
parents:
diff changeset
50 _end = _method->_handler_count;
a61af66fc99e Initial load
duke
parents:
diff changeset
51
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 next();
a61af66fc99e Initial load
duke
parents:
diff changeset
54 while (!is_done()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
55 count++;
a61af66fc99e Initial load
duke
parents:
diff changeset
56 next();
a61af66fc99e Initial load
duke
parents:
diff changeset
57 }
a61af66fc99e Initial load
duke
parents:
diff changeset
58
a61af66fc99e Initial load
duke
parents:
diff changeset
59 _pos = save_pos;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 _end = save_end;
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
62 return count;
a61af66fc99e Initial load
duke
parents:
diff changeset
63 }
a61af66fc99e Initial load
duke
parents:
diff changeset
64
a61af66fc99e Initial load
duke
parents:
diff changeset
65 int ciExceptionHandlerStream::count_remaining() {
a61af66fc99e Initial load
duke
parents:
diff changeset
66 int save_pos = _pos;
a61af66fc99e Initial load
duke
parents:
diff changeset
67 int save_end = _end;
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 int count = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
70
a61af66fc99e Initial load
duke
parents:
diff changeset
71 while (!is_done()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
72 count++;
a61af66fc99e Initial load
duke
parents:
diff changeset
73 next();
a61af66fc99e Initial load
duke
parents:
diff changeset
74 }
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 _pos = save_pos;
a61af66fc99e Initial load
duke
parents:
diff changeset
77 _end = save_end;
a61af66fc99e Initial load
duke
parents:
diff changeset
78
a61af66fc99e Initial load
duke
parents:
diff changeset
79 return count;
a61af66fc99e Initial load
duke
parents:
diff changeset
80 }
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82 // ciBytecodeStream
a61af66fc99e Initial load
duke
parents:
diff changeset
83 //
a61af66fc99e Initial load
duke
parents:
diff changeset
84 // The class is used to iterate over the bytecodes of a method.
a61af66fc99e Initial load
duke
parents:
diff changeset
85 // It hides the details of constant pool structure/access by
a61af66fc99e Initial load
duke
parents:
diff changeset
86 // providing accessors for constant pool items.
a61af66fc99e Initial load
duke
parents:
diff changeset
87
a61af66fc99e Initial load
duke
parents:
diff changeset
88 // ------------------------------------------------------------------
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
89 // ciBytecodeStream::next_wide_or_table
0
a61af66fc99e Initial load
duke
parents:
diff changeset
90 //
a61af66fc99e Initial load
duke
parents:
diff changeset
91 // Special handling for switch ops
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
92 Bytecodes::Code ciBytecodeStream::next_wide_or_table(Bytecodes::Code bc) {
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
93 switch (bc) { // Check for special bytecode handling
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
94 case Bytecodes::_wide:
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
95 // Special handling for the wide bytcode
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
96 // Get following bytecode; do not return wide
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
97 assert(Bytecodes::Code(_pc[0]) == Bytecodes::_wide, "");
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
98 bc = Bytecodes::java_code(_raw_bc = (Bytecodes::Code)_pc[1]);
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
99 assert(Bytecodes::wide_length_for(bc) > 2, "must make progress");
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
100 _pc += Bytecodes::wide_length_for(bc);
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
101 _was_wide = _pc; // Flag last wide bytecode found
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
102 assert(is_wide(), "accessor works right");
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
103 break;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
104
a61af66fc99e Initial load
duke
parents:
diff changeset
105 case Bytecodes::_lookupswitch:
a61af66fc99e Initial load
duke
parents:
diff changeset
106 _pc++; // Skip wide bytecode
a61af66fc99e Initial load
duke
parents:
diff changeset
107 _pc += (_start-_pc)&3; // Word align
a61af66fc99e Initial load
duke
parents:
diff changeset
108 _table_base = (jint*)_pc; // Capture for later usage
a61af66fc99e Initial load
duke
parents:
diff changeset
109 // table_base[0] is default far_dest
a61af66fc99e Initial load
duke
parents:
diff changeset
110 // Table has 2 lead elements (default, length), then pairs of u4 values.
a61af66fc99e Initial load
duke
parents:
diff changeset
111 // So load table length, and compute address at end of table
a61af66fc99e Initial load
duke
parents:
diff changeset
112 _pc = (address)&_table_base[2+ 2*Bytes::get_Java_u4((address)&_table_base[1])];
a61af66fc99e Initial load
duke
parents:
diff changeset
113 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
114
a61af66fc99e Initial load
duke
parents:
diff changeset
115 case Bytecodes::_tableswitch: {
a61af66fc99e Initial load
duke
parents:
diff changeset
116 _pc++; // Skip wide bytecode
a61af66fc99e Initial load
duke
parents:
diff changeset
117 _pc += (_start-_pc)&3; // Word align
a61af66fc99e Initial load
duke
parents:
diff changeset
118 _table_base = (jint*)_pc; // Capture for later usage
a61af66fc99e Initial load
duke
parents:
diff changeset
119 // table_base[0] is default far_dest
a61af66fc99e Initial load
duke
parents:
diff changeset
120 int lo = Bytes::get_Java_u4((address)&_table_base[1]);// Low bound
a61af66fc99e Initial load
duke
parents:
diff changeset
121 int hi = Bytes::get_Java_u4((address)&_table_base[2]);// High bound
a61af66fc99e Initial load
duke
parents:
diff changeset
122 int len = hi - lo + 1; // Dense table size
a61af66fc99e Initial load
duke
parents:
diff changeset
123 _pc = (address)&_table_base[3+len]; // Skip past table
a61af66fc99e Initial load
duke
parents:
diff changeset
124 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
125 }
a61af66fc99e Initial load
duke
parents:
diff changeset
126
a61af66fc99e Initial load
duke
parents:
diff changeset
127 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
128 fatal("unhandled bytecode");
a61af66fc99e Initial load
duke
parents:
diff changeset
129 }
a61af66fc99e Initial load
duke
parents:
diff changeset
130 return bc;
a61af66fc99e Initial load
duke
parents:
diff changeset
131 }
a61af66fc99e Initial load
duke
parents:
diff changeset
132
a61af66fc99e Initial load
duke
parents:
diff changeset
133 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
134 // ciBytecodeStream::reset_to_bci
a61af66fc99e Initial load
duke
parents:
diff changeset
135 void ciBytecodeStream::reset_to_bci( int bci ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
136 _bc_start=_was_wide=0;
a61af66fc99e Initial load
duke
parents:
diff changeset
137 _pc = _start+bci;
a61af66fc99e Initial load
duke
parents:
diff changeset
138 }
a61af66fc99e Initial load
duke
parents:
diff changeset
139
a61af66fc99e Initial load
duke
parents:
diff changeset
140 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
141 // ciBytecodeStream::force_bci
a61af66fc99e Initial load
duke
parents:
diff changeset
142 void ciBytecodeStream::force_bci(int bci) {
a61af66fc99e Initial load
duke
parents:
diff changeset
143 if (bci < 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
144 reset_to_bci(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
145 _bc_start = _start + bci;
a61af66fc99e Initial load
duke
parents:
diff changeset
146 _bc = EOBC();
a61af66fc99e Initial load
duke
parents:
diff changeset
147 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
148 reset_to_bci(bci);
a61af66fc99e Initial load
duke
parents:
diff changeset
149 next();
a61af66fc99e Initial load
duke
parents:
diff changeset
150 }
a61af66fc99e Initial load
duke
parents:
diff changeset
151 }
a61af66fc99e Initial load
duke
parents:
diff changeset
152
a61af66fc99e Initial load
duke
parents:
diff changeset
153
a61af66fc99e Initial load
duke
parents:
diff changeset
154 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
155 // Constant pool access
a61af66fc99e Initial load
duke
parents:
diff changeset
156 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
157
a61af66fc99e Initial load
duke
parents:
diff changeset
158 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
159 // ciBytecodeStream::get_klass_index
a61af66fc99e Initial load
duke
parents:
diff changeset
160 //
a61af66fc99e Initial load
duke
parents:
diff changeset
161 // If this bytecodes references a klass, return the index of the
a61af66fc99e Initial load
duke
parents:
diff changeset
162 // referenced klass.
a61af66fc99e Initial load
duke
parents:
diff changeset
163 int ciBytecodeStream::get_klass_index() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
164 switch(cur_bc()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
165 case Bytecodes::_ldc:
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
166 return get_index_u1();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
167 case Bytecodes::_ldc_w:
a61af66fc99e Initial load
duke
parents:
diff changeset
168 case Bytecodes::_ldc2_w:
a61af66fc99e Initial load
duke
parents:
diff changeset
169 case Bytecodes::_checkcast:
a61af66fc99e Initial load
duke
parents:
diff changeset
170 case Bytecodes::_instanceof:
a61af66fc99e Initial load
duke
parents:
diff changeset
171 case Bytecodes::_anewarray:
a61af66fc99e Initial load
duke
parents:
diff changeset
172 case Bytecodes::_multianewarray:
a61af66fc99e Initial load
duke
parents:
diff changeset
173 case Bytecodes::_new:
a61af66fc99e Initial load
duke
parents:
diff changeset
174 case Bytecodes::_newarray:
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
175 return get_index_u2();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
176 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
177 ShouldNotReachHere();
a61af66fc99e Initial load
duke
parents:
diff changeset
178 return 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
179 }
a61af66fc99e Initial load
duke
parents:
diff changeset
180 }
a61af66fc99e Initial load
duke
parents:
diff changeset
181
a61af66fc99e Initial load
duke
parents:
diff changeset
182 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
183 // ciBytecodeStream::get_klass
a61af66fc99e Initial load
duke
parents:
diff changeset
184 //
a61af66fc99e Initial load
duke
parents:
diff changeset
185 // If this bytecode is a new, newarray, multianewarray, instanceof,
a61af66fc99e Initial load
duke
parents:
diff changeset
186 // or checkcast, get the referenced klass.
a61af66fc99e Initial load
duke
parents:
diff changeset
187 ciKlass* ciBytecodeStream::get_klass(bool& will_link) {
1138
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
188 VM_ENTRY_MARK;
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
189 constantPoolHandle cpool(_method->get_methodOop()->constants());
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
190 return CURRENT_ENV->get_klass_by_index(cpool, get_klass_index(), will_link, _holder);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
191 }
a61af66fc99e Initial load
duke
parents:
diff changeset
192
a61af66fc99e Initial load
duke
parents:
diff changeset
193 // ------------------------------------------------------------------
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
194 // ciBytecodeStream::get_constant_raw_index
0
a61af66fc99e Initial load
duke
parents:
diff changeset
195 //
a61af66fc99e Initial load
duke
parents:
diff changeset
196 // If this bytecode is one of the ldc variants, get the index of the
a61af66fc99e Initial load
duke
parents:
diff changeset
197 // referenced constant.
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
198 int ciBytecodeStream::get_constant_raw_index() const {
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
199 // work-alike for Bytecode_loadconstant::raw_index()
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
200 switch (cur_bc()) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
201 case Bytecodes::_ldc:
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
202 return get_index_u1();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
203 case Bytecodes::_ldc_w:
a61af66fc99e Initial load
duke
parents:
diff changeset
204 case Bytecodes::_ldc2_w:
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
205 return get_index_u2();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
206 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
207 ShouldNotReachHere();
a61af66fc99e Initial load
duke
parents:
diff changeset
208 return 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
209 }
a61af66fc99e Initial load
duke
parents:
diff changeset
210 }
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
211
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
212 // ------------------------------------------------------------------
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
213 // ciBytecodeStream::get_constant_pool_index
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
214 // Decode any CP cache index into a regular pool index.
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
215 int ciBytecodeStream::get_constant_pool_index() const {
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
216 // work-alike for Bytecode_loadconstant::pool_index()
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
217 int index = get_constant_raw_index();
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
218 if (has_cache_index()) {
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
219 return get_cpcache()->get_pool_index(index);
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
220 }
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
221 return index;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
222 }
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
223
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
224 // ------------------------------------------------------------------
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
225 // ciBytecodeStream::get_constant_cache_index
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
226 // Return the CP cache index, or -1 if there isn't any.
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
227 int ciBytecodeStream::get_constant_cache_index() const {
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
228 // work-alike for Bytecode_loadconstant::cache_index()
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
229 return has_cache_index() ? get_constant_raw_index() : -1;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
230 }
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
231
0
a61af66fc99e Initial load
duke
parents:
diff changeset
232 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
233 // ciBytecodeStream::get_constant
a61af66fc99e Initial load
duke
parents:
diff changeset
234 //
a61af66fc99e Initial load
duke
parents:
diff changeset
235 // If this bytecode is one of the ldc variants, get the referenced
a61af66fc99e Initial load
duke
parents:
diff changeset
236 // constant.
a61af66fc99e Initial load
duke
parents:
diff changeset
237 ciConstant ciBytecodeStream::get_constant() {
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
238 int pool_index = get_constant_raw_index();
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
239 int cache_index = -1;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
240 if (has_cache_index()) {
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
241 cache_index = pool_index;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
242 pool_index = -1;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
243 }
1138
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
244 VM_ENTRY_MARK;
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
245 constantPoolHandle cpool(_method->get_methodOop()->constants());
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
246 return CURRENT_ENV->get_constant_by_index(cpool, pool_index, cache_index, _holder);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
247 }
a61af66fc99e Initial load
duke
parents:
diff changeset
248
a61af66fc99e Initial load
duke
parents:
diff changeset
249 // ------------------------------------------------------------------
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
250 // ciBytecodeStream::get_constant_pool_tag
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
251 //
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
252 // If this bytecode is one of the ldc variants, get the referenced
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
253 // constant.
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
254 constantTag ciBytecodeStream::get_constant_pool_tag(int index) const {
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
255 VM_ENTRY_MARK;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
256 return _method->get_methodOop()->constants()->tag_at(index);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
257 }
a61af66fc99e Initial load
duke
parents:
diff changeset
258
a61af66fc99e Initial load
duke
parents:
diff changeset
259 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
260 // ciBytecodeStream::get_field_index
a61af66fc99e Initial load
duke
parents:
diff changeset
261 //
a61af66fc99e Initial load
duke
parents:
diff changeset
262 // If this is a field access bytecode, get the constant pool
a61af66fc99e Initial load
duke
parents:
diff changeset
263 // index of the referenced field.
a61af66fc99e Initial load
duke
parents:
diff changeset
264 int ciBytecodeStream::get_field_index() {
a61af66fc99e Initial load
duke
parents:
diff changeset
265 assert(cur_bc() == Bytecodes::_getfield ||
a61af66fc99e Initial load
duke
parents:
diff changeset
266 cur_bc() == Bytecodes::_putfield ||
a61af66fc99e Initial load
duke
parents:
diff changeset
267 cur_bc() == Bytecodes::_getstatic ||
a61af66fc99e Initial load
duke
parents:
diff changeset
268 cur_bc() == Bytecodes::_putstatic, "wrong bc");
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
269 return get_index_u2_cpcache();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
270 }
a61af66fc99e Initial load
duke
parents:
diff changeset
271
a61af66fc99e Initial load
duke
parents:
diff changeset
272
a61af66fc99e Initial load
duke
parents:
diff changeset
273 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
274 // ciBytecodeStream::get_field
a61af66fc99e Initial load
duke
parents:
diff changeset
275 //
a61af66fc99e Initial load
duke
parents:
diff changeset
276 // If this bytecode is one of get_field, get_static, put_field,
a61af66fc99e Initial load
duke
parents:
diff changeset
277 // or put_static, get the referenced field.
a61af66fc99e Initial load
duke
parents:
diff changeset
278 ciField* ciBytecodeStream::get_field(bool& will_link) {
a61af66fc99e Initial load
duke
parents:
diff changeset
279 ciField* f = CURRENT_ENV->get_field_by_index(_holder, get_field_index());
a61af66fc99e Initial load
duke
parents:
diff changeset
280 will_link = f->will_link(_holder, _bc);
a61af66fc99e Initial load
duke
parents:
diff changeset
281 return f;
a61af66fc99e Initial load
duke
parents:
diff changeset
282 }
a61af66fc99e Initial load
duke
parents:
diff changeset
283
a61af66fc99e Initial load
duke
parents:
diff changeset
284
a61af66fc99e Initial load
duke
parents:
diff changeset
285 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
286 // ciBytecodeStream::get_declared_field_holder
a61af66fc99e Initial load
duke
parents:
diff changeset
287 //
a61af66fc99e Initial load
duke
parents:
diff changeset
288 // Get the declared holder of the currently referenced field.
a61af66fc99e Initial load
duke
parents:
diff changeset
289 //
a61af66fc99e Initial load
duke
parents:
diff changeset
290 // Usage note: the holder() of a ciField class returns the canonical
a61af66fc99e Initial load
duke
parents:
diff changeset
291 // holder of the field, rather than the holder declared in the
a61af66fc99e Initial load
duke
parents:
diff changeset
292 // bytecodes.
a61af66fc99e Initial load
duke
parents:
diff changeset
293 //
a61af66fc99e Initial load
duke
parents:
diff changeset
294 // There is no "will_link" result passed back. The user is responsible
a61af66fc99e Initial load
duke
parents:
diff changeset
295 // for checking linkability when retrieving the associated field.
a61af66fc99e Initial load
duke
parents:
diff changeset
296 ciInstanceKlass* ciBytecodeStream::get_declared_field_holder() {
1138
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
297 VM_ENTRY_MARK;
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
298 constantPoolHandle cpool(_method->get_methodOop()->constants());
0
a61af66fc99e Initial load
duke
parents:
diff changeset
299 int holder_index = get_field_holder_index();
a61af66fc99e Initial load
duke
parents:
diff changeset
300 bool ignore;
1138
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
301 return CURRENT_ENV->get_klass_by_index(cpool, holder_index, ignore, _holder)
0
a61af66fc99e Initial load
duke
parents:
diff changeset
302 ->as_instance_klass();
a61af66fc99e Initial load
duke
parents:
diff changeset
303 }
a61af66fc99e Initial load
duke
parents:
diff changeset
304
a61af66fc99e Initial load
duke
parents:
diff changeset
305 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
306 // ciBytecodeStream::get_field_holder_index
a61af66fc99e Initial load
duke
parents:
diff changeset
307 //
a61af66fc99e Initial load
duke
parents:
diff changeset
308 // Get the constant pool index of the declared holder of the field
a61af66fc99e Initial load
duke
parents:
diff changeset
309 // referenced by the current bytecode. Used for generating
a61af66fc99e Initial load
duke
parents:
diff changeset
310 // deoptimization information.
a61af66fc99e Initial load
duke
parents:
diff changeset
311 int ciBytecodeStream::get_field_holder_index() {
1138
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
312 GUARDED_VM_ENTRY(
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
313 constantPoolOop cpool = _holder->get_instanceKlass()->constants();
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
314 return cpool->klass_ref_index_at(get_field_index());
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
315 )
0
a61af66fc99e Initial load
duke
parents:
diff changeset
316 }
a61af66fc99e Initial load
duke
parents:
diff changeset
317
a61af66fc99e Initial load
duke
parents:
diff changeset
318 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
319 // ciBytecodeStream::get_field_signature_index
a61af66fc99e Initial load
duke
parents:
diff changeset
320 //
a61af66fc99e Initial load
duke
parents:
diff changeset
321 // Get the constant pool index of the signature of the field
a61af66fc99e Initial load
duke
parents:
diff changeset
322 // referenced by the current bytecode. Used for generating
a61af66fc99e Initial load
duke
parents:
diff changeset
323 // deoptimization information.
a61af66fc99e Initial load
duke
parents:
diff changeset
324 int ciBytecodeStream::get_field_signature_index() {
a61af66fc99e Initial load
duke
parents:
diff changeset
325 VM_ENTRY_MARK;
a61af66fc99e Initial load
duke
parents:
diff changeset
326 constantPoolOop cpool = _holder->get_instanceKlass()->constants();
a61af66fc99e Initial load
duke
parents:
diff changeset
327 int nt_index = cpool->name_and_type_ref_index_at(get_field_index());
a61af66fc99e Initial load
duke
parents:
diff changeset
328 return cpool->signature_ref_index_at(nt_index);
a61af66fc99e Initial load
duke
parents:
diff changeset
329 }
a61af66fc99e Initial load
duke
parents:
diff changeset
330
a61af66fc99e Initial load
duke
parents:
diff changeset
331 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
332 // ciBytecodeStream::get_method_index
a61af66fc99e Initial load
duke
parents:
diff changeset
333 //
a61af66fc99e Initial load
duke
parents:
diff changeset
334 // If this is a method invocation bytecode, get the constant pool
a61af66fc99e Initial load
duke
parents:
diff changeset
335 // index of the invoked method.
a61af66fc99e Initial load
duke
parents:
diff changeset
336 int ciBytecodeStream::get_method_index() {
726
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 0
diff changeset
337 #ifdef ASSERT
0
a61af66fc99e Initial load
duke
parents:
diff changeset
338 switch (cur_bc()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
339 case Bytecodes::_invokeinterface:
a61af66fc99e Initial load
duke
parents:
diff changeset
340 case Bytecodes::_invokevirtual:
a61af66fc99e Initial load
duke
parents:
diff changeset
341 case Bytecodes::_invokespecial:
a61af66fc99e Initial load
duke
parents:
diff changeset
342 case Bytecodes::_invokestatic:
726
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 0
diff changeset
343 case Bytecodes::_invokedynamic:
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 0
diff changeset
344 break;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
345 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
346 ShouldNotReachHere();
a61af66fc99e Initial load
duke
parents:
diff changeset
347 }
726
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 0
diff changeset
348 #endif
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
349 if (has_index_u4())
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
350 return get_index_u4(); // invokedynamic
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 1138
diff changeset
351 return get_index_u2_cpcache();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
352 }
a61af66fc99e Initial load
duke
parents:
diff changeset
353
a61af66fc99e Initial load
duke
parents:
diff changeset
354 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
355 // ciBytecodeStream::get_method
a61af66fc99e Initial load
duke
parents:
diff changeset
356 //
a61af66fc99e Initial load
duke
parents:
diff changeset
357 // If this is a method invocation bytecode, get the invoked method.
a61af66fc99e Initial load
duke
parents:
diff changeset
358 ciMethod* ciBytecodeStream::get_method(bool& will_link) {
1138
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
359 VM_ENTRY_MARK;
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
360 constantPoolHandle cpool(_method->get_methodOop()->constants());
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
361 ciMethod* m = CURRENT_ENV->get_method_by_index(cpool, get_method_index(), cur_bc(), _holder);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
362 will_link = m->is_loaded();
a61af66fc99e Initial load
duke
parents:
diff changeset
363 return m;
a61af66fc99e Initial load
duke
parents:
diff changeset
364 }
a61af66fc99e Initial load
duke
parents:
diff changeset
365
a61af66fc99e Initial load
duke
parents:
diff changeset
366 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
367 // ciBytecodeStream::get_declared_method_holder
a61af66fc99e Initial load
duke
parents:
diff changeset
368 //
a61af66fc99e Initial load
duke
parents:
diff changeset
369 // Get the declared holder of the currently referenced method.
a61af66fc99e Initial load
duke
parents:
diff changeset
370 //
a61af66fc99e Initial load
duke
parents:
diff changeset
371 // Usage note: the holder() of a ciMethod class returns the canonical
a61af66fc99e Initial load
duke
parents:
diff changeset
372 // holder of the method, rather than the holder declared in the
a61af66fc99e Initial load
duke
parents:
diff changeset
373 // bytecodes.
a61af66fc99e Initial load
duke
parents:
diff changeset
374 //
a61af66fc99e Initial load
duke
parents:
diff changeset
375 // There is no "will_link" result passed back. The user is responsible
a61af66fc99e Initial load
duke
parents:
diff changeset
376 // for checking linkability when retrieving the associated method.
a61af66fc99e Initial load
duke
parents:
diff changeset
377 ciKlass* ciBytecodeStream::get_declared_method_holder() {
1138
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
378 VM_ENTRY_MARK;
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
379 constantPoolHandle cpool(_method->get_methodOop()->constants());
0
a61af66fc99e Initial load
duke
parents:
diff changeset
380 bool ignore;
1135
e66fd840cb6b 6893081: method handle & invokedynamic code needs additional cleanup (post 6815692, 6858164)
twisti
parents: 844
diff changeset
381 // report as InvokeDynamic for invokedynamic, which is syntactically classless
726
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 0
diff changeset
382 if (cur_bc() == Bytecodes::_invokedynamic)
2357
8033953d67ff 7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents: 1972
diff changeset
383 return CURRENT_ENV->get_klass_by_name(_holder, ciSymbol::java_lang_invoke_InvokeDynamic(), false);
1138
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
384 return CURRENT_ENV->get_klass_by_index(cpool, get_method_holder_index(), ignore, _holder);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
385 }
a61af66fc99e Initial load
duke
parents:
diff changeset
386
a61af66fc99e Initial load
duke
parents:
diff changeset
387 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
388 // ciBytecodeStream::get_method_holder_index
a61af66fc99e Initial load
duke
parents:
diff changeset
389 //
a61af66fc99e Initial load
duke
parents:
diff changeset
390 // Get the constant pool index of the declared holder of the method
a61af66fc99e Initial load
duke
parents:
diff changeset
391 // referenced by the current bytecode. Used for generating
a61af66fc99e Initial load
duke
parents:
diff changeset
392 // deoptimization information.
a61af66fc99e Initial load
duke
parents:
diff changeset
393 int ciBytecodeStream::get_method_holder_index() {
1138
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
394 constantPoolOop cpool = _method->get_methodOop()->constants();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
395 return cpool->klass_ref_index_at(get_method_index());
a61af66fc99e Initial load
duke
parents:
diff changeset
396 }
a61af66fc99e Initial load
duke
parents:
diff changeset
397
a61af66fc99e Initial load
duke
parents:
diff changeset
398 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
399 // ciBytecodeStream::get_method_signature_index
a61af66fc99e Initial load
duke
parents:
diff changeset
400 //
a61af66fc99e Initial load
duke
parents:
diff changeset
401 // Get the constant pool index of the signature of the method
a61af66fc99e Initial load
duke
parents:
diff changeset
402 // referenced by the current bytecode. Used for generating
a61af66fc99e Initial load
duke
parents:
diff changeset
403 // deoptimization information.
a61af66fc99e Initial load
duke
parents:
diff changeset
404 int ciBytecodeStream::get_method_signature_index() {
a61af66fc99e Initial load
duke
parents:
diff changeset
405 VM_ENTRY_MARK;
a61af66fc99e Initial load
duke
parents:
diff changeset
406 constantPoolOop cpool = _holder->get_instanceKlass()->constants();
a61af66fc99e Initial load
duke
parents:
diff changeset
407 int method_index = get_method_index();
a61af66fc99e Initial load
duke
parents:
diff changeset
408 int name_and_type_index = cpool->name_and_type_ref_index_at(method_index);
a61af66fc99e Initial load
duke
parents:
diff changeset
409 return cpool->signature_ref_index_at(name_and_type_index);
a61af66fc99e Initial load
duke
parents:
diff changeset
410 }
1137
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 1135
diff changeset
411
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 1135
diff changeset
412 // ------------------------------------------------------------------
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 1135
diff changeset
413 // ciBytecodeStream::get_cpcache
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
414 ciCPCache* ciBytecodeStream::get_cpcache() const {
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
415 if (_cpcache == NULL) {
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
416 VM_ENTRY_MARK;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
417 // Get the constant pool.
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
418 constantPoolOop cpool = _holder->get_instanceKlass()->constants();
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
419 constantPoolCacheOop cpcache = cpool->cache();
1137
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 1135
diff changeset
420
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
421 *(ciCPCache**)&_cpcache = CURRENT_ENV->get_object(cpcache)->as_cpcache();
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
422 }
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
423 return _cpcache;
1137
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 1135
diff changeset
424 }
1138
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
425
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
426 // ------------------------------------------------------------------
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
427 // ciBytecodeStream::get_call_site
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
428 ciCallSite* ciBytecodeStream::get_call_site() {
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
429 VM_ENTRY_MARK;
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
430 // Get the constant pool.
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
431 constantPoolOop cpool = _holder->get_instanceKlass()->constants();
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
432 constantPoolCacheOop cpcache = cpool->cache();
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
433
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
434 // Get the CallSite from the constant pool cache.
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
435 int method_index = get_method_index();
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
436 ConstantPoolCacheEntry* cpcache_entry = cpcache->secondary_entry_at(method_index);
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
437 oop call_site_oop = cpcache_entry->f1();
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
438
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
439 // Create a CallSite object and return it.
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
440 return CURRENT_ENV->get_object(call_site_oop)->as_call_site();
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
441 }