[Interpreter] Remove --ignition-filter and replace with --print-bytecode-filter.
The --ignition-filter hasn't worked properly for a while due to some functions only being supported by Ignition. Remove it and add a --print-bytecode-filter to allow the main use-case of limiting bytecode printing to a particular function. BUG=chromium:685476,v8:5203 Change-Id: Id41eeb3083ae9f713433d3a30227cd4c5d0d47dd Reviewed-on: https://chromium-review.googlesource.com/441047 Reviewed-by: Mythri Alle <mythria@chromium.org> Commit-Queue: Ross McIlroy <rmcilroy@chromium.org> Cr-Commit-Position: refs/heads/master@{#43113}
This commit is contained in:
parent
a98b60004c
commit
cdf73ea484
@ -378,16 +378,7 @@ bool ShouldUseIgnition(CompilationInfo* info) {
|
||||
if (UseTurboFan(shared)) return true;
|
||||
|
||||
// Only use Ignition for any other function if FLAG_ignition is true.
|
||||
if (!FLAG_ignition) return false;
|
||||
|
||||
// Checks whether top level functions should be passed by the filter.
|
||||
if (shared->is_toplevel()) {
|
||||
Vector<const char> filter = CStrVector(FLAG_ignition_filter);
|
||||
return (filter.length() == 0) || (filter.length() == 1 && filter[0] == '*');
|
||||
}
|
||||
|
||||
// Finally respect the filter.
|
||||
return shared->PassesFilter(FLAG_ignition_filter);
|
||||
return FLAG_ignition;
|
||||
}
|
||||
|
||||
bool UseAsmWasm(DeclarationScope* scope, Handle<SharedFunctionInfo> shared_info,
|
||||
|
@ -305,7 +305,6 @@ DEFINE_BOOL(string_slices, true, "use string slices")
|
||||
|
||||
// Flags for Ignition.
|
||||
DEFINE_BOOL(ignition, false, "use ignition interpreter")
|
||||
DEFINE_STRING(ignition_filter, "*", "filter for ignition interpreter")
|
||||
DEFINE_BOOL(ignition_deadcode, true,
|
||||
"use ignition dead code elimination optimizer")
|
||||
DEFINE_BOOL(ignition_osr, true, "enable support for OSR from ignition code")
|
||||
@ -315,6 +314,8 @@ DEFINE_BOOL(ignition_filter_expression_positions, true,
|
||||
"filter expression positions before the bytecode pipeline")
|
||||
DEFINE_BOOL(print_bytecode, false,
|
||||
"print bytecode generated by ignition interpreter")
|
||||
DEFINE_STRING(print_bytecode_filter, "*",
|
||||
"filter for selecting which functions to print bytecode")
|
||||
DEFINE_BOOL(trace_ignition, false,
|
||||
"trace the bytecodes executed by the ignition interpreter")
|
||||
DEFINE_BOOL(trace_ignition_codegen, false,
|
||||
|
@ -78,6 +78,7 @@ class InterpreterCompilationJob final : public CompilationJob {
|
||||
BytecodeGenerator generator_;
|
||||
RuntimeCallStats* runtime_call_stats_;
|
||||
RuntimeCallCounter background_execute_counter_;
|
||||
bool print_bytecode_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(InterpreterCompilationJob);
|
||||
};
|
||||
@ -193,15 +194,33 @@ int Interpreter::InterruptBudget() {
|
||||
return FLAG_interrupt_budget * kCodeSizeMultiplier;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
bool ShouldPrintBytecode(Handle<SharedFunctionInfo> shared) {
|
||||
if (!FLAG_print_bytecode) return false;
|
||||
|
||||
// Checks whether function passed the filter.
|
||||
if (shared->is_toplevel()) {
|
||||
Vector<const char> filter = CStrVector(FLAG_print_bytecode_filter);
|
||||
return (filter.length() == 0) || (filter.length() == 1 && filter[0] == '*');
|
||||
} else {
|
||||
return shared->PassesFilter(FLAG_print_bytecode_filter);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
InterpreterCompilationJob::InterpreterCompilationJob(CompilationInfo* info)
|
||||
: CompilationJob(info->isolate(), info, "Ignition"),
|
||||
generator_(info),
|
||||
runtime_call_stats_(info->isolate()->counters()->runtime_call_stats()),
|
||||
background_execute_counter_("CompileBackgroundIgnition") {}
|
||||
background_execute_counter_("CompileBackgroundIgnition"),
|
||||
print_bytecode_(ShouldPrintBytecode(info->shared_info())) {}
|
||||
|
||||
InterpreterCompilationJob::Status InterpreterCompilationJob::PrepareJobImpl() {
|
||||
CodeGenerator::MakeCodePrologue(info(), "interpreter");
|
||||
if (FLAG_print_bytecode) {
|
||||
|
||||
if (print_bytecode_) {
|
||||
OFStream os(stdout);
|
||||
std::unique_ptr<char[]> name = info()->GetDebugName();
|
||||
os << "[generating bytecode for function: " << info()->GetDebugName().get()
|
||||
@ -243,7 +262,7 @@ InterpreterCompilationJob::Status InterpreterCompilationJob::FinalizeJobImpl() {
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
if (FLAG_print_bytecode) {
|
||||
if (print_bytecode_) {
|
||||
OFStream os(stdout);
|
||||
bytecodes->Print(os);
|
||||
os << std::flush;
|
||||
|
Loading…
Reference in New Issue
Block a user