Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Side by Side Diff: runtime/vm/code_generator.cc

Issue 25446003: Improve --optimization-filter to accept a comma-separated list of strings. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 OS::PrintErr("Too Many Deoptimizations: %s\n", 1232 OS::PrintErr("Too Many Deoptimizations: %s\n",
1233 function.ToFullyQualifiedCString()); 1233 function.ToFullyQualifiedCString());
1234 if (FLAG_stop_on_excessive_deoptimization) { 1234 if (FLAG_stop_on_excessive_deoptimization) {
1235 FATAL("Stop on excessive deoptimization"); 1235 FATAL("Stop on excessive deoptimization");
1236 } 1236 }
1237 } 1237 }
1238 // TODO(srdjan): Investigate excessive deoptimization. 1238 // TODO(srdjan): Investigate excessive deoptimization.
1239 function.set_usage_counter(kLowInvocationCount); 1239 function.set_usage_counter(kLowInvocationCount);
1240 return false; 1240 return false;
1241 } 1241 }
1242 if ((FLAG_optimization_filter != NULL) && 1242 if (FLAG_optimization_filter != NULL) {
1243 (strstr(function.ToFullyQualifiedCString(), 1243 // FLAG_optimization_filter is a comma-separated list of strings that are
1244 FLAG_optimization_filter) == NULL)) { 1244 // matched against the fully-qualified function name.
1245 function.set_usage_counter(kLowInvocationCount); 1245 char* save_ptr; // Needed for strtok_r.
1246 return false; 1246 const char* function_name = function.ToFullyQualifiedCString();
1247 intptr_t len = strlen(FLAG_optimization_filter) + 1; // Length with \0.
1248 char* filter = new char[len];
1249 strncpy(filter, FLAG_optimization_filter, len); // strtok modifies arg 1.
1250 char* token = strtok_r(filter, ",", &save_ptr);
1251 bool found = false;
1252 while (token != NULL) {
Kevin Millikin (Google) 2013/10/14 11:09:28 Without the found flag :) char* token = NULL; do
1253 if (strstr(function_name, token) != NULL) {
1254 found = true;
1255 break;
1256 }
1257 token = strtok_r(NULL, ",", &save_ptr);
1258 }
1259 delete[] filter;
1260 if (!found) {
1261 function.set_usage_counter(kLowInvocationCount);
1262 return false;
1263 }
1247 } 1264 }
1248 if (!function.is_optimizable()) { 1265 if (!function.is_optimizable()) {
1249 if (FLAG_trace_failed_optimization_attempts) { 1266 if (FLAG_trace_failed_optimization_attempts) {
1250 OS::PrintErr("Not Optimizable: %s\n", function.ToFullyQualifiedCString()); 1267 OS::PrintErr("Not Optimizable: %s\n", function.ToFullyQualifiedCString());
1251 } 1268 }
1252 // TODO(5442338): Abort as this should not happen. 1269 // TODO(5442338): Abort as this should not happen.
1253 function.set_usage_counter(kLowInvocationCount); 1270 function.set_usage_counter(kLowInvocationCount);
1254 return false; 1271 return false;
1255 } 1272 }
1256 return true; 1273 return true;
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
1828 field.UpdateCid(cid); 1845 field.UpdateCid(cid);
1829 intptr_t list_length = Field::kNoFixedLength; 1846 intptr_t list_length = Field::kNoFixedLength;
1830 if ((field.guarded_cid() != kDynamicCid) && 1847 if ((field.guarded_cid() != kDynamicCid) &&
1831 field.is_final() && RawObject::IsBuiltinListClassId(cid)) { 1848 field.is_final() && RawObject::IsBuiltinListClassId(cid)) {
1832 list_length = GetListLength(value); 1849 list_length = GetListLength(value);
1833 } 1850 }
1834 field.UpdateLength(list_length); 1851 field.UpdateLength(list_length);
1835 } 1852 }
1836 1853
1837 } // namespace dart 1854 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698