Add support for empty hydrogen filter that matches only the top-level JSFunction.

BUG=

Review URL: https://codereview.chromium.org/19590002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15729 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
titzer@chromium.org 2013-07-17 16:21:03 +00:00
parent 9ed1fe1ac4
commit b1373531ba
2 changed files with 10 additions and 2 deletions

View File

@ -212,7 +212,7 @@ DEFINE_bool(string_slices, true, "use string slices")
// Flags for Crankshaft.
DEFINE_bool(crankshaft, true, "use crankshaft")
DEFINE_string(hydrogen_filter, "", "optimization filter")
DEFINE_string(hydrogen_filter, "*", "optimization filter")
DEFINE_bool(use_range, true, "use hydrogen range analysis")
DEFINE_bool(use_gvn, true, "use hydrogen global value numbering")
DEFINE_bool(use_canonicalizing, true, "use hydrogen instruction canonicalizing")

View File

@ -9646,8 +9646,16 @@ Context* JSFunction::NativeContextFromLiterals(FixedArray* literals) {
bool JSFunction::PassesHydrogenFilter() {
String* name = shared()->DebugName();
if (*FLAG_hydrogen_filter != '\0') {
// The filter string is a pattern that matches functions in this way:
// "*" all; the default
// "-" all but the top-level function
// "-name" all but the function "name"
// "" only the top-level function
// "name" only the function "name"
// "name*" only functions starting with "name"
if (*FLAG_hydrogen_filter != '*') {
Vector<const char> filter = CStrVector(FLAG_hydrogen_filter);
if (filter.length() == 0) return name->length() == 0;
if (filter[0] != '-' && name->IsUtf8EqualTo(filter)) return true;
if (filter[0] == '-' &&
!name->IsUtf8EqualTo(filter.SubVector(1, filter.length()))) {