Reviewers: Michael Starzinger,

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

BUG=

Please review this at https://codereview.chromium.org/19590002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/flag-definitions.h
  M src/objects.cc


Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index 50d96690b02a89d86d83ff5fea4f340aecf3a8bd..2965665de14e9a5be11be8c081052108acdbdd43 100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -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")
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 7b06b8732ad03928d97d3dfcf16483b7633a39c5..fc0e30c67f11773479704a3315763fc20d7b1622 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -9642,8 +9642,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()))) {


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to