--- old/src/share/vm/opto/graphKit.hpp 2013-10-17 18:54:50.122478700 +0200 +++ new/src/share/vm/opto/graphKit.hpp 2013-10-17 18:54:49.756203763 +0200 @@ -386,10 +386,41 @@ // Check the null_seen bit. bool seems_never_null(Node* obj, ciProfileData* data); + // At a call, if profiling tells us there's a unique klass for the + // receiver, return it. + ciKlass* profile_has_unique_klass() { + ciCallProfile profile = method()->call_profile_at_bci(bci()); + if (profile.count() >= 0 && // no cast failures here + profile.has_receiver(0) && + profile.morphism() == 1) { + return profile.receiver(0); + } + return NULL; + } + + // Record profiling data exact_kls for Node n with the type system + // so that it can propagate it (speculation) + Node* record_profile_for_speculation(Node* n, ciKlass* exact_kls); + // Record profiling data from receiver profiling at an invoke with + // the type system so that it can propagate it (speculation) + Node* record_profiled_receiver_for_speculation(Node* n); + // Record profiling data from argument profiling at an invoke with + // the type system so that it can propagate it (speculation) + void record_profiled_arguments_for_speculation(ciMethod* dest_method, Bytecodes::Code bc); + // Record profiling data from argument profiling at an invoke with + // the type system so that it can propagate it (speculation) + void record_profiled_parameters_for_speculation(); + // Use the type profile to narrow an object type. Node* maybe_cast_profiled_receiver(Node* not_null_obj, - ciProfileData* data, - ciKlass* require_klass); + ciKlass* require_klass, + ciKlass* spec, + bool safe_for_replace); + + // Cast obj to type and emit guard unless we had too many traps here already + Node* maybe_cast_profiled_obj(Node* obj, + ciKlass* type, + bool not_null = false); // Cast obj to not-null on this path Node* cast_not_null(Node* obj, bool do_replace_in_map = true); @@ -775,7 +806,7 @@ // Generate an instance-of idiom. Used by both the instance-of bytecode // and the reflective instance-of call. - Node* gen_instanceof( Node *subobj, Node* superkls ); + Node* gen_instanceof(Node *subobj, Node* superkls, bool safe_for_replace = false); // Generate a check-cast idiom. Used by both the check-cast bytecode // and the array-store bytecode