diff --git a/DEPS b/DEPS index 35994d242ef..c2357c961e8 100644 --- a/DEPS +++ b/DEPS @@ -72,7 +72,7 @@ vars = { # Scripts that make 'git cl format' work. "clang_format_scripts_rev": "bb994c6f067340c1135eb43eed84f4b33cfa7397", - "gperftools_revision": "180bfa10d7cb38e8b3784d60943d50e8fcef0dcb", + "gperftools_revision": "bf8b714bf5075d0a6f2f28504b43095e2b1e11c5", # Revisions of /third_party/* dependencies. # Note that putting an EOL comment after a dependency below will prevent the diff --git a/runtime/vm/malloc_hooks_riscv.cc b/runtime/vm/malloc_hooks_riscv.cc new file mode 100644 index 00000000000..f4f46191c3c --- /dev/null +++ b/runtime/vm/malloc_hooks_riscv.cc @@ -0,0 +1,17 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include "vm/malloc_hooks.h" + +#include "vm/globals.h" + +#if defined(HOST_ARCH_RISCV32) || defined(HOST_ARCH_RISCV64) + +namespace dart { + +const intptr_t kSkipCount = 5; + +} // namespace dart + +#endif // defined(HOST_ARCH_RISCV32) || defined(HOST_ARCH_RISCV64) diff --git a/runtime/vm/vm_sources.gni b/runtime/vm/vm_sources.gni index b7a9c01a9ae..5efb5042f5c 100644 --- a/runtime/vm/vm_sources.gni +++ b/runtime/vm/vm_sources.gni @@ -165,6 +165,7 @@ vm_sources = [ "malloc_hooks_arm.cc", "malloc_hooks_arm64.cc", "malloc_hooks_ia32.cc", + "malloc_hooks_riscv.cc", "malloc_hooks_tcmalloc.cc", "malloc_hooks_unsupported.cc", "malloc_hooks_x64.cc", diff --git a/third_party/tcmalloc/BUILD.gn b/third_party/tcmalloc/BUILD.gn index 0eb6244d403..fec7c407d81 100644 --- a/third_party/tcmalloc/BUILD.gn +++ b/third_party/tcmalloc/BUILD.gn @@ -128,8 +128,6 @@ source_set("tcmalloc") { "gperftools/src/fake_stacktrace_scope.cc", # Not using the cpuprofiler - "gperftools/src/base/thread_lister.c", - "gperftools/src/base/thread_lister.h", "gperftools/src/profile-handler.cc", "gperftools/src/profile-handler.h", "gperftools/src/profiledata.cc", diff --git a/third_party/tcmalloc/configure_command b/third_party/tcmalloc/configure_command index 7249c18dca6..5c13500340b 100644 --- a/third_party/tcmalloc/configure_command +++ b/third_party/tcmalloc/configure_command @@ -1,2 +1,2 @@ -./auto_gen.sh +./autogen.sh ./configure --enable-emergency-malloc --enable-frame-pointers --disable-cpu-profiler --disable-heap-checker --disable-debugalloc --enable-sized-delete --disable-libunwind diff --git a/third_party/tcmalloc/include/config.h b/third_party/tcmalloc/include/config.h index ef33e13d4f0..0c0125ee205 100644 --- a/third_party/tcmalloc/include/config.h +++ b/third_party/tcmalloc/include/config.h @@ -24,9 +24,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ASM_PTRACE_H */ -/* Define to 1 if compiler supports __builtin_stack_pointer */ -/* #undef HAVE_BUILTIN_STACK_POINTER */ - /* Define to 1 if you have the header file. */ /* #undef HAVE_CONFLICT_SIGNAL_H */ @@ -64,10 +61,6 @@ */ /* #undef HAVE_DECL_SLEEP */ -/* Define to 1 if you have the declaration of `uname', and to 0 if you don't. - */ -#define HAVE_DECL_UNAME 1 - /* Define to 1 if you have the declaration of `valloc', and to 0 if you don't. */ #define HAVE_DECL_VALLOC 1 @@ -114,15 +107,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MALLOC_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 -/* define if the compiler implements namespaces */ -#define HAVE_NAMESPACES 1 - /* Define to 1 if you have the header file. */ #define HAVE_POLL_H 1 @@ -148,6 +135,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 @@ -202,9 +192,6 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNWIND_H 1 -/* Define to 1 if you have the header file. */ -/* #undef HAVE_VALGRIND_H */ - /* define if your compiler has __attribute__ */ #define HAVE___ATTRIBUTE__ 1 @@ -214,9 +201,6 @@ /* Define to 1 if compiler supports __environ */ #define HAVE___ENVIRON 1 -/* Define to 1 if the system has the type `__int64'. */ -/* #undef HAVE___INT64 */ - /* Define to 1 if you have the `__sbrk' function. */ #define HAVE___SBRK 1 @@ -239,7 +223,7 @@ #define PACKAGE_NAME "gperftools" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "gperftools 2.8" +#define PACKAGE_STRING "gperftools 2.10" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "gperftools" @@ -248,7 +232,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.8" +#define PACKAGE_VERSION "2.10" /* How to access the PC from a struct ucontext */ /* #undef PC_FROM_UCONTEXT */ @@ -260,15 +244,6 @@ "config.h" before anything else. */ #define PERFTOOLS_DLL_DECL /**/ -/* printf format code for printing a size_t and ssize_t */ -#define PRIdS "ld" - -/* printf format code for printing a size_t and ssize_t */ -#define PRIuS "lu" - -/* printf format code for printing a size_t and ssize_t */ -#define PRIxS "lx" - /* Mark the systems where we know it's bad if pthreads runs too early before main (before threads are initialized, presumably). */ #ifdef __FreeBSD__ @@ -279,12 +254,11 @@ your system. */ /* #undef PTHREAD_CREATE_JOINABLE */ -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #define STDC_HEADERS 1 -/* the namespace where STL code like vector<> is defined */ -#define STL_NAMESPACE std - /* Define 8 bytes of allocation alignment for tcmalloc */ /* #undef TCMALLOC_ALIGN_8BYTES */ @@ -292,19 +266,13 @@ /* #undef TCMALLOC_PAGE_SIZE_SHIFT */ /* Version number of package */ -#define VERSION "2.8" +#define VERSION "2.10" /* C99 says: define this to get the PRI... macros from stdint.h */ #ifndef __STDC_FORMAT_MACROS # define __STDC_FORMAT_MACROS 1 #endif -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -/* #undef inline */ -#endif - #ifdef __MINGW32__ #include "windows/mingw.h" diff --git a/tools/bots/test_matrix.json b/tools/bots/test_matrix.json index 76f87722bb2..b94faf722d2 100644 --- a/tools/bots/test_matrix.json +++ b/tools/bots/test_matrix.json @@ -1291,6 +1291,7 @@ "arguments": [ "--no-clang", "--use-qemu", + "--use-mallinfo2", "dart_precompiled_runtime", "runtime" ] diff --git a/tools/gn.py b/tools/gn.py index 647f045d061..c93daea550b 100755 --- a/tools/gn.py +++ b/tools/gn.py @@ -245,9 +245,7 @@ def ToGnArgs(args, mode, arch, target_os, sanitizer, verify_sdk_hash): # Use tcmalloc only when targeting Linux and when not using ASAN. gn_args['dart_use_tcmalloc'] = ((gn_args['target_os'] == 'linux') and - (gn_args['target_cpu'] != 'arm') and (gn_args['target_cpu'] != 'riscv32') and - (gn_args['target_cpu'] != 'riscv64') and sanitizer == 'none') # Use mallinfo2 if specified on the command line