| Index: src/mips/simulator-mips.cc
|
| diff --git a/src/mips/simulator-mips.cc b/src/mips/simulator-mips.cc
|
| index 052eaed8272f7224d1fc7830dc92c48770cb108f..83af5868153aa6914bc6c237c152d3663be65959 100644
|
| --- a/src/mips/simulator-mips.cc
|
| +++ b/src/mips/simulator-mips.cc
|
| @@ -93,11 +93,17 @@ static FILE* coverage_log = NULL;
|
|
|
| static void InitializeCoverage() {
|
| char* file_name = getenv("V8_GENERATED_CODE_COVERAGE_LOG");
|
| - if (file_name != NULL) {
|
| + if (file_name != NULL && NULL == coverage_log) {
|
| coverage_log = fopen(file_name, "aw+");
|
| }
|
| }
|
|
|
| +static void DeinitCoverageLog() {
|
| + if (coverage_log != NULL) {
|
| + fclose(coverage_log);
|
| + coverage_log = NULL;
|
| + }
|
| +}
|
|
|
| void MipsDebugger::Stop(Instruction* instr) {
|
| // Get the stop code.
|
| @@ -131,6 +137,7 @@ void MipsDebugger::Stop(Instruction* instr) {
|
| #define UNSUPPORTED() printf("Unsupported instruction.\n");
|
|
|
| static void InitializeCoverage() {}
|
| +static void DeinitCoverageLog() {}
|
|
|
|
|
| void MipsDebugger::Stop(Instruction* instr) {
|
| @@ -903,6 +910,7 @@ Simulator::Simulator(Isolate* isolate) : isolate_(isolate) {
|
|
|
|
|
| Simulator::~Simulator() {
|
| + DeinitCoverageLog();
|
| }
|
|
|
|
|
|
|