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