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

Unified Diff: src/objects.cc

Issue 19590002: Add support for empty hydrogen filter that matches only the top-level JSFunction. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()))) {
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698