comparison src/share/vm/opto/graphKit.hpp @ 12966:b2ee5dc63353

8024070: C2 needs some form of type speculation Summary: record unused type profile information with type system, propagate and use it. Reviewed-by: kvn, twisti
author roland
date Wed, 23 Oct 2013 12:40:23 +0200
parents d9043b88eeb3
children de6a9e811145 2113136690bc
comparison
equal deleted inserted replaced
12965:8b4bbba322d3 12966:b2ee5dc63353
384 bool never_see_null = false, bool safe_for_replace = false); 384 bool never_see_null = false, bool safe_for_replace = false);
385 385
386 // Check the null_seen bit. 386 // Check the null_seen bit.
387 bool seems_never_null(Node* obj, ciProfileData* data); 387 bool seems_never_null(Node* obj, ciProfileData* data);
388 388
389 // Check for unique class for receiver at call
390 ciKlass* profile_has_unique_klass() {
391 ciCallProfile profile = method()->call_profile_at_bci(bci());
392 if (profile.count() >= 0 && // no cast failures here
393 profile.has_receiver(0) &&
394 profile.morphism() == 1) {
395 return profile.receiver(0);
396 }
397 return NULL;
398 }
399
400 // record type from profiling with the type system
401 Node* record_profile_for_speculation(Node* n, ciKlass* exact_kls);
402 Node* record_profiled_receiver_for_speculation(Node* n);
403 void record_profiled_arguments_for_speculation(ciMethod* dest_method, Bytecodes::Code bc);
404 void record_profiled_parameters_for_speculation();
405
389 // Use the type profile to narrow an object type. 406 // Use the type profile to narrow an object type.
390 Node* maybe_cast_profiled_receiver(Node* not_null_obj, 407 Node* maybe_cast_profiled_receiver(Node* not_null_obj,
391 ciProfileData* data, 408 ciKlass* require_klass,
392 ciKlass* require_klass); 409 ciKlass* spec,
410 bool safe_for_replace);
411
412 // Cast obj to type and emit guard unless we had too many traps here already
413 Node* maybe_cast_profiled_obj(Node* obj,
414 ciKlass* type,
415 bool not_null = false);
393 416
394 // Cast obj to not-null on this path 417 // Cast obj to not-null on this path
395 Node* cast_not_null(Node* obj, bool do_replace_in_map = true); 418 Node* cast_not_null(Node* obj, bool do_replace_in_map = true);
396 // Replace all occurrences of one node by another. 419 // Replace all occurrences of one node by another.
397 void replace_in_map(Node* old, Node* neww); 420 void replace_in_map(Node* old, Node* neww);
773 // helper functions for the fast path/slow path idioms 796 // helper functions for the fast path/slow path idioms
774 Node* fast_and_slow(Node* in, const Type *result_type, Node* null_result, IfNode* fast_test, Node* fast_result, address slow_call, const TypeFunc *slow_call_type, Node* slow_arg, Klass* ex_klass, Node* slow_result); 797 Node* fast_and_slow(Node* in, const Type *result_type, Node* null_result, IfNode* fast_test, Node* fast_result, address slow_call, const TypeFunc *slow_call_type, Node* slow_arg, Klass* ex_klass, Node* slow_result);
775 798
776 // Generate an instance-of idiom. Used by both the instance-of bytecode 799 // Generate an instance-of idiom. Used by both the instance-of bytecode
777 // and the reflective instance-of call. 800 // and the reflective instance-of call.
778 Node* gen_instanceof( Node *subobj, Node* superkls ); 801 Node* gen_instanceof(Node *subobj, Node* superkls, bool safe_for_replace = false);
779 802
780 // Generate a check-cast idiom. Used by both the check-cast bytecode 803 // Generate a check-cast idiom. Used by both the check-cast bytecode
781 // and the array-store bytecode 804 // and the array-store bytecode
782 Node* gen_checkcast( Node *subobj, Node* superkls, 805 Node* gen_checkcast( Node *subobj, Node* superkls,
783 Node* *failure_control = NULL ); 806 Node* *failure_control = NULL );