Commit dfb96b52 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[wasm] Fix broken --print-wasm-code for sync compiles.

R=clemensh@chromium.org
BUG=chromium:849713

Change-Id: I3af8a654c32f8eb77dcdd3dffeb2dd826b90db9d
Reviewed-on: https://chromium-review.googlesource.com/1087451Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53533}
parent 5e45a19d
...@@ -1402,6 +1402,9 @@ MaybeHandle<WasmModuleObject> CompileToModuleObjectInternal( ...@@ -1402,6 +1402,9 @@ MaybeHandle<WasmModuleObject> CompileToModuleObjectInternal(
isolate->debug()->OnAfterCompile(script); isolate->debug()->OnAfterCompile(script);
} }
// Log the code within the generated module for profiling.
compiled_module->LogWasmCodes(isolate);
return module_object; return module_object;
} }
...@@ -2849,6 +2852,9 @@ void AsyncCompileJob::FinishCompile() { ...@@ -2849,6 +2852,9 @@ void AsyncCompileJob::FinishCompile() {
// Finish the wasm script now and make it public to the debugger. // Finish the wasm script now and make it public to the debugger.
isolate_->debug()->OnAfterCompile(script); isolate_->debug()->OnAfterCompile(script);
// Log the code within the generated module for profiling.
compiled_module_->LogWasmCodes(isolate_);
// TODO(wasm): compiling wrappers should be made async as well. // TODO(wasm): compiling wrappers should be made async as well.
DoSync<CompileWrappers>(); DoSync<CompileWrappers>();
} }
......
...@@ -300,7 +300,6 @@ void WasmCode::Disassemble(const char* name, Isolate* isolate, std::ostream& os, ...@@ -300,7 +300,6 @@ void WasmCode::Disassemble(const char* name, Isolate* isolate, std::ostream& os,
os << "Body (size = " << body_size << ")\n"; os << "Body (size = " << body_size << ")\n";
#ifdef ENABLE_DISASSEMBLER #ifdef ENABLE_DISASSEMBLER
size_t instruction_size = body_size; size_t instruction_size = body_size;
if (constant_pool_offset_ && constant_pool_offset_ < instruction_size) { if (constant_pool_offset_ && constant_pool_offset_ < instruction_size) {
instruction_size = constant_pool_offset_; instruction_size = constant_pool_offset_;
......
...@@ -274,8 +274,6 @@ Handle<WasmModuleObject> WasmModuleObject::New( ...@@ -274,8 +274,6 @@ Handle<WasmModuleObject> WasmModuleObject::New(
shared->script()->set_wasm_module_object(*module_object); shared->script()->set_wasm_module_object(*module_object);
} }
module_object->set_shared(*shared); module_object->set_shared(*shared);
compiled_module->LogWasmCodes(isolate);
return module_object; return module_object;
} }
......
...@@ -627,6 +627,9 @@ MaybeHandle<WasmModuleObject> DeserializeNativeModule( ...@@ -627,6 +627,9 @@ MaybeHandle<WasmModuleObject> DeserializeNativeModule(
// the module into a state as if the last instance was collected. // the module into a state as if the last instance was collected.
WasmCompiledModule::Reset(isolate, *compiled_module); WasmCompiledModule::Reset(isolate, *compiled_module);
// Log the code within the generated module for profiling.
compiled_module->LogWasmCodes(isolate);
return module_object; return module_object;
} }
......
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