Mercurial > hg > graal-compiler
comparison src/share/vm/c1/c1_LIRGenerator.cpp @ 18041:52b4284cb496
Merge with jdk8u20-b26
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 15 Oct 2014 16:02:50 +0200 |
parents | 4ca6dc0799b6 45e59fae8f2b |
children | 7848fc12602b |
comparison
equal
deleted
inserted
replaced
17606:45d7b2c7029d | 18041:52b4284cb496 |
---|---|
2632 result = exact_signature_k; | 2632 result = exact_signature_k; |
2633 // Known statically. No need to emit any code: prevent | 2633 // Known statically. No need to emit any code: prevent |
2634 // LIR_Assembler::emit_profile_type() from emitting useless code | 2634 // LIR_Assembler::emit_profile_type() from emitting useless code |
2635 profiled_k = ciTypeEntries::with_status(result, profiled_k); | 2635 profiled_k = ciTypeEntries::with_status(result, profiled_k); |
2636 } | 2636 } |
2637 if (exact_signature_k != NULL && exact_klass != exact_signature_k) { | 2637 // exact_klass and exact_signature_k can be both non NULL but |
2638 assert(exact_klass == NULL, "obj and signature disagree?"); | 2638 // different if exact_klass is loaded after the ciObject for |
2639 // exact_signature_k is created. | |
2640 if (exact_klass == NULL && exact_signature_k != NULL && exact_klass != exact_signature_k) { | |
2639 // sometimes the type of the signature is better than the best type | 2641 // sometimes the type of the signature is better than the best type |
2640 // the compiler has | 2642 // the compiler has |
2641 exact_klass = exact_signature_k; | 2643 exact_klass = exact_signature_k; |
2642 } | 2644 } |
2643 if (callee_signature_k != NULL && | 2645 if (callee_signature_k != NULL && |
2644 callee_signature_k != signature_at_call_k) { | 2646 callee_signature_k != signature_at_call_k) { |
2645 ciKlass* improved_klass = callee_signature_k->exact_klass(); | 2647 ciKlass* improved_klass = callee_signature_k->exact_klass(); |
2646 if (improved_klass == NULL) { | 2648 if (improved_klass == NULL) { |
2647 improved_klass = comp->cha_exact_type(callee_signature_k); | 2649 improved_klass = comp->cha_exact_type(callee_signature_k); |
2648 } | 2650 } |
2649 if (improved_klass != NULL && exact_klass != improved_klass) { | 2651 if (exact_klass == NULL && improved_klass != NULL && exact_klass != improved_klass) { |
2650 assert(exact_klass == NULL, "obj and signature disagree?"); | |
2651 exact_klass = exact_signature_k; | 2652 exact_klass = exact_signature_k; |
2652 } | 2653 } |
2653 } | 2654 } |
2654 do_update = exact_klass == NULL || ciTypeEntries::valid_ciklass(profiled_k) != exact_klass; | 2655 do_update = exact_klass == NULL || ciTypeEntries::valid_ciklass(profiled_k) != exact_klass; |
2655 } | 2656 } |
3184 } | 3185 } |
3185 } else { | 3186 } else { |
3186 #ifdef ASSERT | 3187 #ifdef ASSERT |
3187 Bytecodes::Code code = x->method()->raw_code_at_bci(x->bci_of_invoke()); | 3188 Bytecodes::Code code = x->method()->raw_code_at_bci(x->bci_of_invoke()); |
3188 int n = x->nb_profiled_args(); | 3189 int n = x->nb_profiled_args(); |
3189 assert(MethodData::profile_parameters() && x->inlined() && | 3190 assert(MethodData::profile_parameters() && (MethodData::profile_arguments_jsr292_only() || |
3190 ((code == Bytecodes::_invokedynamic && n <= 1) || (code == Bytecodes::_invokehandle && n <= 2)), | 3191 (x->inlined() && ((code == Bytecodes::_invokedynamic && n <= 1) || (code == Bytecodes::_invokehandle && n <= 2)))), |
3191 "only at JSR292 bytecodes"); | 3192 "only at JSR292 bytecodes"); |
3192 #endif | 3193 #endif |
3193 } | 3194 } |
3194 } | 3195 } |
3195 } | 3196 } |
3286 | 3287 |
3287 bool ignored_will_link; | 3288 bool ignored_will_link; |
3288 ciSignature* signature_at_call = NULL; | 3289 ciSignature* signature_at_call = NULL; |
3289 x->method()->get_method_at_bci(bci, ignored_will_link, &signature_at_call); | 3290 x->method()->get_method_at_bci(bci, ignored_will_link, &signature_at_call); |
3290 | 3291 |
3291 ciKlass* exact = profile_type(md, 0, md->byte_offset_of_slot(data, ret->type_offset()), | 3292 // The offset within the MDO of the entry to update may be too large |
3293 // to be used in load/store instructions on some platforms. So have | |
3294 // profile_type() compute the address of the profile in a register. | |
3295 ciKlass* exact = profile_type(md, md->byte_offset_of_slot(data, ret->type_offset()), 0, | |
3292 ret->type(), x->ret(), mdp, | 3296 ret->type(), x->ret(), mdp, |
3293 !x->needs_null_check(), | 3297 !x->needs_null_check(), |
3294 signature_at_call->return_type()->as_klass(), | 3298 signature_at_call->return_type()->as_klass(), |
3295 x->callee()->signature()->return_type()->as_klass()); | 3299 x->callee()->signature()->return_type()->as_klass()); |
3296 if (exact != NULL) { | 3300 if (exact != NULL) { |