Add a compilation pass timing facility.
Individual compilation passes call the corresponding timing::*() function and hold on to their timing token while they run. This causes nested per-pass timing information to be recorded in thread-local storage. The --time-passes command line option prints a pass timing report to stdout.
This commit is contained in:
@@ -8,6 +8,7 @@ use code_translator::translate_operator;
|
||||
use cretonne::entity::EntityRef;
|
||||
use cretonne::ir::{self, InstBuilder, Ebb};
|
||||
use cretonne::result::{CtonResult, CtonError};
|
||||
use cretonne::timing;
|
||||
use cton_frontend::{ILBuilder, FunctionBuilder};
|
||||
use environ::FuncEnvironment;
|
||||
use state::TranslationState;
|
||||
@@ -66,6 +67,7 @@ impl FuncTranslator {
|
||||
func: &mut ir::Function,
|
||||
environ: &mut FE,
|
||||
) -> CtonResult {
|
||||
let _tt = timing::wasm_translate_function();
|
||||
dbg!(
|
||||
"translate({} bytes, {}{})",
|
||||
reader.bytes_remaining(),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
//! Translation skeletton that traverses the whole WebAssembly module and call helper functions
|
||||
//! to deal with each part of it.
|
||||
use cretonne::timing;
|
||||
use wasmparser::{ParserState, SectionCode, ParserInput, Parser, WasmDecoder, BinaryReaderError};
|
||||
use sections_translator::{SectionParsingError, parse_function_signatures, parse_import_section,
|
||||
parse_function_section, parse_export_section, parse_start_section,
|
||||
@@ -15,6 +16,7 @@ pub fn translate_module<'data>(
|
||||
data: &'data [u8],
|
||||
environ: &mut ModuleEnvironment<'data>,
|
||||
) -> Result<(), String> {
|
||||
let _tt = timing::wasm_translate_module();
|
||||
let mut parser = Parser::new(data);
|
||||
match *parser.read() {
|
||||
ParserState::BeginWasm { .. } => {}
|
||||
|
||||
Reference in New Issue
Block a user