| Index: src/mips64/simulator-mips64.cc
|
| diff --git a/src/mips64/simulator-mips64.cc b/src/mips64/simulator-mips64.cc
|
| index 29fccd0b5974b8d5b81f2002f0d4fd6656d65866..0d70fab3893f5679ae7b983f76e9d90776bd05f8 100644
|
| --- a/src/mips64/simulator-mips64.cc
|
| +++ b/src/mips64/simulator-mips64.cc
|
| @@ -920,8 +920,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
|
| @@ -977,6 +976,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_;
|
| @@ -985,6 +992,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);
|
|
|