151 counter->set_carry_flag();
152 }
153 }
154
155 // Set carry flags on the counters if necessary
156 void SimpleThresholdPolicy::handle_counter_overflow(Method* method) {
157 MethodCounters *mcs = method->method_counters();
158 if (mcs != NULL) {
159 set_carry_if_necessary(mcs->invocation_counter());
160 set_carry_if_necessary(mcs->backedge_counter());
161 }
162 MethodData* mdo = method->method_data();
163 if (mdo != NULL) {
164 set_carry_if_necessary(mdo->invocation_counter());
165 set_carry_if_necessary(mdo->backedge_counter());
166 }
167 }
168
169 // Called with the queue locked and with at least one element
170 CompileTask* SimpleThresholdPolicy::select_task(CompileQueue* compile_queue) {
171 return compile_queue->first();
172 }
173
174 void SimpleThresholdPolicy::reprofile(ScopeDesc* trap_scope, bool is_osr) {
175 for (ScopeDesc* sd = trap_scope;; sd = sd->sender()) {
176 if (PrintTieredEvents) {
177 methodHandle mh(sd->method());
178 print_event(REPROFILE, mh, mh, InvocationEntryBci, CompLevel_none);
179 }
180 MethodData* mdo = sd->method()->method_data();
181 if (mdo != NULL) {
182 mdo->reset_start_counters();
183 }
184 if (sd->is_top()) break;
185 }
186 }
187
188 nmethod* SimpleThresholdPolicy::event(const methodHandle& method, const methodHandle& inlinee,
189 int branch_bci, int bci, CompLevel comp_level, nmethod* nm, JavaThread* thread) {
190 if (comp_level == CompLevel_none &&
191 JvmtiExport::can_post_interpreter_events() &&
|
151 counter->set_carry_flag();
152 }
153 }
154
155 // Set carry flags on the counters if necessary
156 void SimpleThresholdPolicy::handle_counter_overflow(Method* method) {
157 MethodCounters *mcs = method->method_counters();
158 if (mcs != NULL) {
159 set_carry_if_necessary(mcs->invocation_counter());
160 set_carry_if_necessary(mcs->backedge_counter());
161 }
162 MethodData* mdo = method->method_data();
163 if (mdo != NULL) {
164 set_carry_if_necessary(mdo->invocation_counter());
165 set_carry_if_necessary(mdo->backedge_counter());
166 }
167 }
168
169 // Called with the queue locked and with at least one element
170 CompileTask* SimpleThresholdPolicy::select_task(CompileQueue* compile_queue) {
171 return select_task_helper(compile_queue);
172 }
173
174 void SimpleThresholdPolicy::reprofile(ScopeDesc* trap_scope, bool is_osr) {
175 for (ScopeDesc* sd = trap_scope;; sd = sd->sender()) {
176 if (PrintTieredEvents) {
177 methodHandle mh(sd->method());
178 print_event(REPROFILE, mh, mh, InvocationEntryBci, CompLevel_none);
179 }
180 MethodData* mdo = sd->method()->method_data();
181 if (mdo != NULL) {
182 mdo->reset_start_counters();
183 }
184 if (sd->is_top()) break;
185 }
186 }
187
188 nmethod* SimpleThresholdPolicy::event(const methodHandle& method, const methodHandle& inlinee,
189 int branch_bci, int bci, CompLevel comp_level, nmethod* nm, JavaThread* thread) {
190 if (comp_level == CompLevel_none &&
191 JvmtiExport::can_post_interpreter_events() &&
|