Commit b1373531 authored by titzer@chromium.org's avatar titzer@chromium.org

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
parent 9ed1fe1a
...@@ -212,7 +212,7 @@ DEFINE_bool(string_slices, true, "use string slices") ...@@ -212,7 +212,7 @@ DEFINE_bool(string_slices, true, "use string slices")
// Flags for Crankshaft. // Flags for Crankshaft.
DEFINE_bool(crankshaft, true, "use 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_range, true, "use hydrogen range analysis")
DEFINE_bool(use_gvn, true, "use hydrogen global value numbering") DEFINE_bool(use_gvn, true, "use hydrogen global value numbering")
DEFINE_bool(use_canonicalizing, true, "use hydrogen instruction canonicalizing") DEFINE_bool(use_canonicalizing, true, "use hydrogen instruction canonicalizing")
......
...@@ -9646,8 +9646,16 @@ Context* JSFunction::NativeContextFromLiterals(FixedArray* literals) { ...@@ -9646,8 +9646,16 @@ Context* JSFunction::NativeContextFromLiterals(FixedArray* literals) {
bool JSFunction::PassesHydrogenFilter() { bool JSFunction::PassesHydrogenFilter() {
String* name = shared()->DebugName(); 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); 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)) return true;
if (filter[0] == '-' && if (filter[0] == '-' &&
!name->IsUtf8EqualTo(filter.SubVector(1, filter.length()))) { !name->IsUtf8EqualTo(filter.SubVector(1, filter.length()))) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment