src/share/vm/opto/graphKit.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/graphKit.cpp	Wed Jan 29 22:25:45 2014
--- new/src/share/vm/opto/graphKit.cpp	Wed Jan 29 22:25:44 2014

*** 2997,3006 **** --- 2997,3011 ---- region->del_req(_null_path); phi ->del_req(_null_path); } Node* cast_obj = NULL; + if (tk->klass_is_exact()) { + // The following optimization tries to statically cast the speculative type of the object + // (for example obtained during profiling) to the type of the superklass and then do a + // dynamic check that the type of the object is what we expect. To work correctly + // for checkcast and aastore the type of superklass should be exact. const TypeOopPtr* obj_type = _gvn.type(obj)->is_oopptr(); // We may not have profiling here or it may not help us. If we have // a speculative type use it to perform an exact cast. ciKlass* spec_obj_type = obj_type->speculative_type(); if (spec_obj_type != NULL ||
*** 3015,3024 **** --- 3020,3030 ---- (*failure_control) = top(); // adjust the type of the phi to the exact klass: phi->raise_bottom_type(_gvn.type(cast_obj)->meet_speculative(TypePtr::NULL_PTR)); } } + } if (cast_obj == NULL) { // Load the object's klass Node* obj_klass = load_object_klass(not_null_obj);

src/share/vm/opto/graphKit.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File