10f4e6c379
This reverts commit 61367a25fa
.
Reason for revert: http://shortn/_amqTfxgjk0
Original change's description:
> [platform][cleanup] Fix --enable-tracing
>
> The flag --enable-tracing can be used to measure how much time is spent
> in a scope. In d8 this flag did not work properly for the following
> reasons:
>
> * The tracing file is not written when the JavaScript code calls quit().
>
> * The tracing file is not written when the JavaScript code throws an
> uncaught exception, except if the --throws flag is passed to d8.
>
> The reason for these two issues is that both call Shell::Exit(), which
> end d8 immediately without calling any destructors. In addition I moved
> in a recent CL the destruction of the platform after the destruction of
> the file handle for the tracing file. Thereby the tracing file did not
> get filled with content even destructors were executed.
>
> With this CL I also call the destructors of the platform and of the file
> handle in the Shell::Exit() function. For this I make Shell::Exit()
> platform independent and let it call the platform dependent
> Shell::OSExit() at the end.
>
> R=rmcilroy@chromium.org
>
> Change-Id: I14425b6a5c25b757211bc8b9959a9cc8bfa0602c
> Reviewed-on: https://chromium-review.googlesource.com/789038
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Commit-Queue: Andreas Haas <ahaas@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#49659}
TBR=rmcilroy@chromium.org,ahaas@chromium.org
Change-Id: I17c6f19c38cb337b00707f606f267b52b7f2c1e6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/792991
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49663}
27 lines
674 B
C++
27 lines
674 B
C++
// Copyright 2009 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "src/d8.h"
|
|
|
|
|
|
namespace v8 {
|
|
|
|
|
|
void Shell::AddOSMethods(Isolate* isolate, Local<ObjectTemplate> os_templ) {}
|
|
|
|
char* Shell::ReadCharsFromTcpPort(const char* name, int* size_out) {
|
|
// TODO(leszeks): No reason this shouldn't exist on windows.
|
|
return nullptr;
|
|
}
|
|
|
|
void Shell::Exit(int exit_code) {
|
|
// Use TerminateProcess avoid races between isolate threads and
|
|
// static destructors.
|
|
fflush(stdout);
|
|
fflush(stderr);
|
|
TerminateProcess(GetCurrentProcess(), exit_code);
|
|
}
|
|
|
|
} // namespace v8
|