diff --git a/BUILDING.md b/BUILDING.md index 7a17a24b595c17..8725db965eb0e4 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -328,7 +328,7 @@ If you are updating tests and want to run tests in a single test file (e.g. `test/parallel/test-stream2-transform.js`): ```text -$ python tools/test.py parallel/test-stream2-transform.js +$ python tools/test.py test/parallel/test-stream2-transform.js ``` You can execute the entire suite of tests for a given subsystem diff --git a/CHANGELOG.md b/CHANGELOG.md index 39018bccec7b45..9170fa4e3223a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,8 @@ release. -12.8.1
+12.9.0
+12.8.1
12.8.0
12.7.0
12.6.0
diff --git a/Makefile b/Makefile index 1e4915a6d2ebed..58f4cc7a5795b8 100644 --- a/Makefile +++ b/Makefile @@ -170,12 +170,16 @@ clean: ## Remove build artifacts. $(RM) -r node_modules @if [ -d deps/icu ]; then echo deleting deps/icu; $(RM) -r deps/icu; fi $(RM) test.tap - # Next one is legacy remove this at some point - $(RM) -r test/tmp* - $(RM) -r test/.tmp* + $(MAKE) testclean $(MAKE) test-addons-clean $(MAKE) bench-addons-clean +.PHONY: testclean +testclean: +# Next one is legacy remove this at some point + $(RM) -r test/tmp* + $(RM) -r test/.tmp* + .PHONY: distclean distclean: $(RM) -r out @@ -294,6 +298,10 @@ jstest: build-addons build-js-native-api-tests build-node-api-tests ## Runs addo $(CI_JS_SUITES) \ $(CI_NATIVE_SUITES) +.PHONY: tooltest +tooltest: + @$(PYTHON) test/tools/test-js2c.py + .PHONY: coverage-run-js coverage-run-js: $(RM) -r out/$(BUILDTYPE)/.coverage @@ -311,6 +319,7 @@ test: all ## Runs default tests, linters, and builds docs. $(MAKE) -s build-node-api-tests $(MAKE) -s cctest $(MAKE) -s jstest + $(MAKE) -s tooltest .PHONY: test-only test-only: all ## For a quick test, does not run linter or build docs. @@ -319,6 +328,7 @@ test-only: all ## For a quick test, does not run linter or build docs. $(MAKE) build-node-api-tests $(MAKE) cctest $(MAKE) jstest + $(MAKE) tooltest # Used by `make coverage-test` test-cov: all @@ -509,7 +519,7 @@ test-ci-native: | test/addons/.buildstamp test/js-native-api/.buildstamp test/no test-ci-js: | clear-stalled $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ --mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \ - $(TEST_CI_ARGS) $(CI_JS_SUITES) --skip-tests=sequential/test-benchmark-napi + $(TEST_CI_ARGS) $(CI_JS_SUITES) @echo "Clean up any leftover processes, error if found." ps awwx | grep Release/node | grep -v grep | cat @PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \ diff --git a/benchmark/buffers/buffer-copy.js b/benchmark/buffers/buffer-copy.js new file mode 100644 index 00000000000000..164f31420766d5 --- /dev/null +++ b/benchmark/buffers/buffer-copy.js @@ -0,0 +1,19 @@ +'use strict'; +const common = require('../common.js'); + +const bench = common.createBenchmark(main, { + bytes: [0, 8, 128, 32 * 1024], + partial: ['true', 'false'], + n: [6e6] +}); + +function main({ n, bytes, partial }) { + const source = Buffer.allocUnsafe(bytes); + const target = Buffer.allocUnsafe(bytes); + const sourceStart = (partial === 'true' ? Math.floor(bytes / 2) : 0); + bench.start(); + for (let i = 0; i < n; i++) { + source.copy(target, 0, sourceStart); + } + bench.end(n); +} diff --git a/benchmark/common.js b/benchmark/common.js index b4778d71935e25..6a3be4fc376920 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -25,6 +25,10 @@ function Benchmark(fn, configs, options) { if (options && options.flags) { this.flags = this.flags.concat(options.flags); } + if (process.env.NODE_BENCHMARK_FLAGS) { + const flags = process.env.NODE_BENCHMARK_FLAGS.split(/\s+/); + this.flags = this.flags.concat(flags); + } // Holds process.hrtime value this._time = [0, 0]; // Used to make sure a benchmark only start a timer once diff --git a/common.gypi b/common.gypi index b86e5e05d7df9a..6c4b04d7d06ecc 100644 --- a/common.gypi +++ b/common.gypi @@ -38,7 +38,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.16', + 'v8_embedder_string': '-node.15', ##### V8 defaults for Node.js ##### diff --git a/configure.py b/configure.py index cc805d3fd165fd..beab9ceccce9ad 100755 --- a/configure.py +++ b/configure.py @@ -11,7 +11,6 @@ import shlex import subprocess import shutil -import string from distutils.spawn import find_executable as which # If not run from node/, cd to node/. @@ -402,6 +401,11 @@ help='build with Large Pages support. This feature is supported only on Linux kernel' + '>= 2.6.38 with Transparent Huge pages enabled and FreeBSD') +parser.add_option('--use-largepages-script-lld', + action='store_true', + dest='node_use_large_pages_script_lld', + help='link against the LLVM ld linker script. Implies -fuse-ld=lld in the linker flags') + intl_optgroup.add_option('--with-intl', action='store', dest='with_intl', @@ -626,18 +630,14 @@ def print_verbose(x): def b(value): """Returns the string 'true' if value is truthy, 'false' otherwise.""" - if value: - return 'true' - else: - return 'false' + return 'true' if value else 'false' def B(value): """Returns 1 if value is truthy, 0 otherwise.""" - if value: - return 1 - else: - return 0 + return 1 if value else 0 +def to_utf8(s): + return s if isinstance(s, str) else s.decode("utf-8") def pkg_config(pkg): """Run pkg-config on the specified package @@ -652,7 +652,7 @@ def pkg_config(pkg): try: proc = subprocess.Popen(shlex.split(pkg_config) + args, stdout=subprocess.PIPE) - val = proc.communicate()[0].strip() + val = to_utf8(proc.communicate()[0]).strip() except OSError as e: if e.errno != errno.ENOENT: raise e # Unexpected error. return (None, None, None, None) # No pkg-config/pkgconf installed. @@ -668,10 +668,10 @@ def try_check_compiler(cc, lang): except OSError: return (False, False, '', '') - proc.stdin.write('__clang__ __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ ' - '__clang_major__ __clang_minor__ __clang_patchlevel__') + proc.stdin.write(b'__clang__ __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ ' + b'__clang_major__ __clang_minor__ __clang_patchlevel__') - values = (proc.communicate()[0].split() + ['0'] * 7)[0:7] + values = (to_utf8(proc.communicate()[0]).split() + ['0'] * 7)[0:7] is_clang = values[0] == '1' gcc_version = tuple(map(int, values[1:1+3])) clang_version = tuple(map(int, values[4:4+3])) if is_clang else None @@ -696,7 +696,7 @@ def get_version_helper(cc, regexp): consider adjusting the CC environment variable if you installed it in a non-standard prefix.''') - match = re.search(regexp, proc.communicate()[1]) + match = re.search(regexp, to_utf8(proc.communicate()[1])) if match: return match.group(2) @@ -715,7 +715,7 @@ def get_nasm_version(asm): return '0' match = re.match(r"NASM version ([2-9]\.[0-9][0-9]+)", - proc.communicate()[0]) + to_utf8(proc.communicate()[0])) if match: return match.group(1) @@ -746,7 +746,7 @@ def get_gas_version(cc): consider adjusting the CC environment variable if you installed it in a non-standard prefix.''') - gas_ret = proc.communicate()[1] + gas_ret = to_utf8(proc.communicate()[1]) match = re.match(r"GNU assembler version ([2-9]\.[0-9]+)", gas_ret) if match: @@ -811,10 +811,8 @@ def cc_macros(cc=None): consider adjusting the CC environment variable if you installed it in a non-standard prefix.''') - p.stdin.write('\n') - out = p.communicate()[0] - - out = str(out).split('\n') + p.stdin.write(b'\n') + out = to_utf8(p.communicate()[0]).split('\n') k = {} for line in out: @@ -1055,6 +1053,7 @@ def configure_node(o): raise Exception( 'Large pages need Linux kernel version >= 2.6.38') o['variables']['node_use_large_pages'] = b(options.node_use_large_pages) + o['variables']['node_use_large_pages_script_lld'] = b(options.node_use_large_pages_script_lld) if options.no_ifaddrs: o['defines'] += ['SUNOS_NO_IFADDRS'] @@ -1294,7 +1293,7 @@ def glob_to_var(dir_base, dir_sub, patch_dir): def configure_intl(o): def icu_download(path): - depFile = 'tools/icu/current_ver.dep'; + depFile = 'tools/icu/current_ver.dep' with open(depFile) as f: icus = json.load(f) # download ICU, if needed @@ -1363,7 +1362,7 @@ def write_config(data, name): o['variables']['icu_small'] = b(True) locs = set(options.with_icu_locales.split(',')) locs.add('root') # must have root - o['variables']['icu_locales'] = string.join(locs,',') + o['variables']['icu_locales'] = ','.join(str(loc) for loc in locs) # We will check a bit later if we can use the canned deps/icu-small elif with_intl == 'full-icu': # full ICU @@ -1503,7 +1502,7 @@ def write_config(data, name): elif int(icu_ver_major) < icu_versions['minimum_icu']: error('icu4c v%s.x is too old, v%d.x or later is required.' % (icu_ver_major, icu_versions['minimum_icu'])) - icu_endianness = sys.byteorder[0]; + icu_endianness = sys.byteorder[0] o['variables']['icu_ver_major'] = icu_ver_major o['variables']['icu_endianness'] = icu_endianness icu_data_file_l = 'icudt%s%s.dat' % (icu_ver_major, 'l') diff --git a/deps/uv/.gitignore b/deps/uv/.gitignore index c132987917623e..b6abc2ab464978 100644 --- a/deps/uv/.gitignore +++ b/deps/uv/.gitignore @@ -51,6 +51,7 @@ Makefile.in /test/run-benchmarks /test/run-benchmarks.exe /test/run-benchmarks.dSYM +test_file_* *.sln *.sln.cache diff --git a/deps/uv/.mailmap b/deps/uv/.mailmap index 3d95997e4fe4d6..87d63bed0b14d3 100644 --- a/deps/uv/.mailmap +++ b/deps/uv/.mailmap @@ -38,6 +38,7 @@ Sam Roberts San-Tai Hsu Santiago Gimeno Saúl Ibarra Corretgé +Saúl Ibarra Corretgé Shigeki Ohtsu Timothy J. Fontaine Yasuhiro Matsumoto diff --git a/deps/uv/AUTHORS b/deps/uv/AUTHORS index 4db18540d46a77..5d5866d3ff2405 100644 --- a/deps/uv/AUTHORS +++ b/deps/uv/AUTHORS @@ -389,3 +389,10 @@ Jenil Christo Evgeny Ermakov gengjiawen Leo Chung +Javier Blazquez +Mustafa M +Zach Bjornson +Nan Xiao +Ben Davies +Nhan Khong +Crunkle diff --git a/deps/uv/CMakeLists.txt b/deps/uv/CMakeLists.txt index a34e5a1b80a988..bf7990f745fee2 100644 --- a/deps/uv/CMakeLists.txt +++ b/deps/uv/CMakeLists.txt @@ -53,6 +53,8 @@ set(uv_test_sources test/test-fs-poll.c test/test-fs.c test/test-fs-readdir.c + test/test-fs-fd-hash.c + test/test-fs-open-flags.c test/test-get-currentexe.c test/test-get-loadavg.c test/test-get-memory.c diff --git a/deps/uv/ChangeLog b/deps/uv/ChangeLog index a6e2786b0ed330..d440b5507719c5 100644 --- a/deps/uv/ChangeLog +++ b/deps/uv/ChangeLog @@ -1,3 +1,52 @@ +2019.08.10, Version 1.31.0 (Stable), 0a6771cee4c15184c924bfe9d397bdd0c3b206ba + +Changes since version 1.30.1: + +* win,fs: don't modify global file translation mode (Javier Blazquez) + +* win: fix uv_os_tmpdir when env var is 260 chars (Mustafa M) + +* win: prevent tty event explosion machine hang (Javier Blazquez) + +* win: add UV_FS_O_FILEMAP (João Reis) + +* win, fs: mkdir return UV_EINVAL for invalid names (Bartosz Sosnowski) + +* github: add root warning to template (cjihrig) + +* win: misc fs cleanup (cjihrig) + +* unix,win: add uv_fs_statfs() (cjihrig) + +* test: avoid AF_LOCAL (Carlo Marcelo Arenas Belón) + +* unix,win: add ability to retrieve all env variables (Saúl Ibarra Corretgé) + +* Revert "darwin: speed up uv_set_process_title()" (Ben Noordhuis) + +* doc: add %p to valgrind log-file arg (Zach Bjornson) + +* doc: fix typo in basics.rst (Nan Xiao) + +* ibmi: support Makefile build for IBM i (Xu Meng) + +* OpenBSD: only get active CPU core count (Ben Davies) + +* test: fix gcc 8 warnings for tests (Nhan Khong) + +* ibmi: use correct header files (Xu Meng) + +* unix: clear UV_HANDLE_READING flag before callback (zyxwvu Shi) + +* unix: fix unused-function warning on BSD (Nhan Khong) + +* test: fix test runner on MinGW (Crunkle) + +* win: remove try-except outside MSVC (Crunkle) + +* win: fix uv_spawn() ENOMEM on empty env (Ben Noordhuis) + + 2019.07.03, Version 1.30.1 (Stable), 1551969c84c2f546a429dac169c7fdac3e38115e Changes since version 1.30.0: diff --git a/deps/uv/Makefile.am b/deps/uv/Makefile.am index d213d8f4faec67..6b11c9349ce9dc 100644 --- a/deps/uv/Makefile.am +++ b/deps/uv/Makefile.am @@ -184,6 +184,8 @@ test_run_tests_SOURCES = test/blackhole-server.c \ test/test-fs-poll.c \ test/test-fs.c \ test/test-fs-readdir.c \ + test/test-fs-fd-hash.c \ + test/test-fs-open-flags.c \ test/test-fork.c \ test/test-getters-setters.c \ test/test-get-currentexe.c \ @@ -322,6 +324,12 @@ test_run_tests_CFLAGS += -D_ALL_SOURCE \ -D_LINUX_SOURCE_COMPAT endif +if OS400 +test_run_tests_CFLAGS += -D_ALL_SOURCE \ + -D_XOPEN_SOURCE=500 \ + -D_LINUX_SOURCE_COMPAT +endif + if HAIKU test_run_tests_CFLAGS += -D_BSD_SOURCE endif @@ -362,6 +370,19 @@ uvinclude_HEADERS += include/uv/aix.h libuv_la_SOURCES += src/unix/aix.c src/unix/aix-common.c endif +if OS400 +libuv_la_CFLAGS += -D_ALL_SOURCE \ + -D_XOPEN_SOURCE=500 \ + -D_LINUX_SOURCE_COMPAT \ + -D_THREAD_SAFE +uvinclude_HEADERS += include/uv/posix.h +libuv_la_SOURCES += src/unix/aix-common.c \ + src/unix/ibmi.c \ + src/unix/posix-poll.c \ + src/unix/no-fsevents.c \ + src/unix/no-proctitle.c +endif + if ANDROID uvinclude_HEADERS += include/uv/android-ifaddrs.h libuv_la_SOURCES += src/unix/android-ifaddrs.c \ diff --git a/deps/uv/README.md b/deps/uv/README.md index 11874cdb287fba..b55c3a9238a1d1 100644 --- a/deps/uv/README.md +++ b/deps/uv/README.md @@ -387,7 +387,7 @@ $ gdb --args out/Debug/run-tests TEST_NAME Use the `--trace-children=yes` parameter: ```bash -$ valgrind --trace-children=yes -v --tool=memcheck --leak-check=full --track-origins=yes --leak-resolution=high --show-reachable=yes --log-file=memcheck.log out/Debug/run-tests TEST_NAME +$ valgrind --trace-children=yes -v --tool=memcheck --leak-check=full --track-origins=yes --leak-resolution=high --show-reachable=yes --log-file=memcheck-%p.log out/Debug/run-tests TEST_NAME ``` ### Running benchmarks diff --git a/deps/uv/configure.ac b/deps/uv/configure.ac index 52aaddcfc150c9..c5e29fef849e4e 100644 --- a/deps/uv/configure.ac +++ b/deps/uv/configure.ac @@ -13,7 +13,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_PREREQ(2.57) -AC_INIT([libuv], [1.30.1], [https://github.com/libuv/libuv/issues]) +AC_INIT([libuv], [1.31.0], [https://github.com/libuv/libuv/issues]) AC_CONFIG_MACRO_DIR([m4]) m4_include([m4/libuv-extra-automake-flags.m4]) m4_include([m4/as_case.m4]) @@ -63,6 +63,7 @@ AM_CONDITIONAL([MSYS], [AS_CASE([$host_os],[msys*], [true], [false]) AM_CONDITIONAL([NETBSD], [AS_CASE([$host_os],[netbsd*], [true], [false])]) AM_CONDITIONAL([OPENBSD], [AS_CASE([$host_os],[openbsd*], [true], [false])]) AM_CONDITIONAL([OS390], [AS_CASE([$host_os],[openedition*], [true], [false])]) +AM_CONDITIONAL([OS400], [AS_CASE([$host_os],[os400], [true], [false])]) AM_CONDITIONAL([SUNOS], [AS_CASE([$host_os],[solaris*], [true], [false])]) AM_CONDITIONAL([WINNT], [AS_CASE([$host_os],[mingw*], [true], [false])]) AS_CASE([$host_os],[mingw*], [ diff --git a/deps/uv/docs/src/fs.rst b/deps/uv/docs/src/fs.rst index 996624b6951475..aabe49b3f3a981 100644 --- a/deps/uv/docs/src/fs.rst +++ b/deps/uv/docs/src/fs.rst @@ -102,6 +102,24 @@ Data types UV_FS_CLOSEDIR } uv_fs_type; +.. c:type:: uv_statfs_t + + Reduced cross platform equivalent of ``struct statfs``. + Used in :c:func:`uv_fs_statfs`. + + :: + + typedef struct uv_statfs_s { + uint64_t f_type; + uint64_t f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + uint64_t f_spare[4]; + } uv_statfs_t; + .. c:type:: uv_dirent_t Cross platform (reduced) equivalent of ``struct dirent``. @@ -200,6 +218,11 @@ API Equivalent to :man:`preadv(2)`. + .. warning:: + On Windows, under non-MSVC environments (e.g. when GCC or Clang is used + to build libuv), files opened using ``UV_FS_O_FILEMAP`` may cause a fatal + crash if the memory mapped read operation fails. + .. c:function:: int uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) Equivalent to :man:`unlink(2)`. @@ -208,6 +231,11 @@ API Equivalent to :man:`pwritev(2)`. + .. warning:: + On Windows, under non-MSVC environments (e.g. when GCC or Clang is used + to build libuv), files opened using ``UV_FS_O_FILEMAP`` may cause a fatal + crash if the memory mapped write operation fails. + .. c:function:: int uv_fs_mkdir(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode, uv_fs_cb cb) Equivalent to :man:`mkdir(2)`. @@ -290,6 +318,17 @@ API Equivalent to :man:`stat(2)`, :man:`fstat(2)` and :man:`lstat(2)` respectively. +.. c:function:: int uv_fs_statfs(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) + + Equivalent to :man:`statfs(2)`. On success, a `uv_statfs_t` is allocated + and returned via `req->ptr`. This memory is freed by `uv_fs_req_cleanup()`. + + .. note:: + Any fields in the resulting `uv_statfs_t` that are not supported by the + underlying operating system are set to zero. + + .. versionadded:: 1.31.0 + .. c:function:: int uv_fs_rename(uv_loop_t* loop, uv_fs_t* req, const char* path, const char* new_path, uv_fs_cb cb) Equivalent to :man:`rename(2)`. @@ -534,6 +573,14 @@ File open constants .. versionchanged:: 1.17.0 support is added for Windows. +.. c:macro:: UV_FS_O_FILEMAP + + Use a memory file mapping to access the file. When using this flag, the + file cannot be open multiple times concurrently. + + .. note:: + `UV_FS_O_FILEMAP` is only supported on Windows. + .. c:macro:: UV_FS_O_NOATIME Do not update the file access time when the file is read. diff --git a/deps/uv/docs/src/misc.rst b/deps/uv/docs/src/misc.rst index ef70e14bff8cac..3ecfce486c4da2 100644 --- a/deps/uv/docs/src/misc.rst +++ b/deps/uv/docs/src/misc.rst @@ -180,6 +180,17 @@ Data types char machine[256]; } uv_utsname_t; +.. c:type:: uv_env_item_t + + Data type for environment variable storage. + + :: + + typedef struct uv_env_item_s { + char* name; + char* value; + } uv_env_item_t; + API --- @@ -523,6 +534,23 @@ API .. versionadded:: 1.8.0 +.. c:function:: int uv_os_environ(uv_env_item_t** envitems, int* count) + + Retrieves all environment variables. This function will allocate memory + which must be freed by calling :c:func:`uv_os_free_environ`. + + .. warning:: + This function is not thread safe. + + .. versionadded:: 1.31.0 + +.. c:function:: void uv_os_free_environ(uv_env_item_t* envitems, int count); + + Frees the memory allocated for the environment variables by + :c:func:`uv_os_environ`. + + .. versionadded:: 1.31.0 + .. c:function:: int uv_os_getenv(const char* name, char* buffer, size_t* size) Retrieves the environment variable specified by `name`, copies its value diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h index f97801cec2f41b..f71767b6e9fab5 100644 --- a/deps/uv/include/uv.h +++ b/deps/uv/include/uv.h @@ -231,11 +231,13 @@ typedef struct uv_fs_s uv_fs_t; typedef struct uv_work_s uv_work_t; /* None of the above. */ +typedef struct uv_env_item_s uv_env_item_t; typedef struct uv_cpu_info_s uv_cpu_info_t; typedef struct uv_interface_address_s uv_interface_address_t; typedef struct uv_dirent_s uv_dirent_t; typedef struct uv_passwd_s uv_passwd_t; typedef struct uv_utsname_s uv_utsname_t; +typedef struct uv_statfs_s uv_statfs_t; typedef enum { UV_LOOP_BLOCK_SIGNAL @@ -1070,6 +1072,17 @@ struct uv_utsname_s { to as meaningless in the docs. */ }; +struct uv_statfs_s { + uint64_t f_type; + uint64_t f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + uint64_t f_spare[4]; +}; + typedef enum { UV_DIRENT_UNKNOWN, UV_DIRENT_FILE, @@ -1150,6 +1163,13 @@ UV_EXTERN int uv_interface_addresses(uv_interface_address_t** addresses, UV_EXTERN void uv_free_interface_addresses(uv_interface_address_t* addresses, int count); +struct uv_env_item_s { + char* name; + char* value; +}; + +UV_EXTERN int uv_os_environ(uv_env_item_t** envitems, int* count); +UV_EXTERN void uv_os_free_environ(uv_env_item_t* envitems, int count); UV_EXTERN int uv_os_getenv(const char* name, char* buffer, size_t* size); UV_EXTERN int uv_os_setenv(const char* name, const char* value); UV_EXTERN int uv_os_unsetenv(const char* name); @@ -1205,7 +1225,8 @@ typedef enum { UV_FS_LCHOWN, UV_FS_OPENDIR, UV_FS_READDIR, - UV_FS_CLOSEDIR + UV_FS_CLOSEDIR, + UV_FS_STATFS } uv_fs_type; struct uv_dir_s { @@ -1433,6 +1454,10 @@ UV_EXTERN int uv_fs_lchown(uv_loop_t* loop, uv_uid_t uid, uv_gid_t gid, uv_fs_cb cb); +UV_EXTERN int uv_fs_statfs(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_fs_cb cb); enum uv_fs_event { diff --git a/deps/uv/include/uv/unix.h b/deps/uv/include/uv/unix.h index 6c93ee97de27a6..9080352d31dfc0 100644 --- a/deps/uv/include/uv/unix.h +++ b/deps/uv/include/uv/unix.h @@ -49,6 +49,8 @@ # include "uv/linux.h" #elif defined (__MVS__) # include "uv/os390.h" +#elif defined(__PASE__) /* __PASE__ and _AIX are both defined on IBM i */ +# include "uv/posix.h" /* IBM i needs uv/posix.h, not uv/aix.h */ #elif defined(_AIX) # include "uv/aix.h" #elif defined(__sun) @@ -61,8 +63,7 @@ defined(__OpenBSD__) || \ defined(__NetBSD__) # include "uv/bsd.h" -#elif defined(__PASE__) || \ - defined(__CYGWIN__) || \ +#elif defined(__CYGWIN__) || \ defined(__MSYS__) || \ defined(__GNU__) # include "uv/posix.h" @@ -481,6 +482,7 @@ typedef struct { #endif /* fs open() flags supported on other platforms: */ +#define UV_FS_O_FILEMAP 0 #define UV_FS_O_RANDOM 0 #define UV_FS_O_SHORT_LIVED 0 #define UV_FS_O_SEQUENTIAL 0 diff --git a/deps/uv/include/uv/version.h b/deps/uv/include/uv/version.h index bf992d2d0ee6d8..37a6a445b8d0da 100644 --- a/deps/uv/include/uv/version.h +++ b/deps/uv/include/uv/version.h @@ -31,8 +31,8 @@ */ #define UV_VERSION_MAJOR 1 -#define UV_VERSION_MINOR 30 -#define UV_VERSION_PATCH 1 +#define UV_VERSION_MINOR 31 +#define UV_VERSION_PATCH 0 #define UV_VERSION_IS_RELEASE 1 #define UV_VERSION_SUFFIX "" diff --git a/deps/uv/include/uv/win.h b/deps/uv/include/uv/win.h index acbd958be4cd47..9793eee3e1e166 100644 --- a/deps/uv/include/uv/win.h +++ b/deps/uv/include/uv/win.h @@ -668,6 +668,7 @@ typedef struct { #define UV_FS_O_APPEND _O_APPEND #define UV_FS_O_CREAT _O_CREAT #define UV_FS_O_EXCL _O_EXCL +#define UV_FS_O_FILEMAP 0x20000000 #define UV_FS_O_RANDOM _O_RANDOM #define UV_FS_O_RDONLY _O_RDONLY #define UV_FS_O_RDWR _O_RDWR diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c index 202c75bbb5e94c..f4b94e30cc0049 100644 --- a/deps/uv/src/unix/core.c +++ b/deps/uv/src/unix/core.c @@ -50,11 +50,15 @@ #endif #ifdef __APPLE__ +# include # include /* _NSGetExecutablePath */ # include # if defined(O_CLOEXEC) # define UV__O_CLOEXEC O_CLOEXEC # endif +# define environ (*_NSGetEnviron()) +#else +extern char** environ; #endif #if defined(__DragonFly__) || \ @@ -1284,6 +1288,62 @@ int uv_translate_sys_error(int sys_errno) { } +int uv_os_environ(uv_env_item_t** envitems, int* count) { + int i, j, cnt; + uv_env_item_t* envitem; + + *envitems = NULL; + *count = 0; + + for (i = 0; environ[i] != NULL; i++); + + *envitems = uv__calloc(i, sizeof(**envitems)); + + if (envitems == NULL) + return UV_ENOMEM; + + for (j = 0, cnt = 0; j < i; j++) { + char* buf; + char* ptr; + + if (environ[j] == NULL) + break; + + buf = uv__strdup(environ[j]); + if (buf == NULL) + goto fail; + + ptr = strchr(buf, '='); + if (ptr == NULL) { + uv__free(buf); + continue; + } + + *ptr = '\0'; + + envitem = &(*envitems)[cnt]; + envitem->name = buf; + envitem->value = ptr + 1; + + cnt++; + } + + *count = cnt; + return 0; + +fail: + for (i = 0; i < cnt; i++) { + envitem = &(*envitems)[cnt]; + uv__free(envitem->name); + } + uv__free(*envitems); + + *envitems = NULL; + *count = 0; + return UV_ENOMEM; +} + + int uv_os_getenv(const char* name, char* buffer, size_t* size) { char* var; size_t len; diff --git a/deps/uv/src/unix/darwin-proctitle.c b/deps/uv/src/unix/darwin-proctitle.c index e505bdd23f8636..dabde2239ccab3 100644 --- a/deps/uv/src/unix/darwin-proctitle.c +++ b/deps/uv/src/unix/darwin-proctitle.c @@ -33,56 +33,61 @@ # include #endif -#define S(s) pCFStringCreateWithCString(NULL, (s), kCFStringEncodingUTF8) - - -static int (*dynamic_pthread_setname_np)(const char* name); -#if !TARGET_OS_IPHONE -static CFStringRef (*pCFStringCreateWithCString)(CFAllocatorRef, - const char*, - CFStringEncoding); -static CFBundleRef (*pCFBundleGetBundleWithIdentifier)(CFStringRef); -static void *(*pCFBundleGetDataPointerForName)(CFBundleRef, CFStringRef); -static void *(*pCFBundleGetFunctionPointerForName)(CFBundleRef, CFStringRef); -static CFTypeRef (*pLSGetCurrentApplicationASN)(void); -static OSStatus (*pLSSetApplicationInformationItem)(int, - CFTypeRef, - CFStringRef, - CFStringRef, - CFDictionaryRef*); -static void* application_services_handle; -static void* core_foundation_handle; -static CFBundleRef launch_services_bundle; -static CFStringRef* display_name_key; -static CFDictionaryRef (*pCFBundleGetInfoDictionary)(CFBundleRef); -static CFBundleRef (*pCFBundleGetMainBundle)(void); -static CFBundleRef hi_services_bundle; -static OSStatus (*pSetApplicationIsDaemon)(int); -static CFDictionaryRef (*pLSApplicationCheckIn)(int, CFDictionaryRef); -static void (*pLSSetApplicationLaunchServicesServerConnectionStatus)(uint64_t, - void*); - - -UV_DESTRUCTOR(static void uv__set_process_title_platform_fini(void)) { - if (core_foundation_handle != NULL) { - dlclose(core_foundation_handle); - core_foundation_handle = NULL; - } - - if (application_services_handle != NULL) { - dlclose(application_services_handle); - application_services_handle = NULL; - } -} -#endif /* !TARGET_OS_IPHONE */ +static int uv__pthread_setname_np(const char* name) { + int (*dynamic_pthread_setname_np)(const char* name); + char namebuf[64]; /* MAXTHREADNAMESIZE */ + int err; -void uv__set_process_title_platform_init(void) { /* pthread_setname_np() first appeared in OS X 10.6 and iOS 3.2. */ *(void **)(&dynamic_pthread_setname_np) = dlsym(RTLD_DEFAULT, "pthread_setname_np"); -#if !TARGET_OS_IPHONE + if (dynamic_pthread_setname_np == NULL) + return UV_ENOSYS; + + strncpy(namebuf, name, sizeof(namebuf) - 1); + namebuf[sizeof(namebuf) - 1] = '\0'; + + err = dynamic_pthread_setname_np(namebuf); + if (err) + return UV__ERR(err); + + return 0; +} + + +int uv__set_process_title(const char* title) { +#if TARGET_OS_IPHONE + return uv__pthread_setname_np(title); +#else + CFStringRef (*pCFStringCreateWithCString)(CFAllocatorRef, + const char*, + CFStringEncoding); + CFBundleRef (*pCFBundleGetBundleWithIdentifier)(CFStringRef); + void *(*pCFBundleGetDataPointerForName)(CFBundleRef, CFStringRef); + void *(*pCFBundleGetFunctionPointerForName)(CFBundleRef, CFStringRef); + CFTypeRef (*pLSGetCurrentApplicationASN)(void); + OSStatus (*pLSSetApplicationInformationItem)(int, + CFTypeRef, + CFStringRef, + CFStringRef, + CFDictionaryRef*); + void* application_services_handle; + void* core_foundation_handle; + CFBundleRef launch_services_bundle; + CFStringRef* display_name_key; + CFDictionaryRef (*pCFBundleGetInfoDictionary)(CFBundleRef); + CFBundleRef (*pCFBundleGetMainBundle)(void); + CFBundleRef hi_services_bundle; + OSStatus (*pSetApplicationIsDaemon)(int); + CFDictionaryRef (*pLSApplicationCheckIn)(int, CFDictionaryRef); + void (*pLSSetApplicationLaunchServicesServerConnectionStatus)(uint64_t, + void*); + CFTypeRef asn; + int err; + + err = UV_ENOENT; application_services_handle = dlopen("/System/Library/Frameworks/" "ApplicationServices.framework/" "Versions/A/ApplicationServices", @@ -111,6 +116,8 @@ void uv__set_process_title_platform_init(void) { goto out; } +#define S(s) pCFStringCreateWithCString(NULL, (s), kCFStringEncodingUTF8) + launch_services_bundle = pCFBundleGetBundleWithIdentifier(S("com.apple.LaunchServices")); @@ -141,14 +148,13 @@ void uv__set_process_title_platform_init(void) { "CFBundleGetInfoDictionary"); *(void **)(&pCFBundleGetMainBundle) = dlsym(core_foundation_handle, "CFBundleGetMainBundle"); - if (pCFBundleGetInfoDictionary == NULL || pCFBundleGetMainBundle == NULL) goto out; /* Black 10.9 magic, to remove (Not responding) mark in Activity Monitor */ hi_services_bundle = pCFBundleGetBundleWithIdentifier(S("com.apple.HIServices")); - + err = UV_ENOENT; if (hi_services_bundle == NULL) goto out; @@ -162,37 +168,42 @@ void uv__set_process_title_platform_init(void) { pCFBundleGetFunctionPointerForName( launch_services_bundle, S("_LSSetApplicationLaunchServicesServerConnectionStatus")); - if (pSetApplicationIsDaemon == NULL || pLSApplicationCheckIn == NULL || pLSSetApplicationLaunchServicesServerConnectionStatus == NULL) { goto out; } - return; + if (pSetApplicationIsDaemon(1) != noErr) + goto out; -out: - uv__set_process_title_platform_fini(); -#endif /* !TARGET_OS_IPHONE */ -} + pLSSetApplicationLaunchServicesServerConnectionStatus(0, NULL); + /* Check into process manager?! */ + pLSApplicationCheckIn(-2, + pCFBundleGetInfoDictionary(pCFBundleGetMainBundle())); -void uv__set_process_title(const char* title) { -#if !TARGET_OS_IPHONE - if (core_foundation_handle != NULL && pSetApplicationIsDaemon(1) != noErr) { - CFTypeRef asn; - pLSSetApplicationLaunchServicesServerConnectionStatus(0, NULL); - pLSApplicationCheckIn(/* Magic value */ -2, - pCFBundleGetInfoDictionary(pCFBundleGetMainBundle())); - asn = pLSGetCurrentApplicationASN(); - pLSSetApplicationInformationItem(/* Magic value */ -2, asn, - *display_name_key, S(title), NULL); - } -#endif /* !TARGET_OS_IPHONE */ + asn = pLSGetCurrentApplicationASN(); - if (dynamic_pthread_setname_np != NULL) { - char namebuf[64]; /* MAXTHREADNAMESIZE */ - uv__strscpy(namebuf, title, sizeof(namebuf)); - dynamic_pthread_setname_np(namebuf); + err = UV_EINVAL; + if (pLSSetApplicationInformationItem(-2, /* Magic value. */ + asn, + *display_name_key, + S(title), + NULL) != noErr) { + goto out; } + + uv__pthread_setname_np(title); /* Don't care if it fails. */ + err = 0; + +out: + if (core_foundation_handle != NULL) + dlclose(core_foundation_handle); + + if (application_services_handle != NULL) + dlclose(application_services_handle); + + return err; +#endif /* !TARGET_OS_IPHONE */ } diff --git a/deps/uv/src/unix/fs.c b/deps/uv/src/unix/fs.c index 5138c619b02f1d..fc80d00d5c563e 100644 --- a/deps/uv/src/unix/fs.c +++ b/deps/uv/src/unix/fs.c @@ -70,6 +70,20 @@ # include #endif +#if defined(__APPLE__) || \ + defined(__DragonFly__) || \ + defined(__FreeBSD__) || \ + defined(__FreeBSD_kernel__) || \ + defined(__OpenBSD__) || \ + defined(__NetBSD__) +# include +# include +#elif defined(__sun) || defined(__MVS__) +# include +#else +# include +#endif + #if defined(_AIX) && _XOPEN_SOURCE <= 600 extern char *mkdtemp(char *template); /* See issue #740 on AIX < 7 */ #endif @@ -278,6 +292,7 @@ static ssize_t uv__fs_open(uv_fs_t* req) { } +#if !HAVE_PREADV static ssize_t uv__fs_preadv(uv_file fd, uv_buf_t* bufs, unsigned int nbufs, @@ -324,6 +339,7 @@ static ssize_t uv__fs_preadv(uv_file fd, return result; } +#endif static ssize_t uv__fs_read(uv_fs_t* req) { @@ -519,6 +535,40 @@ static int uv__fs_closedir(uv_fs_t* req) { return 0; } +static int uv__fs_statfs(uv_fs_t* req) { + uv_statfs_t* stat_fs; +#if defined(__sun) || defined(__MVS__) + struct statvfs buf; + + if (0 != statvfs(req->path, &buf)) +#else + struct statfs buf; + + if (0 != statfs(req->path, &buf)) +#endif /* defined(__sun) */ + return -1; + + stat_fs = uv__malloc(sizeof(*stat_fs)); + if (stat_fs == NULL) { + errno = ENOMEM; + return -1; + } + +#if defined(__sun) || defined(__MVS__) + stat_fs->f_type = 0; /* f_type is not supported. */ +#else + stat_fs->f_type = buf.f_type; +#endif + stat_fs->f_bsize = buf.f_bsize; + stat_fs->f_blocks = buf.f_blocks; + stat_fs->f_bfree = buf.f_bfree; + stat_fs->f_bavail = buf.f_bavail; + stat_fs->f_files = buf.f_files; + stat_fs->f_ffree = buf.f_ffree; + req->ptr = stat_fs; + return 0; +} + static ssize_t uv__fs_pathmax_size(const char* path) { ssize_t pathmax; @@ -1386,6 +1436,7 @@ static void uv__fs_work(struct uv__work* w) { X(RMDIR, rmdir(req->path)); X(SENDFILE, uv__fs_sendfile(req)); X(STAT, uv__fs_stat(req->path, &req->statbuf)); + X(STATFS, uv__fs_statfs(req)); X(SYMLINK, symlink(req->path, req->new_path)); X(UNLINK, unlink(req->path)); X(UTIME, uv__fs_utime(req)); @@ -1858,3 +1909,13 @@ int uv_fs_copyfile(uv_loop_t* loop, req->flags = flags; POST; } + + +int uv_fs_statfs(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_fs_cb cb) { + INIT(STATFS); + PATH; + POST; +} diff --git a/deps/uv/src/unix/openbsd.c b/deps/uv/src/unix/openbsd.c index ffae7683d8b620..b5cdc80c3e92fe 100644 --- a/deps/uv/src/unix/openbsd.c +++ b/deps/uv/src/unix/openbsd.c @@ -193,7 +193,7 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { if (sysctl(which, 2, &model, &size, NULL, 0)) return UV__ERR(errno); - which[1] = HW_NCPU; + which[1] = HW_NCPUONLINE; size = sizeof(numcpus); if (sysctl(which, 2, &numcpus, &size, NULL, 0)) return UV__ERR(errno); diff --git a/deps/uv/src/unix/proctitle.c b/deps/uv/src/unix/proctitle.c index a5ce2030c55be8..1a8c7a7090e8a6 100644 --- a/deps/uv/src/unix/proctitle.c +++ b/deps/uv/src/unix/proctitle.c @@ -24,7 +24,6 @@ #include #include -extern void uv__set_process_title_platform_init(void); extern void uv__set_process_title(const char* title); static uv_mutex_t process_title_mutex; @@ -39,9 +38,6 @@ static struct { static void init_process_title_mutex_once(void) { uv_mutex_init(&process_title_mutex); -#ifdef __APPLE__ - uv__set_process_title_platform_init(); -#endif } diff --git a/deps/uv/src/unix/stream.c b/deps/uv/src/unix/stream.c index 17b06a39a772b0..9de01e3c78403e 100644 --- a/deps/uv/src/unix/stream.c +++ b/deps/uv/src/unix/stream.c @@ -1000,12 +1000,12 @@ uv_handle_type uv__handle_type(int fd) { static void uv__stream_eof(uv_stream_t* stream, const uv_buf_t* buf) { stream->flags |= UV_HANDLE_READ_EOF; + stream->flags &= ~UV_HANDLE_READING; uv__io_stop(stream->loop, &stream->io_watcher, POLLIN); if (!uv__io_active(&stream->io_watcher, POLLOUT)) uv__handle_stop(stream); uv__stream_osx_interrupt_select(stream); stream->read_cb(stream, UV_EOF, buf); - stream->flags &= ~UV_HANDLE_READING; } diff --git a/deps/uv/src/uv-common.c b/deps/uv/src/uv-common.c index 066eb31d03892d..d1a5e2fbe6b77e 100644 --- a/deps/uv/src/uv-common.c +++ b/deps/uv/src/uv-common.c @@ -786,3 +786,14 @@ void uv_loop_delete(uv_loop_t* loop) { if (loop != default_loop) uv__free(loop); } + + +void uv_os_free_environ(uv_env_item_t* envitems, int count) { + int i; + + for (i = 0; i < count; i++) { + uv__free(envitems[i].name); + } + + uv__free(envitems); +} diff --git a/deps/uv/src/win/fs-fd-hash-inl.h b/deps/uv/src/win/fs-fd-hash-inl.h new file mode 100644 index 00000000000000..7a203d232d35b4 --- /dev/null +++ b/deps/uv/src/win/fs-fd-hash-inl.h @@ -0,0 +1,178 @@ +#ifndef UV_WIN_FS_FD_HASH_INL_H_ +#define UV_WIN_FS_FD_HASH_INL_H_ + +#include "uv.h" +#include "internal.h" + +/* Files are only inserted in uv__fd_hash when the UV_FS_O_FILEMAP flag is + * specified. Thus, when uv__fd_hash_get returns true, the file mapping in the + * info structure should be used for read/write operations. + * + * If the file is empty, the mapping field will be set to + * INVALID_HANDLE_VALUE. This is not an issue since the file mapping needs to + * be created anyway when the file size changes. + * + * Since file descriptors are sequential integers, the modulo operator is used + * as hashing function. For each bucket, a single linked list of arrays is + * kept to minimize allocations. A statically allocated memory buffer is kept + * for the first array in each bucket. */ + + +#define UV__FD_HASH_SIZE 256 +#define UV__FD_HASH_GROUP_SIZE 16 + +struct uv__fd_info_s { + int flags; + BOOLEAN is_directory; + HANDLE mapping; + LARGE_INTEGER size; + LARGE_INTEGER current_pos; +}; + +struct uv__fd_hash_entry_s { + uv_file fd; + struct uv__fd_info_s info; +}; + +struct uv__fd_hash_entry_group_s { + struct uv__fd_hash_entry_s entries[UV__FD_HASH_GROUP_SIZE]; + struct uv__fd_hash_entry_group_s* next; +}; + +struct uv__fd_hash_bucket_s { + size_t size; + struct uv__fd_hash_entry_group_s* data; +}; + + +static uv_mutex_t uv__fd_hash_mutex; + +static struct uv__fd_hash_entry_group_s + uv__fd_hash_entry_initial[UV__FD_HASH_SIZE * UV__FD_HASH_GROUP_SIZE]; +static struct uv__fd_hash_bucket_s uv__fd_hash[UV__FD_HASH_SIZE]; + + +INLINE static void uv__fd_hash_init(void) { + int i, err; + + err = uv_mutex_init(&uv__fd_hash_mutex); + if (err) { + uv_fatal_error(err, "uv_mutex_init"); + } + + for (i = 0; i < ARRAY_SIZE(uv__fd_hash); ++i) { + uv__fd_hash[i].size = 0; + uv__fd_hash[i].data = + uv__fd_hash_entry_initial + i * UV__FD_HASH_GROUP_SIZE; + } +} + +#define FIND_COMMON_VARIABLES \ + unsigned i; \ + unsigned bucket = fd % ARRAY_SIZE(uv__fd_hash); \ + struct uv__fd_hash_entry_s* entry_ptr = NULL; \ + struct uv__fd_hash_entry_group_s* group_ptr; \ + struct uv__fd_hash_bucket_s* bucket_ptr = &uv__fd_hash[bucket]; + +#define FIND_IN_GROUP_PTR(group_size) \ + do { \ + for (i = 0; i < group_size; ++i) { \ + if (group_ptr->entries[i].fd == fd) { \ + entry_ptr = &group_ptr->entries[i]; \ + break; \ + } \ + } \ + } while (0) + +#define FIND_IN_BUCKET_PTR() \ + do { \ + size_t first_group_size = bucket_ptr->size % UV__FD_HASH_GROUP_SIZE; \ + if (bucket_ptr->size != 0 && first_group_size == 0) \ + first_group_size = UV__FD_HASH_GROUP_SIZE; \ + group_ptr = bucket_ptr->data; \ + FIND_IN_GROUP_PTR(first_group_size); \ + for (group_ptr = group_ptr->next; \ + group_ptr != NULL && entry_ptr == NULL; \ + group_ptr = group_ptr->next) \ + FIND_IN_GROUP_PTR(UV__FD_HASH_GROUP_SIZE); \ + } while (0) + +INLINE static int uv__fd_hash_get(int fd, struct uv__fd_info_s* info) { + FIND_COMMON_VARIABLES + + uv_mutex_lock(&uv__fd_hash_mutex); + + FIND_IN_BUCKET_PTR(); + + if (entry_ptr != NULL) { + *info = entry_ptr->info; + } + + uv_mutex_unlock(&uv__fd_hash_mutex); + return entry_ptr != NULL; +} + +INLINE static void uv__fd_hash_add(int fd, struct uv__fd_info_s* info) { + FIND_COMMON_VARIABLES + + uv_mutex_lock(&uv__fd_hash_mutex); + + FIND_IN_BUCKET_PTR(); + + if (entry_ptr == NULL) { + i = bucket_ptr->size % UV__FD_HASH_GROUP_SIZE; + + if (bucket_ptr->size != 0 && i == 0) { + struct uv__fd_hash_entry_group_s* new_group_ptr = + uv__malloc(sizeof(*new_group_ptr)); + if (new_group_ptr == NULL) { + uv_fatal_error(ERROR_OUTOFMEMORY, "uv__malloc"); + } + new_group_ptr->next = bucket_ptr->data; + bucket_ptr->data = new_group_ptr; + } + + bucket_ptr->size += 1; + entry_ptr = &bucket_ptr->data->entries[i]; + entry_ptr->fd = fd; + } + + entry_ptr->info = *info; + + uv_mutex_unlock(&uv__fd_hash_mutex); +} + +INLINE static int uv__fd_hash_remove(int fd, struct uv__fd_info_s* info) { + FIND_COMMON_VARIABLES + + uv_mutex_lock(&uv__fd_hash_mutex); + + FIND_IN_BUCKET_PTR(); + + if (entry_ptr != NULL) { + *info = entry_ptr->info; + + bucket_ptr->size -= 1; + + i = bucket_ptr->size % UV__FD_HASH_GROUP_SIZE; + if (entry_ptr != &bucket_ptr->data->entries[i]) { + *entry_ptr = bucket_ptr->data->entries[i]; + } + + if (bucket_ptr->size != 0 && + bucket_ptr->size % UV__FD_HASH_GROUP_SIZE == 0) { + struct uv__fd_hash_entry_group_s* old_group_ptr = bucket_ptr->data; + bucket_ptr->data = old_group_ptr->next; + uv__free(old_group_ptr); + } + } + + uv_mutex_unlock(&uv__fd_hash_mutex); + return entry_ptr != NULL; +} + +#undef FIND_COMMON_VARIABLES +#undef FIND_IN_GROUP_PTR +#undef FIND_IN_BUCKET_PTR + +#endif /* UV_WIN_FS_FD_HASH_INL_H_ */ diff --git a/deps/uv/src/win/fs.c b/deps/uv/src/win/fs.c index 7d78d466c8738f..5dccca77999dbd 100644 --- a/deps/uv/src/win/fs.c +++ b/deps/uv/src/win/fs.c @@ -34,6 +34,7 @@ #include "internal.h" #include "req-inl.h" #include "handle-inl.h" +#include "fs-fd-hash-inl.h" #include @@ -126,6 +127,8 @@ #define IS_LETTER(c) (((c) >= L'a' && (c) <= L'z') || \ ((c) >= L'A' && (c) <= L'Z')) +#define MIN(a,b) (((a) < (b)) ? (a) : (b)) + const WCHAR JUNCTION_PREFIX[] = L"\\??\\"; const WCHAR JUNCTION_PREFIX_LEN = 4; @@ -137,8 +140,16 @@ const WCHAR UNC_PATH_PREFIX_LEN = 8; static int uv__file_symlink_usermode_flag = SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE; +static DWORD uv__allocation_granularity; + + void uv_fs_init(void) { - _fmode = _O_BINARY; + SYSTEM_INFO system_info; + + GetSystemInfo(&system_info); + uv__allocation_granularity = system_info.dwAllocationGranularity; + + uv__fd_hash_init(); } @@ -414,6 +425,27 @@ void fs__open(uv_fs_t* req) { HANDLE file; int fd, current_umask; int flags = req->fs.info.file_flags; + struct uv__fd_info_s fd_info; + + /* Adjust flags to be compatible with the memory file mapping. Save the + * original flags to emulate the correct behavior. */ + if (flags & UV_FS_O_FILEMAP) { + fd_info.flags = flags; + fd_info.current_pos.QuadPart = 0; + + if ((flags & (UV_FS_O_RDONLY | UV_FS_O_WRONLY | UV_FS_O_RDWR)) == + UV_FS_O_WRONLY) { + /* CreateFileMapping always needs read access */ + flags = (flags & ~UV_FS_O_WRONLY) | UV_FS_O_RDWR; + } + + if (flags & UV_FS_O_APPEND) { + /* Clear the append flag and ensure RDRW mode */ + flags &= ~UV_FS_O_APPEND; + flags &= ~(UV_FS_O_RDONLY | UV_FS_O_WRONLY | UV_FS_O_RDWR); + flags |= UV_FS_O_RDWR; + } + } /* Obtain the active umask. umask() never fails and returns the previous * umask. */ @@ -444,7 +476,8 @@ void fs__open(uv_fs_t* req) { * Here is where we deviate significantly from what CRT's _open() * does. We indiscriminately use all the sharing modes, to match * UNIX semantics. In particular, this ensures that the file can - * be deleted even whilst it's open, fixing issue #1449. + * be deleted even whilst it's open, fixing issue + * https://github.com/nodejs/node-v0.x-archive/issues/1449. * We still support exclusive sharing mode, since it is necessary * for opening raw block devices, otherwise Windows will prevent * any attempt to write past the master boot record. @@ -583,11 +616,55 @@ void fs__open(uv_fs_t* req) { else if (GetLastError() != ERROR_SUCCESS) SET_REQ_WIN32_ERROR(req, GetLastError()); else - SET_REQ_WIN32_ERROR(req, UV_UNKNOWN); + SET_REQ_WIN32_ERROR(req, (DWORD) UV_UNKNOWN); CloseHandle(file); return; } + if (flags & UV_FS_O_FILEMAP) { + FILE_STANDARD_INFO file_info; + if (!GetFileInformationByHandleEx(file, + FileStandardInfo, + &file_info, + sizeof file_info)) { + SET_REQ_WIN32_ERROR(req, GetLastError()); + CloseHandle(file); + return; + } + fd_info.is_directory = file_info.Directory; + + if (fd_info.is_directory) { + fd_info.size.QuadPart = 0; + fd_info.mapping = INVALID_HANDLE_VALUE; + } else { + if (!GetFileSizeEx(file, &fd_info.size)) { + SET_REQ_WIN32_ERROR(req, GetLastError()); + CloseHandle(file); + return; + } + + if (fd_info.size.QuadPart == 0) { + fd_info.mapping = INVALID_HANDLE_VALUE; + } else { + DWORD flProtect = (fd_info.flags & (UV_FS_O_RDONLY | UV_FS_O_WRONLY | + UV_FS_O_RDWR)) == UV_FS_O_RDONLY ? PAGE_READONLY : PAGE_READWRITE; + fd_info.mapping = CreateFileMapping(file, + NULL, + flProtect, + fd_info.size.HighPart, + fd_info.size.LowPart, + NULL); + if (fd_info.mapping == NULL) { + SET_REQ_WIN32_ERROR(req, GetLastError()); + CloseHandle(file); + return; + } + } + } + + uv__fd_hash_add(fd, &fd_info); + } + SET_REQ_RESULT(req, fd); return; @@ -598,9 +675,16 @@ void fs__open(uv_fs_t* req) { void fs__close(uv_fs_t* req) { int fd = req->file.fd; int result; + struct uv__fd_info_s fd_info; VERIFY_FD(fd, req); + if (uv__fd_hash_remove(fd, &fd_info)) { + if (fd_info.mapping != INVALID_HANDLE_VALUE) { + CloseHandle(fd_info.mapping); + } + } + if (fd > 2) result = _close(fd); else @@ -618,6 +702,123 @@ void fs__close(uv_fs_t* req) { } +LONG fs__filemap_ex_filter(LONG excode, PEXCEPTION_POINTERS pep, + int* perror) { + if (excode != EXCEPTION_IN_PAGE_ERROR) { + return EXCEPTION_CONTINUE_SEARCH; + } + + assert(perror != NULL); + if (pep != NULL && pep->ExceptionRecord != NULL && + pep->ExceptionRecord->NumberParameters >= 3) { + NTSTATUS status = (NTSTATUS)pep->ExceptionRecord->ExceptionInformation[3]; + *perror = pRtlNtStatusToDosError(status); + if (*perror != ERROR_SUCCESS) { + return EXCEPTION_EXECUTE_HANDLER; + } + } + *perror = UV_UNKNOWN; + return EXCEPTION_EXECUTE_HANDLER; +} + + +void fs__read_filemap(uv_fs_t* req, struct uv__fd_info_s* fd_info) { + int fd = req->file.fd; /* VERIFY_FD done in fs__read */ + int rw_flags = fd_info->flags & + (UV_FS_O_RDONLY | UV_FS_O_WRONLY | UV_FS_O_RDWR); + size_t read_size, done_read; + unsigned int index; + LARGE_INTEGER pos, end_pos; + size_t view_offset; + LARGE_INTEGER view_base; + void* view; + + if (rw_flags == UV_FS_O_WRONLY) { + SET_REQ_WIN32_ERROR(req, ERROR_ACCESS_DENIED); + return; + } + if (fd_info->is_directory) { + SET_REQ_WIN32_ERROR(req, ERROR_INVALID_FUNCTION); + return; + } + + if (req->fs.info.offset == -1) { + pos = fd_info->current_pos; + } else { + pos.QuadPart = req->fs.info.offset; + } + + /* Make sure we wont read past EOF. */ + if (pos.QuadPart >= fd_info->size.QuadPart) { + SET_REQ_RESULT(req, 0); + return; + } + + read_size = 0; + for (index = 0; index < req->fs.info.nbufs; ++index) { + read_size += req->fs.info.bufs[index].len; + } + read_size = (size_t) MIN((LONGLONG) read_size, + fd_info->size.QuadPart - pos.QuadPart); + if (read_size == 0) { + SET_REQ_RESULT(req, 0); + return; + } + + end_pos.QuadPart = pos.QuadPart + read_size; + + view_offset = pos.QuadPart % uv__allocation_granularity; + view_base.QuadPart = pos.QuadPart - view_offset; + view = MapViewOfFile(fd_info->mapping, + FILE_MAP_READ, + view_base.HighPart, + view_base.LowPart, + view_offset + read_size); + if (view == NULL) { + SET_REQ_WIN32_ERROR(req, GetLastError()); + return; + } + + done_read = 0; + for (index = 0; + index < req->fs.info.nbufs && done_read < read_size; + ++index) { + int err = 0; + size_t this_read_size = MIN(req->fs.info.bufs[index].len, + read_size - done_read); +#ifdef _MSC_VER + __try { +#endif + memcpy(req->fs.info.bufs[index].base, + (char*)view + view_offset + done_read, + this_read_size); +#ifdef _MSC_VER + } + __except (fs__filemap_ex_filter(GetExceptionCode(), + GetExceptionInformation(), &err)) { + SET_REQ_WIN32_ERROR(req, err); + UnmapViewOfFile(view); + return; + } +#endif + done_read += this_read_size; + } + assert(done_read == read_size); + + if (!UnmapViewOfFile(view)) { + SET_REQ_WIN32_ERROR(req, GetLastError()); + return; + } + + if (req->fs.info.offset == -1) { + fd_info->current_pos = end_pos; + uv__fd_hash_add(fd, fd_info); + } + + SET_REQ_RESULT(req, read_size); + return; +} + void fs__read(uv_fs_t* req) { int fd = req->file.fd; int64_t offset = req->fs.info.offset; @@ -631,9 +832,15 @@ void fs__read(uv_fs_t* req) { LARGE_INTEGER original_position; LARGE_INTEGER zero_offset; int restore_position; + struct uv__fd_info_s fd_info; VERIFY_FD(fd, req); + if (uv__fd_hash_get(fd, &fd_info)) { + fs__read_filemap(req, &fd_info); + return; + } + zero_offset.QuadPart = 0; restore_position = 0; handle = uv__get_osfhandle(fd); @@ -690,6 +897,131 @@ void fs__read(uv_fs_t* req) { } +void fs__write_filemap(uv_fs_t* req, HANDLE file, + struct uv__fd_info_s* fd_info) { + int fd = req->file.fd; /* VERIFY_FD done in fs__write */ + int force_append = fd_info->flags & UV_FS_O_APPEND; + int rw_flags = fd_info->flags & + (UV_FS_O_RDONLY | UV_FS_O_WRONLY | UV_FS_O_RDWR); + size_t write_size, done_write; + unsigned int index; + LARGE_INTEGER zero, pos, end_pos; + size_t view_offset; + LARGE_INTEGER view_base; + void* view; + FILETIME ft; + + if (rw_flags == UV_FS_O_RDONLY) { + SET_REQ_WIN32_ERROR(req, ERROR_ACCESS_DENIED); + return; + } + if (fd_info->is_directory) { + SET_REQ_WIN32_ERROR(req, ERROR_INVALID_FUNCTION); + return; + } + + write_size = 0; + for (index = 0; index < req->fs.info.nbufs; ++index) { + write_size += req->fs.info.bufs[index].len; + } + + if (write_size == 0) { + SET_REQ_RESULT(req, 0); + return; + } + + zero.QuadPart = 0; + if (force_append) { + pos = fd_info->size; + } else if (req->fs.info.offset == -1) { + pos = fd_info->current_pos; + } else { + pos.QuadPart = req->fs.info.offset; + } + + end_pos.QuadPart = pos.QuadPart + write_size; + + /* Recreate the mapping to enlarge the file if needed */ + if (end_pos.QuadPart > fd_info->size.QuadPart) { + if (fd_info->mapping != INVALID_HANDLE_VALUE) { + CloseHandle(fd_info->mapping); + } + + fd_info->mapping = CreateFileMapping(file, + NULL, + PAGE_READWRITE, + end_pos.HighPart, + end_pos.LowPart, + NULL); + if (fd_info->mapping == NULL) { + SET_REQ_WIN32_ERROR(req, GetLastError()); + CloseHandle(file); + fd_info->mapping = INVALID_HANDLE_VALUE; + fd_info->size.QuadPart = 0; + fd_info->current_pos.QuadPart = 0; + uv__fd_hash_add(fd, fd_info); + return; + } + + fd_info->size = end_pos; + uv__fd_hash_add(fd, fd_info); + } + + view_offset = pos.QuadPart % uv__allocation_granularity; + view_base.QuadPart = pos.QuadPart - view_offset; + view = MapViewOfFile(fd_info->mapping, + FILE_MAP_WRITE, + view_base.HighPart, + view_base.LowPart, + view_offset + write_size); + if (view == NULL) { + SET_REQ_WIN32_ERROR(req, GetLastError()); + return; + } + + done_write = 0; + for (index = 0; index < req->fs.info.nbufs; ++index) { + int err = 0; +#ifdef _MSC_VER + __try { +#endif + memcpy((char*)view + view_offset + done_write, + req->fs.info.bufs[index].base, + req->fs.info.bufs[index].len); +#ifdef _MSC_VER + } + __except (fs__filemap_ex_filter(GetExceptionCode(), + GetExceptionInformation(), &err)) { + SET_REQ_WIN32_ERROR(req, err); + UnmapViewOfFile(view); + return; + } +#endif + done_write += req->fs.info.bufs[index].len; + } + assert(done_write == write_size); + + if (!FlushViewOfFile(view, 0)) { + SET_REQ_WIN32_ERROR(req, GetLastError()); + UnmapViewOfFile(view); + return; + } + if (!UnmapViewOfFile(view)) { + SET_REQ_WIN32_ERROR(req, GetLastError()); + return; + } + + if (req->fs.info.offset == -1) { + fd_info->current_pos = end_pos; + uv__fd_hash_add(fd, fd_info); + } + + GetSystemTimeAsFileTime(&ft); + SetFileTime(file, NULL, NULL, &ft); + + SET_REQ_RESULT(req, done_write); +} + void fs__write(uv_fs_t* req) { int fd = req->file.fd; int64_t offset = req->fs.info.offset; @@ -702,6 +1034,7 @@ void fs__write(uv_fs_t* req) { LARGE_INTEGER original_position; LARGE_INTEGER zero_offset; int restore_position; + struct uv__fd_info_s fd_info; VERIFY_FD(fd, req); @@ -713,6 +1046,11 @@ void fs__write(uv_fs_t* req) { return; } + if (uv__fd_hash_get(fd, &fd_info)) { + fs__write_filemap(req, handle, &fd_info); + return; + } + if (offset != -1) { memset(&overlapped, 0, sizeof overlapped); overlapped_ptr = &overlapped; @@ -850,8 +1188,13 @@ void fs__unlink(uv_fs_t* req) { void fs__mkdir(uv_fs_t* req) { /* TODO: use req->mode. */ - int result = _wmkdir(req->file.pathw); - SET_REQ_RESULT(req, result); + req->result = _wmkdir(req->file.pathw); + if (req->result == -1) { + req->sys_errno_ = _doserrno; + req->result = req->sys_errno_ == ERROR_INVALID_NAME + ? UV_EINVAL + : uv_translate_sys_error(req->sys_errno_); + } } @@ -1536,6 +1879,7 @@ static void fs__fdatasync(uv_fs_t* req) { static void fs__ftruncate(uv_fs_t* req) { int fd = req->file.fd; HANDLE handle; + struct uv__fd_info_s fd_info = { 0 }; NTSTATUS status; IO_STATUS_BLOCK io_status; FILE_END_OF_FILE_INFORMATION eof_info; @@ -1544,6 +1888,17 @@ static void fs__ftruncate(uv_fs_t* req) { handle = uv__get_osfhandle(fd); + if (uv__fd_hash_get(fd, &fd_info)) { + if (fd_info.is_directory) { + SET_REQ_WIN32_ERROR(req, ERROR_ACCESS_DENIED); + return; + } + + if (fd_info.mapping != INVALID_HANDLE_VALUE) { + CloseHandle(fd_info.mapping); + } + } + eof_info.EndOfFile.QuadPart = req->fs.info.offset; status = pNtSetInformationFile(handle, @@ -1556,6 +1911,43 @@ static void fs__ftruncate(uv_fs_t* req) { SET_REQ_RESULT(req, 0); } else { SET_REQ_WIN32_ERROR(req, pRtlNtStatusToDosError(status)); + + if (fd_info.flags) { + CloseHandle(handle); + fd_info.mapping = INVALID_HANDLE_VALUE; + fd_info.size.QuadPart = 0; + fd_info.current_pos.QuadPart = 0; + uv__fd_hash_add(fd, &fd_info); + return; + } + } + + if (fd_info.flags) { + fd_info.size = eof_info.EndOfFile; + + if (fd_info.size.QuadPart == 0) { + fd_info.mapping = INVALID_HANDLE_VALUE; + } else { + DWORD flProtect = (fd_info.flags & (UV_FS_O_RDONLY | UV_FS_O_WRONLY | + UV_FS_O_RDWR)) == UV_FS_O_RDONLY ? PAGE_READONLY : PAGE_READWRITE; + fd_info.mapping = CreateFileMapping(handle, + NULL, + flProtect, + fd_info.size.HighPart, + fd_info.size.LowPart, + NULL); + if (fd_info.mapping == NULL) { + SET_REQ_WIN32_ERROR(req, GetLastError()); + CloseHandle(handle); + fd_info.mapping = INVALID_HANDLE_VALUE; + fd_info.size.QuadPart = 0; + fd_info.current_pos.QuadPart = 0; + uv__fd_hash_add(fd, &fd_info); + return; + } + } + + uv__fd_hash_add(fd, &fd_info); } } @@ -1563,7 +1955,6 @@ static void fs__ftruncate(uv_fs_t* req) { static void fs__copyfile(uv_fs_t* req) { int flags; int overwrite; - DWORD error; uv_stat_t statbuf; uv_stat_t new_statbuf; @@ -2165,6 +2556,41 @@ static void fs__lchown(uv_fs_t* req) { req->result = 0; } + +static void fs__statfs(uv_fs_t* req) { + uv_statfs_t* stat_fs; + DWORD sectors_per_cluster; + DWORD bytes_per_sector; + DWORD free_clusters; + DWORD total_clusters; + + if (0 == GetDiskFreeSpaceW(req->file.pathw, + §ors_per_cluster, + &bytes_per_sector, + &free_clusters, + &total_clusters)) { + SET_REQ_WIN32_ERROR(req, GetLastError()); + return; + } + + stat_fs = uv__malloc(sizeof(*stat_fs)); + if (stat_fs == NULL) { + SET_REQ_UV_ERROR(req, UV_ENOMEM, ERROR_OUTOFMEMORY); + return; + } + + stat_fs->f_type = 0; + stat_fs->f_bsize = bytes_per_sector * sectors_per_cluster; + stat_fs->f_blocks = total_clusters; + stat_fs->f_bfree = free_clusters; + stat_fs->f_bavail = free_clusters; + stat_fs->f_files = 0; + stat_fs->f_ffree = 0; + req->ptr = stat_fs; + SET_REQ_RESULT(req, 0); +} + + static void uv__fs_work(struct uv__work* w) { uv_fs_t* req; @@ -2204,8 +2630,9 @@ static void uv__fs_work(struct uv__work* w) { XX(READLINK, readlink) XX(REALPATH, realpath) XX(CHOWN, chown) - XX(FCHOWN, fchown); - XX(LCHOWN, lchown); + XX(FCHOWN, fchown) + XX(LCHOWN, lchown) + XX(STATFS, statfs) default: assert(!"bad uv_fs_type"); } @@ -2717,3 +3144,18 @@ int uv_fs_futime(uv_loop_t* loop, uv_fs_t* req, uv_file fd, double atime, req->fs.time.mtime = mtime; POST; } + + +int uv_fs_statfs(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_fs_cb cb) { + int err; + + INIT(UV_FS_STATFS); + err = fs__capture_path(req, path, NULL, cb != NULL); + if (err) + return uv_translate_sys_error(err); + + POST; +} diff --git a/deps/uv/src/win/process.c b/deps/uv/src/win/process.c index f9c53de0af0079..9b7fdc1dc1b4e2 100644 --- a/deps/uv/src/win/process.c +++ b/deps/uv/src/win/process.c @@ -714,7 +714,7 @@ int make_program_env(char* env_block[], WCHAR** dst_ptr) { /* second pass: copy to UTF-16 environment block */ dst_copy = (WCHAR*)uv__malloc(env_len * sizeof(WCHAR)); - if (!dst_copy) { + if (dst_copy == NULL && env_len > 0) { return ERROR_OUTOFMEMORY; } env_copy = alloca(env_block_count * sizeof(WCHAR*)); @@ -739,7 +739,7 @@ int make_program_env(char* env_block[], WCHAR** dst_ptr) { } } *ptr_copy = NULL; - assert(env_len == (size_t) (ptr - dst_copy)); + assert(env_len == 0 || env_len == (size_t) (ptr - dst_copy)); /* sort our (UTF-16) copy */ qsort(env_copy, env_block_count-1, sizeof(wchar_t*), qsort_wcscmp); diff --git a/deps/uv/src/win/tty.c b/deps/uv/src/win/tty.c index a98fe26335e4b8..07436dc804f0f1 100644 --- a/deps/uv/src/win/tty.c +++ b/deps/uv/src/win/tty.c @@ -2280,6 +2280,8 @@ static void uv__determine_vterm_state(HANDLE handle) { static DWORD WINAPI uv__tty_console_resize_message_loop_thread(void* param) { CONSOLE_SCREEN_BUFFER_INFO sb_info; + NTSTATUS status; + ULONG_PTR conhost_pid; MSG msg; if (!GetConsoleScreenBufferInfo(uv__tty_console_handle, &sb_info)) @@ -2288,14 +2290,29 @@ static DWORD WINAPI uv__tty_console_resize_message_loop_thread(void* param) { uv__tty_console_width = sb_info.dwSize.X; uv__tty_console_height = sb_info.srWindow.Bottom - sb_info.srWindow.Top + 1; - if (pSetWinEventHook == NULL) + if (pSetWinEventHook == NULL || pNtQueryInformationProcess == NULL) return 0; + status = pNtQueryInformationProcess(GetCurrentProcess(), + ProcessConsoleHostProcess, + &conhost_pid, + sizeof(conhost_pid), + NULL); + + if (!NT_SUCCESS(status)) + /* We couldn't retrieve our console host process, probably because this + * is a 32-bit process running on 64-bit Windows. Fall back to receiving + * console events from all processes. */ + conhost_pid = 0; + + /* Ensure the PID is a multiple of 4, which is required by SetWinEventHook */ + conhost_pid &= ~(ULONG_PTR)0x3; + if (!pSetWinEventHook(EVENT_CONSOLE_LAYOUT, EVENT_CONSOLE_LAYOUT, NULL, uv__tty_console_resize_event, - 0, + (DWORD)conhost_pid, 0, WINEVENT_OUTOFCONTEXT)) return 0; diff --git a/deps/uv/src/win/util.c b/deps/uv/src/win/util.c index 7ca83213a67cca..359a16aed4bb27 100644 --- a/deps/uv/src/win/util.c +++ b/deps/uv/src/win/util.c @@ -1171,18 +1171,18 @@ int uv_os_homedir(char* buffer, size_t* size) { int uv_os_tmpdir(char* buffer, size_t* size) { - wchar_t path[MAX_PATH + 1]; + wchar_t path[MAX_PATH + 2]; DWORD bufsize; size_t len; if (buffer == NULL || size == NULL || *size == 0) return UV_EINVAL; - len = GetTempPathW(MAX_PATH + 1, path); + len = GetTempPathW(ARRAY_SIZE(path), path); if (len == 0) { return uv_translate_sys_error(GetLastError()); - } else if (len > MAX_PATH + 1) { + } else if (len > ARRAY_SIZE(path)) { /* This should not be possible */ return UV_EIO; } @@ -1397,6 +1397,75 @@ int uv_os_get_passwd(uv_passwd_t* pwd) { } +int uv_os_environ(uv_env_item_t** envitems, int* count) { + wchar_t* env; + wchar_t* penv; + int i, cnt; + uv_env_item_t* envitem; + + *envitems = NULL; + *count = 0; + + env = GetEnvironmentStringsW(); + if (env == NULL) + return 0; + + for (penv = env, i = 0; *penv != L'\0'; penv += wcslen(penv) + 1, i++); + + *envitems = uv__calloc(i, sizeof(**envitems)); + if (envitems == NULL) { + FreeEnvironmentStringsW(env); + return UV_ENOMEM; + } + + penv = env; + cnt = 0; + + while (*penv != L'\0' && cnt < i) { + char* buf; + char* ptr; + + if (uv__convert_utf16_to_utf8(penv, -1, &buf) != 0) + goto fail; + + ptr = strchr(buf, '='); + if (ptr == NULL) { + uv__free(buf); + goto do_continue; + } + + *ptr = '\0'; + + envitem = &(*envitems)[cnt]; + envitem->name = buf; + envitem->value = ptr + 1; + + cnt++; + + do_continue: + penv += wcslen(penv) + 1; + } + + FreeEnvironmentStringsW(env); + + *count = cnt; + return 0; + +fail: + FreeEnvironmentStringsW(env); + + for (i = 0; i < cnt; i++) { + envitem = &(*envitems)[cnt]; + uv__free(envitem->name); + } + uv__free(*envitems); + + *envitems = NULL; + *count = 0; + return UV_ENOMEM; +} + + int uv_os_getenv(const char* name, char* buffer, size_t* size) { wchar_t var[MAX_ENV_VAR_LENGTH]; wchar_t* name_w; diff --git a/deps/uv/src/win/winapi.c b/deps/uv/src/win/winapi.c index fbbbceed95ebcf..19e4377faf5599 100644 --- a/deps/uv/src/win/winapi.c +++ b/deps/uv/src/win/winapi.c @@ -34,6 +34,7 @@ sNtSetInformationFile pNtSetInformationFile; sNtQueryVolumeInformationFile pNtQueryVolumeInformationFile; sNtQueryDirectoryFile pNtQueryDirectoryFile; sNtQuerySystemInformation pNtQuerySystemInformation; +sNtQueryInformationProcess pNtQueryInformationProcess; /* Kernel32 function pointers */ sGetQueuedCompletionStatusEx pGetQueuedCompletionStatusEx; @@ -106,6 +107,13 @@ void uv_winapi_init(void) { uv_fatal_error(GetLastError(), "GetProcAddress"); } + pNtQueryInformationProcess = (sNtQueryInformationProcess) GetProcAddress( + ntdll_module, + "NtQueryInformationProcess"); + if (pNtQueryInformationProcess == NULL) { + uv_fatal_error(GetLastError(), "GetProcAddress"); + } + kernel32_module = GetModuleHandleA("kernel32.dll"); if (kernel32_module == NULL) { uv_fatal_error(GetLastError(), "GetModuleHandleA"); diff --git a/deps/uv/src/win/winapi.h b/deps/uv/src/win/winapi.h index 82c5ed46711d2f..203393c2e3af03 100644 --- a/deps/uv/src/win/winapi.h +++ b/deps/uv/src/win/winapi.h @@ -4436,6 +4436,10 @@ typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION { # define SystemProcessorPerformanceInformation 8 #endif +#ifndef ProcessConsoleHostProcess +# define ProcessConsoleHostProcess 49 +#endif + #ifndef FILE_DEVICE_FILE_SYSTEM # define FILE_DEVICE_FILE_SYSTEM 0x00000009 #endif @@ -4578,6 +4582,13 @@ typedef NTSTATUS (NTAPI *sNtQueryDirectoryFile) BOOLEAN RestartScan ); +typedef NTSTATUS (NTAPI *sNtQueryInformationProcess) + (HANDLE ProcessHandle, + UINT ProcessInformationClass, + PVOID ProcessInformation, + ULONG Length, + PULONG ReturnLength); + /* * Kernel32 headers */ @@ -4718,6 +4729,7 @@ extern sNtSetInformationFile pNtSetInformationFile; extern sNtQueryVolumeInformationFile pNtQueryVolumeInformationFile; extern sNtQueryDirectoryFile pNtQueryDirectoryFile; extern sNtQuerySystemInformation pNtQuerySystemInformation; +extern sNtQueryInformationProcess pNtQueryInformationProcess; /* Kernel32 function pointers */ extern sGetQueuedCompletionStatusEx pGetQueuedCompletionStatusEx; diff --git a/deps/uv/test/runner-win.c b/deps/uv/test/runner-win.c index f60c23df3ebf1e..6bb41a5d0629c8 100644 --- a/deps/uv/test/runner-win.c +++ b/deps/uv/test/runner-win.c @@ -56,6 +56,12 @@ int platform_init(int argc, char **argv) { _setmode(1, _O_BINARY); _setmode(2, _O_BINARY); +#ifdef _MSC_VER + _set_fmode(_O_BINARY); +#else + _fmode = _O_BINARY; +#endif + /* Disable stdio output buffering. */ setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0); diff --git a/deps/uv/test/task.h b/deps/uv/test/task.h index 8462e0ddbd0a9c..e763f89f09dcd1 100644 --- a/deps/uv/test/task.h +++ b/deps/uv/test/task.h @@ -44,6 +44,10 @@ # pragma clang diagnostic ignored "-Wc99-extensions" #endif +#ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wvariadic-macros" +#endif + #define TEST_PORT 9123 #define TEST_PORT_2 9124 diff --git a/deps/uv/test/test-env-vars.c b/deps/uv/test/test-env-vars.c index 641050e675ffce..d7abb4249561a4 100644 --- a/deps/uv/test/test-env-vars.c +++ b/deps/uv/test/test-env-vars.c @@ -27,9 +27,11 @@ TEST_IMPL(env_vars) { const char* name = "UV_TEST_FOO"; + const char* name2 = "UV_TEST_FOO2"; char buf[BUF_SIZE]; size_t size; - int r; + int i, r, envcount, found; + uv_env_item_t* envitems; /* Reject invalid inputs when setting an environment variable */ r = uv_os_setenv(NULL, "foo"); @@ -86,5 +88,38 @@ TEST_IMPL(env_vars) { r = uv_os_unsetenv(name); ASSERT(r == 0); + /* Check getting all env variables. */ + r = uv_os_setenv(name, "123456789"); + ASSERT(r == 0); + r = uv_os_setenv(name2, ""); + ASSERT(r == 0); + + r = uv_os_environ(&envitems, &envcount); + ASSERT(r == 0); + ASSERT(envcount > 0); + + found = 0; + + for (i = 0; i < envcount; i++) { + /* printf("Env: %s = %s\n", envitems[i].name, envitems[i].value); */ + if (strcmp(envitems[i].name, name) == 0) { + found++; + ASSERT(strcmp(envitems[i].value, "123456789") == 0); + } else if (strcmp(envitems[i].name, name2) == 0) { + found++; + ASSERT(strlen(envitems[i].value) == 0); + } + } + + ASSERT(found == 2); + + uv_os_free_environ(envitems, envcount); + + r = uv_os_unsetenv(name); + ASSERT(r == 0); + + r = uv_os_unsetenv(name2); + ASSERT(r == 0); + return 0; } diff --git a/deps/uv/test/test-fs-fd-hash.c b/deps/uv/test/test-fs-fd-hash.c new file mode 100644 index 00000000000000..8b4bc0351b334e --- /dev/null +++ b/deps/uv/test/test-fs-fd-hash.c @@ -0,0 +1,133 @@ +/* Copyright libuv project contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#if defined(_WIN32) && !defined(USING_UV_SHARED) + +#include "uv.h" +#include "task.h" + +#include "../src/win/fs-fd-hash-inl.h" + + +#define HASH_MAX 1000000000 +#define HASH_INC (1000 * UV__FD_HASH_SIZE + 2) +#define BUCKET_MAX (UV__FD_HASH_SIZE * UV__FD_HASH_GROUP_SIZE * 10) +#define BUCKET_INC UV__FD_HASH_SIZE +#define FD_DIFF 9 + + +void assert_nonexistent(int fd) { + struct uv__fd_info_s info = { 0 }; + ASSERT(!uv__fd_hash_get(fd, &info)); + ASSERT(!uv__fd_hash_remove(fd, &info)); +} + +void assert_existent(int fd) { + struct uv__fd_info_s info = { 0 }; + ASSERT(uv__fd_hash_get(fd, &info)); + ASSERT(info.flags == fd + FD_DIFF); +} + +void assert_insertion(int fd) { + struct uv__fd_info_s info = { 0 }; + assert_nonexistent(fd); + info.flags = fd + FD_DIFF; + uv__fd_hash_add(fd, &info); + assert_existent(fd); +} + +void assert_removal(int fd) { + struct uv__fd_info_s info = { 0 }; + assert_existent(fd); + uv__fd_hash_remove(fd, &info); + ASSERT(info.flags == fd + FD_DIFF); + assert_nonexistent(fd); +} + + +/* Run a function for a set of values up to a very high number */ +#define RUN_HASH(function) \ + do { \ + for (fd = 0; fd < HASH_MAX; fd += HASH_INC) { \ + function(fd); \ + } \ + } while (0) + +/* Run a function for a set of values that will cause many collisions */ +#define RUN_COLLISIONS(function) \ + do { \ + for (fd = 1; fd < BUCKET_MAX; fd += BUCKET_INC) { \ + function(fd); \ + } \ + } while (0) + + +TEST_IMPL(fs_fd_hash) { + int fd; + + uv__fd_hash_init(); + + /* Empty table */ + RUN_HASH(assert_nonexistent); + RUN_COLLISIONS(assert_nonexistent); + + /* Fill up */ + RUN_HASH(assert_insertion); + RUN_COLLISIONS(assert_insertion); + + /* Full */ + RUN_HASH(assert_existent); + RUN_COLLISIONS(assert_existent); + + /* Update */ + { + struct uv__fd_info_s info = { 0 }; + info.flags = FD_DIFF + FD_DIFF; + uv__fd_hash_add(0, &info); + } + { + struct uv__fd_info_s info = { 0 }; + ASSERT(uv__fd_hash_get(0, &info)); + ASSERT(info.flags == FD_DIFF + FD_DIFF); + } + { + /* Leave as it was, will be again tested below */ + struct uv__fd_info_s info = { 0 }; + info.flags = FD_DIFF; + uv__fd_hash_add(0, &info); + } + + /* Remove all */ + RUN_HASH(assert_removal); + RUN_COLLISIONS(assert_removal); + + /* Empty table */ + RUN_HASH(assert_nonexistent); + RUN_COLLISIONS(assert_nonexistent); + + return 0; +} + +#else + +typedef int file_has_no_tests; /* ISO C forbids an empty translation unit. */ + +#endif /* ifndef _WIN32 */ diff --git a/deps/uv/test/test-fs-open-flags.c b/deps/uv/test/test-fs-open-flags.c new file mode 100644 index 00000000000000..fcef2fb0819f74 --- /dev/null +++ b/deps/uv/test/test-fs-open-flags.c @@ -0,0 +1,435 @@ +/* Copyright libuv project contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifdef _WIN32 + +#include "uv.h" +#include "task.h" + +#if defined(__unix__) || defined(__POSIX__) || \ + defined(__APPLE__) || defined(__sun) || \ + defined(_AIX) || defined(__MVS__) || \ + defined(__HAIKU__) +# include /* unlink, rmdir */ +#else +# include +# define rmdir _rmdir +# define unlink _unlink +#endif + +static int flags; + +static uv_fs_t close_req; +static uv_fs_t mkdir_req; +static uv_fs_t open_req; +static uv_fs_t read_req; +static uv_fs_t rmdir_req; +static uv_fs_t unlink_req; +static uv_fs_t write_req; + +static char buf[32]; +static uv_buf_t iov; + +/* Opening the same file multiple times quickly can cause uv_fs_open to fail + * with EBUSY, so append an identifier to the file name for each operation */ +static int sid = 0; + +#define FILE_NAME_SIZE 128 +static char absent_file[FILE_NAME_SIZE]; +static char empty_file[FILE_NAME_SIZE]; +static char dummy_file[FILE_NAME_SIZE]; +static char empty_dir[] = "empty_dir"; + +static void setup() { + int r; + + /* empty_dir */ + r = uv_fs_rmdir(NULL, &rmdir_req, empty_dir, NULL); + ASSERT(r == 0 || r == UV_ENOENT); + ASSERT(rmdir_req.result == 0 || rmdir_req.result == UV_ENOENT); + uv_fs_req_cleanup(&rmdir_req); + + r = uv_fs_mkdir(NULL, &mkdir_req, empty_dir, 0755, NULL); + ASSERT(r == 0); + ASSERT(mkdir_req.result == 0); + uv_fs_req_cleanup(&mkdir_req); +} + +static void refresh() { + int r; + + /* absent_file */ + sprintf(absent_file, "test_file_%d", sid++); + + r = uv_fs_unlink(NULL, &unlink_req, absent_file, NULL); + ASSERT(r == 0 || r == UV_ENOENT); + ASSERT(unlink_req.result == 0 || unlink_req.result == UV_ENOENT); + uv_fs_req_cleanup(&unlink_req); + + /* empty_file */ + sprintf(empty_file, "test_file_%d", sid++); + + r = uv_fs_open(NULL, &open_req, empty_file, + UV_FS_O_TRUNC | UV_FS_O_CREAT | UV_FS_O_WRONLY, S_IWUSR | S_IRUSR, NULL); + ASSERT(r >= 0); + ASSERT(open_req.result >= 0); + uv_fs_req_cleanup(&open_req); + + r = uv_fs_close(NULL, &close_req, open_req.result, NULL); + ASSERT(r == 0); + ASSERT(close_req.result == 0); + uv_fs_req_cleanup(&close_req); + + /* dummy_file */ + sprintf(dummy_file, "test_file_%d", sid++); + + r = uv_fs_open(NULL, &open_req, dummy_file, + UV_FS_O_TRUNC | UV_FS_O_CREAT | UV_FS_O_WRONLY, S_IWUSR | S_IRUSR, NULL); + ASSERT(r >= 0); + ASSERT(open_req.result >= 0); + uv_fs_req_cleanup(&open_req); + + iov = uv_buf_init("a", 1); + r = uv_fs_write(NULL, &write_req, open_req.result, &iov, 1, -1, NULL); + ASSERT(r == 1); + ASSERT(write_req.result == 1); + uv_fs_req_cleanup(&write_req); + + r = uv_fs_close(NULL, &close_req, open_req.result, NULL); + ASSERT(r == 0); + ASSERT(close_req.result == 0); + uv_fs_req_cleanup(&close_req); +} + +static void cleanup() { + unlink(absent_file); + unlink(empty_file); + unlink(dummy_file); +} + +static void openFail(char *file, int error) { + int r; + + refresh(); + + r = uv_fs_open(NULL, &open_req, file, flags, S_IWUSR | S_IRUSR, NULL); + ASSERT(r == error); + ASSERT(open_req.result == error); + uv_fs_req_cleanup(&open_req); + + /* Ensure the first call does not create the file */ + r = uv_fs_open(NULL, &open_req, file, flags, S_IWUSR | S_IRUSR, NULL); + ASSERT(r == error); + ASSERT(open_req.result == error); + uv_fs_req_cleanup(&open_req); + + cleanup(); +} + +static void refreshOpen(char *file) { + int r; + + refresh(); + + r = uv_fs_open(NULL, &open_req, file, flags, S_IWUSR | S_IRUSR, NULL); + ASSERT(r >= 0); + ASSERT(open_req.result >= 0); + uv_fs_req_cleanup(&open_req); +} + +static void writeExpect(char *file, char *expected, int size) { + int r; + + refreshOpen(file); + + iov = uv_buf_init("b", 1); + r = uv_fs_write(NULL, &write_req, open_req.result, &iov, 1, -1, NULL); + ASSERT(r == 1); + ASSERT(write_req.result == 1); + uv_fs_req_cleanup(&write_req); + + iov = uv_buf_init("c", 1); + r = uv_fs_write(NULL, &write_req, open_req.result, &iov, 1, -1, NULL); + ASSERT(r == 1); + ASSERT(write_req.result == 1); + uv_fs_req_cleanup(&write_req); + + r = uv_fs_close(NULL, &close_req, open_req.result, NULL); + ASSERT(r == 0); + ASSERT(close_req.result == 0); + uv_fs_req_cleanup(&close_req); + + /* Check contents */ + r = uv_fs_open(NULL, &open_req, file, UV_FS_O_RDONLY, S_IWUSR | S_IRUSR, NULL); + ASSERT(r >= 0); + ASSERT(open_req.result >= 0); + uv_fs_req_cleanup(&open_req); + + iov = uv_buf_init(buf, sizeof(buf)); + r = uv_fs_read(NULL, &read_req, open_req.result, &iov, 1, -1, NULL); + ASSERT(r == size); + ASSERT(read_req.result == size); + ASSERT(strncmp(buf, expected, size) == 0); + uv_fs_req_cleanup(&read_req); + + r = uv_fs_close(NULL, &close_req, open_req.result, NULL); + ASSERT(r == 0); + ASSERT(close_req.result == 0); + uv_fs_req_cleanup(&close_req); + + cleanup(); +} + +static void writeFail(char *file, int error) { + int r; + + refreshOpen(file); + + iov = uv_buf_init("z", 1); + r = uv_fs_write(NULL, &write_req, open_req.result, &iov, 1, -1, NULL); + ASSERT(r == error); + ASSERT(write_req.result == error); + uv_fs_req_cleanup(&write_req); + + iov = uv_buf_init("z", 1); + r = uv_fs_write(NULL, &write_req, open_req.result, &iov, 1, -1, NULL); + ASSERT(r == error); + ASSERT(write_req.result == error); + uv_fs_req_cleanup(&write_req); + + r = uv_fs_close(NULL, &close_req, open_req.result, NULL); + ASSERT(r == 0); + ASSERT(close_req.result == 0); + uv_fs_req_cleanup(&close_req); + + cleanup(); +} + +static void readExpect(char *file, char *expected, int size) { + int r; + + refreshOpen(file); + + iov = uv_buf_init(buf, sizeof(buf)); + r = uv_fs_read(NULL, &read_req, open_req.result, &iov, 1, -1, NULL); + ASSERT(r == size); + ASSERT(read_req.result == size); + ASSERT(strncmp(buf, expected, size) == 0); + uv_fs_req_cleanup(&read_req); + + r = uv_fs_close(NULL, &close_req, open_req.result, NULL); + ASSERT(r == 0); + ASSERT(close_req.result == 0); + uv_fs_req_cleanup(&close_req); + + cleanup(); +} + +static void readFail(char *file, int error) { + int r; + + refreshOpen(file); + + iov = uv_buf_init(buf, sizeof(buf)); + r = uv_fs_read(NULL, &read_req, open_req.result, &iov, 1, -1, NULL); + ASSERT(r == error); + ASSERT(read_req.result == error); + uv_fs_req_cleanup(&read_req); + + iov = uv_buf_init(buf, sizeof(buf)); + r = uv_fs_read(NULL, &read_req, open_req.result, &iov, 1, -1, NULL); + ASSERT(r == error); + ASSERT(read_req.result == error); + uv_fs_req_cleanup(&read_req); + + r = uv_fs_close(NULL, &close_req, open_req.result, NULL); + ASSERT(r == 0); + ASSERT(close_req.result == 0); + uv_fs_req_cleanup(&close_req); + + cleanup(); +} + +static void fs_open_flags(int add_flags) { + /* Follow the order from + * https://github.com/nodejs/node/blob/1a96abe849/lib/internal/fs/utils.js#L329-L354 + */ + + /* r */ + flags = add_flags | UV_FS_O_RDONLY; + openFail(absent_file, UV_ENOENT); + writeFail(empty_file, UV_EPERM); + readExpect(empty_file, "", 0); + writeFail(dummy_file, UV_EPERM); + readExpect(dummy_file, "a", 1); + writeFail(empty_dir, UV_EPERM); + readFail(empty_dir, UV_EISDIR); + + /* rs */ + flags = add_flags | UV_FS_O_RDONLY | UV_FS_O_SYNC; + openFail(absent_file, UV_ENOENT); + writeFail(empty_file, UV_EPERM); + readExpect(empty_file, "", 0); + writeFail(dummy_file, UV_EPERM); + readExpect(dummy_file, "a", 1); + writeFail(empty_dir, UV_EPERM); + readFail(empty_dir, UV_EISDIR); + + /* r+ */ + flags = add_flags | UV_FS_O_RDWR; + openFail(absent_file, UV_ENOENT); + writeExpect(empty_file, "bc", 2); + readExpect(empty_file, "", 0); + writeExpect(dummy_file, "bc", 2); + readExpect(dummy_file, "a", 1); + writeFail(empty_dir, UV_EISDIR); + readFail(empty_dir, UV_EISDIR); + + /* rs+ */ + flags = add_flags | UV_FS_O_RDWR | UV_FS_O_SYNC; + openFail(absent_file, UV_ENOENT); + writeExpect(empty_file, "bc", 2); + readExpect(empty_file, "", 0); + writeExpect(dummy_file, "bc", 2); + readExpect(dummy_file, "a", 1); + writeFail(empty_dir, UV_EISDIR); + readFail(empty_dir, UV_EISDIR); + + /* w */ + flags = add_flags | UV_FS_O_TRUNC | UV_FS_O_CREAT | UV_FS_O_WRONLY; + writeExpect(absent_file, "bc", 2); + readFail(absent_file, UV_EPERM); + writeExpect(empty_file, "bc", 2); + readFail(empty_file, UV_EPERM); + writeExpect(dummy_file, "bc", 2); + readFail(dummy_file, UV_EPERM); + openFail(empty_dir, UV_EISDIR); + + /* wx */ + flags = add_flags | UV_FS_O_TRUNC | UV_FS_O_CREAT | UV_FS_O_WRONLY | + UV_FS_O_EXCL; + writeExpect(absent_file, "bc", 2); + readFail(absent_file, UV_EPERM); + openFail(empty_file, UV_EEXIST); + openFail(dummy_file, UV_EEXIST); + openFail(empty_dir, UV_EEXIST); + + /* w+ */ + flags = add_flags | UV_FS_O_TRUNC | UV_FS_O_CREAT | UV_FS_O_RDWR; + writeExpect(absent_file, "bc", 2); + readExpect(absent_file, "", 0); + writeExpect(empty_file, "bc", 2); + readExpect(empty_file, "", 0); + writeExpect(dummy_file, "bc", 2); + readExpect(dummy_file, "", 0); + openFail(empty_dir, UV_EISDIR); + + /* wx+ */ + flags = add_flags | UV_FS_O_TRUNC | UV_FS_O_CREAT | UV_FS_O_RDWR | + UV_FS_O_EXCL; + writeExpect(absent_file, "bc", 2); + readExpect(absent_file, "", 0); + openFail(empty_file, UV_EEXIST); + openFail(dummy_file, UV_EEXIST); + openFail(empty_dir, UV_EEXIST); + + /* a */ + flags = add_flags | UV_FS_O_APPEND | UV_FS_O_CREAT | UV_FS_O_WRONLY; + writeExpect(absent_file, "bc", 2); + readFail(absent_file, UV_EPERM); + writeExpect(empty_file, "bc", 2); + readFail(empty_file, UV_EPERM); + writeExpect(dummy_file, "abc", 3); + readFail(dummy_file, UV_EPERM); + writeFail(empty_dir, UV_EISDIR); + readFail(empty_dir, UV_EPERM); + + /* ax */ + flags = add_flags | UV_FS_O_APPEND | UV_FS_O_CREAT | UV_FS_O_WRONLY | + UV_FS_O_EXCL; + writeExpect(absent_file, "bc", 2); + readFail(absent_file, UV_EPERM); + openFail(empty_file, UV_EEXIST); + openFail(dummy_file, UV_EEXIST); + openFail(empty_dir, UV_EEXIST); + + /* as */ + flags = add_flags | UV_FS_O_APPEND | UV_FS_O_CREAT | UV_FS_O_WRONLY | + UV_FS_O_SYNC; + writeExpect(absent_file, "bc", 2); + readFail(absent_file, UV_EPERM); + writeExpect(empty_file, "bc", 2); + readFail(empty_file, UV_EPERM); + writeExpect(dummy_file, "abc", 3); + readFail(dummy_file, UV_EPERM); + writeFail(empty_dir, UV_EISDIR); + readFail(empty_dir, UV_EPERM); + + /* a+ */ + flags = add_flags | UV_FS_O_APPEND | UV_FS_O_CREAT | UV_FS_O_RDWR; + writeExpect(absent_file, "bc", 2); + readExpect(absent_file, "", 0); + writeExpect(empty_file, "bc", 2); + readExpect(empty_file, "", 0); + writeExpect(dummy_file, "abc", 3); + readExpect(dummy_file, "a", 1); + writeFail(empty_dir, UV_EISDIR); + readFail(empty_dir, UV_EISDIR); + + /* ax+ */ + flags = add_flags | UV_FS_O_APPEND | UV_FS_O_CREAT | UV_FS_O_RDWR | + UV_FS_O_EXCL; + writeExpect(absent_file, "bc", 2); + readExpect(absent_file, "", 0); + openFail(empty_file, UV_EEXIST); + openFail(dummy_file, UV_EEXIST); + openFail(empty_dir, UV_EEXIST); + + /* as+ */ + flags = add_flags | UV_FS_O_APPEND | UV_FS_O_CREAT | UV_FS_O_RDWR | + UV_FS_O_SYNC; + writeExpect(absent_file, "bc", 2); + readExpect(absent_file, "", 0); + writeExpect(empty_file, "bc", 2); + readExpect(empty_file, "", 0); + writeExpect(dummy_file, "abc", 3); + readExpect(dummy_file, "a", 1); + writeFail(empty_dir, UV_EISDIR); + readFail(empty_dir, UV_EISDIR); +} +TEST_IMPL(fs_open_flags) { + setup(); + + fs_open_flags(0); + fs_open_flags(UV_FS_O_FILEMAP); + + /* Cleanup. */ + rmdir(empty_dir); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + +#else + +typedef int file_has_no_tests; /* ISO C forbids an empty translation unit. */ + +#endif /* ifndef _WIN32 */ diff --git a/deps/uv/test/test-fs.c b/deps/uv/test/test-fs.c index 2cf8f287fe331d..0d92b0d3a0d319 100644 --- a/deps/uv/test/test-fs.c +++ b/deps/uv/test/test-fs.c @@ -94,6 +94,7 @@ static int readlink_cb_count; static int realpath_cb_count; static int utime_cb_count; static int futime_cb_count; +static int statfs_cb_count; static uv_loop_t* loop; @@ -330,6 +331,38 @@ static void fstat_cb(uv_fs_t* req) { } +static void statfs_cb(uv_fs_t* req) { + uv_statfs_t* stats; + + ASSERT(req->fs_type == UV_FS_STATFS); + ASSERT(req->result == 0); + ASSERT(req->ptr != NULL); + stats = req->ptr; + +#if defined(_WIN32) || defined(__sun) || defined(_AIX) || defined(__MVS__) + ASSERT(stats->f_type == 0); +#else + ASSERT(stats->f_type > 0); +#endif + + ASSERT(stats->f_bsize > 0); + ASSERT(stats->f_blocks > 0); + ASSERT(stats->f_bfree <= stats->f_blocks); + ASSERT(stats->f_bavail <= stats->f_bfree); + +#ifdef _WIN32 + ASSERT(stats->f_files == 0); + ASSERT(stats->f_ffree == 0); +#else + ASSERT(stats->f_files > 0); + ASSERT(stats->f_ffree <= stats->f_files); +#endif + uv_fs_req_cleanup(req); + ASSERT(req->ptr == NULL); + statfs_cb_count++; +} + + static void close_cb(uv_fs_t* req) { int r; ASSERT(req == &close_req); @@ -847,7 +880,7 @@ TEST_IMPL(fs_file_async) { } -TEST_IMPL(fs_file_sync) { +static void fs_file_sync(int add_flags) { int r; /* Setup. */ @@ -856,8 +889,8 @@ TEST_IMPL(fs_file_sync) { loop = uv_default_loop(); - r = uv_fs_open(loop, &open_req1, "test_file", O_WRONLY | O_CREAT, - S_IWUSR | S_IRUSR, NULL); + r = uv_fs_open(loop, &open_req1, "test_file", + O_WRONLY | O_CREAT | add_flags, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); @@ -873,7 +906,7 @@ TEST_IMPL(fs_file_sync) { ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_open(NULL, &open_req1, "test_file", O_RDWR, 0, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file", O_RDWR | add_flags, 0, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); @@ -900,7 +933,8 @@ TEST_IMPL(fs_file_sync) { ASSERT(rename_req.result == 0); uv_fs_req_cleanup(&rename_req); - r = uv_fs_open(NULL, &open_req1, "test_file2", O_RDONLY, 0, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file2", O_RDONLY | add_flags, 0, + NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); @@ -926,13 +960,17 @@ TEST_IMPL(fs_file_sync) { /* Cleanup */ unlink("test_file"); unlink("test_file2"); +} +TEST_IMPL(fs_file_sync) { + fs_file_sync(0); + fs_file_sync(UV_FS_O_FILEMAP); MAKE_VALGRIND_HAPPY(); return 0; } -TEST_IMPL(fs_file_write_null_buffer) { +static void fs_file_write_null_buffer(int add_flags) { int r; /* Setup. */ @@ -940,8 +978,8 @@ TEST_IMPL(fs_file_write_null_buffer) { loop = uv_default_loop(); - r = uv_fs_open(NULL, &open_req1, "test_file", O_WRONLY | O_CREAT, - S_IWUSR | S_IRUSR, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file", + O_WRONLY | O_CREAT | add_flags, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); @@ -958,6 +996,10 @@ TEST_IMPL(fs_file_write_null_buffer) { uv_fs_req_cleanup(&close_req); unlink("test_file"); +} +TEST_IMPL(fs_file_write_null_buffer) { + fs_file_write_null_buffer(0); + fs_file_write_null_buffer(UV_FS_O_FILEMAP); MAKE_VALGRIND_HAPPY(); return 0; @@ -1470,7 +1512,7 @@ TEST_IMPL(fs_chmod) { uv_run(loop, UV_RUN_DEFAULT); ASSERT(fchmod_cb_count == 1); - close(file); + uv_fs_close(loop, &req, file, NULL); /* * Run the loop just to check we don't have make any extraneous uv_ref() @@ -1513,7 +1555,7 @@ TEST_IMPL(fs_unlink_readonly) { ASSERT(req.result == sizeof(test_buf)); uv_fs_req_cleanup(&req); - close(file); + uv_fs_close(loop, &req, file, NULL); /* Make the file read-only */ r = uv_fs_chmod(NULL, &req, "test_file", 0400, NULL); @@ -1572,7 +1614,7 @@ TEST_IMPL(fs_unlink_archive_readonly) { ASSERT(req.result == sizeof(test_buf)); uv_fs_req_cleanup(&req); - close(file); + uv_fs_close(loop, &req, file, NULL); /* Make the file read-only and clear archive flag */ r = SetFileAttributes("test_file", FILE_ATTRIBUTE_READONLY); @@ -1722,7 +1764,7 @@ TEST_IMPL(fs_link) { ASSERT(req.result == sizeof(test_buf)); uv_fs_req_cleanup(&req); - close(file); + uv_fs_close(loop, &req, file, NULL); /* sync link */ r = uv_fs_link(NULL, &req, "test_file", "test_file_link", NULL); @@ -1764,7 +1806,7 @@ TEST_IMPL(fs_link) { ASSERT(req.result >= 0); ASSERT(strcmp(buf, test_buf) == 0); - close(link); + uv_fs_close(loop, &req, link, NULL); /* * Run the loop just to check we don't have make any extraneous uv_ref() @@ -1871,7 +1913,7 @@ TEST_IMPL(fs_symlink) { ASSERT(req.result == sizeof(test_buf)); uv_fs_req_cleanup(&req); - close(file); + uv_fs_close(loop, &req, file, NULL); /* sync symlink */ r = uv_fs_symlink(NULL, &req, "test_file", "test_file_symlink", 0, NULL); @@ -1909,7 +1951,7 @@ TEST_IMPL(fs_symlink) { ASSERT(req.result >= 0); ASSERT(strcmp(buf, test_buf) == 0); - close(link); + uv_fs_close(loop, &req, link, NULL); r = uv_fs_symlink(NULL, &req, @@ -1971,7 +2013,7 @@ TEST_IMPL(fs_symlink) { ASSERT(req.result >= 0); ASSERT(strcmp(buf, test_buf) == 0); - close(link); + uv_fs_close(loop, &req, link, NULL); r = uv_fs_symlink(NULL, &req, @@ -2293,7 +2335,7 @@ TEST_IMPL(fs_utime) { ASSERT(r >= 0); ASSERT(req.result >= 0); uv_fs_req_cleanup(&req); - close(r); + uv_fs_close(loop, &req, r, NULL); atime = mtime = 400497753; /* 1982-09-10 11:22:33 */ @@ -2388,7 +2430,7 @@ TEST_IMPL(fs_futime) { ASSERT(r >= 0); ASSERT(req.result >= 0); uv_fs_req_cleanup(&req); - close(r); + uv_fs_close(loop, &req, r, NULL); atime = mtime = 400497753; /* 1982-09-10 11:22:33 */ @@ -2583,7 +2625,7 @@ TEST_IMPL(fs_open_dir) { } -TEST_IMPL(fs_file_open_append) { +static void fs_file_open_append(int add_flags) { int r; /* Setup. */ @@ -2591,8 +2633,8 @@ TEST_IMPL(fs_file_open_append) { loop = uv_default_loop(); - r = uv_fs_open(NULL, &open_req1, "test_file", O_WRONLY | O_CREAT, - S_IWUSR | S_IRUSR, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file", + O_WRONLY | O_CREAT | add_flags, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); @@ -2608,7 +2650,8 @@ TEST_IMPL(fs_file_open_append) { ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_open(NULL, &open_req1, "test_file", O_RDWR | O_APPEND, 0, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file", + O_RDWR | O_APPEND | add_flags, 0, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); @@ -2624,7 +2667,8 @@ TEST_IMPL(fs_file_open_append) { ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_open(NULL, &open_req1, "test_file", O_RDONLY, S_IRUSR, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file", O_RDONLY | add_flags, + S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); @@ -2646,6 +2690,10 @@ TEST_IMPL(fs_file_open_append) { /* Cleanup */ unlink("test_file"); +} +TEST_IMPL(fs_file_open_append) { + fs_file_open_append(0); + fs_file_open_append(UV_FS_O_FILEMAP); MAKE_VALGRIND_HAPPY(); return 0; @@ -2721,13 +2769,13 @@ TEST_IMPL(fs_rename_to_existing_file) { } -TEST_IMPL(fs_read_bufs) { +static void fs_read_bufs(int add_flags) { char scratch[768]; uv_buf_t bufs[4]; ASSERT(0 <= uv_fs_open(NULL, &open_req1, "test/fixtures/lorem_ipsum.txt", - O_RDONLY, 0, NULL)); + O_RDONLY | add_flags, 0, NULL)); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); @@ -2769,13 +2817,17 @@ TEST_IMPL(fs_read_bufs) { ASSERT(0 == uv_fs_close(NULL, &close_req, open_req1.result, NULL)); ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); +} +TEST_IMPL(fs_read_bufs) { + fs_read_bufs(0); + fs_read_bufs(UV_FS_O_FILEMAP); MAKE_VALGRIND_HAPPY(); return 0; } -TEST_IMPL(fs_read_file_eof) { +static void fs_read_file_eof(int add_flags) { #if defined(__CYGWIN__) || defined(__MSYS__) RETURN_SKIP("Cygwin pread at EOF may (incorrectly) return data!"); #endif @@ -2786,8 +2838,8 @@ TEST_IMPL(fs_read_file_eof) { loop = uv_default_loop(); - r = uv_fs_open(NULL, &open_req1, "test_file", O_WRONLY | O_CREAT, - S_IWUSR | S_IRUSR, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file", + O_WRONLY | O_CREAT | add_flags, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); @@ -2803,7 +2855,8 @@ TEST_IMPL(fs_read_file_eof) { ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_open(NULL, &open_req1, "test_file", O_RDONLY, 0, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file", O_RDONLY | add_flags, 0, + NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); @@ -2830,13 +2883,17 @@ TEST_IMPL(fs_read_file_eof) { /* Cleanup */ unlink("test_file"); +} +TEST_IMPL(fs_read_file_eof) { + fs_read_file_eof(0); + fs_read_file_eof(UV_FS_O_FILEMAP); MAKE_VALGRIND_HAPPY(); return 0; } -TEST_IMPL(fs_write_multiple_bufs) { +static void fs_write_multiple_bufs(int add_flags) { uv_buf_t iovs[2]; int r; @@ -2845,8 +2902,8 @@ TEST_IMPL(fs_write_multiple_bufs) { loop = uv_default_loop(); - r = uv_fs_open(NULL, &open_req1, "test_file", O_WRONLY | O_CREAT, - S_IWUSR | S_IRUSR, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file", + O_WRONLY | O_CREAT | add_flags, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); @@ -2863,7 +2920,8 @@ TEST_IMPL(fs_write_multiple_bufs) { ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_open(NULL, &open_req1, "test_file", O_RDONLY, 0, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file", O_RDONLY | add_flags, 0, + NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); @@ -2919,13 +2977,17 @@ TEST_IMPL(fs_write_multiple_bufs) { /* Cleanup */ unlink("test_file"); +} +TEST_IMPL(fs_write_multiple_bufs) { + fs_write_multiple_bufs(0); + fs_write_multiple_bufs(UV_FS_O_FILEMAP); MAKE_VALGRIND_HAPPY(); return 0; } -TEST_IMPL(fs_write_alotof_bufs) { +static void fs_write_alotof_bufs(int add_flags) { size_t iovcount; size_t iovmax; uv_buf_t* iovs; @@ -2947,7 +3009,7 @@ TEST_IMPL(fs_write_alotof_bufs) { r = uv_fs_open(NULL, &open_req1, "test_file", - O_RDWR | O_CREAT, + O_RDWR | O_CREAT | add_flags, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); @@ -2976,7 +3038,17 @@ TEST_IMPL(fs_write_alotof_bufs) { iovs[index] = uv_buf_init(buffer + index * sizeof(test_buf), sizeof(test_buf)); - ASSERT(lseek(open_req1.result, 0, SEEK_SET) == 0); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); + ASSERT(r == 0); + ASSERT(close_req.result == 0); + uv_fs_req_cleanup(&close_req); + + r = uv_fs_open(NULL, &open_req1, "test_file", O_RDONLY | add_flags, 0, + NULL); + ASSERT(r >= 0); + ASSERT(open_req1.result >= 0); + uv_fs_req_cleanup(&open_req1); + r = uv_fs_read(NULL, &read_req, open_req1.result, iovs, iovcount, -1, NULL); if (iovcount > iovmax) iovcount = iovmax; @@ -3012,13 +3084,17 @@ TEST_IMPL(fs_write_alotof_bufs) { /* Cleanup */ unlink("test_file"); free(iovs); +} +TEST_IMPL(fs_write_alotof_bufs) { + fs_write_alotof_bufs(0); + fs_write_alotof_bufs(UV_FS_O_FILEMAP); MAKE_VALGRIND_HAPPY(); return 0; } -TEST_IMPL(fs_write_alotof_bufs_with_offset) { +static void fs_write_alotof_bufs_with_offset(int add_flags) { size_t iovcount; size_t iovmax; uv_buf_t* iovs; @@ -3045,7 +3121,7 @@ TEST_IMPL(fs_write_alotof_bufs_with_offset) { r = uv_fs_open(NULL, &open_req1, "test_file", - O_RDWR | O_CREAT, + O_RDWR | O_CREAT | add_flags, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); @@ -3124,6 +3200,10 @@ TEST_IMPL(fs_write_alotof_bufs_with_offset) { /* Cleanup */ unlink("test_file"); free(iovs); +} +TEST_IMPL(fs_write_alotof_bufs_with_offset) { + fs_write_alotof_bufs_with_offset(0); + fs_write_alotof_bufs_with_offset(UV_FS_O_FILEMAP); MAKE_VALGRIND_HAPPY(); return 0; @@ -3539,6 +3619,146 @@ TEST_IMPL(fs_file_pos_after_op_with_offset) { return 0; } +#ifdef _WIN32 +static void fs_file_pos_common() { + int r; + + iov = uv_buf_init("abc", 3); + r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); + ASSERT(r == 3); + uv_fs_req_cleanup(&write_req); + + /* Read with offset should not change the position */ + iov = uv_buf_init(buf, 1); + r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, 1, NULL); + ASSERT(r == 1); + ASSERT(buf[0] == 'b'); + uv_fs_req_cleanup(&read_req); + + iov = uv_buf_init(buf, sizeof(buf)); + r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); + ASSERT(r == 0); + uv_fs_req_cleanup(&read_req); + + /* Write without offset should change the position */ + iov = uv_buf_init("d", 1); + r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); + ASSERT(r == 1); + uv_fs_req_cleanup(&write_req); + + iov = uv_buf_init(buf, sizeof(buf)); + r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); + ASSERT(r == 0); + uv_fs_req_cleanup(&read_req); +} + +static void fs_file_pos_close_check(const char *contents, int size) { + int r; + + /* Close */ + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); + ASSERT(r == 0); + uv_fs_req_cleanup(&close_req); + + /* Confirm file contents */ + r = uv_fs_open(NULL, &open_req1, "test_file", O_RDONLY, 0, NULL); + ASSERT(r >= 0); + ASSERT(open_req1.result >= 0); + uv_fs_req_cleanup(&open_req1); + + iov = uv_buf_init(buf, sizeof(buf)); + r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); + ASSERT(r == size); + ASSERT(strncmp(buf, contents, size) == 0); + uv_fs_req_cleanup(&read_req); + + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); + ASSERT(r == 0); + uv_fs_req_cleanup(&close_req); + + /* Cleanup */ + unlink("test_file"); +} + +static void fs_file_pos_write(int add_flags) { + int r; + + /* Setup. */ + unlink("test_file"); + + r = uv_fs_open(NULL, + &open_req1, + "test_file", + O_TRUNC | O_CREAT | O_RDWR | add_flags, + S_IWUSR | S_IRUSR, + NULL); + ASSERT(r > 0); + uv_fs_req_cleanup(&open_req1); + + fs_file_pos_common(); + + /* Write with offset should not change the position */ + iov = uv_buf_init("e", 1); + r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, 1, NULL); + ASSERT(r == 1); + uv_fs_req_cleanup(&write_req); + + iov = uv_buf_init(buf, sizeof(buf)); + r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); + ASSERT(r == 0); + uv_fs_req_cleanup(&read_req); + + fs_file_pos_close_check("aecd", 4); +} +TEST_IMPL(fs_file_pos_write) { + fs_file_pos_write(0); + fs_file_pos_write(UV_FS_O_FILEMAP); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + +static void fs_file_pos_append(int add_flags) { + int r; + + /* Setup. */ + unlink("test_file"); + + r = uv_fs_open(NULL, + &open_req1, + "test_file", + O_APPEND | O_CREAT | O_RDWR | add_flags, + S_IWUSR | S_IRUSR, + NULL); + ASSERT(r > 0); + uv_fs_req_cleanup(&open_req1); + + fs_file_pos_common(); + + /* Write with offset appends (ignoring offset) + * but does not change the position */ + iov = uv_buf_init("e", 1); + r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, 1, NULL); + ASSERT(r == 1); + uv_fs_req_cleanup(&write_req); + + iov = uv_buf_init(buf, sizeof(buf)); + r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); + ASSERT(r == 1); + ASSERT(buf[0] == 'e'); + uv_fs_req_cleanup(&read_req); + + fs_file_pos_close_check("abcde", 5); +} +TEST_IMPL(fs_file_pos_append) { + fs_file_pos_append(0); + fs_file_pos_append(UV_FS_O_FILEMAP); + + MAKE_VALGRIND_HAPPY(); + return 0; +} +#endif + TEST_IMPL(fs_null_req) { /* Verify that all fs functions return UV_EINVAL when the request is NULL. */ int r; @@ -3630,6 +3850,9 @@ TEST_IMPL(fs_null_req) { r = uv_fs_futime(NULL, NULL, 0, 0.0, 0.0, NULL); ASSERT(r == UV_EINVAL); + r = uv_fs_statfs(NULL, NULL, NULL, NULL); + ASSERT(r == UV_EINVAL); + /* This should be a no-op. */ uv_fs_req_cleanup(NULL); @@ -3873,4 +4096,37 @@ TEST_IMPL(fs_fchmod_archive_readonly) { return 0; } + +TEST_IMPL(fs_invalid_mkdir_name) { + uv_loop_t* loop; + uv_fs_t req; + int r; + + loop = uv_default_loop(); + r = uv_fs_mkdir(loop, &req, "invalid>", 0, NULL); + ASSERT(r == UV_EINVAL); + + return 0; +} #endif + +TEST_IMPL(fs_statfs) { + uv_fs_t req; + int r; + + loop = uv_default_loop(); + + /* Test the synchronous version. */ + r = uv_fs_statfs(NULL, &req, ".", NULL); + ASSERT(r == 0); + statfs_cb(&req); + ASSERT(statfs_cb_count == 1); + + /* Test the asynchronous version. */ + r = uv_fs_statfs(loop, &req, ".", statfs_cb); + ASSERT(r == 0); + uv_run(loop, UV_RUN_DEFAULT); + ASSERT(statfs_cb_count == 2); + + return 0; +} diff --git a/deps/uv/test/test-ipc.c b/deps/uv/test/test-ipc.c index 24c067e0a4b9de..8579a470292d31 100644 --- a/deps/uv/test/test-ipc.c +++ b/deps/uv/test/test-ipc.c @@ -838,10 +838,10 @@ static unsigned int write_until_data_queued() { closed_handle_large_write_cb); ASSERT(r == 0); i++; - } while (((uv_stream_t*)&channel)->write_queue_size == 0 && + } while (channel.write_queue_size == 0 && i < ARRAY_SIZE(write_reqs)); - return ((uv_stream_t*)&channel)->write_queue_size; + return channel.write_queue_size; } static void send_handle_and_close() { diff --git a/deps/uv/test/test-list.h b/deps/uv/test/test-list.h index a48f6f3806806a..6eb8ecadc7870f 100644 --- a/deps/uv/test/test-list.h +++ b/deps/uv/test/test-list.h @@ -264,6 +264,7 @@ TEST_DECLARE (spawn_fails) #ifndef _WIN32 TEST_DECLARE (spawn_fails_check_for_waitpid_cleanup) #endif +TEST_DECLARE (spawn_empty_env) TEST_DECLARE (spawn_exit_code) TEST_DECLARE (spawn_stdout) TEST_DECLARE (spawn_stdin) @@ -321,10 +322,15 @@ TEST_DECLARE (fs_symlink_dir) #ifdef _WIN32 TEST_DECLARE (fs_symlink_junction) TEST_DECLARE (fs_non_symlink_reparse_point) +TEST_DECLARE (fs_open_flags) +#endif +#if defined(_WIN32) && !defined(USING_UV_SHARED) +TEST_DECLARE (fs_fd_hash) #endif TEST_DECLARE (fs_utime) TEST_DECLARE (fs_futime) TEST_DECLARE (fs_file_open_append) +TEST_DECLARE (fs_statfs) TEST_DECLARE (fs_stat_missing_path) TEST_DECLARE (fs_read_bufs) TEST_DECLARE (fs_read_file_eof) @@ -370,10 +376,13 @@ TEST_DECLARE (fs_file_pos_after_op_with_offset) TEST_DECLARE (fs_null_req) TEST_DECLARE (fs_read_dir) #ifdef _WIN32 +TEST_DECLARE (fs_file_pos_write) +TEST_DECLARE (fs_file_pos_append) TEST_DECLARE (fs_exclusive_sharing_mode) TEST_DECLARE (fs_file_flag_no_buffering) TEST_DECLARE (fs_open_readonly_acl) TEST_DECLARE (fs_fchmod_archive_readonly) +TEST_DECLARE (fs_invalid_mkdir_name) #endif TEST_DECLARE (strscpy) TEST_DECLARE (threadpool_queue_work_simple) @@ -821,6 +830,7 @@ TASK_LIST_START #ifndef _WIN32 TEST_ENTRY (spawn_fails_check_for_waitpid_cleanup) #endif + TEST_ENTRY (spawn_empty_env) TEST_ENTRY (spawn_exit_code) TEST_ENTRY (spawn_stdout) TEST_ENTRY (spawn_stdin) @@ -912,7 +922,12 @@ TASK_LIST_START #ifdef _WIN32 TEST_ENTRY (fs_symlink_junction) TEST_ENTRY (fs_non_symlink_reparse_point) + TEST_ENTRY (fs_open_flags) +#endif +#if defined(_WIN32) && !defined(USING_UV_SHARED) + TEST_ENTRY (fs_fd_hash) #endif + TEST_ENTRY (fs_statfs) TEST_ENTRY (fs_stat_missing_path) TEST_ENTRY (fs_read_bufs) TEST_ENTRY (fs_read_file_eof) @@ -957,10 +972,13 @@ TASK_LIST_START TEST_ENTRY (fs_null_req) TEST_ENTRY (fs_read_dir) #ifdef _WIN32 + TEST_ENTRY (fs_file_pos_write) + TEST_ENTRY (fs_file_pos_append) TEST_ENTRY (fs_exclusive_sharing_mode) TEST_ENTRY (fs_file_flag_no_buffering) TEST_ENTRY (fs_open_readonly_acl) TEST_ENTRY (fs_fchmod_archive_readonly) + TEST_ENTRY (fs_invalid_mkdir_name) #endif TEST_ENTRY (get_osfhandle_valid_handle) TEST_ENTRY (open_osfhandle_valid_handle) diff --git a/deps/uv/test/test-pipe-getsockname.c b/deps/uv/test/test-pipe-getsockname.c index d1628a67d5d032..48ee400e74cf97 100644 --- a/deps/uv/test/test-pipe-getsockname.c +++ b/deps/uv/test/test-pipe-getsockname.c @@ -171,7 +171,7 @@ TEST_IMPL(pipe_getsockname_abstract) { socklen_t sun_len; char abstract_pipe[] = "\0test-pipe"; - sock = socket(AF_LOCAL, SOCK_STREAM, 0); + sock = socket(AF_UNIX, SOCK_STREAM, 0); ASSERT(sock != -1); sun_len = sizeof sun; diff --git a/deps/uv/test/test-process-title-threadsafe.c b/deps/uv/test/test-process-title-threadsafe.c index 19098eda0c4019..5b30f17f44d529 100644 --- a/deps/uv/test/test-process-title-threadsafe.c +++ b/deps/uv/test/test-process-title-threadsafe.c @@ -25,7 +25,11 @@ #include -#define NUM_ITERATIONS 50 +#ifdef __APPLE__ +# define NUM_ITERATIONS 10 +#else +# define NUM_ITERATIONS 50 +#endif static const char* titles[] = { "8L2NY0Kdj0XyNFZnmUZigIOfcWjyNr0SkMmUhKw99VLUsZFrvCQQC3XIRfNR8pjyMjXObllled", diff --git a/deps/uv/test/test-queue-foreach-delete.c b/deps/uv/test/test-queue-foreach-delete.c index 45da225381f51f..049ea776e34322 100644 --- a/deps/uv/test/test-queue-foreach-delete.c +++ b/deps/uv/test/test-queue-foreach-delete.c @@ -65,11 +65,11 @@ static const unsigned first_handle_number_fs_event = 0; #endif -#define DEFINE_GLOBALS_AND_CBS(name) \ +#define DEFINE_GLOBALS_AND_CBS(name, ...) \ static uv_##name##_t (name)[3]; \ static unsigned name##_cb_calls[3]; \ \ - static void name##2_cb(uv_##name##_t* handle) { \ + static void name##2_cb(__VA_ARGS__) { \ ASSERT(handle == &(name)[2]); \ if (first_handle_number_##name == 2) { \ uv_close((uv_handle_t*)&(name)[2], NULL); \ @@ -78,12 +78,12 @@ static const unsigned first_handle_number_fs_event = 0; name##_cb_calls[2]++; \ } \ \ - static void name##1_cb(uv_##name##_t* handle) { \ + static void name##1_cb(__VA_ARGS__) { \ ASSERT(handle == &(name)[1]); \ ASSERT(0 && "Shouldn't be called" && (&name[0])); \ } \ \ - static void name##0_cb(uv_##name##_t* handle) { \ + static void name##0_cb(__VA_ARGS__) { \ ASSERT(handle == &(name)[0]); \ if (first_handle_number_##name == 0) { \ uv_close((uv_handle_t*)&(name)[0], NULL); \ @@ -93,9 +93,9 @@ static const unsigned first_handle_number_fs_event = 0; } \ \ static const uv_##name##_cb name##_cbs[] = { \ - (uv_##name##_cb)name##0_cb, \ - (uv_##name##_cb)name##1_cb, \ - (uv_##name##_cb)name##2_cb, \ + name##0_cb, \ + name##1_cb, \ + name##2_cb, \ }; #define INIT_AND_START(name, loop) \ @@ -118,12 +118,16 @@ static const unsigned first_handle_number_fs_event = 0; ASSERT(name##_cb_calls[2] == 1); \ } while (0) -DEFINE_GLOBALS_AND_CBS(idle) -DEFINE_GLOBALS_AND_CBS(prepare) -DEFINE_GLOBALS_AND_CBS(check) +DEFINE_GLOBALS_AND_CBS(idle, uv_idle_t* handle) +DEFINE_GLOBALS_AND_CBS(prepare, uv_prepare_t* handle) +DEFINE_GLOBALS_AND_CBS(check, uv_check_t* handle) #ifdef __linux__ -DEFINE_GLOBALS_AND_CBS(fs_event) +DEFINE_GLOBALS_AND_CBS(fs_event, + uv_fs_event_t* handle, + const char* filename, + int events, + int status) static const char watched_dir[] = "."; static uv_timer_t timer; diff --git a/deps/uv/test/test-spawn.c b/deps/uv/test/test-spawn.c index fea1165d89e08e..fec610bfdef97e 100644 --- a/deps/uv/test/test-spawn.c +++ b/deps/uv/test/test-spawn.c @@ -232,6 +232,34 @@ TEST_IMPL(spawn_fails_check_for_waitpid_cleanup) { #endif +TEST_IMPL(spawn_empty_env) { + char* env[1]; + + /* The autotools dynamic library build requires the presence of + * DYLD_LIBARY_PATH (macOS) or LD_LIBRARY_PATH (other Unices) + * in the environment, but of course that doesn't work with + * the empty environment that we're testing here. + */ + if (NULL != getenv("DYLD_LIBARY_PATH") || + NULL != getenv("LD_LIBRARY_PATH")) { + RETURN_SKIP("doesn't work with DYLD_LIBRARY_PATH/LD_LIBRARY_PATH"); + } + + init_process_options("spawn_helper1", exit_cb); + options.env = env; + env[0] = NULL; + + ASSERT(0 == uv_spawn(uv_default_loop(), &process, &options)); + ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); + + ASSERT(exit_cb_called == 1); + ASSERT(close_cb_called == 1); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + + TEST_IMPL(spawn_exit_code) { int r; diff --git a/deps/uv/test/test-tmpdir.c b/deps/uv/test/test-tmpdir.c index 29e8055f1d5d91..dac488d05804e0 100644 --- a/deps/uv/test/test-tmpdir.c +++ b/deps/uv/test/test-tmpdir.c @@ -67,5 +67,16 @@ TEST_IMPL(tmpdir) { r = uv_os_tmpdir(tmpdir, &len); ASSERT(r == UV_EINVAL); +#ifdef _WIN32 + const char *name = "TMP"; + char tmpdir_win[] = "C:\\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; + r = uv_os_setenv(name, tmpdir_win); + ASSERT(r == 0); + char tmpdirx[PATHMAX]; + size_t lenx = sizeof tmpdirx; + r = uv_os_tmpdir(tmpdirx, &lenx); + ASSERT(r == 0); +#endif + return 0; } diff --git a/deps/uv/test/test.gyp b/deps/uv/test/test.gyp index a4083e917834b5..6158a2b8b6601f 100644 --- a/deps/uv/test/test.gyp +++ b/deps/uv/test/test.gyp @@ -35,6 +35,8 @@ 'test-fs-readdir.c', 'test-fs-copyfile.c', 'test-fs-event.c', + 'test-fs-fd-hash.c', + 'test-fs-open-flags.c', 'test-fs-poll.c', 'test-getters-setters.c', 'test-get-currentexe.c', diff --git a/deps/v8/.git-blame-ignore-revs b/deps/v8/.git-blame-ignore-revs index 58d0039ab911f4..5ae39770316425 100644 --- a/deps/v8/.git-blame-ignore-revs +++ b/deps/v8/.git-blame-ignore-revs @@ -20,3 +20,6 @@ # Update of quotations in DEPS file. e50b49a0e38b34e2b28e026f4d1c7e0da0c7bb1a + +# Rewrite code base to use "." instead of "->" to access Object members. +878ccb33bd3cf0e6dc018ff8d15843f585ac07be diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index 7fc0f66b373003..6350393ebf376e 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -94,7 +94,6 @@ GTAGS TAGS bsuite compile_commands.json -d8 !/test/mjsunit/d8 d8_g gccauses diff --git a/deps/v8/.gn b/deps/v8/.gn index 573fd030d80cf1..328778fb46bcdf 100644 --- a/deps/v8/.gn +++ b/deps/v8/.gn @@ -7,11 +7,6 @@ import("//build/dotfile_settings.gni") # The location of the build configuration file. buildconfig = "//build/config/BUILDCONFIG.gn" -# The secondary source root is a parallel directory tree where -# GN build files are placed when they can not be placed directly -# in the source tree, e.g. for third party source trees. -secondary_source = "//build/secondary/" - # These are the targets to check headers for by default. The files in targets # matching these patterns (see "gn help label_pattern" for format) will have # their includes checked for proper dependencies when you run either diff --git a/deps/v8/.vpython b/deps/v8/.vpython index f8d3b7278a466e..3b7cb32468e1f5 100644 --- a/deps/v8/.vpython +++ b/deps/v8/.vpython @@ -66,3 +66,11 @@ wheel: < name: "infra/python/wheels/mock-py2_py3" version: "version:2.0.0" > + +# Used by: +# tools/run_perf.py +# tools/unittests/run_perf_test.py +wheel: < + name: "infra/python/wheels/numpy/${vpython_platform}" + version: "version:1.11.3" +> diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index 5182ae52014ac8..5a8628b4cb2a77 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -15,6 +15,7 @@ NVIDIA Corporation <*@nvidia.com> BlackBerry Limited <*@blackberry.com> Opera Software ASA <*@opera.com> Intel Corporation <*@intel.com> +LG Electronics, Inc. <*@lge.com> Microsoft <*@microsoft.com> MIPS Technologies, Inc. <*@mips.com> Imagination Technologies, LLC <*@imgtec.com> @@ -22,8 +23,10 @@ Wave Computing, Inc. <*@wavecomp.com> Loongson Technology Corporation Limited <*@loongson.cn> Code Aurora Forum <*@codeaurora.org> Home Jinni Inc. <*@homejinni.com> -IBM Inc. <*@*ibm.com> +IBM Inc. <*@*.ibm.com> +IBM Inc. <*@ibm.com> Samsung <*@*.samsung.com> +Samsung <*@samsung.com> Joyent, Inc <*@joyent.com> RT-RK Computer Based System <*@rt-rk.com> Amazon, Inc <*@amazon.com> @@ -44,6 +47,7 @@ Alessandro Pignotti Alex Kodat Alexander Botero-Lowry Alexander Karpinsky +Alexander Neville Alexandre Vassalotti Alexis Campailla Allan Sandfeld Jensen @@ -99,6 +103,7 @@ Jay Freeman James Pike James M Snell Jianghua Yang +Jiawen Geng Joel Stanley Johan Bergström Jonathan Liu @@ -136,6 +141,7 @@ Noj Vek Oleksandr Chekhovskyi Paolo Giarrusso Patrick Gansterer +Peng Fei Peter Rybin Peter Varga Peter Wong @@ -145,11 +151,13 @@ PhistucK Qingyan Li Qiuyi Zhang Rafal Krypa +Raul Tambre Ray Glover Refael Ackermann Rene Rebe Rick Waldron Rob Wu +Robert Meijer Robert Mustacchi Robert Nagy Ruben Bridgewater diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index 10fee264203ae0..8640517ae5c23d 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -15,8 +15,8 @@ if (is_android) { import("//build/config/android/rules.gni") } +import("gni/snapshot_toolchain.gni") import("gni/v8.gni") -import("snapshot_toolchain.gni") # Specifies if the target build is a simulator build. Comparing target cpu # with v8 target cpu to not affect simulator builds for making cross-compile @@ -85,11 +85,14 @@ declare_args() { # Enable fast mksnapshot runs. v8_enable_fast_mksnapshot = false + # Optimize code for Torque executable, even during a debug build. + v8_enable_fast_torque = "" + # Enable embedded builtins. v8_enable_embedded_builtins = true # Enable the registration of unwinding info for Windows/x64. - v8_win64_unwinding_info = false + v8_win64_unwinding_info = true # Enable code comments for builtins in the snapshot (impacts performance). v8_enable_snapshot_code_comments = false @@ -136,10 +139,6 @@ declare_args() { # Use Siphash as added protection against hash flooding attacks. v8_use_siphash = false - # Use Perfetto (https://perfetto.dev) as the default TracingController. Not - # currently implemented. - v8_use_perfetto = false - # Switches off inlining in V8. v8_no_inline = false @@ -186,7 +185,8 @@ declare_args() { v8_check_header_includes = false # Enable sharing read-only space across isolates. - v8_enable_shared_ro_heap = false + # Sets -DV8_SHARED_RO_HEAP. + v8_enable_shared_ro_heap = "" } # We reuse the snapshot toolchain for building torque and other generators to @@ -224,6 +224,12 @@ if (v8_check_microtasks_scopes_consistency == "") { if (v8_enable_snapshot_native_code_counters == "") { v8_enable_snapshot_native_code_counters = v8_enable_debugging_features } +if (v8_enable_shared_ro_heap == "") { + v8_enable_shared_ro_heap = v8_enable_lite_mode +} +if (v8_enable_fast_torque == "") { + v8_enable_fast_torque = v8_enable_fast_mksnapshot +} assert(v8_current_cpu != "x86" || !v8_untrusted_code_mitigations, "Untrusted code mitigations are unsupported on ia32") @@ -233,8 +239,9 @@ assert(!v8_enable_lite_mode || v8_enable_embedded_builtins, assert(!v8_enable_lite_mode || v8_use_snapshot, "Lite mode requires a snapshot build") -assert(v8_use_snapshot || !v8_enable_shared_ro_heap, - "Nosnapshot builds are not supported with shared read-only heap enabled") +assert( + !v8_enable_pointer_compression || !v8_enable_shared_ro_heap, + "Pointer compression is not supported with shared read-only heap enabled") v8_random_seed = "314159265" v8_toolset_for_shell = "host" @@ -850,8 +857,8 @@ action("postmortem-metadata") { # NOSORT sources = [ - "src/objects.h", - "src/objects-inl.h", + "src/objects/objects.h", + "src/objects/objects-inl.h", "src/objects/allocation-site-inl.h", "src/objects/allocation-site.h", "src/objects/cell-inl.h", @@ -912,11 +919,7 @@ action("postmortem-metadata") { } torque_files = [ - "src/builtins/base.tq", - "src/builtins/growable-fixed-array.tq", - "src/builtins/frames.tq", "src/builtins/arguments.tq", - "src/builtins/array.tq", "src/builtins/array-copywithin.tq", "src/builtins/array-every.tq", "src/builtins/array-filter.tq", @@ -925,32 +928,45 @@ torque_files = [ "src/builtins/array-foreach.tq", "src/builtins/array-join.tq", "src/builtins/array-lastindexof.tq", - "src/builtins/array-of.tq", "src/builtins/array-map.tq", - "src/builtins/array-reduce.tq", + "src/builtins/array-of.tq", "src/builtins/array-reduce-right.tq", + "src/builtins/array-reduce.tq", "src/builtins/array-reverse.tq", "src/builtins/array-shift.tq", "src/builtins/array-slice.tq", "src/builtins/array-some.tq", "src/builtins/array-splice.tq", "src/builtins/array-unshift.tq", + "src/builtins/array.tq", + "src/builtins/base.tq", + "src/builtins/boolean.tq", "src/builtins/collections.tq", "src/builtins/data-view.tq", "src/builtins/extras-utils.tq", + "src/builtins/frames.tq", + "src/builtins/growable-fixed-array.tq", + "src/builtins/internal-coverage.tq", "src/builtins/iterator.tq", + "src/builtins/math.tq", "src/builtins/object-fromentries.tq", - "src/builtins/proxy.tq", "src/builtins/proxy-constructor.tq", + "src/builtins/proxy-get-property.tq", + "src/builtins/proxy-has-property.tq", "src/builtins/proxy-revocable.tq", "src/builtins/proxy-revoke.tq", - "src/builtins/regexp.tq", + "src/builtins/proxy-set-property.tq", + "src/builtins/proxy.tq", "src/builtins/regexp-replace.tq", + "src/builtins/regexp.tq", + "src/builtins/string.tq", "src/builtins/string-endswith.tq", "src/builtins/string-html.tq", + "src/builtins/string-iterator.tq", "src/builtins/string-repeat.tq", + "src/builtins/string-slice.tq", "src/builtins/string-startswith.tq", - "src/builtins/typed-array.tq", + "src/builtins/string-substring.tq", "src/builtins/typed-array-createtypedarray.tq", "src/builtins/typed-array-every.tq", "src/builtins/typed-array-filter.tq", @@ -962,10 +978,16 @@ torque_files = [ "src/builtins/typed-array-slice.tq", "src/builtins/typed-array-some.tq", "src/builtins/typed-array-subarray.tq", + "src/builtins/typed-array.tq", + "src/objects/intl-objects.tq", "test/torque/test-torque.tq", "third_party/v8/builtins/array-sort.tq", ] +if (!v8_enable_i18n_support) { + torque_files -= [ "src/objects/intl-objects.tq" ] +} + torque_namespaces = [ "arguments", "array", @@ -984,18 +1006,24 @@ torque_namespaces = [ "array-unshift", "array-lastindexof", "base", + "boolean", "collections", "data-view", "extras-utils", "growable-fixed-array", + "internal-coverage", "iterator", + "math", "object", "proxy", "regexp", "regexp-replace", "string", "string-html", + "string-iterator", "string-repeat", + "string-slice", + "string-substring", "test", "typed-array", "typed-array-createtypedarray", @@ -1027,14 +1055,22 @@ action("run_torque") { sources = torque_files outputs = [ - "$target_gen_dir/torque-generated/builtin-definitions-from-dsl.h", - "$target_gen_dir/torque-generated/class-definitions-from-dsl.h", - "$target_gen_dir/torque-generated/objects-printer-from-dsl.cc", + "$target_gen_dir/torque-generated/builtin-definitions-tq.h", + "$target_gen_dir/torque-generated/field-offsets-tq.h", + "$target_gen_dir/torque-generated/class-verifiers-tq.cc", + "$target_gen_dir/torque-generated/class-verifiers-tq.h", + "$target_gen_dir/torque-generated/objects-printer-tq.cc", + "$target_gen_dir/torque-generated/class-definitions-tq.cc", + "$target_gen_dir/torque-generated/class-definitions-tq-inl.h", + "$target_gen_dir/torque-generated/class-definitions-tq.h", + "$target_gen_dir/torque-generated/exported-macros-assembler-tq.cc", + "$target_gen_dir/torque-generated/exported-macros-assembler-tq.h", + "$target_gen_dir/torque-generated/csa-types-tq.h", ] foreach(namespace, torque_namespaces) { outputs += [ - "$target_gen_dir/torque-generated/builtins-$namespace-from-dsl-gen.cc", - "$target_gen_dir/torque-generated/builtins-$namespace-from-dsl-gen.h", + "$target_gen_dir/torque-generated/builtins-$namespace-gen-tq.cc", + "$target_gen_dir/torque-generated/builtins-$namespace-gen-tq.h", ] } @@ -1071,11 +1107,15 @@ v8_source_set("torque_generated_initializers") { ":v8_maybe_icu", ] - sources = [] + sources = [ + "$target_gen_dir/torque-generated/csa-types-tq.h", + "$target_gen_dir/torque-generated/exported-macros-assembler-tq.cc", + "$target_gen_dir/torque-generated/exported-macros-assembler-tq.h", + ] foreach(namespace, torque_namespaces) { sources += [ - "$target_gen_dir/torque-generated/builtins-$namespace-from-dsl-gen.cc", - "$target_gen_dir/torque-generated/builtins-$namespace-from-dsl-gen.h", + "$target_gen_dir/torque-generated/builtins-$namespace-gen-tq.cc", + "$target_gen_dir/torque-generated/builtins-$namespace-gen-tq.h", ] } @@ -1095,7 +1135,10 @@ v8_source_set("torque_generated_definitions") { ] sources = [ - "$target_gen_dir/torque-generated/objects-printer-from-dsl.cc", + "$target_gen_dir/torque-generated/class-definitions-tq.cc", + "$target_gen_dir/torque-generated/class-verifiers-tq.cc", + "$target_gen_dir/torque-generated/class-verifiers-tq.h", + "$target_gen_dir/torque-generated/objects-printer-tq.cc", ] configs = [ ":internal_config" ] @@ -1163,14 +1206,11 @@ template("run_mksnapshot") { # mksnapshot needs to know which target OS to use at runtime. It's weird, # but the target OS is really |current_os|. "--target_os=$current_os", + "--target_arch=$current_cpu", ] args += invoker.args - if (v8_win64_unwinding_info) { - args += [ "--win64-unwinding-info" ] - } - if (v8_enable_embedded_builtins) { outputs += [ "$target_gen_dir/embedded${suffix}.S" ] args += [ @@ -1278,6 +1318,7 @@ action("v8_dump_build_config") { "$root_out_dir/v8_build_config.json", ] is_gcov_coverage = v8_code_coverage && !is_clang + is_full_debug = v8_enable_debugging_features && !v8_optimized_debug args = [ rebase_path("$root_out_dir/v8_build_config.json", root_build_dir), "current_cpu=\"$current_cpu\"", @@ -1288,6 +1329,7 @@ action("v8_dump_build_config") { "is_clang=$is_clang", "is_component_build=$is_component_build", "is_debug=$v8_enable_debugging_features", + "is_full_debug=$is_full_debug", "is_gcov_coverage=$is_gcov_coverage", "is_msan=$is_msan", "is_tsan=$is_tsan", @@ -1349,7 +1391,7 @@ v8_source_set("v8_nosnapshot") { sources = [ "$target_gen_dir/extras-libraries.cc", - "src/snapshot/embedded-empty.cc", + "src/snapshot/embedded/embedded-empty.cc", "src/snapshot/snapshot-empty.cc", ] @@ -1382,7 +1424,7 @@ if (v8_use_snapshot && !v8_use_external_startup_data) { sources = [ "$target_gen_dir/extras-libraries.cc", "$target_gen_dir/snapshot.cc", - "src/setup-isolate-deserialize.cc", + "src/init/setup-isolate-deserialize.cc", ] if (v8_enable_embedded_builtins && emit_builtins_as_inline_asm) { @@ -1391,7 +1433,7 @@ if (v8_use_snapshot && !v8_use_external_startup_data) { } else if (v8_enable_embedded_builtins) { sources += [ "$target_gen_dir/embedded.S" ] } else { - sources += [ "src/snapshot/embedded-empty.cc" ] + sources += [ "src/snapshot/embedded/embedded-empty.cc" ] } configs = [ ":internal_config" ] @@ -1416,7 +1458,7 @@ if (v8_use_snapshot && v8_use_external_startup_data) { } sources = [ - "src/setup-isolate-deserialize.cc", + "src/init/setup-isolate-deserialize.cc", "src/snapshot/natives-external.cc", "src/snapshot/snapshot-external.cc", ] @@ -1444,7 +1486,7 @@ if (v8_use_snapshot && v8_use_external_startup_data) { ] } } else { - sources += [ "src/snapshot/embedded-empty.cc" ] + sources += [ "src/snapshot/embedded/embedded-empty.cc" ] } configs = [ ":internal_config" ] @@ -1520,8 +1562,8 @@ v8_source_set("v8_initializers") { "src/builtins/growable-fixed-array-gen.cc", "src/builtins/growable-fixed-array-gen.h", "src/builtins/setup-builtins-internal.cc", - "src/code-stub-assembler.cc", - "src/code-stub-assembler.h", + "src/codegen/code-stub-assembler.cc", + "src/codegen/code-stub-assembler.h", "src/heap/setup-heap-internal.cc", "src/ic/accessor-assembler.cc", "src/ic/accessor-assembler.h", @@ -1545,7 +1587,7 @@ v8_source_set("v8_initializers") { # These source files take an unusually large amount of time to # compile. Build them separately to avoid bottlenecks. "src/builtins/builtins-regexp-gen.cc", - "src/code-stub-assembler.cc", + "src/codegen/code-stub-assembler.cc", ] if (v8_current_cpu == "x86") { @@ -1606,7 +1648,7 @@ v8_source_set("v8_init") { sources = [ ### gcmole(all) ### - "src/setup-isolate-full.cc", + "src/init/setup-isolate-full.cc", ] public_deps = [ @@ -1659,7 +1701,7 @@ v8_header_set("v8_shared_internal_headers") { configs = [ ":internal_config" ] sources = [ - "src/globals.h", + "src/common/globals.h", ] deps = [ @@ -1668,6 +1710,7 @@ v8_header_set("v8_shared_internal_headers") { } v8_compiler_sources = [ + ### gcmole(all) ### "src/compiler/access-builder.cc", "src/compiler/access-builder.h", "src/compiler/access-info.cc", @@ -1735,6 +1778,8 @@ v8_compiler_sources = [ "src/compiler/control-flow-optimizer.h", "src/compiler/dead-code-elimination.cc", "src/compiler/dead-code-elimination.h", + "src/compiler/decompression-elimination.cc", + "src/compiler/decompression-elimination.h", "src/compiler/diamond.h", "src/compiler/effect-control-linearizer.cc", "src/compiler/effect-control-linearizer.h", @@ -1805,6 +1850,8 @@ v8_compiler_sources = [ "src/compiler/machine-operator-reducer.h", "src/compiler/machine-operator.cc", "src/compiler/machine-operator.h", + "src/compiler/map-inference.cc", + "src/compiler/map-inference.h", "src/compiler/memory-optimizer.cc", "src/compiler/memory-optimizer.h", "src/compiler/node-aux-data.h", @@ -1878,10 +1925,13 @@ v8_compiler_sources = [ "src/compiler/types.h", "src/compiler/value-numbering-reducer.cc", "src/compiler/value-numbering-reducer.h", + "src/compiler/vector-slot-pair.cc", + "src/compiler/vector-slot-pair.h", "src/compiler/verifier.cc", "src/compiler/verifier.h", "src/compiler/wasm-compiler.cc", "src/compiler/wasm-compiler.h", + "src/compiler/write-barrier-kind.h", "src/compiler/zone-stats.cc", "src/compiler/zone-stats.h", ] @@ -1958,25 +2008,13 @@ v8_source_set("v8_base_without_compiler") { "include/v8-wasm-trap-handler-posix.h", "include/v8.h", "include/v8config.h", - "src/accessors.cc", - "src/accessors.h", - "src/address-map.cc", - "src/address-map.h", - "src/allocation-site-scopes-inl.h", - "src/allocation-site-scopes.h", - "src/allocation.cc", - "src/allocation.h", - "src/api-arguments-inl.h", - "src/api-arguments.cc", - "src/api-arguments.h", - "src/api-natives.cc", - "src/api-natives.h", - "src/api.cc", - "src/api.h", - "src/arguments-inl.h", - "src/arguments.cc", - "src/arguments.h", - "src/asan.h", + "src/api/api-arguments-inl.h", + "src/api/api-arguments.cc", + "src/api/api-arguments.h", + "src/api/api-natives.cc", + "src/api/api-natives.h", + "src/api/api.cc", + "src/api/api.h", "src/asmjs/asm-js.cc", "src/asmjs/asm-js.h", "src/asmjs/asm-names.h", @@ -1986,12 +2024,6 @@ v8_source_set("v8_base_without_compiler") { "src/asmjs/asm-scanner.h", "src/asmjs/asm-types.cc", "src/asmjs/asm-types.h", - "src/assembler-arch.h", - "src/assembler-inl.h", - "src/assembler.cc", - "src/assembler.h", - "src/assert-scope.cc", - "src/assert-scope.h", "src/ast/ast-function-literal-id-reindexer.cc", "src/ast/ast-function-literal-id-reindexer.h", "src/ast/ast-source-ranges.h", @@ -2010,24 +2042,12 @@ v8_source_set("v8_base_without_compiler") { "src/ast/source-range-ast-visitor.h", "src/ast/variables.cc", "src/ast/variables.h", - "src/bailout-reason.cc", - "src/bailout-reason.h", - "src/basic-block-profiler.cc", - "src/basic-block-profiler.h", - "src/bignum-dtoa.cc", - "src/bignum-dtoa.h", - "src/bignum.cc", - "src/bignum.h", - "src/bit-vector.cc", - "src/bit-vector.h", - "src/bootstrapper.cc", - "src/bootstrapper.h", - "src/boxed-float.h", + "src/builtins/accessors.cc", + "src/builtins/accessors.h", "src/builtins/builtins-api.cc", "src/builtins/builtins-array.cc", "src/builtins/builtins-arraybuffer.cc", "src/builtins/builtins-bigint.cc", - "src/builtins/builtins-boolean.cc", "src/builtins/builtins-call.cc", "src/builtins/builtins-callsite.cc", "src/builtins/builtins-collections.cc", @@ -2063,55 +2083,81 @@ v8_source_set("v8_base_without_compiler") { "src/builtins/builtins.h", "src/builtins/constants-table-builder.cc", "src/builtins/constants-table-builder.h", - "src/cached-powers.cc", - "src/cached-powers.h", - "src/callable.h", - "src/cancelable-task.cc", - "src/cancelable-task.h", - "src/char-predicates-inl.h", - "src/char-predicates.cc", - "src/char-predicates.h", - "src/checks.h", - "src/code-comments.cc", - "src/code-comments.h", - "src/code-desc.cc", - "src/code-desc.h", - "src/code-events.h", - "src/code-factory.cc", - "src/code-factory.h", - "src/code-reference.cc", - "src/code-reference.h", - "src/code-tracer.h", - "src/collector.h", - "src/compilation-cache.cc", - "src/compilation-cache.h", - "src/compilation-statistics.cc", - "src/compilation-statistics.h", + "src/codegen/assembler-arch.h", + "src/codegen/assembler-inl.h", + "src/codegen/assembler.cc", + "src/codegen/assembler.h", + "src/codegen/bailout-reason.cc", + "src/codegen/bailout-reason.h", + "src/codegen/callable.h", + "src/codegen/code-comments.cc", + "src/codegen/code-comments.h", + "src/codegen/code-desc.cc", + "src/codegen/code-desc.h", + "src/codegen/code-factory.cc", + "src/codegen/code-factory.h", + "src/codegen/code-reference.cc", + "src/codegen/code-reference.h", + "src/codegen/compilation-cache.cc", + "src/codegen/compilation-cache.h", + "src/codegen/compiler.cc", + "src/codegen/compiler.h", + "src/codegen/constant-pool.cc", + "src/codegen/constant-pool.h", + "src/codegen/constants-arch.h", + "src/codegen/cpu-features.h", + "src/codegen/external-reference-table.cc", + "src/codegen/external-reference-table.h", + "src/codegen/external-reference.cc", + "src/codegen/external-reference.h", + "src/codegen/flush-instruction-cache.cc", + "src/codegen/flush-instruction-cache.h", + "src/codegen/handler-table.cc", + "src/codegen/handler-table.h", + "src/codegen/interface-descriptors.cc", + "src/codegen/interface-descriptors.h", + "src/codegen/label.h", + "src/codegen/machine-type.cc", + "src/codegen/machine-type.h", + "src/codegen/macro-assembler-inl.h", + "src/codegen/macro-assembler.h", + "src/codegen/optimized-compilation-info.cc", + "src/codegen/optimized-compilation-info.h", + "src/codegen/register-arch.h", + "src/codegen/register-configuration.cc", + "src/codegen/register-configuration.h", + "src/codegen/register.h", + "src/codegen/reglist.h", + "src/codegen/reloc-info.cc", + "src/codegen/reloc-info.h", + "src/codegen/safepoint-table.cc", + "src/codegen/safepoint-table.h", + "src/codegen/signature.h", + "src/codegen/source-position-table.cc", + "src/codegen/source-position-table.h", + "src/codegen/source-position.cc", + "src/codegen/source-position.h", + "src/codegen/string-constants.cc", + "src/codegen/string-constants.h", + "src/codegen/turbo-assembler.cc", + "src/codegen/turbo-assembler.h", + "src/codegen/unoptimized-compilation-info.cc", + "src/codegen/unoptimized-compilation-info.h", + "src/common/assert-scope.cc", + "src/common/assert-scope.h", + "src/common/checks.h", + "src/common/ptr-compr-inl.h", + "src/common/ptr-compr.h", + "src/common/v8memory.h", "src/compiler-dispatcher/compiler-dispatcher.cc", "src/compiler-dispatcher/compiler-dispatcher.h", "src/compiler-dispatcher/optimizing-compile-dispatcher.cc", "src/compiler-dispatcher/optimizing-compile-dispatcher.h", - "src/compiler.cc", - "src/compiler.h", - "src/constant-pool.cc", - "src/constant-pool.h", - "src/constants-arch.h", - "src/contexts-inl.h", - "src/contexts.cc", - "src/contexts.h", - "src/conversions-inl.h", - "src/conversions.cc", - "src/conversions.h", - "src/counters-definitions.h", - "src/counters-inl.h", - "src/counters.cc", - "src/counters.h", - "src/cpu-features.h", - "src/date.cc", - "src/date.h", - "src/dateparser-inl.h", - "src/dateparser.cc", - "src/dateparser.h", + "src/date/date.cc", + "src/date/date.h", + "src/date/dateparser-inl.h", + "src/date/dateparser.cc", + "src/date/dateparser.h", "src/debug/debug-coverage.cc", "src/debug/debug-coverage.h", "src/debug/debug-evaluate.cc", @@ -2134,29 +2180,60 @@ v8_source_set("v8_base_without_compiler") { "src/debug/interface-types.h", "src/debug/liveedit.cc", "src/debug/liveedit.h", - "src/deoptimize-reason.cc", - "src/deoptimize-reason.h", - "src/deoptimizer.cc", - "src/deoptimizer.h", - "src/detachable-vector.cc", - "src/detachable-vector.h", - "src/disasm.h", - "src/disassembler.cc", - "src/disassembler.h", - "src/diy-fp.cc", - "src/diy-fp.h", - "src/double.h", - "src/dtoa.cc", - "src/dtoa.h", - "src/eh-frame.cc", - "src/eh-frame.h", - "src/elements-inl.h", - "src/elements-kind.cc", - "src/elements-kind.h", - "src/elements.cc", - "src/elements.h", - "src/execution.cc", - "src/execution.h", + "src/deoptimizer/deoptimize-reason.cc", + "src/deoptimizer/deoptimize-reason.h", + "src/deoptimizer/deoptimizer.cc", + "src/deoptimizer/deoptimizer.h", + "src/diagnostics/basic-block-profiler.cc", + "src/diagnostics/basic-block-profiler.h", + "src/diagnostics/code-tracer.h", + "src/diagnostics/compilation-statistics.cc", + "src/diagnostics/compilation-statistics.h", + "src/diagnostics/disasm.h", + "src/diagnostics/disassembler.cc", + "src/diagnostics/disassembler.h", + "src/diagnostics/eh-frame.cc", + "src/diagnostics/eh-frame.h", + "src/diagnostics/gdb-jit.cc", + "src/diagnostics/gdb-jit.h", + "src/diagnostics/objects-debug.cc", + "src/diagnostics/objects-printer.cc", + "src/diagnostics/perf-jit.cc", + "src/diagnostics/perf-jit.h", + "src/diagnostics/unwinder.cc", + "src/execution/arguments-inl.h", + "src/execution/arguments.cc", + "src/execution/arguments.h", + "src/execution/execution.cc", + "src/execution/execution.h", + "src/execution/frame-constants.h", + "src/execution/frames-inl.h", + "src/execution/frames.cc", + "src/execution/frames.h", + "src/execution/futex-emulation.cc", + "src/execution/futex-emulation.h", + "src/execution/isolate-data.h", + "src/execution/isolate-inl.h", + "src/execution/isolate.cc", + "src/execution/isolate.h", + "src/execution/message-template.h", + "src/execution/messages.cc", + "src/execution/messages.h", + "src/execution/microtask-queue.cc", + "src/execution/microtask-queue.h", + "src/execution/runtime-profiler.cc", + "src/execution/runtime-profiler.h", + "src/execution/simulator-base.cc", + "src/execution/simulator-base.h", + "src/execution/simulator.h", + "src/execution/thread-id.cc", + "src/execution/thread-id.h", + "src/execution/thread-local-top.cc", + "src/execution/thread-local-top.h", + "src/execution/v8threads.cc", + "src/execution/v8threads.h", + "src/execution/vm-state-inl.h", + "src/execution/vm-state.h", "src/extensions/externalize-string-extension.cc", "src/extensions/externalize-string-extension.h", "src/extensions/free-buffer-extension.cc", @@ -2169,44 +2246,16 @@ v8_source_set("v8_base_without_compiler") { "src/extensions/statistics-extension.h", "src/extensions/trigger-failure-extension.cc", "src/extensions/trigger-failure-extension.h", - "src/external-reference-table.cc", - "src/external-reference-table.h", - "src/external-reference.cc", - "src/external-reference.h", - "src/fast-dtoa.cc", - "src/fast-dtoa.h", - "src/feedback-vector-inl.h", - "src/feedback-vector.cc", - "src/feedback-vector.h", - "src/field-index-inl.h", - "src/field-index.h", - "src/field-type.cc", - "src/field-type.h", - "src/fixed-dtoa.cc", - "src/fixed-dtoa.h", - "src/flag-definitions.h", - "src/flags.cc", - "src/flags.h", - "src/flush-instruction-cache.cc", - "src/flush-instruction-cache.h", - "src/frame-constants.h", - "src/frames-inl.h", - "src/frames.cc", - "src/frames.h", - "src/function-kind.h", - "src/futex-emulation.cc", - "src/futex-emulation.h", - "src/gdb-jit.cc", - "src/gdb-jit.h", - "src/global-handles.cc", - "src/global-handles.h", - "src/handler-table.cc", - "src/handler-table.h", - "src/handles-inl.h", - "src/handles.cc", - "src/handles.h", - "src/hash-seed-inl.h", - "src/heap-symbols.h", + "src/flags/flag-definitions.h", + "src/flags/flags.cc", + "src/flags/flags.h", + "src/handles/global-handles.cc", + "src/handles/global-handles.h", + "src/handles/handles-inl.h", + "src/handles/handles.cc", + "src/handles/handles.h", + "src/handles/maybe-handles-inl.h", + "src/handles/maybe-handles.h", "src/heap/array-buffer-collector.cc", "src/heap/array-buffer-collector.h", "src/heap/array-buffer-tracker-inl.h", @@ -2215,6 +2264,8 @@ v8_source_set("v8_base_without_compiler") { "src/heap/barrier.h", "src/heap/code-stats.cc", "src/heap/code-stats.h", + "src/heap/combined-heap.cc", + "src/heap/combined-heap.h", "src/heap/concurrent-marking.cc", "src/heap/concurrent-marking.h", "src/heap/embedder-tracing.cc", @@ -2292,12 +2343,18 @@ v8_source_set("v8_base_without_compiler") { "src/ic/ic.h", "src/ic/stub-cache.cc", "src/ic/stub-cache.h", - "src/icu_util.cc", - "src/icu_util.h", - "src/identity-map.cc", - "src/identity-map.h", - "src/interface-descriptors.cc", - "src/interface-descriptors.h", + "src/init/bootstrapper.cc", + "src/init/bootstrapper.h", + "src/init/heap-symbols.h", + "src/init/icu_util.cc", + "src/init/icu_util.h", + "src/init/isolate-allocator.cc", + "src/init/isolate-allocator.h", + "src/init/setup-isolate.h", + "src/init/startup-data-util.cc", + "src/init/startup-data-util.h", + "src/init/v8.cc", + "src/init/v8.h", "src/interpreter/block-coverage-builder.h", "src/interpreter/bytecode-array-accessor.cc", "src/interpreter/bytecode-array-accessor.h", @@ -2343,61 +2400,46 @@ v8_source_set("v8_base_without_compiler") { "src/interpreter/interpreter-intrinsics.h", "src/interpreter/interpreter.cc", "src/interpreter/interpreter.h", - "src/isolate-allocator.cc", - "src/isolate-allocator.h", - "src/isolate-data.h", - "src/isolate-inl.h", - "src/isolate.cc", - "src/isolate.h", - "src/json-parser.cc", - "src/json-parser.h", - "src/json-stringifier.cc", - "src/json-stringifier.h", - "src/keys.cc", - "src/keys.h", - "src/label.h", - "src/layout-descriptor-inl.h", - "src/layout-descriptor.cc", - "src/layout-descriptor.h", - "src/locked-queue-inl.h", - "src/locked-queue.h", - "src/log-inl.h", - "src/log-utils.cc", - "src/log-utils.h", - "src/log.cc", - "src/log.h", - "src/lookup-cache-inl.h", - "src/lookup-cache.cc", - "src/lookup-cache.h", - "src/lookup-inl.h", - "src/lookup.cc", - "src/lookup.h", - "src/machine-type.cc", - "src/machine-type.h", - "src/macro-assembler-inl.h", - "src/macro-assembler.h", - "src/map-updater.cc", - "src/map-updater.h", - "src/math-random.cc", - "src/math-random.h", - "src/maybe-handles-inl.h", - "src/maybe-handles.h", - "src/memcopy.cc", - "src/memcopy.h", - "src/message-template.h", - "src/messages.cc", - "src/messages.h", - "src/microtask-queue.cc", - "src/microtask-queue.h", - "src/msan.h", - "src/objects-body-descriptors-inl.h", - "src/objects-body-descriptors.h", - "src/objects-debug.cc", - "src/objects-inl.h", - "src/objects-printer.cc", - "src/objects.cc", - "src/objects.h", + "src/json/json-parser.cc", + "src/json/json-parser.h", + "src/json/json-stringifier.cc", + "src/json/json-stringifier.h", + "src/logging/code-events.h", + "src/logging/counters-definitions.h", + "src/logging/counters-inl.h", + "src/logging/counters.cc", + "src/logging/counters.h", + "src/logging/log-inl.h", + "src/logging/log-utils.cc", + "src/logging/log-utils.h", + "src/logging/log.cc", + "src/logging/log.h", + "src/numbers/bignum-dtoa.cc", + "src/numbers/bignum-dtoa.h", + "src/numbers/bignum.cc", + "src/numbers/bignum.h", + "src/numbers/cached-powers.cc", + "src/numbers/cached-powers.h", + "src/numbers/conversions-inl.h", + "src/numbers/conversions.cc", + "src/numbers/conversions.h", + "src/numbers/diy-fp.cc", + "src/numbers/diy-fp.h", + "src/numbers/double.h", + "src/numbers/dtoa.cc", + "src/numbers/dtoa.h", + "src/numbers/fast-dtoa.cc", + "src/numbers/fast-dtoa.h", + "src/numbers/fixed-dtoa.cc", + "src/numbers/fixed-dtoa.h", + "src/numbers/hash-seed-inl.h", + "src/numbers/math-random.cc", + "src/numbers/math-random.h", + "src/numbers/strtod.cc", + "src/numbers/strtod.h", "src/objects/allocation-site-inl.h", + "src/objects/allocation-site-scopes-inl.h", + "src/objects/allocation-site-scopes.h", "src/objects/allocation-site.h", "src/objects/api-callbacks-inl.h", "src/objects/api-callbacks.h", @@ -2414,6 +2456,9 @@ v8_source_set("v8_base_without_compiler") { "src/objects/compilation-cache.h", "src/objects/compressed-slots-inl.h", "src/objects/compressed-slots.h", + "src/objects/contexts-inl.h", + "src/objects/contexts.cc", + "src/objects/contexts.h", "src/objects/data-handler.h", "src/objects/debug-objects-inl.h", "src/objects/debug-objects.cc", @@ -2422,6 +2467,11 @@ v8_source_set("v8_base_without_compiler") { "src/objects/descriptor-array.h", "src/objects/dictionary-inl.h", "src/objects/dictionary.h", + "src/objects/elements-inl.h", + "src/objects/elements-kind.cc", + "src/objects/elements-kind.h", + "src/objects/elements.cc", + "src/objects/elements.h", "src/objects/embedder-data-array-inl.h", "src/objects/embedder-data-array.cc", "src/objects/embedder-data-array.h", @@ -2429,10 +2479,18 @@ v8_source_set("v8_base_without_compiler") { "src/objects/embedder-data-slot.h", "src/objects/feedback-cell-inl.h", "src/objects/feedback-cell.h", + "src/objects/feedback-vector-inl.h", + "src/objects/feedback-vector.cc", + "src/objects/feedback-vector.h", + "src/objects/field-index-inl.h", + "src/objects/field-index.h", + "src/objects/field-type.cc", + "src/objects/field-type.h", "src/objects/fixed-array-inl.h", "src/objects/fixed-array.h", "src/objects/frame-array-inl.h", "src/objects/frame-array.h", + "src/objects/function-kind.h", "src/objects/hash-table-inl.h", "src/objects/hash-table.h", "src/objects/heap-number-inl.h", @@ -2496,12 +2554,25 @@ v8_source_set("v8_base_without_compiler") { "src/objects/js-segmenter.h", "src/objects/js-weak-refs-inl.h", "src/objects/js-weak-refs.h", + "src/objects/keys.cc", + "src/objects/keys.h", + "src/objects/layout-descriptor-inl.h", + "src/objects/layout-descriptor.cc", + "src/objects/layout-descriptor.h", "src/objects/literal-objects-inl.h", "src/objects/literal-objects.cc", "src/objects/literal-objects.h", + "src/objects/lookup-cache-inl.h", + "src/objects/lookup-cache.cc", + "src/objects/lookup-cache.h", + "src/objects/lookup-inl.h", + "src/objects/lookup.cc", + "src/objects/lookup.h", "src/objects/managed.cc", "src/objects/managed.h", "src/objects/map-inl.h", + "src/objects/map-updater.cc", + "src/objects/map-updater.h", "src/objects/map.cc", "src/objects/map.h", "src/objects/maybe-object-inl.h", @@ -2513,8 +2584,14 @@ v8_source_set("v8_base_without_compiler") { "src/objects/module.h", "src/objects/name-inl.h", "src/objects/name.h", + "src/objects/object-list-macros.h", "src/objects/object-macros-undef.h", "src/objects/object-macros.h", + "src/objects/objects-body-descriptors-inl.h", + "src/objects/objects-body-descriptors.h", + "src/objects/objects-inl.h", + "src/objects/objects.cc", + "src/objects/objects.h", "src/objects/oddball-inl.h", "src/objects/oddball.h", "src/objects/ordered-hash-table-inl.h", @@ -2528,8 +2605,14 @@ v8_source_set("v8_base_without_compiler") { "src/objects/property-cell.h", "src/objects/property-descriptor-object-inl.h", "src/objects/property-descriptor-object.h", + "src/objects/property-descriptor.cc", + "src/objects/property-descriptor.h", + "src/objects/property-details.h", + "src/objects/property.cc", + "src/objects/property.h", "src/objects/prototype-info-inl.h", "src/objects/prototype-info.h", + "src/objects/prototype.h", "src/objects/regexp-match-info.h", "src/objects/scope-info.cc", "src/objects/scope-info.h", @@ -2552,20 +2635,32 @@ v8_source_set("v8_base_without_compiler") { "src/objects/string.h", "src/objects/struct-inl.h", "src/objects/struct.h", + "src/objects/tagged-impl-inl.h", + "src/objects/tagged-impl.cc", + "src/objects/tagged-impl.h", + "src/objects/tagged-value-inl.h", + "src/objects/tagged-value.h", "src/objects/template-objects-inl.h", "src/objects/template-objects.cc", "src/objects/template-objects.h", "src/objects/templates-inl.h", "src/objects/templates.h", - "src/optimized-compilation-info.cc", - "src/optimized-compilation-info.h", - "src/ostreams.cc", - "src/ostreams.h", + "src/objects/transitions-inl.h", + "src/objects/transitions.cc", + "src/objects/transitions.h", + "src/objects/type-hints.cc", + "src/objects/type-hints.h", + "src/objects/value-serializer.cc", + "src/objects/value-serializer.h", + "src/objects/visitors.cc", + "src/objects/visitors.h", "src/parsing/expression-scope-reparenter.cc", "src/parsing/expression-scope-reparenter.h", "src/parsing/expression-scope.h", "src/parsing/func-name-inferrer.cc", "src/parsing/func-name-inferrer.h", + "src/parsing/literal-buffer.cc", + "src/parsing/literal-buffer.h", "src/parsing/parse-info.cc", "src/parsing/parse-info.h", "src/parsing/parser-base.h", @@ -2573,6 +2668,8 @@ v8_source_set("v8_base_without_compiler") { "src/parsing/parser.h", "src/parsing/parsing.cc", "src/parsing/parsing.h", + "src/parsing/pending-compilation-error-handler.cc", + "src/parsing/pending-compilation-error-handler.h", "src/parsing/preparse-data-impl.h", "src/parsing/preparse-data.cc", "src/parsing/preparse-data.h", @@ -2587,11 +2684,6 @@ v8_source_set("v8_base_without_compiler") { "src/parsing/scanner.h", "src/parsing/token.cc", "src/parsing/token.h", - "src/pending-compilation-error-handler.cc", - "src/pending-compilation-error-handler.h", - "src/perf-jit.cc", - "src/perf-jit.h", - "src/pointer-with-payload.h", "src/profiler/allocation-tracker.cc", "src/profiler/allocation-tracker.h", "src/profiler/circular-queue-inl.h", @@ -2617,14 +2709,6 @@ v8_source_set("v8_base_without_compiler") { "src/profiler/tick-sample.h", "src/profiler/tracing-cpu-profiler.cc", "src/profiler/tracing-cpu-profiler.h", - "src/property-descriptor.cc", - "src/property-descriptor.h", - "src/property-details.h", - "src/property.cc", - "src/property.h", - "src/prototype.h", - "src/ptr-compr-inl.h", - "src/ptr-compr.h", "src/regexp/bytecodes-irregexp.h", "src/regexp/interpreter-irregexp.cc", "src/regexp/interpreter-irregexp.h", @@ -2644,22 +2728,14 @@ v8_source_set("v8_base_without_compiler") { "src/regexp/regexp-macro-assembler.h", "src/regexp/regexp-parser.cc", "src/regexp/regexp-parser.h", + "src/regexp/regexp-special-case.h", "src/regexp/regexp-stack.cc", "src/regexp/regexp-stack.h", "src/regexp/regexp-utils.cc", "src/regexp/regexp-utils.h", - "src/register-arch.h", - "src/register-configuration.cc", - "src/register-configuration.h", - "src/register.h", - "src/reglist.h", - "src/reloc-info.cc", - "src/reloc-info.h", - "src/roots-inl.h", - "src/roots.cc", - "src/roots.h", - "src/runtime-profiler.cc", - "src/runtime-profiler.h", + "src/roots/roots-inl.h", + "src/roots/roots.cc", + "src/roots/roots.h", "src/runtime/runtime-array.cc", "src/runtime/runtime-atomics.cc", "src/runtime/runtime-bigint.cc", @@ -2693,21 +2769,19 @@ v8_source_set("v8_base_without_compiler") { "src/runtime/runtime-weak-refs.cc", "src/runtime/runtime.cc", "src/runtime/runtime.h", - "src/safepoint-table.cc", - "src/safepoint-table.h", - "src/setup-isolate.h", - "src/signature.h", - "src/simulator-base.cc", - "src/simulator-base.h", - "src/simulator.h", + "src/sanitizer/asan.h", + "src/sanitizer/lsan-page-allocator.cc", + "src/sanitizer/lsan-page-allocator.h", + "src/sanitizer/msan.h", + "src/sanitizer/tsan.h", "src/snapshot/code-serializer.cc", "src/snapshot/code-serializer.h", "src/snapshot/deserializer-allocator.cc", "src/snapshot/deserializer-allocator.h", "src/snapshot/deserializer.cc", "src/snapshot/deserializer.h", - "src/snapshot/embedded-data.cc", - "src/snapshot/embedded-data.h", + "src/snapshot/embedded/embedded-data.cc", + "src/snapshot/embedded/embedded-data.h", "src/snapshot/natives-common.cc", "src/snapshot/natives.h", "src/snapshot/object-deserializer.cc", @@ -2737,85 +2811,69 @@ v8_source_set("v8_base_without_compiler") { "src/snapshot/startup-deserializer.h", "src/snapshot/startup-serializer.cc", "src/snapshot/startup-serializer.h", - "src/source-position-table.cc", - "src/source-position-table.h", - "src/source-position.cc", - "src/source-position.h", - "src/splay-tree-inl.h", - "src/splay-tree.h", - "src/startup-data-util.cc", - "src/startup-data-util.h", - "src/string-builder-inl.h", - "src/string-builder.cc", - "src/string-case.cc", - "src/string-case.h", - "src/string-constants.cc", - "src/string-constants.h", - "src/string-hasher-inl.h", - "src/string-hasher.h", - "src/string-search.h", - "src/string-stream.cc", - "src/string-stream.h", - "src/strtod.cc", - "src/strtod.h", - "src/task-utils.cc", - "src/task-utils.h", + "src/strings/char-predicates-inl.h", + "src/strings/char-predicates.cc", + "src/strings/char-predicates.h", + "src/strings/string-builder-inl.h", + "src/strings/string-builder.cc", + "src/strings/string-case.cc", + "src/strings/string-case.h", + "src/strings/string-hasher-inl.h", + "src/strings/string-hasher.h", + "src/strings/string-search.h", + "src/strings/string-stream.cc", + "src/strings/string-stream.h", + "src/strings/unicode-decoder.cc", + "src/strings/unicode-decoder.h", + "src/strings/unicode-inl.h", + "src/strings/unicode.cc", + "src/strings/unicode.h", + "src/strings/uri.cc", + "src/strings/uri.h", + "src/tasks/cancelable-task.cc", + "src/tasks/cancelable-task.h", + "src/tasks/task-utils.cc", + "src/tasks/task-utils.h", "src/third_party/siphash/halfsiphash.cc", "src/third_party/siphash/halfsiphash.h", "src/third_party/utf8-decoder/utf8-decoder.h", - "src/thread-id.cc", - "src/thread-id.h", - "src/thread-local-top.cc", - "src/thread-local-top.h", "src/tracing/trace-event.cc", "src/tracing/trace-event.h", "src/tracing/traced-value.cc", "src/tracing/traced-value.h", "src/tracing/tracing-category-observer.cc", "src/tracing/tracing-category-observer.h", - "src/transitions-inl.h", - "src/transitions.cc", - "src/transitions.h", "src/trap-handler/handler-inside.cc", "src/trap-handler/handler-outside.cc", "src/trap-handler/handler-shared.cc", "src/trap-handler/trap-handler-internal.h", "src/trap-handler/trap-handler.h", - "src/turbo-assembler.cc", - "src/turbo-assembler.h", - "src/type-hints.cc", - "src/type-hints.h", - "src/type-traits.h", - "src/unicode-cache.h", - "src/unicode-decoder.cc", - "src/unicode-decoder.h", - "src/unicode-inl.h", - "src/unicode.cc", - "src/unicode.h", - "src/unoptimized-compilation-info.cc", - "src/unoptimized-compilation-info.h", - "src/unwinder.cc", - "src/uri.cc", - "src/uri.h", - "src/utils-inl.h", - "src/utils.cc", - "src/utils.h", - "src/v8.cc", - "src/v8.h", - "src/v8memory.h", - "src/v8threads.cc", - "src/v8threads.h", - "src/value-serializer.cc", - "src/value-serializer.h", - "src/vector-slot-pair.cc", - "src/vector-slot-pair.h", - "src/vector.h", - "src/version.cc", - "src/version.h", - "src/visitors.cc", - "src/visitors.h", - "src/vm-state-inl.h", - "src/vm-state.h", + "src/utils/address-map.cc", + "src/utils/address-map.h", + "src/utils/allocation.cc", + "src/utils/allocation.h", + "src/utils/bit-vector.cc", + "src/utils/bit-vector.h", + "src/utils/boxed-float.h", + "src/utils/detachable-vector.cc", + "src/utils/detachable-vector.h", + "src/utils/identity-map.cc", + "src/utils/identity-map.h", + "src/utils/locked-queue-inl.h", + "src/utils/locked-queue.h", + "src/utils/memcopy.cc", + "src/utils/memcopy.h", + "src/utils/ostreams.cc", + "src/utils/ostreams.h", + "src/utils/pointer-with-payload.h", + "src/utils/splay-tree-inl.h", + "src/utils/splay-tree.h", + "src/utils/utils-inl.h", + "src/utils/utils.cc", + "src/utils/utils.h", + "src/utils/vector.h", + "src/utils/version.cc", + "src/utils/version.h", "src/wasm/baseline/liftoff-assembler-defs.h", "src/wasm/baseline/liftoff-assembler.cc", "src/wasm/baseline/liftoff-assembler.h", @@ -2916,40 +2974,50 @@ v8_source_set("v8_base_without_compiler") { # These source files take an unusually large amount of time to # compile. Build them separately to avoid bottlenecks. - "src/api.cc", - "src/elements.cc", + "src/api/api.cc", "src/heap/heap.cc", - "src/objects.cc", + "src/objects/elements.cc", + "src/objects/objects.cc", "src/parsing/parser.cc", ] if (v8_current_cpu == "x86") { sources += [ ### gcmole(arch:ia32) ### + "src/codegen/ia32/assembler-ia32-inl.h", + "src/codegen/ia32/assembler-ia32.cc", + "src/codegen/ia32/assembler-ia32.h", + "src/codegen/ia32/constants-ia32.h", + "src/codegen/ia32/cpu-ia32.cc", + "src/codegen/ia32/interface-descriptors-ia32.cc", + "src/codegen/ia32/macro-assembler-ia32.cc", + "src/codegen/ia32/macro-assembler-ia32.h", + "src/codegen/ia32/register-ia32.h", + "src/codegen/ia32/sse-instr.h", "src/compiler/backend/ia32/code-generator-ia32.cc", "src/compiler/backend/ia32/instruction-codes-ia32.h", "src/compiler/backend/ia32/instruction-scheduler-ia32.cc", "src/compiler/backend/ia32/instruction-selector-ia32.cc", "src/debug/ia32/debug-ia32.cc", - "src/ia32/assembler-ia32-inl.h", - "src/ia32/assembler-ia32.cc", - "src/ia32/assembler-ia32.h", - "src/ia32/constants-ia32.h", - "src/ia32/cpu-ia32.cc", - "src/ia32/deoptimizer-ia32.cc", - "src/ia32/disasm-ia32.cc", - "src/ia32/frame-constants-ia32.cc", - "src/ia32/frame-constants-ia32.h", - "src/ia32/interface-descriptors-ia32.cc", - "src/ia32/macro-assembler-ia32.cc", - "src/ia32/macro-assembler-ia32.h", - "src/ia32/register-ia32.h", - "src/ia32/sse-instr.h", + "src/deoptimizer/ia32/deoptimizer-ia32.cc", + "src/diagnostics/ia32/disasm-ia32.cc", + "src/execution/ia32/frame-constants-ia32.cc", + "src/execution/ia32/frame-constants-ia32.h", "src/regexp/ia32/regexp-macro-assembler-ia32.cc", "src/regexp/ia32/regexp-macro-assembler-ia32.h", "src/wasm/baseline/ia32/liftoff-assembler-ia32.h", ] } else if (v8_current_cpu == "x64") { sources += [ ### gcmole(arch:x64) ### + "src/codegen/x64/assembler-x64-inl.h", + "src/codegen/x64/assembler-x64.cc", + "src/codegen/x64/assembler-x64.h", + "src/codegen/x64/constants-x64.h", + "src/codegen/x64/cpu-x64.cc", + "src/codegen/x64/interface-descriptors-x64.cc", + "src/codegen/x64/macro-assembler-x64.cc", + "src/codegen/x64/macro-assembler-x64.h", + "src/codegen/x64/register-x64.h", + "src/codegen/x64/sse-instr.h", "src/compiler/backend/x64/code-generator-x64.cc", "src/compiler/backend/x64/instruction-codes-x64.h", "src/compiler/backend/x64/instruction-scheduler-x64.cc", @@ -2957,26 +3025,17 @@ v8_source_set("v8_base_without_compiler") { "src/compiler/backend/x64/unwinding-info-writer-x64.cc", "src/compiler/backend/x64/unwinding-info-writer-x64.h", "src/debug/x64/debug-x64.cc", + "src/deoptimizer/x64/deoptimizer-x64.cc", + "src/diagnostics/x64/disasm-x64.cc", + "src/diagnostics/x64/eh-frame-x64.cc", + "src/execution/x64/frame-constants-x64.cc", + "src/execution/x64/frame-constants-x64.h", "src/regexp/x64/regexp-macro-assembler-x64.cc", "src/regexp/x64/regexp-macro-assembler-x64.h", "src/third_party/valgrind/valgrind.h", "src/wasm/baseline/x64/liftoff-assembler-x64.h", - "src/x64/assembler-x64-inl.h", - "src/x64/assembler-x64.cc", - "src/x64/assembler-x64.h", - "src/x64/constants-x64.h", - "src/x64/cpu-x64.cc", - "src/x64/deoptimizer-x64.cc", - "src/x64/disasm-x64.cc", - "src/x64/eh-frame-x64.cc", - "src/x64/frame-constants-x64.cc", - "src/x64/frame-constants-x64.h", - "src/x64/interface-descriptors-x64.cc", - "src/x64/macro-assembler-x64.cc", - "src/x64/macro-assembler-x64.h", - "src/x64/register-x64.h", - "src/x64/sse-instr.h", ] + # iOS Xcode simulator builds run on an x64 target. iOS and macOS are both # based on Darwin and thus POSIX-compliant to a similar degree. if (is_linux || is_mac || is_ios) { @@ -2988,32 +3047,25 @@ v8_source_set("v8_base_without_compiler") { } if (is_win) { sources += [ + "src/diagnostics/unwinding-info-win64.cc", + "src/diagnostics/unwinding-info-win64.h", "src/trap-handler/handler-inside-win.cc", "src/trap-handler/handler-inside-win.h", "src/trap-handler/handler-outside-win.cc", - "src/unwinding-info-win64.cc", - "src/unwinding-info-win64.h", ] } } else if (v8_current_cpu == "arm") { sources += [ ### gcmole(arch:arm) ### - "src/arm/assembler-arm-inl.h", - "src/arm/assembler-arm.cc", - "src/arm/assembler-arm.h", - "src/arm/constants-arm.cc", - "src/arm/constants-arm.h", - "src/arm/cpu-arm.cc", - "src/arm/deoptimizer-arm.cc", - "src/arm/disasm-arm.cc", - "src/arm/eh-frame-arm.cc", - "src/arm/frame-constants-arm.cc", - "src/arm/frame-constants-arm.h", - "src/arm/interface-descriptors-arm.cc", - "src/arm/macro-assembler-arm.cc", - "src/arm/macro-assembler-arm.h", - "src/arm/register-arm.h", - "src/arm/simulator-arm.cc", - "src/arm/simulator-arm.h", + "src/codegen/arm/assembler-arm-inl.h", + "src/codegen/arm/assembler-arm.cc", + "src/codegen/arm/assembler-arm.h", + "src/codegen/arm/constants-arm.cc", + "src/codegen/arm/constants-arm.h", + "src/codegen/arm/cpu-arm.cc", + "src/codegen/arm/interface-descriptors-arm.cc", + "src/codegen/arm/macro-assembler-arm.cc", + "src/codegen/arm/macro-assembler-arm.h", + "src/codegen/arm/register-arm.h", "src/compiler/backend/arm/code-generator-arm.cc", "src/compiler/backend/arm/instruction-codes-arm.h", "src/compiler/backend/arm/instruction-scheduler-arm.cc", @@ -3021,42 +3073,40 @@ v8_source_set("v8_base_without_compiler") { "src/compiler/backend/arm/unwinding-info-writer-arm.cc", "src/compiler/backend/arm/unwinding-info-writer-arm.h", "src/debug/arm/debug-arm.cc", + "src/deoptimizer/arm/deoptimizer-arm.cc", + "src/diagnostics/arm/disasm-arm.cc", + "src/diagnostics/arm/eh-frame-arm.cc", + "src/execution/arm/frame-constants-arm.cc", + "src/execution/arm/frame-constants-arm.h", + "src/execution/arm/simulator-arm.cc", + "src/execution/arm/simulator-arm.h", "src/regexp/arm/regexp-macro-assembler-arm.cc", "src/regexp/arm/regexp-macro-assembler-arm.h", "src/wasm/baseline/arm/liftoff-assembler-arm.h", ] } else if (v8_current_cpu == "arm64") { sources += [ ### gcmole(arch:arm64) ### - "src/arm64/assembler-arm64-inl.h", - "src/arm64/assembler-arm64.cc", - "src/arm64/assembler-arm64.h", - "src/arm64/constants-arm64.h", - "src/arm64/cpu-arm64.cc", - "src/arm64/decoder-arm64-inl.h", - "src/arm64/decoder-arm64.cc", - "src/arm64/decoder-arm64.h", - "src/arm64/deoptimizer-arm64.cc", - "src/arm64/disasm-arm64.cc", - "src/arm64/disasm-arm64.h", - "src/arm64/eh-frame-arm64.cc", - "src/arm64/frame-constants-arm64.cc", - "src/arm64/frame-constants-arm64.h", - "src/arm64/instructions-arm64-constants.cc", - "src/arm64/instructions-arm64.cc", - "src/arm64/instructions-arm64.h", - "src/arm64/instrument-arm64.cc", - "src/arm64/instrument-arm64.h", - "src/arm64/interface-descriptors-arm64.cc", - "src/arm64/macro-assembler-arm64-inl.h", - "src/arm64/macro-assembler-arm64.cc", - "src/arm64/macro-assembler-arm64.h", - "src/arm64/register-arm64.cc", - "src/arm64/register-arm64.h", - "src/arm64/simulator-arm64.cc", - "src/arm64/simulator-arm64.h", - "src/arm64/simulator-logic-arm64.cc", - "src/arm64/utils-arm64.cc", - "src/arm64/utils-arm64.h", + "src/codegen/arm64/assembler-arm64-inl.h", + "src/codegen/arm64/assembler-arm64.cc", + "src/codegen/arm64/assembler-arm64.h", + "src/codegen/arm64/constants-arm64.h", + "src/codegen/arm64/cpu-arm64.cc", + "src/codegen/arm64/decoder-arm64-inl.h", + "src/codegen/arm64/decoder-arm64.cc", + "src/codegen/arm64/decoder-arm64.h", + "src/codegen/arm64/instructions-arm64-constants.cc", + "src/codegen/arm64/instructions-arm64.cc", + "src/codegen/arm64/instructions-arm64.h", + "src/codegen/arm64/instrument-arm64.cc", + "src/codegen/arm64/instrument-arm64.h", + "src/codegen/arm64/interface-descriptors-arm64.cc", + "src/codegen/arm64/macro-assembler-arm64-inl.h", + "src/codegen/arm64/macro-assembler-arm64.cc", + "src/codegen/arm64/macro-assembler-arm64.h", + "src/codegen/arm64/register-arm64.cc", + "src/codegen/arm64/register-arm64.h", + "src/codegen/arm64/utils-arm64.cc", + "src/codegen/arm64/utils-arm64.h", "src/compiler/backend/arm64/code-generator-arm64.cc", "src/compiler/backend/arm64/instruction-codes-arm64.h", "src/compiler/backend/arm64/instruction-scheduler-arm64.cc", @@ -3064,6 +3114,15 @@ v8_source_set("v8_base_without_compiler") { "src/compiler/backend/arm64/unwinding-info-writer-arm64.cc", "src/compiler/backend/arm64/unwinding-info-writer-arm64.h", "src/debug/arm64/debug-arm64.cc", + "src/deoptimizer/arm64/deoptimizer-arm64.cc", + "src/diagnostics/arm64/disasm-arm64.cc", + "src/diagnostics/arm64/disasm-arm64.h", + "src/diagnostics/arm64/eh-frame-arm64.cc", + "src/execution/arm64/frame-constants-arm64.cc", + "src/execution/arm64/frame-constants-arm64.h", + "src/execution/arm64/simulator-arm64.cc", + "src/execution/arm64/simulator-arm64.h", + "src/execution/arm64/simulator-logic-arm64.cc", "src/regexp/arm64/regexp-macro-assembler-arm64.cc", "src/regexp/arm64/regexp-macro-assembler-arm64.h", "src/wasm/baseline/arm64/liftoff-assembler-arm64.h", @@ -3071,114 +3130,114 @@ v8_source_set("v8_base_without_compiler") { jumbo_excluded_sources += [ # TODO(mostynb@vewd.com): fix this code so it doesn't need # to be excluded, see the comments inside. - "src/arm64/instructions-arm64-constants.cc", + "src/codegen/arm64/instructions-arm64-constants.cc", ] } else if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel") { sources += [ ### gcmole(arch:mipsel) ### + "src/codegen/mips/assembler-mips-inl.h", + "src/codegen/mips/assembler-mips.cc", + "src/codegen/mips/assembler-mips.h", + "src/codegen/mips/constants-mips.cc", + "src/codegen/mips/constants-mips.h", + "src/codegen/mips/cpu-mips.cc", + "src/codegen/mips/interface-descriptors-mips.cc", + "src/codegen/mips/macro-assembler-mips.cc", + "src/codegen/mips/macro-assembler-mips.h", + "src/codegen/mips/register-mips.h", "src/compiler/backend/mips/code-generator-mips.cc", "src/compiler/backend/mips/instruction-codes-mips.h", "src/compiler/backend/mips/instruction-scheduler-mips.cc", "src/compiler/backend/mips/instruction-selector-mips.cc", "src/debug/mips/debug-mips.cc", - "src/mips/assembler-mips-inl.h", - "src/mips/assembler-mips.cc", - "src/mips/assembler-mips.h", - "src/mips/constants-mips.cc", - "src/mips/constants-mips.h", - "src/mips/cpu-mips.cc", - "src/mips/deoptimizer-mips.cc", - "src/mips/disasm-mips.cc", - "src/mips/frame-constants-mips.cc", - "src/mips/frame-constants-mips.h", - "src/mips/interface-descriptors-mips.cc", - "src/mips/macro-assembler-mips.cc", - "src/mips/macro-assembler-mips.h", - "src/mips/register-mips.h", - "src/mips/simulator-mips.cc", - "src/mips/simulator-mips.h", + "src/deoptimizer/mips/deoptimizer-mips.cc", + "src/diagnostics/mips/disasm-mips.cc", + "src/execution/mips/frame-constants-mips.cc", + "src/execution/mips/frame-constants-mips.h", + "src/execution/mips/simulator-mips.cc", + "src/execution/mips/simulator-mips.h", "src/regexp/mips/regexp-macro-assembler-mips.cc", "src/regexp/mips/regexp-macro-assembler-mips.h", "src/wasm/baseline/mips/liftoff-assembler-mips.h", ] } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") { sources += [ ### gcmole(arch:mips64el) ### + "src/codegen/mips64/assembler-mips64-inl.h", + "src/codegen/mips64/assembler-mips64.cc", + "src/codegen/mips64/assembler-mips64.h", + "src/codegen/mips64/constants-mips64.cc", + "src/codegen/mips64/constants-mips64.h", + "src/codegen/mips64/cpu-mips64.cc", + "src/codegen/mips64/interface-descriptors-mips64.cc", + "src/codegen/mips64/macro-assembler-mips64.cc", + "src/codegen/mips64/macro-assembler-mips64.h", + "src/codegen/mips64/register-mips64.h", "src/compiler/backend/mips64/code-generator-mips64.cc", "src/compiler/backend/mips64/instruction-codes-mips64.h", "src/compiler/backend/mips64/instruction-scheduler-mips64.cc", "src/compiler/backend/mips64/instruction-selector-mips64.cc", "src/debug/mips64/debug-mips64.cc", - "src/mips64/assembler-mips64-inl.h", - "src/mips64/assembler-mips64.cc", - "src/mips64/assembler-mips64.h", - "src/mips64/constants-mips64.cc", - "src/mips64/constants-mips64.h", - "src/mips64/cpu-mips64.cc", - "src/mips64/deoptimizer-mips64.cc", - "src/mips64/disasm-mips64.cc", - "src/mips64/frame-constants-mips64.cc", - "src/mips64/frame-constants-mips64.h", - "src/mips64/interface-descriptors-mips64.cc", - "src/mips64/macro-assembler-mips64.cc", - "src/mips64/macro-assembler-mips64.h", - "src/mips64/register-mips64.h", - "src/mips64/simulator-mips64.cc", - "src/mips64/simulator-mips64.h", + "src/deoptimizer/mips64/deoptimizer-mips64.cc", + "src/diagnostics/mips64/disasm-mips64.cc", + "src/execution/mips64/frame-constants-mips64.cc", + "src/execution/mips64/frame-constants-mips64.h", + "src/execution/mips64/simulator-mips64.cc", + "src/execution/mips64/simulator-mips64.h", "src/regexp/mips64/regexp-macro-assembler-mips64.cc", "src/regexp/mips64/regexp-macro-assembler-mips64.h", "src/wasm/baseline/mips64/liftoff-assembler-mips64.h", ] } else if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64") { sources += [ ### gcmole(arch:ppc) ### + "src/codegen/ppc/assembler-ppc-inl.h", + "src/codegen/ppc/assembler-ppc.cc", + "src/codegen/ppc/assembler-ppc.h", + "src/codegen/ppc/constants-ppc.cc", + "src/codegen/ppc/constants-ppc.h", + "src/codegen/ppc/cpu-ppc.cc", + "src/codegen/ppc/interface-descriptors-ppc.cc", + "src/codegen/ppc/macro-assembler-ppc.cc", + "src/codegen/ppc/macro-assembler-ppc.h", + "src/codegen/ppc/register-ppc.h", "src/compiler/backend/ppc/code-generator-ppc.cc", "src/compiler/backend/ppc/instruction-codes-ppc.h", "src/compiler/backend/ppc/instruction-scheduler-ppc.cc", "src/compiler/backend/ppc/instruction-selector-ppc.cc", "src/debug/ppc/debug-ppc.cc", - "src/ppc/assembler-ppc-inl.h", - "src/ppc/assembler-ppc.cc", - "src/ppc/assembler-ppc.h", - "src/ppc/constants-ppc.cc", - "src/ppc/constants-ppc.h", - "src/ppc/cpu-ppc.cc", - "src/ppc/deoptimizer-ppc.cc", - "src/ppc/disasm-ppc.cc", - "src/ppc/frame-constants-ppc.cc", - "src/ppc/frame-constants-ppc.h", - "src/ppc/interface-descriptors-ppc.cc", - "src/ppc/macro-assembler-ppc.cc", - "src/ppc/macro-assembler-ppc.h", - "src/ppc/register-ppc.h", - "src/ppc/simulator-ppc.cc", - "src/ppc/simulator-ppc.h", + "src/deoptimizer/ppc/deoptimizer-ppc.cc", + "src/diagnostics/ppc/disasm-ppc.cc", + "src/execution/ppc/frame-constants-ppc.cc", + "src/execution/ppc/frame-constants-ppc.h", + "src/execution/ppc/simulator-ppc.cc", + "src/execution/ppc/simulator-ppc.h", "src/regexp/ppc/regexp-macro-assembler-ppc.cc", "src/regexp/ppc/regexp-macro-assembler-ppc.h", "src/wasm/baseline/ppc/liftoff-assembler-ppc.h", ] } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") { sources += [ ### gcmole(arch:s390) ### + "src/codegen/s390/assembler-s390-inl.h", + "src/codegen/s390/assembler-s390.cc", + "src/codegen/s390/assembler-s390.h", + "src/codegen/s390/constants-s390.cc", + "src/codegen/s390/constants-s390.h", + "src/codegen/s390/cpu-s390.cc", + "src/codegen/s390/interface-descriptors-s390.cc", + "src/codegen/s390/macro-assembler-s390.cc", + "src/codegen/s390/macro-assembler-s390.h", + "src/codegen/s390/register-s390.h", "src/compiler/backend/s390/code-generator-s390.cc", "src/compiler/backend/s390/instruction-codes-s390.h", "src/compiler/backend/s390/instruction-scheduler-s390.cc", "src/compiler/backend/s390/instruction-selector-s390.cc", "src/debug/s390/debug-s390.cc", + "src/deoptimizer/s390/deoptimizer-s390.cc", + "src/diagnostics/s390/disasm-s390.cc", + "src/execution/s390/frame-constants-s390.cc", + "src/execution/s390/frame-constants-s390.h", + "src/execution/s390/simulator-s390.cc", + "src/execution/s390/simulator-s390.h", "src/regexp/s390/regexp-macro-assembler-s390.cc", "src/regexp/s390/regexp-macro-assembler-s390.h", - "src/s390/assembler-s390-inl.h", - "src/s390/assembler-s390.cc", - "src/s390/assembler-s390.h", - "src/s390/constants-s390.cc", - "src/s390/constants-s390.h", - "src/s390/cpu-s390.cc", - "src/s390/deoptimizer-s390.cc", - "src/s390/disasm-s390.cc", - "src/s390/frame-constants-s390.cc", - "src/s390/frame-constants-s390.h", - "src/s390/interface-descriptors-s390.cc", - "src/s390/macro-assembler-s390.cc", - "src/s390/macro-assembler-s390.h", - "src/s390/register-s390.h", - "src/s390/simulator-s390.cc", - "src/s390/simulator-s390.h", "src/wasm/baseline/s390/liftoff-assembler-s390.h", ] } @@ -3203,13 +3262,14 @@ v8_source_set("v8_base_without_compiler") { ] if (v8_enable_i18n_support) { + deps += [ ":run_gen-regexp-special-case" ] + sources += [ "$target_gen_dir/src/regexp/special-case.cc" ] if (is_win) { deps += [ "//third_party/icu:icudata" ] } } else { sources -= [ "src/builtins/builtins-intl.cc", - "src/char-predicates.cc", "src/objects/intl-objects.cc", "src/objects/intl-objects.h", "src/objects/js-break-iterator-inl.h", @@ -3243,6 +3303,7 @@ v8_source_set("v8_base_without_compiler") { "src/objects/js-segmenter.cc", "src/objects/js-segmenter.h", "src/runtime/runtime-intl.cc", + "src/strings/char-predicates.cc", ] } @@ -3275,6 +3336,7 @@ v8_source_set("torque_base") { "src/torque/ast.h", "src/torque/cfg.cc", "src/torque/cfg.h", + "src/torque/constants.h", "src/torque/contextual.h", "src/torque/csa-generator.cc", "src/torque/csa-generator.h", @@ -3286,8 +3348,6 @@ v8_source_set("torque_base") { "src/torque/declarations.h", "src/torque/earley-parser.cc", "src/torque/earley-parser.h", - "src/torque/file-visitor.cc", - "src/torque/file-visitor.h", "src/torque/global-context.h", "src/torque/implementation-visitor.cc", "src/torque/implementation-visitor.h", @@ -3303,6 +3363,8 @@ v8_source_set("torque_base") { "src/torque/torque-parser.h", "src/torque/type-oracle.cc", "src/torque/type-oracle.h", + "src/torque/type-visitor.cc", + "src/torque/type-visitor.h", "src/torque/types.cc", "src/torque/types.h", "src/torque/utils.cc", @@ -3329,8 +3391,16 @@ v8_source_set("torque_base") { ] if (is_win && is_asan) { + # Due to a bug in ASAN on Windows (chromium:893437), we disable ASAN for + # Torque on Windows. remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ] } + + if (is_debug && !v8_optimized_debug && v8_enable_fast_torque) { + # The :no_optimize config is added to v8_add_configs in v8.gni. + remove_configs += [ "//build/config/compiler:no_optimize" ] + configs += [ ":always_optimize" ] + } } v8_source_set("torque_ls_base") { @@ -3394,7 +3464,6 @@ v8_component("v8_libbase") { "src/base/file-utils.cc", "src/base/file-utils.h", "src/base/flags.h", - "src/base/format-macros.h", "src/base/free_deleter.h", "src/base/functional.cc", "src/base/functional.h", @@ -3407,8 +3476,6 @@ v8_component("v8_libbase") { "src/base/list.h", "src/base/logging.cc", "src/base/logging.h", - "src/base/lsan-page-allocator.cc", - "src/base/lsan-page-allocator.h", "src/base/macros.h", "src/base/once.cc", "src/base/once.h", @@ -3436,7 +3503,7 @@ v8_component("v8_libbase") { "src/base/sys-info.h", "src/base/template-utils.h", "src/base/timezone-cache.h", - "src/base/tsan.h", + "src/base/type-traits.h", "src/base/utils/random-number-generator.cc", "src/base/utils/random-number-generator.h", ] @@ -3601,7 +3668,25 @@ v8_component("v8_libplatform") { ":v8_libbase", ] if (v8_use_perfetto) { - deps += [ "third_party/perfetto:libperfetto" ] + sources += [ + "src/libplatform/tracing/json-trace-event-listener.cc", + "src/libplatform/tracing/json-trace-event-listener.h", + "src/libplatform/tracing/perfetto-consumer.cc", + "src/libplatform/tracing/perfetto-consumer.h", + "src/libplatform/tracing/perfetto-producer.cc", + "src/libplatform/tracing/perfetto-producer.h", + "src/libplatform/tracing/perfetto-shared-memory.cc", + "src/libplatform/tracing/perfetto-shared-memory.h", + "src/libplatform/tracing/perfetto-tasks.cc", + "src/libplatform/tracing/perfetto-tasks.h", + "src/libplatform/tracing/perfetto-tracing-controller.cc", + "src/libplatform/tracing/perfetto-tracing-controller.h", + "src/libplatform/tracing/trace-event-listener.h", + ] + deps += [ + "//third_party/perfetto:libperfetto", + "//third_party/perfetto/protos/perfetto/trace/chrome:minimal_complete_lite", + ] } } @@ -3679,9 +3764,11 @@ v8_static_library("wee8") { configs = [ ":internal_config" ] sources = [ + ### gcmole(all) ### "src/wasm/c-api.cc", - "third_party/wasm-c-api/wasm.h", - "third_party/wasm-c-api/wasm.hh", + "src/wasm/c-api.h", + "third_party/wasm-api/wasm.h", + "third_party/wasm-api/wasm.hh", ] } @@ -3717,8 +3804,18 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) { visibility = [ ":*" ] # Only targets in this file can depend on this. sources = [ - "src/snapshot/embedded-file-writer.cc", - "src/snapshot/embedded-file-writer.h", + "src/snapshot/embedded/embedded-file-writer.cc", + "src/snapshot/embedded/embedded-file-writer.h", + "src/snapshot/embedded/platform-embedded-file-writer-aix.cc", + "src/snapshot/embedded/platform-embedded-file-writer-aix.h", + "src/snapshot/embedded/platform-embedded-file-writer-base.cc", + "src/snapshot/embedded/platform-embedded-file-writer-base.h", + "src/snapshot/embedded/platform-embedded-file-writer-generic.cc", + "src/snapshot/embedded/platform-embedded-file-writer-generic.h", + "src/snapshot/embedded/platform-embedded-file-writer-mac.cc", + "src/snapshot/embedded/platform-embedded-file-writer-mac.h", + "src/snapshot/embedded/platform-embedded-file-writer-win.cc", + "src/snapshot/embedded/platform-embedded-file-writer-win.h", "src/snapshot/mksnapshot.cc", ] @@ -3733,12 +3830,6 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) { ":v8_nosnapshot", "//build/win:default_exe_manifest", ] - - if (target_os == "fuchsia") { - defines = [ "V8_TARGET_OS_FUCHSIA" ] - } else if (target_os == "win") { - defines = [ "V8_TARGET_OS_WIN" ] - } } } @@ -3801,6 +3892,50 @@ v8_executable("torque-language-server") { } } +if (current_toolchain == v8_generator_toolchain) { + v8_executable("gen-regexp-special-case") { + visibility = [ ":*" ] # Only targets in this file can depend on this. + + sources = [ + "src/regexp/gen-regexp-special-case.cc", + ] + + deps = [ + ":v8_libbase", + "//build/win:default_exe_manifest", + "//third_party/icu", + ] + + configs = [ ":internal_config" ] + } +} + +action("run_gen-regexp-special-case") { + visibility = [ ":*" ] # Only targets in this file can depend on this. + + script = "tools/run.py" + + sources = v8_extra_library_files + + deps = [ + ":gen-regexp-special-case($v8_generator_toolchain)", + ] + + output_file = "$target_gen_dir/src/regexp/special-case.cc" + + outputs = [ + output_file, + ] + + args = [ + "./" + rebase_path( + get_label_info(":gen-regexp-special-case($v8_generator_toolchain)", + "root_out_dir") + "/gen-regexp-special-case", + root_build_dir), + rebase_path(output_file, root_build_dir), + ] +} + ############################################################################### # Public targets # @@ -3833,6 +3968,12 @@ group("gn_all") { } } +group("v8_python_base") { + data = [ + ".vpython", + ] +} + group("v8_clusterfuzz") { testonly = true @@ -3899,7 +4040,7 @@ group("v8_fuzzers") { if (is_component_build) { v8_component("v8") { sources = [ - "src/v8dll-main.cc", + "src/utils/v8dll-main.cc", ] public_deps = [ @@ -3916,7 +4057,7 @@ if (is_component_build) { testonly = true sources = [ - "src/v8dll-main.cc", + "src/utils/v8dll-main.cc", ] public_deps = [ @@ -3965,15 +4106,15 @@ if (is_component_build) { v8_executable("d8") { sources = [ - "src/async-hooks-wrapper.cc", - "src/async-hooks-wrapper.h", - "src/d8-console.cc", - "src/d8-console.h", - "src/d8-js.cc", - "src/d8-platforms.cc", - "src/d8-platforms.h", - "src/d8.cc", - "src/d8.h", + "src/d8/async-hooks-wrapper.cc", + "src/d8/async-hooks-wrapper.h", + "src/d8/d8-console.cc", + "src/d8/d8-console.h", + "src/d8/d8-js.cc", + "src/d8/d8-platforms.cc", + "src/d8/d8-platforms.h", + "src/d8/d8.cc", + "src/d8/d8.h", ] configs = [ @@ -3991,9 +4132,9 @@ v8_executable("d8") { ] if (is_posix || is_fuchsia) { - sources += [ "src/d8-posix.cc" ] + sources += [ "src/d8/d8-posix.cc" ] } else if (is_win) { - sources += [ "src/d8-windows.cc" ] + sources += [ "src/d8/d8-windows.cc" ] } if (v8_correctness_fuzzer) { @@ -4326,16 +4467,13 @@ if (!build_with_chromium && v8_use_perfetto) { "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER", ] cflags = [ - # Using -isystem instead of include_dirs (-I), so we don't need to suppress - # warnings coming from libprotobuf headers. Doing so would mask warnings in - # our own code. - "-isystem", - rebase_path("third_party/protobuf/src", root_build_dir), "-Wno-unknown-warning-option", "-Wno-deprecated", "-Wno-undef", "-Wno-zero-as-null-pointer-constant", + "-Wno-thread-safety-attributes", ] + include_dirs = [ "third_party/protobuf/src" ] } # Configuration used to build libprotobuf_* and the protoc compiler. @@ -4343,7 +4481,9 @@ if (!build_with_chromium && v8_use_perfetto) { # Apply the lighter supressions and macro definitions from above. configs = [ ":protobuf_gen_config" ] - defines = [ "HAVE_PTHREAD=1" ] + if (!is_win) { + defines = [ "HAVE_PTHREAD=1" ] + } if (is_clang) { cflags = [ "-Wno-unused-private-field", @@ -4355,6 +4495,9 @@ if (!build_with_chromium && v8_use_perfetto) { "-Wno-tautological-constant-compare", ] } + if (is_win) { + cflags += [ "-Wno-microsoft-unqualified-friend" ] + } } source_set("protobuf_lite") { @@ -4389,6 +4532,9 @@ if (!build_with_chromium && v8_use_perfetto) { "//build/config/compiler:no_chromium_code", ":protobuf_config", ] + if (is_win) { + configs -= [ "//build/config/win:lean_and_mean" ] + } public_configs = [ ":protobuf_gen_config" ] } @@ -4458,6 +4604,9 @@ if (!build_with_chromium && v8_use_perfetto) { "//build/config/compiler:no_chromium_code", ":protobuf_config", ] + if (is_win) { + configs -= [ "//build/config/win:lean_and_mean" ] + } public_configs = [ ":protobuf_gen_config" ] } @@ -4483,69 +4632,8 @@ if (!build_with_chromium && v8_use_perfetto) { "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc", "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc", - "third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_enum.cc", - "third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_field_base.cc", - "third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_generator.cc", - "third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_helpers.cc", - "third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_map_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_message.cc", - "third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc", - "third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc", - "third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_context.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_doc_comment.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_enum.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_enum_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_enum_field_lite.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_extension.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_extension_lite.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_file.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_generator.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_generator_factory.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_map_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_map_field_lite.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_message.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_message_builder.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_message_builder_lite.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_message_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_message_field_lite.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_message_lite.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_name_resolver.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field_lite.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_service.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_shared_code_generator.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_string_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/java/java_string_field_lite.cc", - "third_party/protobuf/src/google/protobuf/compiler/js/js_generator.cc", - "third_party/protobuf/src/google/protobuf/compiler/js/well_known_types_embed.cc", - "third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum.cc", - "third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_extension.cc", - "third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.cc", - "third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_generator.cc", - "third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc", - "third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc", - "third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc", - "third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc", - "third_party/protobuf/src/google/protobuf/compiler/php/php_generator.cc", "third_party/protobuf/src/google/protobuf/compiler/plugin.cc", "third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc", - "third_party/protobuf/src/google/protobuf/compiler/python/python_generator.cc", - "third_party/protobuf/src/google/protobuf/compiler/ruby/ruby_generator.cc", "third_party/protobuf/src/google/protobuf/compiler/subprocess.cc", "third_party/protobuf/src/google/protobuf/compiler/zip_writer.cc", ] @@ -4554,6 +4642,9 @@ if (!build_with_chromium && v8_use_perfetto) { "//build/config/compiler:no_chromium_code", ":protobuf_config", ] + if (is_win) { + configs -= [ "//build/config/win:lean_and_mean" ] + } public_configs = [ ":protobuf_gen_config" ] } @@ -4563,7 +4654,7 @@ if (!build_with_chromium && v8_use_perfetto) { "//build/win:default_exe_manifest", ] sources = [ - "third_party/protobuf/src/google/protobuf/compiler/main.cc", + "src/protobuf/protobuf-compiler-main.cc", ] configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] diff --git a/deps/v8/COMMON_OWNERS b/deps/v8/COMMON_OWNERS new file mode 100644 index 00000000000000..79f14286583397 --- /dev/null +++ b/deps/v8/COMMON_OWNERS @@ -0,0 +1,38 @@ +adamk@chromium.org +ahaas@chromium.org +bbudge@chromium.org +binji@chromium.org +bmeurer@chromium.org +cbruni@chromium.org +clemensh@chromium.org +danno@chromium.org +delphick@chromium.org +gdeepti@chromium.org +gsathya@chromium.org +hablich@chromium.org +hpayer@chromium.org +ishell@chromium.org +jarin@chromium.org +jgruber@chromium.org +jkummerow@chromium.org +leszeks@chromium.org +machenbach@chromium.org +mathias@chromium.org +marja@chromium.org +mlippautz@chromium.org +mslekova@chromium.org +mstarzinger@chromium.org +mvstanton@chromium.org +mythria@chromium.org +neis@chromium.org +petermarshall@chromium.org +rmcilroy@chromium.org +sergiyb@chromium.org +sigurds@chromium.org +solanes@chromium.org +szuend@chromium.org +tebbi@chromium.org +titzer@chromium.org +ulan@chromium.org +verwaest@chromium.org +yangguo@chromium.org diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index 6d315e6a9efdb5..c21ac1176032d5 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,1523 @@ +2019-05-28: Version 7.6.303 + + Performance and stability improvements on all platforms. + + +2019-05-28: Version 7.6.302 + + Performance and stability improvements on all platforms. + + +2019-05-28: Version 7.6.301 + + Performance and stability improvements on all platforms. + + +2019-05-28: Version 7.6.300 + + Performance and stability improvements on all platforms. + + +2019-05-28: Version 7.6.299 + + Performance and stability improvements on all platforms. + + +2019-05-28: Version 7.6.298 + + Performance and stability improvements on all platforms. + + +2019-05-28: Version 7.6.297 + + Performance and stability improvements on all platforms. + + +2019-05-28: Version 7.6.296 + + Performance and stability improvements on all platforms. + + +2019-05-28: Version 7.6.295 + + Performance and stability improvements on all platforms. + + +2019-05-28: Version 7.6.294 + + Performance and stability improvements on all platforms. + + +2019-05-28: Version 7.6.293 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.292 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.291 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.290 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.289 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.288 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.287 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.286 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.285 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.284 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.283 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.282 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.281 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.280 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.279 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.278 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.277 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.276 + + Performance and stability improvements on all platforms. + + +2019-05-27: Version 7.6.275 + + Performance and stability improvements on all platforms. + + +2019-05-24: Version 7.6.274 + + Performance and stability improvements on all platforms. + + +2019-05-24: Version 7.6.273 + + Performance and stability improvements on all platforms. + + +2019-05-24: Version 7.6.272 + + Performance and stability improvements on all platforms. + + +2019-05-24: Version 7.6.271 + + Performance and stability improvements on all platforms. + + +2019-05-24: Version 7.6.270 + + Performance and stability improvements on all platforms. + + +2019-05-24: Version 7.6.269 + + Performance and stability improvements on all platforms. + + +2019-05-24: Version 7.6.268 + + Performance and stability improvements on all platforms. + + +2019-05-23: Version 7.6.267 + + Performance and stability improvements on all platforms. + + +2019-05-23: Version 7.6.266 + + Performance and stability improvements on all platforms. + + +2019-05-23: Version 7.6.265 + + Performance and stability improvements on all platforms. + + +2019-05-23: Version 7.6.264 + + Performance and stability improvements on all platforms. + + +2019-05-23: Version 7.6.263 + + Performance and stability improvements on all platforms. + + +2019-05-23: Version 7.6.262 + + Performance and stability improvements on all platforms. + + +2019-05-23: Version 7.6.261 + + Performance and stability improvements on all platforms. + + +2019-05-22: Version 7.6.260 + + Performance and stability improvements on all platforms. + + +2019-05-22: Version 7.6.259 + + Performance and stability improvements on all platforms. + + +2019-05-22: Version 7.6.258 + + Performance and stability improvements on all platforms. + + +2019-05-22: Version 7.6.257 + + Performance and stability improvements on all platforms. + + +2019-05-22: Version 7.6.256 + + Performance and stability improvements on all platforms. + + +2019-05-22: Version 7.6.255 + + Performance and stability improvements on all platforms. + + +2019-05-22: Version 7.6.254 + + Performance and stability improvements on all platforms. + + +2019-05-22: Version 7.6.253 + + Performance and stability improvements on all platforms. + + +2019-05-22: Version 7.6.252 + + Performance and stability improvements on all platforms. + + +2019-05-22: Version 7.6.251 + + Performance and stability improvements on all platforms. + + +2019-05-22: Version 7.6.250 + + Performance and stability improvements on all platforms. + + +2019-05-22: Version 7.6.249 + + Performance and stability improvements on all platforms. + + +2019-05-22: Version 7.6.248 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.247 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.246 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.245 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.244 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.243 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.242 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.241 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.240 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.239 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.238 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.237 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.236 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.235 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.234 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.233 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.232 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.231 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.230 + + Performance and stability improvements on all platforms. + + +2019-05-21: Version 7.6.229 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.228 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.227 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.226 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.225 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.224 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.223 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.222 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.221 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.220 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.219 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.218 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.217 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.216 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.215 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.214 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.213 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.212 + + Performance and stability improvements on all platforms. + + +2019-05-20: Version 7.6.211 + + Performance and stability improvements on all platforms. + + +2019-05-17: Version 7.6.210 + + Performance and stability improvements on all platforms. + + +2019-05-17: Version 7.6.209 + + Performance and stability improvements on all platforms. + + +2019-05-17: Version 7.6.208 + + Performance and stability improvements on all platforms. + + +2019-05-17: Version 7.6.207 + + Performance and stability improvements on all platforms. + + +2019-05-17: Version 7.6.206 + + Performance and stability improvements on all platforms. + + +2019-05-17: Version 7.6.205 + + Performance and stability improvements on all platforms. + + +2019-05-16: Version 7.6.204 + + Performance and stability improvements on all platforms. + + +2019-05-16: Version 7.6.203 + + Performance and stability improvements on all platforms. + + +2019-05-16: Version 7.6.202 + + Performance and stability improvements on all platforms. + + +2019-05-16: Version 7.6.201 + + Performance and stability improvements on all platforms. + + +2019-05-16: Version 7.6.200 + + Performance and stability improvements on all platforms. + + +2019-05-16: Version 7.6.199 + + Performance and stability improvements on all platforms. + + +2019-05-16: Version 7.6.198 + + Performance and stability improvements on all platforms. + + +2019-05-16: Version 7.6.197 + + Performance and stability improvements on all platforms. + + +2019-05-16: Version 7.6.196 + + Performance and stability improvements on all platforms. + + +2019-05-15: Version 7.6.195 + + Performance and stability improvements on all platforms. + + +2019-05-15: Version 7.6.194 + + Performance and stability improvements on all platforms. + + +2019-05-15: Version 7.6.193 + + Performance and stability improvements on all platforms. + + +2019-05-15: Version 7.6.192 + + Performance and stability improvements on all platforms. + + +2019-05-15: Version 7.6.191 + + Performance and stability improvements on all platforms. + + +2019-05-15: Version 7.6.190 + + Performance and stability improvements on all platforms. + + +2019-05-15: Version 7.6.189 + + Performance and stability improvements on all platforms. + + +2019-05-15: Version 7.6.188 + + Performance and stability improvements on all platforms. + + +2019-05-15: Version 7.6.187 + + Performance and stability improvements on all platforms. + + +2019-05-15: Version 7.6.186 + + Performance and stability improvements on all platforms. + + +2019-05-15: Version 7.6.185 + + Performance and stability improvements on all platforms. + + +2019-05-14: Version 7.6.184 + + Performance and stability improvements on all platforms. + + +2019-05-14: Version 7.6.183 + + Performance and stability improvements on all platforms. + + +2019-05-14: Version 7.6.182 + + Performance and stability improvements on all platforms. + + +2019-05-14: Version 7.6.181 + + Performance and stability improvements on all platforms. + + +2019-05-14: Version 7.6.180 + + Performance and stability improvements on all platforms. + + +2019-05-14: Version 7.6.179 + + Performance and stability improvements on all platforms. + + +2019-05-14: Version 7.6.178 + + Performance and stability improvements on all platforms. + + +2019-05-14: Version 7.6.177 + + Performance and stability improvements on all platforms. + + +2019-05-14: Version 7.6.176 + + Performance and stability improvements on all platforms. + + +2019-05-14: Version 7.6.175 + + Performance and stability improvements on all platforms. + + +2019-05-14: Version 7.6.174 + + Performance and stability improvements on all platforms. + + +2019-05-14: Version 7.6.173 + + Performance and stability improvements on all platforms. + + +2019-05-14: Version 7.6.172 + + Performance and stability improvements on all platforms. + + +2019-05-13: Version 7.6.171 + + Performance and stability improvements on all platforms. + + +2019-05-13: Version 7.6.170 + + Performance and stability improvements on all platforms. + + +2019-05-13: Version 7.6.169 + + Performance and stability improvements on all platforms. + + +2019-05-13: Version 7.6.168 + + Performance and stability improvements on all platforms. + + +2019-05-13: Version 7.6.167 + + Performance and stability improvements on all platforms. + + +2019-05-13: Version 7.6.166 + + Performance and stability improvements on all platforms. + + +2019-05-13: Version 7.6.165 + + Performance and stability improvements on all platforms. + + +2019-05-13: Version 7.6.164 + + Performance and stability improvements on all platforms. + + +2019-05-13: Version 7.6.163 + + Performance and stability improvements on all platforms. + + +2019-05-13: Version 7.6.162 + + Performance and stability improvements on all platforms. + + +2019-05-13: Version 7.6.161 + + Performance and stability improvements on all platforms. + + +2019-05-10: Version 7.6.160 + + Performance and stability improvements on all platforms. + + +2019-05-10: Version 7.6.159 + + Performance and stability improvements on all platforms. + + +2019-05-10: Version 7.6.158 + + Performance and stability improvements on all platforms. + + +2019-05-10: Version 7.6.157 + + Performance and stability improvements on all platforms. + + +2019-05-10: Version 7.6.156 + + Performance and stability improvements on all platforms. + + +2019-05-10: Version 7.6.155 + + Performance and stability improvements on all platforms. + + +2019-05-10: Version 7.6.154 + + Performance and stability improvements on all platforms. + + +2019-05-10: Version 7.6.153 + + Performance and stability improvements on all platforms. + + +2019-05-10: Version 7.6.152 + + Performance and stability improvements on all platforms. + + +2019-05-10: Version 7.6.151 + + Performance and stability improvements on all platforms. + + +2019-05-10: Version 7.6.150 + + Performance and stability improvements on all platforms. + + +2019-05-10: Version 7.6.149 + + Performance and stability improvements on all platforms. + + +2019-05-10: Version 7.6.148 + + Performance and stability improvements on all platforms. + + +2019-05-10: Version 7.6.147 + + Performance and stability improvements on all platforms. + + +2019-05-10: Version 7.6.146 + + Performance and stability improvements on all platforms. + + +2019-05-10: Version 7.6.145 + + Performance and stability improvements on all platforms. + + +2019-05-09: Version 7.6.144 + + Performance and stability improvements on all platforms. + + +2019-05-09: Version 7.6.143 + + Performance and stability improvements on all platforms. + + +2019-05-09: Version 7.6.142 + + Performance and stability improvements on all platforms. + + +2019-05-09: Version 7.6.141 + + Performance and stability improvements on all platforms. + + +2019-05-09: Version 7.6.140 + + Performance and stability improvements on all platforms. + + +2019-05-09: Version 7.6.139 + + Performance and stability improvements on all platforms. + + +2019-05-09: Version 7.6.138 + + Performance and stability improvements on all platforms. + + +2019-05-09: Version 7.6.137 + + Performance and stability improvements on all platforms. + + +2019-05-09: Version 7.6.136 + + Performance and stability improvements on all platforms. + + +2019-05-09: Version 7.6.135 + + Performance and stability improvements on all platforms. + + +2019-05-09: Version 7.6.134 + + Performance and stability improvements on all platforms. + + +2019-05-08: Version 7.6.133 + + Performance and stability improvements on all platforms. + + +2019-05-08: Version 7.6.132 + + Performance and stability improvements on all platforms. + + +2019-05-08: Version 7.6.131 + + Performance and stability improvements on all platforms. + + +2019-05-08: Version 7.6.130 + + Performance and stability improvements on all platforms. + + +2019-05-08: Version 7.6.129 + + Performance and stability improvements on all platforms. + + +2019-05-08: Version 7.6.128 + + Performance and stability improvements on all platforms. + + +2019-05-08: Version 7.6.127 + + Performance and stability improvements on all platforms. + + +2019-05-08: Version 7.6.126 + + Performance and stability improvements on all platforms. + + +2019-05-08: Version 7.6.125 + + Performance and stability improvements on all platforms. + + +2019-05-08: Version 7.6.124 + + Performance and stability improvements on all platforms. + + +2019-05-08: Version 7.6.123 + + Performance and stability improvements on all platforms. + + +2019-05-08: Version 7.6.122 + + Performance and stability improvements on all platforms. + + +2019-05-08: Version 7.6.121 + + Performance and stability improvements on all platforms. + + +2019-05-08: Version 7.6.120 + + Performance and stability improvements on all platforms. + + +2019-05-08: Version 7.6.119 + + Performance and stability improvements on all platforms. + + +2019-05-07: Version 7.6.118 + + Performance and stability improvements on all platforms. + + +2019-05-07: Version 7.6.117 + + Performance and stability improvements on all platforms. + + +2019-05-07: Version 7.6.116 + + Performance and stability improvements on all platforms. + + +2019-05-07: Version 7.6.115 + + Performance and stability improvements on all platforms. + + +2019-05-07: Version 7.6.114 + + Performance and stability improvements on all platforms. + + +2019-05-07: Version 7.6.113 + + Performance and stability improvements on all platforms. + + +2019-05-07: Version 7.6.112 + + Performance and stability improvements on all platforms. + + +2019-05-07: Version 7.6.111 + + Performance and stability improvements on all platforms. + + +2019-05-07: Version 7.6.110 + + Performance and stability improvements on all platforms. + + +2019-05-07: Version 7.6.109 + + Performance and stability improvements on all platforms. + + +2019-05-06: Version 7.6.108 + + Performance and stability improvements on all platforms. + + +2019-05-06: Version 7.6.107 + + Performance and stability improvements on all platforms. + + +2019-05-06: Version 7.6.106 + + Performance and stability improvements on all platforms. + + +2019-05-06: Version 7.6.105 + + Performance and stability improvements on all platforms. + + +2019-05-06: Version 7.6.104 + + Performance and stability improvements on all platforms. + + +2019-05-06: Version 7.6.103 + + Performance and stability improvements on all platforms. + + +2019-05-06: Version 7.6.102 + + Performance and stability improvements on all platforms. + + +2019-05-06: Version 7.6.101 + + Performance and stability improvements on all platforms. + + +2019-05-06: Version 7.6.100 + + Performance and stability improvements on all platforms. + + +2019-05-06: Version 7.6.99 + + Performance and stability improvements on all platforms. + + +2019-05-04: Version 7.6.98 + + Performance and stability improvements on all platforms. + + +2019-05-04: Version 7.6.97 + + Performance and stability improvements on all platforms. + + +2019-05-03: Version 7.6.96 + + Performance and stability improvements on all platforms. + + +2019-05-03: Version 7.6.95 + + Performance and stability improvements on all platforms. + + +2019-05-03: Version 7.6.94 + + Performance and stability improvements on all platforms. + + +2019-05-03: Version 7.6.93 + + Performance and stability improvements on all platforms. + + +2019-05-03: Version 7.6.92 + + Performance and stability improvements on all platforms. + + +2019-05-03: Version 7.6.91 + + Performance and stability improvements on all platforms. + + +2019-05-03: Version 7.6.90 + + Performance and stability improvements on all platforms. + + +2019-05-02: Version 7.6.89 + + Performance and stability improvements on all platforms. + + +2019-05-02: Version 7.6.88 + + Performance and stability improvements on all platforms. + + +2019-05-02: Version 7.6.87 + + Performance and stability improvements on all platforms. + + +2019-05-02: Version 7.6.86 + + Performance and stability improvements on all platforms. + + +2019-05-02: Version 7.6.85 + + Performance and stability improvements on all platforms. + + +2019-05-02: Version 7.6.84 + + Performance and stability improvements on all platforms. + + +2019-05-02: Version 7.6.83 + + Performance and stability improvements on all platforms. + + +2019-05-01: Version 7.6.82 + + Performance and stability improvements on all platforms. + + +2019-05-01: Version 7.6.81 + + Performance and stability improvements on all platforms. + + +2019-05-01: Version 7.6.80 + + Performance and stability improvements on all platforms. + + +2019-05-01: Version 7.6.79 + + Performance and stability improvements on all platforms. + + +2019-04-30: Version 7.6.78 + + Performance and stability improvements on all platforms. + + +2019-04-30: Version 7.6.77 + + Performance and stability improvements on all platforms. + + +2019-04-30: Version 7.6.76 + + Performance and stability improvements on all platforms. + + +2019-04-30: Version 7.6.75 + + Performance and stability improvements on all platforms. + + +2019-04-30: Version 7.6.74 + + Performance and stability improvements on all platforms. + + +2019-04-30: Version 7.6.73 + + Performance and stability improvements on all platforms. + + +2019-04-30: Version 7.6.72 + + Performance and stability improvements on all platforms. + + +2019-04-30: Version 7.6.71 + + Performance and stability improvements on all platforms. + + +2019-04-30: Version 7.6.70 + + Performance and stability improvements on all platforms. + + +2019-04-30: Version 7.6.69 + + Performance and stability improvements on all platforms. + + +2019-04-29: Version 7.6.68 + + Performance and stability improvements on all platforms. + + +2019-04-29: Version 7.6.67 + + Performance and stability improvements on all platforms. + + +2019-04-29: Version 7.6.66 + + Performance and stability improvements on all platforms. + + +2019-04-29: Version 7.6.65 + + Performance and stability improvements on all platforms. + + +2019-04-29: Version 7.6.64 + + Performance and stability improvements on all platforms. + + +2019-04-29: Version 7.6.63 + + Performance and stability improvements on all platforms. + + +2019-04-29: Version 7.6.62 + + Performance and stability improvements on all platforms. + + +2019-04-29: Version 7.6.61 + + Performance and stability improvements on all platforms. + + +2019-04-29: Version 7.6.60 + + Performance and stability improvements on all platforms. + + +2019-04-29: Version 7.6.59 + + Performance and stability improvements on all platforms. + + +2019-04-29: Version 7.6.58 + + Performance and stability improvements on all platforms. + + +2019-04-29: Version 7.6.57 + + Performance and stability improvements on all platforms. + + +2019-04-29: Version 7.6.56 + + Performance and stability improvements on all platforms. + + +2019-04-29: Version 7.6.55 + + Performance and stability improvements on all platforms. + + +2019-04-28: Version 7.6.54 + + Performance and stability improvements on all platforms. + + +2019-04-27: Version 7.6.53 + + Performance and stability improvements on all platforms. + + +2019-04-27: Version 7.6.52 + + Performance and stability improvements on all platforms. + + +2019-04-26: Version 7.6.51 + + Performance and stability improvements on all platforms. + + +2019-04-26: Version 7.6.50 + + Performance and stability improvements on all platforms. + + +2019-04-26: Version 7.6.49 + + Performance and stability improvements on all platforms. + + +2019-04-26: Version 7.6.48 + + Performance and stability improvements on all platforms. + + +2019-04-26: Version 7.6.47 + + Performance and stability improvements on all platforms. + + +2019-04-26: Version 7.6.46 + + Performance and stability improvements on all platforms. + + +2019-04-26: Version 7.6.45 + + Performance and stability improvements on all platforms. + + +2019-04-26: Version 7.6.44 + + Performance and stability improvements on all platforms. + + +2019-04-26: Version 7.6.43 + + Performance and stability improvements on all platforms. + + +2019-04-26: Version 7.6.42 + + Performance and stability improvements on all platforms. + + +2019-04-26: Version 7.6.41 + + Performance and stability improvements on all platforms. + + +2019-04-26: Version 7.6.40 + + Performance and stability improvements on all platforms. + + +2019-04-25: Version 7.6.39 + + Performance and stability improvements on all platforms. + + +2019-04-25: Version 7.6.38 + + Performance and stability improvements on all platforms. + + +2019-04-25: Version 7.6.37 + + Performance and stability improvements on all platforms. + + +2019-04-25: Version 7.6.36 + + Performance and stability improvements on all platforms. + + +2019-04-25: Version 7.6.35 + + Performance and stability improvements on all platforms. + + +2019-04-25: Version 7.6.34 + + Performance and stability improvements on all platforms. + + +2019-04-25: Version 7.6.33 + + Performance and stability improvements on all platforms. + + +2019-04-25: Version 7.6.32 + + Performance and stability improvements on all platforms. + + +2019-04-25: Version 7.6.31 + + Performance and stability improvements on all platforms. + + +2019-04-25: Version 7.6.30 + + Performance and stability improvements on all platforms. + + +2019-04-25: Version 7.6.29 + + Performance and stability improvements on all platforms. + + +2019-04-24: Version 7.6.28 + + Performance and stability improvements on all platforms. + + +2019-04-24: Version 7.6.27 + + Performance and stability improvements on all platforms. + + +2019-04-24: Version 7.6.26 + + Performance and stability improvements on all platforms. + + +2019-04-24: Version 7.6.25 + + Performance and stability improvements on all platforms. + + +2019-04-24: Version 7.6.24 + + Performance and stability improvements on all platforms. + + +2019-04-24: Version 7.6.23 + + Performance and stability improvements on all platforms. + + +2019-04-24: Version 7.6.22 + + Performance and stability improvements on all platforms. + + +2019-04-24: Version 7.6.21 + + Performance and stability improvements on all platforms. + + +2019-04-24: Version 7.6.20 + + Performance and stability improvements on all platforms. + + +2019-04-24: Version 7.6.19 + + Performance and stability improvements on all platforms. + + +2019-04-24: Version 7.6.18 + + Performance and stability improvements on all platforms. + + +2019-04-24: Version 7.6.17 + + Performance and stability improvements on all platforms. + + +2019-04-24: Version 7.6.16 + + Performance and stability improvements on all platforms. + + +2019-04-24: Version 7.6.15 + + Performance and stability improvements on all platforms. + + +2019-04-24: Version 7.6.14 + + Performance and stability improvements on all platforms. + + +2019-04-24: Version 7.6.13 + + Performance and stability improvements on all platforms. + + +2019-04-23: Version 7.6.12 + + Performance and stability improvements on all platforms. + + +2019-04-23: Version 7.6.11 + + Performance and stability improvements on all platforms. + + +2019-04-23: Version 7.6.10 + + Performance and stability improvements on all platforms. + + +2019-04-23: Version 7.6.9 + + Performance and stability improvements on all platforms. + + +2019-04-23: Version 7.6.8 + + Performance and stability improvements on all platforms. + + +2019-04-23: Version 7.6.7 + + Performance and stability improvements on all platforms. + + +2019-04-23: Version 7.6.6 + + Performance and stability improvements on all platforms. + + +2019-04-23: Version 7.6.5 + + Performance and stability improvements on all platforms. + + +2019-04-23: Version 7.6.4 + + Performance and stability improvements on all platforms. + + +2019-04-23: Version 7.6.3 + + Performance and stability improvements on all platforms. + + +2019-04-23: Version 7.6.2 + + Performance and stability improvements on all platforms. + + +2019-04-19: Version 7.6.1 + + Performance and stability improvements on all platforms. + + +2019-04-17: Version 7.5.289 + + Performance and stability improvements on all platforms. + + 2019-04-17: Version 7.5.288 Performance and stability improvements on all platforms. diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 450bfd7862403e..bca59b724f292a 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -12,7 +12,7 @@ vars = { 'check_v8_header_includes': False, # GN CIPD package version. - 'gn_version': 'git_revision:64b846c96daeb3eaf08e26d8a84d8451c6cb712b', + 'gn_version': 'git_revision:81ee1967d3fcbc829bac1c005c3da59739c88df9', # luci-go CIPD package version. 'luci_go': 'git_revision:25958d48e89e980e2a97daeddc977fb5e2e1fb8c', @@ -57,15 +57,15 @@ vars = { deps = { 'v8/build': - Var('chromium_url') + '/chromium/src/build.git' + '@' + 'a0b2e3b2708bcf81ec00ac1738b586bcc5e04eea', + Var('chromium_url') + '/chromium/src/build.git' + '@' + '4cebfa34c79bcfbce6a3f55d1b4f7628bb70ea8a', 'v8/third_party/depot_tools': - Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '7e7523be4e21b0841ae815ef37521a5476f68549', + Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '26af0d34d281440ad0dc6d2e43fe60f32ef62da0', 'v8/third_party/icu': - Var('chromium_url') + '/chromium/deps/icu.git' + '@' + '35f7e139f33f1ddbfdb68b65dda29aff430c3f6f', + Var('chromium_url') + '/chromium/deps/icu.git' + '@' + '64e5d7d43a1ff205e3787ab6150bbc1a1837332b', 'v8/third_party/instrumented_libraries': Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + 'a959e4f0cb643003f2d75d179cede449979e3e77', 'v8/buildtools': - Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + 'd5c58b84d50d256968271db459cd29b22bff1ba2', + Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '0218c0f9ac9fdba00e5c27b5aca94d3a64c74f34', 'v8/buildtools/clang_format/script': Var('chromium_url') + '/chromium/llvm-project/cfe/tools/clang-format.git' + '@' + '96636aa0e9f047f17447f2d45a094d0b59ed7917', 'v8/buildtools/linux64': { @@ -89,7 +89,7 @@ deps = { 'condition': 'host_os == "mac"', }, 'v8/buildtools/third_party/libc++/trunk': - Var('chromium_url') + '/chromium/llvm-project/libcxx.git' + '@' + '9b96c3dbd4e89c10d9fd8364da4b65f93c6f4276', + Var('chromium_url') + '/chromium/llvm-project/libcxx.git' + '@' + '5938e0582bac570a41edb3d6a2217c299adc1bc6', 'v8/buildtools/third_party/libc++abi/trunk': Var('chromium_url') + '/chromium/llvm-project/libcxxabi.git' + '@' + '0d529660e32d77d9111912d73f2c74fc5fa2a858', 'v8/buildtools/third_party/libunwind/trunk': @@ -105,7 +105,7 @@ deps = { 'condition': 'host_os == "win"', }, 'v8/base/trace_event/common': - Var('chromium_url') + '/chromium/src/base/trace_event/common.git' + '@' + 'ebb658ab38d1b23183458ed0430f5b11853a25a3', + Var('chromium_url') + '/chromium/src/base/trace_event/common.git' + '@' + 'cfe8887fa6ac3170e23a68949930e28d4705a16f', 'v8/third_party/android_ndk': { 'url': Var('chromium_url') + '/android_ndk.git' + '@' + '4e2cea441bfd43f0863d14f57b1e1844260b9884', 'condition': 'checkout_android', @@ -158,7 +158,7 @@ deps = { 'dep_type': 'cipd', }, 'v8/third_party/catapult': { - 'url': Var('chromium_url') + '/catapult.git' + '@' + 'acbf095c15e9524a0a1116792c3b6698f8e9b85b', + 'url': Var('chromium_url') + '/catapult.git' + '@' + 'a7b33124672f301cebe0ca94a67ca7d0362e3d6a', 'condition': 'checkout_android', }, 'v8/third_party/colorama/src': { @@ -166,25 +166,25 @@ deps = { 'condition': 'checkout_android', }, 'v8/third_party/fuchsia-sdk': { - 'url': Var('chromium_url') + '/chromium/src/third_party/fuchsia-sdk.git' + '@' + 'a42c2f604f3ae23099e73605df7864988d289d98', + 'url': Var('chromium_url') + '/chromium/src/third_party/fuchsia-sdk.git' + '@' + 'ae68779f84fc36bd88ba4fe0ff78ed9ea3c91d73', 'condition': 'checkout_fuchsia', }, 'v8/third_party/googletest/src': - Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + 'b617b277186e03b1065ac6d43912b1c4147c2982', + Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + 'f71fb4f9a912ec945401cc49a287a759b6131026', 'v8/third_party/jinja2': Var('chromium_url') + '/chromium/src/third_party/jinja2.git' + '@' + 'b41863e42637544c2941b574c7877d3e1f663e25', 'v8/third_party/markupsafe': Var('chromium_url') + '/chromium/src/third_party/markupsafe.git' + '@' + '8f45f5cfa0009d2a70589bcda0349b8cb2b72783', 'v8/tools/swarming_client': - Var('chromium_url') + '/infra/luci/client-py.git' + '@' + 'aa60736aded9fc32a0e21a81f5fc51f6009d01f3', + Var('chromium_url') + '/infra/luci/client-py.git' + '@' + '779c4f0f8488c64587b75dbb001d18c3c0c4cda9', 'v8/test/benchmarks/data': Var('chromium_url') + '/v8/deps/third_party/benchmarks.git' + '@' + '05d7188267b4560491ff9155c5ee13e207ecd65f', 'v8/test/mozilla/data': Var('chromium_url') + '/v8/deps/third_party/mozilla-tests.git' + '@' + 'f6c578a10ea707b1a8ab0b88943fe5115ce2b9be', 'v8/test/test262/data': - Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + '8e5ab69e8c31135265cba570d54d41f6ade19e45', + Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + 'a9abd418ccc7999b00b8c7df60b25620a7d3c541', 'v8/test/test262/harness': - Var('chromium_url') + '/external/github.com/test262-utils/test262-harness-py.git' + '@' + '9bd99c6f33be10561970bfe16f2f16a8a3d88722', + Var('chromium_url') + '/external/github.com/test262-utils/test262-harness-py.git' + '@' + '4555345a943d0c99a9461182705543fb171dda4b', 'v8/third_party/qemu-linux-x64': { 'packages': [ { @@ -206,7 +206,7 @@ deps = { 'dep_type': 'cipd', }, 'v8/tools/clang': - Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'edee5c0b3641ab345cbe3cf29f1b1cdbd6819549', + Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'fe8ba88894e4b3927d3cd9e24274a0f1a688cf71', 'v8/tools/luci-go': { 'packages': [ { @@ -236,9 +236,9 @@ deps = { 'dep_type': 'cipd', }, 'v8/test/wasm-js/data': - Var('chromium_url') + '/external/github.com/WebAssembly/spec.git' + '@' + 'd14d538e5fccdc03a02948963addad10ad45b50d', + Var('chromium_url') + '/external/github.com/WebAssembly/spec.git' + '@' + 'bc7d3006bbda0de5031c2a1b9266a62fa7895019', 'v8/third_party/perfetto': - Var('android_url') + '/platform/external/perfetto.git' + '@' + '21a33afeef568f72668acf77668a32307a363d6e', + Var('android_url') + '/platform/external/perfetto.git' + '@' + '10c98fe0cfae669f71610d97e9da94260a6da173', 'v8/third_party/protobuf': Var('chromium_url') + '/external/github.com/google/protobuf'+ '@' + 'b68a347f56137b4b1a746e8c7438495a6ac1bd91', } diff --git a/deps/v8/ENG_REVIEW_OWNERS b/deps/v8/ENG_REVIEW_OWNERS new file mode 100644 index 00000000000000..6b189307ad763d --- /dev/null +++ b/deps/v8/ENG_REVIEW_OWNERS @@ -0,0 +1,9 @@ +# Eng reviewers. This is to define an escalation path for potential +# disagreement among owners. Please consult before adding top-level +# directories. + +adamk@chromium.org +danno@chromium.org +hpayer@chromium.org +rmcilroy@chromium.org +yangguo@chromium.org diff --git a/deps/v8/INFRA_OWNERS b/deps/v8/INFRA_OWNERS new file mode 100644 index 00000000000000..4b847b21f7a9a3 --- /dev/null +++ b/deps/v8/INFRA_OWNERS @@ -0,0 +1,3 @@ +machenbach@chromium.org +sergiyb@chromium.org +tmrts@chromium.org diff --git a/deps/v8/src/builtins/mips/OWNERS b/deps/v8/MIPS_OWNERS similarity index 100% rename from deps/v8/src/builtins/mips/OWNERS rename to deps/v8/MIPS_OWNERS diff --git a/deps/v8/OWNERS b/deps/v8/OWNERS index b2161c06ca6a2c..c428ba6d0bbd7b 100644 --- a/deps/v8/OWNERS +++ b/deps/v8/OWNERS @@ -1,42 +1,31 @@ -adamk@chromium.org -ahaas@chromium.org -aseemgarg@chromium.org -bbudge@chromium.org -binji@chromium.org -bmeurer@chromium.org -cbruni@chromium.org -clemensh@chromium.org -danno@chromium.org -delphick@chromium.org -gdeepti@chromium.org -gsathya@chromium.org -hablich@chromium.org -herhut@chromium.org -hpayer@chromium.org -ishell@chromium.org -jarin@chromium.org -jgruber@chromium.org -jkummerow@chromium.org -leszeks@chromium.org -machenbach@chromium.org -mathias@chromium.org -marja@chromium.org -mlippautz@chromium.org -mslekova@chromium.org -mstarzinger@chromium.org -mvstanton@chromium.org -mythria@chromium.org -neis@chromium.org -petermarshall@chromium.org -rmcilroy@chromium.org -sergiyb@chromium.org -sigurds@chromium.org -szuend@chromium.org -tebbi@chromium.org -titzer@chromium.org -ulan@chromium.org -verwaest@chromium.org -yangguo@chromium.org +# Eng reviewer. Please reach out before adding new top-level directories. +# Disagreement among owners should be escalated to eng reviewers. +file://ENG_REVIEW_OWNERS + +# TODO(9247) remove this. +file://COMMON_OWNERS + +per-file .clang-format=file://INFRA_OWNERS +per-file .clang-tidy=file://INFRA_OWNERS +per-file .editorconfig=file://INFRA_OWNERS +per-file .git-blame-ignore-revs=file://INFRA_OWNERS +per-file .gitattributes=file://INFRA_OWNERS +per-file .gitignore=file://INFRA_OWNERS +per-file .gn=file://INFRA_OWNERS +per-file .vpython=file://INFRA_OWNERS +per-file .ycm_extra_conf.py=file://INFRA_OWNERS +per-file BUILD.gn=file://INFRA_OWNERS +per-file DEPS=file://INFRA_OWNERS +per-file PRESUBMIT=file://INFRA_OWNERS +per-file codereview.settings=file://INFRA_OWNERS + +per-file AUTHORS=file://COMMON_OWNERS +per-file WATCHLIST=file://COMMON_OWNERS + +per-file *-mips*=file://MIPS_OWNERS +per-file *-mips64*=file://MIPS_OWNERS +per-file *-ppc*=file://PPC_OWNERS +per-file *-s390*=file://S390_OWNERS # TEAM: v8-dev@googlegroups.com # COMPONENT: Blink>JavaScript diff --git a/deps/v8/src/builtins/ppc/OWNERS b/deps/v8/PPC_OWNERS similarity index 100% rename from deps/v8/src/builtins/ppc/OWNERS rename to deps/v8/PPC_OWNERS diff --git a/deps/v8/PRESUBMIT.py b/deps/v8/PRESUBMIT.py index 8aea920ef4834b..201bf55f714b5a 100644 --- a/deps/v8/PRESUBMIT.py +++ b/deps/v8/PRESUBMIT.py @@ -433,6 +433,8 @@ def TouchesMacros(f): undef_match = undef_pattern.match(line) if undef_match: + if "// NOLINT" in line: + continue name = undef_match.group(1) if not name in defined_macros: errors.append('{}:{}: Macro named \'{}\' was not defined before.' diff --git a/deps/v8/src/builtins/s390/OWNERS b/deps/v8/S390_OWNERS similarity index 100% rename from deps/v8/src/builtins/s390/OWNERS rename to deps/v8/S390_OWNERS diff --git a/deps/v8/base/trace_event/common/trace_event_common.h b/deps/v8/base/trace_event/common/trace_event_common.h index f9b9ad3b014063..f1878a18da91c6 100644 --- a/deps/v8/base/trace_event/common/trace_event_common.h +++ b/deps/v8/base/trace_event/common/trace_event_common.h @@ -420,6 +420,9 @@ INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \ TRACE_EVENT_FLAG_NONE, "value", \ static_cast(value)) +#define TRACE_COUNTER_WITH_FLAG1(category_group, name, flag, value) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \ + flag, "value", static_cast(value)) #define TRACE_COPY_COUNTER1(category_group, name, value) \ INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \ TRACE_EVENT_FLAG_COPY, "value", \ @@ -1069,7 +1072,6 @@ #define TRACE_EVENT_FLAG_HAS_PROCESS_ID (static_cast(1 << 11)) #define TRACE_EVENT_FLAG_HAS_LOCAL_ID (static_cast(1 << 12)) #define TRACE_EVENT_FLAG_HAS_GLOBAL_ID (static_cast(1 << 13)) -#define TRACE_EVENT_FLAG_DISALLOW_POSTTASK (static_cast(1 << 14)) // TODO(eseckler): Remove once we have native support for typed proto events in // TRACE_EVENT macros. #define TRACE_EVENT_FLAG_TYPED_PROTO_ARGS (static_cast(1 << 15)) diff --git a/deps/v8/benchmarks/micro/slice-perf.js b/deps/v8/benchmarks/micro/slice-perf.js deleted file mode 100644 index 300d2126666fd8..00000000000000 --- a/deps/v8/benchmarks/micro/slice-perf.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -const kIterations = 1000000; -const kIterationShort = 10000; -const kArraySize = 64; - -let smi_array = []; -for (let i = 0; i < kArraySize; ++i) smi_array[i] = Math.floor(Math.random() * 100); - -let start = performance.now(); -for (let x = 0; x < kIterations; ++x) { - smi_array.slice(0); -} -let stop = performance.now(); -print("smi_array copy: " + (Math.floor((stop - start)*10)/10) + " ms"); - -start = performance.now(); -for (let x = 0; x < kIterations; ++x) { - smi_array.slice(x % kArraySize); -} -stop = performance.now(); -print("smi_array: " + (Math.floor((stop - start)*10)/10) + " ms"); - -let double_array = []; -for (let i = 0; i < kArraySize; ++i) double_array[i] = Math.random() * 100; -start = performance.now(); -for (let x = 0; x < kIterations; ++x) { - double_array.slice(x % kArraySize); -} -stop = performance.now(); -print("double_array: " + (Math.floor((stop - start)*10)/10) + " ms"); - -let object_array = []; -for (let i = 0; i < kArraySize; ++i) object_array[i] = new Object(); -start = performance.now(); -for (let x = 0; x < kIterations; ++x) { - object_array.slice(x % kArraySize); -} -stop = performance.now(); -print("object_array: " + (Math.floor((stop - start)*10)/10) + " ms"); - -let dictionary_array = []; -for (let i = 0; i < kArraySize; ++i) dictionary_array[i] = new Object(); -dictionary_array[100000] = new Object(); -start = performance.now(); -for (let x = 0; x < kIterationShort; ++x) { - dictionary_array.slice(x % kArraySize); -} -stop = performance.now(); -print("dictionary: " + (Math.floor((stop - start)*10)/10) + " ms"); - -let arguments_array; -function sloppy() { - arguments_array = arguments; -} -sloppy.apply(null, smi_array); -start = performance.now(); -for (let x = 0; x < kIterations; ++x) { - let r = Array.prototype.slice.call(arguments_array, x % kArraySize); -} -stop = performance.now(); -print("arguments_array (sloppy): " + (Math.floor((stop - start)*10)/10) + " ms"); - -function sloppy2 (a) { - arguments_array = arguments; -} -sloppy2.apply(null, smi_array); -start = performance.now(); -for (let x = 0; x < kIterations; ++x) { - Array.prototype.slice.call(arguments_array, x % kArraySize); -} -stop = performance.now(); -print("arguments_array (fast aliased): " + (Math.floor((stop - start)*10)/10) + " ms"); - -delete arguments_array[5]; -start = performance.now(); -for (let x = 0; x < kIterationShort; ++x) { - Array.prototype.slice.call(arguments_array, x % kArraySize); -} -stop = performance.now(); -print("arguments_array (slow aliased): " + (Math.floor((stop - start)*10)/10) + " ms"); diff --git a/deps/v8/build_overrides/OWNERS b/deps/v8/build_overrides/OWNERS new file mode 100644 index 00000000000000..bdb1d555a4fb98 --- /dev/null +++ b/deps/v8/build_overrides/OWNERS @@ -0,0 +1 @@ +file://INFRA_OWNERS diff --git a/deps/v8/custom_deps/OWNERS b/deps/v8/custom_deps/OWNERS index 76719caca0eccc..bdb1d555a4fb98 100644 --- a/deps/v8/custom_deps/OWNERS +++ b/deps/v8/custom_deps/OWNERS @@ -1,2 +1 @@ -machenbach@chromium.org -sergiyb@chromium.org \ No newline at end of file +file://INFRA_OWNERS diff --git a/deps/v8/docs/OWNERS b/deps/v8/docs/OWNERS new file mode 100644 index 00000000000000..39b706f0cc54e9 --- /dev/null +++ b/deps/v8/docs/OWNERS @@ -0,0 +1,2 @@ +hablich@chromium.org +mathias@chromium.org diff --git a/deps/v8/gni/OWNERS b/deps/v8/gni/OWNERS new file mode 100644 index 00000000000000..bdb1d555a4fb98 --- /dev/null +++ b/deps/v8/gni/OWNERS @@ -0,0 +1 @@ +file://INFRA_OWNERS diff --git a/deps/v8/gni/proto_library.gni b/deps/v8/gni/proto_library.gni index 6a00276289e1d2..cf581ed46e4dfe 100644 --- a/deps/v8/gni/proto_library.gni +++ b/deps/v8/gni/proto_library.gni @@ -13,6 +13,12 @@ template("proto_library") { set_sources_assignment_filter([]) + if (host_os == "win") { + host_executable_suffix = ".exe" + } else { + host_executable_suffix = "" + } + # All the proto imports should be relative to the project root. proto_in_dir = "//" if (defined(invoker.proto_in_dir)) { @@ -42,8 +48,9 @@ template("proto_library") { if (defined(invoker.generator_plugin_label)) { plugin_host_label = invoker.generator_plugin_label + "($host_toolchain)" - plugin_path = get_label_info(plugin_host_label, "root_out_dir") + "/" + - get_label_info(plugin_host_label, "name") + plugin_path = + get_label_info(plugin_host_label, "root_out_dir") + "/" + + get_label_info(plugin_host_label, "name") + host_executable_suffix generate_with_plugin = true } else if (defined(invoker.generator_plugin_script)) { plugin_path = invoker.generator_plugin_script @@ -107,7 +114,8 @@ template("proto_library") { outputs = get_path_info(protogens, "abspath") protoc_label = "//:protoc($host_toolchain)" - protoc_path = get_label_info(protoc_label, "root_out_dir") + "/protoc" + protoc_path = get_label_info(protoc_label, "root_out_dir") + "/protoc" + + host_executable_suffix args = [ # Path should be rebased because |root_build_dir| for current toolchain # may be different from |root_out_dir| of protoc built on host toolchain. diff --git a/deps/v8/snapshot_toolchain.gni b/deps/v8/gni/snapshot_toolchain.gni similarity index 100% rename from deps/v8/snapshot_toolchain.gni rename to deps/v8/gni/snapshot_toolchain.gni diff --git a/deps/v8/gni/v8.gni b/deps/v8/gni/v8.gni index 0a120df8e1a6fd..506b8428ee3217 100644 --- a/deps/v8/gni/v8.gni +++ b/deps/v8/gni/v8.gni @@ -63,6 +63,10 @@ declare_args() { # Expose symbols for dynamic linking. v8_expose_symbols = false + + # Use Perfetto (https://perfetto.dev) as the default TracingController. Not + # currently implemented. + v8_use_perfetto = false } if (v8_use_external_startup_data == "") { diff --git a/deps/v8/include/libplatform/v8-tracing.h b/deps/v8/include/libplatform/v8-tracing.h index bc249cb9ecc378..ccdca0a8c5cfc6 100644 --- a/deps/v8/include/libplatform/v8-tracing.h +++ b/deps/v8/include/libplatform/v8-tracing.h @@ -23,6 +23,9 @@ class Mutex; namespace platform { namespace tracing { +class PerfettoTracingController; +class TraceEventListener; + const int kTraceMaxNumArgs = 2; class V8_PLATFORM_EXPORT TraceObject { @@ -238,6 +241,14 @@ class V8_PLATFORM_EXPORT TracingController TracingController(); ~TracingController() override; void Initialize(TraceBuffer* trace_buffer); +#ifdef V8_USE_PERFETTO + // Must be called before StartTracing() if V8_USE_PERFETTO is true. Provides + // the output stream for the JSON trace data. + void InitializeForPerfetto(std::ostream* output_stream); + // Provide an optional listener for testing that will receive trace events. + // Must be called before StartTracing(). + void SetTraceEventListenerForTesting(TraceEventListener* listener); +#endif // v8::TracingController implementation. const uint8_t* GetCategoryGroupEnabled(const char* category_group) override; @@ -280,6 +291,13 @@ class V8_PLATFORM_EXPORT TracingController std::unique_ptr mutex_; std::unordered_set observers_; std::atomic_bool recording_{false}; +#ifdef V8_USE_PERFETTO + std::atomic_bool perfetto_recording_{false}; + std::unique_ptr perfetto_tracing_controller_; + std::ostream* output_stream_ = nullptr; + std::unique_ptr json_listener_; + TraceEventListener* listener_for_testing_ = nullptr; +#endif // Disallow copy and assign TracingController(const TracingController&) = delete; diff --git a/deps/v8/include/v8-inspector.h b/deps/v8/include/v8-inspector.h index 702013588cdb10..b96a6e29ac0cb6 100644 --- a/deps/v8/include/v8-inspector.h +++ b/deps/v8/include/v8-inspector.h @@ -87,7 +87,6 @@ class V8_EXPORT V8ContextInfo { static int executionContextId(v8::Local context); - private: // Disallow copying and allocating this one. enum NotNullTagEnum { NotNullLiteral }; void* operator new(size_t) = delete; @@ -131,7 +130,11 @@ class V8_EXPORT V8InspectorSession { // Dispatching protocol messages. static bool canDispatchMethod(const StringView& method); virtual void dispatchProtocolMessage(const StringView& message) = 0; - virtual std::unique_ptr stateJSON() = 0; + virtual V8_DEPRECATED("Use state() instead", + std::unique_ptr stateJSON()) { + return nullptr; + } + virtual std::vector state() = 0; virtual std::vector> supportedDomains() = 0; diff --git a/deps/v8/include/v8-internal.h b/deps/v8/include/v8-internal.h index 8e700a4d4d401b..fe2ce67e0df04e 100644 --- a/deps/v8/include/v8-internal.h +++ b/deps/v8/include/v8-internal.h @@ -48,28 +48,32 @@ const intptr_t kSmiTagMask = (1 << kSmiTagSize) - 1; template struct SmiTagging; +constexpr intptr_t kIntptrAllBitsSet = intptr_t{-1}; +constexpr uintptr_t kUintptrAllBitsSet = + static_cast(kIntptrAllBitsSet); + // Smi constants for systems where tagged pointer is a 32-bit value. template <> struct SmiTagging<4> { enum { kSmiShiftSize = 0, kSmiValueSize = 31 }; + + static constexpr intptr_t kSmiMinValue = + static_cast(kUintptrAllBitsSet << (kSmiValueSize - 1)); + static constexpr intptr_t kSmiMaxValue = -(kSmiMinValue + 1); + V8_INLINE static int SmiToInt(const internal::Address value) { int shift_bits = kSmiTagSize + kSmiShiftSize; // Shift down (requires >> to be sign extending). return static_cast(static_cast(value)) >> shift_bits; } V8_INLINE static constexpr bool IsValidSmi(intptr_t value) { - // To be representable as an tagged small integer, the two - // most-significant bits of 'value' must be either 00 or 11 due to - // sign-extension. To check this we add 01 to the two - // most-significant bits, and check if the most-significant bit is 0. - // - // CAUTION: The original code below: - // bool result = ((value + 0x40000000) & 0x80000000) == 0; - // may lead to incorrect results according to the C language spec, and - // in fact doesn't work correctly with gcc4.1.1 in some cases: The - // compiler may produce undefined results in case of signed integer - // overflow. The computation must be done w/ unsigned ints. - return static_cast(value) + 0x40000000U < 0x80000000U; + // Is value in range [kSmiMinValue, kSmiMaxValue]. + // Use unsigned operations in order to avoid undefined behaviour in case of + // signed integer overflow. + return (static_cast(value) - + static_cast(kSmiMinValue)) <= + (static_cast(kSmiMaxValue) - + static_cast(kSmiMinValue)); } }; @@ -77,6 +81,11 @@ struct SmiTagging<4> { template <> struct SmiTagging<8> { enum { kSmiShiftSize = 31, kSmiValueSize = 32 }; + + static constexpr intptr_t kSmiMinValue = + static_cast(kUintptrAllBitsSet << (kSmiValueSize - 1)); + static constexpr intptr_t kSmiMaxValue = -(kSmiMinValue + 1); + V8_INLINE static int SmiToInt(const internal::Address value) { int shift_bits = kSmiTagSize + kSmiShiftSize; // Shift down and throw away top 32 bits. @@ -98,15 +107,15 @@ const int kApiTaggedSize = kApiSystemPointerSize; #endif #ifdef V8_31BIT_SMIS_ON_64BIT_ARCH -typedef SmiTagging PlatformSmiTagging; +using PlatformSmiTagging = SmiTagging; #else -typedef SmiTagging PlatformSmiTagging; +using PlatformSmiTagging = SmiTagging; #endif const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize; const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize; -const int kSmiMinValue = (static_cast(-1)) << (kSmiValueSize - 1); -const int kSmiMaxValue = -(kSmiMinValue + 1); +const int kSmiMinValue = static_cast(PlatformSmiTagging::kSmiMinValue); +const int kSmiMaxValue = static_cast(PlatformSmiTagging::kSmiMaxValue); constexpr bool SmiValuesAre31Bits() { return kSmiValueSize == 31; } constexpr bool SmiValuesAre32Bits() { return kSmiValueSize == 32; } diff --git a/deps/v8/include/v8-platform.h b/deps/v8/include/v8-platform.h index 556407d8761f1b..b707fafc49229a 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -109,7 +109,6 @@ class TaskRunner { TaskRunner() = default; virtual ~TaskRunner() = default; - private: TaskRunner(const TaskRunner&) = delete; TaskRunner& operator=(const TaskRunner&) = delete; }; diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index 672a694e0796be..645920d9c1b357 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -5,6 +5,7 @@ #ifndef V8_V8_PROFILER_H_ #define V8_V8_PROFILER_H_ +#include #include #include #include "v8.h" // NOLINT(build/include) @@ -297,6 +298,53 @@ enum CpuProfilingMode { kCallerLineNumbers, }; +// Determines how names are derived for functions sampled. +enum CpuProfilingNamingMode { + // Use the immediate name of functions at compilation time. + kStandardNaming, + // Use more verbose naming for functions without names, inferred from scope + // where possible. + kDebugNaming, +}; + +/** + * Optional profiling attributes. + */ +class V8_EXPORT CpuProfilingOptions { + public: + // Indicates that the sample buffer size should not be explicitly limited. + static const unsigned kNoSampleLimit = UINT_MAX; + + /** + * \param mode Type of computation of stack frame line numbers. + * \param max_samples The maximum number of samples that should be recorded by + * the profiler. Samples obtained after this limit will be + * discarded. + * \param sampling_interval_us controls the profile-specific target + * sampling interval. The provided sampling + * interval will be snapped to the next lowest + * non-zero multiple of the profiler's sampling + * interval, set via SetSamplingInterval(). If + * zero, the sampling interval will be equal to + * the profiler's sampling interval. + */ + CpuProfilingOptions(CpuProfilingMode mode = kLeafNodeLineNumbers, + unsigned max_samples = kNoSampleLimit, + int sampling_interval_us = 0) + : mode_(mode), + max_samples_(max_samples), + sampling_interval_us_(sampling_interval_us) {} + + CpuProfilingMode mode() const { return mode_; } + unsigned max_samples() const { return max_samples_; } + int sampling_interval_us() const { return sampling_interval_us_; } + + private: + CpuProfilingMode mode_; + unsigned max_samples_; + int sampling_interval_us_; +}; + /** * Interface for controlling CPU profiling. Instance of the * profiler can be created using v8::CpuProfiler::New method. @@ -309,6 +357,8 @@ class V8_EXPORT CpuProfiler { * |Dispose| method. */ static CpuProfiler* New(Isolate* isolate); + static CpuProfiler* New(Isolate* isolate, + CpuProfilingNamingMode mode); /** * Synchronously collect current stack sample in all profilers attached to @@ -339,18 +389,28 @@ class V8_EXPORT CpuProfiler { void SetUsePreciseSampling(bool); /** - * Starts collecting CPU profile. Title may be an empty string. It - * is allowed to have several profiles being collected at - * once. Attempts to start collecting several profiles with the same - * title are silently ignored. While collecting a profile, functions - * from all security contexts are included in it. The token-based - * filtering is only performed when querying for a profile. + * Starts collecting a CPU profile. Title may be an empty string. Several + * profiles may be collected at once. Attempts to start collecting several + * profiles with the same title are silently ignored. + */ + void StartProfiling(Local title, CpuProfilingOptions options); + + /** + * Starts profiling with the same semantics as above, except with expanded + * parameters. * * |record_samples| parameter controls whether individual samples should * be recorded in addition to the aggregated tree. + * + * |max_samples| controls the maximum number of samples that should be + * recorded by the profiler. Samples obtained after this limit will be + * discarded. */ - void StartProfiling(Local title, CpuProfilingMode mode, - bool record_samples = false); + void StartProfiling( + Local title, CpuProfilingMode mode, bool record_samples = false); + void StartProfiling( + Local title, CpuProfilingMode mode, bool record_samples, + unsigned max_samples); /** * The same as StartProfiling above, but the CpuProfilingMode defaults to * kLeafNodeLineNumbers mode, which was the previous default behavior of the @@ -391,7 +451,6 @@ class V8_EXPORT CpuProfiler { CpuProfiler& operator=(const CpuProfiler&); }; - /** * HeapSnapshotEdge represents a directed connection between heap * graph nodes: from retainers to retained nodes. @@ -742,7 +801,6 @@ class V8_EXPORT EmbedderGraph { */ virtual const char* NamePrefix() { return nullptr; } - private: Node(const Node&) = delete; Node& operator=(const Node&) = delete; }; diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index dfcd5b467dbf82..e9c5c339f280d8 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -9,9 +9,9 @@ // NOTE these macros are used by some of the tool scripts and the build // system so their names cannot be changed without changing the scripts. #define V8_MAJOR_VERSION 7 -#define V8_MINOR_VERSION 5 -#define V8_BUILD_NUMBER 288 -#define V8_PATCH_LEVEL 22 +#define V8_MINOR_VERSION 6 +#define V8_BUILD_NUMBER 303 +#define V8_PATCH_LEVEL 29 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 79c17ad57f8923..3b73ae6413a44d 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -1940,6 +1940,11 @@ class V8_EXPORT StackFrame { * Returns whether or not the associated functions is defined in wasm. */ bool IsWasm() const; + + /** + * Returns whether or not the associated function is defined by the user. + */ + bool IsUserJavaScript() const; }; @@ -1958,10 +1963,11 @@ enum StateTag { // A RegisterState represents the current state of registers used // by the sampling profiler API. struct RegisterState { - RegisterState() : pc(nullptr), sp(nullptr), fp(nullptr) {} + RegisterState() : pc(nullptr), sp(nullptr), fp(nullptr), lr(nullptr) {} void* pc; // Instruction pointer. void* sp; // Stack pointer. void* fp; // Frame pointer. + void* lr; // Link register (or nullptr on platforms without a link register). }; // The output structure filled up by GetStackSample API function. @@ -2127,10 +2133,10 @@ class V8_EXPORT ValueSerializer { void WriteDouble(double value); void WriteRawBytes(const void* source, size_t length); - private: ValueSerializer(const ValueSerializer&) = delete; void operator=(const ValueSerializer&) = delete; + private: struct PrivateData; PrivateData* private_; }; @@ -2229,10 +2235,10 @@ class V8_EXPORT ValueDeserializer { V8_WARN_UNUSED_RESULT bool ReadDouble(double* value); V8_WARN_UNUSED_RESULT bool ReadRawBytes(size_t length, const void** data); - private: ValueDeserializer(const ValueDeserializer&) = delete; void operator=(const ValueDeserializer&) = delete; + private: struct PrivateData; PrivateData* private_; }; @@ -2771,6 +2777,10 @@ class V8_EXPORT String : public Name { */ virtual bool IsCacheable() const { return true; } + // Disallow copying and assigning. + ExternalStringResourceBase(const ExternalStringResourceBase&) = delete; + void operator=(const ExternalStringResourceBase&) = delete; + protected: ExternalStringResourceBase() = default; @@ -2800,10 +2810,6 @@ class V8_EXPORT String : public Name { */ virtual void Unlock() const {} - // Disallow copying and assigning. - ExternalStringResourceBase(const ExternalStringResourceBase&) = delete; - void operator=(const ExternalStringResourceBase&) = delete; - private: friend class internal::ExternalString; friend class v8::String; @@ -3362,8 +3368,8 @@ enum class IntegrityLevel { kFrozen, kSealed }; */ class V8_EXPORT Object : public Value { public: - V8_DEPRECATE_SOON("Use maybe version", - bool Set(Local key, Local value)); + V8_DEPRECATED("Use maybe version", + bool Set(Local key, Local value)); /** * Set only return Just(true) or Empty(), so if it should never fail, use * result.Check(). @@ -3371,8 +3377,8 @@ class V8_EXPORT Object : public Value { V8_WARN_UNUSED_RESULT Maybe Set(Local context, Local key, Local value); - V8_DEPRECATE_SOON("Use maybe version", - bool Set(uint32_t index, Local value)); + V8_DEPRECATED("Use maybe version", + bool Set(uint32_t index, Local value)); V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index, Local value); @@ -3416,11 +3422,11 @@ class V8_EXPORT Object : public Value { V8_WARN_UNUSED_RESULT Maybe DefineProperty( Local context, Local key, PropertyDescriptor& descriptor); - V8_DEPRECATE_SOON("Use maybe version", Local Get(Local key)); + V8_DEPRECATED("Use maybe version", Local Get(Local key)); V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context, Local key); - V8_DEPRECATE_SOON("Use maybe version", Local Get(uint32_t index)); + V8_DEPRECATED("Use maybe version", Local Get(uint32_t index)); V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context, uint32_t index); @@ -6828,8 +6834,6 @@ class V8_EXPORT MicrotaskQueue { private: friend class internal::MicrotaskQueue; MicrotaskQueue() = default; - MicrotaskQueue(const MicrotaskQueue&) = delete; - MicrotaskQueue& operator=(const MicrotaskQueue&) = delete; }; /** @@ -7220,6 +7224,11 @@ enum class MemoryPressureLevel { kNone, kModerate, kCritical }; */ class V8_EXPORT EmbedderHeapTracer { public: + enum TraceFlags : uint64_t { + kNoFlags = 0, + kReduceMemory = 1 << 0, + }; + // Indicator for the stack state of the embedder. enum EmbedderStackState { kUnknown, @@ -7236,6 +7245,24 @@ class V8_EXPORT EmbedderHeapTracer { virtual void VisitTracedGlobalHandle(const TracedGlobal& value) = 0; }; + /** + * Summary of a garbage collection cycle. See |TraceEpilogue| on how the + * summary is reported. + */ + struct TraceSummary { + /** + * Time spent managing the retained memory in milliseconds. This can e.g. + * include the time tracing through objects in the embedder. + */ + double time = 0.0; + + /** + * Memory retained by the embedder through the |EmbedderHeapTracer| + * mechanism in bytes. + */ + size_t allocated_size = 0; + }; + virtual ~EmbedderHeapTracer() = default; /** @@ -7258,7 +7285,8 @@ class V8_EXPORT EmbedderHeapTracer { /** * Called at the beginning of a GC cycle. */ - virtual void TracePrologue() = 0; + V8_DEPRECATE_SOON("Use version with flags.", virtual void TracePrologue()) {} + virtual void TracePrologue(TraceFlags flags); /** * Called to advance tracing in the embedder. @@ -7281,9 +7309,12 @@ class V8_EXPORT EmbedderHeapTracer { /** * Called at the end of a GC cycle. * - * Note that allocation is *not* allowed within |TraceEpilogue|. + * Note that allocation is *not* allowed within |TraceEpilogue|. Can be + * overriden to fill a |TraceSummary| that is used by V8 to schedule future + * garbage collections. */ - virtual void TraceEpilogue() = 0; + virtual void TraceEpilogue() {} + virtual void TraceEpilogue(TraceSummary* trace_summary) { TraceEpilogue(); } /** * Called upon entering the final marking pause. No more incremental marking @@ -7320,6 +7351,14 @@ class V8_EXPORT EmbedderHeapTracer { */ void GarbageCollectionForTesting(EmbedderStackState stack_state); + /* + * Called by the embedder to signal newly allocated memory. Not bound to + * tracing phases. Embedders should trade off when increments are reported as + * V8 may consult global heuristics on whether to trigger garbage collection + * on this change. + */ + void IncreaseAllocatedSize(size_t bytes); + /* * Returns the v8::Isolate this tracer is attached too and |nullptr| if it * is not attached to any v8::Isolate. @@ -8677,6 +8716,7 @@ class V8_EXPORT V8 { /** * Sets V8 flags from a string. */ + static void SetFlagsFromString(const char* str); static void SetFlagsFromString(const char* str, int length); /** @@ -10951,7 +10991,8 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory( *external_memory = amount; int64_t allocation_diff_since_last_mc = - *external_memory - *external_memory_at_last_mc; + static_cast(static_cast(*external_memory) - + static_cast(*external_memory_at_last_mc)); // Only check memory pressure and potentially trigger GC if the amount of // external memory increased. if (allocation_diff_since_last_mc > kMemoryReducerActivationLimit) { diff --git a/deps/v8/infra/OWNERS b/deps/v8/infra/OWNERS index c05d1d39218a42..a75a43666efa57 100644 --- a/deps/v8/infra/OWNERS +++ b/deps/v8/infra/OWNERS @@ -1,4 +1,3 @@ -machenbach@chromium.org -sergiyb@chromium.org +file://INFRA_OWNERS + tandrii@chromium.org -tmrts@chromium.org \ No newline at end of file diff --git a/deps/v8/infra/mb/gn_isolate_map.pyl b/deps/v8/infra/mb/gn_isolate_map.pyl index 8f13079ea3d3b4..05b147d503f000 100644 --- a/deps/v8/infra/mb/gn_isolate_map.pyl +++ b/deps/v8/infra/mb/gn_isolate_map.pyl @@ -47,6 +47,10 @@ "label": "//test:v8_perf", "type": "script", }, + "perf_integration": { + "label": "//test:v8_perf", + "type": "script", + }, "jsfunfuzz": { "label": "//tools/jsfunfuzz:v8_jsfunfuzz", "type": "script", diff --git a/deps/v8/infra/mb/mb_config.pyl b/deps/v8/infra/mb/mb_config.pyl index 6d05b7f2371833..354415ef438ccf 100644 --- a/deps/v8/infra/mb/mb_config.pyl +++ b/deps/v8/infra/mb/mb_config.pyl @@ -92,6 +92,8 @@ 'V8 Linux gcc': 'release_x86_gcc', 'V8 Linux64 gcc - debug': 'debug_x64_gcc', # FYI. + 'V8 iOS - sim': 'release_x64_ios_simulator', + 'V8 Linux64 - debug - perfetto - builder': 'debug_x64_perfetto', 'V8 Linux64 - pointer compression': 'release_x64_pointer_compression', 'V8 Linux64 - arm64 - sim - pointer compression - builder': 'release_simulate_arm64_pointer_compression', @@ -151,6 +153,7 @@ # Arm64. 'V8 Android Arm64 - builder': 'release_android_arm64', 'V8 Android Arm64 - debug builder': 'debug_android_arm64', + 'V8 Arm64 - builder': 'release_arm64', 'V8 Linux - arm64 - sim': 'release_simulate_arm64', 'V8 Linux - arm64 - sim - debug': 'debug_simulate_arm64', 'V8 Linux - arm64 - sim - nosnap - debug': @@ -191,6 +194,7 @@ 'v8_android_arm64_compile_dbg': 'debug_android_arm64', 'v8_android_arm64_n5x_rel_ng': 'release_android_arm64', 'v8_fuchsia_rel_ng': 'release_x64_fuchsia_trybot', + 'v8_ios_simulator': 'release_x64_ios_simulator', 'v8_linux_noembed_rel_ng': 'release_x86_noembed_trybot', 'v8_linux_rel_ng': 'release_x86_gcmole_trybot', 'v8_linux_optional_rel_ng': 'release_x86_trybot', @@ -212,6 +216,8 @@ 'v8_linux64_gcc_compile_dbg': 'debug_x64_gcc', 'v8_linux64_header_includes_dbg': 'debug_x64_header_includes', 'v8_linux64_fyi_rel_ng': 'release_x64_test_features_trybot', + 'v8_linux64_nodcheck_rel_ng': 'release_x64', + 'v8_linux64_perfetto_dbg_ng': 'debug_x64_perfetto', 'v8_linux64_pointer_compression_rel_ng': 'release_x64_pointer_compression', 'v8_linux64_rel_ng': 'release_x64_test_features_trybot', 'v8_linux64_shared_compile_rel': 'release_x64_shared_verify_heap', @@ -390,6 +396,8 @@ # Release configs for arm. 'release_arm': [ 'release_bot', 'arm', 'hard_float'], + 'release_arm64': [ + 'release_bot', 'arm64', 'hard_float'], 'release_android_arm': [ 'release_bot', 'arm', 'android', 'minimal_symbols', 'android_strip_outputs'], @@ -433,6 +441,8 @@ 'release_x64_gcc_coverage': [ 'release_bot', 'x64', 'coverage', 'gcc', 'no_custom_libcxx', 'no_sysroot'], + 'release_x64_ios_simulator': [ + 'release_bot', 'x64', 'ios_simulator'], 'release_x64_internal': [ 'release_bot', 'x64', 'v8_snapshot_internal'], 'release_x64_jumbo': [ @@ -490,6 +500,8 @@ 'debug_bot', 'x64', 'jumbo_limited'], 'debug_x64_minimal_symbols': [ 'debug_bot', 'x64', 'minimal_symbols'], + 'debug_x64_perfetto': [ + 'debug_bot', 'x64', 'perfetto'], 'debug_x64_trybot': [ 'debug_trybot', 'x64'], 'debug_x64_trybot_custom': [ @@ -646,6 +658,10 @@ 'gn_args': 'arm_float_abi="hard"', }, + 'ios_simulator': { + 'gn_args': 'target_cpu="x64" target_os="ios"', + }, + 'jumbo': { 'gn_args': 'use_jumbo_build=true', }, @@ -699,6 +715,10 @@ 'gn_args': 'use_sysroot=false', }, + 'perfetto': { + 'gn_args': 'v8_use_perfetto=true', + }, + 'release': { 'gn_args': 'is_debug=false', }, diff --git a/deps/v8/infra/testing/OWNERS b/deps/v8/infra/testing/OWNERS index c8693c972c7225..50b5741785cb07 100644 --- a/deps/v8/infra/testing/OWNERS +++ b/deps/v8/infra/testing/OWNERS @@ -1,5 +1,3 @@ set noparent -machenbach@chromium.org -sergiyb@chromium.org -tmrts@chromium.org \ No newline at end of file +file://INFRA_OWNERS diff --git a/deps/v8/infra/testing/builders.pyl b/deps/v8/infra/testing/builders.pyl index 00e385711a0eb2..0d39ea31f75512 100644 --- a/deps/v8/infra/testing/builders.pyl +++ b/deps/v8/infra/testing/builders.pyl @@ -51,6 +51,7 @@ 'v8_linux_dbg_ng_triggered': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', + 'os': 'Ubuntu-14.04', }, 'tests': [ {'name': 'benchmarks'}, @@ -65,6 +66,9 @@ ], }, 'v8_linux_gc_stress_dbg': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mjsunit', 'variant': 'slow_path', 'test_args': ['--gc-stress'], 'shards': 2}, {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 5}, @@ -81,6 +85,7 @@ 'v8_linux_nodcheck_rel_ng_triggered': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', + 'os': 'Ubuntu-14.04', }, 'tests': [ {'name': 'benchmarks'}, @@ -94,11 +99,17 @@ ], }, 'v8_linux_noembed_rel_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing', 'shards': 2}, ], }, 'v8_linux_noi18n_rel_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla', 'variant': 'default'}, {'name': 'test262', 'variant': 'default'}, @@ -106,6 +117,9 @@ ], }, 'v8_linux_nosnap_rel': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing', 'variant': 'default', 'shards': 6}, ], @@ -121,6 +135,7 @@ 'v8_linux_rel_ng_triggered': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', + 'os': 'Ubuntu-14.04', }, 'tests': [ {'name': 'benchmarks'}, @@ -140,6 +155,7 @@ 'v8_linux_optional_rel_ng_triggered': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', + 'os': 'Ubuntu-14.04', }, 'tests': [ # Code serializer. @@ -193,6 +209,9 @@ ], }, 'v8_linux_verify_csa_rel_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing', 'shards': 2}, ], @@ -200,6 +219,9 @@ ############################################################################## # Linux32 with arm simulators 'v8_linux_arm_dbg': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mjsunit_sp_frame_access'}, {'name': 'mozilla'}, @@ -210,11 +232,17 @@ ], }, 'v8_linux_arm_lite_rel_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing', 'variant': 'default', 'shards': 4}, ], }, 'v8_linux_arm_rel_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mjsunit_sp_frame_access', 'shards': 2}, {'name': 'mozilla', 'shards': 2}, @@ -227,6 +255,9 @@ ############################################################################## # Linux64 'v8_linux64_asan_rel_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'test262_variants', 'shards': 7}, {'name': 'v8testing', 'shards': 3}, @@ -235,6 +266,9 @@ ], }, 'v8_linux64_cfi_rel_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'benchmarks'}, {'name': 'mozilla'}, @@ -246,6 +280,7 @@ 'v8_linux64_dbg_ng_triggered': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', + 'os': 'Ubuntu-14.04', }, 'tests': [ {'name': 'benchmarks'}, @@ -261,6 +296,9 @@ ], }, 'v8_linux64_gc_stress_custom_snapshot_dbg_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ { 'name': 'mjsunit', @@ -270,6 +308,9 @@ ], }, 'v8_linux64_fyi_rel_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ # Stress sampling. {'name': 'mjsunit', 'variant': 'stress_sampling'}, @@ -280,12 +321,43 @@ ], }, 'v8_linux64_msan_rel': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'test262', 'shards': 2}, {'name': 'v8testing', 'shards': 5}, ], }, + 'v8_linux64_nodcheck_rel_ng_triggered': { + 'swarming_dimensions' : { + 'cpu': 'x86-64-avx2', + 'os': 'Ubuntu-14.04', + }, + 'tests': [ + {'name': 'benchmarks'}, + {'name': 'benchmarks', 'variant': 'extra'}, + {'name': 'mozilla'}, + {'name': 'mozilla', 'variant': 'extra'}, + {'name': 'perf_integration'}, + {'name': 'test262_variants', 'shards': 2}, + {'name': 'test262_variants', 'variant': 'extra', 'shards': 2}, + {'name': 'v8testing', 'shards': 2}, + {'name': 'v8testing', 'variant': 'extra'}, + ], + }, + 'v8_linux64_perfetto_dbg_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, + 'tests': [ + {'name': 'v8testing', 'shards': 3}, + ], + }, 'v8_linux64_pointer_compression_rel_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing', 'shards': 3}, ], @@ -293,6 +365,7 @@ 'v8_linux64_rel_ng_triggered': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', + 'os': 'Ubuntu-14.04', }, 'tests': [ # TODO(machenbach): Add benchmarks. @@ -313,6 +386,7 @@ 'v8_linux64_rel_xg': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', + 'os': 'Ubuntu-14.04', }, 'tests': [ {'name': 'v8initializers'}, @@ -320,11 +394,17 @@ ], }, 'v8_linux64_sanitizer_coverage_rel': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing', 'shards': 3}, ], }, 'v8_linux64_tsan_rel': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'benchmarks'}, {'name': 'mozilla'}, @@ -335,16 +415,25 @@ ], }, 'v8_linux64_tsan_isolates_rel_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing', 'test_args': ['--isolates'], 'shards': 7}, ], }, 'v8_linux64_ubsan_rel_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing', 'shards': 2}, ], }, 'v8_linux64_verify_csa_rel_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing', 'shards': 2}, ], @@ -352,6 +441,9 @@ ############################################################################## # Linux64 with arm64 simulators 'v8_linux_arm64_dbg': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mjsunit_sp_frame_access'}, {'name': 'mozilla', 'shards': 2}, @@ -362,11 +454,17 @@ ], }, 'v8_linux_arm64_gc_stress_dbg': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 10}, ], }, 'v8_linux_arm64_rel_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mjsunit_sp_frame_access', 'shards': 2}, {'name': 'mozilla', 'shards': 2}, @@ -377,6 +475,9 @@ ], }, 'v8_linux64_arm64_pointer_compression_rel_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'swarming_task_attrs': { 'expiration': 14400, 'hard_timeout': 3600, @@ -530,6 +631,9 @@ ############################################################################## # Main. 'V8 Fuzzer': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'swarming_task_attrs': { 'expiration': 14400, 'hard_timeout': 3600, @@ -542,6 +646,7 @@ 'V8 Linux': { 'swarming_dimensions': { 'cpu': 'x86-64-avx2', + 'os': 'Ubuntu-14.04', }, 'tests': [ {'name': 'benchmarks'}, @@ -582,6 +687,9 @@ ], }, 'V8 Linux - arm64 - sim - MSAN': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'test262', 'shards': 3}, {'name': 'v8testing', 'shards': 4}, @@ -590,6 +698,7 @@ 'V8 Linux - debug': { 'swarming_dimensions': { 'cpu': 'x86-64-avx2', + 'os': 'Ubuntu-14.04', }, 'tests': [ {'name': 'benchmarks'}, @@ -649,26 +758,38 @@ ], }, 'V8 Linux - noembed': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing'}, ], }, 'V8 Linux - noembed - debug': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing', 'shards': 3}, ], }, 'V8 Linux - full debug': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'swarming_task_attrs': { 'expiration': 14400, 'hard_timeout': 3600, 'priority': 35, }, 'tests': [ - {'name': 'v8testing', 'variant': 'default', 'shards': 3}, + {'name': 'v8testing', 'variant': 'default', 'shards': 4}, ], }, 'V8 Linux - gc stress': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ { 'name': 'd8testing', @@ -684,6 +805,9 @@ ], }, 'V8 Linux - noi18n - debug': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla', 'variant': 'default'}, {'name': 'test262', 'variant': 'default'}, @@ -691,6 +815,9 @@ ], }, 'V8 Linux - nosnap': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'swarming_task_attrs': { 'expiration': 14400, 'hard_timeout': 3600, @@ -703,6 +830,9 @@ ], }, 'V8 Linux - nosnap - debug': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'swarming_task_attrs': { 'expiration': 14400, 'hard_timeout': 3600, @@ -713,6 +843,9 @@ ], }, 'V8 Linux - predictable': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'benchmarks'}, {'name': 'd8testing'}, @@ -720,6 +853,9 @@ ], }, 'V8 Linux - shared': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla'}, {'name': 'test262'}, @@ -727,6 +863,9 @@ ], }, 'V8 Linux - verify csa': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing'}, ], @@ -742,6 +881,7 @@ 'V8 Linux64': { 'swarming_dimensions': { 'cpu': 'x86-64-avx2', + 'os': 'Ubuntu-14.04', }, 'tests': [ {'name': 'benchmarks'}, @@ -750,6 +890,7 @@ {'name': 'mozilla'}, {'name': 'mozilla', 'variant': 'extra'}, {'name': 'optimize_for_size'}, + {'name': 'perf_integration'}, {'name': 'test262_variants', 'shards': 2}, {'name': 'test262_variants', 'variant': 'extra'}, {'name': 'v8initializers'}, @@ -775,6 +916,9 @@ ], }, 'V8 Linux64 - cfi': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'benchmarks'}, {'name': 'mozilla'}, @@ -784,6 +928,9 @@ ], }, 'V8 Linux64 - custom snapshot - debug': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mjsunit', 'test_args': ['--no-harness']}, ], @@ -791,6 +938,7 @@ 'V8 Linux64 - debug': { 'swarming_dimensions': { 'cpu': 'x86-64-avx2', + 'os': 'Ubuntu-14.04', }, 'tests': [ {'name': 'benchmarks'}, @@ -825,6 +973,9 @@ ], }, 'V8 Linux64 - debug - fyi': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ # Infra staging. {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 2}, @@ -833,7 +984,23 @@ {'name': 'webkit', 'variant': 'stress_sampling', 'shards': 1}, ], }, + 'V8 Linux64 - debug - perfetto': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 3600, + 'priority': 35, + }, + 'tests': [ + {'name': 'v8testing', 'shards': 2}, + ], + }, 'V8 Linux64 - fyi': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ # Infra staging. {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 1}, @@ -843,21 +1010,33 @@ ], }, 'V8 Linux64 - gcov coverage': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing'}, ], }, 'V8 Linux64 - internal snapshot': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing'}, ], }, 'V8 Linux64 - pointer compression': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing', 'shards': 2}, ], }, 'V8 Linux64 - shared': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla'}, {'name': 'test262'}, @@ -865,11 +1044,17 @@ ], }, 'V8 Linux64 - verify csa': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing'}, ], }, 'V8 Linux64 ASAN': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'test262_variants', 'shards': 5}, {'name': 'v8testing', 'shards': 2}, @@ -878,6 +1063,9 @@ ], }, 'V8 Linux64 GC Stress - custom snapshot': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ { 'name': 'mjsunit', @@ -887,6 +1075,9 @@ ], }, 'V8 Linux64 TSAN': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'benchmarks'}, {'name': 'mozilla'}, @@ -897,6 +1088,9 @@ ], }, 'V8 Linux64 TSAN - concurrent marking': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'swarming_task_attrs': { 'expiration': 14400, 'hard_timeout': 3600, @@ -924,11 +1118,17 @@ ], }, 'V8 Linux64 TSAN - isolates': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing', 'test_args': ['--isolates'], 'shards': 7}, ], }, 'V8 Linux64 UBSan': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla'}, {'name': 'test262', 'shards': 2}, @@ -1068,6 +1268,7 @@ 'swarming_dimensions': { 'cores': '2', 'cpu': 'armv7l', + 'os': 'Ubuntu-14.04', }, 'swarming_task_attrs': { 'expiration': 21600, @@ -1114,6 +1315,7 @@ 'swarming_dimensions': { 'cores': '2', 'cpu': 'armv7l', + 'os': 'Ubuntu-14.04', }, 'swarming_task_attrs': { 'expiration': 21600, @@ -1163,6 +1365,7 @@ 'swarming_dimensions': { 'cores': '2', 'cpu': 'armv7l', + 'os': 'Ubuntu-14.04', }, 'swarming_task_attrs': { 'expiration': 21600, @@ -1190,6 +1393,9 @@ ], }, 'V8 Linux - arm - sim': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mjsunit_sp_frame_access'}, {'name': 'mozilla'}, @@ -1226,6 +1432,9 @@ ], }, 'V8 Linux - arm - sim - debug': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mjsunit_sp_frame_access'}, {'name': 'mozilla'}, @@ -1273,16 +1482,25 @@ ], }, 'V8 Linux - arm - sim - lite': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing', 'variant': 'default', 'shards': 2}, ], }, 'V8 Linux - arm - sim - lite - debug': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing', 'variant': 'default', 'shards': 4}, ], }, 'V8 Linux - arm64 - sim': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mjsunit_sp_frame_access'}, {'name': 'mozilla'}, @@ -1293,6 +1511,9 @@ ], }, 'V8 Linux - arm64 - sim - debug': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, # TODO(machenbach): Remove longer timeout when this builder scales better. 'swarming_task_attrs': { 'hard_timeout': 3600, @@ -1307,6 +1528,9 @@ ], }, 'V8 Linux - arm64 - sim - gc stress': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'swarming_task_attrs': { 'expiration': 14400, 'hard_timeout': 7200, @@ -1321,6 +1545,9 @@ ], }, 'V8 Linux - mips64el - sim': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'swarming_task_attrs': { 'expiration': 14400, 'hard_timeout': 3600, @@ -1332,6 +1559,9 @@ ], }, 'V8 Linux - mipsel - sim': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'swarming_task_attrs': { 'expiration': 14400, 'hard_timeout': 3600, @@ -1343,6 +1573,9 @@ ], }, 'V8 Linux - ppc64 - sim': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'swarming_task_attrs': { 'expiration': 14400, 'hard_timeout': 3600, @@ -1353,6 +1586,9 @@ ], }, 'V8 Linux - s390x - sim': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'swarming_task_attrs': { 'expiration': 14400, 'hard_timeout': 3600, @@ -1363,6 +1599,9 @@ ], }, 'V8 Linux64 - arm64 - sim - pointer compression': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'swarming_task_attrs': { 'expiration': 14400, 'hard_timeout': 3600, @@ -1388,6 +1627,9 @@ ############################################################################## # Clusterfuzz. 'V8 NumFuzz': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'swarming_task_attrs': { 'expiration': 13800, 'hard_timeout': 4200, @@ -1402,6 +1644,9 @@ ], }, 'V8 NumFuzz - TSAN': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'swarming_task_attrs': { 'expiration': 13800, 'hard_timeout': 4200, @@ -1447,6 +1692,9 @@ ], }, 'V8 NumFuzz - debug': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'swarming_task_attrs': { 'expiration': 13800, 'hard_timeout': 4200, @@ -1501,6 +1749,9 @@ ############################################################################## # Branches. 'V8 Linux - beta branch': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla'}, {'name': 'test262'}, @@ -1508,6 +1759,9 @@ ], }, 'V8 Linux - beta branch - debug': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla'}, {'name': 'test262'}, @@ -1515,6 +1769,9 @@ ], }, 'V8 Linux - stable branch': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla'}, {'name': 'test262'}, @@ -1522,6 +1779,9 @@ ], }, 'V8 Linux - stable branch - debug': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla'}, {'name': 'test262'}, @@ -1529,6 +1789,9 @@ ], }, 'V8 Linux64 - beta branch': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla'}, {'name': 'test262'}, @@ -1536,6 +1799,9 @@ ], }, 'V8 Linux64 - beta branch - debug': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla'}, {'name': 'test262'}, @@ -1543,6 +1809,9 @@ ], }, 'V8 Linux64 - stable branch': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla'}, {'name': 'test262'}, @@ -1550,6 +1819,9 @@ ], }, 'V8 Linux64 - stable branch - debug': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla'}, {'name': 'test262'}, @@ -1557,6 +1829,9 @@ ], }, 'V8 arm - sim - beta branch': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla'}, {'name': 'test262'}, @@ -1564,6 +1839,9 @@ ], }, 'V8 arm - sim - beta branch - debug': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla'}, {'name': 'test262'}, @@ -1571,6 +1849,9 @@ ], }, 'V8 arm - sim - stable branch': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla'}, {'name': 'test262'}, @@ -1578,6 +1859,9 @@ ], }, 'V8 arm - sim - stable branch - debug': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'mozilla'}, {'name': 'test262'}, @@ -1585,41 +1869,65 @@ ], }, 'V8 mips64el - sim - beta branch': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'unittests'}, ], }, 'V8 mips64el - sim - stable branch': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'unittests'}, ], }, 'V8 mipsel - sim - beta branch': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing', 'shards': 4}, ], }, 'V8 mipsel - sim - stable branch': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'v8testing', 'shards': 4}, ], }, 'V8 ppc64 - sim - beta branch': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'unittests'}, ], }, 'V8 ppc64 - sim - stable branch': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'unittests'}, ], }, 'V8 s390x - sim - beta branch': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'unittests'}, ], }, 'V8 s390x - sim - stable branch': { + 'swarming_dimensions': { + 'os': 'Ubuntu-14.04', + }, 'tests': [ {'name': 'unittests'}, ], diff --git a/deps/v8/samples/OWNERS b/deps/v8/samples/OWNERS new file mode 100644 index 00000000000000..9c4f2439aa5ef3 --- /dev/null +++ b/deps/v8/samples/OWNERS @@ -0,0 +1,2 @@ +mathias@chromium.org +yangguo@chromium.org diff --git a/deps/v8/src/DEPS b/deps/v8/src/DEPS index 74c48a6dddab58..d24e647b24157d 100644 --- a/deps/v8/src/DEPS +++ b/deps/v8/src/DEPS @@ -8,6 +8,7 @@ include_rules = [ "+src/compiler/code-assembler.h", "+src/compiler/wasm-compiler.h", "-src/heap", + "+src/heap/combined-heap.h", "+src/heap/embedder-tracing.h", "+src/heap/factory.h", "+src/heap/factory-inl.h", diff --git a/deps/v8/src/api-arguments-inl.h b/deps/v8/src/api/api-arguments-inl.h similarity index 97% rename from deps/v8/src/api-arguments-inl.h rename to deps/v8/src/api/api-arguments-inl.h index 7f83708b969d67..05bb35786a94e9 100644 --- a/deps/v8/src/api-arguments-inl.h +++ b/deps/v8/src/api/api-arguments-inl.h @@ -2,17 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef V8_API_ARGUMENTS_INL_H_ -#define V8_API_ARGUMENTS_INL_H_ +#ifndef V8_API_API_ARGUMENTS_INL_H_ +#define V8_API_API_ARGUMENTS_INL_H_ -#include "src/api-arguments.h" +#include "src/api/api-arguments.h" -#include "src/api-inl.h" +#include "src/api/api-inl.h" #include "src/debug/debug.h" +#include "src/execution/vm-state-inl.h" +#include "src/logging/counters.h" #include "src/objects/api-callbacks.h" #include "src/objects/slots-inl.h" #include "src/tracing/trace-event.h" -#include "src/vm-state-inl.h" namespace v8 { namespace internal { @@ -42,7 +43,7 @@ Handle CustomArguments::GetReturnValue(Isolate* isolate) { // Check the ReturnValue. FullObjectSlot slot = slot_at(kReturnValueOffset); // Nothing was set, return empty handle as per previous behaviour. - if ((*slot)->IsTheHole(isolate)) return Handle(); + if ((*slot).IsTheHole(isolate)) return Handle(); Handle result = Handle::cast(Handle(slot.location())); result->VerifyApiCallResultType(); return result; @@ -143,7 +144,7 @@ Handle FunctionCallbackArguments::Call(CallHandlerInfo handler) { LOG(isolate, ApiObjectAccess("call", holder())); RuntimeCallTimerScope timer(isolate, RuntimeCallCounterId::kFunctionCallback); v8::FunctionCallback f = - v8::ToCData(handler->callback()); + v8::ToCData(handler.callback()); Handle receiver_check_unsupported; if (isolate->debug_execution_mode() == DebugInfo::kSideEffects && !isolate->debug()->PerformSideEffectCheckForCallback( @@ -367,4 +368,4 @@ Handle PropertyCallbackArguments::CallAccessorSetter( } // namespace internal } // namespace v8 -#endif // V8_API_ARGUMENTS_INL_H_ +#endif // V8_API_API_ARGUMENTS_INL_H_ diff --git a/deps/v8/src/api-arguments.cc b/deps/v8/src/api/api-arguments.cc similarity index 87% rename from deps/v8/src/api-arguments.cc rename to deps/v8/src/api/api-arguments.cc index 76e821cad7a2d7..51317fd0bf14bb 100644 --- a/deps/v8/src/api-arguments.cc +++ b/deps/v8/src/api/api-arguments.cc @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "src/api-arguments.h" +#include "src/api/api-arguments.h" -#include "src/api-arguments-inl.h" +#include "src/api/api-arguments-inl.h" namespace v8 { namespace internal { @@ -28,8 +28,8 @@ PropertyCallbackArguments::PropertyCallbackArguments( HeapObject the_hole = ReadOnlyRoots(isolate).the_hole_value(); slot_at(T::kReturnValueDefaultValueIndex).store(the_hole); slot_at(T::kReturnValueIndex).store(the_hole); - DCHECK((*slot_at(T::kHolderIndex))->IsHeapObject()); - DCHECK((*slot_at(T::kIsolateIndex))->IsSmi()); + DCHECK((*slot_at(T::kHolderIndex)).IsHeapObject()); + DCHECK((*slot_at(T::kIsolateIndex)).IsSmi()); } FunctionCallbackArguments::FunctionCallbackArguments( @@ -46,8 +46,8 @@ FunctionCallbackArguments::FunctionCallbackArguments( HeapObject the_hole = ReadOnlyRoots(isolate).the_hole_value(); slot_at(T::kReturnValueDefaultValueIndex).store(the_hole); slot_at(T::kReturnValueIndex).store(the_hole); - DCHECK((*slot_at(T::kHolderIndex))->IsHeapObject()); - DCHECK((*slot_at(T::kIsolateIndex))->IsSmi()); + DCHECK((*slot_at(T::kHolderIndex)).IsHeapObject()); + DCHECK((*slot_at(T::kIsolateIndex)).IsSmi()); } } // namespace internal diff --git a/deps/v8/src/api-arguments.h b/deps/v8/src/api/api-arguments.h similarity index 95% rename from deps/v8/src/api-arguments.h rename to deps/v8/src/api/api-arguments.h index 4f1ea8c85a5fbd..794681b71d0e60 100644 --- a/deps/v8/src/api-arguments.h +++ b/deps/v8/src/api/api-arguments.h @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef V8_API_ARGUMENTS_H_ -#define V8_API_ARGUMENTS_H_ +#ifndef V8_API_API_ARGUMENTS_H_ +#define V8_API_API_ARGUMENTS_H_ -#include "src/api.h" +#include "src/api/api.h" #include "src/debug/debug.h" -#include "src/isolate.h" +#include "src/execution/isolate.h" #include "src/objects/slots.h" -#include "src/visitors.h" +#include "src/objects/visitors.h" namespace v8 { namespace internal { @@ -60,8 +60,8 @@ class CustomArguments : public CustomArgumentsBase { class PropertyCallbackArguments : public CustomArguments > { public: - typedef PropertyCallbackInfo T; - typedef CustomArguments Super; + using T = PropertyCallbackInfo; + using Super = CustomArguments; static const int kArgsLength = T::kArgsLength; static const int kThisIndex = T::kThisIndex; static const int kHolderIndex = T::kHolderIndex; @@ -150,8 +150,8 @@ class PropertyCallbackArguments class FunctionCallbackArguments : public CustomArguments > { public: - typedef FunctionCallbackInfo T; - typedef CustomArguments Super; + using T = FunctionCallbackInfo; + using Super = CustomArguments; static const int kArgsLength = T::kArgsLength; static const int kHolderIndex = T::kHolderIndex; static const int kDataIndex = T::kDataIndex; @@ -186,4 +186,4 @@ class FunctionCallbackArguments } // namespace internal } // namespace v8 -#endif // V8_API_ARGUMENTS_H_ +#endif // V8_API_API_ARGUMENTS_H_ diff --git a/deps/v8/src/api-inl.h b/deps/v8/src/api/api-inl.h similarity index 93% rename from deps/v8/src/api-inl.h rename to deps/v8/src/api/api-inl.h index 9ccb9e4a6a2522..d152412b474f95 100644 --- a/deps/v8/src/api-inl.h +++ b/deps/v8/src/api/api-inl.h @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef V8_API_INL_H_ -#define V8_API_INL_H_ +#ifndef V8_API_API_INL_H_ +#define V8_API_API_INL_H_ -#include "src/api.h" -#include "src/handles-inl.h" -#include "src/objects-inl.h" +#include "src/api/api.h" +#include "src/handles/handles-inl.h" #include "src/objects/foreign-inl.h" +#include "src/objects/objects-inl.h" #include "src/objects/stack-frame-info.h" namespace v8 { @@ -18,13 +18,13 @@ inline T ToCData(v8::internal::Object obj) { STATIC_ASSERT(sizeof(T) == sizeof(v8::internal::Address)); if (obj == v8::internal::Smi::kZero) return nullptr; return reinterpret_cast( - v8::internal::Foreign::cast(obj)->foreign_address()); + v8::internal::Foreign::cast(obj).foreign_address()); } template <> inline v8::internal::Address ToCData(v8::internal::Object obj) { if (obj == v8::internal::Smi::kZero) return v8::internal::kNullAddress; - return v8::internal::Foreign::cast(obj)->foreign_address(); + return v8::internal::Foreign::cast(obj).foreign_address(); } template @@ -117,7 +117,7 @@ MAKE_TO_LOCAL(ScriptOrModuleToLocal, Script, ScriptOrModule) DCHECK(that == nullptr || \ v8::internal::Object( \ *reinterpret_cast(that)) \ - ->Is##To()); \ + .Is##To()); \ return v8::internal::Handle( \ reinterpret_cast( \ const_cast(that))); \ @@ -151,4 +151,4 @@ Handle HandleScopeImplementer::LastEnteredOrMicrotaskContext() { } // namespace internal } // namespace v8 -#endif // V8_API_INL_H_ +#endif // V8_API_API_INL_H_ diff --git a/deps/v8/src/api-natives.cc b/deps/v8/src/api/api-natives.cc similarity index 89% rename from deps/v8/src/api-natives.cc rename to deps/v8/src/api/api-natives.cc index 7b5541a1c3b389..c22b7c47f9cf4b 100644 --- a/deps/v8/src/api-natives.cc +++ b/deps/v8/src/api/api-natives.cc @@ -2,21 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "src/api-natives.h" +#include "src/api/api-natives.h" -#include "src/api-inl.h" -#include "src/isolate-inl.h" -#include "src/lookup.h" -#include "src/message-template.h" +#include "src/api/api-inl.h" +#include "src/execution/isolate-inl.h" +#include "src/execution/message-template.h" #include "src/objects/api-callbacks.h" #include "src/objects/hash-table-inl.h" +#include "src/objects/lookup.h" #include "src/objects/property-cell.h" #include "src/objects/templates.h" namespace v8 { namespace internal { - namespace { class InvokeScope { @@ -66,12 +65,12 @@ MaybeHandle DefineAccessorProperty( Handle getter, Handle setter, PropertyAttributes attributes, bool force_instantiate) { DCHECK(!getter->IsFunctionTemplateInfo() || - !FunctionTemplateInfo::cast(*getter)->do_not_cache()); + !FunctionTemplateInfo::cast(*getter).do_not_cache()); DCHECK(!setter->IsFunctionTemplateInfo() || - !FunctionTemplateInfo::cast(*setter)->do_not_cache()); + !FunctionTemplateInfo::cast(*setter).do_not_cache()); if (getter->IsFunctionTemplateInfo()) { if (force_instantiate || - FunctionTemplateInfo::cast(*getter)->BreakAtEntry()) { + FunctionTemplateInfo::cast(*getter).BreakAtEntry()) { ASSIGN_RETURN_ON_EXCEPTION( isolate, getter, InstantiateFunction(isolate, @@ -81,7 +80,7 @@ MaybeHandle DefineAccessorProperty( } if (setter->IsFunctionTemplateInfo()) { if (force_instantiate || - FunctionTemplateInfo::cast(*setter)->BreakAtEntry()) { + FunctionTemplateInfo::cast(*setter).BreakAtEntry()) { ASSIGN_RETURN_ON_EXCEPTION( isolate, setter, InstantiateFunction(isolate, @@ -96,7 +95,6 @@ MaybeHandle DefineAccessorProperty( return object; } - MaybeHandle DefineDataProperty(Isolate* isolate, Handle object, Handle name, @@ -126,7 +124,6 @@ MaybeHandle DefineDataProperty(Isolate* isolate, return value; } - void DisableAccessChecks(Isolate* isolate, Handle object) { Handle old_map(object->map(), isolate); // Copy map so it won't interfere constructor's initial map. @@ -135,7 +132,6 @@ void DisableAccessChecks(Isolate* isolate, Handle object) { JSObject::MigrateToMap(Handle::cast(object), new_map); } - void EnableAccessChecks(Isolate* isolate, Handle object) { Handle old_map(object->map(), isolate); // Copy map so it won't interfere constructor's initial map. @@ -145,12 +141,11 @@ void EnableAccessChecks(Isolate* isolate, Handle object) { JSObject::MigrateToMap(object, new_map); } - class AccessCheckDisableScope { public: AccessCheckDisableScope(Isolate* isolate, Handle obj) : isolate_(isolate), - disabled_(obj->map()->is_access_check_needed()), + disabled_(obj->map().is_access_check_needed()), obj_(obj) { if (disabled_) { DisableAccessChecks(isolate_, obj_); @@ -193,11 +188,11 @@ MaybeHandle ConfigureInstance(Isolate* isolate, Handle obj, int max_number_of_properties = 0; TemplateInfoT info = *data; while (!info.is_null()) { - Object props = info->property_accessors(); - if (!props->IsUndefined(isolate)) { - max_number_of_properties += TemplateList::cast(props)->length(); + Object props = info.property_accessors(); + if (!props.IsUndefined(isolate)) { + max_number_of_properties += TemplateList::cast(props).length(); } - info = info->GetParent(isolate); + info = info.GetParent(isolate); } if (max_number_of_properties > 0) { @@ -210,7 +205,7 @@ MaybeHandle ConfigureInstance(Isolate* isolate, Handle obj, temp = handle(temp->GetParent(isolate), isolate)) { // Accumulate accessors. Object maybe_properties = temp->property_accessors(); - if (!maybe_properties->IsUndefined(isolate)) { + if (!maybe_properties.IsUndefined(isolate)) { valid_descriptors = AccessorInfo::AppendUnique( isolate, handle(maybe_properties, isolate), array, valid_descriptors); @@ -228,7 +223,7 @@ MaybeHandle ConfigureInstance(Isolate* isolate, Handle obj, } Object maybe_property_list = data->property_list(); - if (maybe_property_list->IsUndefined(isolate)) return obj; + if (maybe_property_list.IsUndefined(isolate)) return obj; Handle properties(TemplateList::cast(maybe_property_list), isolate); if (properties->length() == 0) return obj; @@ -237,22 +232,24 @@ MaybeHandle ConfigureInstance(Isolate* isolate, Handle obj, for (int c = 0; c < data->number_of_properties(); c++) { auto name = handle(Name::cast(properties->get(i++)), isolate); Object bit = properties->get(i++); - if (bit->IsSmi()) { + if (bit.IsSmi()) { PropertyDetails details(Smi::cast(bit)); PropertyAttributes attributes = details.attributes(); PropertyKind kind = details.kind(); if (kind == kData) { auto prop_data = handle(properties->get(i++), isolate); - RETURN_ON_EXCEPTION(isolate, DefineDataProperty(isolate, obj, name, - prop_data, attributes), - JSObject); + RETURN_ON_EXCEPTION( + isolate, + DefineDataProperty(isolate, obj, name, prop_data, attributes), + JSObject); } else { auto getter = handle(properties->get(i++), isolate); auto setter = handle(properties->get(i++), isolate); RETURN_ON_EXCEPTION( - isolate, DefineAccessorProperty(isolate, obj, name, getter, setter, - attributes, is_hidden_prototype), + isolate, + DefineAccessorProperty(isolate, obj, name, getter, setter, + attributes, is_hidden_prototype), JSObject); } } else { @@ -266,9 +263,10 @@ MaybeHandle ConfigureInstance(Isolate* isolate, Handle obj, static_cast(Smi::ToInt(properties->get(i++))); auto prop_data = handle(GetIntrinsic(isolate, intrinsic), isolate); - RETURN_ON_EXCEPTION(isolate, DefineDataProperty(isolate, obj, name, - prop_data, attributes), - JSObject); + RETURN_ON_EXCEPTION( + isolate, + DefineDataProperty(isolate, obj, name, prop_data, attributes), + JSObject); } } return obj; @@ -289,20 +287,20 @@ MaybeHandle ProbeInstantiationsCache(Isolate* isolate, if (serial_number <= TemplateInfo::kFastTemplateInstantiationsCacheSize) { Handle fast_cache = isolate->fast_template_instantiations_cache(); - return fast_cache->GetValue(isolate, serial_number - 1); - } else if (caching_mode == CachingMode::kUnlimited || - (serial_number <= - TemplateInfo::kSlowTemplateInstantiationsCacheSize)) { + Handle object{fast_cache->get(serial_number - 1), isolate}; + if (object->IsUndefined(isolate)) return {}; + return Handle::cast(object); + } + if (caching_mode == CachingMode::kUnlimited || + (serial_number <= TemplateInfo::kSlowTemplateInstantiationsCacheSize)) { Handle slow_cache = isolate->slow_template_instantiations_cache(); int entry = slow_cache->FindEntry(isolate, serial_number); - if (entry == SimpleNumberDictionary::kNotFound) { - return MaybeHandle(); + if (entry != SimpleNumberDictionary::kNotFound) { + return handle(JSObject::cast(slow_cache->ValueAt(entry)), isolate); } - return handle(JSObject::cast(slow_cache->ValueAt(entry)), isolate); - } else { - return MaybeHandle(); } + return {}; } void CacheTemplateInstantiation(Isolate* isolate, int serial_number, @@ -338,7 +336,7 @@ void UncacheTemplateInstantiation(Isolate* isolate, int serial_number, if (serial_number <= TemplateInfo::kFastTemplateInstantiationsCacheSize) { Handle fast_cache = isolate->fast_template_instantiations_cache(); - DCHECK(!fast_cache->get(serial_number - 1)->IsUndefined(isolate)); + DCHECK(!fast_cache->get(serial_number - 1).IsUndefined(isolate)); fast_cache->set_undefined(serial_number - 1); } else if (caching_mode == CachingMode::kUnlimited || (serial_number <= @@ -356,11 +354,11 @@ bool IsSimpleInstantiation(Isolate* isolate, ObjectTemplateInfo info, JSReceiver new_target) { DisallowHeapAllocation no_gc; - if (!new_target->IsJSFunction()) return false; + if (!new_target.IsJSFunction()) return false; JSFunction fun = JSFunction::cast(new_target); - if (fun->shared()->function_data() != info->constructor()) return false; - if (info->immutable_proto()) return false; - return fun->context()->native_context() == isolate->raw_native_context(); + if (fun.shared().function_data() != info.constructor()) return false; + if (info.immutable_proto()) return false; + return fun.context().native_context() == isolate->raw_native_context(); } MaybeHandle InstantiateObject(Isolate* isolate, @@ -389,7 +387,7 @@ MaybeHandle InstantiateObject(Isolate* isolate, if (constructor.is_null()) { Object maybe_constructor_info = info->constructor(); - if (maybe_constructor_info->IsUndefined(isolate)) { + if (maybe_constructor_info.IsUndefined(isolate)) { constructor = isolate->object_function(); } else { // Enter a new scope. Recursion could otherwise create a lot of handles. @@ -473,9 +471,9 @@ MaybeHandle InstantiateFunction(Isolate* isolate, Handle prototype; if (!data->remove_prototype()) { Object prototype_templ = data->GetPrototypeTemplate(); - if (prototype_templ->IsUndefined(isolate)) { + if (prototype_templ.IsUndefined(isolate)) { Object protoype_provider_templ = data->GetPrototypeProviderTemplate(); - if (protoype_provider_templ->IsUndefined(isolate)) { + if (protoype_provider_templ.IsUndefined(isolate)) { prototype = isolate->factory()->NewJSObject(isolate->object_function()); } else { ASSIGN_RETURN_ON_EXCEPTION( @@ -488,11 +486,11 @@ MaybeHandle InstantiateFunction(Isolate* isolate, InstantiateObject( isolate, handle(ObjectTemplateInfo::cast(prototype_templ), isolate), - Handle(), data->hidden_prototype(), true), + Handle(), false, true), JSFunction); } Object parent = data->GetParentTemplate(); - if (!parent->IsUndefined(isolate)) { + if (!parent.IsUndefined(isolate)) { Handle parent_prototype; ASSIGN_RETURN_ON_EXCEPTION(isolate, parent_prototype, GetInstancePrototype(isolate, parent), @@ -504,8 +502,8 @@ MaybeHandle InstantiateFunction(Isolate* isolate, } InstanceType function_type = (!data->needs_access_check() && - data->GetNamedPropertyHandler()->IsUndefined(isolate) && - data->GetIndexedPropertyHandler()->IsUndefined(isolate)) + data->GetNamedPropertyHandler().IsUndefined(isolate) && + data->GetIndexedPropertyHandler().IsUndefined(isolate)) ? JS_API_OBJECT_TYPE : JS_SPECIAL_API_OBJECT_TYPE; @@ -517,7 +515,7 @@ MaybeHandle InstantiateFunction(Isolate* isolate, function); } MaybeHandle result = - ConfigureInstance(isolate, function, data, data->hidden_prototype()); + ConfigureInstance(isolate, function, data, false); if (result.is_null()) { // Uncache on error. if (serial_number) { @@ -529,12 +527,11 @@ MaybeHandle InstantiateFunction(Isolate* isolate, return function; } - void AddPropertyToPropertyList(Isolate* isolate, Handle templ, int length, Handle* data) { Object maybe_list = templ->property_list(); Handle list; - if (maybe_list->IsUndefined(isolate)) { + if (maybe_list.IsUndefined(isolate)) { list = TemplateList::New(isolate, length); } else { list = handle(TemplateList::cast(maybe_list), isolate); @@ -598,7 +595,6 @@ void ApiNatives::AddDataProperty(Isolate* isolate, Handle info, AddPropertyToPropertyList(isolate, info, arraysize(data), data); } - void ApiNatives::AddDataProperty(Isolate* isolate, Handle info, Handle name, v8::Intrinsic intrinsic, PropertyAttributes attributes) { @@ -610,7 +606,6 @@ void ApiNatives::AddDataProperty(Isolate* isolate, Handle info, AddPropertyToPropertyList(isolate, info, arraysize(data), data); } - void ApiNatives::AddAccessorProperty(Isolate* isolate, Handle info, Handle name, @@ -623,13 +618,12 @@ void ApiNatives::AddAccessorProperty(Isolate* isolate, AddPropertyToPropertyList(isolate, info, arraysize(data), data); } - void ApiNatives::AddNativeDataProperty(Isolate* isolate, Handle info, Handle property) { Object maybe_list = info->property_accessors(); Handle list; - if (maybe_list->IsUndefined(isolate)) { + if (maybe_list.IsUndefined(isolate)) { list = TemplateList::New(isolate, 1); } else { list = handle(TemplateList::cast(maybe_list), isolate); @@ -653,7 +647,7 @@ Handle ApiNatives::CreateApiFunction( if (obj->remove_prototype()) { DCHECK(prototype.is_null()); - DCHECK(result->shared()->IsApiFunction()); + DCHECK(result->shared().IsApiFunction()); DCHECK(!result->IsConstructor()); DCHECK(!result->has_prototype_slot()); return result; @@ -669,7 +663,7 @@ Handle ApiNatives::CreateApiFunction( if (prototype->IsTheHole(isolate)) { prototype = isolate->factory()->NewFunctionPrototype(result); - } else if (obj->GetPrototypeProviderTemplate()->IsUndefined(isolate)) { + } else if (obj->GetPrototypeProviderTemplate().IsUndefined(isolate)) { JSObject::AddProperty(isolate, Handle::cast(prototype), isolate->factory()->constructor_string(), result, DONT_ENUM); @@ -677,7 +671,7 @@ Handle ApiNatives::CreateApiFunction( int embedder_field_count = 0; bool immutable_proto = false; - if (!obj->GetInstanceTemplate()->IsUndefined(isolate)) { + if (!obj->GetInstanceTemplate().IsUndefined(isolate)) { Handle GetInstanceTemplate = Handle( ObjectTemplateInfo::cast(obj->GetInstanceTemplate()), isolate); embedder_field_count = GetInstanceTemplate->embedder_field_count(); @@ -700,7 +694,7 @@ Handle ApiNatives::CreateApiFunction( // undetectable and callable. If we ever see the need to have an object // that is undetectable but not callable, we need to update the types.h // to allow encoding this. - CHECK(!obj->GetInstanceCallHandler()->IsUndefined(isolate)); + CHECK(!obj->GetInstanceCallHandler().IsUndefined(isolate)); map->set_is_undetectable(true); } @@ -711,16 +705,16 @@ Handle ApiNatives::CreateApiFunction( } // Set interceptor information in the map. - if (!obj->GetNamedPropertyHandler()->IsUndefined(isolate)) { + if (!obj->GetNamedPropertyHandler().IsUndefined(isolate)) { map->set_has_named_interceptor(true); map->set_may_have_interesting_symbols(true); } - if (!obj->GetIndexedPropertyHandler()->IsUndefined(isolate)) { + if (!obj->GetIndexedPropertyHandler().IsUndefined(isolate)) { map->set_has_indexed_interceptor(true); } // Mark instance as callable in the map. - if (!obj->GetInstanceCallHandler()->IsUndefined(isolate)) { + if (!obj->GetInstanceCallHandler().IsUndefined(isolate)) { map->set_is_callable(true); map->set_is_constructor(!obj->undetectable()); } diff --git a/deps/v8/src/api-natives.h b/deps/v8/src/api/api-natives.h similarity index 89% rename from deps/v8/src/api-natives.h rename to deps/v8/src/api/api-natives.h index 9a9ae50da811e1..153212cc6c43d7 100644 --- a/deps/v8/src/api-natives.h +++ b/deps/v8/src/api/api-natives.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef V8_API_NATIVES_H_ -#define V8_API_NATIVES_H_ +#ifndef V8_API_API_NATIVES_H_ +#define V8_API_API_NATIVES_H_ #include "include/v8.h" #include "src/base/macros.h" -#include "src/handles.h" -#include "src/maybe-handles.h" -#include "src/objects.h" -#include "src/property-details.h" +#include "src/handles/handles.h" +#include "src/handles/maybe-handles.h" +#include "src/objects/objects.h" +#include "src/objects/property-details.h" namespace v8 { namespace internal { @@ -61,4 +61,4 @@ class ApiNatives { } // namespace internal } // namespace v8 -#endif // V8_API_NATIVES_H_ +#endif // V8_API_API_NATIVES_H_ diff --git a/deps/v8/src/api.cc b/deps/v8/src/api/api.cc similarity index 93% rename from deps/v8/src/api.cc rename to deps/v8/src/api/api.cc index 4127d6735adb28..0965e23632e3b1 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api/api.cc @@ -2,58 +2,62 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "src/api.h" +#include "src/api/api.h" #include // For memcpy, strlen. #include // For isnan. #include #include -#include "src/api-inl.h" +#include "src/api/api-inl.h" #include "include/v8-profiler.h" #include "include/v8-testing.h" #include "include/v8-util.h" -#include "src/accessors.h" -#include "src/api-natives.h" -#include "src/assert-scope.h" +#include "src/api/api-natives.h" #include "src/base/functional.h" #include "src/base/logging.h" #include "src/base/platform/platform.h" #include "src/base/platform/time.h" #include "src/base/safe_conversions.h" #include "src/base/utils/random-number-generator.h" -#include "src/bootstrapper.h" +#include "src/builtins/accessors.h" #include "src/builtins/builtins-utils.h" -#include "src/char-predicates-inl.h" +#include "src/codegen/compiler.h" +#include "src/codegen/cpu-features.h" +#include "src/common/assert-scope.h" +#include "src/common/globals.h" #include "src/compiler-dispatcher/compiler-dispatcher.h" -#include "src/compiler.h" -#include "src/contexts.h" -#include "src/conversions-inl.h" -#include "src/counters.h" -#include "src/cpu-features.h" -#include "src/date.h" +#include "src/date/date.h" #include "src/debug/debug-coverage.h" #include "src/debug/debug-evaluate.h" #include "src/debug/debug-type-profile.h" #include "src/debug/debug.h" #include "src/debug/liveedit.h" -#include "src/deoptimizer.h" -#include "src/detachable-vector.h" -#include "src/execution.h" -#include "src/frames-inl.h" -#include "src/gdb-jit.h" -#include "src/global-handles.h" -#include "src/globals.h" +#include "src/deoptimizer/deoptimizer.h" +#include "src/diagnostics/gdb-jit.h" +#include "src/execution/execution.h" +#include "src/execution/frames-inl.h" +#include "src/execution/isolate-inl.h" +#include "src/execution/messages.h" +#include "src/execution/microtask-queue.h" +#include "src/execution/runtime-profiler.h" +#include "src/execution/simulator.h" +#include "src/execution/v8threads.h" +#include "src/execution/vm-state-inl.h" +#include "src/handles/global-handles.h" +#include "src/heap/embedder-tracing.h" #include "src/heap/heap-inl.h" -#include "src/icu_util.h" -#include "src/isolate-inl.h" -#include "src/json-parser.h" -#include "src/json-stringifier.h" -#include "src/messages.h" -#include "src/microtask-queue.h" -#include "src/objects-inl.h" +#include "src/init/bootstrapper.h" +#include "src/init/icu_util.h" +#include "src/init/startup-data-util.h" +#include "src/init/v8.h" +#include "src/json/json-parser.h" +#include "src/json/json-stringifier.h" +#include "src/logging/counters.h" +#include "src/numbers/conversions-inl.h" #include "src/objects/api-callbacks.h" +#include "src/objects/contexts.h" #include "src/objects/embedder-data-array-inl.h" #include "src/objects/embedder-data-slot-inl.h" #include "src/objects/frame-array-inl.h" @@ -65,44 +69,41 @@ #include "src/objects/js-promise-inl.h" #include "src/objects/js-regexp-inl.h" #include "src/objects/module-inl.h" +#include "src/objects/objects-inl.h" #include "src/objects/oddball.h" #include "src/objects/ordered-hash-table-inl.h" +#include "src/objects/property-descriptor.h" +#include "src/objects/property-details.h" +#include "src/objects/property.h" +#include "src/objects/prototype.h" #include "src/objects/slots.h" #include "src/objects/smi.h" #include "src/objects/stack-frame-info-inl.h" #include "src/objects/templates.h" +#include "src/objects/value-serializer.h" #include "src/parsing/parse-info.h" #include "src/parsing/parser.h" +#include "src/parsing/pending-compilation-error-handler.h" #include "src/parsing/scanner-character-streams.h" -#include "src/pending-compilation-error-handler.h" #include "src/profiler/cpu-profiler.h" #include "src/profiler/heap-profiler.h" #include "src/profiler/heap-snapshot-generator-inl.h" #include "src/profiler/profile-generator-inl.h" #include "src/profiler/tick-sample.h" -#include "src/property-descriptor.h" -#include "src/property-details.h" -#include "src/property.h" -#include "src/prototype.h" -#include "src/runtime-profiler.h" #include "src/runtime/runtime.h" -#include "src/simulator.h" #include "src/snapshot/code-serializer.h" #include "src/snapshot/natives.h" #include "src/snapshot/partial-serializer.h" #include "src/snapshot/read-only-serializer.h" #include "src/snapshot/snapshot.h" #include "src/snapshot/startup-serializer.h" -#include "src/startup-data-util.h" -#include "src/string-hasher.h" +#include "src/strings/char-predicates-inl.h" +#include "src/strings/string-hasher.h" +#include "src/strings/unicode-inl.h" #include "src/tracing/trace-event.h" #include "src/trap-handler/trap-handler.h" -#include "src/unicode-inl.h" -#include "src/v8.h" -#include "src/v8threads.h" -#include "src/value-serializer.h" -#include "src/version.h" -#include "src/vm-state-inl.h" +#include "src/utils/detachable-vector.h" +#include "src/utils/version.h" #include "src/wasm/streaming-decoder.h" #include "src/wasm/wasm-engine.h" #include "src/wasm/wasm-objects-inl.h" @@ -121,7 +122,7 @@ #include "include/v8-wasm-trap-handler-win.h" #include "src/trap-handler/handler-inside-win.h" #if V8_TARGET_ARCH_X64 -#include "src/unwinding-info-win64.h" +#include "src/diagnostics/unwinding-info-win64.h" #endif // V8_TARGET_ARCH_X64 #endif // V8_OS_WIN @@ -239,7 +240,6 @@ namespace v8 { #define RETURN_TO_LOCAL_UNCHECKED(maybe_local, T) \ return maybe_local.FromMaybe(Local()); - #define RETURN_ESCAPED(value) return handle_scope.Escape(value); namespace { @@ -286,7 +286,7 @@ class CallDepthScope { i::Handle env = Utils::OpenHandle(*context); i::HandleScopeImplementer* impl = isolate->handle_scope_implementer(); if (!isolate->context().is_null() && - isolate->context()->native_context() == env->native_context()) { + isolate->context().native_context() == env->native_context()) { context_ = Local(); } else { impl->SaveContext(isolate->context()); @@ -302,7 +302,7 @@ class CallDepthScope { isolate_->set_context(impl->RestoreContext()); i::Handle env = Utils::OpenHandle(*context_); - microtask_queue = env->native_context()->microtask_queue(); + microtask_queue = env->native_context().microtask_queue(); } if (!escaped_) isolate_->handle_scope_implementer()->DecrementCallDepth(); if (do_callback) isolate_->FireCallCompletedCallback(microtask_queue); @@ -335,7 +335,6 @@ class CallDepthScope { } // namespace - static ScriptOrigin GetScriptOriginForScript(i::Isolate* isolate, i::Handle script) { i::Handle scriptName(script->GetNameOrSourceURL(), isolate); @@ -358,7 +357,6 @@ static ScriptOrigin GetScriptOriginForScript(i::Isolate* isolate, return origin; } - // --- E x c e p t i o n B e h a v i o r --- void i::FatalProcessOutOfMemory(i::Isolate* isolate, const char* location) { @@ -462,7 +460,6 @@ void i::V8::FatalProcessOutOfMemory(i::Isolate* isolate, const char* location, FATAL("API fatal error handler returned after process out of memory"); } - void Utils::ReportApiFailure(const char* location, const char* message) { i::Isolate* isolate = i::Isolate::Current(); FatalErrorCallback callback = nullptr; @@ -510,12 +507,10 @@ static inline bool IsExecutionTerminatingCheck(i::Isolate* isolate) { return false; } - void V8::SetNativesDataBlob(StartupData* natives_blob) { i::V8::SetNativesBlob(natives_blob); } - void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) { i::V8::SetSnapshotBlob(snapshot_blob); } @@ -648,7 +643,7 @@ size_t SnapshotCreator::AddData(i::Address object) { i::HandleScope scope(isolate); i::Handle obj(i::Object(object), isolate); i::Handle list; - if (!isolate->heap()->serialized_objects()->IsArrayList()) { + if (!isolate->heap()->serialized_objects().IsArrayList()) { list = i::ArrayList::New(isolate, 1); } else { list = i::Handle( @@ -668,7 +663,7 @@ size_t SnapshotCreator::AddData(Local context, i::Address object) { i::HandleScope scope(isolate); i::Handle obj(i::Object(object), isolate); i::Handle list; - if (!ctx->serialized_objects()->IsArrayList()) { + if (!ctx->serialized_objects().IsArrayList()) { list = i::ArrayList::New(isolate, 1); } else { list = i::Handle( @@ -684,7 +679,7 @@ namespace { void ConvertSerializedObjectsToFixedArray(Local context) { i::Handle ctx = Utils::OpenHandle(*context); i::Isolate* isolate = ctx->GetIsolate(); - if (!ctx->serialized_objects()->IsArrayList()) { + if (!ctx->serialized_objects().IsArrayList()) { ctx->set_serialized_objects(i::ReadOnlyRoots(isolate).empty_fixed_array()); } else { i::Handle list(i::ArrayList::cast(ctx->serialized_objects()), @@ -695,7 +690,7 @@ void ConvertSerializedObjectsToFixedArray(Local context) { } void ConvertSerializedObjectsToFixedArray(i::Isolate* isolate) { - if (!isolate->heap()->serialized_objects()->IsArrayList()) { + if (!isolate->heap()->serialized_objects().IsArrayList()) { isolate->heap()->SetSerializedObjects( i::ReadOnlyRoots(isolate).empty_fixed_array()); } else { @@ -737,7 +732,7 @@ StartupData SnapshotCreator::CreateBlob( i::Handle context = v8::Utils::OpenHandle(*data->contexts_.Get(i)); global_proxy_sizes->set(i, - i::Smi::FromInt(context->global_proxy()->Size())); + i::Smi::FromInt(context->global_proxy().Size())); } isolate->heap()->SetSerializedGlobalProxySizes(*global_proxy_sizes); } @@ -754,8 +749,6 @@ StartupData SnapshotCreator::CreateBlob( isolate->heap()->CompactWeakArrayLists(internal::AllocationType::kOld); } - isolate->heap()->read_only_space()->ClearStringPaddingIfNeeded(); - if (function_code_handling == FunctionCodeHandling::kClear) { // Clear out re-compilable data from all shared function infos. Any // JSFunctions using these SFIs will have their code pointers reset by the @@ -774,16 +767,16 @@ StartupData SnapshotCreator::CreateBlob( i::HeapIterator heap_iterator(isolate->heap()); for (i::HeapObject current_obj = heap_iterator.next(); !current_obj.is_null(); current_obj = heap_iterator.next()) { - if (current_obj->IsSharedFunctionInfo()) { + if (current_obj.IsSharedFunctionInfo()) { i::SharedFunctionInfo shared = i::SharedFunctionInfo::cast(current_obj); - if (shared->CanDiscardCompiled()) { + if (shared.CanDiscardCompiled()) { sfis_to_clear.emplace_back(shared, isolate); } - } else if (current_obj->IsJSRegExp()) { + } else if (current_obj.IsJSRegExp()) { i::JSRegExp regexp = i::JSRegExp::cast(current_obj); - if (regexp->HasCompiledCode()) { - regexp->DiscardCompiledCodeForSerialization(); + if (regexp.HasCompiledCode()) { + regexp.DiscardCompiledCodeForSerialization(); } } } @@ -820,23 +813,22 @@ StartupData SnapshotCreator::CreateBlob( i::HeapIterator heap_iterator(isolate->heap()); for (i::HeapObject current_obj = heap_iterator.next(); !current_obj.is_null(); current_obj = heap_iterator.next()) { - if (current_obj->IsJSFunction()) { + if (current_obj.IsJSFunction()) { i::JSFunction fun = i::JSFunction::cast(current_obj); // Complete in-object slack tracking for all functions. - fun->CompleteInobjectSlackTrackingIfActive(); + fun.CompleteInobjectSlackTrackingIfActive(); // Also, clear out feedback vectors, or any optimized code. - if (!fun->raw_feedback_cell()->value()->IsUndefined()) { - fun->raw_feedback_cell()->set_value( + if (!fun.raw_feedback_cell().value().IsUndefined()) { + fun.raw_feedback_cell().set_value( i::ReadOnlyRoots(isolate).undefined_value()); - fun->set_code(isolate->builtins()->builtin(i::Builtins::kCompileLazy)); + fun.set_code(isolate->builtins()->builtin(i::Builtins::kCompileLazy)); } if (function_code_handling == FunctionCodeHandling::kClear) { - DCHECK(fun->shared()->HasWasmExportedFunctionData() || - fun->shared()->HasBuiltinId() || - fun->shared()->IsApiFunction() || - fun->shared()->HasUncompiledDataWithoutPreparseData()); + DCHECK(fun.shared().HasWasmExportedFunctionData() || + fun.shared().HasBuiltinId() || fun.shared().IsApiFunction() || + fun.shared().HasUncompiledDataWithoutPreparseData()); } } } @@ -896,12 +888,16 @@ void V8::SetDcheckErrorHandler(DcheckErrorCallback that) { v8::base::SetDcheckFunction(that); } +void V8::SetFlagsFromString(const char* str) { + SetFlagsFromString(str, static_cast(strlen(str))); +} + void V8::SetFlagsFromString(const char* str, int length) { - i::FlagList::SetFlagsFromString(str, length); + CHECK_LE(0, length); + i::FlagList::SetFlagsFromString(str, static_cast(length)); i::FlagList::EnforceFlagImplications(); } - void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) { i::FlagList::SetFlagsFromCommandLine(argc, argv, remove_flags); } @@ -950,15 +946,12 @@ void RegisterExtension(std::unique_ptr extension) { RegisteredExtension::Register(std::move(extension)); } -Extension::Extension(const char* name, - const char* source, - int dep_count, - const char** deps, - int source_length) +Extension::Extension(const char* name, const char* source, int dep_count, + const char** deps, int source_length) : name_(name), - source_length_(source_length >= 0 ? - source_length : - (source ? static_cast(strlen(source)) : 0)), + source_length_(source_length >= 0 + ? source_length + : (source ? static_cast(strlen(source)) : 0)), dep_count_(dep_count), deps_(deps), auto_enable_(false) { @@ -1009,7 +1002,7 @@ i::Address* V8::GlobalizeReference(i::Isolate* isolate, i::Address* obj) { i::Handle result = isolate->global_handles()->Create(*obj); #ifdef VERIFY_HEAP if (i::FLAG_verify_heap) { - i::Object(*obj)->ObjectVerify(isolate); + i::Object(*obj).ObjectVerify(isolate); } #endif // VERIFY_HEAP return result.location(); @@ -1022,7 +1015,7 @@ i::Address* V8::GlobalizeTracedReference(i::Isolate* isolate, i::Address* obj, isolate->global_handles()->CreateTraced(*obj, slot); #ifdef VERIFY_HEAP if (i::FLAG_verify_heap) { - i::Object(*obj)->ObjectVerify(isolate); + i::Object(*obj).ObjectVerify(isolate); } #endif // VERIFY_HEAP return result.location(); @@ -1089,12 +1082,10 @@ Value* V8::Eternalize(Isolate* v8_isolate, Value* value) { isolate->eternal_handles()->Get(index).location()); } - void V8::FromJustIsNothing() { Utils::ApiCheck(false, "v8::FromJust", "Maybe value is Nothing."); } - void V8::ToLocalEmpty() { Utils::ApiCheck(false, "v8::ToLocalChecked", "Empty MaybeLocal."); } @@ -1105,14 +1096,9 @@ void V8::InternalFieldOutOfBounds(int index) { "Internal field out of bounds."); } - // --- H a n d l e s --- - -HandleScope::HandleScope(Isolate* isolate) { - Initialize(isolate); -} - +HandleScope::HandleScope(Isolate* isolate) { Initialize(isolate); } void HandleScope::Initialize(Isolate* isolate) { i::Isolate* internal_isolate = reinterpret_cast(isolate); @@ -1134,7 +1120,6 @@ void HandleScope::Initialize(Isolate* isolate) { current->level++; } - HandleScope::~HandleScope() { i::HandleScope::CloseScope(isolate_, prev_next_, prev_limit_); } @@ -1156,16 +1141,16 @@ i::Address* HandleScope::CreateHandle(i::Isolate* isolate, i::Address value) { EscapableHandleScope::EscapableHandleScope(Isolate* v8_isolate) { i::Isolate* isolate = reinterpret_cast(v8_isolate); escape_slot_ = - CreateHandle(isolate, i::ReadOnlyRoots(isolate).the_hole_value()->ptr()); + CreateHandle(isolate, i::ReadOnlyRoots(isolate).the_hole_value().ptr()); Initialize(v8_isolate); } i::Address* EscapableHandleScope::Escape(i::Address* escape_value) { i::Heap* heap = reinterpret_cast(GetIsolate())->heap(); - Utils::ApiCheck(i::Object(*escape_slot_)->IsTheHole(heap->isolate()), + Utils::ApiCheck(i::Object(*escape_slot_).IsTheHole(heap->isolate()), "EscapableHandleScope::Escape", "Escape value set twice"); if (escape_value == nullptr) { - *escape_slot_ = i::ReadOnlyRoots(heap).undefined_value()->ptr(); + *escape_slot_ = i::ReadOnlyRoots(heap).undefined_value().ptr(); return nullptr; } *escape_slot_ = *escape_value; @@ -1188,7 +1173,6 @@ SealHandleScope::SealHandleScope(Isolate* isolate) current->sealed_level = current->level; } - SealHandleScope::~SealHandleScope() { i::HandleScopeData* current = isolate_->handle_scope_data(); DCHECK_EQ(current->next, current->limit); @@ -1256,11 +1240,9 @@ static i::Handle EmbedderDataFor(Context* context, const char* location) { i::Handle env = Utils::OpenHandle(context); i::Isolate* isolate = env->GetIsolate(); - bool ok = - Utils::ApiCheck(env->IsNativeContext(), - location, - "Not a native context") && - Utils::ApiCheck(index >= 0, location, "Negative index"); + bool ok = Utils::ApiCheck(env->IsNativeContext(), location, + "Not a native context") && + Utils::ApiCheck(index >= 0, location, "Negative index"); if (!ok) return i::Handle(); // TODO(ishell): remove cast once embedder_data slot has a proper type. i::Handle data( @@ -1280,7 +1262,7 @@ uint32_t Context::GetNumberOfEmbedderDataFields() { CHECK(context->IsNativeContext()); // TODO(ishell): remove cast once embedder_data slot has a proper type. return static_cast( - i::EmbedderDataArray::cast(context->embedder_data())->length()); + i::EmbedderDataArray::cast(context->embedder_data()).length()); } v8::Local Context::SlowGetEmbedderData(int index) { @@ -1294,7 +1276,6 @@ v8::Local Context::SlowGetEmbedderData(int index) { return Utils::ToLocal(result); } - void Context::SetEmbedderData(int index, v8::Local value) { const char* location = "v8::Context::SetEmbedderData()"; i::Handle data = @@ -1306,7 +1287,6 @@ void Context::SetEmbedderData(int index, v8::Local value) { *Utils::OpenHandle(*GetEmbedderData(index))); } - void* Context::SlowGetAlignedPointerFromEmbedderData(int index) { const char* location = "v8::Context::GetAlignedPointerFromEmbedderData()"; i::Handle data = @@ -1318,7 +1298,6 @@ void* Context::SlowGetAlignedPointerFromEmbedderData(int index) { return result; } - void Context::SetAlignedPointerInEmbedderData(int index, void* value) { const char* location = "v8::Context::SetAlignedPointerInEmbedderData()"; i::Handle data = @@ -1328,16 +1307,13 @@ void Context::SetAlignedPointerInEmbedderData(int index, void* value) { DCHECK_EQ(value, GetAlignedPointerFromEmbedderData(index)); } - // --- T e m p l a t e --- - static void InitializeTemplate(i::Handle that, int type) { that->set_number_of_properties(0); that->set_tag(i::Smi::FromInt(type)); } - void Template::Set(v8::Local name, v8::Local value, v8::PropertyAttribute attribute) { auto templ = Utils::OpenHandle(this); @@ -1363,12 +1339,11 @@ void Template::SetPrivate(v8::Local name, v8::Local value, attribute); } -void Template::SetAccessorProperty( - v8::Local name, - v8::Local getter, - v8::Local setter, - v8::PropertyAttribute attribute, - v8::AccessControl access_control) { +void Template::SetAccessorProperty(v8::Local name, + v8::Local getter, + v8::Local setter, + v8::PropertyAttribute attribute, + v8::AccessControl access_control) { // TODO(verwaest): Remove |access_control|. DCHECK_EQ(v8::DEFAULT, access_control); auto templ = Utils::OpenHandle(this); @@ -1383,7 +1358,6 @@ void Template::SetAccessorProperty( static_cast(attribute)); } - // --- F u n c t i o n T e m p l a t e --- static void InitializeFunctionTemplate( i::Handle info) { @@ -1416,8 +1390,8 @@ void FunctionTemplate::SetPrototypeProviderTemplate( ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); i::Handle result = Utils::OpenHandle(*prototype_provider); auto info = Utils::OpenHandle(this); - CHECK(info->GetPrototypeTemplate()->IsUndefined(i_isolate)); - CHECK(info->GetParentTemplate()->IsUndefined(i_isolate)); + CHECK(info->GetPrototypeTemplate().IsUndefined(i_isolate)); + CHECK(info->GetParentTemplate().IsUndefined(i_isolate)); i::FunctionTemplateInfo::SetPrototypeProviderTemplate(i_isolate, info, result); } @@ -1428,13 +1402,12 @@ static void EnsureNotInstantiated(i::Handle info, "FunctionTemplate already instantiated"); } - void FunctionTemplate::Inherit(v8::Local value) { auto info = Utils::OpenHandle(this); EnsureNotInstantiated(info, "v8::FunctionTemplate::Inherit"); i::Isolate* i_isolate = info->GetIsolate(); ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); - CHECK(info->GetPrototypeProviderTemplate()->IsUndefined(i_isolate)); + CHECK(info->GetPrototypeProviderTemplate().IsUndefined(i_isolate)); i::FunctionTemplateInfo::SetParentTemplate(i_isolate, info, Utils::OpenHandle(*value)); } @@ -1492,9 +1465,9 @@ MaybeLocal FunctionTemplate::FromSnapshot(Isolate* isolate, i::Isolate* i_isolate = reinterpret_cast(isolate); i::FixedArray serialized_objects = i_isolate->heap()->serialized_objects(); int int_index = static_cast(index); - if (int_index < serialized_objects->length()) { - i::Object info = serialized_objects->get(int_index); - if (info->IsFunctionTemplateInfo()) { + if (int_index < serialized_objects.length()) { + i::Object info = serialized_objects.get(int_index); + if (info.IsFunctionTemplateInfo()) { return Utils::ToLocal(i::Handle( i::FunctionTemplateInfo::cast(info), i_isolate)); } @@ -1518,7 +1491,6 @@ Local Signature::New(Isolate* isolate, return Utils::SignatureToLocal(Utils::OpenHandle(*receiver)); } - Local AccessorSignature::New( Isolate* isolate, Local receiver) { return Utils::AccessorSignatureToLocal(Utils::OpenHandle(*receiver)); @@ -1549,7 +1521,6 @@ void FunctionTemplate::SetCallHandler(FunctionCallback callback, info->set_call_code(*obj); } - namespace { template @@ -1602,7 +1573,7 @@ Local FunctionTemplate::InstanceTemplate() { } i::Isolate* isolate = handle->GetIsolate(); ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - if (handle->GetInstanceTemplate()->IsUndefined(isolate)) { + if (handle->GetInstanceTemplate().IsUndefined(isolate)) { Local templ = ObjectTemplate::New(isolate, ToApiHandle(handle)); i::FunctionTemplateInfo::SetInstanceTemplate(isolate, handle, @@ -1613,7 +1584,6 @@ Local FunctionTemplate::InstanceTemplate() { return Utils::ToLocal(result); } - void FunctionTemplate::SetLength(int length) { auto info = Utils::OpenHandle(this); EnsureNotInstantiated(info, "v8::FunctionTemplate::SetLength"); @@ -1622,7 +1592,6 @@ void FunctionTemplate::SetLength(int length) { info->set_length(length); } - void FunctionTemplate::SetClassName(Local name) { auto info = Utils::OpenHandle(this); EnsureNotInstantiated(info, "v8::FunctionTemplate::SetClassName"); @@ -1631,7 +1600,6 @@ void FunctionTemplate::SetClassName(Local name) { info->set_class_name(*Utils::OpenHandle(*name)); } - void FunctionTemplate::SetAcceptAnyReceiver(bool value) { auto info = Utils::OpenHandle(this); EnsureNotInstantiated(info, "v8::FunctionTemplate::SetAcceptAnyReceiver"); @@ -1640,16 +1608,10 @@ void FunctionTemplate::SetAcceptAnyReceiver(bool value) { info->set_accept_any_receiver(value); } - void FunctionTemplate::SetHiddenPrototype(bool value) { - auto info = Utils::OpenHandle(this); - EnsureNotInstantiated(info, "v8::FunctionTemplate::SetHiddenPrototype"); - auto isolate = info->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - info->set_hidden_prototype(value); + /* No-op for ABI compatibility. */ } - void FunctionTemplate::ReadOnlyPrototype() { auto info = Utils::OpenHandle(this); EnsureNotInstantiated(info, "v8::FunctionTemplate::ReadOnlyPrototype"); @@ -1658,7 +1620,6 @@ void FunctionTemplate::ReadOnlyPrototype() { info->set_read_only_prototype(true); } - void FunctionTemplate::RemovePrototype() { auto info = Utils::OpenHandle(this); EnsureNotInstantiated(info, "v8::FunctionTemplate::RemovePrototype"); @@ -1667,16 +1628,13 @@ void FunctionTemplate::RemovePrototype() { info->set_remove_prototype(true); } - // --- O b j e c t T e m p l a t e --- - Local ObjectTemplate::New( Isolate* isolate, v8::Local constructor) { return New(reinterpret_cast(isolate), constructor); } - static Local ObjectTemplateNew( i::Isolate* isolate, v8::Local constructor, bool do_not_cache) { @@ -1708,9 +1666,9 @@ MaybeLocal ObjectTemplate::FromSnapshot(Isolate* isolate, i::Isolate* i_isolate = reinterpret_cast(isolate); i::FixedArray serialized_objects = i_isolate->heap()->serialized_objects(); int int_index = static_cast(index); - if (int_index < serialized_objects->length()) { - i::Object info = serialized_objects->get(int_index); - if (info->IsObjectTemplateInfo()) { + if (int_index < serialized_objects.length()) { + i::Object info = serialized_objects.get(int_index); + if (info.IsObjectTemplateInfo()) { return Utils::ToLocal(i::Handle( i::ObjectTemplateInfo::cast(info), i_isolate)); } @@ -1721,10 +1679,9 @@ MaybeLocal ObjectTemplate::FromSnapshot(Isolate* isolate, // Ensure that the object template has a constructor. If no // constructor is available we create one. static i::Handle EnsureConstructor( - i::Isolate* isolate, - ObjectTemplate* object_template) { + i::Isolate* isolate, ObjectTemplate* object_template) { i::Object obj = Utils::OpenHandle(object_template)->constructor(); - if (!obj->IsUndefined(isolate)) { + if (!obj.IsUndefined(isolate)) { i::FunctionTemplateInfo info = i::FunctionTemplateInfo::cast(obj); return i::Handle(info, isolate); } @@ -1917,7 +1874,6 @@ void ObjectTemplate::SetHandler( config.flags); } - void ObjectTemplate::MarkAsUndetectable() { i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); @@ -1927,7 +1883,6 @@ void ObjectTemplate::MarkAsUndetectable() { cons->set_undetectable(true); } - void ObjectTemplate::SetAccessCheckCallback(AccessCheckCallback callback, Local data) { i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); @@ -2057,7 +2012,6 @@ void ObjectTemplate::SetImmutableProto() { // --- S c r i p t s --- - // Internally, UnboundScript is a SharedFunctionInfo, and Script is a // JSFunction. @@ -2068,7 +2022,6 @@ ScriptCompiler::CachedData::CachedData(const uint8_t* data_, int length_, rejected(false), buffer_policy(buffer_policy_) {} - ScriptCompiler::CachedData::~CachedData() { if (buffer_policy == BufferOwned) { delete[] data; @@ -2110,13 +2063,12 @@ int UnboundScript::GetId() { return script->id(); } - int UnboundScript::GetLineNumber(int code_pos) { i::Handle obj = i::Handle::cast(Utils::OpenHandle(this)); i::Isolate* isolate = obj->GetIsolate(); LOG_API(isolate, UnboundScript, GetLineNumber); - if (obj->script()->IsScript()) { + if (obj->script().IsScript()) { i::Handle script(i::Script::cast(obj->script()), isolate); return i::Script::GetLineNumber(script, code_pos); } else { @@ -2124,49 +2076,45 @@ int UnboundScript::GetLineNumber(int code_pos) { } } - Local UnboundScript::GetScriptName() { i::Handle obj = i::Handle::cast(Utils::OpenHandle(this)); i::Isolate* isolate = obj->GetIsolate(); LOG_API(isolate, UnboundScript, GetName); - if (obj->script()->IsScript()) { - i::Object name = i::Script::cast(obj->script())->name(); + if (obj->script().IsScript()) { + i::Object name = i::Script::cast(obj->script()).name(); return Utils::ToLocal(i::Handle(name, isolate)); } else { return Local(); } } - Local UnboundScript::GetSourceURL() { i::Handle obj = i::Handle::cast(Utils::OpenHandle(this)); i::Isolate* isolate = obj->GetIsolate(); LOG_API(isolate, UnboundScript, GetSourceURL); - if (obj->script()->IsScript()) { - i::Object url = i::Script::cast(obj->script())->source_url(); + if (obj->script().IsScript()) { + i::Object url = i::Script::cast(obj->script()).source_url(); return Utils::ToLocal(i::Handle(url, isolate)); } else { return Local(); } } - Local UnboundScript::GetSourceMappingURL() { i::Handle obj = i::Handle::cast(Utils::OpenHandle(this)); i::Isolate* isolate = obj->GetIsolate(); LOG_API(isolate, UnboundScript, GetSourceMappingURL); - if (obj->script()->IsScript()) { - i::Object url = i::Script::cast(obj->script())->source_mapping_url(); + if (obj->script().IsScript()) { + i::Object url = i::Script::cast(obj->script()).source_mapping_url(); return Utils::ToLocal(i::Handle(url, isolate)); } else { return Local(); } } - MaybeLocal Script::Run(Local context) { auto isolate = reinterpret_cast(context->GetIsolate()); TRACE_EVENT_CALL_STATS_SCOPED(isolate, "v8", "V8.Execute"); @@ -2186,7 +2134,6 @@ MaybeLocal Script::Run(Local context) { RETURN_ESCAPED(result); } - Local ScriptOrModule::GetResourceName() { i::Handle obj = Utils::OpenHandle(this); i::Isolate* isolate = obj->GetIsolate(); @@ -2205,8 +2152,8 @@ Local ScriptOrModule::GetHostDefinedOptions() { Local Script::GetUnboundScript() { i::Handle obj = Utils::OpenHandle(this); - i::SharedFunctionInfo sfi = i::JSFunction::cast(*obj)->shared(); - i::Isolate* isolate = sfi->GetIsolate(); + i::SharedFunctionInfo sfi = i::JSFunction::cast(*obj).shared(); + i::Isolate* isolate = sfi.GetIsolate(); return ToApiHandle(i::handle(sfi, isolate)); } @@ -2280,14 +2227,14 @@ Local Module::GetException() const { int Module::GetModuleRequestsLength() const { i::Handle self = Utils::OpenHandle(this); - return self->info()->module_requests()->length(); + return self->info().module_requests().length(); } Local Module::GetModuleRequest(int i) const { CHECK_GE(i, 0); i::Handle self = Utils::OpenHandle(this); i::Isolate* isolate = self->GetIsolate(); - i::Handle module_requests(self->info()->module_requests(), + i::Handle module_requests(self->info().module_requests(), isolate); CHECK_LT(i, module_requests->length()); return ToApiHandle(i::handle(module_requests->get(i), isolate)); @@ -2299,7 +2246,7 @@ Location Module::GetModuleRequestLocation(int i) const { i::HandleScope scope(isolate); i::Handle self = Utils::OpenHandle(this); i::Handle module_request_positions( - self->info()->module_request_positions(), isolate); + self->info().module_request_positions(), isolate); CHECK_LT(i, module_request_positions->length()); int position = i::Smi::ToInt(module_request_positions->get(i)); i::Handle script(self->script(), isolate); @@ -2684,7 +2631,6 @@ MaybeLocal