diff --git a/deps/v8/.clang-tidy b/deps/v8/.clang-tidy new file mode 100644 index 00000000000000..31d7ddc750011f --- /dev/null +++ b/deps/v8/.clang-tidy @@ -0,0 +1,20 @@ +--- +--- + Checks: '-*, + modernize-redundant-void-arg, + modernize-replace-random-shuffle, + modernize-shrink-to-fit, + modernize-use-auto, + modernize-use-bool-literals, + modernize-use-equals-default, + modernize-use-equals-delete, + modernize-use-nullptr, + modernize-use-override, + google-build-explicit-make-pair, + google-explicit-constructor, + google-readability-casting' +WarningsAsErrors: '' +HeaderFilterRegex: '' +AnalyzeTemporaryDtors: false +... + diff --git a/deps/v8/.gitattributes b/deps/v8/.gitattributes index 7ef1e1b74b01e0..b3e9762a9392a1 100644 --- a/deps/v8/.gitattributes +++ b/deps/v8/.gitattributes @@ -3,3 +3,5 @@ # Do not modify line endings for binary files (which are sometimes auto # detected as text files by git). *.png binary +# Don't include minified JS in git grep/diff output +test/mjsunit/asm/sqlite3/*.js -diff diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index 511e24d90c740f..7f09c89e360f8e 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -73,7 +73,6 @@ /tools/clang /tools/gcmole/gcmole-tools /tools/gcmole/gcmole-tools.tar.gz -/tools/gyp /tools/jsfunfuzz/jsfunfuzz /tools/jsfunfuzz/jsfunfuzz.tar.gz /tools/luci-go diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index 898bc8feaecd08..b935565945dad7 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -132,6 +132,7 @@ Peter Rybin Peter Varga Peter Wong Paul Lind +PhistucK Qingyan Li Qiuyi Zhang Rafal Krypa @@ -162,6 +163,7 @@ Vladimir Krivosheev Vladimir Shutoff Wiktor Garbacz Xiaoyin Liu +Yannic Bonenberger Yong Wang Yu Yin Zac Hansen diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index 7e3406fb6760b6..83f1fdb0bf75dd 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -76,9 +76,6 @@ declare_args() { v8_enable_embedded_builtins = v8_use_snapshot && v8_current_cpu != "x86" && !is_aix && (!is_win || is_clang) - # Enable embedded bytecode handlers. - v8_enable_embedded_bytecode_handlers = false - # Enable code-generation-time checking of types in the CodeStubAssembler. v8_enable_verify_csa = false @@ -164,6 +161,17 @@ declare_args() { # setting the "check_v8_header_includes" gclient variable to run a # specific hook). v8_check_header_includes = false + + # We reuse the snapshot toolchain for building torque and other generators to + # avoid building v8_libbase on the host more than once. On mips with big + # endian, the snapshot toolchain is the target toolchain and, hence, can't be + # used. +} + +v8_generator_toolchain = v8_snapshot_toolchain +if (host_cpu == "x64" && + (v8_current_cpu == "mips" || v8_current_cpu == "mips64")) { + v8_generator_toolchain = "//build/toolchain/linux:clang_x64" } # Derived defaults. @@ -197,9 +205,6 @@ assert( !v8_untrusted_code_mitigations, "Embedded builtins on ia32 and untrusted code mitigations are incompatible") -assert(!v8_enable_embedded_bytecode_handlers || v8_enable_embedded_builtins, - "Embedded bytecode handlers only work with embedded builtins") - # 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 # snapshots. @@ -377,10 +382,10 @@ config("features") { defines += [ "V8_CHECK_MICROTASKS_SCOPES_CONSISTENCY" ] } if (v8_enable_embedded_builtins) { - defines += [ "V8_EMBEDDED_BUILTINS" ] - } - if (v8_enable_embedded_bytecode_handlers) { - defines += [ "V8_EMBEDDED_BYTECODE_HANDLERS" ] + defines += [ + "V8_EMBEDDED_BUILTINS", + "V8_EMBEDDED_BYTECODE_HANDLERS", + ] } if (v8_use_multi_snapshots) { defines += [ "V8_MULTI_SNAPSHOTS" ] @@ -849,6 +854,8 @@ action("postmortem-metadata") { sources = [ "src/objects.h", "src/objects-inl.h", + "src/objects/allocation-site-inl.h", + "src/objects/allocation-site.h", "src/objects/code-inl.h", "src/objects/code.h", "src/objects/data-handler.h", @@ -859,6 +866,8 @@ action("postmortem-metadata") { "src/objects/js-array.h", "src/objects/js-array-buffer-inl.h", "src/objects/js-array-buffer.h", + "src/objects/js-objects-inl.h", + "src/objects/js-objects.h", "src/objects/js-regexp-inl.h", "src/objects/js-regexp.h", "src/objects/js-regexp-string-iterator-inl.h", @@ -889,7 +898,10 @@ torque_files = [ "src/builtins/array.tq", "src/builtins/array-copywithin.tq", "src/builtins/array-foreach.tq", + "src/builtins/array-lastindexof.tq", "src/builtins/array-reverse.tq", + "src/builtins/array-splice.tq", + "src/builtins/array-unshift.tq", "src/builtins/typed-array.tq", "src/builtins/data-view.tq", "test/torque/test-torque.tq", @@ -911,17 +923,8 @@ action("run_torque") { "test/cctest/:*", ] - # We reuse the snapshot toolchain for building torque to not build v8_libbase - # on the host more than once. On mips with big endian, the snapshot toolchain - # is the target toolchain and, hence, can't be used. - v8_torque_toolchain = v8_snapshot_toolchain - if (host_cpu == "x64" && - (v8_current_cpu == "mips" || v8_current_cpu == "mips64")) { - v8_torque_toolchain = "//build/toolchain/linux:clang_x64" - } - deps = [ - ":torque($v8_torque_toolchain)", + ":torque($v8_generator_toolchain)", ] script = "tools/run.py" @@ -939,7 +942,7 @@ action("run_torque") { } args = [ - "./" + rebase_path(get_label_info(":torque($v8_torque_toolchain)", + "./" + rebase_path(get_label_info(":torque($v8_generator_toolchain)", "root_out_dir") + "/torque", root_build_dir), "-o", @@ -969,6 +972,7 @@ v8_source_set("torque_generated_initializers") { visibility = [ ":*" ] # Only targets in this file can depend on this. deps = [ + ":generate_bytecode_builtins_list", ":run_torque", ] @@ -989,6 +993,24 @@ v8_source_set("torque_generated_initializers") { configs = [ ":internal_config" ] } +action("generate_bytecode_builtins_list") { + script = "tools/run.py" + outputs = [ + "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h", + ] + deps = [ + ":bytecode_builtins_list_generator($v8_generator_toolchain)", + ] + args = [ + "./" + rebase_path( + get_label_info( + ":bytecode_builtins_list_generator($v8_generator_toolchain)", + "root_out_dir") + "/bytecode_builtins_list_generator", + root_build_dir), + rebase_path("$target_gen_dir/builtins-generated/bytecodes-builtins-list.h"), + ] +} + # Template to generate different V8 snapshots based on different runtime flags. # Can be invoked with run_mksnapshot(). The target will resolve to # run_mksnapshot_. If is "default", no file suffixes will be used. @@ -1382,8 +1404,6 @@ v8_source_set("v8_initializers") { "src/interpreter/interpreter-generator.h", "src/interpreter/interpreter-intrinsics-generator.cc", "src/interpreter/interpreter-intrinsics-generator.h", - "src/interpreter/setup-interpreter-internal.cc", - "src/interpreter/setup-interpreter.h", ] if (use_jumbo_build == true) { @@ -1485,6 +1505,7 @@ v8_header_set("v8_headers") { configs = [ ":internal_config" ] sources = [ + "include/v8-internal.h", "include/v8.h", "include/v8config.h", ] @@ -1504,8 +1525,10 @@ v8_source_set("v8_base") { "//base/trace_event/common/trace_event_common.h", ### gcmole(all) ### + "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h", "include/v8-inspector-protocol.h", "include/v8-inspector.h", + "include/v8-internal.h", "include/v8-platform.h", "include/v8-profiler.h", "include/v8-testing.h", @@ -1516,6 +1539,7 @@ v8_source_set("v8_base") { "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", @@ -1562,6 +1586,7 @@ v8_source_set("v8_base") { "src/ast/modules.h", "src/ast/prettyprinter.cc", "src/ast/prettyprinter.h", + "src/ast/scopes-inl.h", "src/ast/scopes.cc", "src/ast/scopes.h", "src/ast/variables.cc", @@ -1599,7 +1624,6 @@ v8_source_set("v8_base") { "src/builtins/builtins-internal.cc", "src/builtins/builtins-interpreter.cc", "src/builtins/builtins-intl.cc", - "src/builtins/builtins-intl.h", "src/builtins/builtins-json.cc", "src/builtins/builtins-math.cc", "src/builtins/builtins-number.cc", @@ -1813,6 +1837,7 @@ v8_source_set("v8_base") { "src/compiler/operator.h", "src/compiler/osr.cc", "src/compiler/osr.h", + "src/compiler/per-isolate-compiler-cache.h", "src/compiler/persistent-map.h", "src/compiler/pipeline-statistics.cc", "src/compiler/pipeline-statistics.h", @@ -1824,6 +1849,8 @@ v8_source_set("v8_base") { "src/compiler/raw-machine-assembler.h", "src/compiler/redundancy-elimination.cc", "src/compiler/redundancy-elimination.h", + "src/compiler/refs-map.cc", + "src/compiler/refs-map.h", "src/compiler/register-allocator-verifier.cc", "src/compiler/register-allocator-verifier.h", "src/compiler/register-allocator.cc", @@ -2140,6 +2167,8 @@ v8_source_set("v8_base") { "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/messages.cc", @@ -2158,6 +2187,7 @@ v8_source_set("v8_base") { "src/objects/arguments.h", "src/objects/bigint.cc", "src/objects/bigint.h", + "src/objects/builtin-function-id.h", "src/objects/code-inl.h", "src/objects/code.h", "src/objects/compilation-cache-inl.h", @@ -2181,11 +2211,17 @@ v8_source_set("v8_base") { "src/objects/js-array-buffer.h", "src/objects/js-array-inl.h", "src/objects/js-array.h", + "src/objects/js-break-iterator-inl.h", + "src/objects/js-break-iterator.cc", + "src/objects/js-break-iterator.h", "src/objects/js-collator-inl.h", "src/objects/js-collator.cc", "src/objects/js-collator.h", "src/objects/js-collection-inl.h", "src/objects/js-collection.h", + "src/objects/js-date-time-format-inl.h", + "src/objects/js-date-time-format.cc", + "src/objects/js-date-time-format.h", "src/objects/js-generator-inl.h", "src/objects/js-generator.h", "src/objects/js-list-format-inl.h", @@ -2194,6 +2230,11 @@ v8_source_set("v8_base") { "src/objects/js-locale-inl.h", "src/objects/js-locale.cc", "src/objects/js-locale.h", + "src/objects/js-number-format-inl.h", + "src/objects/js-number-format.cc", + "src/objects/js-number-format.h", + "src/objects/js-objects-inl.h", + "src/objects/js-objects.h", "src/objects/js-plural-rules-inl.h", "src/objects/js-plural-rules.cc", "src/objects/js-plural-rules.h", @@ -2208,6 +2249,9 @@ v8_source_set("v8_base") { "src/objects/js-relative-time-format-inl.h", "src/objects/js-relative-time-format.cc", "src/objects/js-relative-time-format.h", + "src/objects/js-segmenter-inl.h", + "src/objects/js-segmenter.cc", + "src/objects/js-segmenter.h", "src/objects/literal-objects-inl.h", "src/objects/literal-objects.cc", "src/objects/literal-objects.h", @@ -2218,6 +2262,9 @@ v8_source_set("v8_base") { "src/objects/maybe-object-inl.h", "src/objects/maybe-object.h", "src/objects/microtask-inl.h", + "src/objects/microtask-queue-inl.h", + "src/objects/microtask-queue.cc", + "src/objects/microtask-queue.h", "src/objects/microtask.h", "src/objects/module-inl.h", "src/objects/module.cc", @@ -2231,6 +2278,8 @@ v8_source_set("v8_base") { "src/objects/ordered-hash-table.h", "src/objects/promise-inl.h", "src/objects/promise.h", + "src/objects/property-array-inl.h", + "src/objects/property-array.h", "src/objects/property-descriptor-object-inl.h", "src/objects/property-descriptor-object.h", "src/objects/prototype-info-inl.h", @@ -2242,6 +2291,8 @@ v8_source_set("v8_base") { "src/objects/script.h", "src/objects/shared-function-info-inl.h", "src/objects/shared-function-info.h", + "src/objects/stack-frame-info-inl.h", + "src/objects/stack-frame-info.h", "src/objects/string-inl.h", "src/objects/string-table.h", "src/objects/string.h", @@ -2267,6 +2318,7 @@ v8_source_set("v8_base") { "src/parsing/parsing.cc", "src/parsing/parsing.h", "src/parsing/pattern-rewriter.cc", + "src/parsing/preparsed-scope-data-impl.h", "src/parsing/preparsed-scope-data.cc", "src/parsing/preparsed-scope-data.h", "src/parsing/preparser-logger.h", @@ -2323,6 +2375,8 @@ v8_source_set("v8_base") { "src/regexp/jsregexp-inl.h", "src/regexp/jsregexp.cc", "src/regexp/jsregexp.h", + "src/regexp/property-sequences.cc", + "src/regexp/property-sequences.h", "src/regexp/regexp-ast.cc", "src/regexp/regexp-ast.h", "src/regexp/regexp-macro-assembler-irregexp-inl.h", @@ -2344,6 +2398,7 @@ v8_source_set("v8_base") { "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", @@ -2363,7 +2418,6 @@ v8_source_set("v8_base") { "src/runtime/runtime-interpreter.cc", "src/runtime/runtime-intl.cc", "src/runtime/runtime-literals.cc", - "src/runtime/runtime-maths.cc", "src/runtime/runtime-module.cc", "src/runtime/runtime-numbers.cc", "src/runtime/runtime-object.cc", @@ -2395,8 +2449,6 @@ v8_source_set("v8_base") { "src/snapshot/builtin-serializer-allocator.h", "src/snapshot/builtin-serializer.cc", "src/snapshot/builtin-serializer.h", - "src/snapshot/builtin-snapshot-utils.cc", - "src/snapshot/builtin-snapshot-utils.h", "src/snapshot/code-serializer.cc", "src/snapshot/code-serializer.h", "src/snapshot/default-deserializer-allocator.cc", @@ -2439,6 +2491,8 @@ v8_source_set("v8_base") { "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", @@ -2447,6 +2501,7 @@ v8_source_set("v8_base") { "src/strtod.cc", "src/strtod.h", "src/third_party/utf8-decoder/utf8-decoder.h", + "src/torque-assembler.h", "src/tracing/trace-event.cc", "src/tracing/trace-event.h", "src/tracing/traced-value.cc", @@ -2518,6 +2573,7 @@ v8_source_set("v8_base") { "src/wasm/module-compiler.h", "src/wasm/module-decoder.cc", "src/wasm/module-decoder.h", + "src/wasm/object-access.h", "src/wasm/signature-map.cc", "src/wasm/signature-map.h", "src/wasm/streaming-decoder.cc", @@ -2869,6 +2925,7 @@ v8_source_set("v8_base") { defines = [] deps = [ + ":generate_bytecode_builtins_list", ":torque_generated_core", ":v8_headers", ":v8_libbase", @@ -2886,28 +2943,39 @@ v8_source_set("v8_base") { } else { sources -= [ "src/builtins/builtins-intl.cc", - "src/builtins/builtins-intl.h", "src/char-predicates.cc", "src/intl.cc", "src/intl.h", "src/objects/intl-objects-inl.h", "src/objects/intl-objects.cc", "src/objects/intl-objects.h", + "src/objects/js-break-iterator-inl.h", + "src/objects/js-break-iterator.cc", + "src/objects/js-break-iterator.h", "src/objects/js-collator-inl.h", "src/objects/js-collator.cc", "src/objects/js-collator.h", + "src/objects/js-date-time-format-inl.h", + "src/objects/js-date-time-format.cc", + "src/objects/js-date-time-format.h", "src/objects/js-list-format-inl.h", "src/objects/js-list-format.cc", "src/objects/js-list-format.h", "src/objects/js-locale-inl.h", "src/objects/js-locale.cc", "src/objects/js-locale.h", + "src/objects/js-number-format-inl.h", + "src/objects/js-number-format.cc", + "src/objects/js-number-format.h", "src/objects/js-plural-rules-inl.h", "src/objects/js-plural-rules.cc", "src/objects/js-plural-rules.h", "src/objects/js-relative-time-format-inl.h", "src/objects/js-relative-time-format.cc", "src/objects/js-relative-time-format.h", + "src/objects/js-segmenter-inl.h", + "src/objects/js-segmenter.cc", + "src/objects/js-segmenter.h", "src/runtime/runtime-intl.cc", ] } @@ -2916,6 +2984,15 @@ v8_source_set("v8_base") { sources += [ "$target_gen_dir/debug-support.cc" ] deps += [ ":postmortem-metadata" ] } + + # Platforms that don't have CAS support need to link atomic library + # to implement atomic memory access + if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel" || + v8_current_cpu == "mips64" || v8_current_cpu == "mips64el" || + v8_current_cpu == "ppc" || v8_current_cpu == "ppc64" || + v8_current_cpu == "s390" || v8_current_cpu == "s390x") { + libs = [ "atomic" ] + } } v8_source_set("torque_base") { @@ -2923,7 +3000,11 @@ v8_source_set("torque_base") { sources = [ "src/torque/ast.h", + "src/torque/cfg.cc", + "src/torque/cfg.h", "src/torque/contextual.h", + "src/torque/csa-generator.cc", + "src/torque/csa-generator.h", "src/torque/declarable.cc", "src/torque/declarable.h", "src/torque/declaration-visitor.cc", @@ -2937,6 +3018,8 @@ v8_source_set("torque_base") { "src/torque/global-context.h", "src/torque/implementation-visitor.cc", "src/torque/implementation-visitor.h", + "src/torque/instructions.cc", + "src/torque/instructions.h", "src/torque/scope.cc", "src/torque/scope.h", "src/torque/source-positions.cc", @@ -2956,11 +3039,15 @@ v8_source_set("torque_base") { ] configs = [ ":internal_config" ] + if (is_win && is_asan) { + remove_configs = [ "//build/config/sanitizers:default_sanitizer_flags" ] + } } v8_component("v8_libbase") { sources = [ "src/base/adapters.h", + "src/base/address-region.h", "src/base/atomic-utils.h", "src/base/atomicops.h", "src/base/atomicops_internals_atomicword_compat.h", @@ -2969,6 +3056,8 @@ v8_component("v8_libbase") { "src/base/base-export.h", "src/base/bits.cc", "src/base/bits.h", + "src/base/bounded-page-allocator.cc", + "src/base/bounded-page-allocator.h", "src/base/build_config.h", "src/base/compiler-specific.h", "src/base/cpu.cc", @@ -2994,6 +3083,8 @@ 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", @@ -3010,6 +3101,8 @@ v8_component("v8_libbase") { "src/base/platform/semaphore.h", "src/base/platform/time.cc", "src/base/platform/time.h", + "src/base/region-allocator.cc", + "src/base/region-allocator.h", "src/base/ring-buffer.h", "src/base/safe_conversions.h", "src/base/safe_conversions_impl.h", @@ -3237,6 +3330,29 @@ if (v8_monolithic) { # Executables # +if (current_toolchain == v8_generator_toolchain) { + v8_executable("bytecode_builtins_list_generator") { + visibility = [ ":*" ] # Only targets in this file can depend on this. + + include_dirs = [ "." ] + + sources = [ + "src/builtins/generate-bytecodes-builtins-list.cc", + "src/interpreter/bytecode-operands.cc", + "src/interpreter/bytecode-operands.h", + "src/interpreter/bytecodes.cc", + "src/interpreter/bytecodes.h", + ] + + configs = [ ":internal_config" ] + + deps = [ + ":v8_libbase", + "//build/win:default_exe_manifest", + ] + } +} + if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) { v8_executable("mksnapshot") { visibility = [ ":*" ] # Only targets in this file can depend on this. @@ -3272,6 +3388,9 @@ if (current_toolchain == v8_snapshot_toolchain) { ] configs = [ ":internal_config" ] + if (is_win && is_asan) { + remove_configs = [ "//build/config/sanitizers:default_sanitizer_flags" ] + } } } @@ -3325,11 +3444,32 @@ group("v8_clusterfuzz") { } group("v8_archive") { + testonly = true + deps = [ ":d8", + "test/cctest:cctest", ] } +# TODO(dglazkov): Remove the "!build_with_chromium" condition once this clause +# is removed from Chromium. +if (is_fuchsia && !build_with_chromium) { + import("//build/config/fuchsia/rules.gni") + + fuchsia_package("d8_fuchsia_pkg") { + testonly = true + binary = ":d8" + package_name_override = "d8" + } + + fuchsia_package_runner("d8_fuchsia") { + testonly = true + package = ":d8_fuchsia_pkg" + package_name_override = "d8" + } +} + group("v8_fuzzers") { testonly = true data_deps = [ @@ -3636,6 +3776,7 @@ v8_source_set("wasm_module_runner") { ] deps = [ + ":generate_bytecode_builtins_list", ":torque_generated_core", ] @@ -3719,6 +3860,7 @@ v8_source_set("lib_wasm_fuzzer_common") { ] deps = [ + ":generate_bytecode_builtins_list", ":torque_generated_core", ] diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index 428325ad58c974..a3377ab473cdf4 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,1643 @@ +2018-10-09: Version 7.1.302 + + Performance and stability improvements on all platforms. + + +2018-10-09: Version 7.1.301 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.300 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.299 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.298 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.297 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.296 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.295 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.294 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.293 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.292 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.291 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.290 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.289 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.288 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.287 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.286 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.285 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.284 + + Performance and stability improvements on all platforms. + + +2018-10-08: Version 7.1.283 + + Performance and stability improvements on all platforms. + + +2018-10-07: Version 7.1.282 + + Performance and stability improvements on all platforms. + + +2018-10-07: Version 7.1.281 + + Performance and stability improvements on all platforms. + + +2018-10-07: Version 7.1.280 + + Performance and stability improvements on all platforms. + + +2018-10-06: Version 7.1.279 + + Performance and stability improvements on all platforms. + + +2018-10-06: Version 7.1.278 + + Performance and stability improvements on all platforms. + + +2018-10-06: Version 7.1.277 + + Performance and stability improvements on all platforms. + + +2018-10-06: Version 7.1.276 + + Performance and stability improvements on all platforms. + + +2018-10-06: Version 7.1.275 + + Performance and stability improvements on all platforms. + + +2018-10-05: Version 7.1.274 + + Performance and stability improvements on all platforms. + + +2018-10-05: Version 7.1.273 + + Performance and stability improvements on all platforms. + + +2018-10-05: Version 7.1.272 + + Performance and stability improvements on all platforms. + + +2018-10-05: Version 7.1.271 + + Performance and stability improvements on all platforms. + + +2018-10-05: Version 7.1.270 + + Performance and stability improvements on all platforms. + + +2018-10-05: Version 7.1.269 + + Performance and stability improvements on all platforms. + + +2018-10-05: Version 7.1.268 + + Performance and stability improvements on all platforms. + + +2018-10-05: Version 7.1.267 + + Performance and stability improvements on all platforms. + + +2018-10-05: Version 7.1.266 + + Performance and stability improvements on all platforms. + + +2018-10-05: Version 7.1.265 + + Performance and stability improvements on all platforms. + + +2018-10-05: Version 7.1.264 + + Performance and stability improvements on all platforms. + + +2018-10-05: Version 7.1.263 + + Performance and stability improvements on all platforms. + + +2018-10-05: Version 7.1.262 + + Performance and stability improvements on all platforms. + + +2018-10-05: Version 7.1.261 + + Performance and stability improvements on all platforms. + + +2018-10-05: Version 7.1.260 + + Performance and stability improvements on all platforms. + + +2018-10-04: Version 7.1.259 + + Performance and stability improvements on all platforms. + + +2018-10-04: Version 7.1.258 + + Performance and stability improvements on all platforms. + + +2018-10-04: Version 7.1.257 + + Performance and stability improvements on all platforms. + + +2018-10-04: Version 7.1.256 + + Performance and stability improvements on all platforms. + + +2018-10-04: Version 7.1.255 + + Performance and stability improvements on all platforms. + + +2018-10-04: Version 7.1.254 + + Performance and stability improvements on all platforms. + + +2018-10-04: Version 7.1.253 + + Performance and stability improvements on all platforms. + + +2018-10-04: Version 7.1.252 + + Performance and stability improvements on all platforms. + + +2018-10-04: Version 7.1.251 + + Performance and stability improvements on all platforms. + + +2018-10-04: Version 7.1.250 + + Performance and stability improvements on all platforms. + + +2018-10-04: Version 7.1.249 + + Performance and stability improvements on all platforms. + + +2018-10-04: Version 7.1.248 + + Performance and stability improvements on all platforms. + + +2018-10-04: Version 7.1.247 + + Performance and stability improvements on all platforms. + + +2018-10-04: Version 7.1.246 + + Performance and stability improvements on all platforms. + + +2018-10-03: Version 7.1.245 + + Performance and stability improvements on all platforms. + + +2018-10-03: Version 7.1.244 + + Performance and stability improvements on all platforms. + + +2018-10-03: Version 7.1.243 + + Performance and stability improvements on all platforms. + + +2018-10-03: Version 7.1.242 + + Performance and stability improvements on all platforms. + + +2018-10-03: Version 7.1.241 + + Performance and stability improvements on all platforms. + + +2018-10-03: Version 7.1.240 + + Performance and stability improvements on all platforms. + + +2018-10-03: Version 7.1.239 + + Performance and stability improvements on all platforms. + + +2018-10-03: Version 7.1.238 + + Performance and stability improvements on all platforms. + + +2018-10-03: Version 7.1.237 + + Performance and stability improvements on all platforms. + + +2018-10-03: Version 7.1.236 + + Performance and stability improvements on all platforms. + + +2018-10-03: Version 7.1.235 + + Performance and stability improvements on all platforms. + + +2018-10-02: Version 7.1.234 + + Performance and stability improvements on all platforms. + + +2018-10-02: Version 7.1.233 + + Performance and stability improvements on all platforms. + + +2018-10-02: Version 7.1.232 + + Performance and stability improvements on all platforms. + + +2018-10-02: Version 7.1.231 + + Performance and stability improvements on all platforms. + + +2018-10-02: Version 7.1.230 + + Performance and stability improvements on all platforms. + + +2018-10-02: Version 7.1.229 + + Performance and stability improvements on all platforms. + + +2018-10-02: Version 7.1.228 + + Performance and stability improvements on all platforms. + + +2018-10-02: Version 7.1.227 + + Performance and stability improvements on all platforms. + + +2018-10-01: Version 7.1.226 + + Performance and stability improvements on all platforms. + + +2018-10-01: Version 7.1.225 + + Performance and stability improvements on all platforms. + + +2018-10-01: Version 7.1.224 + + Performance and stability improvements on all platforms. + + +2018-10-01: Version 7.1.223 + + Performance and stability improvements on all platforms. + + +2018-10-01: Version 7.1.222 + + Performance and stability improvements on all platforms. + + +2018-10-01: Version 7.1.221 + + Performance and stability improvements on all platforms. + + +2018-10-01: Version 7.1.220 + + Performance and stability improvements on all platforms. + + +2018-10-01: Version 7.1.219 + + Performance and stability improvements on all platforms. + + +2018-09-30: Version 7.1.218 + + Performance and stability improvements on all platforms. + + +2018-09-29: Version 7.1.217 + + Performance and stability improvements on all platforms. + + +2018-09-29: Version 7.1.216 + + Performance and stability improvements on all platforms. + + +2018-09-29: Version 7.1.215 + + Performance and stability improvements on all platforms. + + +2018-09-28: Version 7.1.214 + + Performance and stability improvements on all platforms. + + +2018-09-28: Version 7.1.213 + + Performance and stability improvements on all platforms. + + +2018-09-28: Version 7.1.212 + + Performance and stability improvements on all platforms. + + +2018-09-28: Version 7.1.211 + + Performance and stability improvements on all platforms. + + +2018-09-28: Version 7.1.210 + + Performance and stability improvements on all platforms. + + +2018-09-28: Version 7.1.209 + + Performance and stability improvements on all platforms. + + +2018-09-28: Version 7.1.208 + + Performance and stability improvements on all platforms. + + +2018-09-28: Version 7.1.207 + + Performance and stability improvements on all platforms. + + +2018-09-28: Version 7.1.206 + + Performance and stability improvements on all platforms. + + +2018-09-28: Version 7.1.205 + + Performance and stability improvements on all platforms. + + +2018-09-28: Version 7.1.204 + + Performance and stability improvements on all platforms. + + +2018-09-28: Version 7.1.203 + + Performance and stability improvements on all platforms. + + +2018-09-28: Version 7.1.202 + + Performance and stability improvements on all platforms. + + +2018-09-27: Version 7.1.201 + + Performance and stability improvements on all platforms. + + +2018-09-27: Version 7.1.200 + + Performance and stability improvements on all platforms. + + +2018-09-27: Version 7.1.199 + + Performance and stability improvements on all platforms. + + +2018-09-27: Version 7.1.198 + + Performance and stability improvements on all platforms. + + +2018-09-27: Version 7.1.197 + + Performance and stability improvements on all platforms. + + +2018-09-27: Version 7.1.196 + + Performance and stability improvements on all platforms. + + +2018-09-27: Version 7.1.195 + + Performance and stability improvements on all platforms. + + +2018-09-27: Version 7.1.194 + + Performance and stability improvements on all platforms. + + +2018-09-27: Version 7.1.193 + + Performance and stability improvements on all platforms. + + +2018-09-27: Version 7.1.192 + + Performance and stability improvements on all platforms. + + +2018-09-27: Version 7.1.191 + + Performance and stability improvements on all platforms. + + +2018-09-27: Version 7.1.190 + + Performance and stability improvements on all platforms. + + +2018-09-27: Version 7.1.189 + + Performance and stability improvements on all platforms. + + +2018-09-27: Version 7.1.188 + + Performance and stability improvements on all platforms. + + +2018-09-27: Version 7.1.187 + + Performance and stability improvements on all platforms. + + +2018-09-27: Version 7.1.186 + + Performance and stability improvements on all platforms. + + +2018-09-26: Version 7.1.185 + + Performance and stability improvements on all platforms. + + +2018-09-26: Version 7.1.184 + + Performance and stability improvements on all platforms. + + +2018-09-26: Version 7.1.183 + + Performance and stability improvements on all platforms. + + +2018-09-26: Version 7.1.182 + + Performance and stability improvements on all platforms. + + +2018-09-26: Version 7.1.181 + + Performance and stability improvements on all platforms. + + +2018-09-26: Version 7.1.180 + + Performance and stability improvements on all platforms. + + +2018-09-26: Version 7.1.179 + + Performance and stability improvements on all platforms. + + +2018-09-25: Version 7.1.178 + + Performance and stability improvements on all platforms. + + +2018-09-25: Version 7.1.177 + + Performance and stability improvements on all platforms. + + +2018-09-25: Version 7.1.176 + + Performance and stability improvements on all platforms. + + +2018-09-25: Version 7.1.175 + + Performance and stability improvements on all platforms. + + +2018-09-25: Version 7.1.174 + + Performance and stability improvements on all platforms. + + +2018-09-25: Version 7.1.173 + + Performance and stability improvements on all platforms. + + +2018-09-25: Version 7.1.172 + + Performance and stability improvements on all platforms. + + +2018-09-24: Version 7.1.171 + + Performance and stability improvements on all platforms. + + +2018-09-24: Version 7.1.170 + + Performance and stability improvements on all platforms. + + +2018-09-24: Version 7.1.169 + + Performance and stability improvements on all platforms. + + +2018-09-24: Version 7.1.168 + + Performance and stability improvements on all platforms. + + +2018-09-24: Version 7.1.167 + + Performance and stability improvements on all platforms. + + +2018-09-24: Version 7.1.166 + + Performance and stability improvements on all platforms. + + +2018-09-24: Version 7.1.165 + + Performance and stability improvements on all platforms. + + +2018-09-24: Version 7.1.164 + + Performance and stability improvements on all platforms. + + +2018-09-21: Version 7.1.163 + + Performance and stability improvements on all platforms. + + +2018-09-21: Version 7.1.162 + + Performance and stability improvements on all platforms. + + +2018-09-21: Version 7.1.161 + + Performance and stability improvements on all platforms. + + +2018-09-21: Version 7.1.160 + + Performance and stability improvements on all platforms. + + +2018-09-21: Version 7.1.159 + + Performance and stability improvements on all platforms. + + +2018-09-21: Version 7.1.158 + + Performance and stability improvements on all platforms. + + +2018-09-21: Version 7.1.157 + + Performance and stability improvements on all platforms. + + +2018-09-21: Version 7.1.156 + + Performance and stability improvements on all platforms. + + +2018-09-21: Version 7.1.155 + + Performance and stability improvements on all platforms. + + +2018-09-21: Version 7.1.154 + + Performance and stability improvements on all platforms. + + +2018-09-21: Version 7.1.153 + + Performance and stability improvements on all platforms. + + +2018-09-21: Version 7.1.152 + + Performance and stability improvements on all platforms. + + +2018-09-21: Version 7.1.151 + + Performance and stability improvements on all platforms. + + +2018-09-21: Version 7.1.150 + + Performance and stability improvements on all platforms. + + +2018-09-21: Version 7.1.149 + + Performance and stability improvements on all platforms. + + +2018-09-20: Version 7.1.148 + + Performance and stability improvements on all platforms. + + +2018-09-19: Version 7.1.147 + + Performance and stability improvements on all platforms. + + +2018-09-19: Version 7.1.146 + + Performance and stability improvements on all platforms. + + +2018-09-19: Version 7.1.145 + + Performance and stability improvements on all platforms. + + +2018-09-19: Version 7.1.144 + + Performance and stability improvements on all platforms. + + +2018-09-19: Version 7.1.143 + + Performance and stability improvements on all platforms. + + +2018-09-19: Version 7.1.142 + + Performance and stability improvements on all platforms. + + +2018-09-19: Version 7.1.141 + + Performance and stability improvements on all platforms. + + +2018-09-19: Version 7.1.140 + + Performance and stability improvements on all platforms. + + +2018-09-19: Version 7.1.139 + + Performance and stability improvements on all platforms. + + +2018-09-19: Version 7.1.138 + + Performance and stability improvements on all platforms. + + +2018-09-19: Version 7.1.137 + + Performance and stability improvements on all platforms. + + +2018-09-19: Version 7.1.136 + + Performance and stability improvements on all platforms. + + +2018-09-19: Version 7.1.135 + + Performance and stability improvements on all platforms. + + +2018-09-19: Version 7.1.134 + + Performance and stability improvements on all platforms. + + +2018-09-19: Version 7.1.133 + + Performance and stability improvements on all platforms. + + +2018-09-18: Version 7.1.132 + + Performance and stability improvements on all platforms. + + +2018-09-18: Version 7.1.131 + + Performance and stability improvements on all platforms. + + +2018-09-18: Version 7.1.130 + + Performance and stability improvements on all platforms. + + +2018-09-18: Version 7.1.129 + + Performance and stability improvements on all platforms. + + +2018-09-18: Version 7.1.128 + + Performance and stability improvements on all platforms. + + +2018-09-18: Version 7.1.127 + + Performance and stability improvements on all platforms. + + +2018-09-18: Version 7.1.126 + + Performance and stability improvements on all platforms. + + +2018-09-18: Version 7.1.125 + + Performance and stability improvements on all platforms. + + +2018-09-18: Version 7.1.124 + + Performance and stability improvements on all platforms. + + +2018-09-18: Version 7.1.123 + + Performance and stability improvements on all platforms. + + +2018-09-18: Version 7.1.122 + + Performance and stability improvements on all platforms. + + +2018-09-18: Version 7.1.121 + + Performance and stability improvements on all platforms. + + +2018-09-17: Version 7.1.120 + + Performance and stability improvements on all platforms. + + +2018-09-17: Version 7.1.119 + + Performance and stability improvements on all platforms. + + +2018-09-17: Version 7.1.118 + + Performance and stability improvements on all platforms. + + +2018-09-17: Version 7.1.117 + + Performance and stability improvements on all platforms. + + +2018-09-17: Version 7.1.116 + + Performance and stability improvements on all platforms. + + +2018-09-17: Version 7.1.115 + + Performance and stability improvements on all platforms. + + +2018-09-17: Version 7.1.114 + + Performance and stability improvements on all platforms. + + +2018-09-14: Version 7.1.113 + + Performance and stability improvements on all platforms. + + +2018-09-14: Version 7.1.112 + + Performance and stability improvements on all platforms. + + +2018-09-14: Version 7.1.111 + + Performance and stability improvements on all platforms. + + +2018-09-14: Version 7.1.110 + + Performance and stability improvements on all platforms. + + +2018-09-14: Version 7.1.109 + + Performance and stability improvements on all platforms. + + +2018-09-14: Version 7.1.108 + + Performance and stability improvements on all platforms. + + +2018-09-14: Version 7.1.107 + + Performance and stability improvements on all platforms. + + +2018-09-14: Version 7.1.106 + + Performance and stability improvements on all platforms. + + +2018-09-14: Version 7.1.105 + + Performance and stability improvements on all platforms. + + +2018-09-14: Version 7.1.104 + + Performance and stability improvements on all platforms. + + +2018-09-14: Version 7.1.103 + + Performance and stability improvements on all platforms. + + +2018-09-14: Version 7.1.102 + + Performance and stability improvements on all platforms. + + +2018-09-14: Version 7.1.101 + + Performance and stability improvements on all platforms. + + +2018-09-14: Version 7.1.100 + + Performance and stability improvements on all platforms. + + +2018-09-14: Version 7.1.99 + + Performance and stability improvements on all platforms. + + +2018-09-13: Version 7.1.98 + + Performance and stability improvements on all platforms. + + +2018-09-13: Version 7.1.97 + + Performance and stability improvements on all platforms. + + +2018-09-13: Version 7.1.96 + + Performance and stability improvements on all platforms. + + +2018-09-13: Version 7.1.95 + + Performance and stability improvements on all platforms. + + +2018-09-13: Version 7.1.94 + + Performance and stability improvements on all platforms. + + +2018-09-13: Version 7.1.93 + + Performance and stability improvements on all platforms. + + +2018-09-13: Version 7.1.92 + + Performance and stability improvements on all platforms. + + +2018-09-12: Version 7.1.91 + + Performance and stability improvements on all platforms. + + +2018-09-12: Version 7.1.90 + + Performance and stability improvements on all platforms. + + +2018-09-12: Version 7.1.89 + + Performance and stability improvements on all platforms. + + +2018-09-12: Version 7.1.88 + + Performance and stability improvements on all platforms. + + +2018-09-12: Version 7.1.87 + + Performance and stability improvements on all platforms. + + +2018-09-12: Version 7.1.86 + + Performance and stability improvements on all platforms. + + +2018-09-11: Version 7.1.85 + + Performance and stability improvements on all platforms. + + +2018-09-11: Version 7.1.84 + + Performance and stability improvements on all platforms. + + +2018-09-11: Version 7.1.83 + + Performance and stability improvements on all platforms. + + +2018-09-11: Version 7.1.82 + + Performance and stability improvements on all platforms. + + +2018-09-11: Version 7.1.81 + + Performance and stability improvements on all platforms. + + +2018-09-11: Version 7.1.80 + + Performance and stability improvements on all platforms. + + +2018-09-10: Version 7.1.79 + + Performance and stability improvements on all platforms. + + +2018-09-10: Version 7.1.78 + + Performance and stability improvements on all platforms. + + +2018-09-10: Version 7.1.77 + + Performance and stability improvements on all platforms. + + +2018-09-10: Version 7.1.76 + + Performance and stability improvements on all platforms. + + +2018-09-10: Version 7.1.75 + + Performance and stability improvements on all platforms. + + +2018-09-10: Version 7.1.74 + + Performance and stability improvements on all platforms. + + +2018-09-10: Version 7.1.73 + + Performance and stability improvements on all platforms. + + +2018-09-10: Version 7.1.72 + + Performance and stability improvements on all platforms. + + +2018-09-10: Version 7.1.71 + + Performance and stability improvements on all platforms. + + +2018-09-09: Version 7.1.70 + + Performance and stability improvements on all platforms. + + +2018-09-08: Version 7.1.69 + + Performance and stability improvements on all platforms. + + +2018-09-07: Version 7.1.68 + + Performance and stability improvements on all platforms. + + +2018-09-07: Version 7.1.67 + + Performance and stability improvements on all platforms. + + +2018-09-07: Version 7.1.66 + + Performance and stability improvements on all platforms. + + +2018-09-07: Version 7.1.65 + + Performance and stability improvements on all platforms. + + +2018-09-07: Version 7.1.64 + + Performance and stability improvements on all platforms. + + +2018-09-07: Version 7.1.63 + + Performance and stability improvements on all platforms. + + +2018-09-07: Version 7.1.62 + + Performance and stability improvements on all platforms. + + +2018-09-07: Version 7.1.61 + + Performance and stability improvements on all platforms. + + +2018-09-07: Version 7.1.60 + + Performance and stability improvements on all platforms. + + +2018-09-07: Version 7.1.59 + + Performance and stability improvements on all platforms. + + +2018-09-07: Version 7.1.58 + + Performance and stability improvements on all platforms. + + +2018-09-07: Version 7.1.57 + + Performance and stability improvements on all platforms. + + +2018-09-07: Version 7.1.56 + + Performance and stability improvements on all platforms. + + +2018-09-06: Version 7.1.55 + + Performance and stability improvements on all platforms. + + +2018-09-06: Version 7.1.54 + + Performance and stability improvements on all platforms. + + +2018-09-06: Version 7.1.53 + + Performance and stability improvements on all platforms. + + +2018-09-06: Version 7.1.52 + + Performance and stability improvements on all platforms. + + +2018-09-06: Version 7.1.51 + + Performance and stability improvements on all platforms. + + +2018-09-06: Version 7.1.50 + + Performance and stability improvements on all platforms. + + +2018-09-06: Version 7.1.49 + + Performance and stability improvements on all platforms. + + +2018-09-06: Version 7.1.48 + + Performance and stability improvements on all platforms. + + +2018-09-06: Version 7.1.47 + + Performance and stability improvements on all platforms. + + +2018-09-06: Version 7.1.46 + + Performance and stability improvements on all platforms. + + +2018-09-06: Version 7.1.45 + + Performance and stability improvements on all platforms. + + +2018-09-06: Version 7.1.44 + + Performance and stability improvements on all platforms. + + +2018-09-06: Version 7.1.43 + + Performance and stability improvements on all platforms. + + +2018-09-06: Version 7.1.42 + + Performance and stability improvements on all platforms. + + +2018-09-06: Version 7.1.41 + + Performance and stability improvements on all platforms. + + +2018-09-05: Version 7.1.40 + + Performance and stability improvements on all platforms. + + +2018-09-05: Version 7.1.39 + + Performance and stability improvements on all platforms. + + +2018-09-05: Version 7.1.38 + + Performance and stability improvements on all platforms. + + +2018-09-05: Version 7.1.37 + + Performance and stability improvements on all platforms. + + +2018-09-05: Version 7.1.36 + + Performance and stability improvements on all platforms. + + +2018-09-05: Version 7.1.35 + + Performance and stability improvements on all platforms. + + +2018-09-05: Version 7.1.34 + + Performance and stability improvements on all platforms. + + +2018-09-05: Version 7.1.33 + + Performance and stability improvements on all platforms. + + +2018-09-05: Version 7.1.32 + + Performance and stability improvements on all platforms. + + +2018-09-05: Version 7.1.31 + + Performance and stability improvements on all platforms. + + +2018-09-05: Version 7.1.30 + + Performance and stability improvements on all platforms. + + +2018-09-05: Version 7.1.29 + + Performance and stability improvements on all platforms. + + +2018-09-05: Version 7.1.28 + + Performance and stability improvements on all platforms. + + +2018-09-05: Version 7.1.27 + + Performance and stability improvements on all platforms. + + +2018-09-04: Version 7.1.26 + + Performance and stability improvements on all platforms. + + +2018-09-04: Version 7.1.25 + + Performance and stability improvements on all platforms. + + +2018-09-04: Version 7.1.24 + + Performance and stability improvements on all platforms. + + +2018-09-04: Version 7.1.23 + + Performance and stability improvements on all platforms. + + +2018-09-04: Version 7.1.22 + + Performance and stability improvements on all platforms. + + +2018-09-04: Version 7.1.21 + + Performance and stability improvements on all platforms. + + +2018-09-04: Version 7.1.20 + + Performance and stability improvements on all platforms. + + +2018-09-04: Version 7.1.19 + + Performance and stability improvements on all platforms. + + +2018-09-04: Version 7.1.18 + + Performance and stability improvements on all platforms. + + +2018-09-04: Version 7.1.17 + + Performance and stability improvements on all platforms. + + +2018-09-04: Version 7.1.16 + + Performance and stability improvements on all platforms. + + +2018-09-03: Version 7.1.15 + + Performance and stability improvements on all platforms. + + +2018-09-03: Version 7.1.14 + + Performance and stability improvements on all platforms. + + +2018-09-03: Version 7.1.13 + + Performance and stability improvements on all platforms. + + +2018-09-03: Version 7.1.12 + + Performance and stability improvements on all platforms. + + +2018-09-03: Version 7.1.11 + + Performance and stability improvements on all platforms. + + +2018-09-03: Version 7.1.10 + + Performance and stability improvements on all platforms. + + +2018-09-02: Version 7.1.9 + + Performance and stability improvements on all platforms. + + +2018-09-02: Version 7.1.8 + + Performance and stability improvements on all platforms. + + +2018-09-02: Version 7.1.7 + + Performance and stability improvements on all platforms. + + +2018-09-01: Version 7.1.6 + + Performance and stability improvements on all platforms. + + +2018-08-31: Version 7.1.5 + + Performance and stability improvements on all platforms. + + +2018-08-31: Version 7.1.4 + + Performance and stability improvements on all platforms. + + +2018-08-31: Version 7.1.3 + + Performance and stability improvements on all platforms. + + +2018-08-31: Version 7.1.2 + + Performance and stability improvements on all platforms. + + +2018-08-31: Version 7.1.1 + + Performance and stability improvements on all platforms. + + +2018-08-29: Version 7.0.302 + + Performance and stability improvements on all platforms. + + +2018-08-29: Version 7.0.301 + + Performance and stability improvements on all platforms. + + +2018-08-29: Version 7.0.300 + + Performance and stability improvements on all platforms. + + +2018-08-29: Version 7.0.299 + + Performance and stability improvements on all platforms. + + +2018-08-29: Version 7.0.298 + + Performance and stability improvements on all platforms. + + +2018-08-29: Version 7.0.297 + + Performance and stability improvements on all platforms. + + +2018-08-29: Version 7.0.296 + + Performance and stability improvements on all platforms. + + +2018-08-29: Version 7.0.295 + + Performance and stability improvements on all platforms. + + +2018-08-29: Version 7.0.294 + + Performance and stability improvements on all platforms. + + +2018-08-29: Version 7.0.293 + + Performance and stability improvements on all platforms. + + +2018-08-29: Version 7.0.292 + + Performance and stability improvements on all platforms. + + +2018-08-29: Version 7.0.291 + + Performance and stability improvements on all platforms. + + +2018-08-29: Version 7.0.290 + + Performance and stability improvements on all platforms. + + +2018-08-29: Version 7.0.289 + + Performance and stability improvements on all platforms. + + +2018-08-29: Version 7.0.288 + + Performance and stability improvements on all platforms. + + +2018-08-28: Version 7.0.287 + + Performance and stability improvements on all platforms. + + +2018-08-28: Version 7.0.286 + + Performance and stability improvements on all platforms. + + +2018-08-28: Version 7.0.285 + + Performance and stability improvements on all platforms. + + +2018-08-28: Version 7.0.284 + + Performance and stability improvements on all platforms. + + +2018-08-28: Version 7.0.283 + + Performance and stability improvements on all platforms. + + +2018-08-28: Version 7.0.282 + + Performance and stability improvements on all platforms. + + +2018-08-28: Version 7.0.281 + + Performance and stability improvements on all platforms. + + +2018-08-28: Version 7.0.280 + + Performance and stability improvements on all platforms. + + +2018-08-28: Version 7.0.279 + + Performance and stability improvements on all platforms. + + +2018-08-28: Version 7.0.278 + + Performance and stability improvements on all platforms. + + +2018-08-28: Version 7.0.277 + + Performance and stability improvements on all platforms. + + 2018-08-27: Version 7.0.276 Performance and stability improvements on all platforms. diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 42e7a40baa5980..fdd96f9b820f3d 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -13,15 +13,13 @@ vars = { deps = { 'v8/build': - Var('chromium_url') + '/chromium/src/build.git' + '@' + 'dd6b994b32b498e9e766ce60c44da0aec3a2a188', - 'v8/tools/gyp': - Var('chromium_url') + '/external/gyp.git' + '@' + 'd61a9397e668fa9843c4aa7da9e79460fe590bfb', + Var('chromium_url') + '/chromium/src/build.git' + '@' + 'a7674eacc34947257c78fe6ba5cf0da17f60696c', 'v8/third_party/depot_tools': - Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + 'aaf2cc09c6874e394c6c1e4692360cc400d6b388', + Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '71e3be7a50c21faeee91ed99a8d5addfb7594e7c', 'v8/third_party/icu': - Var('chromium_url') + '/chromium/deps/icu.git' + '@' + 'a191af9d025859e8368b8b469120d78006e9f5f6', + Var('chromium_url') + '/chromium/deps/icu.git' + '@' + 'c52a2a250d6c5f5cbdd015dff36af7c5d0ae1150', 'v8/third_party/instrumented_libraries': - Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + 'd8cf40c4592dcec7fb01fcbdf1f6d4958b3fbf11', + Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + 'a90cbf3b4216430a437991fb53ede8e048dea454', 'v8/buildtools': Var('chromium_url') + '/chromium/buildtools.git' + '@' + '2dff9c9c74e9d732e6fe57c84ef7fd044cc45d96', 'v8/base/trace_event/common': @@ -35,7 +33,7 @@ deps = { 'condition': 'checkout_android', }, 'v8/third_party/catapult': { - 'url': Var('chromium_url') + '/catapult.git' + '@' + 'bc2c0a9307285fa36e03e7cdb6bf8623390ff855', + 'url': Var('chromium_url') + '/catapult.git' + '@' + '9ec8468cfde0868ce5f3893e819087278c5af988', 'condition': 'checkout_android', }, 'v8/third_party/colorama/src': { @@ -43,17 +41,15 @@ deps = { 'condition': 'checkout_android', }, 'v8/third_party/fuchsia-sdk': { - 'url': Var('chromium_url') + '/chromium/src/third_party/fuchsia-sdk.git' + '@' + '3ec92c896bcbddc46e2a073ebfdd25aa1194656e', + 'url': Var('chromium_url') + '/chromium/src/third_party/fuchsia-sdk.git' + '@' + '6e1868c9083769d489d3fc25657339d50c22b1d8', 'condition': 'checkout_fuchsia', }, 'v8/third_party/googletest/src': - Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + 'd5266326752f0a1dadbd310932d8f4fd8c3c5e7d', + Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + '2e68926a9d4929e9289373cd49e40ddcb9a628f7', '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/third_party/proguard': - Var('chromium_url') + '/chromium/src/third_party/proguard.git' + '@' + 'a3729bea473bb5ffc5eaf289f5733bc5e2861c07', 'v8/tools/swarming_client': Var('chromium_url') + '/infra/luci/client-py.git' + '@' + '486c9b53c4d54dd4b95bb6ce0e31160e600dfc11', 'v8/test/benchmarks/data': @@ -61,25 +57,35 @@ deps = { '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' + '@' + 'a6c1d05ac4fed084fa047e4c52ab2a8c9c2a8aef', + Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + '00cfe1628cc03164dcf03f01ba9c84376e9be735', 'v8/test/test262/harness': Var('chromium_url') + '/external/github.com/test262-utils/test262-harness-py.git' + '@' + '0f2acdd882c84cff43b9d60df7574a1901e2cdcd', - 'v8/third_party/qemu': { + 'v8/third_party/qemu-linux-x64': { 'packages': [ { 'package': 'fuchsia/qemu/linux-amd64', 'version': '9cc486c5b18a0be515c39a280ca9a309c54cf994' }, ], - 'condition': 'checkout_fuchsia', + 'condition': 'host_os == "linux" and checkout_fuchsia', + 'dep_type': 'cipd', + }, + 'v8/third_party/qemu-mac-x64': { + 'packages': [ + { + 'package': 'fuchsia/qemu/mac-amd64', + 'version': '2d3358ae9a569b2d4a474f498b32b202a152134f' + }, + ], + 'condition': 'host_os == "mac" and checkout_fuchsia', 'dep_type': 'cipd', }, 'v8/tools/clang': - Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'bb4146fb8a9dde405b71914657bb461dc93912ab', + Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '7792d28b069af6dd3a86d1ba83b7f5c4ede605dc', 'v8/tools/luci-go': Var('chromium_url') + '/chromium/src/tools/luci-go.git' + '@' + '445d7c4b6a4f10e188edb395b132e3996b127691', 'v8/test/wasm-js': - Var('chromium_url') + '/external/github.com/WebAssembly/spec.git' + '@' + '240ea673de6e75d78ae472f66127301ecab22a99', + Var('chromium_url') + '/external/github.com/WebAssembly/spec.git' + '@' + 'db9cd40808a90ecc5f4a23e88fb375c8f60b8d52', } recursedeps = [ @@ -344,13 +350,6 @@ hooks = [ 'condition': 'checkout_win', 'action': ['python', 'v8/build/vs_toolchain.py', 'update'], }, - { - # Update the Mac toolchain if necessary. - 'name': 'mac_toolchain', - 'pattern': '.', - 'condition': 'checkout_mac', - 'action': ['python', 'v8/build/mac_toolchain.py'], - }, # Pull binutils for linux, enabled debug fission for faster linking / # debugging when used with clang on Ubuntu Precise. # https://code.google.com/p/chromium/issues/detail?id=352046 @@ -387,6 +386,23 @@ hooks = [ 'v8/build/fuchsia/update_sdk.py', ], }, + { + # Mac doesn't use lld so it's not included in the default clang bundle + # there. However, lld is need in Fuchsia cross builds, so + # download it there. + # Should run after the clang hook. + 'name': 'lld/mac', + 'pattern': '.', + 'condition': 'host_os == "mac" and checkout_fuchsia', + 'action': ['python', 'v8/tools/clang/scripts/download_lld_mac.py'], + }, + { + # Mac does not have llvm-objdump, download it for cross builds in Fuchsia. + 'name': 'llvm-objdump', + 'pattern': '.', + 'condition': 'host_os == "mac" and checkout_fuchsia', + 'action': ['python', 'v8/tools/clang/scripts/download_objdump.py'], + }, { 'name': 'mips_toolchain', 'pattern': '.', diff --git a/deps/v8/PRESUBMIT.py b/deps/v8/PRESUBMIT.py index bd780ce62f7a78..88a64e727b2b8c 100644 --- a/deps/v8/PRESUBMIT.py +++ b/deps/v8/PRESUBMIT.py @@ -73,9 +73,10 @@ def _V8PresubmitChecks(input_api, output_api): import sys sys.path.append(input_api.os_path.join( input_api.PresubmitLocalPath(), 'tools')) - from presubmit import CppLintProcessor - from presubmit import SourceProcessor - from presubmit import StatusFilesProcessor + from v8_presubmit import CppLintProcessor + from v8_presubmit import TorqueFormatProcessor + from v8_presubmit import SourceProcessor + from v8_presubmit import StatusFilesProcessor def FilterFile(affected_file): return input_api.FilterSourceFile( @@ -83,10 +84,19 @@ def FilterFile(affected_file): white_list=None, black_list=_NO_LINT_PATHS) + def FilterTorqueFile(affected_file): + return input_api.FilterSourceFile( + affected_file, + white_list=(r'.+\.tq')) + results = [] if not CppLintProcessor().RunOnFiles( input_api.AffectedFiles(file_filter=FilterFile, include_deletes=False)): results.append(output_api.PresubmitError("C++ lint check failed")) + if not TorqueFormatProcessor().RunOnFiles( + input_api.AffectedFiles(file_filter=FilterTorqueFile, + include_deletes=False)): + results.append(output_api.PresubmitError("Torque format check failed")) if not SourceProcessor().RunOnFiles( input_api.AffectedFiles(include_deletes=False)): results.append(output_api.PresubmitError( diff --git a/deps/v8/gni/v8.gni b/deps/v8/gni/v8.gni index a5312f76acd9dd..6cb248f160dbd6 100644 --- a/deps/v8/gni/v8.gni +++ b/deps/v8/gni/v8.gni @@ -143,7 +143,15 @@ template("v8_source_set") { } } target(link_target_type, target_name) { - forward_variables_from(invoker, "*", [ "configs" ]) + forward_variables_from(invoker, + "*", + [ + "configs", + "remove_configs", + ]) + if (defined(invoker.remove_configs)) { + configs -= invoker.remove_configs + } configs += invoker.configs configs -= v8_remove_configs configs += v8_add_configs diff --git a/deps/v8/include/libplatform/v8-tracing.h b/deps/v8/include/libplatform/v8-tracing.h index e430e7c3502741..250d5fbdb9f07f 100644 --- a/deps/v8/include/libplatform/v8-tracing.h +++ b/deps/v8/include/libplatform/v8-tracing.h @@ -35,7 +35,7 @@ class V8_PLATFORM_EXPORT TraceObject { const char* as_string; }; - TraceObject() {} + TraceObject() = default; ~TraceObject(); void Initialize( char phase, const uint8_t* category_enabled_flag, const char* name, @@ -106,8 +106,8 @@ class V8_PLATFORM_EXPORT TraceObject { class V8_PLATFORM_EXPORT TraceWriter { public: - TraceWriter() {} - virtual ~TraceWriter() {} + TraceWriter() = default; + virtual ~TraceWriter() = default; virtual void AppendTraceEvent(TraceObject* trace_event) = 0; virtual void Flush() = 0; @@ -147,8 +147,8 @@ class V8_PLATFORM_EXPORT TraceBufferChunk { class V8_PLATFORM_EXPORT TraceBuffer { public: - TraceBuffer() {} - virtual ~TraceBuffer() {} + TraceBuffer() = default; + virtual ~TraceBuffer() = default; virtual TraceObject* AddTraceEvent(uint64_t* handle) = 0; virtual TraceObject* GetEventByHandle(uint64_t handle) = 0; diff --git a/deps/v8/include/v8-inspector.h b/deps/v8/include/v8-inspector.h index e06963949a5620..f0a8b5f1635adf 100644 --- a/deps/v8/include/v8-inspector.h +++ b/deps/v8/include/v8-inspector.h @@ -62,7 +62,7 @@ class V8_EXPORT StringView { class V8_EXPORT StringBuffer { public: - virtual ~StringBuffer() {} + virtual ~StringBuffer() = default; virtual const StringView& string() = 0; // This method copies contents. static std::unique_ptr create(const StringView&); @@ -107,7 +107,7 @@ class V8_EXPORT V8StackTrace { virtual StringView topScriptId() const = 0; virtual StringView topFunctionName() const = 0; - virtual ~V8StackTrace() {} + virtual ~V8StackTrace() = default; virtual std::unique_ptr buildInspectorObject() const = 0; virtual std::unique_ptr toString() const = 0; @@ -118,13 +118,13 @@ class V8_EXPORT V8StackTrace { class V8_EXPORT V8InspectorSession { public: - virtual ~V8InspectorSession() {} + virtual ~V8InspectorSession() = default; // Cross-context inspectable values (DOM nodes in different worlds, etc.). class V8_EXPORT Inspectable { public: virtual v8::Local get(v8::Local) = 0; - virtual ~Inspectable() {} + virtual ~Inspectable() = default; }; virtual void addInspectedObject(std::unique_ptr) = 0; @@ -162,7 +162,7 @@ class V8_EXPORT V8InspectorSession { class V8_EXPORT V8InspectorClient { public: - virtual ~V8InspectorClient() {} + virtual ~V8InspectorClient() = default; virtual void runMessageLoopOnPause(int contextGroupId) {} virtual void quitMessageLoopOnPause() {} @@ -239,7 +239,7 @@ struct V8_EXPORT V8StackTraceId { class V8_EXPORT V8Inspector { public: static std::unique_ptr create(v8::Isolate*, V8InspectorClient*); - virtual ~V8Inspector() {} + virtual ~V8Inspector() = default; // Contexts instrumentation. virtual void contextCreated(const V8ContextInfo&) = 0; @@ -277,7 +277,7 @@ class V8_EXPORT V8Inspector { // Connection. class V8_EXPORT Channel { public: - virtual ~Channel() {} + virtual ~Channel() = default; virtual void sendResponse(int callId, std::unique_ptr message) = 0; virtual void sendNotification(std::unique_ptr message) = 0; diff --git a/deps/v8/include/v8-internal.h b/deps/v8/include/v8-internal.h new file mode 100644 index 00000000000000..80f7367bfee3e6 --- /dev/null +++ b/deps/v8/include/v8-internal.h @@ -0,0 +1,316 @@ +// 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. + +#ifndef INCLUDE_V8_INTERNAL_H_ +#define INCLUDE_V8_INTERNAL_H_ + +#include +#include +#include + +#include "v8-version.h" // NOLINT(build/include) +#include "v8config.h" // NOLINT(build/include) + +namespace v8 { + +class Context; +class Data; +class Isolate; + +namespace internal { + +class Object; + +/** + * Configuration of tagging scheme. + */ +const int kApiPointerSize = sizeof(void*); // NOLINT +const int kApiDoubleSize = sizeof(double); // NOLINT +const int kApiIntSize = sizeof(int); // NOLINT +const int kApiInt64Size = sizeof(int64_t); // NOLINT + +// Tag information for HeapObject. +const int kHeapObjectTag = 1; +const int kWeakHeapObjectTag = 3; +const int kHeapObjectTagSize = 2; +const intptr_t kHeapObjectTagMask = (1 << kHeapObjectTagSize) - 1; + +// Tag information for Smi. +const int kSmiTag = 0; +const int kSmiTagSize = 1; +const intptr_t kSmiTagMask = (1 << kSmiTagSize) - 1; + +template +struct SmiTagging; + +template +V8_INLINE internal::Object* IntToSmi(int value) { + int smi_shift_bits = kSmiTagSize + kSmiShiftSize; + intptr_t tagged_value = + (static_cast(value) << smi_shift_bits) | kSmiTag; + return reinterpret_cast(tagged_value); +} + +// Smi constants for systems where tagged pointer is a 32-bit value. +template <> +struct SmiTagging<4> { + enum { kSmiShiftSize = 0, kSmiValueSize = 31 }; + static int SmiShiftSize() { return kSmiShiftSize; } + static int SmiValueSize() { return kSmiValueSize; } + V8_INLINE static int SmiToInt(const internal::Object* value) { + int shift_bits = kSmiTagSize + kSmiShiftSize; + // Throw away top 32 bits and shift down (requires >> to be sign extending). + return static_cast(reinterpret_cast(value)) >> shift_bits; + } + V8_INLINE static internal::Object* IntToSmi(int value) { + return internal::IntToSmi(value); + } + 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; + } +}; + +// Smi constants for systems where tagged pointer is a 64-bit value. +template <> +struct SmiTagging<8> { + enum { kSmiShiftSize = 31, kSmiValueSize = 32 }; + static int SmiShiftSize() { return kSmiShiftSize; } + static int SmiValueSize() { return kSmiValueSize; } + V8_INLINE static int SmiToInt(const internal::Object* value) { + int shift_bits = kSmiTagSize + kSmiShiftSize; + // Shift down and throw away top 32 bits. + return static_cast(reinterpret_cast(value) >> shift_bits); + } + V8_INLINE static internal::Object* IntToSmi(int value) { + return internal::IntToSmi(value); + } + V8_INLINE static constexpr bool IsValidSmi(intptr_t value) { + // To be representable as a long smi, the value must be a 32-bit integer. + return (value == static_cast(value)); + } +}; + +#if V8_COMPRESS_POINTERS +static_assert( + kApiPointerSize == kApiInt64Size, + "Pointer compression can be enabled only for 64-bit architectures"); +typedef SmiTagging<4> PlatformSmiTagging; +#else +typedef SmiTagging PlatformSmiTagging; +#endif + +const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize; +const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize; +const int kSmiMinValue = (static_cast(-1)) << (kSmiValueSize - 1); +const int kSmiMaxValue = -(kSmiMinValue + 1); +constexpr bool SmiValuesAre31Bits() { return kSmiValueSize == 31; } +constexpr bool SmiValuesAre32Bits() { return kSmiValueSize == 32; } + +/** + * This class exports constants and functionality from within v8 that + * is necessary to implement inline functions in the v8 api. Don't + * depend on functions and constants defined here. + */ +class Internals { + public: + // These values match non-compiler-dependent values defined within + // the implementation of v8. + static const int kHeapObjectMapOffset = 0; + static const int kMapInstanceTypeOffset = 1 * kApiPointerSize + kApiIntSize; + static const int kStringResourceOffset = + 1 * kApiPointerSize + 2 * kApiIntSize; + + static const int kOddballKindOffset = 4 * kApiPointerSize + kApiDoubleSize; + static const int kForeignAddressOffset = kApiPointerSize; + static const int kJSObjectHeaderSize = 3 * kApiPointerSize; + static const int kFixedArrayHeaderSize = 2 * kApiPointerSize; + static const int kContextHeaderSize = 2 * kApiPointerSize; + static const int kContextEmbedderDataIndex = 5; + static const int kFullStringRepresentationMask = 0x0f; + static const int kStringEncodingMask = 0x8; + static const int kExternalTwoByteRepresentationTag = 0x02; + static const int kExternalOneByteRepresentationTag = 0x0a; + + static const int kIsolateEmbedderDataOffset = 0 * kApiPointerSize; + static const int kExternalMemoryOffset = 4 * kApiPointerSize; + static const int kExternalMemoryLimitOffset = + kExternalMemoryOffset + kApiInt64Size; + static const int kExternalMemoryAtLastMarkCompactOffset = + kExternalMemoryLimitOffset + kApiInt64Size; + static const int kIsolateRootsOffset = kExternalMemoryLimitOffset + + kApiInt64Size + kApiInt64Size + + kApiPointerSize + kApiPointerSize; + static const int kUndefinedValueRootIndex = 4; + static const int kTheHoleValueRootIndex = 5; + static const int kNullValueRootIndex = 6; + static const int kTrueValueRootIndex = 7; + static const int kFalseValueRootIndex = 8; + static const int kEmptyStringRootIndex = 9; + + static const int kNodeClassIdOffset = 1 * kApiPointerSize; + static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3; + static const int kNodeStateMask = 0x7; + static const int kNodeStateIsWeakValue = 2; + static const int kNodeStateIsPendingValue = 3; + static const int kNodeStateIsNearDeathValue = 4; + static const int kNodeIsIndependentShift = 3; + static const int kNodeIsActiveShift = 4; + + static const int kFirstNonstringType = 0x80; + static const int kOddballType = 0x83; + static const int kForeignType = 0x87; + static const int kJSSpecialApiObjectType = 0x410; + static const int kJSApiObjectType = 0x420; + static const int kJSObjectType = 0x421; + + static const int kUndefinedOddballKind = 5; + static const int kNullOddballKind = 3; + + static const uint32_t kNumIsolateDataSlots = 4; + + // Soft limit for AdjustAmountofExternalAllocatedMemory. Trigger an + // incremental GC once the external memory reaches this limit. + static constexpr int kExternalAllocationSoftLimit = 64 * 1024 * 1024; + + V8_EXPORT static void CheckInitializedImpl(v8::Isolate* isolate); + V8_INLINE static void CheckInitialized(v8::Isolate* isolate) { +#ifdef V8_ENABLE_CHECKS + CheckInitializedImpl(isolate); +#endif + } + + V8_INLINE static bool HasHeapObjectTag(const internal::Object* value) { + return ((reinterpret_cast(value) & kHeapObjectTagMask) == + kHeapObjectTag); + } + + V8_INLINE static int SmiValue(const internal::Object* value) { + return PlatformSmiTagging::SmiToInt(value); + } + + V8_INLINE static internal::Object* IntToSmi(int value) { + return PlatformSmiTagging::IntToSmi(value); + } + + V8_INLINE static constexpr bool IsValidSmi(intptr_t value) { + return PlatformSmiTagging::IsValidSmi(value); + } + + V8_INLINE static int GetInstanceType(const internal::Object* obj) { + typedef internal::Object O; + O* map = ReadField(obj, kHeapObjectMapOffset); + return ReadField(map, kMapInstanceTypeOffset); + } + + V8_INLINE static int GetOddballKind(const internal::Object* obj) { + typedef internal::Object O; + return SmiValue(ReadField(obj, kOddballKindOffset)); + } + + V8_INLINE static bool IsExternalTwoByteString(int instance_type) { + int representation = (instance_type & kFullStringRepresentationMask); + return representation == kExternalTwoByteRepresentationTag; + } + + V8_INLINE static uint8_t GetNodeFlag(internal::Object** obj, int shift) { + uint8_t* addr = reinterpret_cast(obj) + kNodeFlagsOffset; + return *addr & static_cast(1U << shift); + } + + V8_INLINE static void UpdateNodeFlag(internal::Object** obj, bool value, + int shift) { + uint8_t* addr = reinterpret_cast(obj) + kNodeFlagsOffset; + uint8_t mask = static_cast(1U << shift); + *addr = static_cast((*addr & ~mask) | (value << shift)); + } + + V8_INLINE static uint8_t GetNodeState(internal::Object** obj) { + uint8_t* addr = reinterpret_cast(obj) + kNodeFlagsOffset; + return *addr & kNodeStateMask; + } + + V8_INLINE static void UpdateNodeState(internal::Object** obj, uint8_t value) { + uint8_t* addr = reinterpret_cast(obj) + kNodeFlagsOffset; + *addr = static_cast((*addr & ~kNodeStateMask) | value); + } + + V8_INLINE static void SetEmbedderData(v8::Isolate* isolate, uint32_t slot, + void* data) { + uint8_t* addr = reinterpret_cast(isolate) + + kIsolateEmbedderDataOffset + slot * kApiPointerSize; + *reinterpret_cast(addr) = data; + } + + V8_INLINE static void* GetEmbedderData(const v8::Isolate* isolate, + uint32_t slot) { + const uint8_t* addr = reinterpret_cast(isolate) + + kIsolateEmbedderDataOffset + slot * kApiPointerSize; + return *reinterpret_cast(addr); + } + + V8_INLINE static internal::Object** GetRoot(v8::Isolate* isolate, int index) { + uint8_t* addr = reinterpret_cast(isolate) + kIsolateRootsOffset; + return reinterpret_cast(addr + index * kApiPointerSize); + } + + template + V8_INLINE static T ReadField(const internal::Object* ptr, int offset) { + const uint8_t* addr = + reinterpret_cast(ptr) + offset - kHeapObjectTag; + return *reinterpret_cast(addr); + } + + template + V8_INLINE static T ReadEmbedderData(const v8::Context* context, int index) { + typedef internal::Object O; + typedef internal::Internals I; + O* ctx = *reinterpret_cast(context); + int embedder_data_offset = + I::kContextHeaderSize + + (internal::kApiPointerSize * I::kContextEmbedderDataIndex); + O* embedder_data = I::ReadField(ctx, embedder_data_offset); + int value_offset = + I::kFixedArrayHeaderSize + (internal::kApiPointerSize * index); + return I::ReadField(embedder_data, value_offset); + } +}; + +// Only perform cast check for types derived from v8::Data since +// other types do not implement the Cast method. +template +struct CastCheck { + template + static void Perform(T* data); +}; + +template <> +template +void CastCheck::Perform(T* data) { + T::Cast(data); +} + +template <> +template +void CastCheck::Perform(T* data) {} + +template +V8_INLINE void PerformCastCheck(T* data) { + CastCheck::value>::Perform(data); +} + +} // namespace internal +} // namespace v8 + +#endif // INCLUDE_V8_INTERNAL_H_ diff --git a/deps/v8/include/v8-platform.h b/deps/v8/include/v8-platform.h index cfeb13b65829f9..d983c30249591b 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -322,7 +322,9 @@ class Platform { * |isolate|. Tasks posted for the same isolate should be execute in order of * scheduling. The definition of "foreground" is opaque to V8. */ - virtual void CallOnForegroundThread(Isolate* isolate, Task* task) = 0; + V8_DEPRECATE_SOON( + "Use a taskrunner acquired by GetForegroundTaskRunner instead.", + virtual void CallOnForegroundThread(Isolate* isolate, Task* task)) = 0; /** * Schedules a task to be invoked on a foreground thread wrt a specific @@ -330,8 +332,10 @@ class Platform { * Tasks posted for the same isolate should be execute in order of * scheduling. The definition of "foreground" is opaque to V8. */ - virtual void CallDelayedOnForegroundThread(Isolate* isolate, Task* task, - double delay_in_seconds) = 0; + V8_DEPRECATE_SOON( + "Use a taskrunner acquired by GetForegroundTaskRunner instead.", + virtual void CallDelayedOnForegroundThread(Isolate* isolate, Task* task, + double delay_in_seconds)) = 0; /** * Schedules a task to be invoked on a foreground thread wrt a specific @@ -341,7 +345,10 @@ class Platform { * starved for an arbitrarily long time if no idle time is available. * The definition of "foreground" is opaque to V8. */ - virtual void CallIdleOnForegroundThread(Isolate* isolate, IdleTask* task) { + V8_DEPRECATE_SOON( + "Use a taskrunner acquired by GetForegroundTaskRunner instead.", + virtual void CallIdleOnForegroundThread(Isolate* isolate, + IdleTask* task)) { // This must be overriden if |IdleTasksEnabled()|. abort(); } diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index 3689a122725f89..c034518defdd96 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -341,12 +341,6 @@ class V8_EXPORT CpuProfiler { V8_DEPRECATED("Use Isolate::SetIdle(bool) instead.", void SetIdle(bool is_idle)); - /** - * Generate more detailed source positions to code objects. This results in - * better results when mapping profiling samples to script source. - */ - static void UseDetailedSourcePositionsForProfiling(Isolate* isolate); - private: CpuProfiler(); ~CpuProfiler(); @@ -451,7 +445,7 @@ class V8_EXPORT OutputStream { // NOLINT kContinue = 0, kAbort = 1 }; - virtual ~OutputStream() {} + virtual ~OutputStream() = default; /** Notify about the end of stream. */ virtual void EndOfStream() = 0; /** Get preferred output chunk size. Called only once. */ @@ -545,7 +539,7 @@ class V8_EXPORT ActivityControl { // NOLINT kContinue = 0, kAbort = 1 }; - virtual ~ActivityControl() {} + virtual ~ActivityControl() = default; /** * Notify about current progress. The activity can be stopped by * returning kAbort as the callback result. @@ -631,7 +625,7 @@ class V8_EXPORT AllocationProfile { */ virtual Node* GetRootNode() = 0; - virtual ~AllocationProfile() {} + virtual ~AllocationProfile() = default; static const int kNoLineNumberInfo = Message::kNoLineNumberInfo; static const int kNoColumnNumberInfo = Message::kNoColumnInfo; @@ -799,15 +793,15 @@ class V8_EXPORT HeapProfiler { virtual const char* GetName(Local object) = 0; protected: - virtual ~ObjectNameResolver() {} + virtual ~ObjectNameResolver() = default; }; /** * Takes a heap snapshot and returns it. */ const HeapSnapshot* TakeHeapSnapshot( - ActivityControl* control = NULL, - ObjectNameResolver* global_object_name_resolver = NULL); + ActivityControl* control = nullptr, + ObjectNameResolver* global_object_name_resolver = nullptr); /** * Starts tracking of heap objects population statistics. After calling @@ -834,7 +828,7 @@ class V8_EXPORT HeapProfiler { * method. */ SnapshotObjectId GetHeapStats(OutputStream* stream, - int64_t* timestamp_us = NULL); + int64_t* timestamp_us = nullptr); /** * Stops tracking of heap objects population statistics, cleans up all @@ -991,8 +985,8 @@ class V8_EXPORT RetainedObjectInfo { // NOLINT virtual intptr_t GetSizeInBytes() { return -1; } protected: - RetainedObjectInfo() {} - virtual ~RetainedObjectInfo() {} + RetainedObjectInfo() = default; + virtual ~RetainedObjectInfo() = default; private: RetainedObjectInfo(const RetainedObjectInfo&); diff --git a/deps/v8/include/v8-util.h b/deps/v8/include/v8-util.h index a3069651222ee0..96c9acbbdc2b29 100644 --- a/deps/v8/include/v8-util.h +++ b/deps/v8/include/v8-util.h @@ -94,11 +94,11 @@ class DefaultPersistentValueMapTraits : public StdMapTraits { static WeakCallbackDataType* WeakCallbackParameter( MapType* map, const K& key, Local value) { - return NULL; + return nullptr; } static MapType* MapFromWeakCallbackInfo( const WeakCallbackInfo& data) { - return NULL; + return nullptr; } static K KeyFromWeakCallbackInfo( const WeakCallbackInfo& data) { @@ -302,7 +302,7 @@ class PersistentValueMapBase { static PersistentContainerValue ClearAndLeak(Global* persistent) { V* v = persistent->val_; - persistent->val_ = 0; + persistent->val_ = nullptr; return reinterpret_cast(v); } @@ -633,7 +633,7 @@ class PersistentValueVector { private: static PersistentContainerValue ClearAndLeak(Global* persistent) { V* v = persistent->val_; - persistent->val_ = 0; + persistent->val_ = nullptr; return reinterpret_cast(v); } diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 63dc5e7a7bab0f..8624767047c2f1 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 0 -#define V8_BUILD_NUMBER 276 -#define V8_PATCH_LEVEL 38 +#define V8_MINOR_VERSION 1 +#define V8_BUILD_NUMBER 302 +#define V8_PATCH_LEVEL 28 // 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 e1951ec270597d..a4bbe1b0c43d66 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -22,42 +22,13 @@ #include #include -#include "v8-version.h" // NOLINT(build/include) -#include "v8config.h" // NOLINT(build/include) +#include "v8-internal.h" // NOLINT(build/include) +#include "v8-version.h" // NOLINT(build/include) +#include "v8config.h" // NOLINT(build/include) // We reserve the V8_* prefix for macros defined in V8 public API and // assume there are no name conflicts with the embedder's code. -#ifdef V8_OS_WIN - -// Setup for Windows DLL export/import. When building the V8 DLL the -// BUILDING_V8_SHARED needs to be defined. When building a program which uses -// the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8 -// static library or building a program which uses the V8 static library neither -// BUILDING_V8_SHARED nor USING_V8_SHARED should be defined. -#ifdef BUILDING_V8_SHARED -# define V8_EXPORT __declspec(dllexport) -#elif USING_V8_SHARED -# define V8_EXPORT __declspec(dllimport) -#else -# define V8_EXPORT -#endif // BUILDING_V8_SHARED - -#else // V8_OS_WIN - -// Setup for Linux shared library export. -#if V8_HAS_ATTRIBUTE_VISIBILITY -# ifdef BUILDING_V8_SHARED -# define V8_EXPORT __attribute__ ((visibility("default"))) -# else -# define V8_EXPORT -# endif -#else -# define V8_EXPORT -#endif - -#endif // V8_OS_WIN - /** * The v8 JavaScript engine. */ @@ -153,108 +124,13 @@ template class CustomArguments; class PropertyCallbackArguments; class FunctionCallbackArguments; class GlobalHandles; +class ScopedExternalStringLock; namespace wasm { class NativeModule; class StreamingDecoder; } // namespace wasm -/** - * Configuration of tagging scheme. - */ -const int kApiPointerSize = sizeof(void*); // NOLINT -const int kApiDoubleSize = sizeof(double); // NOLINT -const int kApiIntSize = sizeof(int); // NOLINT -const int kApiInt64Size = sizeof(int64_t); // NOLINT - -// Tag information for HeapObject. -const int kHeapObjectTag = 1; -const int kWeakHeapObjectTag = 3; -const int kHeapObjectTagSize = 2; -const intptr_t kHeapObjectTagMask = (1 << kHeapObjectTagSize) - 1; - -// Tag information for Smi. -const int kSmiTag = 0; -const int kSmiTagSize = 1; -const intptr_t kSmiTagMask = (1 << kSmiTagSize) - 1; - -template -struct SmiTagging; - -template -V8_INLINE internal::Object* IntToSmi(int value) { - int smi_shift_bits = kSmiTagSize + kSmiShiftSize; - intptr_t tagged_value = - (static_cast(value) << smi_shift_bits) | kSmiTag; - return reinterpret_cast(tagged_value); -} - -// Smi constants for systems where tagged pointer is a 32-bit value. -template <> -struct SmiTagging<4> { - enum { kSmiShiftSize = 0, kSmiValueSize = 31 }; - static int SmiShiftSize() { return kSmiShiftSize; } - static int SmiValueSize() { return kSmiValueSize; } - V8_INLINE static int SmiToInt(const internal::Object* value) { - int shift_bits = kSmiTagSize + kSmiShiftSize; - // Throw away top 32 bits and shift down (requires >> to be sign extending). - return static_cast(reinterpret_cast(value)) >> shift_bits; - } - V8_INLINE static internal::Object* IntToSmi(int value) { - return internal::IntToSmi(value); - } - 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; - } -}; - -// Smi constants for systems where tagged pointer is a 64-bit value. -template <> -struct SmiTagging<8> { - enum { kSmiShiftSize = 31, kSmiValueSize = 32 }; - static int SmiShiftSize() { return kSmiShiftSize; } - static int SmiValueSize() { return kSmiValueSize; } - V8_INLINE static int SmiToInt(const internal::Object* value) { - int shift_bits = kSmiTagSize + kSmiShiftSize; - // Shift down and throw away top 32 bits. - return static_cast(reinterpret_cast(value) >> shift_bits); - } - V8_INLINE static internal::Object* IntToSmi(int value) { - return internal::IntToSmi(value); - } - V8_INLINE static constexpr bool IsValidSmi(intptr_t value) { - // To be representable as a long smi, the value must be a 32-bit integer. - return (value == static_cast(value)); - } -}; - -#if V8_COMPRESS_POINTERS -static_assert( - kApiPointerSize == kApiInt64Size, - "Pointer compression can be enabled only for 64-bit architectures"); -typedef SmiTagging<4> PlatformSmiTagging; -#else -typedef SmiTagging PlatformSmiTagging; -#endif - -const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize; -const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize; -const int kSmiMinValue = (static_cast(-1)) << (kSmiValueSize - 1); -const int kSmiMaxValue = -(kSmiMinValue + 1); -constexpr bool SmiValuesAre31Bits() { return kSmiValueSize == 31; } -constexpr bool SmiValuesAre32Bits() { return kSmiValueSize == 32; } - } // namespace internal namespace debug { @@ -302,7 +178,7 @@ class ConsoleCallArguments; template class Local { public: - V8_INLINE Local() : val_(0) {} + V8_INLINE Local() : val_(nullptr) {} template V8_INLINE Local(Local that) : val_(reinterpret_cast(*that)) { @@ -317,12 +193,12 @@ class Local { /** * Returns true if the handle is empty. */ - V8_INLINE bool IsEmpty() const { return val_ == 0; } + V8_INLINE bool IsEmpty() const { return val_ == nullptr; } /** * Sets the handle to be empty. IsEmpty() will then return true. */ - V8_INLINE void Clear() { val_ = 0; } + V8_INLINE void Clear() { val_ = nullptr; } V8_INLINE T* operator->() const { return val_; } @@ -338,8 +214,8 @@ class Local { V8_INLINE bool operator==(const Local& that) const { internal::Object** a = reinterpret_cast(this->val_); internal::Object** b = reinterpret_cast(that.val_); - if (a == 0) return b == 0; - if (b == 0) return false; + if (a == nullptr) return b == nullptr; + if (b == nullptr) return false; return *a == *b; } @@ -347,8 +223,8 @@ class Local { const PersistentBase& that) const { internal::Object** a = reinterpret_cast(this->val_); internal::Object** b = reinterpret_cast(that.val_); - if (a == 0) return b == 0; - if (b == 0) return false; + if (a == nullptr) return b == nullptr; + if (b == nullptr) return false; return *a == *b; } @@ -592,7 +468,7 @@ template class PersistentBase { template V8_INLINE void Reset(Isolate* isolate, const PersistentBase& other); - V8_INLINE bool IsEmpty() const { return val_ == NULL; } + V8_INLINE bool IsEmpty() const { return val_ == nullptr; } V8_INLINE void Empty() { val_ = 0; } V8_INLINE Local Get(Isolate* isolate) const { @@ -603,8 +479,8 @@ template class PersistentBase { V8_INLINE bool operator==(const PersistentBase& that) const { internal::Object** a = reinterpret_cast(this->val_); internal::Object** b = reinterpret_cast(that.val_); - if (a == NULL) return b == NULL; - if (b == NULL) return false; + if (a == nullptr) return b == nullptr; + if (b == nullptr) return false; return *a == *b; } @@ -612,8 +488,8 @@ template class PersistentBase { V8_INLINE bool operator==(const Local& that) const { internal::Object** a = reinterpret_cast(this->val_); internal::Object** b = reinterpret_cast(that.val_); - if (a == NULL) return b == NULL; - if (b == NULL) return false; + if (a == nullptr) return b == nullptr; + if (b == nullptr) return false; return *a == *b; } @@ -786,7 +662,7 @@ template class Persistent : public PersistentBase { /** * A Persistent with no storage cell. */ - V8_INLINE Persistent() : PersistentBase(0) { } + V8_INLINE Persistent() : PersistentBase(nullptr) {} /** * Construct a Persistent from a Local. * When the Local is non-empty, a new storage cell is created @@ -813,7 +689,7 @@ template class Persistent : public PersistentBase { * traits class is called, allowing the setting of flags based on the * copied Persistent. */ - V8_INLINE Persistent(const Persistent& that) : PersistentBase(0) { + V8_INLINE Persistent(const Persistent& that) : PersistentBase(nullptr) { Copy(that); } template @@ -979,7 +855,7 @@ class V8_EXPORT HandleScope { void operator=(const HandleScope&) = delete; protected: - V8_INLINE HandleScope() {} + V8_INLINE HandleScope() = default; void Initialize(Isolate* isolate); @@ -1019,7 +895,7 @@ class V8_EXPORT HandleScope { class V8_EXPORT EscapableHandleScope : public HandleScope { public: explicit EscapableHandleScope(Isolate* isolate); - V8_INLINE ~EscapableHandleScope() {} + V8_INLINE ~EscapableHandleScope() = default; /** * Pushes the value into the previous scope and returns a handle to it. @@ -1123,10 +999,6 @@ class V8_EXPORT PrimitiveArray { public: static Local New(Isolate* isolate, int length); int Length() const; - V8_DEPRECATED("Use Isolate* version", - void Set(int index, Local item)); - V8_DEPRECATED("Use Isolate* version", - Local Get(int index)); void Set(Isolate* isolate, int index, Local item); Local Get(Isolate* isolate, int index); }; @@ -1393,7 +1265,7 @@ class V8_EXPORT ScriptCompiler { }; CachedData() - : data(NULL), + : data(nullptr), length(0), rejected(false), buffer_policy(BufferNotOwned) {} @@ -1424,9 +1296,9 @@ class V8_EXPORT ScriptCompiler { public: // Source takes ownership of CachedData. V8_INLINE Source(Local source_string, const ScriptOrigin& origin, - CachedData* cached_data = NULL); + CachedData* cached_data = nullptr); V8_INLINE Source(Local source_string, - CachedData* cached_data = NULL); + CachedData* cached_data = nullptr); V8_INLINE ~Source(); // Ownership of the CachedData or its buffers is *not* transferred to the @@ -1465,7 +1337,7 @@ class V8_EXPORT ScriptCompiler { */ class V8_EXPORT ExternalSourceStream { public: - virtual ~ExternalSourceStream() {} + virtual ~ExternalSourceStream() = default; /** * V8 calls this to request the next chunk of data from the embedder. This @@ -1508,12 +1380,11 @@ class V8_EXPORT ScriptCompiler { virtual void ResetToBookmark(); }; - /** * Source code which can be streamed into V8 in pieces. It will be parsed - * while streaming. It can be compiled after the streaming is complete. - * StreamedSource must be kept alive while the streaming task is ran (see - * ScriptStreamingTask below). + * while streaming and compiled after parsing has completed. StreamedSource + * must be kept alive while the streaming task is run (see ScriptStreamingTask + * below). */ class V8_EXPORT StreamedSource { public: @@ -1522,29 +1393,35 @@ class V8_EXPORT ScriptCompiler { StreamedSource(ExternalSourceStream* source_stream, Encoding encoding); ~StreamedSource(); - // Ownership of the CachedData or its buffers is *not* transferred to the - // caller. The CachedData object is alive as long as the StreamedSource - // object is alive. - const CachedData* GetCachedData() const; + V8_DEPRECATED("No longer used", const CachedData* GetCachedData() const) { + return nullptr; + } - internal::ScriptStreamingData* impl() const { return impl_; } + internal::ScriptStreamingData* impl() const { return impl_.get(); } // Prevent copying. StreamedSource(const StreamedSource&) = delete; StreamedSource& operator=(const StreamedSource&) = delete; private: - internal::ScriptStreamingData* impl_; + std::unique_ptr impl_; }; /** * A streaming task which the embedder must run on a background thread to * stream scripts into V8. Returned by ScriptCompiler::StartStreamingScript. */ - class ScriptStreamingTask { + class V8_EXPORT ScriptStreamingTask final { public: - virtual ~ScriptStreamingTask() {} - virtual void Run() = 0; + void Run(); + + private: + friend class ScriptCompiler; + + explicit ScriptStreamingTask(internal::ScriptStreamingData* data) + : data_(data) {} + + internal::ScriptStreamingData* data_; }; enum CompileOptions { @@ -1833,8 +1710,6 @@ class V8_EXPORT StackTrace { /** * Returns a StackFrame at a particular index. */ - V8_DEPRECATED("Use Isolate version", - Local GetFrame(uint32_t index) const); Local GetFrame(Isolate* isolate, uint32_t index) const; /** @@ -1951,6 +1826,11 @@ struct SampleInfo { // executing an external callback. }; +struct MemoryRange { + const void* start; + size_t length_in_bytes; +}; + /** * A JSON Parser and Stringifier. */ @@ -1993,7 +1873,7 @@ class V8_EXPORT ValueSerializer { public: class V8_EXPORT Delegate { public: - virtual ~Delegate() {} + virtual ~Delegate() = default; /** * Handles the case where a DataCloneError would be thrown in the structured @@ -2130,7 +2010,7 @@ class V8_EXPORT ValueDeserializer { public: class V8_EXPORT Delegate { public: - virtual ~Delegate() {} + virtual ~Delegate() = default; /** * The embedder overrides this method to read some kind of host object, if @@ -2514,8 +2394,9 @@ class V8_EXPORT Value : public Data { V8_WARN_UNUSED_RESULT MaybeLocal ToBigInt( Local context) const; - V8_WARN_UNUSED_RESULT MaybeLocal ToBoolean( - Local context) const; + V8_DEPRECATE_SOON("ToBoolean can never throw. Use Local version.", + V8_WARN_UNUSED_RESULT MaybeLocal ToBoolean( + Local context) const); V8_WARN_UNUSED_RESULT MaybeLocal ToNumber( Local context) const; V8_WARN_UNUSED_RESULT MaybeLocal ToString( @@ -2530,25 +2411,17 @@ class V8_EXPORT Value : public Data { Local context) const; V8_WARN_UNUSED_RESULT MaybeLocal ToInt32(Local context) const; - V8_DEPRECATED("Use maybe version", - Local ToBoolean(Isolate* isolate) const); - V8_DEPRECATED("Use maybe version", - Local ToNumber(Isolate* isolate) const); - V8_DEPRECATED("Use maybe version", - Local ToString(Isolate* isolate) const); - V8_DEPRECATED("Use maybe version", - Local ToObject(Isolate* isolate) const); - V8_DEPRECATED("Use maybe version", - Local ToInteger(Isolate* isolate) const); - V8_DEPRECATED("Use maybe version", - Local ToInt32(Isolate* isolate) const); - - inline V8_DEPRECATED("Use maybe version", - Local ToBoolean() const); - inline V8_DEPRECATED("Use maybe version", Local ToString() const); - inline V8_DEPRECATED("Use maybe version", Local ToObject() const); - inline V8_DEPRECATED("Use maybe version", - Local ToInteger() const); + Local ToBoolean(Isolate* isolate) const; + V8_DEPRECATE_SOON("Use maybe version", + Local ToNumber(Isolate* isolate) const); + V8_DEPRECATE_SOON("Use maybe version", + Local ToString(Isolate* isolate) const); + V8_DEPRECATE_SOON("Use maybe version", + Local ToObject(Isolate* isolate) const); + V8_DEPRECATE_SOON("Use maybe version", + Local ToInteger(Isolate* isolate) const); + V8_DEPRECATE_SOON("Use maybe version", + Local ToInt32(Isolate* isolate) const); /** * Attempts to convert a string to an array index. @@ -2557,7 +2430,11 @@ class V8_EXPORT Value : public Data { V8_WARN_UNUSED_RESULT MaybeLocal ToArrayIndex( Local context) const; - V8_WARN_UNUSED_RESULT Maybe BooleanValue(Local context) const; + bool BooleanValue(Isolate* isolate) const; + + V8_DEPRECATE_SOON("BooleanValue can never throw. Use Isolate version.", + V8_WARN_UNUSED_RESULT Maybe BooleanValue( + Local context) const); V8_WARN_UNUSED_RESULT Maybe NumberValue(Local context) const; V8_WARN_UNUSED_RESULT Maybe IntegerValue( Local context) const; @@ -2565,14 +2442,7 @@ class V8_EXPORT Value : public Data { Local context) const; V8_WARN_UNUSED_RESULT Maybe Int32Value(Local context) const; - V8_DEPRECATED("Use maybe version", bool BooleanValue() const); - V8_DEPRECATED("Use maybe version", double NumberValue() const); - V8_DEPRECATED("Use maybe version", int64_t IntegerValue() const); - V8_DEPRECATED("Use maybe version", uint32_t Uint32Value() const); - V8_DEPRECATED("Use maybe version", int32_t Int32Value() const); - /** JS == */ - V8_DEPRECATED("Use maybe version", bool Equals(Local that) const); V8_WARN_UNUSED_RESULT Maybe Equals(Local context, Local that) const; bool StrictEquals(Local that) const; @@ -2679,8 +2549,6 @@ class V8_EXPORT String : public Name { * Returns the number of bytes in the UTF-8 encoded * representation of this string. */ - V8_DEPRECATED("Use Isolate version instead", int Utf8Length() const); - int Utf8Length(Isolate* isolate) const; /** @@ -2737,23 +2605,12 @@ class V8_EXPORT String : public Name { // 16-bit character codes. int Write(Isolate* isolate, uint16_t* buffer, int start = 0, int length = -1, int options = NO_OPTIONS) const; - V8_DEPRECATED("Use Isolate* version", - int Write(uint16_t* buffer, int start = 0, int length = -1, - int options = NO_OPTIONS) const); // One byte characters. int WriteOneByte(Isolate* isolate, uint8_t* buffer, int start = 0, int length = -1, int options = NO_OPTIONS) const; - V8_DEPRECATED("Use Isolate* version", - int WriteOneByte(uint8_t* buffer, int start = 0, - int length = -1, int options = NO_OPTIONS) - const); // UTF-8 encoded characters. int WriteUtf8(Isolate* isolate, char* buffer, int length = -1, - int* nchars_ref = NULL, int options = NO_OPTIONS) const; - V8_DEPRECATED("Use Isolate* version", - int WriteUtf8(char* buffer, int length = -1, - int* nchars_ref = NULL, - int options = NO_OPTIONS) const); + int* nchars_ref = nullptr, int options = NO_OPTIONS) const; /** * A zero length string. @@ -2772,12 +2629,31 @@ class V8_EXPORT String : public Name { class V8_EXPORT ExternalStringResourceBase { // NOLINT public: - virtual ~ExternalStringResourceBase() {} + virtual ~ExternalStringResourceBase() = default; - virtual bool IsCompressible() const { return false; } + V8_DEPRECATE_SOON("Use IsCacheable().", + virtual bool IsCompressible() const) { + return false; + } + + /** + * If a string is cacheable, the value returned by + * ExternalStringResource::data() may be cached, otherwise it is not + * expected to be stable beyond the current top-level task. + */ + virtual bool IsCacheable() const { +#if __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + return !IsCompressible(); +#if __clang__ +#pragma clang diagnostic pop +#endif + } protected: - ExternalStringResourceBase() {} + ExternalStringResourceBase() = default; /** * Internally V8 will call this Dispose method when the external string @@ -2787,6 +2663,24 @@ class V8_EXPORT String : public Name { */ virtual void Dispose() { delete this; } + /** + * For a non-cacheable string, the value returned by + * |ExternalStringResource::data()| has to be stable between |Lock()| and + * |Unlock()|, that is the string must behave as is |IsCacheable()| returned + * true. + * + * These two functions must be thread-safe, and can be called from anywhere. + * They also must handle lock depth, in the sense that each can be called + * several times, from different threads, and unlocking should only happen + * when the balance of Lock() and Unlock() calls is 0. + */ + virtual void Lock() const {} + + /** + * Unlocks the string. + */ + virtual void Unlock() const {} + // Disallow copying and assigning. ExternalStringResourceBase(const ExternalStringResourceBase&) = delete; void operator=(const ExternalStringResourceBase&) = delete; @@ -2794,6 +2688,7 @@ class V8_EXPORT String : public Name { private: friend class internal::Heap; friend class v8::String; + friend class internal::ScopedExternalStringLock; }; /** @@ -2809,7 +2704,7 @@ class V8_EXPORT String : public Name { * Override the destructor to manage the life cycle of the underlying * buffer. */ - virtual ~ExternalStringResource() {} + ~ExternalStringResource() override = default; /** * The string data from the underlying buffer. @@ -2822,7 +2717,7 @@ class V8_EXPORT String : public Name { virtual size_t length() const = 0; protected: - ExternalStringResource() {} + ExternalStringResource() = default; }; /** @@ -2842,13 +2737,13 @@ class V8_EXPORT String : public Name { * Override the destructor to manage the life cycle of the underlying * buffer. */ - virtual ~ExternalOneByteStringResource() {} + ~ExternalOneByteStringResource() override = default; /** The string data from the underlying buffer.*/ virtual const char* data() const = 0; /** The number of Latin-1 characters in the string.*/ virtual size_t length() const = 0; protected: - ExternalOneByteStringResource() {} + ExternalOneByteStringResource() = default; }; /** @@ -2917,9 +2812,6 @@ class V8_EXPORT String : public Name { */ static Local Concat(Isolate* isolate, Local left, Local right); - static V8_DEPRECATED("Use Isolate* version", - Local Concat(Local left, - Local right)); /** * Creates a new external string using the data defined in the given @@ -2988,8 +2880,6 @@ class V8_EXPORT String : public Name { */ class V8_EXPORT Utf8Value { public: - V8_DEPRECATED("Use Isolate version", - explicit Utf8Value(Local obj)); Utf8Value(Isolate* isolate, Local obj); ~Utf8Value(); char* operator*() { return str_; } @@ -3013,7 +2903,6 @@ class V8_EXPORT String : public Name { */ class V8_EXPORT Value { public: - V8_DEPRECATED("Use Isolate version", explicit Value(Local obj)); Value(Isolate* isolate, Local obj); ~Value(); uint16_t* operator*() { return str_; } @@ -3075,6 +2964,7 @@ class V8_EXPORT Symbol : public Name { static Local ForApi(Isolate *isolate, Local name); // Well-known symbols + static Local GetAsyncIterator(Isolate* isolate); static Local GetHasInstance(Isolate* isolate); static Local GetIsConcatSpreadable(Isolate* isolate); static Local GetIterator(Isolate* isolate); @@ -3312,10 +3202,17 @@ enum PropertyFilter { * Options for marking whether callbacks may trigger JS-observable side effects. * Side-effect-free callbacks are whitelisted during debug evaluation with * throwOnSideEffect. It applies when calling a Function, FunctionTemplate, - * or an Accessor's getter callback. For Interceptors, please see + * or an Accessor callback. For Interceptors, please see * PropertyHandlerFlags's kHasNoSideEffect. + * Callbacks that only cause side effects to the receiver are whitelisted if + * invoked on receiver objects that are created within the same debug-evaluate + * call, as these objects are temporary and the side effect does not escape. */ -enum class SideEffectType { kHasSideEffect, kHasNoSideEffect }; +enum class SideEffectType { + kHasSideEffect, + kHasNoSideEffect, + kHasSideEffectToReceiver +}; /** * Keys/Properties filter enums: @@ -3439,7 +3336,7 @@ class V8_EXPORT Object : public Value { V8_WARN_UNUSED_RESULT Maybe Has(Local context, Local key); - V8_DEPRECATED("Use maybe version", bool Delete(Local key)); + V8_DEPRECATE_SOON("Use maybe version", bool Delete(Local key)); V8_WARN_UNUSED_RESULT Maybe Delete(Local context, Local key); @@ -3453,10 +3350,12 @@ class V8_EXPORT Object : public Value { */ V8_WARN_UNUSED_RESULT Maybe SetAccessor( Local context, Local name, - AccessorNameGetterCallback getter, AccessorNameSetterCallback setter = 0, + AccessorNameGetterCallback getter, + AccessorNameSetterCallback setter = nullptr, MaybeLocal data = MaybeLocal(), AccessControl settings = DEFAULT, PropertyAttribute attribute = None, - SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect); + SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect, + SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect); void SetAccessorProperty(Local name, Local getter, Local setter = Local(), @@ -3472,7 +3371,8 @@ class V8_EXPORT Object : public Value { AccessorNameGetterCallback getter, AccessorNameSetterCallback setter = nullptr, Local data = Local(), PropertyAttribute attributes = None, - SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect); + SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect, + SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect); /** * Attempts to create a property with the given name which behaves like a data @@ -3486,7 +3386,8 @@ class V8_EXPORT Object : public Value { Local context, Local name, AccessorNameGetterCallback getter, Local data = Local(), PropertyAttribute attributes = None, - SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect); + SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect, + SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect); /** * Functionality for private properties. @@ -3779,12 +3680,6 @@ class V8_EXPORT Array : public Object { */ static Local New(Isolate* isolate, int length = 0); - /** - * Creates a JavaScript array out of a Local array in C++ - * with a known length. - */ - static Local New(Isolate* isolate, Local* elements, - size_t length); V8_INLINE static Array* Cast(Value* obj); private: Array(); @@ -4518,7 +4413,7 @@ class V8_EXPORT WasmModuleObjectBuilderStreaming final { void Abort(MaybeLocal exception); Local GetPromise(); - ~WasmModuleObjectBuilderStreaming(); + ~WasmModuleObjectBuilderStreaming() = default; private: WasmModuleObjectBuilderStreaming(const WasmModuleObjectBuilderStreaming&) = @@ -4577,7 +4472,7 @@ class V8_EXPORT ArrayBuffer : public Object { */ class V8_EXPORT Allocator { // NOLINT public: - virtual ~Allocator() {} + virtual ~Allocator() = default; /** * Allocate |length| bytes. Return NULL if allocation is not successful. @@ -5238,8 +5133,6 @@ class V8_EXPORT BooleanObject : public Object { class V8_EXPORT StringObject : public Object { public: static Local New(Isolate* isolate, Local value); - V8_DEPRECATED("Use Isolate* version", - static Local New(Local value)); Local ValueOf() const; @@ -5400,20 +5293,22 @@ class V8_EXPORT Template : public Data { */ void SetNativeDataProperty( Local name, AccessorGetterCallback getter, - AccessorSetterCallback setter = 0, + AccessorSetterCallback setter = nullptr, // TODO(dcarney): gcc can't handle Local below Local data = Local(), PropertyAttribute attribute = None, Local signature = Local(), AccessControl settings = DEFAULT, - SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect); + SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect, + SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect); void SetNativeDataProperty( Local name, AccessorNameGetterCallback getter, - AccessorNameSetterCallback setter = 0, + AccessorNameSetterCallback setter = nullptr, // TODO(dcarney): gcc can't handle Local below Local data = Local(), PropertyAttribute attribute = None, Local signature = Local(), AccessControl settings = DEFAULT, - SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect); + SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect, + SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect); /** * Like SetNativeDataProperty, but V8 will replace the native data property @@ -5422,7 +5317,8 @@ class V8_EXPORT Template : public Data { void SetLazyDataProperty( Local name, AccessorNameGetterCallback getter, Local data = Local(), PropertyAttribute attribute = None, - SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect); + SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect, + SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect); /** * During template instantiation, sets the value with the intrinsic property @@ -5783,7 +5679,7 @@ class V8_EXPORT FunctionTemplate : public Template { public: /** Creates a function template.*/ static Local New( - Isolate* isolate, FunctionCallback callback = 0, + Isolate* isolate, FunctionCallback callback = nullptr, Local data = Local(), Local signature = Local(), int length = 0, ConstructorBehavior behavior = ConstructorBehavior::kAllow, @@ -5964,11 +5860,11 @@ struct NamedPropertyHandlerConfiguration { NamedPropertyHandlerConfiguration( /** Note: getter is required */ - GenericNamedPropertyGetterCallback getter = 0, - GenericNamedPropertySetterCallback setter = 0, - GenericNamedPropertyQueryCallback query = 0, - GenericNamedPropertyDeleterCallback deleter = 0, - GenericNamedPropertyEnumeratorCallback enumerator = 0, + GenericNamedPropertyGetterCallback getter = nullptr, + GenericNamedPropertySetterCallback setter = nullptr, + GenericNamedPropertyQueryCallback query = nullptr, + GenericNamedPropertyDeleterCallback deleter = nullptr, + GenericNamedPropertyEnumeratorCallback enumerator = nullptr, Local data = Local(), PropertyHandlerFlags flags = PropertyHandlerFlags::kNone) : getter(getter), @@ -5976,8 +5872,8 @@ struct NamedPropertyHandlerConfiguration { query(query), deleter(deleter), enumerator(enumerator), - definer(0), - descriptor(0), + definer(nullptr), + descriptor(nullptr), data(data), flags(flags) {} @@ -5992,7 +5888,7 @@ struct NamedPropertyHandlerConfiguration { PropertyHandlerFlags flags = PropertyHandlerFlags::kNone) : getter(getter), setter(setter), - query(0), + query(nullptr), deleter(deleter), enumerator(enumerator), definer(definer), @@ -6034,11 +5930,11 @@ struct IndexedPropertyHandlerConfiguration { IndexedPropertyHandlerConfiguration( /** Note: getter is required */ - IndexedPropertyGetterCallback getter = 0, - IndexedPropertySetterCallback setter = 0, - IndexedPropertyQueryCallback query = 0, - IndexedPropertyDeleterCallback deleter = 0, - IndexedPropertyEnumeratorCallback enumerator = 0, + IndexedPropertyGetterCallback getter = nullptr, + IndexedPropertySetterCallback setter = nullptr, + IndexedPropertyQueryCallback query = nullptr, + IndexedPropertyDeleterCallback deleter = nullptr, + IndexedPropertyEnumeratorCallback enumerator = nullptr, Local data = Local(), PropertyHandlerFlags flags = PropertyHandlerFlags::kNone) : getter(getter), @@ -6046,8 +5942,8 @@ struct IndexedPropertyHandlerConfiguration { query(query), deleter(deleter), enumerator(enumerator), - definer(0), - descriptor(0), + definer(nullptr), + descriptor(nullptr), data(data), flags(flags) {} @@ -6062,7 +5958,7 @@ struct IndexedPropertyHandlerConfiguration { PropertyHandlerFlags flags = PropertyHandlerFlags::kNone) : getter(getter), setter(setter), - query(0), + query(nullptr), deleter(deleter), enumerator(enumerator), definer(definer), @@ -6134,16 +6030,20 @@ class V8_EXPORT ObjectTemplate : public Template { */ void SetAccessor( Local name, AccessorGetterCallback getter, - AccessorSetterCallback setter = 0, Local data = Local(), - AccessControl settings = DEFAULT, PropertyAttribute attribute = None, + AccessorSetterCallback setter = nullptr, + Local data = Local(), AccessControl settings = DEFAULT, + PropertyAttribute attribute = None, Local signature = Local(), - SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect); + SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect, + SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect); void SetAccessor( Local name, AccessorNameGetterCallback getter, - AccessorNameSetterCallback setter = 0, Local data = Local(), - AccessControl settings = DEFAULT, PropertyAttribute attribute = None, + AccessorNameSetterCallback setter = nullptr, + Local data = Local(), AccessControl settings = DEFAULT, + PropertyAttribute attribute = None, Local signature = Local(), - SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect); + SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect, + SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect); /** * Sets a named property handler on the object template. @@ -6177,10 +6077,10 @@ class V8_EXPORT ObjectTemplate : public Template { // TODO(dcarney): deprecate void SetIndexedPropertyHandler( IndexedPropertyGetterCallback getter, - IndexedPropertySetterCallback setter = 0, - IndexedPropertyQueryCallback query = 0, - IndexedPropertyDeleterCallback deleter = 0, - IndexedPropertyEnumeratorCallback enumerator = 0, + IndexedPropertySetterCallback setter = nullptr, + IndexedPropertyQueryCallback query = nullptr, + IndexedPropertyDeleterCallback deleter = nullptr, + IndexedPropertyEnumeratorCallback enumerator = nullptr, Local data = Local()) { SetHandler(IndexedPropertyHandlerConfiguration(getter, setter, query, deleter, enumerator, data)); @@ -6320,11 +6220,11 @@ V8_DEPRECATE_SOON("Implementation detail", class) V8_EXPORT ExternalOneByteStringResourceImpl : public String::ExternalOneByteStringResource { public: - ExternalOneByteStringResourceImpl() : data_(0), length_(0) {} + ExternalOneByteStringResourceImpl() : data_(nullptr), length_(0) {} ExternalOneByteStringResourceImpl(const char* data, size_t length) : data_(data), length_(length) {} - const char* data() const { return data_; } - size_t length() const { return length_; } + const char* data() const override { return data_; } + size_t length() const override { return length_; } private: const char* data_; @@ -6338,11 +6238,8 @@ class V8_EXPORT Extension { // NOLINT public: // Note that the strings passed into this constructor must live as long // as the Extension itself. - Extension(const char* name, - const char* source = 0, - int dep_count = 0, - const char** deps = 0, - int source_length = -1); + Extension(const char* name, const char* source = nullptr, int dep_count = 0, + const char** deps = nullptr, int source_length = -1); virtual ~Extension() { delete source_; } virtual Local GetNativeFunctionTemplate( Isolate* isolate, Local name) { @@ -6566,6 +6463,15 @@ typedef void (*HostInitializeImportMetaObjectCallback)(Local context, Local module, Local meta); +/** + * PrepareStackTraceCallback is called when the stack property of an error is + * first accessed. The return value will be used as the stack value. If this + * callback is registed, the |Error.prepareStackTrace| API will be disabled. + */ +typedef MaybeLocal (*PrepareStackTraceCallback)(Local context, + Local error, + Local trace); + /** * PromiseHook with type kInit is called when a new promise is * created. When a new promise is created as part of the chain in the @@ -6994,7 +6900,7 @@ typedef void (*JitCodeEventHandler)(const JitCodeEvent* event); */ class V8_EXPORT ExternalResourceVisitor { // NOLINT public: - virtual ~ExternalResourceVisitor() {} + virtual ~ExternalResourceVisitor() = default; virtual void VisitExternalString(Local string) {} }; @@ -7004,7 +6910,7 @@ class V8_EXPORT ExternalResourceVisitor { // NOLINT */ class V8_EXPORT PersistentHandleVisitor { // NOLINT public: - virtual ~PersistentHandleVisitor() {} + virtual ~PersistentHandleVisitor() = default; virtual void VisitPersistentHandle(Persistent* value, uint16_t class_id) {} }; @@ -7074,8 +6980,8 @@ class V8_EXPORT EmbedderHeapTracer { * embedder. */ V8_DEPRECATED("Use void AdvanceTracing(deadline_in_ms)", - virtual bool AdvanceTracing( - double deadline_in_ms, AdvanceTracingActions actions)) { + virtual bool AdvanceTracing(double deadline_in_ms, + AdvanceTracingActions actions)) { return false; } @@ -7124,7 +7030,8 @@ class V8_EXPORT EmbedderHeapTracer { * The embedder is expected to throw away all intermediate data and reset to * the initial state. */ - virtual void AbortTracing() = 0; + V8_DEPRECATE_SOON("Obsolete as V8 will not abort tracing anymore.", + virtual void AbortTracing()) {} /* * Called by the embedder to request immediate finalization of the currently @@ -7153,8 +7060,7 @@ class V8_EXPORT EmbedderHeapTracer { /** * Returns the number of wrappers that are still to be traced by the embedder. */ - V8_DEPRECATE_SOON("Use IsTracingDone", - virtual size_t NumberOfWrappersToTrace()) { + V8_DEPRECATED("Use IsTracingDone", virtual size_t NumberOfWrappersToTrace()) { return 0; } @@ -7458,6 +7364,23 @@ class V8_EXPORT Isolate { kFunctionTokenOffsetTooLongForToString = 49, kWasmSharedMemory = 50, kWasmThreadOpcodes = 51, + kAtomicsNotify = 52, + kAtomicsWake = 53, + kCollator = 54, + kNumberFormat = 55, + kDateTimeFormat = 56, + kPluralRules = 57, + kRelativeTimeFormat = 58, + kLocale = 59, + kListFormat = 60, + kSegmenter = 61, + kStringLocaleCompare = 62, + kStringToLocaleUpperCase = 63, + kStringToLocaleLowerCase = 64, + kNumberToLocaleString = 65, + kDateToLocaleString = 66, + kDateToLocaleDateString = 67, + kDateToLocaleTimeString = 68, // If you add new values here, you'll also need to update Chromium's: // web_feature.mojom, UseCounterCallback.cpp, and enums.xml. V8 changes to @@ -7545,6 +7468,12 @@ class V8_EXPORT Isolate { void SetHostInitializeImportMetaObjectCallback( HostInitializeImportMetaObjectCallback callback); + /** + * This specifies the callback called when the stack property of Error + * is accessed. + */ + void SetPrepareStackTraceCallback(PrepareStackTraceCallback callback); + /** * Optional notification that the system is running low on memory. * V8 uses these notifications to guide heuristics. @@ -7782,6 +7711,11 @@ class V8_EXPORT Isolate { */ void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer); + /* + * Gets the currently active heap tracer for the isolate. + */ + EmbedderHeapTracer* GetEmbedderHeapTracer(); + /** * Use for |AtomicsWaitCallback| to indicate the type of event it receives. */ @@ -8180,7 +8114,9 @@ class V8_EXPORT Isolate { void SetStackLimit(uintptr_t stack_limit); /** - * Returns a memory range that can potentially contain jitted code. + * Returns a memory range that can potentially contain jitted code. Code for + * V8's 'builtins' will not be in this range if embedded builtins is enabled. + * Instead, see GetEmbeddedCodeRange. * * On Win64, embedders are advised to install function table callbacks for * these ranges, as default SEH won't be able to unwind through jitted code. @@ -8194,6 +8130,15 @@ class V8_EXPORT Isolate { */ void GetCodeRange(void** start, size_t* length_in_bytes); + /** + * Returns a memory range containing the code for V8's embedded functions + * (e.g. builtins) which are shared across isolates. + * + * If embedded builtins are disabled, then the memory range will be a null + * pointer with 0 length. + */ + MemoryRange GetEmbeddedCodeRange(); + /** Set the callback to invoke in case of fatal errors. */ void SetFatalErrorHandler(FatalErrorCallback that); @@ -8933,7 +8878,7 @@ class V8_EXPORT TryCatch { * of the C++ try catch handler itself. */ static void* JSStackComparableAddress(TryCatch* handler) { - if (handler == NULL) return NULL; + if (handler == nullptr) return nullptr; return handler->js_stack_comparable_address_; } @@ -8973,7 +8918,7 @@ class V8_EXPORT TryCatch { */ class V8_EXPORT ExtensionConfiguration { public: - ExtensionConfiguration() : name_count_(0), names_(NULL) { } + ExtensionConfiguration() : name_count_(0), names_(nullptr) {} ExtensionConfiguration(int name_count, const char* names[]) : name_count_(name_count), names_(names) { } @@ -9030,7 +8975,7 @@ class V8_EXPORT Context { * and only object identify will remain. */ static Local New( - Isolate* isolate, ExtensionConfiguration* extensions = NULL, + Isolate* isolate, ExtensionConfiguration* extensions = nullptr, MaybeLocal global_template = MaybeLocal(), MaybeLocal global_object = MaybeLocal(), DeserializeInternalFieldsCallback internal_fields_deserializer = @@ -9369,201 +9314,6 @@ class V8_EXPORT Locker { // --- Implementation --- - -namespace internal { - -/** - * This class exports constants and functionality from within v8 that - * is necessary to implement inline functions in the v8 api. Don't - * depend on functions and constants defined here. - */ -class Internals { - public: - // These values match non-compiler-dependent values defined within - // the implementation of v8. - static const int kHeapObjectMapOffset = 0; - static const int kMapInstanceTypeOffset = 1 * kApiPointerSize + kApiIntSize; - static const int kStringResourceOffset = 3 * kApiPointerSize; - - static const int kOddballKindOffset = 4 * kApiPointerSize + kApiDoubleSize; - static const int kForeignAddressOffset = kApiPointerSize; - static const int kJSObjectHeaderSize = 3 * kApiPointerSize; - static const int kFixedArrayHeaderSize = 2 * kApiPointerSize; - static const int kContextHeaderSize = 2 * kApiPointerSize; - static const int kContextEmbedderDataIndex = 5; - static const int kFullStringRepresentationMask = 0x0f; - static const int kStringEncodingMask = 0x8; - static const int kExternalTwoByteRepresentationTag = 0x02; - static const int kExternalOneByteRepresentationTag = 0x0a; - - static const int kIsolateEmbedderDataOffset = 0 * kApiPointerSize; - static const int kExternalMemoryOffset = 4 * kApiPointerSize; - static const int kExternalMemoryLimitOffset = - kExternalMemoryOffset + kApiInt64Size; - static const int kExternalMemoryAtLastMarkCompactOffset = - kExternalMemoryLimitOffset + kApiInt64Size; - static const int kIsolateRootsOffset = kExternalMemoryLimitOffset + - kApiInt64Size + kApiInt64Size + - kApiPointerSize + kApiPointerSize; - static const int kUndefinedValueRootIndex = 4; - static const int kTheHoleValueRootIndex = 5; - static const int kNullValueRootIndex = 6; - static const int kTrueValueRootIndex = 7; - static const int kFalseValueRootIndex = 8; - static const int kEmptyStringRootIndex = 9; - - static const int kNodeClassIdOffset = 1 * kApiPointerSize; - static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3; - static const int kNodeStateMask = 0x7; - static const int kNodeStateIsWeakValue = 2; - static const int kNodeStateIsPendingValue = 3; - static const int kNodeStateIsNearDeathValue = 4; - static const int kNodeIsIndependentShift = 3; - static const int kNodeIsActiveShift = 4; - - static const int kFirstNonstringType = 0x80; - static const int kOddballType = 0x83; - static const int kForeignType = 0x87; - static const int kJSSpecialApiObjectType = 0x410; - static const int kJSApiObjectType = 0x420; - static const int kJSObjectType = 0x421; - - static const int kUndefinedOddballKind = 5; - static const int kNullOddballKind = 3; - - static const uint32_t kNumIsolateDataSlots = 4; - - V8_EXPORT static void CheckInitializedImpl(v8::Isolate* isolate); - V8_INLINE static void CheckInitialized(v8::Isolate* isolate) { -#ifdef V8_ENABLE_CHECKS - CheckInitializedImpl(isolate); -#endif - } - - V8_INLINE static bool HasHeapObjectTag(const internal::Object* value) { - return ((reinterpret_cast(value) & kHeapObjectTagMask) == - kHeapObjectTag); - } - - V8_INLINE static int SmiValue(const internal::Object* value) { - return PlatformSmiTagging::SmiToInt(value); - } - - V8_INLINE static internal::Object* IntToSmi(int value) { - return PlatformSmiTagging::IntToSmi(value); - } - - V8_INLINE static constexpr bool IsValidSmi(intptr_t value) { - return PlatformSmiTagging::IsValidSmi(value); - } - - V8_INLINE static int GetInstanceType(const internal::Object* obj) { - typedef internal::Object O; - O* map = ReadField(obj, kHeapObjectMapOffset); - return ReadField(map, kMapInstanceTypeOffset); - } - - V8_INLINE static int GetOddballKind(const internal::Object* obj) { - typedef internal::Object O; - return SmiValue(ReadField(obj, kOddballKindOffset)); - } - - V8_INLINE static bool IsExternalTwoByteString(int instance_type) { - int representation = (instance_type & kFullStringRepresentationMask); - return representation == kExternalTwoByteRepresentationTag; - } - - V8_INLINE static uint8_t GetNodeFlag(internal::Object** obj, int shift) { - uint8_t* addr = reinterpret_cast(obj) + kNodeFlagsOffset; - return *addr & static_cast(1U << shift); - } - - V8_INLINE static void UpdateNodeFlag(internal::Object** obj, - bool value, int shift) { - uint8_t* addr = reinterpret_cast(obj) + kNodeFlagsOffset; - uint8_t mask = static_cast(1U << shift); - *addr = static_cast((*addr & ~mask) | (value << shift)); - } - - V8_INLINE static uint8_t GetNodeState(internal::Object** obj) { - uint8_t* addr = reinterpret_cast(obj) + kNodeFlagsOffset; - return *addr & kNodeStateMask; - } - - V8_INLINE static void UpdateNodeState(internal::Object** obj, - uint8_t value) { - uint8_t* addr = reinterpret_cast(obj) + kNodeFlagsOffset; - *addr = static_cast((*addr & ~kNodeStateMask) | value); - } - - V8_INLINE static void SetEmbedderData(v8::Isolate* isolate, - uint32_t slot, - void* data) { - uint8_t* addr = reinterpret_cast(isolate) + - kIsolateEmbedderDataOffset + slot * kApiPointerSize; - *reinterpret_cast(addr) = data; - } - - V8_INLINE static void* GetEmbedderData(const v8::Isolate* isolate, - uint32_t slot) { - const uint8_t* addr = reinterpret_cast(isolate) + - kIsolateEmbedderDataOffset + slot * kApiPointerSize; - return *reinterpret_cast(addr); - } - - V8_INLINE static internal::Object** GetRoot(v8::Isolate* isolate, - int index) { - uint8_t* addr = reinterpret_cast(isolate) + kIsolateRootsOffset; - return reinterpret_cast(addr + index * kApiPointerSize); - } - - template - V8_INLINE static T ReadField(const internal::Object* ptr, int offset) { - const uint8_t* addr = - reinterpret_cast(ptr) + offset - kHeapObjectTag; - return *reinterpret_cast(addr); - } - - template - V8_INLINE static T ReadEmbedderData(const v8::Context* context, int index) { - typedef internal::Object O; - typedef internal::Internals I; - O* ctx = *reinterpret_cast(context); - int embedder_data_offset = I::kContextHeaderSize + - (internal::kApiPointerSize * I::kContextEmbedderDataIndex); - O* embedder_data = I::ReadField(ctx, embedder_data_offset); - int value_offset = - I::kFixedArrayHeaderSize + (internal::kApiPointerSize * index); - return I::ReadField(embedder_data, value_offset); - } -}; - -// Only perform cast check for types derived from v8::Data since -// other types do not implement the Cast method. -template -struct CastCheck { - template - static void Perform(T* data); -}; - -template <> -template -void CastCheck::Perform(T* data) { - T::Cast(data); -} - -template <> -template -void CastCheck::Perform(T* data) {} - -template -V8_INLINE void PerformCastCheck(T* data) { - CastCheck::value>::Perform(data); -} - -} // namespace internal - - template Local Local::New(Isolate* isolate, Local that) { return New(isolate, that.val_); @@ -9577,7 +9327,7 @@ Local Local::New(Isolate* isolate, const PersistentBase& that) { template Local Local::New(Isolate* isolate, T* that) { - if (that == NULL) return Local(); + if (that == nullptr) return Local(); T* that_ptr = that; internal::Object** p = reinterpret_cast(that_ptr); return Local(reinterpret_cast(HandleScope::CreateHandle( @@ -9621,7 +9371,7 @@ void* WeakCallbackInfo::GetInternalField(int index) const { template T* PersistentBase::New(Isolate* isolate, T* that) { - if (that == NULL) return NULL; + if (that == nullptr) return nullptr; internal::Object** p = reinterpret_cast(that); return reinterpret_cast( V8::GlobalizeReference(reinterpret_cast(isolate), @@ -9672,7 +9422,7 @@ template void PersistentBase::Reset() { if (this->IsEmpty()) return; V8::DisposeGlobal(reinterpret_cast(this->val_)); - val_ = 0; + val_ = nullptr; } @@ -10239,30 +9989,6 @@ template Value* Value::Cast(T* value) { } -Local Value::ToBoolean() const { - return ToBoolean(Isolate::GetCurrent()->GetCurrentContext()) - .FromMaybe(Local()); -} - - -Local Value::ToString() const { - return ToString(Isolate::GetCurrent()->GetCurrentContext()) - .FromMaybe(Local()); -} - - -Local Value::ToObject() const { - return ToObject(Isolate::GetCurrent()->GetCurrentContext()) - .FromMaybe(Local()); -} - - -Local Value::ToInteger() const { - return ToInteger(Isolate::GetCurrent()->GetCurrentContext()) - .FromMaybe(Local()); -} - - Boolean* Boolean::Cast(v8::Value* value) { #ifdef V8_ENABLE_CHECKS CheckCast(value); @@ -10711,10 +10437,10 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory( } if (change_in_bytes < 0) { - *external_memory_limit += change_in_bytes; - } - - if (change_in_bytes > 0 && amount > *external_memory_limit) { + const int64_t lower_limit = *external_memory_limit + change_in_bytes; + if (lower_limit > I::kExternalAllocationSoftLimit) + *external_memory_limit = lower_limit; + } else if (change_in_bytes > 0 && amount > *external_memory_limit) { ReportExternalAllocationLimitReached(); } return *external_memory; diff --git a/deps/v8/include/v8config.h b/deps/v8/include/v8config.h index 75fd5aa7e743f7..93c4629825b255 100644 --- a/deps/v8/include/v8config.h +++ b/deps/v8/include/v8config.h @@ -420,6 +420,36 @@ namespace v8 { template class AlignOfHelper { char c; T t; }; } #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ #endif +#ifdef V8_OS_WIN + +// Setup for Windows DLL export/import. When building the V8 DLL the +// BUILDING_V8_SHARED needs to be defined. When building a program which uses +// the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8 +// static library or building a program which uses the V8 static library neither +// BUILDING_V8_SHARED nor USING_V8_SHARED should be defined. +#ifdef BUILDING_V8_SHARED +# define V8_EXPORT __declspec(dllexport) +#elif USING_V8_SHARED +# define V8_EXPORT __declspec(dllimport) +#else +# define V8_EXPORT +#endif // BUILDING_V8_SHARED + +#else // V8_OS_WIN + +// Setup for Linux shared library export. +#if V8_HAS_ATTRIBUTE_VISIBILITY +# ifdef BUILDING_V8_SHARED +# define V8_EXPORT __attribute__ ((visibility("default"))) +# else +# define V8_EXPORT +# endif +#else +# define V8_EXPORT +#endif + +#endif // V8_OS_WIN + // clang-format on #endif // V8CONFIG_H_ diff --git a/deps/v8/infra/config/cq.cfg b/deps/v8/infra/config/cq.cfg index a0ede58b911a79..53ea0cdd44182d 100644 --- a/deps/v8/infra/config/cq.cfg +++ b/deps/v8/infra/config/cq.cfg @@ -108,6 +108,23 @@ verifiers { triggered_by: "v8_win_rel_ng" } } + # TODO(machenbach): Remove after testing in practice and migrate to + # PRESUBMIT.py scripts. + buckets { + name: "luci.chromium.try" + builders { + name: "cast_shell_android" + experiment_percentage: 20 + } + builders { + name: "cast_shell_linux" + experiment_percentage: 20 + } + builders { + name: "linux-chromeos-rel" + experiment_percentage: 20 + } + } } } diff --git a/deps/v8/infra/mb/mb_config.pyl b/deps/v8/infra/mb/mb_config.pyl index 095aeefc5c4631..124524c552f3c3 100644 --- a/deps/v8/infra/mb/mb_config.pyl +++ b/deps/v8/infra/mb/mb_config.pyl @@ -27,24 +27,12 @@ 'mips64el.debug': 'default_debug_mips64el', 'mips64el.optdebug': 'default_optdebug_mips64el', 'mips64el.release': 'default_release_mips64el', - 'ppc.debug': 'default_debug_ppc', - 'ppc.optdebug': 'default_optdebug_ppc', - 'ppc.release': 'default_release_ppc', - 'ppc.debug.sim': 'default_debug_ppc_sim', - 'ppc.optdebug.sim': 'default_optdebug_ppc_sim', - 'ppc.release.sim': 'default_release_ppc_sim', 'ppc64.debug': 'default_debug_ppc64', 'ppc64.optdebug': 'default_optdebug_ppc64', 'ppc64.release': 'default_release_ppc64', 'ppc64.debug.sim': 'default_debug_ppc64_sim', 'ppc64.optdebug.sim': 'default_optdebug_ppc64_sim', 'ppc64.release.sim': 'default_release_ppc64_sim', - 's390.debug': 'default_debug_s390', - 's390.optdebug': 'default_optdebug_s390', - 's390.release': 'default_release_s390', - 's390.debug.sim': 'default_debug_s390_sim', - 's390.optdebug.sim': 'default_optdebug_s390_sim', - 's390.release.sim': 'default_release_s390_sim', 's390x.debug': 'default_debug_s390x', 's390x.optdebug': 'default_optdebug_s390x', 's390x.release': 'default_release_s390x', @@ -54,6 +42,7 @@ 'x64.debug': 'default_debug_x64', 'x64.optdebug': 'default_optdebug_x64', 'x64.release': 'default_release_x64', + 'x64.release.sample': 'release_x64_sample', }, 'client.dynamorio': { 'linux-v8-dr': 'release_x64', @@ -102,6 +91,8 @@ 'V8 Linux gcc 4.8': 'release_x86_gcc', 'V8 Linux64 gcc 4.8 - debug': 'debug_x64_gcc', # FYI. + 'V8 Linux - embedded builtins': 'release_x86_embedded_builtins', + 'V8 Linux - embedded builtins - debug': 'debug_x86_embedded_builtins', 'V8 Fuchsia': 'release_x64_fuchsia', 'V8 Fuchsia - debug': 'debug_x64_fuchsia', 'V8 Linux64 - cfi': 'release_x64_cfi', @@ -138,8 +129,6 @@ 'debug_simulate_arm64_asan_edge', 'V8 Clusterfuzz Linux ASAN arm - debug builder': 'debug_simulate_arm_asan_edge', - 'V8 Clusterfuzz Linux ASAN mipsel - debug builder': - 'debug_simulate_mipsel_asan_edge', 'V8 Clusterfuzz Linux64 CFI - release builder': 'release_x64_cfi_clusterfuzz', 'V8 Clusterfuzz Linux MSAN no origins': @@ -169,11 +158,8 @@ 'V8 Mips - builder': 'release_mips_no_snap_no_i18n', 'V8 Linux - mipsel - sim - builder': 'release_simulate_mipsel', 'V8 Linux - mips64el - sim - builder': 'release_simulate_mips64el', - # PPC. - 'V8 Linux - ppc - sim': 'release_simulate_ppc', + # IBM. 'V8 Linux - ppc64 - sim': 'release_simulate_ppc64', - # S390. - 'V8 Linux - s390 - sim': 'release_simulate_s390', 'V8 Linux - s390x - sim': 'release_simulate_s390x', }, 'client.v8.branches': { @@ -193,12 +179,8 @@ 'V8 mips64el - sim - stable branch': 'release_simulate_mips64el', 'V8 mipsel - sim - beta branch': 'release_simulate_mipsel', 'V8 mipsel - sim - stable branch': 'release_simulate_mipsel', - 'V8 ppc - sim - beta branch': 'release_simulate_ppc', - 'V8 ppc - sim - stable branch': 'release_simulate_ppc', 'V8 ppc64 - sim - beta branch': 'release_simulate_ppc64', 'V8 ppc64 - sim - stable branch': 'release_simulate_ppc64', - 'V8 s390 - sim - beta branch': 'release_simulate_s390', - 'V8 s390 - sim - stable branch': 'release_simulate_s390', 'V8 s390x - sim - beta branch': 'release_simulate_s390x', 'V8 s390x - sim - stable branch': 'release_simulate_s390x', }, @@ -207,7 +189,9 @@ '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_linux_embedded_builtins_rel_ng': 'release_x86_embedded_builtins_trybot', 'v8_linux_rel_ng': 'release_x86_gcmole_trybot', + 'v8_linux_optional_rel_ng': 'release_x86_trybot', 'v8_linux_verify_csa_rel_ng': 'release_x86_verify_csa', 'v8_linux_nodcheck_rel_ng': 'release_x86_minimal_symbols', 'v8_linux_dbg_ng': 'debug_x86_trybot', @@ -218,6 +202,7 @@ 'v8_linux_gcc_compile_rel': 'release_x86_gcc_minimal_symbols', 'v8_linux_gcc_rel': 'release_x86_gcc_minimal_symbols', 'v8_linux_shared_compile_rel': 'release_x86_shared_verify_heap', + 'v8_linux64_compile_rel_xg': 'release_x64_test_features_trybot', 'v8_linux64_dbg_ng': 'debug_x64_trybot', 'v8_linux64_gcc_compile_dbg': 'debug_x64_gcc', 'v8_linux64_header_includes_dbg': 'debug_x64_header_includes', @@ -235,6 +220,7 @@ 'v8_linux64_tsan_isolates_rel_ng': 'release_x64_tsan_minimal_symbols', 'v8_linux64_ubsan_rel_ng': 'release_x64_ubsan_vptr_minimal_symbols', + 'v8_odroid_arm_rel_ng': 'release_arm', # TODO(machenbach): Remove after switching to x64 on infra side. 'v8_win_dbg': 'debug_x86_trybot', 'v8_win_compile_dbg': 'debug_x86_trybot', @@ -280,7 +266,7 @@ 'default_optdebug_android_arm': [ 'debug', 'arm', 'android', 'v8_enable_slow_dchecks' ], 'default_release_android_arm': [ - 'release', 'arm', 'android'], + 'release', 'arm', 'android', 'android_strip_outputs'], 'default_debug_arm64': [ 'debug', 'simulate_arm64', 'v8_enable_slow_dchecks', 'v8_full_debug'], 'default_optdebug_arm64': [ @@ -299,18 +285,6 @@ 'debug', 'simulate_mips64el', 'v8_enable_slow_dchecks'], 'default_release_mips64el': [ 'release', 'simulate_mips64el'], - 'default_debug_ppc': [ - 'debug', 'ppc', 'v8_enable_slow_dchecks', 'v8_full_debug'], - 'default_optdebug_ppc': [ - 'debug', 'ppc', 'v8_enable_slow_dchecks'], - 'default_release_ppc': [ - 'release', 'ppc'], - 'default_debug_ppc_sim': [ - 'debug', 'simulate_ppc', 'v8_enable_slow_dchecks', 'v8_full_debug'], - 'default_optdebug_ppc_sim': [ - 'debug', 'simulate_ppc', 'v8_enable_slow_dchecks'], - 'default_release_ppc_sim': [ - 'release', 'simulate_ppc'], 'default_debug_ppc64': [ 'debug', 'ppc64', 'gcc', 'v8_enable_slow_dchecks', 'v8_full_debug'], 'default_optdebug_ppc64': [ @@ -323,18 +297,6 @@ 'debug', 'simulate_ppc64', 'v8_enable_slow_dchecks'], 'default_release_ppc64_sim': [ 'release', 'simulate_ppc64'], - 'default_debug_s390': [ - 'debug', 's390', 'v8_enable_slow_dchecks', 'v8_full_debug'], - 'default_optdebug_s390': [ - 'debug', 's390', 'v8_enable_slow_dchecks'], - 'default_release_s390': [ - 'release', 's390'], - 'default_debug_s390_sim': [ - 'debug', 'simulate_s390', 'v8_enable_slow_dchecks', 'v8_full_debug'], - 'default_optdebug_s390_sim': [ - 'debug', 'simulate_s390', 'v8_enable_slow_dchecks'], - 'default_release_s390_sim': [ - 'release', 'simulate_s390'], 'default_debug_s390x': [ 'debug', 's390x', 'v8_enable_slow_dchecks', 'v8_full_debug'], 'default_optdebug_s390x': [ @@ -353,6 +315,8 @@ 'debug', 'x64', 'v8_enable_slow_dchecks'], 'default_release_x64': [ 'release', 'x64'], + 'release_x64_sample': [ + 'release', 'x64', 'sample'], 'default_debug_x86': [ 'debug', 'x86', 'v8_enable_slow_dchecks', 'v8_full_debug'], 'default_optdebug_x86': [ @@ -373,8 +337,6 @@ 'debug_simulate_arm64_no_snap': [ 'debug', 'simulate_arm64', 'shared', 'goma', 'v8_optimized_debug', 'v8_snapshot_none'], - 'debug_simulate_mipsel_asan_edge': [ - 'debug_bot', 'simulate_mipsel', 'asan', 'edge'], # Release configs for simulators. 'release_simulate_arm': [ @@ -397,12 +359,8 @@ 'release_bot', 'simulate_mipsel'], 'release_simulate_mips64el': [ 'release_bot', 'simulate_mips64el'], - 'release_simulate_ppc': [ - 'release_bot', 'simulate_ppc'], 'release_simulate_ppc64': [ 'release_bot', 'simulate_ppc64'], - 'release_simulate_s390': [ - 'release_bot', 'simulate_s390'], 'release_simulate_s390x': [ 'release_bot', 'simulate_s390x'], @@ -416,9 +374,11 @@ 'release_arm': [ 'release_bot', 'arm', 'hard_float'], 'release_android_arm': [ - 'release_bot', 'arm', 'android', 'minimal_symbols'], + 'release_bot', 'arm', 'android', 'minimal_symbols', + 'android_strip_outputs'], 'release_android_arm64': [ - 'release_bot', 'arm64', 'android', 'minimal_symbols'], + 'release_bot', 'arm64', 'android', 'minimal_symbols', + 'android_strip_outputs'], # Release configs for x64. 'release_x64': [ @@ -519,6 +479,9 @@ # Debug configs for x86. 'debug_x86': [ 'debug_bot', 'x86'], + 'debug_x86_embedded_builtins': [ + 'debug_bot', 'x86', 'v8_enable_embedded_builtins', + 'v8_no_untrusted_code_mitigations'], 'debug_x86_minimal_symbols': [ 'debug_bot', 'x86', 'minimal_symbols'], 'debug_x86_no_i18n': [ @@ -538,6 +501,12 @@ # Release configs for x86. 'release_x86': [ 'release_bot', 'x86'], + 'release_x86_embedded_builtins': [ + 'release_bot', 'x86', 'v8_enable_embedded_builtins', + 'v8_no_untrusted_code_mitigations'], + 'release_x86_embedded_builtins_trybot': [ + 'release_trybot', 'x86', 'v8_enable_embedded_builtins', + 'v8_no_untrusted_code_mitigations'], 'release_x86_gcc': [ 'release_bot', 'x86', 'gcc'], 'release_x86_gcc_minimal_symbols': [ @@ -580,6 +549,10 @@ 'gn_args': 'target_os="android" v8_android_log_stdout=true', }, + 'android_strip_outputs': { + 'gn_args': 'android_unstripped_runtime_outputs=false', + }, + 'arm': { 'gn_args': 'target_cpu="arm"', }, @@ -625,14 +598,10 @@ 'gn_args': 'is_debug=true v8_enable_backtrace=true', }, - 'v8_use_multi_snapshots': { - 'gn_args': 'v8_use_multi_snapshots=true', - }, - 'debug_bot': { 'mixins': [ 'debug', 'shared', 'goma', 'v8_enable_slow_dchecks', - 'v8_use_multi_snapshots', 'v8_optimized_debug'], + 'v8_optimized_debug'], }, 'debug_trybot': { @@ -715,11 +684,11 @@ }, 'release': { - 'gn_args': 'is_debug=false android_unstripped_runtime_outputs=false', + 'gn_args': 'is_debug=false', }, 'release_bot': { - 'mixins': ['release', 'static', 'goma', 'v8_use_multi_snapshots'], + 'mixins': ['release', 'static', 'goma'], }, 'release_trybot': { @@ -747,18 +716,10 @@ 'gn_args': 'target_cpu="x64" v8_target_cpu="mips64el"', }, - 'simulate_ppc': { - 'gn_args': 'target_cpu="x86" v8_target_cpu="ppc"', - }, - 'simulate_ppc64': { 'gn_args': 'target_cpu="x64" v8_target_cpu="ppc64"', }, - 'simulate_s390': { - 'gn_args': 'target_cpu="x86" v8_target_cpu="s390"', - }, - 'simulate_s390x': { 'gn_args': 'target_cpu="x64" v8_target_cpu="s390x"', }, @@ -808,6 +769,10 @@ 'gn_args': 'v8_correctness_fuzzer=true v8_multi_arch_build=true', }, + 'v8_enable_embedded_builtins': { + 'gn_args': 'v8_enable_embedded_builtins=true', + }, + 'v8_enable_slow_dchecks': { 'gn_args': 'v8_enable_slow_dchecks=true', }, @@ -853,6 +818,10 @@ 'gn_args': 'v8_use_snapshot=false', }, + 'v8_no_untrusted_code_mitigations': { + 'gn_args': 'v8_untrusted_code_mitigations=false', + }, + 'v8_verify_heap': { 'gn_args': 'v8_enable_verify_heap=true', }, @@ -861,18 +830,10 @@ 'gn_args': 'v8_enable_verify_csa=true', }, - 's390': { - 'gn_args': 'target_cpu="s390x" v8_target_cpu="s390"', - }, - 's390x': { 'gn_args': 'target_cpu="s390x" v8_target_cpu="s390x"', }, - 'ppc': { - 'gn_args': 'target_cpu="ppc"', - }, - 'ppc64': { 'gn_args': 'target_cpu="ppc64" use_custom_libcxx=false', }, @@ -885,5 +846,9 @@ 'gn_args': 'target_cpu="x86"', }, + 'sample': { + 'gn_args': 'v8_monolithic=true is_component_build=false ' + 'v8_use_external_startup_data=false use_custom_libcxx=false', + }, }, } diff --git a/deps/v8/src/DEPS b/deps/v8/src/DEPS index 90cfd737f21bd6..99873803c99fc1 100644 --- a/deps/v8/src/DEPS +++ b/deps/v8/src/DEPS @@ -13,6 +13,7 @@ include_rules = [ "+src/heap/heap.h", "+src/heap/heap-inl.h", "+src/heap/heap-write-barrier-inl.h", + "+src/heap/heap-write-barrier.h", "-src/inspector", "-src/interpreter", "+src/interpreter/bytecode-array-accessor.h", @@ -30,6 +31,7 @@ include_rules = [ "+testing/gtest/include/gtest/gtest_prod.h", "-src/libplatform", "-include/libplatform", + "+builtins-generated", "+torque-generated" ] diff --git a/deps/v8/src/accessors.cc b/deps/v8/src/accessors.cc index da935f3652812c..226178394db1bf 100644 --- a/deps/v8/src/accessors.cc +++ b/deps/v8/src/accessors.cc @@ -31,7 +31,8 @@ Handle Accessors::MakeAccessor( info->set_is_special_data_property(true); info->set_is_sloppy(false); info->set_replace_on_access(false); - info->set_has_no_side_effect(false); + info->set_getter_side_effect_type(SideEffectType::kHasSideEffect); + info->set_setter_side_effect_type(SideEffectType::kHasSideEffect); name = factory->InternalizeName(name); info->set_name(*name); Handle get = v8::FromCData(isolate, getter); @@ -70,7 +71,7 @@ bool Accessors::IsJSObjectFieldAccessor(Isolate* isolate, Handle map, default: if (map->instance_type() < FIRST_NONSTRING_TYPE) { return CheckForName(isolate, name, isolate->factory()->length_string(), - String::kLengthOffset, FieldIndex::kTagged, index); + String::kLengthOffset, FieldIndex::kWord32, index); } return false; diff --git a/deps/v8/src/accessors.h b/deps/v8/src/accessors.h index 69fdbbb74e329a..15c4773ec3cc3d 100644 --- a/deps/v8/src/accessors.h +++ b/deps/v8/src/accessors.h @@ -22,27 +22,28 @@ class JavaScriptFrame; // The list of accessor descriptors. This is a second-order macro // taking a macro to be applied to all accessor descriptor names. -#define ACCESSOR_INFO_LIST(V) \ - V(arguments_iterator, ArgumentsIterator) \ - V(array_length, ArrayLength) \ - V(bound_function_length, BoundFunctionLength) \ - V(bound_function_name, BoundFunctionName) \ - V(error_stack, ErrorStack) \ - V(function_arguments, FunctionArguments) \ - V(function_caller, FunctionCaller) \ - V(function_name, FunctionName) \ - V(function_length, FunctionLength) \ - V(function_prototype, FunctionPrototype) \ - V(string_length, StringLength) - -#define SIDE_EFFECT_FREE_ACCESSOR_INFO_LIST(V) \ - V(ArrayLength) \ - V(BoundFunctionLength) \ - V(BoundFunctionName) \ - V(FunctionName) \ - V(FunctionLength) \ - V(FunctionPrototype) \ - V(StringLength) +// V(accessor_name, AccessorName, GetterSideEffectType, SetterSideEffectType) +#define ACCESSOR_INFO_LIST_GENERATOR(V, _) \ + V(_, arguments_iterator, ArgumentsIterator, kHasNoSideEffect, \ + kHasSideEffectToReceiver) \ + V(_, array_length, ArrayLength, kHasNoSideEffect, kHasSideEffectToReceiver) \ + V(_, bound_function_length, BoundFunctionLength, kHasNoSideEffect, \ + kHasSideEffectToReceiver) \ + V(_, bound_function_name, BoundFunctionName, kHasNoSideEffect, \ + kHasSideEffectToReceiver) \ + V(_, error_stack, ErrorStack, kHasSideEffectToReceiver, \ + kHasSideEffectToReceiver) \ + V(_, function_arguments, FunctionArguments, kHasNoSideEffect, \ + kHasSideEffectToReceiver) \ + V(_, function_caller, FunctionCaller, kHasNoSideEffect, \ + kHasSideEffectToReceiver) \ + V(_, function_name, FunctionName, kHasNoSideEffect, \ + kHasSideEffectToReceiver) \ + V(_, function_length, FunctionLength, kHasNoSideEffect, \ + kHasSideEffectToReceiver) \ + V(_, function_prototype, FunctionPrototype, kHasNoSideEffect, \ + kHasSideEffectToReceiver) \ + V(_, string_length, StringLength, kHasNoSideEffect, kHasSideEffectToReceiver) #define ACCESSOR_SETTER_LIST(V) \ V(ArrayLengthSetter) \ @@ -55,11 +56,11 @@ class JavaScriptFrame; class Accessors : public AllStatic { public: -#define ACCESSOR_GETTER_DECLARATION(accessor_name, AccessorName) \ - static void AccessorName##Getter( \ - v8::Local name, \ +#define ACCESSOR_GETTER_DECLARATION(_, accessor_name, AccessorName, ...) \ + static void AccessorName##Getter( \ + v8::Local name, \ const v8::PropertyCallbackInfo& info); - ACCESSOR_INFO_LIST(ACCESSOR_GETTER_DECLARATION) + ACCESSOR_INFO_LIST_GENERATOR(ACCESSOR_GETTER_DECLARATION, /* not used */) #undef ACCESSOR_GETTER_DECLARATION #define ACCESSOR_SETTER_DECLARATION(accessor_name) \ @@ -71,7 +72,7 @@ class Accessors : public AllStatic { static constexpr int kAccessorInfoCount = #define COUNT_ACCESSOR(...) +1 - ACCESSOR_INFO_LIST(COUNT_ACCESSOR); + ACCESSOR_INFO_LIST_GENERATOR(COUNT_ACCESSOR, /* not used */); #undef COUNT_ACCESSOR static constexpr int kAccessorSetterCount = @@ -118,9 +119,9 @@ class Accessors : public AllStatic { AccessorNameBooleanSetterCallback setter); private: -#define ACCESSOR_INFO_DECLARATION(accessor_name, AccessorName) \ +#define ACCESSOR_INFO_DECLARATION(_, accessor_name, AccessorName, ...) \ static Handle Make##AccessorName##Info(Isolate* isolate); - ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION) + ACCESSOR_INFO_LIST_GENERATOR(ACCESSOR_INFO_DECLARATION, /* not used */) #undef ACCESSOR_INFO_DECLARATION friend class Heap; diff --git a/deps/v8/src/address-map.cc b/deps/v8/src/address-map.cc index 2b0bf727e5b31a..ad71a25a99de0c 100644 --- a/deps/v8/src/address-map.cc +++ b/deps/v8/src/address-map.cc @@ -14,8 +14,8 @@ RootIndexMap::RootIndexMap(Isolate* isolate) { map_ = isolate->root_index_map(); if (map_ != nullptr) return; map_ = new HeapObjectToIndexHashMap(); - for (uint32_t i = 0; i < Heap::kStrongRootListLength; i++) { - Heap::RootListIndex root_index = static_cast(i); + for (RootIndex root_index = RootIndex::kFirstStrongRoot; + root_index <= RootIndex::kLastStrongRoot; ++root_index) { Object* root = isolate->heap()->root(root_index); if (!root->IsHeapObject()) continue; // Omit root entries that can be written after initialization. They must @@ -25,11 +25,12 @@ RootIndexMap::RootIndexMap(Isolate* isolate) { if (isolate->heap()->RootCanBeTreatedAsConstant(root_index)) { HeapObject* heap_object = HeapObject::cast(root); Maybe maybe_index = map_->Get(heap_object); + uint32_t index = static_cast(root_index); if (maybe_index.IsJust()) { // Some are initialized to a previous value in the root list. - DCHECK_LT(maybe_index.FromJust(), i); + DCHECK_LT(maybe_index.FromJust(), index); } else { - map_->Set(heap_object, i); + map_->Set(heap_object, index); } } else { // Immortal immovable root objects are constant and allocated on the first diff --git a/deps/v8/src/address-map.h b/deps/v8/src/address-map.h index 599e44724ab1d9..f7a1cc2ad9aabd 100644 --- a/deps/v8/src/address-map.h +++ b/deps/v8/src/address-map.h @@ -56,11 +56,14 @@ class RootIndexMap { public: explicit RootIndexMap(Isolate* isolate); - static const int kInvalidRootIndex = -1; - - int Lookup(HeapObject* obj) { + // Returns true on successful lookup and sets *|out_root_list|. + bool Lookup(HeapObject* obj, RootIndex* out_root_list) { Maybe maybe_index = map_->Get(obj); - return maybe_index.IsJust() ? maybe_index.FromJust() : kInvalidRootIndex; + if (maybe_index.IsJust()) { + *out_root_list = static_cast(maybe_index.FromJust()); + return true; + } + return false; } private: diff --git a/deps/v8/src/allocation-site-scopes-inl.h b/deps/v8/src/allocation-site-scopes-inl.h new file mode 100644 index 00000000000000..e114bb3885c202 --- /dev/null +++ b/deps/v8/src/allocation-site-scopes-inl.h @@ -0,0 +1,52 @@ +// 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. + +#ifndef V8_ALLOCATION_SITE_SCOPES_INL_H_ +#define V8_ALLOCATION_SITE_SCOPES_INL_H_ + +#include "src/allocation-site-scopes.h" + +#include "src/objects/allocation-site-inl.h" + +namespace v8 { +namespace internal { + +Handle AllocationSiteUsageContext::EnterNewScope() { + if (top().is_null()) { + InitializeTraversal(top_site_); + } else { + // Advance current site + Object* nested_site = current()->nested_site(); + // Something is wrong if we advance to the end of the list here. + update_current_site(AllocationSite::cast(nested_site)); + } + return Handle(*current(), isolate()); +} + +void AllocationSiteUsageContext::ExitScope(Handle scope_site, + Handle object) { + // This assert ensures that we are pointing at the right sub-object in a + // recursive walk of a nested literal. + DCHECK(object.is_null() || *object == scope_site->boilerplate()); +} + +bool AllocationSiteUsageContext::ShouldCreateMemento(Handle object) { + if (activated_ && AllocationSite::CanTrack(object->map()->instance_type())) { + if (FLAG_allocation_site_pretenuring || + AllocationSite::ShouldTrack(object->GetElementsKind())) { + if (FLAG_trace_creation_allocation_sites) { + PrintF("*** Creating Memento for %s %p\n", + object->IsJSArray() ? "JSArray" : "JSObject", + static_cast(*object)); + } + return true; + } + } + return false; +} + +} // namespace internal +} // namespace v8 + +#endif // V8_ALLOCATION_SITE_SCOPES_INL_H_ diff --git a/deps/v8/src/allocation-site-scopes.h b/deps/v8/src/allocation-site-scopes.h index 60614c5e01cd12..0a729948db2f59 100644 --- a/deps/v8/src/allocation-site-scopes.h +++ b/deps/v8/src/allocation-site-scopes.h @@ -56,40 +56,12 @@ class AllocationSiteUsageContext : public AllocationSiteContext { top_site_(site), activated_(activated) { } - inline Handle EnterNewScope() { - if (top().is_null()) { - InitializeTraversal(top_site_); - } else { - // Advance current site - Object* nested_site = current()->nested_site(); - // Something is wrong if we advance to the end of the list here. - update_current_site(AllocationSite::cast(nested_site)); - } - return Handle(*current(), isolate()); - } + inline Handle EnterNewScope(); inline void ExitScope(Handle scope_site, - Handle object) { - // This assert ensures that we are pointing at the right sub-object in a - // recursive walk of a nested literal. - DCHECK(object.is_null() || *object == scope_site->boilerplate()); - } + Handle object); - bool ShouldCreateMemento(Handle object) { - if (activated_ && - AllocationSite::CanTrack(object->map()->instance_type())) { - if (FLAG_allocation_site_pretenuring || - AllocationSite::ShouldTrack(object->GetElementsKind())) { - if (FLAG_trace_creation_allocation_sites) { - PrintF("*** Creating Memento for %s %p\n", - object->IsJSArray() ? "JSArray" : "JSObject", - static_cast(*object)); - } - return true; - } - } - return false; - } + inline bool ShouldCreateMemento(Handle object); static const bool kCopying = true; diff --git a/deps/v8/src/allocation.cc b/deps/v8/src/allocation.cc index 55c68dea89482e..6327a9c965abe7 100644 --- a/deps/v8/src/allocation.cc +++ b/deps/v8/src/allocation.cc @@ -8,6 +8,7 @@ #include "src/base/bits.h" #include "src/base/lazy-instance.h" #include "src/base/logging.h" +#include "src/base/lsan-page-allocator.h" #include "src/base/page-allocator.h" #include "src/base/platform/platform.h" #include "src/utils.h" @@ -17,10 +18,6 @@ #include // NOLINT #endif -#if defined(LEAK_SANITIZER) -#include -#endif - namespace v8 { namespace internal { @@ -51,21 +48,29 @@ struct InitializePageAllocator { static v8::base::PageAllocator default_allocator; page_allocator = &default_allocator; } +#if defined(LEAK_SANITIZER) + { + static v8::base::LsanPageAllocator lsan_allocator(page_allocator); + page_allocator = &lsan_allocator; + } +#endif *page_allocator_ptr = page_allocator; } }; static base::LazyInstance::type page_allocator = LAZY_INSTANCE_INITIALIZER; - -v8::PageAllocator* GetPageAllocator() { return page_allocator.Get(); } - // We will attempt allocation this many times. After each failure, we call // OnCriticalMemoryPressure to try to free some memory. const int kAllocationTries = 2; } // namespace +v8::PageAllocator* GetPlatformPageAllocator() { + DCHECK_NOT_NULL(page_allocator.Get()); + return page_allocator.Get(); +} + void* Malloced::New(size_t size) { void* result = AllocWithRetry(size); if (result == nullptr) { @@ -131,68 +136,62 @@ void AlignedFree(void *ptr) { #endif } -size_t AllocatePageSize() { return GetPageAllocator()->AllocatePageSize(); } +size_t AllocatePageSize() { + return GetPlatformPageAllocator()->AllocatePageSize(); +} -size_t CommitPageSize() { return GetPageAllocator()->CommitPageSize(); } +size_t CommitPageSize() { return GetPlatformPageAllocator()->CommitPageSize(); } void SetRandomMmapSeed(int64_t seed) { - GetPageAllocator()->SetRandomMmapSeed(seed); + GetPlatformPageAllocator()->SetRandomMmapSeed(seed); } -void* GetRandomMmapAddr() { return GetPageAllocator()->GetRandomMmapAddr(); } +void* GetRandomMmapAddr() { + return GetPlatformPageAllocator()->GetRandomMmapAddr(); +} -void* AllocatePages(void* address, size_t size, size_t alignment, +void* AllocatePages(v8::PageAllocator* page_allocator, void* address, + size_t size, size_t alignment, PageAllocator::Permission access) { + DCHECK_NOT_NULL(page_allocator); DCHECK_EQ(address, AlignedAddress(address, alignment)); - DCHECK_EQ(0UL, size & (GetPageAllocator()->AllocatePageSize() - 1)); + DCHECK_EQ(0UL, size & (page_allocator->AllocatePageSize() - 1)); void* result = nullptr; for (int i = 0; i < kAllocationTries; ++i) { - result = - GetPageAllocator()->AllocatePages(address, size, alignment, access); + result = page_allocator->AllocatePages(address, size, alignment, access); if (result != nullptr) break; - size_t request_size = size + alignment - AllocatePageSize(); + size_t request_size = size + alignment - page_allocator->AllocatePageSize(); if (!OnCriticalMemoryPressure(request_size)) break; } -#if defined(LEAK_SANITIZER) - if (result != nullptr) { - __lsan_register_root_region(result, size); - } -#endif return result; } -bool FreePages(void* address, const size_t size) { - DCHECK_EQ(0UL, size & (GetPageAllocator()->AllocatePageSize() - 1)); - bool result = GetPageAllocator()->FreePages(address, size); -#if defined(LEAK_SANITIZER) - if (result) { - __lsan_unregister_root_region(address, size); - } -#endif - return result; +bool FreePages(v8::PageAllocator* page_allocator, void* address, + const size_t size) { + DCHECK_NOT_NULL(page_allocator); + DCHECK_EQ(0UL, size & (page_allocator->AllocatePageSize() - 1)); + return page_allocator->FreePages(address, size); } -bool ReleasePages(void* address, size_t size, size_t new_size) { +bool ReleasePages(v8::PageAllocator* page_allocator, void* address, size_t size, + size_t new_size) { + DCHECK_NOT_NULL(page_allocator); DCHECK_LT(new_size, size); - bool result = GetPageAllocator()->ReleasePages(address, size, new_size); -#if defined(LEAK_SANITIZER) - if (result) { - __lsan_unregister_root_region(address, size); - __lsan_register_root_region(address, new_size); - } -#endif - return result; + return page_allocator->ReleasePages(address, size, new_size); } -bool SetPermissions(void* address, size_t size, - PageAllocator::Permission access) { - return GetPageAllocator()->SetPermissions(address, size, access); +bool SetPermissions(v8::PageAllocator* page_allocator, void* address, + size_t size, PageAllocator::Permission access) { + DCHECK_NOT_NULL(page_allocator); + return page_allocator->SetPermissions(address, size, access); } -byte* AllocatePage(void* address, size_t* allocated) { - size_t page_size = AllocatePageSize(); - void* result = - AllocatePages(address, page_size, page_size, PageAllocator::kReadWrite); +byte* AllocatePage(v8::PageAllocator* page_allocator, void* address, + size_t* allocated) { + DCHECK_NOT_NULL(page_allocator); + size_t page_size = page_allocator->AllocatePageSize(); + void* result = AllocatePages(page_allocator, address, page_size, page_size, + PageAllocator::kReadWrite); if (result != nullptr) *allocated = page_size; return static_cast(result); } @@ -206,16 +205,17 @@ bool OnCriticalMemoryPressure(size_t length) { return true; } -VirtualMemory::VirtualMemory() : address_(kNullAddress), size_(0) {} - -VirtualMemory::VirtualMemory(size_t size, void* hint, size_t alignment) - : address_(kNullAddress), size_(0) { - size_t page_size = AllocatePageSize(); - size_t alloc_size = RoundUp(size, page_size); - address_ = reinterpret_cast
( - AllocatePages(hint, alloc_size, alignment, PageAllocator::kNoAccess)); - if (address_ != kNullAddress) { - size_ = alloc_size; +VirtualMemory::VirtualMemory(v8::PageAllocator* page_allocator, size_t size, + void* hint, size_t alignment) + : page_allocator_(page_allocator) { + DCHECK_NOT_NULL(page_allocator); + size_t page_size = page_allocator_->AllocatePageSize(); + alignment = RoundUp(alignment, page_size); + size = RoundUp(size, page_size); + Address address = reinterpret_cast
(AllocatePages( + page_allocator_, hint, size, alignment, PageAllocator::kNoAccess)); + if (address != kNullAddress) { + region_ = base::AddressRegion(address, size); } } @@ -226,30 +226,31 @@ VirtualMemory::~VirtualMemory() { } void VirtualMemory::Reset() { - address_ = kNullAddress; - size_ = 0; + page_allocator_ = nullptr; + region_ = base::AddressRegion(); } bool VirtualMemory::SetPermissions(Address address, size_t size, PageAllocator::Permission access) { CHECK(InVM(address, size)); - bool result = v8::internal::SetPermissions(address, size, access); + bool result = + v8::internal::SetPermissions(page_allocator_, address, size, access); DCHECK(result); return result; } size_t VirtualMemory::Release(Address free_start) { DCHECK(IsReserved()); - DCHECK(IsAddressAligned(free_start, CommitPageSize())); + DCHECK(IsAddressAligned(free_start, page_allocator_->CommitPageSize())); // Notice: Order is important here. The VirtualMemory object might live // inside the allocated region. - const size_t free_size = size_ - (free_start - address_); + + const size_t old_size = region_.size(); + const size_t free_size = old_size - (free_start - region_.begin()); CHECK(InVM(free_start, free_size)); - DCHECK_LT(address_, free_start); - DCHECK_LT(free_start, address_ + size_); - CHECK(ReleasePages(reinterpret_cast(address_), size_, - size_ - free_size)); - size_ -= free_size; + region_.set_size(old_size - free_size); + CHECK(ReleasePages(page_allocator_, reinterpret_cast(region_.begin()), + old_size, region_.size())); return free_size; } @@ -257,41 +258,21 @@ void VirtualMemory::Free() { DCHECK(IsReserved()); // Notice: Order is important here. The VirtualMemory object might live // inside the allocated region. - Address address = address_; - size_t size = size_; - CHECK(InVM(address, size)); + v8::PageAllocator* page_allocator = page_allocator_; + base::AddressRegion region = region_; Reset(); - // FreePages expects size to be aligned to allocation granularity. Trimming - // may leave size at only commit granularity. Align it here. - CHECK(FreePages(reinterpret_cast(address), - RoundUp(size, AllocatePageSize()))); + // FreePages expects size to be aligned to allocation granularity however + // ReleasePages may leave size at only commit granularity. Align it here. + CHECK(FreePages(page_allocator, reinterpret_cast(region.begin()), + RoundUp(region.size(), page_allocator->AllocatePageSize()))); } void VirtualMemory::TakeControl(VirtualMemory* from) { DCHECK(!IsReserved()); - address_ = from->address_; - size_ = from->size_; + page_allocator_ = from->page_allocator_; + region_ = from->region_; from->Reset(); } -bool AllocVirtualMemory(size_t size, void* hint, VirtualMemory* result) { - VirtualMemory vm(size, hint); - if (vm.IsReserved()) { - result->TakeControl(&vm); - return true; - } - return false; -} - -bool AlignedAllocVirtualMemory(size_t size, size_t alignment, void* hint, - VirtualMemory* result) { - VirtualMemory vm(size, hint, alignment); - if (vm.IsReserved()) { - result->TakeControl(&vm); - return true; - } - return false; -} - } // namespace internal } // namespace v8 diff --git a/deps/v8/src/allocation.h b/deps/v8/src/allocation.h index 8e17a35514e4bf..3a21310af8e698 100644 --- a/deps/v8/src/allocation.h +++ b/deps/v8/src/allocation.h @@ -6,6 +6,7 @@ #define V8_ALLOCATION_H_ #include "include/v8-platform.h" +#include "src/base/address-region.h" #include "src/base/compiler-specific.h" #include "src/base/platform/platform.h" #include "src/globals.h" @@ -82,6 +83,9 @@ void* AllocWithRetry(size_t size); void* AlignedAlloc(size_t size, size_t alignment); void AlignedFree(void *ptr); +// Returns platfrom page allocator instance. Guaranteed to be a valid pointer. +V8_EXPORT_PRIVATE v8::PageAllocator* GetPlatformPageAllocator(); + // Gets the page granularity for AllocatePages and FreePages. Addresses returned // by AllocatePages and AllocatePage are aligned to this size. V8_EXPORT_PRIVATE size_t AllocatePageSize(); @@ -101,14 +105,16 @@ V8_EXPORT_PRIVATE void* GetRandomMmapAddr(); // AllocatePageSize(). Returns the address of the allocated memory, with the // specified size and alignment, or nullptr on failure. V8_EXPORT_PRIVATE -V8_WARN_UNUSED_RESULT void* AllocatePages(void* address, size_t size, +V8_WARN_UNUSED_RESULT void* AllocatePages(v8::PageAllocator* page_allocator, + void* address, size_t size, size_t alignment, PageAllocator::Permission access); // Frees memory allocated by a call to AllocatePages. |address| and |size| must // be multiples of AllocatePageSize(). Returns true on success, otherwise false. V8_EXPORT_PRIVATE -V8_WARN_UNUSED_RESULT bool FreePages(void* address, const size_t size); +V8_WARN_UNUSED_RESULT bool FreePages(v8::PageAllocator* page_allocator, + void* address, const size_t size); // Releases memory that is no longer needed. The range specified by |address| // and |size| must be an allocated memory region. |size| and |new_size| must be @@ -116,7 +122,8 @@ V8_WARN_UNUSED_RESULT bool FreePages(void* address, const size_t size); // Released memory is left in an undefined state, so it should not be accessed. // Returns true on success, otherwise false. V8_EXPORT_PRIVATE -V8_WARN_UNUSED_RESULT bool ReleasePages(void* address, size_t size, +V8_WARN_UNUSED_RESULT bool ReleasePages(v8::PageAllocator* page_allocator, + void* address, size_t size, size_t new_size); // Sets permissions according to |access|. |address| and |size| must be @@ -124,18 +131,21 @@ V8_WARN_UNUSED_RESULT bool ReleasePages(void* address, size_t size, // cause the memory contents to be lost. Returns true on success, otherwise // false. V8_EXPORT_PRIVATE -V8_WARN_UNUSED_RESULT bool SetPermissions(void* address, size_t size, +V8_WARN_UNUSED_RESULT bool SetPermissions(v8::PageAllocator* page_allocator, + void* address, size_t size, PageAllocator::Permission access); -inline bool SetPermissions(Address address, size_t size, - PageAllocator::Permission access) { - return SetPermissions(reinterpret_cast(address), size, access); +inline bool SetPermissions(v8::PageAllocator* page_allocator, Address address, + size_t size, PageAllocator::Permission access) { + return SetPermissions(page_allocator, reinterpret_cast(address), size, + access); } // Convenience function that allocates a single system page with read and write // permissions. |address| is a hint. Returns the base address of the memory and // the page size via |allocated| on success. Returns nullptr on failure. V8_EXPORT_PRIVATE -V8_WARN_UNUSED_RESULT byte* AllocatePage(void* address, size_t* allocated); +V8_WARN_UNUSED_RESULT byte* AllocatePage(v8::PageAllocator* page_allocator, + void* address, size_t* allocated); // Function that may release reserved memory regions to allow failed allocations // to succeed. |length| is the amount of memory needed. Returns |true| if memory @@ -143,50 +153,67 @@ V8_WARN_UNUSED_RESULT byte* AllocatePage(void* address, size_t* allocated); V8_EXPORT_PRIVATE bool OnCriticalMemoryPressure(size_t length); // Represents and controls an area of reserved memory. -class V8_EXPORT_PRIVATE VirtualMemory { +class V8_EXPORT_PRIVATE VirtualMemory final { public: // Empty VirtualMemory object, controlling no reserved memory. - VirtualMemory(); + VirtualMemory() = default; // Reserves virtual memory containing an area of the given size that is - // aligned per alignment. This may not be at the position returned by - // address(). - VirtualMemory(size_t size, void* hint, size_t alignment = AllocatePageSize()); + // aligned per |alignment| rounded up to the |page_allocator|'s allocate page + // size. + // This may not be at the position returned by address(). + VirtualMemory(v8::PageAllocator* page_allocator, size_t size, void* hint, + size_t alignment = 1); // Construct a virtual memory by assigning it some already mapped address // and size. - VirtualMemory(Address address, size_t size) - : address_(address), size_(size) {} + VirtualMemory(v8::PageAllocator* page_allocator, Address address, size_t size) + : page_allocator_(page_allocator), region_(address, size) { + DCHECK_NOT_NULL(page_allocator); + } // Releases the reserved memory, if any, controlled by this VirtualMemory // object. ~VirtualMemory(); + // Move constructor. + VirtualMemory(VirtualMemory&& other) V8_NOEXCEPT { TakeControl(&other); } + + // Move assignment operator. + VirtualMemory& operator=(VirtualMemory&& other) V8_NOEXCEPT { + TakeControl(&other); + return *this; + } + // Returns whether the memory has been reserved. - bool IsReserved() const { return address_ != kNullAddress; } + bool IsReserved() const { return region_.begin() != kNullAddress; } // Initialize or resets an embedded VirtualMemory object. void Reset(); + v8::PageAllocator* page_allocator() { return page_allocator_; } + + const base::AddressRegion& region() const { return region_; } + // Returns the start address of the reserved memory. // If the memory was reserved with an alignment, this address is not // necessarily aligned. The user might need to round it up to a multiple of // the alignment to get the start of the aligned block. Address address() const { DCHECK(IsReserved()); - return address_; + return region_.begin(); } Address end() const { DCHECK(IsReserved()); - return address_ + size_; + return region_.end(); } // Returns the size of the reserved memory. The returned value is only // meaningful when IsReserved() returns true. // If the memory was reserved with an alignment, this size may be larger // than the requested size. - size_t size() const { return size_; } + size_t size() const { return region_.size(); } // Sets permissions according to the access argument. address and size must be // multiples of CommitPageSize(). Returns true on success, otherwise false. @@ -204,17 +231,16 @@ class V8_EXPORT_PRIVATE VirtualMemory { void TakeControl(VirtualMemory* from); bool InVM(Address address, size_t size) { - return (address_ <= address) && ((address_ + size_) >= (address + size)); + return region_.contains(address, size); } private: - Address address_; // Start address of the virtual memory. - size_t size_; // Size of the virtual memory. -}; + // Page allocator that controls the virtual memory. + v8::PageAllocator* page_allocator_ = nullptr; + base::AddressRegion region_; -bool AllocVirtualMemory(size_t size, void* hint, VirtualMemory* result); -bool AlignedAllocVirtualMemory(size_t size, size_t alignment, void* hint, - VirtualMemory* result); + DISALLOW_COPY_AND_ASSIGN(VirtualMemory); +}; } // namespace internal } // namespace v8 diff --git a/deps/v8/src/api-arguments-inl.h b/deps/v8/src/api-arguments-inl.h index 89f606ed410a51..1e5d6b2aaa7ceb 100644 --- a/deps/v8/src/api-arguments-inl.h +++ b/deps/v8/src/api-arguments-inl.h @@ -8,6 +8,7 @@ #include "src/api-arguments.h" #include "src/api-inl.h" +#include "src/debug/debug.h" #include "src/objects/api-callbacks.h" #include "src/tracing/trace-event.h" #include "src/vm-state-inl.h" @@ -34,6 +35,10 @@ inline JSObject* PropertyCallbackArguments::holder() { return JSObject::cast(this->begin()[T::kHolderIndex]); } +inline Object* PropertyCallbackArguments::receiver() { + return Object::cast(this->begin()[T::kThisIndex]); +} + inline JSObject* FunctionCallbackArguments::holder() { return JSObject::cast(this->begin()[T::kHolderIndex]); } @@ -47,14 +52,24 @@ inline JSObject* FunctionCallbackArguments::holder() { DCHECK(!name->IsPrivate()); \ DCHECK_IMPLIES(name->IsSymbol(), interceptor->can_intercept_symbols()); -#define PREPARE_CALLBACK_INFO(ISOLATE, F, RETURN_VALUE, API_RETURN_TYPE, \ - CALLBACK_INFO) \ - if (ISOLATE->debug_execution_mode() == DebugInfo::kSideEffects && \ - !ISOLATE->debug()->PerformSideEffectCheckForCallback(CALLBACK_INFO)) { \ - return RETURN_VALUE(); \ - } \ - VMState state(ISOLATE); \ - ExternalCallbackScope call_scope(ISOLATE, FUNCTION_ADDR(F)); \ +#define PREPARE_CALLBACK_INFO(ISOLATE, F, RETURN_VALUE, API_RETURN_TYPE, \ + CALLBACK_INFO, RECEIVER, ACCESSOR_KIND) \ + if (ISOLATE->debug_execution_mode() == DebugInfo::kSideEffects && \ + !ISOLATE->debug()->PerformSideEffectCheckForCallback( \ + CALLBACK_INFO, RECEIVER, Debug::k##ACCESSOR_KIND)) { \ + return RETURN_VALUE(); \ + } \ + VMState state(ISOLATE); \ + ExternalCallbackScope call_scope(ISOLATE, FUNCTION_ADDR(F)); \ + PropertyCallbackInfo callback_info(begin()); + +#define PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(ISOLATE, F, RETURN_VALUE, \ + API_RETURN_TYPE) \ + if (ISOLATE->debug_execution_mode() == DebugInfo::kSideEffects) { \ + return RETURN_VALUE(); \ + } \ + VMState state(ISOLATE); \ + ExternalCallbackScope call_scope(ISOLATE, FUNCTION_ADDR(F)); \ PropertyCallbackInfo callback_info(begin()); #define CREATE_NAMED_CALLBACK(FUNCTION, TYPE, RETURN_TYPE, API_RETURN_TYPE, \ @@ -65,11 +80,13 @@ inline JSObject* FunctionCallbackArguments::holder() { Isolate* isolate = this->isolate(); \ RuntimeCallTimerScope timer( \ isolate, RuntimeCallCounterId::kNamed##FUNCTION##Callback); \ + Handle receiver_check_unsupported; \ GenericNamedProperty##FUNCTION##Callback f = \ ToCData( \ interceptor->TYPE()); \ PREPARE_CALLBACK_INFO(isolate, f, Handle, API_RETURN_TYPE, \ - INFO_FOR_SIDE_EFFECT); \ + INFO_FOR_SIDE_EFFECT, receiver_check_unsupported, \ + NotAccessor); \ LOG(isolate, \ ApiNamedPropertyAccess("interceptor-named-" #TYPE, holder(), *name)); \ f(v8::Utils::ToLocal(name), callback_info); \ @@ -87,10 +104,12 @@ FOR_EACH_CALLBACK(CREATE_NAMED_CALLBACK) Isolate* isolate = this->isolate(); \ RuntimeCallTimerScope timer( \ isolate, RuntimeCallCounterId::kIndexed##FUNCTION##Callback); \ + Handle receiver_check_unsupported; \ IndexedProperty##FUNCTION##Callback f = \ ToCData(interceptor->TYPE()); \ PREPARE_CALLBACK_INFO(isolate, f, Handle, API_RETURN_TYPE, \ - INFO_FOR_SIDE_EFFECT); \ + INFO_FOR_SIDE_EFFECT, receiver_check_unsupported, \ + NotAccessor); \ LOG(isolate, ApiIndexedPropertyAccess("interceptor-indexed-" #TYPE, \ holder(), index)); \ f(index, callback_info); \ @@ -108,9 +127,11 @@ Handle FunctionCallbackArguments::Call(CallHandlerInfo* handler) { RuntimeCallTimerScope timer(isolate, RuntimeCallCounterId::kFunctionCallback); v8::FunctionCallback f = v8::ToCData(handler->callback()); + Handle receiver_check_unsupported; if (isolate->debug_execution_mode() == DebugInfo::kSideEffects && !isolate->debug()->PerformSideEffectCheckForCallback( - handle(handler, isolate))) { + handle(handler, isolate), receiver_check_unsupported, + Debug::kNotAccessor)) { return Handle(); } VMState state(isolate); @@ -167,10 +188,11 @@ Handle PropertyCallbackArguments::CallNamedDescriptor( Handle PropertyCallbackArguments::BasicCallNamedGetterCallback( GenericNamedPropertyGetterCallback f, Handle name, - Handle info) { + Handle info, Handle receiver) { DCHECK(!name->IsPrivate()); Isolate* isolate = this->isolate(); - PREPARE_CALLBACK_INFO(isolate, f, Handle, v8::Value, info); + PREPARE_CALLBACK_INFO(isolate, f, Handle, v8::Value, info, receiver, + Getter); f(v8::Utils::ToLocal(name), callback_info); return GetReturnValue(isolate); } @@ -184,9 +206,8 @@ Handle PropertyCallbackArguments::CallNamedSetter( Isolate* isolate = this->isolate(); RuntimeCallTimerScope timer(isolate, RuntimeCallCounterId::kNamedSetterCallback); - Handle side_effect_check_not_supported; - PREPARE_CALLBACK_INFO(isolate, f, Handle, v8::Value, - side_effect_check_not_supported); + PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(isolate, f, Handle, + v8::Value); LOG(isolate, ApiNamedPropertyAccess("interceptor-named-set", holder(), *name)); f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), callback_info); @@ -202,9 +223,8 @@ Handle PropertyCallbackArguments::CallNamedDefiner( RuntimeCallCounterId::kNamedDefinerCallback); GenericNamedPropertyDefinerCallback f = ToCData(interceptor->definer()); - Handle side_effect_check_not_supported; - PREPARE_CALLBACK_INFO(isolate, f, Handle, v8::Value, - side_effect_check_not_supported); + PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(isolate, f, Handle, + v8::Value); LOG(isolate, ApiNamedPropertyAccess("interceptor-named-define", holder(), *name)); f(v8::Utils::ToLocal(name), desc, callback_info); @@ -219,9 +239,8 @@ Handle PropertyCallbackArguments::CallIndexedSetter( RuntimeCallCounterId::kIndexedSetterCallback); IndexedPropertySetterCallback f = ToCData(interceptor->setter()); - Handle side_effect_check_not_supported; - PREPARE_CALLBACK_INFO(isolate, f, Handle, v8::Value, - side_effect_check_not_supported); + PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(isolate, f, Handle, + v8::Value); LOG(isolate, ApiIndexedPropertyAccess("interceptor-indexed-set", holder(), index)); f(index, v8::Utils::ToLocal(value), callback_info); @@ -237,9 +256,8 @@ Handle PropertyCallbackArguments::CallIndexedDefiner( RuntimeCallCounterId::kIndexedDefinerCallback); IndexedPropertyDefinerCallback f = ToCData(interceptor->definer()); - Handle side_effect_check_not_supported; - PREPARE_CALLBACK_INFO(isolate, f, Handle, v8::Value, - side_effect_check_not_supported); + PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(isolate, f, Handle, + v8::Value); LOG(isolate, ApiIndexedPropertyAccess("interceptor-indexed-define", holder(), index)); f(index, desc, callback_info); @@ -275,7 +293,9 @@ Handle PropertyCallbackArguments::CallIndexedDescriptor( Handle PropertyCallbackArguments::BasicCallIndexedGetterCallback( IndexedPropertyGetterCallback f, uint32_t index, Handle info) { Isolate* isolate = this->isolate(); - PREPARE_CALLBACK_INFO(isolate, f, Handle, v8::Value, info); + Handle receiver_check_unsupported; + PREPARE_CALLBACK_INFO(isolate, f, Handle, v8::Value, info, + receiver_check_unsupported, Getter); f(index, callback_info); return GetReturnValue(isolate); } @@ -287,7 +307,9 @@ Handle PropertyCallbackArguments::CallPropertyEnumerator( v8::ToCData(interceptor->enumerator()); // TODO(cbruni): assert same type for indexed and named callback. Isolate* isolate = this->isolate(); - PREPARE_CALLBACK_INFO(isolate, f, Handle, v8::Array, interceptor); + Handle receiver_check_unsupported; + PREPARE_CALLBACK_INFO(isolate, f, Handle, v8::Array, interceptor, + receiver_check_unsupported, NotAccessor); f(callback_info); return GetReturnValue(isolate); } @@ -303,7 +325,8 @@ Handle PropertyCallbackArguments::CallAccessorGetter( LOG(isolate, ApiNamedPropertyAccess("accessor-getter", holder(), *name)); AccessorNameGetterCallback f = ToCData(info->getter()); - return BasicCallNamedGetterCallback(f, name, info); + return BasicCallNamedGetterCallback(f, name, info, + handle(receiver(), isolate)); } Handle PropertyCallbackArguments::CallAccessorSetter( @@ -314,15 +337,15 @@ Handle PropertyCallbackArguments::CallAccessorSetter( RuntimeCallCounterId::kAccessorSetterCallback); AccessorNameSetterCallback f = ToCData(accessor_info->setter()); - Handle side_effect_check_not_supported; - PREPARE_CALLBACK_INFO(isolate, f, Handle, void, - side_effect_check_not_supported); + PREPARE_CALLBACK_INFO(isolate, f, Handle, void, accessor_info, + handle(receiver(), isolate), Setter); LOG(isolate, ApiNamedPropertyAccess("accessor-setter", holder(), *name)); f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), callback_info); return GetReturnValue(isolate); } #undef PREPARE_CALLBACK_INFO +#undef PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK } // namespace internal } // namespace v8 diff --git a/deps/v8/src/api-arguments.h b/deps/v8/src/api-arguments.h index 0a0a7362c7c687..d8fc2b49ab2824 100644 --- a/deps/v8/src/api-arguments.h +++ b/deps/v8/src/api-arguments.h @@ -26,12 +26,12 @@ class CustomArguments : public CustomArgumentsBase { public: static const int kReturnValueOffset = T::kReturnValueIndex; - ~CustomArguments() { + ~CustomArguments() override { this->begin()[kReturnValueOffset] = reinterpret_cast(kHandleZapValue); } - virtual inline void IterateInstance(RootVisitor* v) { + inline void IterateInstance(RootVisitor* v) override { v->VisitRootPointers(Root::kRelocatable, nullptr, values_, values_ + T::kArgsLength); } @@ -133,9 +133,10 @@ class PropertyCallbackArguments IndexedPropertyGetterCallback f, uint32_t index, Handle info); inline Handle BasicCallNamedGetterCallback( GenericNamedPropertyGetterCallback f, Handle name, - Handle info); + Handle info, Handle receiver = Handle()); inline JSObject* holder(); + inline Object* receiver(); // Don't copy PropertyCallbackArguments, because they would both have the // same prev_ pointer. diff --git a/deps/v8/src/api-inl.h b/deps/v8/src/api-inl.h index 50586814d8d1a3..5758729dd32e7f 100644 --- a/deps/v8/src/api-inl.h +++ b/deps/v8/src/api-inl.h @@ -7,6 +7,7 @@ #include "src/api.h" #include "src/objects-inl.h" +#include "src/objects/stack-frame-info.h" namespace v8 { diff --git a/deps/v8/src/api-natives.cc b/deps/v8/src/api-natives.cc index 977d6cdafc95fc..11b63d56d8da2c 100644 --- a/deps/v8/src/api-natives.cc +++ b/deps/v8/src/api-natives.cc @@ -114,9 +114,8 @@ MaybeHandle DefineDataProperty(Isolate* isolate, } #endif - MAYBE_RETURN_NULL( - Object::AddDataProperty(&it, value, attributes, kThrowOnError, - Object::CERTAINLY_NOT_STORE_FROM_KEYED)); + MAYBE_RETURN_NULL(Object::AddDataProperty( + &it, value, attributes, kThrowOnError, StoreOrigin::kNamed)); return value; } @@ -403,8 +402,10 @@ MaybeHandle InstantiateObject(Isolate* isolate, } Handle object; - ASSIGN_RETURN_ON_EXCEPTION(isolate, object, - JSObject::New(constructor, new_target), JSObject); + ASSIGN_RETURN_ON_EXCEPTION( + isolate, object, + JSObject::New(constructor, new_target, Handle::null()), + JSObject); if (is_prototype) JSObject::OptimizeAsPrototype(object); @@ -495,8 +496,15 @@ MaybeHandle InstantiateFunction(Isolate* isolate, parent_prototype); } } + InstanceType function_type = + (!data->needs_access_check() && + data->named_property_handler()->IsUndefined(isolate) && + data->indexed_property_handler()->IsUndefined(isolate)) + ? JS_API_OBJECT_TYPE + : JS_SPECIAL_API_OBJECT_TYPE; + Handle function = ApiNatives::CreateApiFunction( - isolate, data, prototype, ApiNatives::JavaScriptObjectType, maybe_name); + isolate, data, prototype, function_type, maybe_name); if (serial_number) { // Cache the function. CacheTemplateInstantiation(isolate, serial_number, CachingMode::kUnlimited, @@ -625,8 +633,7 @@ void ApiNatives::AddNativeDataProperty(Isolate* isolate, Handle ApiNatives::CreateApiFunction( Isolate* isolate, Handle obj, - Handle prototype, ApiInstanceType instance_type, - MaybeHandle maybe_name) { + Handle prototype, InstanceType type, MaybeHandle maybe_name) { Handle shared = FunctionTemplateInfo::GetOrCreateSharedFunctionInfo(isolate, obj, maybe_name); @@ -670,33 +677,10 @@ Handle ApiNatives::CreateApiFunction( immutable_proto = instance_template->immutable_proto(); } - // TODO(svenpanne) Kill ApiInstanceType and refactor things by generalizing - // JSObject::GetHeaderSize. - int instance_size = kPointerSize * embedder_field_count; - InstanceType type; - switch (instance_type) { - case JavaScriptObjectType: - if (!obj->needs_access_check() && - obj->named_property_handler()->IsUndefined(isolate) && - obj->indexed_property_handler()->IsUndefined(isolate)) { - type = JS_API_OBJECT_TYPE; - } else { - type = JS_SPECIAL_API_OBJECT_TYPE; - } - instance_size += JSObject::kHeaderSize; - break; - case GlobalObjectType: - type = JS_GLOBAL_OBJECT_TYPE; - instance_size += JSGlobalObject::kSize; - break; - case GlobalProxyType: - type = JS_GLOBAL_PROXY_TYPE; - instance_size += JSGlobalProxy::kSize; - break; - default: - UNREACHABLE(); - break; - } + // JS_FUNCTION_TYPE requires information about the prototype slot. + DCHECK_NE(JS_FUNCTION_TYPE, type); + int instance_size = + JSObject::GetHeaderSize(type) + kPointerSize * embedder_field_count; Handle map = isolate->factory()->NewMap(type, instance_size, TERMINAL_FAST_ELEMENTS_KIND); diff --git a/deps/v8/src/api-natives.h b/deps/v8/src/api-natives.h index e8bb32d40a02fb..ff6cdc6c864537 100644 --- a/deps/v8/src/api-natives.h +++ b/deps/v8/src/api-natives.h @@ -9,6 +9,7 @@ #include "src/base/macros.h" #include "src/handles.h" #include "src/maybe-handles.h" +#include "src/objects.h" #include "src/property-details.h" namespace v8 { @@ -33,15 +34,9 @@ class ApiNatives { V8_WARN_UNUSED_RESULT static MaybeHandle InstantiateRemoteObject( Handle data); - enum ApiInstanceType { - JavaScriptObjectType, - GlobalObjectType, - GlobalProxyType - }; - static Handle CreateApiFunction( Isolate* isolate, Handle obj, - Handle prototype, ApiInstanceType instance_type, + Handle prototype, InstanceType type, MaybeHandle name = MaybeHandle()); static void AddDataProperty(Isolate* isolate, Handle info, diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index 5ac9aec0479277..3f62a23d43c1c8 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -58,7 +58,9 @@ #include "src/objects/js-regexp-inl.h" #include "src/objects/module-inl.h" #include "src/objects/ordered-hash-table-inl.h" +#include "src/objects/stack-frame-info-inl.h" #include "src/objects/templates.h" +#include "src/parsing/parse-info.h" #include "src/parsing/parser.h" #include "src/parsing/scanner-character-streams.h" #include "src/pending-compilation-error-handler.h" @@ -834,6 +836,7 @@ StartupData SnapshotCreator::CreateBlob( } data->created_ = true; + DCHECK(i::Snapshot::VerifyChecksum(&result)); return result; } @@ -876,12 +879,12 @@ void RegisteredExtension::UnregisterAll() { namespace { class ExtensionResource : public String::ExternalOneByteStringResource { public: - ExtensionResource() : data_(0), length_(0) {} + ExtensionResource() : data_(nullptr), length_(0) {} ExtensionResource(const char* data, size_t length) : data_(data), length_(length) {} - const char* data() const { return data_; } - size_t length() const { return length_; } - virtual void Dispose() {} + const char* data() const override { return data_; } + size_t length() const override { return length_; } + void Dispose() override {} private: const char* data_; @@ -1391,7 +1394,7 @@ static Local FunctionTemplateNew( next_serial_number = isolate->heap()->GetNextTemplateSerialNumber(); } obj->set_serial_number(i::Smi::FromInt(next_serial_number)); - if (callback != 0) { + if (callback != nullptr) { Utils::ToLocal(obj)->SetCallHandler(callback, data, side_effect_type); } obj->set_length(length); @@ -1676,7 +1679,8 @@ static void TemplateSetAccessor( Template* template_obj, v8::Local name, Getter getter, Setter setter, Data data, AccessControl settings, PropertyAttribute attribute, v8::Local signature, bool is_special_data_property, - bool replace_on_access, SideEffectType getter_side_effect_type) { + bool replace_on_access, SideEffectType getter_side_effect_type, + SideEffectType setter_side_effect_type) { auto info = Utils::OpenHandle(template_obj); auto isolate = info->GetIsolate(); ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); @@ -1686,8 +1690,8 @@ static void TemplateSetAccessor( is_special_data_property, replace_on_access); accessor_info->set_initial_property_attributes( static_cast(attribute)); - accessor_info->set_has_no_side_effect(getter_side_effect_type == - SideEffectType::kHasNoSideEffect); + accessor_info->set_getter_side_effect_type(getter_side_effect_type); + accessor_info->set_setter_side_effect_type(setter_side_effect_type); i::ApiNatives::AddNativeDataProperty(isolate, info, accessor_info); } @@ -1695,29 +1699,34 @@ void Template::SetNativeDataProperty( v8::Local name, AccessorGetterCallback getter, AccessorSetterCallback setter, v8::Local data, PropertyAttribute attribute, v8::Local signature, - AccessControl settings, SideEffectType getter_side_effect_type) { + AccessControl settings, SideEffectType getter_side_effect_type, + SideEffectType setter_side_effect_type) { TemplateSetAccessor(this, name, getter, setter, data, settings, attribute, - signature, true, false, getter_side_effect_type); + signature, true, false, getter_side_effect_type, + setter_side_effect_type); } void Template::SetNativeDataProperty( v8::Local name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter, v8::Local data, PropertyAttribute attribute, v8::Local signature, - AccessControl settings, SideEffectType getter_side_effect_type) { + AccessControl settings, SideEffectType getter_side_effect_type, + SideEffectType setter_side_effect_type) { TemplateSetAccessor(this, name, getter, setter, data, settings, attribute, - signature, true, false, getter_side_effect_type); + signature, true, false, getter_side_effect_type, + setter_side_effect_type); } void Template::SetLazyDataProperty(v8::Local name, AccessorNameGetterCallback getter, v8::Local data, PropertyAttribute attribute, - SideEffectType getter_side_effect_type) { + SideEffectType getter_side_effect_type, + SideEffectType setter_side_effect_type) { TemplateSetAccessor(this, name, getter, static_cast(nullptr), data, DEFAULT, attribute, Local(), true, - true, getter_side_effect_type); + true, getter_side_effect_type, setter_side_effect_type); } void Template::SetIntrinsicDataProperty(Local name, Intrinsic intrinsic, @@ -1737,10 +1746,11 @@ void ObjectTemplate::SetAccessor(v8::Local name, v8::Local data, AccessControl settings, PropertyAttribute attribute, v8::Local signature, - SideEffectType getter_side_effect_type) { + SideEffectType getter_side_effect_type, + SideEffectType setter_side_effect_type) { TemplateSetAccessor(this, name, getter, setter, data, settings, attribute, signature, i::FLAG_disable_old_api_accessors, false, - getter_side_effect_type); + getter_side_effect_type, setter_side_effect_type); } void ObjectTemplate::SetAccessor(v8::Local name, @@ -1749,10 +1759,11 @@ void ObjectTemplate::SetAccessor(v8::Local name, v8::Local data, AccessControl settings, PropertyAttribute attribute, v8::Local signature, - SideEffectType getter_side_effect_type) { + SideEffectType getter_side_effect_type, + SideEffectType setter_side_effect_type) { TemplateSetAccessor(this, name, getter, setter, data, settings, attribute, signature, i::FLAG_disable_old_api_accessors, false, - getter_side_effect_type); + getter_side_effect_type, setter_side_effect_type); } template CreateInterceptorInfo( isolate->factory()->NewStruct(i::INTERCEPTOR_INFO_TYPE, i::TENURED)); obj->set_flags(0); - if (getter != 0) SET_FIELD_WRAPPED(isolate, obj, set_getter, getter); - if (setter != 0) SET_FIELD_WRAPPED(isolate, obj, set_setter, setter); - if (query != 0) SET_FIELD_WRAPPED(isolate, obj, set_query, query); - if (descriptor != 0) + if (getter != nullptr) SET_FIELD_WRAPPED(isolate, obj, set_getter, getter); + if (setter != nullptr) SET_FIELD_WRAPPED(isolate, obj, set_setter, setter); + if (query != nullptr) SET_FIELD_WRAPPED(isolate, obj, set_query, query); + if (descriptor != nullptr) SET_FIELD_WRAPPED(isolate, obj, set_descriptor, descriptor); - if (remover != 0) SET_FIELD_WRAPPED(isolate, obj, set_deleter, remover); - if (enumerator != 0) + if (remover != nullptr) SET_FIELD_WRAPPED(isolate, obj, set_deleter, remover); + if (enumerator != nullptr) SET_FIELD_WRAPPED(isolate, obj, set_enumerator, enumerator); - if (definer != 0) SET_FIELD_WRAPPED(isolate, obj, set_definer, definer); + if (definer != nullptr) SET_FIELD_WRAPPED(isolate, obj, set_definer, definer); obj->set_can_intercept_symbols( !(static_cast(flags) & static_cast(PropertyHandlerFlags::kOnlyInterceptStrings))); @@ -2001,24 +2012,15 @@ ScriptCompiler::CachedData::~CachedData() { } } - bool ScriptCompiler::ExternalSourceStream::SetBookmark() { return false; } - void ScriptCompiler::ExternalSourceStream::ResetToBookmark() { UNREACHABLE(); } ScriptCompiler::StreamedSource::StreamedSource(ExternalSourceStream* stream, Encoding encoding) : impl_(new i::ScriptStreamingData(stream, encoding)) {} -ScriptCompiler::StreamedSource::~StreamedSource() { delete impl_; } - - -const ScriptCompiler::CachedData* -ScriptCompiler::StreamedSource::GetCachedData() const { - return impl_->cached_data.get(); -} - +ScriptCompiler::StreamedSource::~StreamedSource() = default; Local