From 927e5605eb2d27f303f24ad0fd60fc5d980d1a1d Mon Sep 17 00:00:00 2001 From: "jochen@chromium.org" Date: Fri, 28 Feb 2014 10:55:47 +0000 Subject: [PATCH] Delete the simulator when we don't need it anymore BUG=none R=svenpanne@chromium.org, ulan@chromium.org LOG=n Review URL: https://codereview.chromium.org/180243010 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19598 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/simulator-arm.cc | 4 ++++ src/isolate.cc | 7 +++++++ src/isolate.h | 1 + src/mips/simulator-mips.cc | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/src/arm/simulator-arm.cc b/src/arm/simulator-arm.cc index ac36687..a7fccdd 100644 --- a/src/arm/simulator-arm.cc +++ b/src/arm/simulator-arm.cc @@ -796,6 +796,10 @@ Simulator::Simulator(Isolate* isolate) : isolate_(isolate) { } +Simulator::~Simulator() { +} + + // When the generated code calls an external reference we need to catch that in // the simulator. The external reference will be a function compiled for the // host architecture. We need to call that function instead of trying to diff --git a/src/isolate.cc b/src/isolate.cc index a9a5161..2d45d78 100644 --- a/src/isolate.cc +++ b/src/isolate.cc @@ -1463,6 +1463,13 @@ Isolate::ThreadDataTable::~ThreadDataTable() { } +Isolate::PerIsolateThreadData::~PerIsolateThreadData() { +#if defined(USE_SIMULATOR) + delete simulator_; +#endif +} + + Isolate::PerIsolateThreadData* Isolate::ThreadDataTable::Lookup(Isolate* isolate, ThreadId thread_id) { diff --git a/src/isolate.h b/src/isolate.h index ef1dd30..897197b 100644 --- a/src/isolate.h +++ b/src/isolate.h @@ -396,6 +396,7 @@ class Isolate { #endif next_(NULL), prev_(NULL) { } + ~PerIsolateThreadData(); Isolate* isolate() const { return isolate_; } ThreadId thread_id() const { return thread_id_; } diff --git a/src/mips/simulator-mips.cc b/src/mips/simulator-mips.cc index efce887..d26499b 100644 --- a/src/mips/simulator-mips.cc +++ b/src/mips/simulator-mips.cc @@ -925,6 +925,10 @@ Simulator::Simulator(Isolate* isolate) : isolate_(isolate) { } +Simulator::~Simulator() { +} + + // When the generated code calls an external reference we need to catch that in // the simulator. The external reference will be a function compiled for the // host architecture. We need to call that function instead of trying to -- 2.7.4