v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
cpu-ia32.cc
Go to the documentation of this file.
1
// Copyright 2011 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
// CPU specific code for ia32 independent of OS goes here.
6
7
#if V8_TARGET_ARCH_IA32
8
9
#include "
src/codegen/cpu-features.h
"
10
#if defined(__GNUC__) && !defined(GOOGLE3)
11
#include "third_party/valgrind/valgrind.h"
12
#endif
13
14
namespace
v8
{
15
namespace
internal
{
16
17
void
CpuFeatures::FlushICache
(
void
*
start
,
size_t
size) {
18
// No need to flush the instruction cache on Intel. On Intel instruction
19
// cache flushing is only necessary when multiple cores running the same
20
// code simultaneously. V8 (and JavaScript) is single threaded and when code
21
// is patched on an intel CPU the core performing the patching will have its
22
// own instruction cache updated automatically.
23
24
// If flushing of the instruction cache becomes necessary Windows has the
25
// API function FlushInstructionCache.
26
27
// By default, valgrind only checks the stack for writes that might need to
28
// invalidate already cached translated code. This leads to random
29
// instability when code patches or moves are sometimes unnoticed. One
30
// solution is to run valgrind with --smc-check=all, but this comes at a big
31
// performance cost. We can notify valgrind to invalidate its cache.
32
#ifdef VALGRIND_DISCARD_TRANSLATIONS
33
unsigned
res = VALGRIND_DISCARD_TRANSLATIONS(
start
, size);
34
USE
(res);
35
#endif
36
}
37
38
}
// namespace internal
39
}
// namespace v8
40
41
#endif
// V8_TARGET_ARCH_IA32
v8::internal::CpuFeatures::FlushICache
static void FlushICache(void *start, size_t size)
Definition
cpu-riscv.cc:15
cpu-features.h
start
int start
Definition
debug-coverage.cc:595
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
v8
Definition
api-arguments-inl.h:19
USE
#define USE(...)
Definition
macros.h:293
src
codegen
ia32
cpu-ia32.cc
Generated on Sun Apr 6 2025 21:08:50 for v8 by
1.12.0