Commit 249e4949 authored by Ben L. Titzer's avatar Ben L. Titzer Committed by Commit Bot

[wasm] Remove flag --skip-compiling-wasm-funcs

This was originally a flag for debugging the compilation of a module
by skipping compilation of the first N functions in a module. This
flag is not properly respected anymore, and is an unnecessary complication.

R=herhut@chromium.org

Change-Id: If9bf80245f6982a8383ca3865c599d58319feba9
Reviewed-on: https://chromium-review.googlesource.com/1061468Reviewed-by: 's avatarStephan Herhut <herhut@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53365}
parent c52b7af5
......@@ -559,7 +559,6 @@ DEFINE_BOOL(liftoff, false,
"enable liftoff, the experimental wasm baseline compiler")
DEFINE_DEBUG_BOOL(trace_liftoff, false,
"trace liftoff, the wasm baseline compiler")
DEFINE_UINT(skip_compiling_wasm_funcs, 0, "start compiling at function N")
DEFINE_DEBUG_BOOL(wasm_break_on_decoder_error, false,
"debug break when wasm decoder encounters an error")
DEFINE_BOOL(wasm_trace_memory, false,
......
......@@ -1038,10 +1038,7 @@ bool FetchAndExecuteCompilationUnit(CompilationState* compilation_state) {
}
size_t GetNumFunctionsToCompile(const WasmModule* wasm_module) {
// TODO(kimanh): Remove, FLAG_skip_compiling_wasm_funcs: previously used for
// debugging, and now not necessarily working anymore.
uint32_t start =
wasm_module->num_imported_functions + FLAG_skip_compiling_wasm_funcs;
uint32_t start = wasm_module->num_imported_functions;
uint32_t num_funcs = static_cast<uint32_t>(wasm_module->functions.size());
uint32_t funcs_to_compile = start > num_funcs ? 0 : num_funcs - start;
return funcs_to_compile;
......@@ -1052,8 +1049,7 @@ void InitializeCompilationUnits(const std::vector<WasmFunction>& functions,
const WasmModule* wasm_module,
Handle<Code> centry_stub,
NativeModule* native_module) {
uint32_t start =
wasm_module->num_imported_functions + FLAG_skip_compiling_wasm_funcs;
uint32_t start = wasm_module->num_imported_functions;
uint32_t num_funcs = static_cast<uint32_t>(functions.size());
CompilationUnitBuilder builder(native_module, centry_stub);
......@@ -1253,8 +1249,7 @@ void CompileSequentially(Isolate* isolate, NativeModule* native_module,
DCHECK(!thrower->error());
const WasmModule* module = module_env->module;
for (uint32_t i = FLAG_skip_compiling_wasm_funcs;
i < module->functions.size(); ++i) {
for (uint32_t i = 0; i < module->functions.size(); ++i) {
const WasmFunction& func = module->functions[i];
if (func.imported) continue; // Imports are compiled at instantiation time.
......@@ -3327,7 +3322,6 @@ bool AsyncStreamingProcessor::ProcessFunctionBody(Vector<const uint8_t> bytes,
uint32_t offset) {
TRACE_STREAMING("Process function body %d ...\n", next_function_);
if (next_function_ >= FLAG_skip_compiling_wasm_funcs) {
decoder_.DecodeFunctionBody(
next_function_, static_cast<uint32_t>(bytes.length()), offset, false);
......@@ -3335,7 +3329,6 @@ bool AsyncStreamingProcessor::ProcessFunctionBody(Vector<const uint8_t> bytes,
const WasmFunction* func = &decoder_.module()->functions[index];
WasmName name = {nullptr, 0};
compilation_unit_builder_->AddUnit(func, offset, bytes, name);
}
++next_function_;
// This method always succeeds. The return value is necessary to comply with
// the StreamingProcessor interface.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment