1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/vm/opto/parseHelper.cpp Sat Dec 01 00:00:00 2007 +0000 1.3 @@ -0,0 +1,520 @@ 1.4 +/* 1.5 + * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. 1.11 + * 1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 + * version 2 for more details (a copy is included in the LICENSE file that 1.16 + * accompanied this code). 1.17 + * 1.18 + * You should have received a copy of the GNU General Public License version 1.19 + * 2 along with this work; if not, write to the Free Software Foundation, 1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 + * 1.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 1.24 + * have any questions. 1.25 + * 1.26 + */ 1.27 + 1.28 +#include "incls/_precompiled.incl" 1.29 +#include "incls/_parseHelper.cpp.incl" 1.30 + 1.31 +//------------------------------make_dtrace_method_entry_exit ---------------- 1.32 +// Dtrace -- record entry or exit of a method if compiled with dtrace support 1.33 +void GraphKit::make_dtrace_method_entry_exit(ciMethod* method, bool is_entry) { 1.34 + const TypeFunc *call_type = OptoRuntime::dtrace_method_entry_exit_Type(); 1.35 + address call_address = is_entry ? CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry) : 1.36 + CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit); 1.37 + const char *call_name = is_entry ? "dtrace_method_entry" : "dtrace_method_exit"; 1.38 + 1.39 + // Get base of thread-local storage area 1.40 + Node* thread = _gvn.transform( new (C, 1) ThreadLocalNode() ); 1.41 + 1.42 + // Get method 1.43 + const TypeInstPtr* method_type = TypeInstPtr::make(TypePtr::Constant, method->klass(), true, method, 0); 1.44 + Node *method_node = _gvn.transform( new (C, 1) ConPNode(method_type) ); 1.45 + 1.46 + kill_dead_locals(); 1.47 + 1.48 + // For some reason, this call reads only raw memory. 1.49 + const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM; 1.50 + make_runtime_call(RC_LEAF | RC_NARROW_MEM, 1.51 + call_type, call_address, 1.52 + call_name, raw_adr_type, 1.53 + thread, method_node); 1.54 +} 1.55 + 1.56 + 1.57 +//============================================================================= 1.58 +//------------------------------do_checkcast----------------------------------- 1.59 +void Parse::do_checkcast() { 1.60 + bool will_link; 1.61 + ciKlass* klass = iter().get_klass(will_link); 1.62 + 1.63 + Node *obj = peek(); 1.64 + 1.65 + // Throw uncommon trap if class is not loaded or the value we are casting 1.66 + // _from_ is not loaded, and value is not null. If the value _is_ NULL, 1.67 + // then the checkcast does nothing. 1.68 + const TypeInstPtr *tp = _gvn.type(obj)->isa_instptr(); 1.69 + if (!will_link || (tp && !tp->is_loaded())) { 1.70 + if (C->log() != NULL) { 1.71 + if (!will_link) { 1.72 + C->log()->elem("assert_null reason='checkcast' klass='%d'", 1.73 + C->log()->identify(klass)); 1.74 + } 1.75 + if (tp && !tp->is_loaded()) { 1.76 + // %%% Cannot happen? 1.77 + C->log()->elem("assert_null reason='checkcast source' klass='%d'", 1.78 + C->log()->identify(tp->klass())); 1.79 + } 1.80 + } 1.81 + do_null_assert(obj, T_OBJECT); 1.82 + assert( stopped() || _gvn.type(peek())->higher_equal(TypePtr::NULL_PTR), "what's left behind is null" ); 1.83 + if (!stopped()) { 1.84 + profile_null_checkcast(); 1.85 + } 1.86 + return; 1.87 + } 1.88 + 1.89 + Node *res = gen_checkcast(obj, makecon(TypeKlassPtr::make(klass)) ); 1.90 + 1.91 + // Pop from stack AFTER gen_checkcast because it can uncommon trap and 1.92 + // the debug info has to be correct. 1.93 + pop(); 1.94 + push(res); 1.95 +} 1.96 + 1.97 + 1.98 +//------------------------------do_instanceof---------------------------------- 1.99 +void Parse::do_instanceof() { 1.100 + if (stopped()) return; 1.101 + // We would like to return false if class is not loaded, emitting a 1.102 + // dependency, but Java requires instanceof to load its operand. 1.103 + 1.104 + // Throw uncommon trap if class is not loaded 1.105 + bool will_link; 1.106 + ciKlass* klass = iter().get_klass(will_link); 1.107 + 1.108 + if (!will_link) { 1.109 + if (C->log() != NULL) { 1.110 + C->log()->elem("assert_null reason='instanceof' klass='%d'", 1.111 + C->log()->identify(klass)); 1.112 + } 1.113 + do_null_assert(peek(), T_OBJECT); 1.114 + assert( stopped() || _gvn.type(peek())->higher_equal(TypePtr::NULL_PTR), "what's left behind is null" ); 1.115 + if (!stopped()) { 1.116 + // The object is now known to be null. 1.117 + // Shortcut the effect of gen_instanceof and return "false" directly. 1.118 + pop(); // pop the null 1.119 + push(_gvn.intcon(0)); // push false answer 1.120 + } 1.121 + return; 1.122 + } 1.123 + 1.124 + // Push the bool result back on stack 1.125 + push( gen_instanceof( pop(), makecon(TypeKlassPtr::make(klass)) ) ); 1.126 +} 1.127 + 1.128 +//------------------------------array_store_check------------------------------ 1.129 +// pull array from stack and check that the store is valid 1.130 +void Parse::array_store_check() { 1.131 + 1.132 + // Shorthand access to array store elements 1.133 + Node *obj = stack(_sp-1); 1.134 + Node *idx = stack(_sp-2); 1.135 + Node *ary = stack(_sp-3); 1.136 + 1.137 + if (_gvn.type(obj) == TypePtr::NULL_PTR) { 1.138 + // There's never a type check on null values. 1.139 + // This cutout lets us avoid the uncommon_trap(Reason_array_check) 1.140 + // below, which turns into a performance liability if the 1.141 + // gen_checkcast folds up completely. 1.142 + return; 1.143 + } 1.144 + 1.145 + // Extract the array klass type 1.146 + int klass_offset = oopDesc::klass_offset_in_bytes(); 1.147 + Node* p = basic_plus_adr( ary, ary, klass_offset ); 1.148 + // p's type is array-of-OOPS plus klass_offset 1.149 + Node* array_klass = _gvn.transform(new (C, 3) LoadKlassNode(0, immutable_memory(), p, TypeInstPtr::KLASS)); 1.150 + // Get the array klass 1.151 + const TypeKlassPtr *tak = _gvn.type(array_klass)->is_klassptr(); 1.152 + 1.153 + // array_klass's type is generally INexact array-of-oop. Heroically 1.154 + // cast the array klass to EXACT array and uncommon-trap if the cast 1.155 + // fails. 1.156 + bool always_see_exact_class = false; 1.157 + if (MonomorphicArrayCheck 1.158 + && !too_many_traps(Deoptimization::Reason_array_check)) { 1.159 + always_see_exact_class = true; 1.160 + // (If no MDO at all, hope for the best, until a trap actually occurs.) 1.161 + } 1.162 + 1.163 + // Is the array klass is exactly its defined type? 1.164 + if (always_see_exact_class && !tak->klass_is_exact()) { 1.165 + // Make a constant out of the inexact array klass 1.166 + const TypeKlassPtr *extak = tak->cast_to_exactness(true)->is_klassptr(); 1.167 + Node* con = makecon(extak); 1.168 + Node* cmp = _gvn.transform(new (C, 3) CmpPNode( array_klass, con )); 1.169 + Node* bol = _gvn.transform(new (C, 2) BoolNode( cmp, BoolTest::eq )); 1.170 + Node* ctrl= control(); 1.171 + { BuildCutout unless(this, bol, PROB_MAX); 1.172 + uncommon_trap(Deoptimization::Reason_array_check, 1.173 + Deoptimization::Action_maybe_recompile, 1.174 + tak->klass()); 1.175 + } 1.176 + if (stopped()) { // MUST uncommon-trap? 1.177 + set_control(ctrl); // Then Don't Do It, just fall into the normal checking 1.178 + } else { // Cast array klass to exactness: 1.179 + // Use the exact constant value we know it is. 1.180 + replace_in_map(array_klass,con); 1.181 + CompileLog* log = C->log(); 1.182 + if (log != NULL) { 1.183 + log->elem("cast_up reason='monomorphic_array' from='%d' to='(exact)'", 1.184 + log->identify(tak->klass())); 1.185 + } 1.186 + array_klass = con; // Use cast value moving forward 1.187 + } 1.188 + } 1.189 + 1.190 + // Come here for polymorphic array klasses 1.191 + 1.192 + // Extract the array element class 1.193 + int element_klass_offset = objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc); 1.194 + Node *p2 = basic_plus_adr(array_klass, array_klass, element_klass_offset); 1.195 + Node *a_e_klass = _gvn.transform(new (C, 3) LoadKlassNode(0, immutable_memory(), p2, tak)); 1.196 + 1.197 + // Check (the hard way) and throw if not a subklass. 1.198 + // Result is ignored, we just need the CFG effects. 1.199 + gen_checkcast( obj, a_e_klass ); 1.200 +} 1.201 + 1.202 + 1.203 +//------------------------------do_new----------------------------------------- 1.204 +void Parse::do_new() { 1.205 + kill_dead_locals(); 1.206 + 1.207 + bool will_link; 1.208 + ciInstanceKlass* klass = iter().get_klass(will_link)->as_instance_klass(); 1.209 + assert(will_link, "_new: typeflow responsibility"); 1.210 + 1.211 + // Should initialize, or throw an InstantiationError? 1.212 + if (!klass->is_initialized() || 1.213 + klass->is_abstract() || klass->is_interface() || 1.214 + klass->name() == ciSymbol::java_lang_Class() || 1.215 + iter().is_unresolved_klass()) { 1.216 + uncommon_trap(Deoptimization::Reason_uninitialized, 1.217 + Deoptimization::Action_reinterpret, 1.218 + klass); 1.219 + return; 1.220 + } 1.221 + 1.222 + Node* kls = makecon(TypeKlassPtr::make(klass)); 1.223 + Node* obj = new_instance(kls); 1.224 + 1.225 + // Push resultant oop onto stack 1.226 + push(obj); 1.227 +} 1.228 + 1.229 +#ifndef PRODUCT 1.230 +//------------------------------dump_map_adr_mem------------------------------- 1.231 +// Debug dump of the mapping from address types to MergeMemNode indices. 1.232 +void Parse::dump_map_adr_mem() const { 1.233 + tty->print_cr("--- Mapping from address types to memory Nodes ---"); 1.234 + MergeMemNode *mem = map() == NULL ? NULL : (map()->memory()->is_MergeMem() ? 1.235 + map()->memory()->as_MergeMem() : NULL); 1.236 + for (uint i = 0; i < (uint)C->num_alias_types(); i++) { 1.237 + C->alias_type(i)->print_on(tty); 1.238 + tty->print("\t"); 1.239 + // Node mapping, if any 1.240 + if (mem && i < mem->req() && mem->in(i) && mem->in(i) != mem->empty_memory()) { 1.241 + mem->in(i)->dump(); 1.242 + } else { 1.243 + tty->cr(); 1.244 + } 1.245 + } 1.246 +} 1.247 + 1.248 +#endif 1.249 + 1.250 + 1.251 +//============================================================================= 1.252 +// 1.253 +// parser methods for profiling 1.254 + 1.255 + 1.256 +//----------------------test_counter_against_threshold ------------------------ 1.257 +void Parse::test_counter_against_threshold(Node* cnt, int limit) { 1.258 + // Test the counter against the limit and uncommon trap if greater. 1.259 + 1.260 + // This code is largely copied from the range check code in 1.261 + // array_addressing() 1.262 + 1.263 + // Test invocation count vs threshold 1.264 + Node *threshold = makecon(TypeInt::make(limit)); 1.265 + Node *chk = _gvn.transform( new (C, 3) CmpUNode( cnt, threshold) ); 1.266 + BoolTest::mask btest = BoolTest::lt; 1.267 + Node *tst = _gvn.transform( new (C, 2) BoolNode( chk, btest) ); 1.268 + // Branch to failure if threshold exceeded 1.269 + { BuildCutout unless(this, tst, PROB_ALWAYS); 1.270 + uncommon_trap(Deoptimization::Reason_age, 1.271 + Deoptimization::Action_maybe_recompile); 1.272 + } 1.273 +} 1.274 + 1.275 +//----------------------increment_and_test_invocation_counter------------------- 1.276 +void Parse::increment_and_test_invocation_counter(int limit) { 1.277 + if (!count_invocations()) return; 1.278 + 1.279 + // Get the methodOop node. 1.280 + const TypePtr* adr_type = TypeOopPtr::make_from_constant(method()); 1.281 + Node *methodOop_node = makecon(adr_type); 1.282 + 1.283 + // Load the interpreter_invocation_counter from the methodOop. 1.284 + int offset = methodOopDesc::interpreter_invocation_counter_offset_in_bytes(); 1.285 + Node* adr_node = basic_plus_adr(methodOop_node, methodOop_node, offset); 1.286 + Node* cnt = make_load(NULL, adr_node, TypeInt::INT, T_INT, adr_type); 1.287 + 1.288 + test_counter_against_threshold(cnt, limit); 1.289 + 1.290 + // Add one to the counter and store 1.291 + Node* incr = _gvn.transform(new (C, 3) AddINode(cnt, _gvn.intcon(1))); 1.292 + store_to_memory( NULL, adr_node, incr, T_INT, adr_type ); 1.293 +} 1.294 + 1.295 +//----------------------------method_data_addressing--------------------------- 1.296 +Node* Parse::method_data_addressing(ciMethodData* md, ciProfileData* data, ByteSize counter_offset, Node* idx, uint stride) { 1.297 + // Get offset within methodDataOop of the data array 1.298 + ByteSize data_offset = methodDataOopDesc::data_offset(); 1.299 + 1.300 + // Get cell offset of the ProfileData within data array 1.301 + int cell_offset = md->dp_to_di(data->dp()); 1.302 + 1.303 + // Add in counter_offset, the # of bytes into the ProfileData of counter or flag 1.304 + int offset = in_bytes(data_offset) + cell_offset + in_bytes(counter_offset); 1.305 + 1.306 + const TypePtr* adr_type = TypeOopPtr::make_from_constant(md); 1.307 + Node* mdo = makecon(adr_type); 1.308 + Node* ptr = basic_plus_adr(mdo, mdo, offset); 1.309 + 1.310 + if (stride != 0) { 1.311 + Node* str = _gvn.MakeConX(stride); 1.312 + Node* scale = _gvn.transform( new (C, 3) MulXNode( idx, str ) ); 1.313 + ptr = _gvn.transform( new (C, 4) AddPNode( mdo, ptr, scale ) ); 1.314 + } 1.315 + 1.316 + return ptr; 1.317 +} 1.318 + 1.319 +//--------------------------increment_md_counter_at---------------------------- 1.320 +void Parse::increment_md_counter_at(ciMethodData* md, ciProfileData* data, ByteSize counter_offset, Node* idx, uint stride) { 1.321 + Node* adr_node = method_data_addressing(md, data, counter_offset, idx, stride); 1.322 + 1.323 + const TypePtr* adr_type = _gvn.type(adr_node)->is_ptr(); 1.324 + Node* cnt = make_load(NULL, adr_node, TypeInt::INT, T_INT, adr_type); 1.325 + Node* incr = _gvn.transform(new (C, 3) AddINode(cnt, _gvn.intcon(DataLayout::counter_increment))); 1.326 + store_to_memory(NULL, adr_node, incr, T_INT, adr_type ); 1.327 +} 1.328 + 1.329 +//--------------------------test_for_osr_md_counter_at------------------------- 1.330 +void Parse::test_for_osr_md_counter_at(ciMethodData* md, ciProfileData* data, ByteSize counter_offset, int limit) { 1.331 + Node* adr_node = method_data_addressing(md, data, counter_offset); 1.332 + 1.333 + const TypePtr* adr_type = _gvn.type(adr_node)->is_ptr(); 1.334 + Node* cnt = make_load(NULL, adr_node, TypeInt::INT, T_INT, adr_type); 1.335 + 1.336 + test_counter_against_threshold(cnt, limit); 1.337 +} 1.338 + 1.339 +//-------------------------------set_md_flag_at-------------------------------- 1.340 +void Parse::set_md_flag_at(ciMethodData* md, ciProfileData* data, int flag_constant) { 1.341 + Node* adr_node = method_data_addressing(md, data, DataLayout::flags_offset()); 1.342 + 1.343 + const TypePtr* adr_type = _gvn.type(adr_node)->is_ptr(); 1.344 + Node* flags = make_load(NULL, adr_node, TypeInt::BYTE, T_BYTE, adr_type); 1.345 + Node* incr = _gvn.transform(new (C, 3) OrINode(flags, _gvn.intcon(flag_constant))); 1.346 + store_to_memory(NULL, adr_node, incr, T_BYTE, adr_type); 1.347 +} 1.348 + 1.349 +//----------------------------profile_taken_branch----------------------------- 1.350 +void Parse::profile_taken_branch(int target_bci, bool force_update) { 1.351 + // This is a potential osr_site if we have a backedge. 1.352 + int cur_bci = bci(); 1.353 + bool osr_site = 1.354 + (target_bci <= cur_bci) && count_invocations() && UseOnStackReplacement; 1.355 + 1.356 + // If we are going to OSR, restart at the target bytecode. 1.357 + set_bci(target_bci); 1.358 + 1.359 + // To do: factor out the the limit calculations below. These duplicate 1.360 + // the similar limit calculations in the interpreter. 1.361 + 1.362 + if (method_data_update() || force_update) { 1.363 + ciMethodData* md = method()->method_data(); 1.364 + assert(md != NULL, "expected valid ciMethodData"); 1.365 + ciProfileData* data = md->bci_to_data(cur_bci); 1.366 + assert(data->is_JumpData(), "need JumpData for taken branch"); 1.367 + increment_md_counter_at(md, data, JumpData::taken_offset()); 1.368 + } 1.369 + 1.370 + // In the new tiered system this is all we need to do. In the old 1.371 + // (c2 based) tiered sytem we must do the code below. 1.372 +#ifndef TIERED 1.373 + if (method_data_update()) { 1.374 + ciMethodData* md = method()->method_data(); 1.375 + if (osr_site) { 1.376 + ciProfileData* data = md->bci_to_data(cur_bci); 1.377 + int limit = (CompileThreshold 1.378 + * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100; 1.379 + test_for_osr_md_counter_at(md, data, JumpData::taken_offset(), limit); 1.380 + } 1.381 + } else { 1.382 + // With method data update off, use the invocation counter to trigger an 1.383 + // OSR compilation, as done in the interpreter. 1.384 + if (osr_site) { 1.385 + int limit = (CompileThreshold * OnStackReplacePercentage) / 100; 1.386 + increment_and_test_invocation_counter(limit); 1.387 + } 1.388 + } 1.389 +#endif // TIERED 1.390 + 1.391 + // Restore the original bytecode. 1.392 + set_bci(cur_bci); 1.393 +} 1.394 + 1.395 +//--------------------------profile_not_taken_branch--------------------------- 1.396 +void Parse::profile_not_taken_branch(bool force_update) { 1.397 + 1.398 + if (method_data_update() || force_update) { 1.399 + ciMethodData* md = method()->method_data(); 1.400 + assert(md != NULL, "expected valid ciMethodData"); 1.401 + ciProfileData* data = md->bci_to_data(bci()); 1.402 + assert(data->is_BranchData(), "need BranchData for not taken branch"); 1.403 + increment_md_counter_at(md, data, BranchData::not_taken_offset()); 1.404 + } 1.405 + 1.406 +} 1.407 + 1.408 +//---------------------------------profile_call-------------------------------- 1.409 +void Parse::profile_call(Node* receiver) { 1.410 + if (!method_data_update()) return; 1.411 + 1.412 + profile_generic_call(); 1.413 + 1.414 + switch (bc()) { 1.415 + case Bytecodes::_invokevirtual: 1.416 + case Bytecodes::_invokeinterface: 1.417 + profile_receiver_type(receiver); 1.418 + break; 1.419 + case Bytecodes::_invokestatic: 1.420 + case Bytecodes::_invokespecial: 1.421 + break; 1.422 + default: fatal("unexpected call bytecode"); 1.423 + } 1.424 +} 1.425 + 1.426 +//------------------------------profile_generic_call--------------------------- 1.427 +void Parse::profile_generic_call() { 1.428 + assert(method_data_update(), "must be generating profile code"); 1.429 + 1.430 + ciMethodData* md = method()->method_data(); 1.431 + assert(md != NULL, "expected valid ciMethodData"); 1.432 + ciProfileData* data = md->bci_to_data(bci()); 1.433 + assert(data->is_CounterData(), "need CounterData for not taken branch"); 1.434 + increment_md_counter_at(md, data, CounterData::count_offset()); 1.435 +} 1.436 + 1.437 +//-----------------------------profile_receiver_type--------------------------- 1.438 +void Parse::profile_receiver_type(Node* receiver) { 1.439 + assert(method_data_update(), "must be generating profile code"); 1.440 + 1.441 + // Skip if we aren't tracking receivers 1.442 + if (TypeProfileWidth < 1) return; 1.443 + 1.444 + ciMethodData* md = method()->method_data(); 1.445 + assert(md != NULL, "expected valid ciMethodData"); 1.446 + ciProfileData* data = md->bci_to_data(bci()); 1.447 + assert(data->is_ReceiverTypeData(), "need ReceiverTypeData here"); 1.448 + ciReceiverTypeData* rdata = (ciReceiverTypeData*)data->as_ReceiverTypeData(); 1.449 + 1.450 + Node* method_data = method_data_addressing(md, rdata, in_ByteSize(0)); 1.451 + 1.452 + // Using an adr_type of TypePtr::BOTTOM to work around anti-dep problems. 1.453 + // A better solution might be to use TypeRawPtr::BOTTOM with RC_NARROW_MEM. 1.454 + make_runtime_call(RC_LEAF, OptoRuntime::profile_receiver_type_Type(), 1.455 + CAST_FROM_FN_PTR(address, 1.456 + OptoRuntime::profile_receiver_type_C), 1.457 + "profile_receiver_type_C", 1.458 + TypePtr::BOTTOM, 1.459 + method_data, receiver); 1.460 +} 1.461 + 1.462 +//---------------------------------profile_ret--------------------------------- 1.463 +void Parse::profile_ret(int target_bci) { 1.464 + if (!method_data_update()) return; 1.465 + 1.466 + // Skip if we aren't tracking ret targets 1.467 + if (TypeProfileWidth < 1) return; 1.468 + 1.469 + ciMethodData* md = method()->method_data(); 1.470 + assert(md != NULL, "expected valid ciMethodData"); 1.471 + ciProfileData* data = md->bci_to_data(bci()); 1.472 + assert(data->is_RetData(), "need RetData for ret"); 1.473 + ciRetData* ret_data = (ciRetData*)data->as_RetData(); 1.474 + 1.475 + // Look for the target_bci is already in the table 1.476 + uint row; 1.477 + bool table_full = true; 1.478 + for (row = 0; row < ret_data->row_limit(); row++) { 1.479 + int key = ret_data->bci(row); 1.480 + table_full &= (key != RetData::no_bci); 1.481 + if (key == target_bci) break; 1.482 + } 1.483 + 1.484 + if (row >= ret_data->row_limit()) { 1.485 + // The target_bci was not found in the table. 1.486 + if (!table_full) { 1.487 + // XXX: Make slow call to update RetData 1.488 + } 1.489 + return; 1.490 + } 1.491 + 1.492 + // the target_bci is already in the table 1.493 + increment_md_counter_at(md, data, RetData::bci_count_offset(row)); 1.494 +} 1.495 + 1.496 +//--------------------------profile_null_checkcast---------------------------- 1.497 +void Parse::profile_null_checkcast() { 1.498 + // Set the null-seen flag, done in conjunction with the usual null check. We 1.499 + // never unset the flag, so this is a one-way switch. 1.500 + if (!method_data_update()) return; 1.501 + 1.502 + ciMethodData* md = method()->method_data(); 1.503 + assert(md != NULL, "expected valid ciMethodData"); 1.504 + ciProfileData* data = md->bci_to_data(bci()); 1.505 + assert(data->is_BitData(), "need BitData for checkcast"); 1.506 + set_md_flag_at(md, data, BitData::null_seen_byte_constant()); 1.507 +} 1.508 + 1.509 +//-----------------------------profile_switch_case----------------------------- 1.510 +void Parse::profile_switch_case(int table_index) { 1.511 + if (!method_data_update()) return; 1.512 + 1.513 + ciMethodData* md = method()->method_data(); 1.514 + assert(md != NULL, "expected valid ciMethodData"); 1.515 + 1.516 + ciProfileData* data = md->bci_to_data(bci()); 1.517 + assert(data->is_MultiBranchData(), "need MultiBranchData for switch case"); 1.518 + if (table_index >= 0) { 1.519 + increment_md_counter_at(md, data, MultiBranchData::case_count_offset(table_index)); 1.520 + } else { 1.521 + increment_md_counter_at(md, data, MultiBranchData::default_count_offset()); 1.522 + } 1.523 +}