Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/graphKit.cpp @ 14726:92aa6797d639
Backed out merge changeset: b51e29501f30
Backed out merge revision to its first parent (8f483e200405)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 24 Mar 2014 21:30:43 +0100 |
parents | b51e29501f30 |
children |
comparison
equal
deleted
inserted
replaced
14719:0bdd0d157040 | 14726:92aa6797d639 |
---|---|
3005 region->del_req(_null_path); | 3005 region->del_req(_null_path); |
3006 phi ->del_req(_null_path); | 3006 phi ->del_req(_null_path); |
3007 } | 3007 } |
3008 | 3008 |
3009 Node* cast_obj = NULL; | 3009 Node* cast_obj = NULL; |
3010 if (tk->klass_is_exact()) { | 3010 const TypeOopPtr* obj_type = _gvn.type(obj)->is_oopptr(); |
3011 // The following optimization tries to statically cast the speculative type of the object | 3011 // We may not have profiling here or it may not help us. If we have |
3012 // (for example obtained during profiling) to the type of the superklass and then do a | 3012 // a speculative type use it to perform an exact cast. |
3013 // dynamic check that the type of the object is what we expect. To work correctly | 3013 ciKlass* spec_obj_type = obj_type->speculative_type(); |
3014 // for checkcast and aastore the type of superklass should be exact. | 3014 if (spec_obj_type != NULL || |
3015 const TypeOopPtr* obj_type = _gvn.type(obj)->is_oopptr(); | 3015 (data != NULL && |
3016 // We may not have profiling here or it may not help us. If we have | 3016 // Counter has never been decremented (due to cast failure). |
3017 // a speculative type use it to perform an exact cast. | 3017 // ...This is a reasonable thing to expect. It is true of |
3018 ciKlass* spec_obj_type = obj_type->speculative_type(); | 3018 // all casts inserted by javac to implement generic types. |
3019 if (spec_obj_type != NULL || | 3019 data->as_CounterData()->count() >= 0)) { |
3020 (data != NULL && | 3020 cast_obj = maybe_cast_profiled_receiver(not_null_obj, tk->klass(), spec_obj_type, safe_for_replace); |
3021 // Counter has never been decremented (due to cast failure). | 3021 if (cast_obj != NULL) { |
3022 // ...This is a reasonable thing to expect. It is true of | 3022 if (failure_control != NULL) // failure is now impossible |
3023 // all casts inserted by javac to implement generic types. | 3023 (*failure_control) = top(); |
3024 data->as_CounterData()->count() >= 0)) { | 3024 // adjust the type of the phi to the exact klass: |
3025 cast_obj = maybe_cast_profiled_receiver(not_null_obj, tk->klass(), spec_obj_type, safe_for_replace); | 3025 phi->raise_bottom_type(_gvn.type(cast_obj)->meet_speculative(TypePtr::NULL_PTR)); |
3026 if (cast_obj != NULL) { | |
3027 if (failure_control != NULL) // failure is now impossible | |
3028 (*failure_control) = top(); | |
3029 // adjust the type of the phi to the exact klass: | |
3030 phi->raise_bottom_type(_gvn.type(cast_obj)->meet_speculative(TypePtr::NULL_PTR)); | |
3031 } | |
3032 } | 3026 } |
3033 } | 3027 } |
3034 | 3028 |
3035 if (cast_obj == NULL) { | 3029 if (cast_obj == NULL) { |
3036 // Load the object's klass | 3030 // Load the object's klass |