src/share/vm/opto/compile.cpp
Print this page
rev 5728 : 8029015: PPC64 (part 216): opto: trap based null and range checks
*** 858,867 ****
--- 858,871 ----
_orig_pc_slot = fixed_slots();
int next_slot = _orig_pc_slot + (sizeof(address) / VMRegImpl::stack_slot_size);
set_fixed_slots(next_slot);
+ // Compute when to use implicit null checks. Used by matching trap based
+ // nodes and NullCheck optimization.
+ set_allowed_deopt_reasons();
+
// Now generate code
Code_Gen();
if (failing()) return;
// Check if we want to skip execution of all compiled code.
*** 946,956 ****
_number_of_mh_late_inlines(0),
_inlining_progress(false),
_inlining_incrementally(false),
_print_inlining_list(NULL),
_print_inlining_idx(0),
! _preserve_jvm_state(0) {
C = this;
#ifndef PRODUCT
TraceTime t1(NULL, &_t_totalCompilation, TimeCompiler, false);
TraceTime t2(NULL, &_t_stubCompilation, TimeCompiler, false);
--- 950,961 ----
_number_of_mh_late_inlines(0),
_inlining_progress(false),
_inlining_incrementally(false),
_print_inlining_list(NULL),
_print_inlining_idx(0),
! _preserve_jvm_state(0),
! _allowed_reasons(0) {
C = this;
#ifndef PRODUCT
TraceTime t1(NULL, &_t_totalCompilation, TimeCompiler, false);
TraceTime t2(NULL, &_t_stubCompilation, TimeCompiler, false);
*** 3348,3357 ****
--- 3353,3375 ----
// The coast is clear.
return false;
}
}
+ // Compute when not to trap. Used by matching trap based nodes and
+ // NullCheck optimization.
+ void Compile::set_allowed_deopt_reasons() {
+ _allowed_reasons = 0;
+ if (is_method_compilation()) {
+ for (int rs = (int)Deoptimization::Reason_none+1; rs < Compile::trapHistLength; rs++) {
+ assert(rs < BitsPerInt, "recode bit map");
+ if (!too_many_traps((Deoptimization::DeoptReason) rs)) {
+ _allowed_reasons |= nth_bit(rs);
+ }
+ }
+ }
+ }
#ifndef PRODUCT
//------------------------------verify_graph_edges---------------------------
// Walk the Graph and verify that there is a one-to-one correspondence
// between Use-Def edges and Def-Use edges in the graph.