Land change to notify valgrind when we modify code on x86. This does
not seem to impact performance and makes it a lot easier for people embedding V8 to run their application under valgrind. If we observe a negative performance impact, we will need to revise this again. Review URL: http://codereview.chromium.org/13612. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2662 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
6a8a7d580e
commit
f39651cbcd
6
LICENSE
6
LICENSE
@ -20,6 +20,12 @@ are:
|
||||
copyrighted by Douglas Crockford and Baruch Even and released under
|
||||
an MIT license.
|
||||
|
||||
- Valgrind client API header, located at third_party/valgrind/valgrind.h
|
||||
This is release under the BSD license.
|
||||
|
||||
- Valgrind client API header, located at third_party/valgrind/valgrind.h
|
||||
This is release under the BSD license.
|
||||
|
||||
These libraries have their own licenses; we recommend you read them,
|
||||
as their terms may differ from the terms below.
|
||||
|
||||
|
@ -27,6 +27,10 @@
|
||||
|
||||
// CPU specific code for ia32 independent of OS goes here.
|
||||
|
||||
#ifdef __GNUC__
|
||||
#include "third_party/valgrind/valgrind.h"
|
||||
#endif
|
||||
|
||||
#include "v8.h"
|
||||
|
||||
#include "cpu.h"
|
||||
@ -49,6 +53,15 @@ void CPU::FlushICache(void* start, size_t size) {
|
||||
|
||||
// If flushing of the instruction cache becomes necessary Windows has the
|
||||
// API function FlushInstructionCache.
|
||||
|
||||
// By default, valgrind only checks the stack for writes that might need to
|
||||
// invalidate already cached translated code. This leads to random
|
||||
// instability when code patches or moves are sometimes unnoticed. One
|
||||
// solution is to run valgrind with --smc-check=all, but this comes at a big
|
||||
// performance cost. We can notify valgrind to invalidate its cache.
|
||||
#ifdef VALGRIND_DISCARD_TRANSLATIONS
|
||||
VALGRIND_DISCARD_TRANSLATIONS(start, size);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
3924
src/third_party/valgrind/valgrind.h
vendored
Normal file
3924
src/third_party/valgrind/valgrind.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user