Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: src/d8.cc

Issue 2694933004: [d8] Call Isolate::Dispose also on early exit via quit() (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index e7e8c98343e5679f7c8550fe01e8a912433bb338..09cd9631b03b1feb16804001aeac04040ebecc90 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -1199,6 +1199,7 @@ void Shell::QuitOnce(v8::FunctionCallbackInfo<v8::Value>* args) {
->Int32Value(args->GetIsolate()->GetCurrentContext())
.FromMaybe(0);
CleanupWorkers();
+ args->GetIsolate()->Exit();
OnExit(args->GetIsolate());
Exit(exit_code);
}
@@ -1721,6 +1722,14 @@ void Shell::WriteLcovData(v8::Isolate* isolate, const char* file) {
}
void Shell::OnExit(v8::Isolate* isolate) {
+ // Dump basic block profiling data.
+ if (i::BasicBlockProfiler* profiler =
+ reinterpret_cast<i::Isolate*>(isolate)->basic_block_profiler()) {
+ i::OFStream os(stdout);
+ os << *profiler;
+ }
+ isolate->Dispose();
+
if (i::FLAG_dump_counters || i::FLAG_dump_counters_nvp) {
int number_of_counters = 0;
for (CounterMap::Iterator i(counter_map_); i.More(); i.Next()) {
@@ -2981,13 +2990,6 @@ int Shell::Main(int argc, char* argv[]) {
CollectGarbage(isolate);
}
OnExit(isolate);
- // Dump basic block profiling data.
- if (i::BasicBlockProfiler* profiler =
- reinterpret_cast<i::Isolate*>(isolate)->basic_block_profiler()) {
- i::OFStream os(stdout);
- os << *profiler;
- }
- isolate->Dispose();
V8::Dispose();
V8::ShutdownPlatform();
delete g_platform;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698