diff options
author | Myles Borins <mylesborins@google.com> | 2018-04-10 21:39:51 -0400 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2018-04-11 13:22:42 -0400 |
commit | 12a1b9b8049462e47181a298120243dc83e81c55 (patch) | |
tree | 8605276308c8b4e3597516961266bae1af57557a /deps/v8/src/simulator-base.cc | |
parent | 78cd8263354705b767ef8c6a651740efe4931ba0 (diff) | |
download | android-node-v8-12a1b9b8049462e47181a298120243dc83e81c55.tar.gz android-node-v8-12a1b9b8049462e47181a298120243dc83e81c55.tar.bz2 android-node-v8-12a1b9b8049462e47181a298120243dc83e81c55.zip |
deps: update V8 to 6.6.346.23
PR-URL: https://github.com/nodejs/node/pull/19201
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/v8/src/simulator-base.cc')
-rw-r--r-- | deps/v8/src/simulator-base.cc | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/deps/v8/src/simulator-base.cc b/deps/v8/src/simulator-base.cc index 72a5daefce..f075ad72ac 100644 --- a/deps/v8/src/simulator-base.cc +++ b/deps/v8/src/simulator-base.cc @@ -20,9 +20,21 @@ base::Mutex* SimulatorBase::redirection_mutex_ = nullptr; Redirection* SimulatorBase::redirection_ = nullptr; // static +base::Mutex* SimulatorBase::i_cache_mutex_ = nullptr; + +// static +base::CustomMatcherHashMap* SimulatorBase::i_cache_ = nullptr; + +// static void SimulatorBase::InitializeOncePerProcess() { DCHECK_NULL(redirection_mutex_); redirection_mutex_ = new base::Mutex(); + + DCHECK_NULL(i_cache_mutex_); + i_cache_mutex_ = new base::Mutex(); + + DCHECK_NULL(i_cache_); + i_cache_ = new base::CustomMatcherHashMap(&Simulator::ICacheMatch); } // static @@ -32,40 +44,40 @@ void SimulatorBase::GlobalTearDown() { Redirection::DeleteChain(redirection_); redirection_ = nullptr; -} -// static -void SimulatorBase::Initialize(Isolate* isolate) { - ExternalReference::set_redirector(isolate, &RedirectExternalReference); -} + delete i_cache_mutex_; + i_cache_mutex_ = nullptr; -// 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)) { + 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; } + delete i_cache_; + i_cache_ = nullptr; +} + +// static +void SimulatorBase::Initialize(Isolate* isolate) { + ExternalReference::set_redirector(isolate, &RedirectExternalReference); } // static -void* SimulatorBase::RedirectExternalReference(Isolate* isolate, - void* external_function, +void* SimulatorBase::RedirectExternalReference(void* external_function, ExternalReference::Type type) { base::LockGuard<base::Mutex> lock_guard(Simulator::redirection_mutex()); - Redirection* redirection = Redirection::Get(isolate, external_function, type); + Redirection* redirection = Redirection::Get(external_function, type); return redirection->address_of_instruction(); } -Redirection::Redirection(Isolate* isolate, void* external_function, - ExternalReference::Type type) +Redirection::Redirection(void* external_function, ExternalReference::Type type) : external_function_(external_function), type_(type), next_(nullptr) { next_ = Simulator::redirection(); + base::LockGuard<base::Mutex> lock_guard(Simulator::i_cache_mutex()); Simulator::SetRedirectInstruction( reinterpret_cast<Instruction*>(address_of_instruction())); - Simulator::FlushICache(isolate->simulator_i_cache(), + Simulator::FlushICache(Simulator::i_cache(), reinterpret_cast<void*>(&instruction_), sizeof(instruction_)); Simulator::set_redirection(this); @@ -77,7 +89,7 @@ Redirection::Redirection(Isolate* isolate, void* external_function, } // static -Redirection* Redirection::Get(Isolate* isolate, void* external_function, +Redirection* Redirection::Get(void* external_function, ExternalReference::Type type) { Redirection* current = Simulator::redirection(); for (; current != nullptr; current = current->next_) { @@ -86,7 +98,7 @@ Redirection* Redirection::Get(Isolate* isolate, void* external_function, return current; } } - return new Redirection(isolate, external_function, type); + return new Redirection(external_function, type); } } // namespace internal |