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

Unified Diff: src/objects.cc

Issue 1389353002: [interpreter] Make --ignition-filter script filtering explicit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Small reordering. Created 5 years, 2 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/objects.h ('k') | test/test262/testcfg.py » ('j') | 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 66d80149fbaeb88ad687d2949ab02cabf2a4c501..5ff3c7dc2133140273d91207a1cec99b1bc2b3bf 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1552,41 +1552,6 @@ void String::PrintUC16(std::ostream& os, int start, int end) { // NOLINT
}
-// The filter is a pattern that matches string names in this way:
-// "*" all; the default
-// "-name" all but "name"
-// "name" only the function "name"
-// "name*" only functions starting with "name"
-// "~" none; the tilde is not an identifier
-bool String::PassesFilter(const char* raw_filter) {
- if (*raw_filter == '*') return true;
-
- Vector<const char> filter = CStrVector(raw_filter);
- if (filter.length() == 0) return length() == 0;
- if (filter[0] == '-') {
- // Negative filter.
- if (filter.length() == 1) {
- return (length() != 0);
- } else if (IsUtf8EqualTo(filter.SubVector(1, filter.length()))) {
- return false;
- }
- if (filter[filter.length() - 1] == '*' &&
- IsUtf8EqualTo(filter.SubVector(1, filter.length() - 1), true)) {
- return false;
- }
- return true;
-
- } else if (IsUtf8EqualTo(filter)) {
- return true;
- }
- if (filter[filter.length() - 1] == '*' &&
- IsUtf8EqualTo(filter.SubVector(0, filter.length() - 1), true)) {
- return true;
- }
- return false;
-}
-
-
void JSObject::JSObjectShortPrint(StringStream* accumulator) {
switch (map()->instance_type()) {
case JS_ARRAY_TYPE: {
@@ -11007,8 +10972,31 @@ void JSFunction::PrintName(FILE* out) {
// "name*" only functions starting with "name"
// "~" none; the tilde is not an identifier
bool JSFunction::PassesFilter(const char* raw_filter) {
+ if (*raw_filter == '*') return true;
String* name = shared()->DebugName();
- return name->PassesFilter(raw_filter);
+ Vector<const char> filter = CStrVector(raw_filter);
+ if (filter.length() == 0) return name->length() == 0;
+ if (filter[0] == '-') {
+ // Negative filter.
+ if (filter.length() == 1) {
+ return (name->length() != 0);
+ } else if (name->IsUtf8EqualTo(filter.SubVector(1, filter.length()))) {
+ return false;
+ }
+ if (filter[filter.length() - 1] == '*' &&
+ name->IsUtf8EqualTo(filter.SubVector(1, filter.length() - 1), true)) {
+ return false;
+ }
+ return true;
+
+ } else if (name->IsUtf8EqualTo(filter)) {
+ return true;
+ }
+ if (filter[filter.length() - 1] == '*' &&
+ name->IsUtf8EqualTo(filter.SubVector(0, filter.length() - 1), true)) {
+ return true;
+ }
+ return false;
}
« no previous file with comments | « src/objects.h ('k') | test/test262/testcfg.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698