Mercurial > hg > graal-jvmci-8
comparison src/share/vm/c1/c1_GraphBuilder.cpp @ 17618:f834ae379225
8028064: tiered may collect wrong receiver type at virtual call
Summary: when unique callee is known at compile time, recorded class may be wrong
Reviewed-by: kvn, iveresov
author | roland |
---|---|
date | Tue, 07 Jan 2014 14:36:34 +0100 |
parents | 144b23411b51 |
children | 96d2c94bbdd0 f47fa50d9b9c |
comparison
equal
deleted
inserted
replaced
17617:29463147336b | 17618:f834ae379225 |
---|---|
4336 vmap()->print(); | 4336 vmap()->print(); |
4337 } | 4337 } |
4338 #endif // PRODUCT | 4338 #endif // PRODUCT |
4339 | 4339 |
4340 void GraphBuilder::profile_call(ciMethod* callee, Value recv, ciKlass* known_holder, Values* obj_args, bool inlined) { | 4340 void GraphBuilder::profile_call(ciMethod* callee, Value recv, ciKlass* known_holder, Values* obj_args, bool inlined) { |
4341 // A default method's holder is an interface | 4341 assert(known_holder == NULL || (known_holder->is_instance_klass() && |
4342 if (known_holder != NULL && known_holder->is_interface()) { | 4342 (!known_holder->is_interface() || |
4343 assert(known_holder->is_instance_klass() && ((ciInstanceKlass*)known_holder)->has_default_methods(), "should be default method"); | 4343 ((ciInstanceKlass*)known_holder)->has_default_methods())), "should be default method"); |
4344 known_holder = NULL; | 4344 if (known_holder != NULL) { |
4345 } | 4345 if (known_holder->exact_klass() == NULL) { |
4346 known_holder = compilation()->cha_exact_type(known_holder); | |
4347 } | |
4348 } | |
4349 | |
4346 append(new ProfileCall(method(), bci(), callee, recv, known_holder, obj_args, inlined)); | 4350 append(new ProfileCall(method(), bci(), callee, recv, known_holder, obj_args, inlined)); |
4347 } | 4351 } |
4348 | 4352 |
4349 void GraphBuilder::profile_return_type(Value ret, ciMethod* callee, ciMethod* m, int invoke_bci) { | 4353 void GraphBuilder::profile_return_type(Value ret, ciMethod* callee, ciMethod* m, int invoke_bci) { |
4350 assert((m == NULL) == (invoke_bci < 0), "invalid method and invalid bci together"); | 4354 assert((m == NULL) == (invoke_bci < 0), "invalid method and invalid bci together"); |