src/share/vm/opto/graphKit.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/share/vm/opto/graphKit.hpp
src/share/vm/opto/graphKit.hpp
Print this page
rev 6132 : 8031755: Type speculation should be used to optimize explicit null checks
Summary: feed profiling data about reference nullness to type speculation.
Reviewed-by:
*** 348,360 ****
// Helper function to do a NULL pointer check or ZERO check based on type.
// Throw an exception if a given value is null.
// Return the value cast to not-null.
// Be clever about equivalent dominating null checks.
Node* null_check_common(Node* value, BasicType type,
! bool assert_null = false, Node* *null_control = NULL);
Node* null_check(Node* value, BasicType type = T_OBJECT) {
! return null_check_common(value, type);
}
Node* null_check_receiver() {
assert(argument(0)->bottom_type()->isa_ptr(), "must be");
return null_check(argument(0));
}
--- 348,362 ----
// Helper function to do a NULL pointer check or ZERO check based on type.
// Throw an exception if a given value is null.
// Return the value cast to not-null.
// Be clever about equivalent dominating null checks.
Node* null_check_common(Node* value, BasicType type,
! bool assert_null = false,
! Node* *null_control = NULL,
! bool speculative = false);
Node* null_check(Node* value, BasicType type = T_OBJECT) {
! return null_check_common(value, type, false, NULL, !_gvn.type(value)->speculative_maybe_null());
}
Node* null_check_receiver() {
assert(argument(0)->bottom_type()->isa_ptr(), "must be");
return null_check(argument(0));
}
*** 379,392 ****
// If never_see_null, use an uncommon trap (*null_control sees a top).
// The cast is not valid along the null path; keep a copy of the original.
// If safe_for_replace, then we can replace the value with the cast
// in the parsing map (the cast is guaranteed to dominate the map)
Node* null_check_oop(Node* value, Node* *null_control,
! bool never_see_null = false, bool safe_for_replace = false);
// Check the null_seen bit.
! bool seems_never_null(Node* obj, ciProfileData* data);
// Check for unique class for receiver at call
ciKlass* profile_has_unique_klass() {
ciCallProfile profile = method()->call_profile_at_bci(bci());
if (profile.count() >= 0 && // no cast failures here
--- 381,396 ----
// If never_see_null, use an uncommon trap (*null_control sees a top).
// The cast is not valid along the null path; keep a copy of the original.
// If safe_for_replace, then we can replace the value with the cast
// in the parsing map (the cast is guaranteed to dominate the map)
Node* null_check_oop(Node* value, Node* *null_control,
! bool never_see_null = false,
! bool safe_for_replace = false,
! bool speculative = false);
// Check the null_seen bit.
! bool seems_never_null(Node* obj, ciProfileData* data, bool& speculating);
// Check for unique class for receiver at call
ciKlass* profile_has_unique_klass() {
ciCallProfile profile = method()->call_profile_at_bci(bci());
if (profile.count() >= 0 && // no cast failures here
*** 396,409 ****
}
return NULL;
}
// record type from profiling with the type system
! Node* record_profile_for_speculation(Node* n, ciKlass* exact_kls);
! Node* record_profiled_receiver_for_speculation(Node* n);
void record_profiled_arguments_for_speculation(ciMethod* dest_method, Bytecodes::Code bc);
void record_profiled_parameters_for_speculation();
// Use the type profile to narrow an object type.
Node* maybe_cast_profiled_receiver(Node* not_null_obj,
ciKlass* require_klass,
ciKlass* spec,
--- 400,414 ----
}
return NULL;
}
// record type from profiling with the type system
! Node* record_profile_for_speculation(Node* n, ciKlass* exact_kls, bool maybe_null);
void record_profiled_arguments_for_speculation(ciMethod* dest_method, Bytecodes::Code bc);
void record_profiled_parameters_for_speculation();
+ void record_profiled_return_for_speculation();
+ Node* record_profiled_receiver_for_speculation(Node* n);
// Use the type profile to narrow an object type.
Node* maybe_cast_profiled_receiver(Node* not_null_obj,
ciKlass* require_klass,
ciKlass* spec,
src/share/vm/opto/graphKit.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File