[simulator] Hoist out common {SimulatorBase::TearDown}.
R=clemensh@chromium.org Change-Id: I53b9de78d6070d04b7535c828fd72225fd93afde Reviewed-on: https://chromium-review.googlesource.com/829375 Reviewed-by: Clemens Hammacher <clemensh@chromium.org> Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#50405}
This commit is contained in:
parent
d7b33bf623
commit
cd9e121128
@ -706,17 +706,6 @@ Simulator::~Simulator() {
|
|||||||
free(stack_);
|
free(stack_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
|
||||||
void SimulatorBase::TearDown(base::CustomMatcherHashMap* i_cache) {
|
|
||||||
if (i_cache != nullptr) {
|
|
||||||
for (base::HashMap::Entry* entry = i_cache->Start(); entry != nullptr;
|
|
||||||
entry = i_cache->Next(entry)) {
|
|
||||||
delete static_cast<CachePage*>(entry->value);
|
|
||||||
}
|
|
||||||
delete i_cache;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Get the active Simulator for the current thread.
|
// Get the active Simulator for the current thread.
|
||||||
Simulator* Simulator::current(Isolate* isolate) {
|
Simulator* Simulator::current(Isolate* isolate) {
|
||||||
|
@ -456,12 +456,6 @@ void Simulator::RunFrom(Instruction* start) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// static
|
|
||||||
void SimulatorBase::TearDown(base::CustomMatcherHashMap* i_cache) {
|
|
||||||
// TODO(all): Simulator flush I cache
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Calls into the V8 runtime are based on this very simple interface.
|
// Calls into the V8 runtime are based on this very simple interface.
|
||||||
// Note: To be able to return two values from some calls the code in runtime.cc
|
// Note: To be able to return two values from some calls the code in runtime.cc
|
||||||
// uses the ObjectPair structure.
|
// uses the ObjectPair structure.
|
||||||
|
@ -226,6 +226,10 @@ T FPRound(int64_t sign, int64_t exponent, uint64_t mantissa,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class CachePage {
|
||||||
|
// TODO(all): Simulate instruction cache.
|
||||||
|
};
|
||||||
|
|
||||||
// Representation of memory, with typed getters and setters for access.
|
// Representation of memory, with typed getters and setters for access.
|
||||||
class SimMemory {
|
class SimMemory {
|
||||||
public:
|
public:
|
||||||
|
@ -929,18 +929,6 @@ Simulator::Simulator(Isolate* isolate) : isolate_(isolate) {
|
|||||||
Simulator::~Simulator() { free(stack_); }
|
Simulator::~Simulator() { free(stack_); }
|
||||||
|
|
||||||
|
|
||||||
// static
|
|
||||||
void SimulatorBase::TearDown(base::CustomMatcherHashMap* i_cache) {
|
|
||||||
if (i_cache != nullptr) {
|
|
||||||
for (base::CustomMatcherHashMap::Entry* entry = i_cache->Start();
|
|
||||||
entry != nullptr; entry = i_cache->Next(entry)) {
|
|
||||||
delete static_cast<CachePage*>(entry->value);
|
|
||||||
}
|
|
||||||
delete i_cache;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Get the active Simulator for the current thread.
|
// Get the active Simulator for the current thread.
|
||||||
Simulator* Simulator::current(Isolate* isolate) {
|
Simulator* Simulator::current(Isolate* isolate) {
|
||||||
v8::internal::Isolate::PerIsolateThreadData* isolate_data =
|
v8::internal::Isolate::PerIsolateThreadData* isolate_data =
|
||||||
|
@ -862,18 +862,6 @@ Simulator::Simulator(Isolate* isolate) : isolate_(isolate) {
|
|||||||
Simulator::~Simulator() { free(stack_); }
|
Simulator::~Simulator() { free(stack_); }
|
||||||
|
|
||||||
|
|
||||||
// static
|
|
||||||
void SimulatorBase::TearDown(base::CustomMatcherHashMap* i_cache) {
|
|
||||||
if (i_cache != nullptr) {
|
|
||||||
for (base::HashMap::Entry* entry = i_cache->Start(); entry != nullptr;
|
|
||||||
entry = i_cache->Next(entry)) {
|
|
||||||
delete static_cast<CachePage*>(entry->value);
|
|
||||||
}
|
|
||||||
delete i_cache;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Get the active Simulator for the current thread.
|
// Get the active Simulator for the current thread.
|
||||||
Simulator* Simulator::current(Isolate* isolate) {
|
Simulator* Simulator::current(Isolate* isolate) {
|
||||||
v8::internal::Isolate::PerIsolateThreadData* isolate_data =
|
v8::internal::Isolate::PerIsolateThreadData* isolate_data =
|
||||||
|
@ -788,18 +788,6 @@ Simulator::~Simulator() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// static
|
|
||||||
void SimulatorBase::TearDown(base::CustomMatcherHashMap* i_cache) {
|
|
||||||
if (i_cache != nullptr) {
|
|
||||||
for (base::HashMap::Entry* entry = i_cache->Start(); entry != nullptr;
|
|
||||||
entry = i_cache->Next(entry)) {
|
|
||||||
delete static_cast<CachePage*>(entry->value);
|
|
||||||
}
|
|
||||||
delete i_cache;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Get the active Simulator for the current thread.
|
// Get the active Simulator for the current thread.
|
||||||
Simulator* Simulator::current(Isolate* isolate) {
|
Simulator* Simulator::current(Isolate* isolate) {
|
||||||
v8::internal::Isolate::PerIsolateThreadData* isolate_data =
|
v8::internal::Isolate::PerIsolateThreadData* isolate_data =
|
||||||
|
@ -1539,18 +1539,6 @@ Simulator::Simulator(Isolate* isolate) : isolate_(isolate) {
|
|||||||
|
|
||||||
Simulator::~Simulator() { free(stack_); }
|
Simulator::~Simulator() { free(stack_); }
|
||||||
|
|
||||||
|
|
||||||
// static
|
|
||||||
void SimulatorBase::TearDown(base::CustomMatcherHashMap* i_cache) {
|
|
||||||
if (i_cache != nullptr) {
|
|
||||||
for (base::HashMap::Entry* entry = i_cache->Start(); entry != nullptr;
|
|
||||||
entry = i_cache->Next(entry)) {
|
|
||||||
delete static_cast<CachePage*>(entry->value);
|
|
||||||
}
|
|
||||||
delete i_cache;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the active Simulator for the current thread.
|
// Get the active Simulator for the current thread.
|
||||||
Simulator* Simulator::current(Isolate* isolate) {
|
Simulator* Simulator::current(Isolate* isolate) {
|
||||||
v8::internal::Isolate::PerIsolateThreadData* isolate_data =
|
v8::internal::Isolate::PerIsolateThreadData* isolate_data =
|
||||||
|
@ -39,6 +39,17 @@ void SimulatorBase::Initialize(Isolate* isolate) {
|
|||||||
ExternalReference::set_redirector(isolate, &RedirectExternalReference);
|
ExternalReference::set_redirector(isolate, &RedirectExternalReference);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
void SimulatorBase::TearDown(base::CustomMatcherHashMap* i_cache) {
|
||||||
|
if (i_cache != nullptr) {
|
||||||
|
for (base::HashMap::Entry* entry = i_cache->Start(); entry != nullptr;
|
||||||
|
entry = i_cache->Next(entry)) {
|
||||||
|
delete static_cast<CachePage*>(entry->value);
|
||||||
|
}
|
||||||
|
delete i_cache;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void* SimulatorBase::RedirectExternalReference(Isolate* isolate,
|
void* SimulatorBase::RedirectExternalReference(Isolate* isolate,
|
||||||
void* external_function,
|
void* external_function,
|
||||||
|
@ -24,7 +24,6 @@ class SimulatorBase {
|
|||||||
|
|
||||||
// Call on isolate initialization and teardown.
|
// Call on isolate initialization and teardown.
|
||||||
static void Initialize(Isolate* isolate);
|
static void Initialize(Isolate* isolate);
|
||||||
// TODO(mstarzinger): Move implementation to "simulator-base.cc" file.
|
|
||||||
static void TearDown(base::CustomMatcherHashMap* i_cache);
|
static void TearDown(base::CustomMatcherHashMap* i_cache);
|
||||||
|
|
||||||
static base::Mutex* redirection_mutex() { return redirection_mutex_; }
|
static base::Mutex* redirection_mutex() { return redirection_mutex_; }
|
||||||
|
Loading…
Reference in New Issue
Block a user