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 6747325 : void FlushInstructionCache(void* start, size_t size) {
15 13494623 : if (size == 0) return;
16 :
17 : #if defined(USE_SIMULATOR)
18 : base::MutexGuard lock_guard(Simulator::i_cache_mutex());
19 : Simulator::FlushICache(Simulator::i_cache(), start, size);
20 : #else
21 6747331 : CpuFeatures::FlushICache(start, size);
22 : #endif // USE_SIMULATOR
23 : }
24 :
25 : } // namespace internal
26 178779 : } // namespace v8
|