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

Unified Diff: src/compiler.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 | « no previous file | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 2e4a1cca9635c8ffa287172a9d82ef13f636ffb3..fe2a26aa19d8aa14009de2b0d33db326af81840a 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1153,6 +1153,18 @@ void Compiler::CompileForLiveEdit(Handle<Script> script) {
}
+// Checks whether the passed {raw_filter} is a script filter (i.e. it matches
+// the "s:{name}" pattern) and {name} is a prefix of the given scripts name.
+// TODO(rmcilroy): Remove filtering once ignition can handle test262 harness.
+static bool ScriptPassesFilter(const char* raw_filter, Handle<Script> script) {
+ if (!script->name()->IsString()) return false;
+ String* name = String::cast(script->name());
+ Vector<const char> filter = CStrVector(raw_filter);
+ if (filter.length() < 2 || filter[0] != 's' || filter[1] != ':') return false;
+ return name->IsUtf8EqualTo(filter.SubVector(2, filter.length()), true);
+}
+
+
static Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
Isolate* isolate = info->isolate();
PostponeInterruptsScope postpone(isolate);
@@ -1215,13 +1227,8 @@ static Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
: info->isolate()->counters()->compile();
HistogramTimerScope timer(rate);
- Handle<String> script_name =
- script->name()->IsString()
- ? Handle<String>(String::cast(script->name()))
- : isolate->factory()->empty_string();
-
// Compile the code.
- if (FLAG_ignition && script_name->PassesFilter(FLAG_ignition_filter)) {
+ if (FLAG_ignition && ScriptPassesFilter(FLAG_ignition_filter, script)) {
if (!GenerateBytecode(info)) {
return Handle<SharedFunctionInfo>::null();
}
@@ -1252,6 +1259,10 @@ static Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
result->set_allows_lazy_compilation_without_context(false);
}
+ Handle<String> script_name =
+ script->name()->IsString()
+ ? Handle<String>(String::cast(script->name()))
+ : isolate->factory()->empty_string();
Logger::LogEventsAndTags log_tag = info->is_eval()
? Logger::EVAL_TAG
: Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script);
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698