696 void increment_counter(address counter_addr); // increment a debug counter
697 void increment_counter(Node* counter_addr); // increment a debug counter
698
699 // Bail out to the interpreter right now
700 // The optional klass is the one causing the trap.
701 // The optional reason is debug information written to the compile log.
702 // Optional must_throw is the same as with add_safepoint_edges.
703 void uncommon_trap(int trap_request,
704 ciKlass* klass = NULL, const char* reason_string = NULL,
705 bool must_throw = false, bool keep_exact_action = false);
706
707 // Shorthand, to avoid saying "Deoptimization::" so many times.
708 void uncommon_trap(Deoptimization::DeoptReason reason,
709 Deoptimization::DeoptAction action,
710 ciKlass* klass = NULL, const char* reason_string = NULL,
711 bool must_throw = false, bool keep_exact_action = false) {
712 uncommon_trap(Deoptimization::make_trap_request(reason, action),
713 klass, reason_string, must_throw, keep_exact_action);
714 }
715
716 // SP when bytecode needs to be reexecuted.
717 virtual int reexecute_sp() { return sp(); }
718
719 // Report if there were too many traps at the current method and bci.
720 // Report if a trap was recorded, and/or PerMethodTrapLimit was exceeded.
721 // If there is no MDO at all, report no trap unless told to assume it.
722 bool too_many_traps(Deoptimization::DeoptReason reason) {
723 return C->too_many_traps(method(), bci(), reason);
724 }
725
726 // Report if there were too many recompiles at the current method and bci.
727 bool too_many_recompiles(Deoptimization::DeoptReason reason) {
728 return C->too_many_recompiles(method(), bci(), reason);
729 }
730
731 // Returns the object (if any) which was created the moment before.
732 Node* just_allocated_object(Node* current_control);
733
734 static bool use_ReduceInitialCardMarks() {
735 return (ReduceInitialCardMarks
|
696 void increment_counter(address counter_addr); // increment a debug counter
697 void increment_counter(Node* counter_addr); // increment a debug counter
698
699 // Bail out to the interpreter right now
700 // The optional klass is the one causing the trap.
701 // The optional reason is debug information written to the compile log.
702 // Optional must_throw is the same as with add_safepoint_edges.
703 void uncommon_trap(int trap_request,
704 ciKlass* klass = NULL, const char* reason_string = NULL,
705 bool must_throw = false, bool keep_exact_action = false);
706
707 // Shorthand, to avoid saying "Deoptimization::" so many times.
708 void uncommon_trap(Deoptimization::DeoptReason reason,
709 Deoptimization::DeoptAction action,
710 ciKlass* klass = NULL, const char* reason_string = NULL,
711 bool must_throw = false, bool keep_exact_action = false) {
712 uncommon_trap(Deoptimization::make_trap_request(reason, action),
713 klass, reason_string, must_throw, keep_exact_action);
714 }
715
716 // Bail out to the interpreter and keep exact action (avoid switching to Action_none).
717 void uncommon_trap_exact(Deoptimization::DeoptReason reason,
718 Deoptimization::DeoptAction action,
719 ciKlass* klass = NULL, const char* reason_string = NULL,
720 bool must_throw = false) {
721 uncommon_trap(Deoptimization::make_trap_request(reason, action),
722 klass, reason_string, must_throw, /*keep_exact_action=*/true);
723 }
724
725 // SP when bytecode needs to be reexecuted.
726 virtual int reexecute_sp() { return sp(); }
727
728 // Report if there were too many traps at the current method and bci.
729 // Report if a trap was recorded, and/or PerMethodTrapLimit was exceeded.
730 // If there is no MDO at all, report no trap unless told to assume it.
731 bool too_many_traps(Deoptimization::DeoptReason reason) {
732 return C->too_many_traps(method(), bci(), reason);
733 }
734
735 // Report if there were too many recompiles at the current method and bci.
736 bool too_many_recompiles(Deoptimization::DeoptReason reason) {
737 return C->too_many_recompiles(method(), bci(), reason);
738 }
739
740 // Returns the object (if any) which was created the moment before.
741 Node* just_allocated_object(Node* current_control);
742
743 static bool use_ReduceInitialCardMarks() {
744 return (ReduceInitialCardMarks
|