229 {
230#if !defined(PRODUCT)
231 if (thread->isolate_group()->debugger()->IsDebugging(thread,
function)) {
232
233
234
236
237
238
239
240
241 if (thread->isolate_group()->optimization_counter_threshold() < 2) {
243 }
244 return false;
245 }
246#endif
247 if (
function.deoptimization_counter() >=
248 FLAG_max_deoptimization_counter_threshold) {
249 if (FLAG_trace_failed_optimization_attempts ||
250 FLAG_stop_on_excessive_deoptimization) {
251 THR_Print(
"Too many deoptimizations: %s\n",
252 function.ToFullyQualifiedCString());
253 if (FLAG_stop_on_excessive_deoptimization) {
254 FATAL(
"Stop on excessive deoptimization");
255 }
256 }
257
258
260 function.SetUsageCounter(INT32_MIN);
261 return false;
262 }
263 if (FLAG_optimization_filter != nullptr) {
264
265
266 char* save_ptr;
268 intptr_t
len = strlen(FLAG_optimization_filter) + 1;
269 char* filter =
new char[
len];
270 strncpy(filter, FLAG_optimization_filter,
len);
271 char* token = strtok_r(filter, ",", &save_ptr);
272 bool found = false;
273 while (token != nullptr) {
275 found = true;
276 break;
277 }
278 token = strtok_r(nullptr, ",", &save_ptr);
279 }
280 delete[] filter;
281 if (!found) {
282 function.SetUsageCounter(INT32_MIN);
283 return false;
284 }
285 }
287
288
289 if (FLAG_trace_failed_optimization_attempts) {
291 }
292 function.SetUsageCounter(INT32_MIN);
293 return false;
294 }
295 return true;
296}
Dart_NativeFunction function
const char *const function_name