When prepending a '-' to the function name, the function will not be optimized.
--hydrogen-filter=foo works as before.
--hydrogen-filter=-foo means don't optimize foo.
Review URL: https://chromiumcodereview.appspot.com/9691042
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11036
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
} else {
print_source = FLAG_print_source;
print_ast = FLAG_print_ast;
- Vector<const char> filter = CStrVector(FLAG_hydrogen_filter);
- if (print_source && !filter.is_empty()) {
- print_source = info->function()->name()->IsEqualTo(filter);
- }
- if (print_ast && !filter.is_empty()) {
- print_ast = info->function()->name()->IsEqualTo(filter);
- }
ftype = "user-defined";
}
bool print_code = Isolate::Current()->bootstrapper()->IsActive()
? FLAG_print_builtin_code
: (FLAG_print_code || (info->IsOptimizing() && FLAG_print_opt_code));
- Vector<const char> filter = CStrVector(FLAG_hydrogen_filter);
- FunctionLiteral* function = info->function();
- bool match = filter.is_empty() || function->debug_name()->IsEqualTo(filter);
- if (print_code && match) {
+ if (print_code) {
// Print the source code if available.
+ FunctionLiteral* function = info->function();
Handle<Script> script = info->script();
if (!script->IsUndefined() && !script->source()->IsUndefined()) {
PrintF("--- Raw source ---\n");
}
// Take --hydrogen-filter into account.
- Vector<const char> filter = CStrVector(FLAG_hydrogen_filter);
Handle<String> name = info->function()->debug_name();
- bool match = filter.is_empty() || name->IsEqualTo(filter);
- if (!match) {
- info->SetCode(code);
- return true;
+ if (*FLAG_hydrogen_filter != '\0') {
+ Vector<const char> filter = CStrVector(FLAG_hydrogen_filter);
+ if ((filter[0] == '-'
+ && name->IsEqualTo(filter.SubVector(1, filter.length())))
+ || (filter[0] != '-' && !name->IsEqualTo(filter))) {
+ info->SetCode(code);
+ return true;
+ }
}
// Recompile the unoptimized version of the code if the current version
// Flags for Crankshaft.
DEFINE_bool(crankshaft, true, "use crankshaft")
-DEFINE_string(hydrogen_filter, "", "hydrogen use/trace filter")
+DEFINE_string(hydrogen_filter, "", "optimization filter")
DEFINE_bool(use_range, true, "use hydrogen range analysis")
DEFINE_bool(eliminate_dead_phis, true, "eliminate dead phis")
DEFINE_bool(use_gvn, true, "use hydrogen global value numbering")