���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /home/real/node-v13.0.1/deps/v8/src/wasm/ |
// Copyright 2018 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_WASM_WASM_IMPORT_WRAPPER_CACHE_H_ #define V8_WASM_WASM_IMPORT_WRAPPER_CACHE_H_ #include "src/base/platform/mutex.h" #include "src/compiler/wasm-compiler.h" namespace v8 { namespace internal { class Counters; namespace wasm { class WasmCode; class WasmEngine; using FunctionSig = Signature<ValueType>; // Implements a cache for import wrappers. class WasmImportWrapperCache { public: using CacheKey = std::pair<compiler::WasmImportCallKind, FunctionSig*>; class CacheKeyHash { public: size_t operator()(const CacheKey& key) const { return base::hash_combine(static_cast<uint8_t>(key.first), *key.second); } }; // Helper class to modify the cache under a lock. class ModificationScope { public: explicit ModificationScope(WasmImportWrapperCache* cache) : cache_(cache), guard_(&cache->mutex_) {} V8_EXPORT_PRIVATE WasmCode*& operator[](const CacheKey& key); private: WasmImportWrapperCache* const cache_; base::MutexGuard guard_; }; // Not thread-safe, use ModificationScope to get exclusive write access to the // cache. V8_EXPORT_PRIVATE WasmCode*& operator[](const CacheKey& key); // Assumes the key exists in the map. V8_EXPORT_PRIVATE WasmCode* Get(compiler::WasmImportCallKind kind, FunctionSig* sig) const; ~WasmImportWrapperCache(); private: base::Mutex mutex_; std::unordered_map<CacheKey, WasmCode*, CacheKeyHash> entry_map_; }; } // namespace wasm } // namespace internal } // namespace v8 #endif // V8_WASM_WASM_IMPORT_WRAPPER_CACHE_H_