Commit f9ff62d2 authored by Camillo Bruni's avatar Camillo Bruni Committed by V8 LUCI CQ

[modules] Fix --trace-module-status

Make sure we update the module status before accessing it's code object
in PrintStatusTransition.

Bug: v8:11949
Change-Id: Ide1745eeeb0d5612034a42680d99fb97a9b110ab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3075361Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76124}
parent 7696ae83
......@@ -37,11 +37,11 @@ void PrintModuleName(Module module, std::ostream& os) {
#endif // OBJECT_PRINT
}
void PrintStatusTransition(Module module, Module::Status new_status) {
void PrintStatusTransition(Module module, Module::Status old_status) {
if (!FLAG_trace_module_status) return;
StdoutStream os;
os << "Changing module status from " << module.status() << " to "
<< new_status << " for ";
os << "Changing module status from " << old_status << " to "
<< module.status() << " for ";
PrintModuleName(module, os);
}
......@@ -56,9 +56,12 @@ void PrintStatusMessage(Module module, const char* message) {
void SetStatusInternal(Module module, Module::Status new_status) {
DisallowGarbageCollection no_gc;
#ifdef DEBUG
PrintStatusTransition(module, new_status);
#endif // DEBUG
Module::Status old_status = static_cast<Module::Status>(module.status());
module.set_status(new_status);
PrintStatusTransition(module, old_status);
#else
module.set_status(new_status);
#endif // DEBUG
}
} // end namespace
......
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