Bug 1546439: Allow showing the optimized IR of a Cranelift-compiled function; r=lth
authorBenjamin Bouvier <benj@benj.me>
Fri, 19 Apr 2019 17:43:45 +0200
changeset 529991 5fd6e9df0a2c8a76139f5994b8d80afe8af68ac2
parent 529990 df4c4083aff8d84ff17010249d08e7b6dc6f9beb
child 529992 5d7b8187380f831c386018fc9f0c8add93d700c1
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslth
bugs1546439
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1546439: Allow showing the optimized IR of a Cranelift-compiled function; r=lth Differential Revision: https://phabricator.services.mozilla.com/D28513
js/src/wasm/cranelift/src/compile.rs
--- a/js/src/wasm/cranelift/src/compile.rs
+++ b/js/src/wasm/cranelift/src/compile.rs
@@ -90,16 +90,17 @@ impl<'a, 'b> BatchCompiler<'a, 'b> {
             context: Context::new(),
             trans: FuncTranslator::new(),
             current_func: CompiledFunc::new(),
         })
     }
 
     pub fn compile(&mut self) -> CodegenResult<()> {
         let size = self.context.compile(&*self.isa)?;
+        debug!("Optimized wasm function IR: {}", self);
         self.binemit(size as usize)
     }
 
     /// Translate the WebAssembly code to Cranelift IR.
     pub fn translate_wasm(
         &mut self,
         func: &bd::FuncCompileInput,
     ) -> WasmResult<bd::FuncTypeWithId> {
@@ -115,17 +116,17 @@ impl<'a, 'b> BatchCompiler<'a, 'b> {
         self.trans.translate(
             func.bytecode(),
             func.offset_in_module as usize,
             &mut self.context.func,
             tenv,
         )?;
 
         info!("Translated wasm function {}.", func.index);
-        debug!("Content: {}", self.context.func.display(&*self.isa));
+        debug!("Translated wasm function IR: {}", self);
         Ok(wsig)
     }
 
     /// Emit binary machine code to `emitter`.
     fn binemit(&mut self, size: usize) -> CodegenResult<()> {
         let frame_pushed = self.frame_pushed();
         let contains_calls = self.contains_calls();