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

Unified Diff: src/objects.cc

Issue 1823033002: [compiler] Move PassesFilter onto SharedFunctionInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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
« src/compiler.cc ('K') | « src/objects.h ('k') | src/runtime-profiler.cc » ('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 7e3a325a6df6c337b5a8b0fc604f8204ff09ce5e..94f4570f2e548505e9d3e4c3d15129660d5e3696 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -13140,43 +13140,6 @@ void JSFunction::PrintName(FILE* out) {
}
-// The filter is a pattern that matches function names 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"
-// "~" none; the tilde is not an identifier
-bool JSFunction::PassesFilter(const char* raw_filter) {
- if (*raw_filter == '*') return true;
- String* name = shared()->DebugName();
- 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;
-}
-
-
Handle<String> JSFunction::GetName(Handle<JSFunction> function) {
Isolate* isolate = function->GetIsolate();
Handle<Object> name =
@@ -13542,6 +13505,41 @@ String* SharedFunctionInfo::DebugName() {
return String::cast(n);
}
+// The filter is a pattern that matches function names 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"
+// "~" none; the tilde is not an identifier
+bool SharedFunctionInfo::PassesFilter(const char* raw_filter) {
+ if (*raw_filter == '*') return true;
+ String* name = DebugName();
Michael Starzinger 2016/03/22 09:06:31 The only change inside the function was this one l
Jakob Kummerow 2016/03/22 09:32:11 Acknowledged.
+ 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;
+}
bool SharedFunctionInfo::HasSourceCode() const {
return !script()->IsUndefined() &&
« src/compiler.cc ('K') | « src/objects.h ('k') | src/runtime-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698