Line data Source code
1 : // Copyright 2019 the V8 project authors. All rights reserved.
2 : // Use of this source code is governed by a BSD-style license that can be
3 : // found in the LICENSE file.
4 :
5 : #include "src/flush-instruction-cache.h"
6 :
7 : #include "src/base/platform/mutex.h"
8 : #include "src/cpu-features.h"
9 : #include "src/simulator.h"
10 :
11 : namespace v8 {
12 : namespace internal {
13 :
14 7436388 : void FlushInstructionCache(void* start, size_t size) {
15 7436388 : if (size == 0) return;
16 7436612 : if (FLAG_jitless) return;
17 :
18 : #if defined(USE_SIMULATOR)
19 : base::MutexGuard lock_guard(Simulator::i_cache_mutex());
20 : Simulator::FlushICache(Simulator::i_cache(), start, size);
21 : #else
22 7224296 : CpuFeatures::FlushICache(start, size);
23 : #endif // USE_SIMULATOR
24 : }
25 :
26 : } // namespace internal
27 120216 : } // namespace v8
|