| Index: src/mips/simulator-mips.cc
|
| diff --git a/src/mips/simulator-mips.cc b/src/mips/simulator-mips.cc
|
| index 68fbdae96ee015d27ff33ae1ddaf0eed651b03a9..b759f690577f634dc2e73fefd2e8f9c2b94ac74a 100644
|
| --- a/src/mips/simulator-mips.cc
|
| +++ b/src/mips/simulator-mips.cc
|
| @@ -989,8 +989,7 @@ Simulator::Simulator(Isolate* isolate) : isolate_(isolate) {
|
| }
|
|
|
|
|
| -Simulator::~Simulator() {
|
| -}
|
| +Simulator::~Simulator() { free(stack_); }
|
|
|
|
|
| // When the generated code calls an external reference we need to catch that in
|
| @@ -1046,6 +1045,14 @@ class Redirection {
|
| return redirection->external_function();
|
| }
|
|
|
| + static void DeleteChain(Redirection* redirection) {
|
| + while (redirection != nullptr) {
|
| + Redirection* next = redirection->next_;
|
| + delete redirection;
|
| + redirection = next;
|
| + }
|
| + }
|
| +
|
| private:
|
| void* external_function_;
|
| uint32_t swi_instruction_;
|
| @@ -1054,6 +1061,19 @@ class Redirection {
|
| };
|
|
|
|
|
| +// static
|
| +void Simulator::TearDown(HashMap* i_cache, Redirection* first) {
|
| + Redirection::DeleteChain(first);
|
| + if (i_cache != nullptr) {
|
| + for (HashMap::Entry* entry = i_cache->Start(); entry != nullptr;
|
| + entry = i_cache->Next(entry)) {
|
| + delete static_cast<CachePage*>(entry->value);
|
| + }
|
| + delete i_cache;
|
| + }
|
| +}
|
| +
|
| +
|
| void* Simulator::RedirectExternalReference(void* external_function,
|
| ExternalReference::Type type) {
|
| Redirection* redirection = Redirection::Get(external_function, type);
|
|
|