diff --git a/deps/v8/.gitattributes b/deps/v8/.gitattributes index d38eef01ae5203..7ef1e1b74b01e0 100644 --- a/deps/v8/.gitattributes +++ b/deps/v8/.gitattributes @@ -1,2 +1,5 @@ # Automatically normalize line endings (to LF) for all text-based files. -* text=auto +* text=auto eol=lf +# Do not modify line endings for binary files (which are sometimes auto +# detected as text files by git). +*.png binary diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index 630c3f2a09d3f8..b76fda4dc499ff 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -105,5 +105,10 @@ turbo*.dot turbo*.json v8.ignition_dispatches_table.json /Default/ +node_modules +tools/turbolizer/build +tools/turbolizer/.rpt2_cache +tools/turbolizer/deploy + !/third_party/jinja2 !/third_party/markupsafe diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index afad3a50414858..b9391a0d284999 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -32,7 +32,6 @@ Facebook, Inc. <*@fb.com> Facebook, Inc. <*@oculus.com> Vewd Software AS <*@vewd.com> Groupon <*@groupon.com> -Meteor Development Group <*@meteor.com> Cloudflare, Inc. <*@cloudflare.com> Aaron Bieber @@ -50,7 +49,6 @@ Andrei Kashcha Anna Henningsen Bangfu Tao Ben Coe -Ben Newman Ben Noordhuis Benjamin Tan Bert Belder @@ -75,6 +73,7 @@ Felix Geisendörfer Filipe David Manana Franziska Hinkelmann Geoffrey Garside +Gergely Nagy Gus Caplan Gwang Yoon Hwang Henrique Ferreiro @@ -88,7 +87,6 @@ Jan de Mooij Jan Krems Jay Freeman James Pike -James M Snell Jianghua Yang Joel Stanley Johan Bergström @@ -151,6 +149,8 @@ Taketoshi Aono Teddy Katz Tiancheng "Timothy" Gu Tobias Burnus +Tobias Nießen +Ujjwal Sharma Victor Costan Vlad Burlik Vladimir Krivosheev diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index fbb34a0b3dc14c..1e31acb2771e6e 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -22,6 +22,13 @@ declare_args() { # Print to stdout on Android. v8_android_log_stdout = false + # Dynamically set an additional dependency from v8/custom_deps. + v8_custom_deps = "" + + # Turns on deprecation warnings for HeapObject::GetIsolate, + # HeapObject::GetHeap, Handle(T* obj) and handle(T* obj). + v8_deprecate_get_isolate = false + # Turns on all V8 debug features. Enables running V8 in a pseudo debug mode # within a release Chrome. v8_enable_debugging_features = is_debug @@ -70,12 +77,17 @@ declare_args() { # Enable embedded builtins. # TODO(jgruber,v8:6666): Support ia32 and maybe MSVC. - # TODO(jgruber,v8:6666): Re-enable. - v8_enable_embedded_builtins = false + # TODO(jgruber,v8:6666): Enable for remaining architectures once performance + # regressions are addressed. + v8_enable_embedded_builtins = + v8_use_snapshot && v8_current_cpu == "x64" && (!is_win || is_clang) # Enable code-generation-time checking of types in the CodeStubAssembler. v8_enable_verify_csa = false + # Enable pointer compression (sets -dV8_COMPRESS_POINTERS). + v8_enable_pointer_compression = false + # Interpreted regexp engine exists as platform-independent alternative # based where the regular expression is compiled to a bytecode. v8_interpreted_regexp = false @@ -176,6 +188,9 @@ if (v8_check_microtasks_scopes_consistency == "") { v8_enable_debugging_features || dcheck_always_on } +assert(!v8_enable_embedded_builtins || v8_use_snapshot, + "Embedded builtins only work with snapshots") + # 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. @@ -195,8 +210,10 @@ config("internal_config") { "$target_gen_dir", ] + defines = [] + if (is_component_build) { - defines = [ "BUILDING_V8_SHARED" ] + defines += [ "BUILDING_V8_SHARED" ] } } @@ -286,6 +303,9 @@ config("features") { if (v8_enable_minor_mc) { defines += [ "ENABLE_MINOR_MC" ] } + if (v8_enable_pointer_compression) { + defines += [ "V8_COMPRESS_POINTERS" ] + } if (v8_enable_object_print) { defines += [ "OBJECT_PRINT" ] } @@ -320,6 +340,9 @@ config("features") { if (v8_imminent_deprecation_warnings) { defines += [ "V8_IMMINENT_DEPRECATION_WARNINGS" ] } + if (v8_deprecate_get_isolate) { + defines += [ "DEPRECATE_GET_ISOLATE" ] + } if (v8_enable_i18n_support) { defines += [ "V8_INTL_SUPPORT" ] } @@ -563,6 +586,10 @@ config("toolchain") { v8_current_cpu == "mips64el") { cflags += [ "-Wshorten-64-to-32" ] } + + if (v8_deprecate_get_isolate) { + cflags += [ "-Wno-error=deprecated" ] + } } if (is_win) { @@ -636,9 +663,6 @@ action("js2c") { "src/js/prologue.js", "src/js/array.js", "src/js/typedarray.js", - "src/debug/mirrors.js", - "src/debug/debug.js", - "src/debug/liveedit.js", ] outputs = [ @@ -828,7 +852,6 @@ action("postmortem-metadata") { "src/objects/js-regexp-string-iterator.h", "src/objects/map.h", "src/objects/map-inl.h", - "src/objects/scope-info.h", "src/objects/script.h", "src/objects/script-inl.h", "src/objects/shared-function-info.h", @@ -848,7 +871,10 @@ action("postmortem-metadata") { torque_files = [ "src/builtins/base.tq", "src/builtins/array.tq", + "src/builtins/array-foreach.tq", + "src/builtins/array-sort.tq", "src/builtins/typed-array.tq", + "src/builtins/data-view.tq", "test/torque/test-torque.tq", ] @@ -856,6 +882,7 @@ torque_modules = [ "base", "array", "typed-array", + "data-view", "test", ] @@ -906,7 +933,7 @@ action("run_torque") { } } -v8_source_set("torque_generated_core") { +v8_header_set("torque_generated_core") { visibility = [ ":*" ] # Only targets in this file can depend on this. deps = [ @@ -927,6 +954,12 @@ v8_source_set("torque_generated_initializers") { ":run_torque", ] + if (v8_enable_i18n_support) { + public_deps = [ + "//third_party/icu", + ] + } + sources = [] foreach(module, torque_modules) { sources += [ @@ -1036,6 +1069,11 @@ template("run_mksnapshot") { "--no-turbo-rewrite-far-jumps", "--no-turbo-verify-allocation", ] + + if (v8_enable_debugging_features && v8_enable_slow_dchecks) { + # mksnapshot only accepts this flag if ENABLE_SLOW_DCHECKS is defined. + args += [ "--no-enable-slow-asserts" ] + } } } } @@ -1178,6 +1216,8 @@ if (v8_use_snapshot && !v8_use_external_startup_data) { if (v8_enable_embedded_builtins) { sources += [ "$target_gen_dir/embedded.cc" ] + } else { + sources += [ "src/snapshot/embedded-empty.cc" ] } if (use_jumbo_build == true) { @@ -1234,6 +1274,8 @@ if (v8_use_snapshot && v8_use_external_startup_data) { ] } } + } else { + sources += [ "src/snapshot/embedded-empty.cc" ] } configs = [ ":internal_config" ] @@ -1271,6 +1313,7 @@ v8_source_set("v8_initializers") { "src/builtins/builtins-constructor-gen.h", "src/builtins/builtins-constructor.h", "src/builtins/builtins-conversion-gen.cc", + "src/builtins/builtins-data-view-gen.h", "src/builtins/builtins-date-gen.cc", "src/builtins/builtins-debug-gen.cc", "src/builtins/builtins-function-gen.cc", @@ -1283,6 +1326,8 @@ v8_source_set("v8_initializers") { "src/builtins/builtins-intl-gen.cc", "src/builtins/builtins-iterator-gen.cc", "src/builtins/builtins-iterator-gen.h", + "src/builtins/builtins-lazy-gen.cc", + "src/builtins/builtins-lazy-gen.h", "src/builtins/builtins-math-gen.cc", "src/builtins/builtins-math-gen.h", "src/builtins/builtins-number-gen.cc", @@ -1394,6 +1439,11 @@ v8_source_set("v8_init") { ### gcmole(all) ### "src/setup-isolate-full.cc", ] + if (v8_enable_i18n_support) { + public_deps = [ + "//third_party/icu", + ] + } configs = [ ":internal_config" ] } @@ -1484,8 +1534,6 @@ v8_source_set("v8_base") { "src/ast/ast-value-factory.h", "src/ast/ast.cc", "src/ast/ast.h", - "src/ast/compile-time-value.cc", - "src/ast/compile-time-value.h", "src/ast/context-slot-cache.cc", "src/ast/context-slot-cache.h", "src/ast/modules.cc", @@ -1540,7 +1588,6 @@ v8_source_set("v8_base") { "src/builtins/builtins-sharedarraybuffer.cc", "src/builtins/builtins-string.cc", "src/builtins/builtins-symbol.cc", - "src/builtins/builtins-trace.cc", "src/builtins/builtins-typed-array.cc", "src/builtins/builtins-utils.h", "src/builtins/builtins.cc", @@ -1566,13 +1613,12 @@ v8_source_set("v8_base") { "src/code-stubs-utils.h", "src/code-stubs.cc", "src/code-stubs.h", + "src/code-tracer.h", "src/codegen.cc", "src/codegen.h", "src/collector.h", "src/compilation-cache.cc", "src/compilation-cache.h", - "src/compilation-dependencies.cc", - "src/compilation-dependencies.h", "src/compilation-statistics.cc", "src/compilation-statistics.h", "src/compiler-dispatcher/compiler-dispatcher-job.cc", @@ -1618,6 +1664,8 @@ v8_source_set("v8_base") { "src/compiler/common-operator-reducer.h", "src/compiler/common-operator.cc", "src/compiler/common-operator.h", + "src/compiler/compilation-dependencies.cc", + "src/compiler/compilation-dependencies.h", "src/compiler/compiler-source-position-table.cc", "src/compiler/compiler-source-position-table.h", "src/compiler/constant-folding-reducer.cc", @@ -1674,6 +1722,8 @@ v8_source_set("v8_base") { "src/compiler/js-generic-lowering.h", "src/compiler/js-graph.cc", "src/compiler/js-graph.h", + "src/compiler/js-heap-broker.cc", + "src/compiler/js-heap-broker.h", "src/compiler/js-inlining-heuristic.cc", "src/compiler/js-inlining-heuristic.h", "src/compiler/js-inlining.cc", @@ -1912,6 +1962,8 @@ v8_source_set("v8_base") { "src/heap/gc-idle-time-handler.h", "src/heap/gc-tracer.cc", "src/heap/gc-tracer.h", + "src/heap/heap-controller.cc", + "src/heap/heap-controller.h", "src/heap/heap-inl.h", "src/heap/heap.cc", "src/heap/heap.h", @@ -2087,6 +2139,7 @@ v8_source_set("v8_base") { "src/objects/frame-array.h", "src/objects/hash-table-inl.h", "src/objects/hash-table.h", + "src/objects/intl-objects-inl.h", "src/objects/intl-objects.cc", "src/objects/intl-objects.h", "src/objects/js-array-inl.h", @@ -2102,6 +2155,9 @@ v8_source_set("v8_base") { "src/objects/js-regexp-string-iterator-inl.h", "src/objects/js-regexp-string-iterator.h", "src/objects/js-regexp.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/literal-objects-inl.h", "src/objects/literal-objects.cc", "src/objects/literal-objects.h", @@ -2127,6 +2183,8 @@ v8_source_set("v8_base") { "src/objects/promise.h", "src/objects/property-descriptor-object-inl.h", "src/objects/property-descriptor-object.h", + "src/objects/prototype-info-inl.h", + "src/objects/prototype-info.h", "src/objects/regexp-match-info.h", "src/objects/scope-info.cc", "src/objects/scope-info.h", @@ -2159,7 +2217,6 @@ v8_source_set("v8_base") { "src/parsing/parsing.cc", "src/parsing/parsing.h", "src/parsing/pattern-rewriter.cc", - "src/parsing/preparse-data-format.h", "src/parsing/preparse-data.cc", "src/parsing/preparse-data.h", "src/parsing/preparsed-scope-data.cc", @@ -2235,6 +2292,8 @@ v8_source_set("v8_base") { "src/register-configuration.cc", "src/register-configuration.h", "src/reglist.h", + "src/roots-inl.h", + "src/roots.h", "src/runtime-profiler.cc", "src/runtime-profiler.h", "src/runtime/runtime-array.cc", @@ -2245,7 +2304,6 @@ v8_source_set("v8_base") { "src/runtime/runtime-compiler.cc", "src/runtime/runtime-date.cc", "src/runtime/runtime-debug.cc", - "src/runtime/runtime-error.cc", "src/runtime/runtime-forin.cc", "src/runtime/runtime-function.cc", "src/runtime/runtime-futex.cc", @@ -2254,7 +2312,6 @@ v8_source_set("v8_base") { "src/runtime/runtime-interpreter.cc", "src/runtime/runtime-intl.cc", "src/runtime/runtime-literals.cc", - "src/runtime/runtime-liveedit.cc", "src/runtime/runtime-maths.cc", "src/runtime/runtime-module.cc", "src/runtime/runtime-numbers.cc", @@ -2306,6 +2363,7 @@ v8_source_set("v8_base") { "src/snapshot/partial-deserializer.h", "src/snapshot/partial-serializer.cc", "src/snapshot/partial-serializer.h", + "src/snapshot/references.h", "src/snapshot/serializer-common.cc", "src/snapshot/serializer-common.h", "src/snapshot/serializer.cc", @@ -2352,6 +2410,8 @@ v8_source_set("v8_base") { "src/trap-handler/handler-shared.cc", "src/trap-handler/trap-handler-internal.h", "src/trap-handler/trap-handler.h", + "src/turbo-assembler.cc", + "src/turbo-assembler.h", "src/type-hints.cc", "src/type-hints.h", "src/unicode-cache-inl.h", @@ -2396,6 +2456,8 @@ v8_source_set("v8_base") { "src/wasm/function-body-decoder.h", "src/wasm/function-compiler.cc", "src/wasm/function-compiler.h", + "src/wasm/jump-table-assembler.cc", + "src/wasm/jump-table-assembler.h", "src/wasm/leb-helper.h", "src/wasm/local-decl-encoder.cc", "src/wasm/local-decl-encoder.h", @@ -2412,8 +2474,6 @@ v8_source_set("v8_base") { "src/wasm/value-type.h", "src/wasm/wasm-code-manager.cc", "src/wasm/wasm-code-manager.h", - "src/wasm/wasm-code-specialization.cc", - "src/wasm/wasm-code-specialization.h", "src/wasm/wasm-constants.h", "src/wasm/wasm-debug.cc", "src/wasm/wasm-engine.cc", @@ -2485,6 +2545,7 @@ v8_source_set("v8_base") { "src/ia32/assembler-ia32.h", "src/ia32/code-stubs-ia32.cc", "src/ia32/codegen-ia32.cc", + "src/ia32/constants-ia32.h", "src/ia32/cpu-ia32.cc", "src/ia32/deoptimizer-ia32.cc", "src/ia32/disasm-ia32.cc", @@ -2518,6 +2579,7 @@ v8_source_set("v8_base") { "src/x64/assembler-x64.h", "src/x64/code-stubs-x64.cc", "src/x64/codegen-x64.cc", + "src/x64/constants-x64.h", "src/x64/cpu-x64.cc", "src/x64/deoptimizer-x64.cc", "src/x64/disasm-x64.cc", @@ -2557,7 +2619,6 @@ v8_source_set("v8_base") { "src/arm/frame-constants-arm.cc", "src/arm/frame-constants-arm.h", "src/arm/interface-descriptors-arm.cc", - "src/arm/interface-descriptors-arm.h", "src/arm/macro-assembler-arm.cc", "src/arm/macro-assembler-arm.h", "src/arm/simulator-arm.cc", @@ -2598,7 +2659,6 @@ v8_source_set("v8_base") { "src/arm64/instrument-arm64.cc", "src/arm64/instrument-arm64.h", "src/arm64/interface-descriptors-arm64.cc", - "src/arm64/interface-descriptors-arm64.h", "src/arm64/macro-assembler-arm64-inl.h", "src/arm64/macro-assembler-arm64.cc", "src/arm64/macro-assembler-arm64.h", @@ -2768,11 +2828,15 @@ v8_source_set("v8_base") { "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-locale-inl.h", "src/objects/js-locale.cc", "src/objects/js-locale.h", + "src/objects/js-relative-time-format-inl.h", + "src/objects/js-relative-time-format.cc", + "src/objects/js-relative-time-format.h", "src/runtime/runtime-intl.cc", ] } @@ -2816,6 +2880,7 @@ v8_component("v8_libbase") { "src/base/ieee754.h", "src/base/iterator.h", "src/base/lazy-instance.h", + "src/base/list.h", "src/base/logging.cc", "src/base/logging.h", "src/base/macros.h", @@ -2925,7 +2990,6 @@ v8_component("v8_libbase") { "src/base/debug/stack_trace_fuchsia.cc", "src/base/platform/platform-fuchsia.cc", ] - public_deps += [ "//third_party/fuchsia-sdk:launchpad" ] } else if (is_mac) { sources += [ "src/base/debug/stack_trace_posix.cc", @@ -3029,6 +3093,10 @@ v8_source_set("fuzzer_support") { ":v8_libbase", ":v8_libplatform", ] + + if (v8_enable_i18n_support) { + public_deps += [ "//third_party/icu" ] + } } ############################################################################### @@ -3047,7 +3115,6 @@ if (v8_monolithic) { ":v8_libbase", ":v8_libplatform", ":v8_libsampler", - "//build/config:exe_and_shlib_deps", "//build/win:default_exe_manifest", ] @@ -3075,7 +3142,6 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) { ":v8_libbase", ":v8_libplatform", ":v8_nosnapshot", - "//build/config:exe_and_shlib_deps", "//build/win:default_exe_manifest", ] } @@ -3129,7 +3195,6 @@ if (current_toolchain == v8_snapshot_toolchain) { deps = [ ":v8_libbase", "third_party/antlr4:antlr4", - "//build/config:exe_and_shlib_deps", "//build/win:default_exe_manifest", ] @@ -3170,6 +3235,11 @@ group("gn_all") { "tools:gn_all", ] + if (v8_custom_deps != "") { + # Custom dependency from directory under v8/custom_deps. + deps += [ v8_custom_deps ] + } + if (want_v8_shell) { deps += [ ":v8_shell" ] } @@ -3285,6 +3355,8 @@ if (is_component_build) { v8_executable("d8") { sources = [ "$target_gen_dir/d8-js.cc", + "src/async-hooks-wrapper.cc", + "src/async-hooks-wrapper.h", "src/d8-console.cc", "src/d8-console.h", "src/d8.cc", @@ -3303,7 +3375,6 @@ v8_executable("d8") { ":v8", ":v8_libbase", ":v8_libplatform", - "//build/config:exe_and_shlib_deps", "//build/win:default_exe_manifest", ] @@ -3340,7 +3411,6 @@ v8_executable("v8_hello_world") { ":v8", ":v8_libbase", ":v8_libplatform", - "//build/config:exe_and_shlib_deps", "//build/win:default_exe_manifest", ] } @@ -3361,7 +3431,6 @@ v8_executable("v8_sample_process") { ":v8", ":v8_libbase", ":v8_libplatform", - "//build/config:exe_and_shlib_deps", "//build/win:default_exe_manifest", ] } @@ -3383,7 +3452,6 @@ if (want_v8_shell) { ":v8", ":v8_libbase", ":v8_libplatform", - "//build/config:exe_and_shlib_deps", "//build/win:default_exe_manifest", ] } @@ -3395,7 +3463,6 @@ template("v8_fuzzer") { v8_executable("v8_simple_" + name) { deps = [ ":" + name, - "//build/config:exe_and_shlib_deps", "//build/win:default_exe_manifest", ] @@ -3508,6 +3575,12 @@ v8_source_set("wasm_module_runner") { ":torque_generated_core", ] + if (v8_enable_i18n_support) { + public_deps = [ + "//third_party/icu", + ] + } + configs = [ ":external_config", ":internal_config_base", @@ -3585,6 +3658,12 @@ v8_source_set("lib_wasm_fuzzer_common") { ":torque_generated_core", ] + if (v8_enable_i18n_support) { + public_deps = [ + "//third_party/icu", + ] + } + configs = [ ":external_config", ":internal_config_base", diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index 437c09b4d0fb04..fc7a93e2d9ddf4 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,2213 @@ +2018-07-17: Version 6.9.427 + + Performance and stability improvements on all platforms. + + +2018-07-17: Version 6.9.426 + + Performance and stability improvements on all platforms. + + +2018-07-17: Version 6.9.425 + + Performance and stability improvements on all platforms. + + +2018-07-17: Version 6.9.424 + + Performance and stability improvements on all platforms. + + +2018-07-17: Version 6.9.423 + + Performance and stability improvements on all platforms. + + +2018-07-17: Version 6.9.422 + + Performance and stability improvements on all platforms. + + +2018-07-17: Version 6.9.421 + + Performance and stability improvements on all platforms. + + +2018-07-17: Version 6.9.420 + + Performance and stability improvements on all platforms. + + +2018-07-17: Version 6.9.419 + + Performance and stability improvements on all platforms. + + +2018-07-17: Version 6.9.418 + + Performance and stability improvements on all platforms. + + +2018-07-17: Version 6.9.417 + + Performance and stability improvements on all platforms. + + +2018-07-17: Version 6.9.416 + + Performance and stability improvements on all platforms. + + +2018-07-17: Version 6.9.415 + + Performance and stability improvements on all platforms. + + +2018-07-17: Version 6.9.414 + + Performance and stability improvements on all platforms. + + +2018-07-17: Version 6.9.413 + + Performance and stability improvements on all platforms. + + +2018-07-16: Version 6.9.412 + + Performance and stability improvements on all platforms. + + +2018-07-16: Version 6.9.411 + + Performance and stability improvements on all platforms. + + +2018-07-16: Version 6.9.410 + + Performance and stability improvements on all platforms. + + +2018-07-16: Version 6.9.409 + + Performance and stability improvements on all platforms. + + +2018-07-16: Version 6.9.408 + + Performance and stability improvements on all platforms. + + +2018-07-16: Version 6.9.407 + + Performance and stability improvements on all platforms. + + +2018-07-16: Version 6.9.406 + + Performance and stability improvements on all platforms. + + +2018-07-16: Version 6.9.405 + + Performance and stability improvements on all platforms. + + +2018-07-16: Version 6.9.404 + + Performance and stability improvements on all platforms. + + +2018-07-16: Version 6.9.403 + + Performance and stability improvements on all platforms. + + +2018-07-16: Version 6.9.402 + + Performance and stability improvements on all platforms. + + +2018-07-16: Version 6.9.401 + + Performance and stability improvements on all platforms. + + +2018-07-15: Version 6.9.400 + + Performance and stability improvements on all platforms. + + +2018-07-14: Version 6.9.399 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.398 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.397 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.396 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.395 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.394 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.393 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.392 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.391 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.390 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.389 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.388 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.387 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.386 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.385 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.384 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.383 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.382 + + Performance and stability improvements on all platforms. + + +2018-07-13: Version 6.9.381 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.380 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.379 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.378 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.377 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.376 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.375 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.374 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.373 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.372 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.371 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.370 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.369 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.368 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.367 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.366 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.365 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.364 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.363 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.362 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.361 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.360 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.359 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.358 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.357 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.356 + + Performance and stability improvements on all platforms. + + +2018-07-12: Version 6.9.355 + + Performance and stability improvements on all platforms. + + +2018-07-11: Version 6.9.354 + + Performance and stability improvements on all platforms. + + +2018-07-11: Version 6.9.353 + + Performance and stability improvements on all platforms. + + +2018-07-11: Version 6.9.352 + + Performance and stability improvements on all platforms. + + +2018-07-11: Version 6.9.351 + + Performance and stability improvements on all platforms. + + +2018-07-11: Version 6.9.350 + + Performance and stability improvements on all platforms. + + +2018-07-11: Version 6.9.349 + + Performance and stability improvements on all platforms. + + +2018-07-11: Version 6.9.348 + + Performance and stability improvements on all platforms. + + +2018-07-11: Version 6.9.347 + + Performance and stability improvements on all platforms. + + +2018-07-11: Version 6.9.346 + + Performance and stability improvements on all platforms. + + +2018-07-11: Version 6.9.345 + + Performance and stability improvements on all platforms. + + +2018-07-10: Version 6.9.344 + + Performance and stability improvements on all platforms. + + +2018-07-10: Version 6.9.343 + + Performance and stability improvements on all platforms. + + +2018-07-10: Version 6.9.342 + + Performance and stability improvements on all platforms. + + +2018-07-10: Version 6.9.341 + + Performance and stability improvements on all platforms. + + +2018-07-10: Version 6.9.340 + + Performance and stability improvements on all platforms. + + +2018-07-10: Version 6.9.339 + + Performance and stability improvements on all platforms. + + +2018-07-10: Version 6.9.338 + + Performance and stability improvements on all platforms. + + +2018-07-10: Version 6.9.337 + + Performance and stability improvements on all platforms. + + +2018-07-10: Version 6.9.336 + + Performance and stability improvements on all platforms. + + +2018-07-10: Version 6.9.335 + + Performance and stability improvements on all platforms. + + +2018-07-10: Version 6.9.334 + + Performance and stability improvements on all platforms. + + +2018-07-10: Version 6.9.333 + + Performance and stability improvements on all platforms. + + +2018-07-10: Version 6.9.332 + + Performance and stability improvements on all platforms. + + +2018-07-09: Version 6.9.331 + + Performance and stability improvements on all platforms. + + +2018-07-09: Version 6.9.330 + + Performance and stability improvements on all platforms. + + +2018-07-09: Version 6.9.329 + + Performance and stability improvements on all platforms. + + +2018-07-09: Version 6.9.328 + + Performance and stability improvements on all platforms. + + +2018-07-09: Version 6.9.327 + + Performance and stability improvements on all platforms. + + +2018-07-09: Version 6.9.326 + + Performance and stability improvements on all platforms. + + +2018-07-09: Version 6.9.325 + + Performance and stability improvements on all platforms. + + +2018-07-08: Version 6.9.324 + + Performance and stability improvements on all platforms. + + +2018-07-07: Version 6.9.323 + + Performance and stability improvements on all platforms. + + +2018-07-06: Version 6.9.322 + + Performance and stability improvements on all platforms. + + +2018-07-06: Version 6.9.321 + + Performance and stability improvements on all platforms. + + +2018-07-06: Version 6.9.320 + + Performance and stability improvements on all platforms. + + +2018-07-06: Version 6.9.319 + + Performance and stability improvements on all platforms. + + +2018-07-06: Version 6.9.318 + + Performance and stability improvements on all platforms. + + +2018-07-06: Version 6.9.317 + + Performance and stability improvements on all platforms. + + +2018-07-06: Version 6.9.316 + + Performance and stability improvements on all platforms. + + +2018-07-05: Version 6.9.315 + + Performance and stability improvements on all platforms. + + +2018-07-05: Version 6.9.314 + + Performance and stability improvements on all platforms. + + +2018-07-05: Version 6.9.313 + + Performance and stability improvements on all platforms. + + +2018-07-05: Version 6.9.312 + + Performance and stability improvements on all platforms. + + +2018-07-05: Version 6.9.311 + + Performance and stability improvements on all platforms. + + +2018-07-05: Version 6.9.310 + + Performance and stability improvements on all platforms. + + +2018-07-05: Version 6.9.309 + + Performance and stability improvements on all platforms. + + +2018-07-05: Version 6.9.308 + + Performance and stability improvements on all platforms. + + +2018-07-04: Version 6.9.307 + + Performance and stability improvements on all platforms. + + +2018-07-04: Version 6.9.306 + + Performance and stability improvements on all platforms. + + +2018-07-04: Version 6.9.305 + + Performance and stability improvements on all platforms. + + +2018-07-04: Version 6.9.304 + + Performance and stability improvements on all platforms. + + +2018-07-04: Version 6.9.303 + + Performance and stability improvements on all platforms. + + +2018-07-04: Version 6.9.302 + + Performance and stability improvements on all platforms. + + +2018-07-04: Version 6.9.301 + + Performance and stability improvements on all platforms. + + +2018-07-04: Version 6.9.300 + + Performance and stability improvements on all platforms. + + +2018-07-04: Version 6.9.299 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.298 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.297 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.296 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.295 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.294 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.293 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.292 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.291 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.290 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.289 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.288 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.287 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.286 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.285 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.284 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.283 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.282 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.281 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.280 + + Performance and stability improvements on all platforms. + + +2018-07-03: Version 6.9.279 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.278 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.277 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.276 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.275 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.274 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.273 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.272 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.271 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.270 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.269 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.268 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.267 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.266 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.265 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.264 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.263 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.262 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.261 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.260 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.259 + + Performance and stability improvements on all platforms. + + +2018-07-02: Version 6.9.258 + + Performance and stability improvements on all platforms. + + +2018-07-01: Version 6.9.257 + + Performance and stability improvements on all platforms. + + +2018-06-30: Version 6.9.256 + + Performance and stability improvements on all platforms. + + +2018-06-29: Version 6.9.255 + + Performance and stability improvements on all platforms. + + +2018-06-29: Version 6.9.254 + + Performance and stability improvements on all platforms. + + +2018-06-29: Version 6.9.253 + + Performance and stability improvements on all platforms. + + +2018-06-29: Version 6.9.252 + + Performance and stability improvements on all platforms. + + +2018-06-29: Version 6.9.251 + + Performance and stability improvements on all platforms. + + +2018-06-29: Version 6.9.250 + + Performance and stability improvements on all platforms. + + +2018-06-29: Version 6.9.249 + + Performance and stability improvements on all platforms. + + +2018-06-29: Version 6.9.248 + + Performance and stability improvements on all platforms. + + +2018-06-29: Version 6.9.247 + + Performance and stability improvements on all platforms. + + +2018-06-29: Version 6.9.246 + + Performance and stability improvements on all platforms. + + +2018-06-28: Version 6.9.245 + + Performance and stability improvements on all platforms. + + +2018-06-28: Version 6.9.244 + + Performance and stability improvements on all platforms. + + +2018-06-28: Version 6.9.243 + + Performance and stability improvements on all platforms. + + +2018-06-27: Version 6.9.242 + + Performance and stability improvements on all platforms. + + +2018-06-27: Version 6.9.241 + + Performance and stability improvements on all platforms. + + +2018-06-27: Version 6.9.240 + + Performance and stability improvements on all platforms. + + +2018-06-27: Version 6.9.239 + + Performance and stability improvements on all platforms. + + +2018-06-27: Version 6.9.238 + + Performance and stability improvements on all platforms. + + +2018-06-27: Version 6.9.237 + + Performance and stability improvements on all platforms. + + +2018-06-27: Version 6.9.236 + + Performance and stability improvements on all platforms. + + +2018-06-27: Version 6.9.235 + + Performance and stability improvements on all platforms. + + +2018-06-27: Version 6.9.234 + + Performance and stability improvements on all platforms. + + +2018-06-27: Version 6.9.233 + + Performance and stability improvements on all platforms. + + +2018-06-27: Version 6.9.232 + + Performance and stability improvements on all platforms. + + +2018-06-27: Version 6.9.231 + + Performance and stability improvements on all platforms. + + +2018-06-27: Version 6.9.230 + + Performance and stability improvements on all platforms. + + +2018-06-26: Version 6.9.229 + + Performance and stability improvements on all platforms. + + +2018-06-26: Version 6.9.228 + + Performance and stability improvements on all platforms. + + +2018-06-26: Version 6.9.227 + + Performance and stability improvements on all platforms. + + +2018-06-26: Version 6.9.226 + + Performance and stability improvements on all platforms. + + +2018-06-26: Version 6.9.225 + + Performance and stability improvements on all platforms. + + +2018-06-26: Version 6.9.224 + + Performance and stability improvements on all platforms. + + +2018-06-26: Version 6.9.223 + + Performance and stability improvements on all platforms. + + +2018-06-26: Version 6.9.222 + + Performance and stability improvements on all platforms. + + +2018-06-26: Version 6.9.221 + + Performance and stability improvements on all platforms. + + +2018-06-25: Version 6.9.220 + + Performance and stability improvements on all platforms. + + +2018-06-25: Version 6.9.219 + + Performance and stability improvements on all platforms. + + +2018-06-25: Version 6.9.218 + + Performance and stability improvements on all platforms. + + +2018-06-25: Version 6.9.217 + + Performance and stability improvements on all platforms. + + +2018-06-25: Version 6.9.216 + + Performance and stability improvements on all platforms. + + +2018-06-25: Version 6.9.215 + + Performance and stability improvements on all platforms. + + +2018-06-25: Version 6.9.214 + + Performance and stability improvements on all platforms. + + +2018-06-25: Version 6.9.213 + + Performance and stability improvements on all platforms. + + +2018-06-25: Version 6.9.212 + + Performance and stability improvements on all platforms. + + +2018-06-25: Version 6.9.211 + + Performance and stability improvements on all platforms. + + +2018-06-25: Version 6.9.210 + + Performance and stability improvements on all platforms. + + +2018-06-25: Version 6.9.209 + + Performance and stability improvements on all platforms. + + +2018-06-24: Version 6.9.208 + + Performance and stability improvements on all platforms. + + +2018-06-23: Version 6.9.207 + + Performance and stability improvements on all platforms. + + +2018-06-23: Version 6.9.206 + + Performance and stability improvements on all platforms. + + +2018-06-22: Version 6.9.205 + + Performance and stability improvements on all platforms. + + +2018-06-22: Version 6.9.204 + + Performance and stability improvements on all platforms. + + +2018-06-22: Version 6.9.203 + + Performance and stability improvements on all platforms. + + +2018-06-22: Version 6.9.202 + + Performance and stability improvements on all platforms. + + +2018-06-22: Version 6.9.201 + + Performance and stability improvements on all platforms. + + +2018-06-22: Version 6.9.200 + + Performance and stability improvements on all platforms. + + +2018-06-22: Version 6.9.199 + + Performance and stability improvements on all platforms. + + +2018-06-22: Version 6.9.198 + + Performance and stability improvements on all platforms. + + +2018-06-21: Version 6.9.197 + + Performance and stability improvements on all platforms. + + +2018-06-21: Version 6.9.196 + + Performance and stability improvements on all platforms. + + +2018-06-21: Version 6.9.195 + + Performance and stability improvements on all platforms. + + +2018-06-21: Version 6.9.194 + + Performance and stability improvements on all platforms. + + +2018-06-21: Version 6.9.193 + + Performance and stability improvements on all platforms. + + +2018-06-21: Version 6.9.192 + + Performance and stability improvements on all platforms. + + +2018-06-20: Version 6.9.191 + + Performance and stability improvements on all platforms. + + +2018-06-20: Version 6.9.190 + + Performance and stability improvements on all platforms. + + +2018-06-20: Version 6.9.189 + + Performance and stability improvements on all platforms. + + +2018-06-20: Version 6.9.188 + + Performance and stability improvements on all platforms. + + +2018-06-20: Version 6.9.187 + + Performance and stability improvements on all platforms. + + +2018-06-20: Version 6.9.186 + + Performance and stability improvements on all platforms. + + +2018-06-20: Version 6.9.185 + + Performance and stability improvements on all platforms. + + +2018-06-19: Version 6.9.184 + + Performance and stability improvements on all platforms. + + +2018-06-19: Version 6.9.183 + + Performance and stability improvements on all platforms. + + +2018-06-19: Version 6.9.182 + + Performance and stability improvements on all platforms. + + +2018-06-19: Version 6.9.181 + + Performance and stability improvements on all platforms. + + +2018-06-19: Version 6.9.180 + + Performance and stability improvements on all platforms. + + +2018-06-19: Version 6.9.179 + + Performance and stability improvements on all platforms. + + +2018-06-19: Version 6.9.178 + + Performance and stability improvements on all platforms. + + +2018-06-19: Version 6.9.177 + + Performance and stability improvements on all platforms. + + +2018-06-19: Version 6.9.176 + + Performance and stability improvements on all platforms. + + +2018-06-19: Version 6.9.175 + + Performance and stability improvements on all platforms. + + +2018-06-19: Version 6.9.174 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.173 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.172 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.171 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.170 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.169 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.168 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.167 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.166 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.165 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.164 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.163 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.162 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.161 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.160 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.159 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.158 + + Performance and stability improvements on all platforms. + + +2018-06-18: Version 6.9.157 + + Performance and stability improvements on all platforms. + + +2018-06-14: Version 6.9.156 + + Performance and stability improvements on all platforms. + + +2018-06-14: Version 6.9.155 + + Performance and stability improvements on all platforms. + + +2018-06-14: Version 6.9.154 + + Performance and stability improvements on all platforms. + + +2018-06-14: Version 6.9.153 + + Performance and stability improvements on all platforms. + + +2018-06-14: Version 6.9.152 + + Performance and stability improvements on all platforms. + + +2018-06-14: Version 6.9.151 + + Performance and stability improvements on all platforms. + + +2018-06-14: Version 6.9.150 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.149 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.148 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.147 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.146 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.145 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.144 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.143 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.142 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.141 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.140 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.139 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.138 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.137 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.136 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.135 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.134 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.133 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.132 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.131 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.130 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.129 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.128 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.127 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.126 + + Performance and stability improvements on all platforms. + + +2018-06-13: Version 6.9.125 + + Performance and stability improvements on all platforms. + + +2018-06-12: Version 6.9.124 + + Performance and stability improvements on all platforms. + + +2018-06-12: Version 6.9.123 + + Performance and stability improvements on all platforms. + + +2018-06-12: Version 6.9.122 + + Performance and stability improvements on all platforms. + + +2018-06-12: Version 6.9.121 + + Performance and stability improvements on all platforms. + + +2018-06-12: Version 6.9.120 + + Performance and stability improvements on all platforms. + + +2018-06-11: Version 6.9.119 + + Performance and stability improvements on all platforms. + + +2018-06-11: Version 6.9.118 + + Performance and stability improvements on all platforms. + + +2018-06-11: Version 6.9.117 + + Performance and stability improvements on all platforms. + + +2018-06-11: Version 6.9.116 + + Performance and stability improvements on all platforms. + + +2018-06-11: Version 6.9.115 + + Performance and stability improvements on all platforms. + + +2018-06-11: Version 6.9.114 + + Performance and stability improvements on all platforms. + + +2018-06-11: Version 6.9.113 + + Performance and stability improvements on all platforms. + + +2018-06-11: Version 6.9.112 + + Performance and stability improvements on all platforms. + + +2018-06-11: Version 6.9.111 + + Performance and stability improvements on all platforms. + + +2018-06-11: Version 6.9.110 + + Performance and stability improvements on all platforms. + + +2018-06-11: Version 6.9.109 + + Performance and stability improvements on all platforms. + + +2018-06-11: Version 6.9.108 + + Performance and stability improvements on all platforms. + + +2018-06-08: Version 6.9.107 + + Performance and stability improvements on all platforms. + + +2018-06-08: Version 6.9.106 + + Performance and stability improvements on all platforms. + + +2018-06-08: Version 6.9.105 + + Performance and stability improvements on all platforms. + + +2018-06-08: Version 6.9.104 + + Performance and stability improvements on all platforms. + + +2018-06-08: Version 6.9.103 + + Performance and stability improvements on all platforms. + + +2018-06-08: Version 6.9.102 + + Performance and stability improvements on all platforms. + + +2018-06-07: Version 6.9.101 + + Performance and stability improvements on all platforms. + + +2018-06-07: Version 6.9.100 + + Performance and stability improvements on all platforms. + + +2018-06-07: Version 6.9.99 + + Performance and stability improvements on all platforms. + + +2018-06-07: Version 6.9.98 + + Performance and stability improvements on all platforms. + + +2018-06-07: Version 6.9.97 + + Performance and stability improvements on all platforms. + + +2018-06-07: Version 6.9.96 + + Performance and stability improvements on all platforms. + + +2018-06-07: Version 6.9.95 + + Performance and stability improvements on all platforms. + + +2018-06-07: Version 6.9.94 + + Performance and stability improvements on all platforms. + + +2018-06-07: Version 6.9.93 + + Performance and stability improvements on all platforms. + + +2018-06-06: Version 6.9.92 + + Performance and stability improvements on all platforms. + + +2018-06-06: Version 6.9.91 + + Performance and stability improvements on all platforms. + + +2018-06-06: Version 6.9.90 + + Performance and stability improvements on all platforms. + + +2018-06-06: Version 6.9.89 + + Performance and stability improvements on all platforms. + + +2018-06-06: Version 6.9.88 + + Performance and stability improvements on all platforms. + + +2018-06-06: Version 6.9.87 + + Performance and stability improvements on all platforms. + + +2018-06-06: Version 6.9.86 + + Performance and stability improvements on all platforms. + + +2018-06-06: Version 6.9.85 + + Performance and stability improvements on all platforms. + + +2018-06-06: Version 6.9.84 + + Performance and stability improvements on all platforms. + + +2018-06-06: Version 6.9.83 + + Performance and stability improvements on all platforms. + + +2018-06-05: Version 6.9.82 + + Performance and stability improvements on all platforms. + + +2018-06-05: Version 6.9.81 + + Performance and stability improvements on all platforms. + + +2018-06-05: Version 6.9.80 + + Performance and stability improvements on all platforms. + + +2018-06-05: Version 6.9.79 + + Performance and stability improvements on all platforms. + + +2018-06-05: Version 6.9.78 + + Performance and stability improvements on all platforms. + + +2018-06-05: Version 6.9.77 + + Performance and stability improvements on all platforms. + + +2018-06-05: Version 6.9.76 + + Performance and stability improvements on all platforms. + + +2018-06-05: Version 6.9.75 + + Performance and stability improvements on all platforms. + + +2018-06-04: Version 6.9.74 + + Performance and stability improvements on all platforms. + + +2018-06-04: Version 6.9.73 + + Performance and stability improvements on all platforms. + + +2018-06-04: Version 6.9.72 + + Performance and stability improvements on all platforms. + + +2018-06-04: Version 6.9.71 + + Performance and stability improvements on all platforms. + + +2018-06-04: Version 6.9.70 + + Performance and stability improvements on all platforms. + + +2018-06-04: Version 6.9.69 + + Performance and stability improvements on all platforms. + + +2018-06-04: Version 6.9.68 + + Performance and stability improvements on all platforms. + + +2018-06-04: Version 6.9.67 + + Performance and stability improvements on all platforms. + + +2018-06-04: Version 6.9.66 + + Performance and stability improvements on all platforms. + + +2018-06-04: Version 6.9.65 + + Performance and stability improvements on all platforms. + + +2018-06-01: Version 6.9.64 + + Performance and stability improvements on all platforms. + + +2018-06-01: Version 6.9.63 + + Performance and stability improvements on all platforms. + + +2018-06-01: Version 6.9.62 + + Performance and stability improvements on all platforms. + + +2018-06-01: Version 6.9.61 + + Performance and stability improvements on all platforms. + + +2018-06-01: Version 6.9.60 + + Performance and stability improvements on all platforms. + + +2018-06-01: Version 6.9.59 + + Performance and stability improvements on all platforms. + + +2018-06-01: Version 6.9.58 + + Performance and stability improvements on all platforms. + + +2018-06-01: Version 6.9.57 + + Performance and stability improvements on all platforms. + + +2018-05-31: Version 6.9.56 + + Performance and stability improvements on all platforms. + + +2018-05-31: Version 6.9.55 + + Performance and stability improvements on all platforms. + + +2018-05-31: Version 6.9.54 + + Performance and stability improvements on all platforms. + + +2018-05-31: Version 6.9.53 + + Performance and stability improvements on all platforms. + + +2018-05-31: Version 6.9.52 + + Performance and stability improvements on all platforms. + + +2018-05-31: Version 6.9.51 + + Performance and stability improvements on all platforms. + + +2018-05-31: Version 6.9.50 + + Performance and stability improvements on all platforms. + + +2018-05-31: Version 6.9.49 + + Performance and stability improvements on all platforms. + + +2018-05-31: Version 6.9.48 + + Performance and stability improvements on all platforms. + + +2018-05-30: Version 6.9.47 + + Performance and stability improvements on all platforms. + + +2018-05-30: Version 6.9.46 + + Performance and stability improvements on all platforms. + + +2018-05-30: Version 6.9.45 + + Performance and stability improvements on all platforms. + + +2018-05-30: Version 6.9.44 + + Performance and stability improvements on all platforms. + + +2018-05-30: Version 6.9.43 + + Performance and stability improvements on all platforms. + + +2018-05-30: Version 6.9.42 + + Performance and stability improvements on all platforms. + + +2018-05-30: Version 6.9.41 + + Performance and stability improvements on all platforms. + + +2018-05-30: Version 6.9.40 + + Performance and stability improvements on all platforms. + + +2018-05-30: Version 6.9.39 + + Performance and stability improvements on all platforms. + + +2018-05-30: Version 6.9.38 + + Performance and stability improvements on all platforms. + + +2018-05-30: Version 6.9.37 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.36 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.35 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.34 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.33 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.32 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.31 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.30 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.29 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.28 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.27 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.26 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.25 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.24 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.23 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.22 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.21 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.20 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.19 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.18 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.17 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.16 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.15 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.14 + + Performance and stability improvements on all platforms. + + +2018-05-29: Version 6.9.13 + + Performance and stability improvements on all platforms. + + +2018-05-28: Version 6.9.12 + + Performance and stability improvements on all platforms. + + +2018-05-28: Version 6.9.11 + + Performance and stability improvements on all platforms. + + +2018-05-28: Version 6.9.10 + + Performance and stability improvements on all platforms. + + +2018-05-28: Version 6.9.9 + + Performance and stability improvements on all platforms. + + +2018-05-28: Version 6.9.8 + + Performance and stability improvements on all platforms. + + +2018-05-28: Version 6.9.7 + + Performance and stability improvements on all platforms. + + +2018-05-28: Version 6.9.6 + + Performance and stability improvements on all platforms. + + +2018-05-28: Version 6.9.5 + + Performance and stability improvements on all platforms. + + +2018-05-28: Version 6.9.4 + + Performance and stability improvements on all platforms. + + +2018-05-27: Version 6.9.3 + + Performance and stability improvements on all platforms. + + +2018-05-26: Version 6.9.2 + + Performance and stability improvements on all platforms. + + +2018-05-25: Version 6.9.1 + + Performance and stability improvements on all platforms. + + +2018-05-24: Version 6.8.290 + + Performance and stability improvements on all platforms. + + +2018-05-23: Version 6.8.289 + + Performance and stability improvements on all platforms. + + +2018-05-23: Version 6.8.288 + + Performance and stability improvements on all platforms. + + +2018-05-23: Version 6.8.287 + + Performance and stability improvements on all platforms. + + +2018-05-23: Version 6.8.286 + + Performance and stability improvements on all platforms. + + +2018-05-23: Version 6.8.285 + + Performance and stability improvements on all platforms. + + +2018-05-23: Version 6.8.284 + + Performance and stability improvements on all platforms. + + +2018-05-23: Version 6.8.283 + + Performance and stability improvements on all platforms. + + +2018-05-23: Version 6.8.282 + + Performance and stability improvements on all platforms. + + +2018-05-23: Version 6.8.281 + + Performance and stability improvements on all platforms. + + +2018-05-22: Version 6.8.280 + + Performance and stability improvements on all platforms. + + +2018-05-22: Version 6.8.279 + + Performance and stability improvements on all platforms. + + +2018-05-22: Version 6.8.278 + + Performance and stability improvements on all platforms. + + +2018-05-22: Version 6.8.277 + + Performance and stability improvements on all platforms. + + +2018-05-22: Version 6.8.276 + + Performance and stability improvements on all platforms. + + 2018-05-22: Version 6.8.275 Performance and stability improvements on all platforms. diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 4bac02255de459..cb9a7fe536a398 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -12,17 +12,17 @@ vars = { deps = { 'v8/build': - Var('chromium_url') + '/chromium/src/build.git' + '@' + 'b5df2518f091eea3d358f30757dec3e33db56156', + Var('chromium_url') + '/chromium/src/build.git' + '@' + '7315579e388589b62236ad933f09afd1e838d234', 'v8/tools/gyp': Var('chromium_url') + '/external/gyp.git' + '@' + 'd61a9397e668fa9843c4aa7da9e79460fe590bfb', 'v8/third_party/depot_tools': - Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '083eb25f9acbe034db94a1bd5c1659125b6ebf98', + Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + 'fb734036f4b5ae6d5afc63cbfc41d3a5d1c29a82', 'v8/third_party/icu': - Var('chromium_url') + '/chromium/deps/icu.git' + '@' + 'f61e46dbee9d539a32551493e3bcc1dea92f83ec', + Var('chromium_url') + '/chromium/deps/icu.git' + '@' + 'a9a2bd3ee4f1d313651c5272252aaf2a3e7ed529', 'v8/third_party/instrumented_libraries': Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + '323cf32193caecbf074d1a0cb5b02b905f163e0f', 'v8/buildtools': - Var('chromium_url') + '/chromium/buildtools.git' + '@' + '94288c26d2ffe3aec9848c147839afee597acefd', + Var('chromium_url') + '/chromium/buildtools.git' + '@' + '0dd5c6f980d22be96b728155249df2da355989d9', 'v8/base/trace_event/common': Var('chromium_url') + '/chromium/src/base/trace_event/common.git' + '@' + '211b3ed9d0481b4caddbee1322321b86a483ca1f', 'v8/third_party/android_ndk': { @@ -30,11 +30,11 @@ deps = { 'condition': 'checkout_android', }, 'v8/third_party/android_tools': { - 'url': Var('chromium_url') + '/android_tools.git' + '@' + 'c22a664c39af72dd8f89200220713dcad811300a', + 'url': Var('chromium_url') + '/android_tools.git' + '@' + '130499e25286f4d56acafa252fee09f3cc595c49', 'condition': 'checkout_android', }, 'v8/third_party/catapult': { - 'url': Var('chromium_url') + '/catapult.git' + '@' + '49edbd3a2b582cbab0a912cb1989062e9b8453ff', + 'url': Var('chromium_url') + '/catapult.git' + '@' + 'f5342c4cf3d3e85e43be84c22bdfd8ebff23ec70', 'condition': 'checkout_android', }, 'v8/third_party/colorama/src': { @@ -42,31 +42,33 @@ deps = { 'condition': 'checkout_android', }, 'v8/third_party/fuchsia-sdk': { - 'url': Var('chromium_url') + '/chromium/src/third_party/fuchsia-sdk.git' + '@' + 'afac8ecd6300c9903009e6f233f61aae401aced6', + 'url': Var('chromium_url') + '/chromium/src/third_party/fuchsia-sdk.git' + '@' + '82277014aeccc89bae4d7a317813affa3f7de0ee', 'condition': 'checkout_fuchsia', }, 'v8/third_party/googletest/src': - Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + '08d5b1f33af8c18785fb8ca02792b5fac81e248f', + Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + 'ce468a17c434e4e79724396ee1b51d86bfc8a88b', 'v8/third_party/jinja2': - Var('chromium_url') + '/chromium/src/third_party/jinja2.git' + '@' + '45571de473282bd1d8b63a8dfcb1fd268d0635d2', + 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' + '@' + 'eba7a98d98735b2cc65c54d36baa5c9b46fe4f8e', 'v8/tools/swarming_client': - Var('chromium_url') + '/infra/luci/client-py.git' + '@' + '833f5ebf894be1e3e6d13678d5de8479bf12ff28', + Var('chromium_url') + '/infra/luci/client-py.git' + '@' + '9a518d097dca20b7b00ce3bdfc5d418ccc79893a', 'v8/test/benchmarks/data': Var('chromium_url') + '/v8/deps/third_party/benchmarks.git' + '@' + '05d7188267b4560491ff9155c5ee13e207ecd65f', 'v8/test/mozilla/data': Var('chromium_url') + '/v8/deps/third_party/mozilla-tests.git' + '@' + 'f6c578a10ea707b1a8ab0b88943fe5115ce2b9be', 'v8/test/test262/data': - Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + '0192e0d70e2295fb590f14865da42f0f9dfa64bd', + Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + 'a6c1d05ac4fed084fa047e4c52ab2a8c9c2a8aef', 'v8/test/test262/harness': Var('chromium_url') + '/external/github.com/test262-utils/test262-harness-py.git' + '@' + '0f2acdd882c84cff43b9d60df7574a1901e2cdcd', 'v8/tools/clang': - Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'c893c7eec4706f8c7fc244ee254b1dadd8f8d158', + Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'c0b1d892b2bc1291eb287d716ca239c1b03fb215', 'v8/tools/luci-go': - Var('chromium_url') + '/chromium/src/tools/luci-go.git' + '@' + 'ff0709d4283b1f233dcf0c9fec1672c6ecaed2f1', + Var('chromium_url') + '/chromium/src/tools/luci-go.git' + '@' + 'abcd908f74fdb155cc8870f5cae48dff1ece7c3c', 'v8/test/wasm-js': - Var('chromium_url') + '/external/github.com/WebAssembly/spec.git' + '@' + '27d63f22e72395248d314520b3ad5b1e0943fc10', + Var('chromium_url') + '/external/github.com/WebAssembly/spec.git' + '@' + '2113ea7e106f8a964e0445ba38f289d2aa845edd', } recursedeps = [ diff --git a/deps/v8/OWNERS b/deps/v8/OWNERS index f6726316f2af95..d32f7213822f10 100644 --- a/deps/v8/OWNERS +++ b/deps/v8/OWNERS @@ -10,10 +10,10 @@ clemensh@chromium.org danno@chromium.org delphick@chromium.org eholk@chromium.org -franzih@chromium.org gdeepti@chromium.org gsathya@chromium.org hablich@chromium.org +herhut@chromium.org hpayer@chromium.org ishell@chromium.org jarin@chromium.org @@ -22,8 +22,10 @@ jkummerow@chromium.org kschimpf@chromium.org leszeks@chromium.org machenbach@chromium.org +mathias@chromium.org marja@chromium.org mlippautz@chromium.org +mslekova@chromium.org mstarzinger@chromium.org mvstanton@chromium.org mythria@chromium.org diff --git a/deps/v8/PRESUBMIT.py b/deps/v8/PRESUBMIT.py index 055027c7bb6050..bd780ce62f7a78 100644 --- a/deps/v8/PRESUBMIT.py +++ b/deps/v8/PRESUBMIT.py @@ -96,7 +96,9 @@ def FilterFile(affected_file): input_api.AffectedFiles(include_deletes=True)): results.append(output_api.PresubmitError("Status file check failed")) results.extend(input_api.canned_checks.CheckAuthorizedAuthor( - input_api, output_api)) + input_api, output_api, bot_whitelist=[ + 'v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com' + ])) return results diff --git a/deps/v8/custom_deps/.gitignore b/deps/v8/custom_deps/.gitignore new file mode 100644 index 00000000000000..83866b6690a22f --- /dev/null +++ b/deps/v8/custom_deps/.gitignore @@ -0,0 +1,4 @@ +* +!.gitignore +!OWNERS +!README.md \ No newline at end of file diff --git a/deps/v8/custom_deps/OWNERS b/deps/v8/custom_deps/OWNERS new file mode 100644 index 00000000000000..76719caca0eccc --- /dev/null +++ b/deps/v8/custom_deps/OWNERS @@ -0,0 +1,2 @@ +machenbach@chromium.org +sergiyb@chromium.org \ No newline at end of file diff --git a/deps/v8/custom_deps/README.md b/deps/v8/custom_deps/README.md new file mode 100644 index 00000000000000..f49930fb939d96 --- /dev/null +++ b/deps/v8/custom_deps/README.md @@ -0,0 +1,2 @@ +Common directory for custom dependencies pulled in via .gclient custom_deps. +All subdirectories are ignored by git by default. \ No newline at end of file diff --git a/deps/v8/gni/v8.gni b/deps/v8/gni/v8.gni index 1cbba9fefdd795..a5312f76acd9dd 100644 --- a/deps/v8/gni/v8.gni +++ b/deps/v8/gni/v8.gni @@ -38,7 +38,7 @@ declare_args() { v8_use_snapshot = !(is_win && host_os != "win" && target_cpu == "x64") # Enable several snapshots side-by-side (e.g. default and for trusted code). - v8_use_multi_snapshots = "" + v8_use_multi_snapshots = false # Use external files for startup data blobs: # the JS builtins sources and the start snapshot. @@ -61,7 +61,10 @@ if (v8_use_external_startup_data == "") { v8_use_external_startup_data = v8_use_snapshot && !is_ios } -if (v8_use_multi_snapshots == "") { +if (v8_use_multi_snapshots) { + # Silently disable multi snapshots if they're incompatible with the current + # build configuration. This allows us to set v8_use_multi_snapshots=true on + # all bots, and e.g. no-snapshot bots will automatically do the right thing. v8_use_multi_snapshots = v8_use_external_startup_data && !build_with_chromium && !use_jumbo_build } diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index af36aa6d2d19d5..b486683c279f31 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -54,7 +54,7 @@ namespace v8 { */ class V8_EXPORT TracingCpuProfiler { public: - V8_DEPRECATE_SOON( + V8_DEPRECATED( "The profiler is created automatically with the isolate.\n" "No need to create it explicitly.", static std::unique_ptr Create(Isolate*)); diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index f0ded3542ce86a..c7cffaca444941 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 6 -#define V8_MINOR_VERSION 8 -#define V8_BUILD_NUMBER 275 -#define V8_PATCH_LEVEL 32 +#define V8_MINOR_VERSION 9 +#define V8_BUILD_NUMBER 427 +#define V8_PATCH_LEVEL 22 // 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 249a4aa184d989..23d5ba36db97da 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -71,7 +71,6 @@ class BigIntObject; class Boolean; class BooleanObject; class Context; -class CpuProfiler; class Data; class Date; class External; @@ -146,6 +145,8 @@ class DeferredHandles; class Heap; class HeapObject; class Isolate; +class LocalEmbedderHeapTracer; +class NeverReadOnlySpaceObject; class Object; struct ScriptStreamingData; template class CustomArguments; @@ -154,6 +155,7 @@ class FunctionCallbackArguments; class GlobalHandles; namespace wasm { +class CompilationResultResolver; class StreamingDecoder; } // namespace wasm @@ -176,18 +178,18 @@ const int kSmiTag = 0; const int kSmiTagSize = 1; const intptr_t kSmiTagMask = (1 << kSmiTagSize) - 1; -template +template struct SmiTagging; template V8_INLINE internal::Object* IntToSmi(int value) { int smi_shift_bits = kSmiTagSize + kSmiShiftSize; - uintptr_t tagged_value = - (static_cast(value) << smi_shift_bits) | kSmiTag; + intptr_t tagged_value = + (static_cast(value) << smi_shift_bits) | kSmiTag; return reinterpret_cast(tagged_value); } -// Smi constants for 32-bit systems. +// Smi constants for systems where tagged pointer is a 32-bit value. template <> struct SmiTagging<4> { enum { kSmiShiftSize = 0, kSmiValueSize = 31 }; @@ -217,7 +219,7 @@ struct SmiTagging<4> { } }; -// Smi constants for 64-bit systems. +// Smi constants for systems where tagged pointer is a 64-bit value. template <> struct SmiTagging<8> { enum { kSmiShiftSize = 31, kSmiValueSize = 32 }; @@ -237,7 +239,15 @@ struct SmiTagging<8> { } }; +#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); @@ -985,8 +995,8 @@ class V8_EXPORT HandleScope { void operator delete[](void*, size_t); // Uses heap_object to obtain the current Isolate. - static internal::Object** CreateHandle(internal::HeapObject* heap_object, - internal::Object* value); + static internal::Object** CreateHandle( + internal::NeverReadOnlySpaceObject* heap_object, internal::Object* value); internal::Isolate* isolate_; internal::Object** prev_next_; @@ -1022,6 +1032,11 @@ class V8_EXPORT EscapableHandleScope : public HandleScope { return Local(reinterpret_cast(slot)); } + template + V8_INLINE MaybeLocal EscapeMaybe(MaybeLocal value) { + return Escape(value.FromMaybe(Local())); + } + EscapableHandleScope(const EscapableHandleScope&) = delete; void operator=(const EscapableHandleScope&) = delete; @@ -1108,8 +1123,12 @@ class V8_EXPORT PrimitiveArray { public: static Local New(Isolate* isolate, int length); int Length() const; - void Set(int index, Local item); - Local Get(int index); + void Set(Isolate* isolate, int index, Local item); + Local Get(Isolate* isolate, int index); + + V8_DEPRECATE_SOON("Use Isolate version", + void Set(int index, Local item)); + V8_DEPRECATE_SOON("Use Isolate version", Local Get(int index)); }; /** @@ -1468,6 +1487,10 @@ class V8_EXPORT ScriptCompiler { * more than two data chunks. The embedder can avoid this problem by always * returning at least 2 bytes of data. * + * When streaming UTF-16 data, V8 does not handle characters split between + * two data chunks. The embedder has to make sure that chunks have an even + * length. + * * If the embedder wants to cancel the streaming, they should make the next * GetMoreData call return 0. V8 will interpret it as end of data (and most * probably, parsing will fail). The streaming task will return as soon as @@ -1651,7 +1674,9 @@ class V8_EXPORT ScriptCompiler { * ECMAScript specification. */ static V8_WARN_UNUSED_RESULT MaybeLocal CompileModule( - Isolate* isolate, Source* source); + Isolate* isolate, Source* source, + CompileOptions options = kNoCompileOptions, + NoCacheReason no_cache_reason = kNoCacheNoReason); /** * Compile a function for a given context. This is equivalent to running @@ -4349,10 +4374,29 @@ class V8_EXPORT Proxy : public Object { class V8_EXPORT WasmCompiledModule : public Object { public: typedef std::pair, size_t> SerializedModule; - /** - * A buffer that is owned by the caller. - */ - typedef std::pair CallerOwnedBuffer; + +// The COMMA macro allows us to use ',' inside of the V8_DEPRECATE_SOON macro. +#define COMMA , + V8_DEPRECATE_SOON( + "Use BufferReference.", + typedef std::pair CallerOwnedBuffer); +#undef COMMA + + /** + * A unowned reference to a byte buffer. + */ + struct BufferReference { + const uint8_t* start; + size_t size; + BufferReference(const uint8_t* start, size_t size) + : start(start), size(size) {} + // Temporarily allow conversion to and from CallerOwnedBuffer. + V8_DEPRECATE_SOON( + "Use BufferReference directly.", + inline BufferReference(CallerOwnedBuffer)); // NOLINT(runtime/explicit) + V8_DEPRECATE_SOON("Use BufferReference directly.", + inline operator CallerOwnedBuffer()); + }; /** * An opaque, native heap object for transferring wasm modules. It @@ -4369,7 +4413,7 @@ class V8_EXPORT WasmCompiledModule : public Object { private: typedef std::pair, size_t> OwnedBuffer; friend class WasmCompiledModule; - TransferrableModule(OwnedBuffer&& code, OwnedBuffer&& bytes) + TransferrableModule(OwnedBuffer code, OwnedBuffer bytes) : compiled_code(std::move(code)), wire_bytes(std::move(bytes)) {} OwnedBuffer compiled_code = {nullptr, 0}; @@ -4393,7 +4437,9 @@ class V8_EXPORT WasmCompiledModule : public Object { /** * Get the wasm-encoded bytes that were used to compile this module. */ - Local GetWasmWireBytes(); + BufferReference GetWasmWireBytesRef(); + V8_DEPRECATE_SOON("Use GetWasmWireBytesRef version.", + Local GetWasmWireBytes()); /** * Serialize the compiled module. The serialized data does not include the @@ -4406,18 +4452,18 @@ class V8_EXPORT WasmCompiledModule : public Object { * uncompiled bytes. */ static MaybeLocal DeserializeOrCompile( - Isolate* isolate, const CallerOwnedBuffer& serialized_module, - const CallerOwnedBuffer& wire_bytes); + Isolate* isolate, BufferReference serialized_module, + BufferReference wire_bytes); V8_INLINE static WasmCompiledModule* Cast(Value* obj); private: static MaybeLocal Deserialize( - Isolate* isolate, const CallerOwnedBuffer& serialized_module, - const CallerOwnedBuffer& wire_bytes); + Isolate* isolate, BufferReference serialized_module, + BufferReference wire_bytes); static MaybeLocal Compile(Isolate* isolate, const uint8_t* start, size_t length); - static CallerOwnedBuffer AsCallerOwned( + static BufferReference AsReference( const TransferrableModule::OwnedBuffer& buff) { return {buff.first.get(), buff.second}; } @@ -4426,6 +4472,61 @@ class V8_EXPORT WasmCompiledModule : public Object { static void CheckCast(Value* obj); }; +// TODO(clemensh): Remove after M69 branch. +WasmCompiledModule::BufferReference::BufferReference( + WasmCompiledModule::CallerOwnedBuffer buf) + : BufferReference(buf.first, buf.second) {} +WasmCompiledModule::BufferReference:: +operator WasmCompiledModule::CallerOwnedBuffer() { + return {start, size}; +} + +/** + * The V8 interface for WebAssembly streaming compilation. When streaming + * compilation is initiated, V8 passes a {WasmStreaming} object to the embedder + * such that the embedder can pass the input butes for streaming compilation to + * V8. + */ +class V8_EXPORT WasmStreaming final { + public: + class WasmStreamingImpl; + + WasmStreaming(std::unique_ptr impl); + + ~WasmStreaming(); + + /** + * Pass a new chunck of bytes to WebAssembly streaming compilation. + * The buffer passed into {OnBytesReceived} is owned by the caller. + */ + void OnBytesReceived(const uint8_t* bytes, size_t size); + + /** + * {Finish} should be called after all received bytes where passed to + * {OnBytesReceived} to tell V8 that there will be no more bytes. {Finish} + * does not have to be called after {Abort} has been called already. + */ + void Finish(); + + /** + * Abort streaming compilation. If {exception} has a value, then the promise + * associated with streaming compilation is rejected with that value. If + * {exception} does not have value, the promise does not get rejected. + */ + void Abort(MaybeLocal exception); + + /** + * Unpacks a {WasmStreaming} object wrapped in a {Managed} for the embedder. + * Since the embedder is on the other side of the API, it cannot unpack the + * {Managed} itself. + */ + static std::shared_ptr Unpack(Isolate* isolate, + Local value); + + private: + std::unique_ptr impl_; +}; + // TODO(mtrofin): when streaming compilation is done, we can rename this // to simply WasmModuleObjectBuilder class V8_EXPORT WasmModuleObjectBuilderStreaming final { @@ -5137,7 +5238,9 @@ class V8_EXPORT BooleanObject : public Object { */ class V8_EXPORT StringObject : public Object { public: - static Local New(Local value); + static Local New(Isolate* isolate, Local value); + static V8_DEPRECATE_SOON("Use Isolate* version", + Local New(Local value)); Local ValueOf() const; @@ -5891,26 +5994,6 @@ enum class PropertyHandlerFlags { }; struct NamedPropertyHandlerConfiguration { - NamedPropertyHandlerConfiguration( - GenericNamedPropertyGetterCallback getter, - GenericNamedPropertySetterCallback setter, - GenericNamedPropertyQueryCallback query, - GenericNamedPropertyDeleterCallback deleter, - GenericNamedPropertyEnumeratorCallback enumerator, - GenericNamedPropertyDefinerCallback definer, - GenericNamedPropertyDescriptorCallback descriptor, - Local data = Local(), - PropertyHandlerFlags flags = PropertyHandlerFlags::kNone) - : getter(getter), - setter(setter), - query(query), - deleter(deleter), - enumerator(enumerator), - definer(definer), - descriptor(descriptor), - data(data), - flags(flags) {} - NamedPropertyHandlerConfiguration( /** Note: getter is required */ GenericNamedPropertyGetterCallback getter = 0, @@ -5962,25 +6045,6 @@ struct NamedPropertyHandlerConfiguration { struct IndexedPropertyHandlerConfiguration { - IndexedPropertyHandlerConfiguration( - IndexedPropertyGetterCallback getter, - IndexedPropertySetterCallback setter, IndexedPropertyQueryCallback query, - IndexedPropertyDeleterCallback deleter, - IndexedPropertyEnumeratorCallback enumerator, - IndexedPropertyDefinerCallback definer, - IndexedPropertyDescriptorCallback descriptor, - Local data = Local(), - PropertyHandlerFlags flags = PropertyHandlerFlags::kNone) - : getter(getter), - setter(setter), - query(query), - deleter(deleter), - enumerator(enumerator), - definer(definer), - descriptor(descriptor), - data(data), - flags(flags) {} - IndexedPropertyHandlerConfiguration( /** Note: getter is required */ IndexedPropertyGetterCallback getter = 0, @@ -6298,7 +6362,8 @@ class V8_EXPORT AccessorSignature : public Data { // --- Extensions --- - +V8_DEPRECATE_SOON("Implementation detail", + class ExternalOneByteStringResourceImpl); class V8_EXPORT ExternalOneByteStringResourceImpl : public String::ExternalOneByteStringResource { public: @@ -6325,7 +6390,7 @@ class V8_EXPORT Extension { // NOLINT int dep_count = 0, const char** deps = 0, int source_length = -1); - virtual ~Extension() { } + virtual ~Extension() { delete source_; } virtual Local GetNativeFunctionTemplate( Isolate* isolate, Local name) { return Local(); @@ -6334,7 +6399,8 @@ class V8_EXPORT Extension { // NOLINT const char* name() const { return name_; } size_t source_length() const { return source_length_; } const String::ExternalOneByteStringResource* source() const { - return &source_; } + return source_; + } int dependency_count() { return dep_count_; } const char** dependencies() { return deps_; } void set_auto_enable(bool value) { auto_enable_ = value; } @@ -6347,7 +6413,7 @@ class V8_EXPORT Extension { // NOLINT private: const char* name_; size_t source_length_; // expected to initialize before source_ - ExternalOneByteStringResourceImpl source_; + String::ExternalOneByteStringResource* source_; int dep_count_; const char** deps_; bool auto_enable_; @@ -6679,6 +6745,9 @@ typedef bool (*AllowWasmCodeGenerationCallback)(Local context, // by the embedder. Example: WebAssembly.{compile|instantiate}Streaming --- typedef void (*ApiImplementationCallback)(const FunctionCallbackInfo&); +// --- Callback for WebAssembly.compileStreaming --- +typedef void (*WasmStreamingCallback)(const FunctionCallbackInfo&); + // --- Garbage Collection Callbacks --- /** @@ -6919,6 +6988,8 @@ struct JitCodeEvent { // New location of instructions. Only valid for CODE_MOVED. void* new_code_start; }; + + Isolate* isolate; }; /** @@ -7040,6 +7111,12 @@ class V8_EXPORT EmbedderHeapTracer { virtual bool AdvanceTracing(double deadline_in_ms, AdvanceTracingActions actions) = 0; + /* + * Returns true if there no more tracing work to be done (see AdvanceTracing) + * and false otherwise. + */ + virtual bool IsTracingDone() { return NumberOfWrappersToTrace() == 0; } + /** * Called at the end of a GC cycle. * @@ -7061,13 +7138,35 @@ class V8_EXPORT EmbedderHeapTracer { */ virtual void AbortTracing() = 0; + /* + * Called by the embedder to request immediaet finalization of the currently + * running tracing phase that has been started with TracePrologue and not + * yet finished with TraceEpilogue. + * + * Will be a noop when currently not in tracing. + * + * This is an experimental feature. + */ + void FinalizeTracing(); + + /* + * Returns the v8::Isolate this tracer is attached too and |nullptr| if it + * is not attached to any v8::Isolate. + */ + v8::Isolate* isolate() const { return isolate_; } + /** * Returns the number of wrappers that are still to be traced by the embedder. */ - virtual size_t NumberOfWrappersToTrace() { return 0; } + V8_DEPRECATE_SOON("Use IsTracingDone", + virtual size_t NumberOfWrappersToTrace() { return 0; }); protected: virtual ~EmbedderHeapTracer() = default; + + v8::Isolate* isolate_ = nullptr; + + friend class internal::LocalEmbedderHeapTracer; }; /** @@ -7361,6 +7460,7 @@ class V8_EXPORT Isolate { kWebAssemblyInstantiation = 46, kDeoptimizerDisableSpeculation = 47, kArrayPrototypeSortJSArrayModifiedPrototype = 48, + kFunctionTokenOffsetTooLongForToString = 49, // 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 @@ -7616,15 +7716,7 @@ class V8_EXPORT Isolate { HeapProfiler* GetHeapProfiler(); /** - * Returns CPU profiler for this isolate. Will return NULL unless the isolate - * is initialized. It is the embedder's responsibility to stop all CPU - * profiling activities if it has started any. - */ - V8_DEPRECATED("CpuProfiler should be created with CpuProfiler::New call.", - CpuProfiler* GetCpuProfiler()); - - /** - * Tells the CPU profiler whether the embedder is idle. + * Tells the VM whether the embedder is idle or not. */ void SetIdle(bool is_idle); @@ -7703,6 +7795,85 @@ class V8_EXPORT Isolate { */ void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer); + /** + * Use for |AtomicsWaitCallback| to indicate the type of event it receives. + */ + enum class AtomicsWaitEvent { + /** Indicates that this call is happening before waiting. */ + kStartWait, + /** `Atomics.wait()` finished because of an `Atomics.wake()` call. */ + kWokenUp, + /** `Atomics.wait()` finished because it timed out. */ + kTimedOut, + /** `Atomics.wait()` was interrupted through |TerminateExecution()|. */ + kTerminatedExecution, + /** `Atomics.wait()` was stopped through |AtomicsWaitWakeHandle|. */ + kAPIStopped, + /** `Atomics.wait()` did not wait, as the initial condition was not met. */ + kNotEqual + }; + + /** + * Passed to |AtomicsWaitCallback| as a means of stopping an ongoing + * `Atomics.wait` call. + */ + class V8_EXPORT AtomicsWaitWakeHandle { + public: + /** + * Stop this `Atomics.wait()` call and call the |AtomicsWaitCallback| + * with |kAPIStopped|. + * + * This function may be called from another thread. The caller has to ensure + * through proper synchronization that it is not called after + * the finishing |AtomicsWaitCallback|. + * + * Note that the ECMAScript specification does not plan for the possibility + * of wakeups that are neither coming from a timeout or an `Atomics.wake()` + * call, so this may invalidate assumptions made by existing code. + * The embedder may accordingly wish to schedule an exception in the + * finishing |AtomicsWaitCallback|. + */ + void Wake(); + }; + + /** + * Embedder callback for `Atomics.wait()` that can be added through + * |SetAtomicsWaitCallback|. + * + * This will be called just before starting to wait with the |event| value + * |kStartWait| and after finishing waiting with one of the other + * values of |AtomicsWaitEvent| inside of an `Atomics.wait()` call. + * + * |array_buffer| will refer to the underlying SharedArrayBuffer, + * |offset_in_bytes| to the location of the waited-on memory address inside + * the SharedArrayBuffer. + * + * |value| and |timeout_in_ms| will be the values passed to + * the `Atomics.wait()` call. If no timeout was used, |timeout_in_ms| + * will be `INFINITY`. + * + * In the |kStartWait| callback, |stop_handle| will be an object that + * is only valid until the corresponding finishing callback and that + * can be used to stop the wait process while it is happening. + * + * This callback may schedule exceptions, *unless* |event| is equal to + * |kTerminatedExecution|. + */ + typedef void (*AtomicsWaitCallback)(AtomicsWaitEvent event, + Local array_buffer, + size_t offset_in_bytes, int32_t value, + double timeout_in_ms, + AtomicsWaitWakeHandle* stop_handle, + void* data); + + /** + * Set a new |AtomicsWaitCallback|. This overrides an earlier + * |AtomicsWaitCallback|, if there was any. If |callback| is nullptr, + * this unsets the callback. |data| will be passed to the callback + * as its last parameter. + */ + void SetAtomicsWaitCallback(AtomicsWaitCallback callback, void* data); + /** * Enables the host application to receive a notification after a * garbage collection. Allocations are allowed in the callback function, @@ -7956,6 +8127,18 @@ class V8_EXPORT Isolate { */ void IsolateInBackgroundNotification(); + /** + * Optional notification which will enable the memory savings mode. + * V8 uses this notification to guide heuristics which may result in a + * smaller memory footprint at the cost of reduced runtime performance. + */ + void EnableMemorySavingsMode(); + + /** + * Optional notification which will disable the memory savings mode. + */ + void DisableMemorySavingsMode(); + /** * Optional notification to tell V8 the current performance requirements * of the embedder based on RAIL. @@ -8079,6 +8262,8 @@ class V8_EXPORT Isolate { void SetWasmCompileStreamingCallback(ApiImplementationCallback callback); + void SetWasmStreamingCallback(WasmStreamingCallback callback); + /** * Check if V8 is dead and therefore unusable. This is the case after * fatal errors such as out-of-memory situations. @@ -9927,7 +10112,6 @@ AccessorSignature* AccessorSignature::Cast(Data* data) { Local Object::GetInternalField(int index) { #ifndef V8_ENABLE_CHECKS typedef internal::Object O; - typedef internal::HeapObject HO; typedef internal::Internals I; O* obj = *reinterpret_cast(this); // Fast path: If the object is a plain JSObject, which is the common case, we @@ -9938,7 +10122,8 @@ Local Object::GetInternalField(int index) { instance_type == I::kJSSpecialApiObjectType) { int offset = I::kJSObjectHeaderSize + (internal::kApiPointerSize * index); O* value = I::ReadField(obj, offset); - O** result = HandleScope::CreateHandle(reinterpret_cast(obj), value); + O** result = HandleScope::CreateHandle( + reinterpret_cast(obj), value); return Local(reinterpret_cast(result)); } #endif @@ -10578,9 +10763,8 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory( Local Context::GetEmbedderData(int index) { #ifndef V8_ENABLE_CHECKS typedef internal::Object O; - typedef internal::HeapObject HO; typedef internal::Internals I; - HO* context = *reinterpret_cast(this); + auto* context = *reinterpret_cast(this); O** result = HandleScope::CreateHandle(context, I::ReadEmbedderData(this, index)); return Local(reinterpret_cast(result)); diff --git a/deps/v8/infra/config/cq.cfg b/deps/v8/infra/config/cq.cfg index 49c13c000bcbf9..85fb595ae7e6c4 100644 --- a/deps/v8/infra/config/cq.cfg +++ b/deps/v8/infra/config/cq.cfg @@ -111,7 +111,5 @@ verifiers { } } } - - sign_cla {} } diff --git a/deps/v8/infra/mb/mb_config.pyl b/deps/v8/infra/mb/mb_config.pyl index 23b00624557606..0492cf31a5f9b3 100644 --- a/deps/v8/infra/mb/mb_config.pyl +++ b/deps/v8/infra/mb/mb_config.pyl @@ -30,15 +30,27 @@ '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', + 's390x.debug.sim': 'default_debug_s390x_sim', + 's390x.optdebug.sim': 'default_optdebug_s390x_sim', + 's390x.release.sim': 'default_release_s390x_sim', 'x64.debug': 'default_debug_x64', 'x64.optdebug': 'default_optdebug_x64', 'x64.release': 'default_release_x64', @@ -95,6 +107,7 @@ 'V8 Fuchsia': 'release_x64_fuchsia', 'V8 Fuchsia - debug': 'debug_x64_fuchsia', 'V8 Linux64 - cfi': 'release_x64_cfi', + 'V8 Linux64 UBSan': 'release_x64_ubsan', 'V8 Linux64 UBSanVptr': 'release_x64_ubsan_vptr', 'V8 Linux - vtunejit': 'debug_x86_vtunejit', 'V8 Linux64 - gcov coverage': 'release_x64_gcc_coverage', @@ -285,28 +298,52 @@ 'default_release_mips64el': [ 'release', 'simulate_mips64el'], 'default_debug_ppc': [ - 'debug', 'simulate_ppc', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'debug', 'ppc', 'v8_enable_slow_dchecks', 'v8_full_debug'], 'default_optdebug_ppc': [ - 'debug', 'simulate_ppc', 'v8_enable_slow_dchecks'], + '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', 'simulate_ppc64', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'debug', 'ppc64', 'gcc', 'v8_enable_slow_dchecks', 'v8_full_debug'], 'default_optdebug_ppc64': [ - 'debug', 'simulate_ppc64', 'v8_enable_slow_dchecks'], + 'debug', 'ppc64', 'gcc', 'v8_enable_slow_dchecks'], 'default_release_ppc64': [ + 'release', 'ppc64', 'gcc'], + 'default_debug_ppc64_sim': [ + 'debug', 'simulate_ppc64', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'default_optdebug_ppc64_sim': [ + 'debug', 'simulate_ppc64', 'v8_enable_slow_dchecks'], + 'default_release_ppc64_sim': [ 'release', 'simulate_ppc64'], 'default_debug_s390': [ - 'debug', 'simulate_s390', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'debug', 's390', 'v8_enable_slow_dchecks', 'v8_full_debug'], 'default_optdebug_s390': [ - 'debug', 'simulate_s390', 'v8_enable_slow_dchecks'], + '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', 'simulate_s390x', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'debug', 's390x', 'v8_enable_slow_dchecks', 'v8_full_debug'], 'default_optdebug_s390x': [ - 'debug', 'simulate_s390x', 'v8_enable_slow_dchecks'], + 'debug', 's390x', 'v8_enable_slow_dchecks'], 'default_release_s390x': [ + 'release', 's390x'], + 'default_debug_s390x_sim': [ + 'debug', 'simulate_s390x', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'default_optdebug_s390x_sim': [ + 'debug', 'simulate_s390x', 'v8_enable_slow_dchecks'], + 'default_release_s390x_sim': [ 'release', 'simulate_s390x'], 'default_debug_x64': [ 'debug', 'x64', 'v8_enable_slow_dchecks', 'v8_full_debug'], @@ -417,8 +454,7 @@ 'release_x64_gcc_coverage': [ 'release_bot', 'x64', 'coverage', 'gcc', 'no_custom_libcxx', 'no_sysroot'], 'release_x64_internal': [ - 'release_bot', 'x64', 'v8_enable_embedded_builtins', - 'v8_snapshot_internal'], + 'release_bot', 'x64', 'v8_snapshot_internal'], 'release_x64_jumbo': [ 'release_bot', 'x64', 'jumbo'], 'release_x64_jumbo_trybot': [ @@ -444,6 +480,8 @@ 'minimal_symbols'], 'release_x64_tsan_minimal_symbols': [ 'release_bot', 'x64', 'tsan', 'minimal_symbols'], + 'release_x64_ubsan': [ + 'release_bot', 'x64', 'ubsan'], 'release_x64_ubsan_vptr': [ 'release_bot', 'x64', 'ubsan_vptr'], 'release_x64_ubsan_vptr_recover_edge': [ @@ -452,7 +490,7 @@ 'release_bot', 'x64', 'ubsan_vptr', 'minimal_symbols'], 'release_x64_verify_csa': [ 'release_bot', 'x64', 'dcheck_always_on', - 'v8_enable_slow_dchecks', 'v8_enable_embedded_builtins', 'v8_verify_csa'], + 'v8_enable_slow_dchecks', 'v8_verify_csa'], # Debug configs for x64. 'debug_x64': [ @@ -588,10 +626,14 @@ '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_optimized_debug'], + 'v8_use_multi_snapshots', 'v8_optimized_debug'], }, 'debug_trybot': { @@ -678,7 +720,7 @@ }, 'release_bot': { - 'mixins': ['release', 'static', 'goma'], + 'mixins': ['release', 'static', 'goma', 'v8_use_multi_snapshots'], }, 'release_trybot': { @@ -736,6 +778,14 @@ 'gn_args': 'is_tsan=true', }, + 'ubsan': { + 'mixins': ['v8_enable_test_features'], + # TODO(krasin): Remove is_ubsan_no_recover=true when + # https://llvm.org/bugs/show_bug.cgi?id=25569 is fixed and just use + # ubsan instead. + 'gn_args': 'is_ubsan=true is_ubsan_no_recover=true', + }, + 'ubsan_vptr': { 'mixins': ['v8_enable_test_features'], # TODO(krasin): Remove is_ubsan_no_recover=true when @@ -763,10 +813,6 @@ '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', }, @@ -816,6 +862,22 @@ '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', + }, + 'x64': { 'gn_args': 'target_cpu="x64"', }, @@ -823,5 +885,6 @@ 'x86': { 'gn_args': 'target_cpu="x86"', }, + }, } diff --git a/deps/v8/infra/testing/builders.pyl b/deps/v8/infra/testing/builders.pyl index 4d76d696b5dccd..f8fad69cb1aeca 100644 --- a/deps/v8/infra/testing/builders.pyl +++ b/deps/v8/infra/testing/builders.pyl @@ -248,7 +248,7 @@ {'name': 'mjsunit_sp_frame_access'}, {'name': 'mozilla'}, {'name': 'test262'}, - {'name': 'v8testing', 'shards': 7}, + {'name': 'v8testing', 'shards': 9}, {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, ], }, diff --git a/deps/v8/samples/hello-world.cc b/deps/v8/samples/hello-world.cc index ab6f0dd8bf67ee..d75dcb3c3cc4ef 100644 --- a/deps/v8/samples/hello-world.cc +++ b/deps/v8/samples/hello-world.cc @@ -34,22 +34,63 @@ int main(int argc, char* argv[]) { // Enter the context for compiling and running the hello world script. v8::Context::Scope context_scope(context); - // Create a string containing the JavaScript source code. - v8::Local source = - v8::String::NewFromUtf8(isolate, "'Hello' + ', World!'", - v8::NewStringType::kNormal) - .ToLocalChecked(); - - // Compile the source code. - v8::Local script = - v8::Script::Compile(context, source).ToLocalChecked(); - - // Run the script to get the result. - v8::Local result = script->Run(context).ToLocalChecked(); - - // Convert the result to an UTF8 string and print it. - v8::String::Utf8Value utf8(isolate, result); - printf("%s\n", *utf8); + { + // Create a string containing the JavaScript source code. + v8::Local source = + v8::String::NewFromUtf8(isolate, "'Hello' + ', World!'", + v8::NewStringType::kNormal) + .ToLocalChecked(); + + // Compile the source code. + v8::Local script = + v8::Script::Compile(context, source).ToLocalChecked(); + + // Run the script to get the result. + v8::Local result = script->Run(context).ToLocalChecked(); + + // Convert the result to an UTF8 string and print it. + v8::String::Utf8Value utf8(isolate, result); + printf("%s\n", *utf8); + } + + { + // Use the JavaScript API to generate a WebAssembly module. + // + // |bytes| contains the binary format for the following module: + // + // (func (export "add") (param i32 i32) (result i32) + // get_local 0 + // get_local 1 + // i32.add) + // + const char* csource = R"( + let bytes = new Uint8Array([ + 0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x07, 0x01, + 0x60, 0x02, 0x7f, 0x7f, 0x01, 0x7f, 0x03, 0x02, 0x01, 0x00, 0x07, + 0x07, 0x01, 0x03, 0x61, 0x64, 0x64, 0x00, 0x00, 0x0a, 0x09, 0x01, + 0x07, 0x00, 0x20, 0x00, 0x20, 0x01, 0x6a, 0x0b + ]); + let module = new WebAssembly.Module(bytes); + let instance = new WebAssembly.Instance(module); + instance.exports.add(3, 4); + )"; + + // Create a string containing the JavaScript source code. + v8::Local source = + v8::String::NewFromUtf8(isolate, csource, v8::NewStringType::kNormal) + .ToLocalChecked(); + + // Compile the source code. + v8::Local script = + v8::Script::Compile(context, source).ToLocalChecked(); + + // Run the script to get the result. + v8::Local result = script->Run(context).ToLocalChecked(); + + // Convert the result to a uint32 and print it. + uint32_t number = result->Uint32Value(context).ToChecked(); + printf("3 + 4 = %u\n", number); + } } // Dispose the isolate and tear down V8. diff --git a/deps/v8/src/accessors.cc b/deps/v8/src/accessors.cc index 565c019092b8a1..ae59ec3356e87f 100644 --- a/deps/v8/src/accessors.cc +++ b/deps/v8/src/accessors.cc @@ -13,6 +13,7 @@ #include "src/isolate-inl.h" #include "src/messages.h" #include "src/objects/api-callbacks.h" +#include "src/objects/module-inl.h" #include "src/property-details.h" #include "src/prototype.h" @@ -45,11 +46,11 @@ Handle Accessors::MakeAccessor( return info; } -static V8_INLINE bool CheckForName(Handle name, +static V8_INLINE bool CheckForName(Isolate* isolate, Handle name, Handle property_name, int offset, FieldIndex::Encoding encoding, FieldIndex* index) { - if (Name::Equals(name, property_name)) { + if (Name::Equals(isolate, name, property_name)) { *index = FieldIndex::ForInObjectOffset(offset, encoding); return true; } @@ -59,17 +60,15 @@ static V8_INLINE bool CheckForName(Handle name, // Returns true for properties that are accessors to object fields. // If true, *object_offset contains offset of object field. -bool Accessors::IsJSObjectFieldAccessor(Handle map, Handle name, - FieldIndex* index) { - Isolate* isolate = name->GetIsolate(); - +bool Accessors::IsJSObjectFieldAccessor(Isolate* isolate, Handle map, + Handle name, FieldIndex* index) { switch (map->instance_type()) { case JS_ARRAY_TYPE: - return CheckForName(name, isolate->factory()->length_string(), + return CheckForName(isolate, name, isolate->factory()->length_string(), JSArray::kLengthOffset, FieldIndex::kTagged, index); default: if (map->instance_type() < FIRST_NONSTRING_TYPE) { - return CheckForName(name, isolate->factory()->length_string(), + return CheckForName(isolate, name, isolate->factory()->length_string(), String::kLengthOffset, FieldIndex::kTagged, index); } @@ -169,7 +168,8 @@ void Accessors::ArrayLengthSetter( RuntimeCallCounterId::kArrayLengthSetter); HandleScope scope(isolate); - DCHECK(Utils::OpenHandle(*name)->SameValue(isolate->heap()->length_string())); + DCHECK(Utils::OpenHandle(*name)->SameValue( + ReadOnlyRoots(isolate).length_string())); Handle object = Utils::OpenHandle(*info.Holder()); Handle array = Handle::cast(object); @@ -237,7 +237,8 @@ void Accessors::ModuleNamespaceEntryGetter( JSModuleNamespace* holder = JSModuleNamespace::cast(*Utils::OpenHandle(*info.Holder())); Handle result; - if (!holder->GetExport(Handle::cast(Utils::OpenHandle(*name))) + if (!holder + ->GetExport(isolate, Handle::cast(Utils::OpenHandle(*name))) .ToHandle(&result)) { isolate->OptionalRescheduleException(false); } else { @@ -304,333 +305,6 @@ Handle Accessors::MakeStringLengthInfo(Isolate* isolate) { &StringLengthGetter, nullptr); } -// -// Accessors::ScriptColumnOffset -// - - -void Accessors::ScriptColumnOffsetGetter( - v8::Local name, - const v8::PropertyCallbackInfo& info) { - i::Isolate* isolate = reinterpret_cast(info.GetIsolate()); - DisallowHeapAllocation no_allocation; - HandleScope scope(isolate); - Object* object = *Utils::OpenHandle(*info.Holder()); - Object* res = Smi::FromInt( - Script::cast(JSValue::cast(object)->value())->column_offset()); - info.GetReturnValue().Set(Utils::ToLocal(Handle(res, isolate))); -} - -Handle Accessors::MakeScriptColumnOffsetInfo(Isolate* isolate) { - Handle name(isolate->factory()->InternalizeOneByteString( - STATIC_CHAR_VECTOR("column_offset"))); - return MakeAccessor(isolate, name, &ScriptColumnOffsetGetter, nullptr); -} - - -// -// Accessors::ScriptId -// - - -void Accessors::ScriptIdGetter( - v8::Local name, - const v8::PropertyCallbackInfo& info) { - i::Isolate* isolate = reinterpret_cast(info.GetIsolate()); - DisallowHeapAllocation no_allocation; - HandleScope scope(isolate); - Object* object = *Utils::OpenHandle(*info.Holder()); - Object* id = Smi::FromInt(Script::cast(JSValue::cast(object)->value())->id()); - info.GetReturnValue().Set(Utils::ToLocal(Handle(id, isolate))); -} - -Handle Accessors::MakeScriptIdInfo(Isolate* isolate) { - Handle name( - isolate->factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("id"))); - return MakeAccessor(isolate, name, &ScriptIdGetter, nullptr); -} - - -// -// Accessors::ScriptName -// - - -void Accessors::ScriptNameGetter( - v8::Local name, - const v8::PropertyCallbackInfo& info) { - i::Isolate* isolate = reinterpret_cast(info.GetIsolate()); - DisallowHeapAllocation no_allocation; - HandleScope scope(isolate); - Object* object = *Utils::OpenHandle(*info.Holder()); - Object* source = Script::cast(JSValue::cast(object)->value())->name(); - info.GetReturnValue().Set(Utils::ToLocal(Handle(source, isolate))); -} - -Handle Accessors::MakeScriptNameInfo(Isolate* isolate) { - return MakeAccessor(isolate, isolate->factory()->name_string(), - &ScriptNameGetter, nullptr); -} - - -// -// Accessors::ScriptSource -// - - -void Accessors::ScriptSourceGetter( - v8::Local name, - const v8::PropertyCallbackInfo& info) { - i::Isolate* isolate = reinterpret_cast(info.GetIsolate()); - DisallowHeapAllocation no_allocation; - HandleScope scope(isolate); - Object* object = *Utils::OpenHandle(*info.Holder()); - Object* source = Script::cast(JSValue::cast(object)->value())->source(); - info.GetReturnValue().Set(Utils::ToLocal(Handle(source, isolate))); -} - -Handle Accessors::MakeScriptSourceInfo(Isolate* isolate) { - return MakeAccessor(isolate, isolate->factory()->source_string(), - &ScriptSourceGetter, nullptr); -} - - -// -// Accessors::ScriptLineOffset -// - - -void Accessors::ScriptLineOffsetGetter( - v8::Local name, - const v8::PropertyCallbackInfo& info) { - i::Isolate* isolate = reinterpret_cast(info.GetIsolate()); - DisallowHeapAllocation no_allocation; - HandleScope scope(isolate); - Object* object = *Utils::OpenHandle(*info.Holder()); - Object* res = - Smi::FromInt(Script::cast(JSValue::cast(object)->value())->line_offset()); - info.GetReturnValue().Set(Utils::ToLocal(Handle(res, isolate))); -} - -Handle Accessors::MakeScriptLineOffsetInfo(Isolate* isolate) { - Handle name(isolate->factory()->InternalizeOneByteString( - STATIC_CHAR_VECTOR("line_offset"))); - return MakeAccessor(isolate, name, &ScriptLineOffsetGetter, nullptr); -} - - -// -// Accessors::ScriptType -// - - -void Accessors::ScriptTypeGetter( - v8::Local name, - const v8::PropertyCallbackInfo& info) { - i::Isolate* isolate = reinterpret_cast(info.GetIsolate()); - DisallowHeapAllocation no_allocation; - HandleScope scope(isolate); - Object* object = *Utils::OpenHandle(*info.Holder()); - Object* res = - Smi::FromInt(Script::cast(JSValue::cast(object)->value())->type()); - info.GetReturnValue().Set(Utils::ToLocal(Handle(res, isolate))); -} - -Handle Accessors::MakeScriptTypeInfo(Isolate* isolate) { - Handle name( - isolate->factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("type"))); - return MakeAccessor(isolate, name, &ScriptTypeGetter, nullptr); -} - - -// -// Accessors::ScriptCompilationType -// - - -void Accessors::ScriptCompilationTypeGetter( - v8::Local name, - const v8::PropertyCallbackInfo& info) { - i::Isolate* isolate = reinterpret_cast(info.GetIsolate()); - DisallowHeapAllocation no_allocation; - HandleScope scope(isolate); - Object* object = *Utils::OpenHandle(*info.Holder()); - Object* res = Smi::FromInt( - Script::cast(JSValue::cast(object)->value())->compilation_type()); - info.GetReturnValue().Set(Utils::ToLocal(Handle(res, isolate))); -} - -Handle Accessors::MakeScriptCompilationTypeInfo( - Isolate* isolate) { - Handle name(isolate->factory()->InternalizeOneByteString( - STATIC_CHAR_VECTOR("compilation_type"))); - return MakeAccessor(isolate, name, &ScriptCompilationTypeGetter, nullptr); -} - - -// -// Accessors::ScriptSourceUrl -// - - -void Accessors::ScriptSourceUrlGetter( - v8::Local name, - const v8::PropertyCallbackInfo& info) { - i::Isolate* isolate = reinterpret_cast(info.GetIsolate()); - DisallowHeapAllocation no_allocation; - HandleScope scope(isolate); - Object* object = *Utils::OpenHandle(*info.Holder()); - Object* url = Script::cast(JSValue::cast(object)->value())->source_url(); - info.GetReturnValue().Set(Utils::ToLocal(Handle(url, isolate))); -} - -Handle Accessors::MakeScriptSourceUrlInfo(Isolate* isolate) { - Handle name(isolate->factory()->InternalizeOneByteString( - STATIC_CHAR_VECTOR("source_url"))); - return MakeAccessor(isolate, name, &ScriptSourceUrlGetter, nullptr); -} - - -// -// Accessors::ScriptSourceMappingUrl -// - - -void Accessors::ScriptSourceMappingUrlGetter( - v8::Local name, - const v8::PropertyCallbackInfo& info) { - i::Isolate* isolate = reinterpret_cast(info.GetIsolate()); - DisallowHeapAllocation no_allocation; - HandleScope scope(isolate); - Object* object = *Utils::OpenHandle(*info.Holder()); - Object* url = - Script::cast(JSValue::cast(object)->value())->source_mapping_url(); - info.GetReturnValue().Set(Utils::ToLocal(Handle(url, isolate))); -} - -Handle Accessors::MakeScriptSourceMappingUrlInfo( - Isolate* isolate) { - Handle name(isolate->factory()->InternalizeOneByteString( - STATIC_CHAR_VECTOR("source_mapping_url"))); - return MakeAccessor(isolate, name, &ScriptSourceMappingUrlGetter, nullptr); -} - - -// -// Accessors::ScriptGetContextData -// - - -void Accessors::ScriptContextDataGetter( - v8::Local name, - const v8::PropertyCallbackInfo& info) { - i::Isolate* isolate = reinterpret_cast(info.GetIsolate()); - DisallowHeapAllocation no_allocation; - HandleScope scope(isolate); - Object* object = *Utils::OpenHandle(*info.Holder()); - Object* res = Script::cast(JSValue::cast(object)->value())->context_data(); - info.GetReturnValue().Set(Utils::ToLocal(Handle(res, isolate))); -} - -Handle Accessors::MakeScriptContextDataInfo(Isolate* isolate) { - Handle name(isolate->factory()->InternalizeOneByteString( - STATIC_CHAR_VECTOR("context_data"))); - return MakeAccessor(isolate, name, &ScriptContextDataGetter, nullptr); -} - - -// -// Accessors::ScriptGetEvalFromScript -// - - -void Accessors::ScriptEvalFromScriptGetter( - v8::Local name, - const v8::PropertyCallbackInfo& info) { - i::Isolate* isolate = reinterpret_cast(info.GetIsolate()); - HandleScope scope(isolate); - Handle object = Utils::OpenHandle(*info.Holder()); - Handle @@ -86,7 +119,6 @@ return document.querySelector(query); } - function loadFile() { let files = $('#uploadInput').files; @@ -149,19 +181,20 @@ } function delay(t) { - return new Promise(resolve = > setTimeout(resolve, t)); + return new Promise(resolve => setTimeout(resolve, t)); } function renderParseResults(parseProcessor) { let result = $('#result'); // clear out all existing result pages; result.innerHTML = ''; - const start = parseProcessor.firstEvent; - const end = parseProcessor.lastEvent; + const start = parseProcessor.firstEventTimestamp; + const end = parseProcessor.lastEventTimestamp; renderScript(result, parseProcessor.totalScript, start, end); // Build up the graphs lazily to keep the page responsive. parseProcessor.scripts.forEach( script => renderScript(result, script, start, end)); + renderScriptSizes(parseProcessor); // Install an intersection observer to lazily load the graphs when the script // div becomes visible for the first time. var io = new IntersectionObserver((entries, observer) => { @@ -172,11 +205,10 @@ appendGraph(target.script, target, start, end); observer.unobserve(entry.target); }); - }, {}); + }, {rootMargin: '400px'}); document.querySelectorAll('.script').forEach(div => io.observe(div)); } - const kTimeFactor = 10; const kHeight = 20; const kFunktionTopOffset = 50; @@ -189,32 +221,69 @@ scriptDiv.script = script; let scriptTitle = h3(); - if (script.file) scriptTitle.appendChild(a(script.file, script.file)); - let anchor = a("", ' id=' + script.id); + let anchor = a("", 'Script #' + script.id); anchor.name = "script"+script.id scriptTitle.appendChild(anchor); scriptDiv.appendChild(scriptTitle); + if (script.file) scriptTitle.appendChild(a(script.file, script.file)); let summary = createNode('pre', 'script-details'); summary.appendChild(text(script.summary)); scriptDiv.appendChild(summary); result.appendChild(scriptDiv); - return scriptDiv; +} + +function renderScriptSizes(parseProcessor) { + let scriptsDiv = $('#scripts'); + parseProcessor.scripts.forEach( + script => { + let scriptDiv = a('#script'+script.id, '', 'script-size'); + let scriptId = div('script-details'); + scriptId.classList.add('id'); + scriptId.innerText = script.id; + scriptDiv.appendChild(scriptId); + let scriptSize = div('script-details'); + scriptSize.innerText = BYTES(script.bytesTotal); + scriptDiv.appendChild(scriptSize); + let scriptUrl = div('script-details'); + if (script.isEval) { + scriptUrl.innerText = "eval"; + scriptDiv.classList.add('eval'); + } else { + scriptUrl.innerText = script.file.split("/").pop(); + } + if (script.isStreamingCompiled ) { + scriptDiv.classList.add('streaming'); + } else if (script.deserializationTimestamp > 0) { + scriptDiv.classList.add('deserialized'); + } + scriptDiv.appendChild(scriptUrl); + scriptDiv.style.width = script.bytesTotal * 0.001; + scriptsDiv.appendChild(scriptDiv); + }); } const kMaxTime = 120 * kSecondsToMillis; // Resolution of the graphs const kTimeIncrement = 1; const kSelectionTimespan = 2; +// TODO(cbruni): support compilation cache hit. const series = [ -// ['firstParseEvent', 'Any Parse Event'], + ['firstParseEvent', 'Any Parse', 'area'], + ['execution', '1st Exec', 'area'], + ['firstCompileEvent', 'Any Compile', 'area'], + ['compile', 'Eager Compile'], + ['lazyCompile', 'Lazy Compile'], ['parse', 'Parsing'], -// ['preparse', 'Preparsing'], -// ['resolution', 'Preparsing with Var. Resolution'], - ['lazyCompile', 'Lazy Compilation'], - ['compile', 'Eager Compilation'], - ['execution', 'First Execution'], + ['preparse', 'Preparse'], + ['resolution', 'Preparse with Var. Resolution'], + ['deserialization', 'Deserialization'], + ['optimization', 'Optimize'], ]; const metricNames = series.map(each => each[0]); +// Display cumulative values (useuful for bytes). +const kCumulative = true; +// Include durations in the graphs. +const kUseDuration = false; function appendGraph(script, parentNode, start, end) { @@ -223,27 +292,34 @@ console.time(timerLabel); let data = new google.visualization.DataTable(); - data.addColumn('number', 'Time'); + data.addColumn('number', 'Duration'); // The series are interleave bytes processed, time spent and thus have two // different vAxes. let seriesOptions = []; - series.forEach(each => { - let description = each[1]; + let colors = ['#4D4D4D', '#fff700', '#5DA5DA', '#FAA43A', '#60BD68', + '#F17CB0', '#B2912F', '#B276B2', '#DECF3F', '#F15854']; + series.forEach(([metric, description, type]) => { + let color = colors.shift(); // Add the bytes column. - data.addColumn('number', description + ' Bytes'); - seriesOptions.push({targetAxisIndex: 0}); + data.addColumn('number', description); + let options = {targetAxisIndex: 0, color: color}; + if (type == 'area') options.type = 'area'; + seriesOptions.push(options) // Add the time column. - data.addColumn('number', description + ' Time'); - seriesOptions.push({targetAxisIndex: 1, lineDashStyle: [3, 2]}); + if (kUseDuration) { + data.addColumn('number', description + ' Duration'); + seriesOptions.push( + {targetAxisIndex: 1, color: color, lineDashStyle: [3, 2]}); + } }); - // The first entry contains the total. - seriesOptions[0].type = 'area'; const maxTime = Math.min(kMaxTime, end); console.time('metrics'); let metricValues = - script.getAccumulatedTimeMetrics(metricNames , 0, maxTime, kTimeIncrement); + script.getAccumulatedTimeMetrics(metricNames , 0, maxTime, kTimeIncrement, + kCumulative, kUseDuration); console.timeEnd('metrics'); + // Make sure that the series added to the graph matches the returned values. console.assert(metricValues[0].length == seriesOptions.length + 1); data.addRows(metricValues); @@ -257,11 +333,11 @@ }, vAxes: { 0: {title: 'Bytes Touched', format: 'short'}, - 1: {title: 'Time', format: '#,###ms'} + 1: {title: 'Duration', format: '#,###ms'} }, height: 400, width: 1000, - chartArea: {left: '5%', top: '15%', width: "85%", height: "75%"}, + chartArea: {left: 70, top: 0, right: 160, height: "90%"}, // The first series should be a area chart (total bytes touched), series: seriesOptions, // everthing else is a line. @@ -275,27 +351,29 @@ google.visualization.events.addListener(chart, 'select', () => selectGraphPointHandler(chart, data, script, parentNode)); chart.draw(data, options); + // Add event listeners console.timeEnd(timerLabel); } - function selectGraphPointHandler(chart, data, script, parentNode) { let selection = chart.getSelection(); if (selection.length <= 0) return; // Display a list of funktions with events at the given time. let {row, column} = selection[0]; if (row === null|| column === null) return; - let name = series[((column-1)/2) | 0][0]; + const kEntrySize = kUseDuration ? 2 : 1; + let [metric, description] = series[((column-1)/ kEntrySize) | 0]; let time = data.getValue(row, 0); let funktions = script.getFunktionsAtTime( - time * kSecondsToMillis, kSelectionTimespan, name); + time * kSecondsToMillis, kSelectionTimespan, metric); let oldList = parentNode.querySelector('.funktion-list'); - parentNode.replaceChild(createFunktionList(name, time, funktions), oldList); + parentNode.replaceChild( + createFunktionList(metric, description, time, funktions), oldList); } -function createFunktionList(metric, time, funktions) { +function createFunktionList(metric, description, time, funktions) { let container = createNode('div', 'funktion-list'); - container.appendChild(h3('Changes of ' + metric + ' at ' + + container.appendChild(h3('Changes of "' + description + '" at ' + time + 's: ' + funktions.length)); let listNode = createNode('ul'); funktions.forEach(funktion => { @@ -311,8 +389,6 @@ container.appendChild(listNode); return container; } - - @@ -326,10 +402,14 @@

Usage

Data

- trace entries: 0 + trace entries: 0

+ +

Scripts

+
+

Result

diff --git a/deps/v8/tools/parse-processor.js b/deps/v8/tools/parse-processor.js index 30b593a15626cb..b829cf29d5be80 100644 --- a/deps/v8/tools/parse-processor.js +++ b/deps/v8/tools/parse-processor.js @@ -22,13 +22,13 @@ function readFile(fileName) { // confusion between the decimal and thousands separator is big (alternating // between comma "," vs dot "."). The Swiss formatting uses "'" as a thousands // separator, dropping most of that confusion. -var numberFormat = new Intl.NumberFormat('de-CH', { +const numberFormat = new Intl.NumberFormat('de-CH', { maximumFractionDigits: 2, minimumFractionDigits: 2, }); function formatNumber(value) { - return formatNumber(value); + return numberFormat.format(value); } function BYTES(bytes, total) { @@ -50,48 +50,136 @@ function PERCENT(value, total) { return Math.round(value / total * 100) + "%"; } -function timestampMin(list) { - let result = -1; - list.forEach(timestamp => { - if (result === -1) { - result = timestamp; - } else if (timestamp != -1) { - result = Math.min(result, timestamp); +// =========================================================================== +const kNoTimeMetrics = { + __proto__: null, + executionDuration: 0, + firstEventTimestamp: 0, + firstParseEventTimestamp: 0, + lastParseEventTimestamp: 0, + lastEventTimestamp: 0 +}; + +class CompilationUnit { + constructor() { + this.isEval = false; + + // Lazily computed properties. + this.firstEventTimestamp = -1; + this.firstParseEventTimestamp = -1; + this.firstCompileEventTimestamp = -1; + this.lastParseEventTimestamp = -1; + this.lastEventTimestamp = -1; + this.deserializationTimestamp = -1; + + this.preparseTimestamp = -1; + this.parseTimestamp = -1; + this.parse2Timestamp = -1; + this.resolutionTimestamp = -1; + this.compileTimestamp = -1; + this.lazyCompileTimestamp = -1; + this.executionTimestamp = -1; + this.optimizationTimestamp = -1; + + this.deserializationDuration = -0.0; + this.preparseDuration = -0.0; + this.parseDuration = -0.0; + this.parse2Duration = -0.0; + this.resolutionDuration = -0.0; + this.scopeResolutionDuration = -0.0; + this.lazyCompileDuration = -0.0; + this.compileDuration = -0.0; + this.optimizeDuration = -0.0; + + this.ownBytes = -1; + this.compilationCacheHits = []; + } + + finalize() { + this.firstEventTimestamp = this.timestampMin( + this.deserializationTimestamp, this.parseTimestamp, + this.preparseTimestamp, this.resolutionTimestamp, + this.executionTimestamp); + + this.firstParseEventTimestamp = this.timestampMin( + this.deserializationTimestamp, this.parseTimestamp, + this.preparseTimestamp, this.resolutionTimestamp); + + this.firstCompileEventTimestamp = this.rawTimestampMin( + this.deserializationTimestamp, this.compileTimestamp, + this.lazyCompileTimestamp); + // Any excuted script needs to be compiled. + if (this.hasBeenExecuted() && + (this.firstCompileEventTimestamp <= 0 || + this.executionTimestamp < this.firstCompileTimestamp)) { + console.error('Compile < execution timestamp', this); } - }); - return Math.round(result); -} + if (this.ownBytes < 0) console.error(this, 'Own bytes must be positive'); + } + + hasBeenExecuted() { + return this.executionTimestamp > 0; + } + + addCompilationCacheHit(timestamp) { + this.compilationCacheHits.push(timestamp); + } + + // Returns the smallest timestamp from the given list, ignoring + // uninitialized (-1) values. + rawTimestampMin(...timestamps) { + timestamps = timestamps.length == 1 ? timestamps[0] : timestamps; + let result = timestamps.reduce((min, item) => { + return item == -1 ? min : (min == -1 ? item : Math.min(item, item)); + }, -1); + return result; + } + timestampMin(...timestamps) { + let result = this.rawTimestampMin(...timestamps); + if (Number.isNaN(result) || result < 0) { + console.error( + 'Invalid timestamp min:', {result, timestamps, script: this}); + return 0; + } + return result; + } + + timestampMax(...timestamps) { + timestamps = timestamps.length == 1 ? timestamps[0] : timestamps; + let result = Math.max(...timestamps); + if (Number.isNaN(result) || result < 0) { + console.error( + 'Invalid timestamp max:', {result, timestamps, script: this}); + return 0; + } + return result; + } +} // =========================================================================== -class Script { - constructor(file, id) { - this.file = file; - this.isNative = false; - this.id = id; +class Script extends CompilationUnit { + constructor(id) { + super(); if (id === void 0 || id <= 0) { - throw new Error(`Invalid id=${id} for script with file='${file}'`); + throw new Error(`Invalid id=${id} for script`); } - this.isEval = false; + this.file = ''; + this.id = id; + + this.isNative = false; + this.isBackgroundCompiled = false; + this.isStreamingCompiled = false; + this.funktions = []; this.metrics = new Map(); this.maxNestingLevel = 0; - this.firstEvent = -1; - this.firstParseEvent = -1; - this.lastParseEvent = -1; - this.executionTimestamp = -1; - this.compileTimestamp = -1; - this.lastEvent = -1; - - this.compileTime = -0.0; - this.width = 0; - this.bytesTotal = 0; - this.ownBytes = -1; + this.bytesTotal = -1; this.finalized = false; this.summary = ''; - this.setFile(file); + this.source = ''; } setFile(name) { @@ -100,15 +188,29 @@ class Script { } isEmpty() { - return this.funktions.length === 0 + return this.funktions.length === 0; } - funktionAtPosition(start) { - if (start === 0) throw "position 0 is reserved for the script"; - if (this.finalized) throw 'Finalized script has no source position!'; + getFunktionAtStartPosition(start) { + if (!this.isEval && start === 0) { + throw 'position 0 is reserved for the script'; + } + if (this.finalized) { + return this.funktions.find(funktion => funktion.start == start); + } return this.funktions[start]; } + // Return the innermost function at the given source position. + getFunktionForPosition(position) { + if (!this.finalized) throw 'Incomplete script'; + for (let i = this.funktions.length - 1; i >= 0; i--) { + let funktion = this.funktions[i]; + if (funktion.containsPosition(position)) return funktion; + } + return undefined; + } + addMissingFunktions(list) { if (this.finalized) throw 'script is finalized!'; list.forEach(fn => { @@ -136,7 +238,7 @@ class Script { let maxNesting = 0; // Iterate over the Funktions in byte position order. this.funktions.forEach(fn => { - fn.fromEval = this.isEval; + fn.isEval = this.isEval; if (parent === null) { parent = fn; } else { @@ -150,18 +252,48 @@ class Script { } parent = fn; } - this.firstParseEvent = this.firstParseEvent === -1 ? - fn.getFirstParseEvent() : - Math.min(this.firstParseEvent, fn.getFirstParseEvent()); - this.lastParseEvent = - Math.max(this.lastParseEvent, fn.getLastParseEvent()); - fn.getFirstEvent(); - if (Number.isNaN(this.lastEvent)) throw "Invalid lastEvent"; - this.lastEvent = Math.max(this.lastEvent, fn.getLastEvent()); - if (Number.isNaN(this.lastEvent)) throw "Invalid lastEvent"; + }); + // Sanity checks to ensure that scripts are executed and parsed before any + // of its funktions. + let funktionFirstParseEventTimestamp = -1; + // Second iteration step to finalize the funktions once the proper + // hierarchy has been set up. + this.funktions.forEach(fn => { + fn.finalize(); + + funktionFirstParseEventTimestamp = this.timestampMin( + funktionFirstParseEventTimestamp, fn.firstParseEventTimestamp); + + this.lastParseEventTimestamp = this.timestampMax( + this.lastParseEventTimestamp, fn.lastParseEventTimestamp); + + this.lastEventTimestamp = + this.timestampMax(this.lastEventTimestamp, fn.lastEventTimestamp); }); this.maxNestingLevel = maxNesting; - this.getFirstEvent(); + + // Initialize sizes. + if (!this.ownBytes === -1) throw 'Invalid state'; + if (this.funktions.length == 0) { + this.bytesTotal = this.ownBytes = 0; + return; + } + let toplevelFunktionBytes = this.funktions.reduce( + (bytes, each) => bytes + (each.isToplevel() ? each.getBytes() : 0), 0); + if (this.isDeserialized || this.isEval || this.isStreamingCompiled) { + if (this.getBytes() === -1) { + this.bytesTotal = toplevelFunktionBytes; + } + } + this.ownBytes = this.bytesTotal - toplevelFunktionBytes; + // Initialize common properties. + super.finalize(); + // Sanity checks after the minimum timestamps have been computed. + if (funktionFirstParseEventTimestamp < this.firstParseEventTimestamp) { + console.error( + 'invalid firstCompileEventTimestamp', this, + funktionFirstParseEventTimestamp, this.firstParseEventTimestamp); + } } print() { @@ -180,22 +312,16 @@ class Script { } getOwnBytes() { - if (this.ownBytes === -1) { - this.ownBytes = this.funktions.reduce( - (bytes, each) => bytes - each.parent == null ? each.getBytes() : 0, - this.getBytes()); - if (this.ownBytes < 0) throw "Own bytes must be positive"; - } return this.ownBytes; } // Also see Funktion.prototype.getMetricBytes getMetricBytes(name) { if (name == 'lazyCompileTimestamp') return this.getOwnBytes(); - return this.getBytes(); + return this.getOwnBytes(); } - getMetricTime(name) { + getMetricDuration(name) { return this[name]; } @@ -235,55 +361,59 @@ class Script { }; log(" - file: " + this.file); + log(' - details: ' + + 'isEval=' + this.isEval + ' deserialized=' + this.isDeserialized + + ' streamed=' + this.isStreamingCompiled); info("scripts", this.getScripts()); info("functions", all); info("toplevel fn", all.filter(each => each.isToplevel())); - info("preparsed", all.filter(each => each.preparseTime > 0)); + info('preparsed', all.filter(each => each.preparseDuration > 0)); - - info("fully parsed", all.filter(each => each.parseTime > 0)); - // info("fn parsed", all.filter(each => each.parse2Time > 0)); - // info("resolved", all.filter(each => each.resolutionTime > 0)); + info('fully parsed', all.filter(each => each.parseDuration > 0)); + // info("fn parsed", all.filter(each => each.parse2Duration > 0)); + // info("resolved", all.filter(each => each.resolutionDuration > 0)); info("executed", all.filter(each => each.executionTimestamp > 0)); - info("forEval", all.filter(each => each.fromEval)); + info('forEval', all.filter(each => each.isEval)); info("lazy compiled", all.filter(each => each.lazyCompileTimestamp > 0)); info("eager compiled", all.filter(each => each.compileTimestamp > 0)); - let parsingCost = new ExecutionCost('parse', all, - each => each.parseTime); + let parsingCost = + new ExecutionCost('parse', all, each => each.parseDuration); parsingCost.setMetrics(this.metrics); - log(parsingCost.toString()) + log(parsingCost.toString()); - let preParsingCost = new ExecutionCost('preparse', all, - each => each.preparseTime); + let preParsingCost = + new ExecutionCost('preparse', all, each => each.preparseDuration); preParsingCost.setMetrics(this.metrics); - log(preParsingCost.toString()) + log(preParsingCost.toString()); - let resolutionCost = new ExecutionCost('resolution', all, - each => each.resolutionTime); + let resolutionCost = + new ExecutionCost('resolution', all, each => each.resolutionDuration); resolutionCost.setMetrics(this.metrics); - log(resolutionCost.toString()) + log(resolutionCost.toString()); let nesting = new NestingDistribution(all); nesting.setMetrics(this.metrics); - log(nesting.toString()) + log(nesting.toString()); if (printSummary) console.log(this.summary); } - getAccumulatedTimeMetrics(metrics, start, end, delta, incremental = false) { + getAccumulatedTimeMetrics( + metrics, start, end, delta, cumulative = true, useDuration = false) { // Returns an array of the following format: - // [ [start, acc(metric0, start, start), acc(metric1, ...), ...], - // [start+delta, acc(metric0, start, start+delta), ...], + // [ [start, acc(metric0, start, start), acc(metric1, ...), ...], + // [start+delta, acc(metric0, start, start+delta), ...], // [start+delta*2, acc(metric0, start, start+delta*2), ...], // ... // ] + if (end <= start) throw 'Invalid ranges [' + start + ',' + end + ']'; const timespan = end - start; const kSteps = Math.ceil(timespan / delta); // To reduce the time spent iterating over the funktions of this script // we iterate once over all funktions and add the metric changes to each // timepoint: - // [ [0, 300, ...], [1, 15, ...], [2, 100, ...], [3, 0, ...] ... ] + // [ [0, 300, ...], [1, 15, ...], [2, 100, ...], [3, 0, ...] ... ] // In a second step we accumulate all values: // [ [0, 300, ...], [1, 315, ...], [2, 415, ...], [3, 415, ...] ... ] // @@ -293,7 +423,7 @@ class Script { const metricProperties = ["time"]; metrics.forEach(each => { metricProperties.push(each + 'Timestamp'); - metricProperties.push(each + 'Time'); + if (useDuration) metricProperties.push(each + 'Duration'); }); // Create a packed {rowTemplate} which is copied later-on. let indexToTime = (t) => (start + t * delta) / kSecondsToMillis; @@ -305,12 +435,15 @@ class Script { // Create the real metric's property name on the Funktion object. // Add the increments of each Funktion's metric to the result. this.forEach(funktionOrScript => { - // Iterate over the Funktion's metric names, position 0 is the time. - for (let i = 1; i < metricProperties.length; i += 2) { - let property = metricProperties[i]; - let timestamp = funktionOrScript[property]; + // Iterate over the Funktion's metric names, skipping position 0 which + // is the time. + const kMetricIncrement = useDuration ? 2 : 1; + for (let i = 1; i < metricProperties.length; i += kMetricIncrement) { + let timestampPropertyName = metricProperties[i]; + let timestamp = funktionOrScript[timestampPropertyName]; if (timestamp === void 0) continue; - if (timestamp < 0 || end < timestamp) continue; + if (timestamp < start || end < timestamp) continue; + timestamp -= start; let index = Math.floor(timestamp / delta); let row = rows[index]; if (row === null) { @@ -320,9 +453,10 @@ class Script { row[0] = indexToTime(index); } // Add the metric value. - row[i] += funktionOrScript.getMetricBytes(property); - let timeMetricName = metricProperties[i + 1]; - row[i + 1] += funktionOrScript.getMetricTime(timeMetricName); + row[i] += funktionOrScript.getMetricBytes(timestampPropertyName); + if (!useDuration) continue; + let durationPropertyName = metricProperties[i + 1]; + row[i + 1] += funktionOrScript.getMetricDuration(durationPropertyName); } }); // Create a packed array again with only the valid entries. @@ -334,14 +468,14 @@ class Script { let current = rows[t]; if (current === null) { // Ensure a zero data-point after each non-zero point. - if (incremental && rows[t - 1] !== null) { + if (!cumulative && rows[t - 1] !== null) { let duplicate = rowTemplate.slice(); duplicate[0] = indexToTime(t); result.push(duplicate); } continue; } - if (!incremental) { + if (cumulative) { // Skip i==0 where the corresponding time value in seconds is. for (let i = 1; i < metricProperties.length; i++) { current[i] += previous[i]; @@ -349,7 +483,7 @@ class Script { } // Make sure we have a data-point in time right before the current one. if (rows[t - 1] === null) { - let duplicate = (incremental ? rowTemplate : previous).slice(); + let duplicate = (!cumulative ? rowTemplate : previous).slice(); duplicate[0] = indexToTime(t - 1); result.push(duplicate); } @@ -374,14 +508,6 @@ class Script { funktion => funktion.didMetricChange(time, delta, metric)); return result; } - - getFirstEvent() { - if (this.firstEvent === -1) { - // TODO(cbruni): add support for network request timestanp - this.firstEvent = this.firstParseEvent; - } - return this.firstEvent; - } } @@ -491,127 +617,67 @@ class ExecutionCost { } // =========================================================================== -const kNoTimeMetrics = { - __proto__: null, - executionTime: 0, - firstEventTimestamp: 0, - firstParseEventTimestamp: 0, - lastParseTimestamp: 0, - lastEventTimestamp: 0 -}; -class Funktion { +class Funktion extends CompilationUnit { constructor(name, start, end, script) { + super(); if (start < 0) throw "invalid start position: " + start; - if (end <= 0) throw "invalid end position: " + end; - if (end <= start) throw "invalid start end positions"; + if (script.isEval) { + if (end < start) throw 'invalid start end positions'; + } else { + if (end <= 0) throw 'invalid end position: ' + end; + if (end <= start) throw 'invalid start end positions'; + } this.name = name; this.start = start; this.end = end; - this.ownBytes = -1; this.script = script; this.parent = null; - this.fromEval = false; this.nested = []; this.nestingLevel = 0; - this.preparseTimestamp = -1; - this.parseTimestamp = -1; - this.parse2Timestamp = -1; - this.resolutionTimestamp = -1; - this.lazyCompileTimestamp = -1; - this.compileTimestamp = -1; - this.executionTimestamp = -1; + if (script) this.script.addFunktion(this); + } + + finalize() { + this.lastParseEventTimestamp = Math.max( + this.preparseTimestamp + this.preparseDuration, + this.parseTimestamp + this.parseDuration, + this.resolutionTimestamp + this.resolutionDuration); + if (!(this.lastParseEventTimestamp > 0)) this.lastParseEventTimestamp = 0; - this.preparseTime = -0.0; - this.parseTime = -0.0; - this.parse2Time = -0.0; - this.resolutionTime = -0.0; - this.scopeResolutionTime = -0.0; - this.lazyCompileTime = -0.0; - this.compileTime = -0.0; + this.lastEventTimestamp = + Math.max(this.lastParseEventTimestamp, this.executionTimestamp); + if (!(this.lastEventTimestamp > 0)) this.lastEventTimestamp = 0; - // Lazily computed properties. - this.firstEventTimestamp = -1; - this.firstParseEventTimestamp = -1; - this.lastParseTimestamp = -1; - this.lastEventTimestamp = -1; + this.ownBytes = this.nested.reduce( + (bytes, each) => bytes - each.getBytes(), this.getBytes()); - if (script) this.script.addFunktion(this); + super.finalize(); } getMetricBytes(name) { if (name == 'lazyCompileTimestamp') return this.getOwnBytes(); - return this.getBytes(); + return this.getOwnBytes(); } - getMetricTime(name) { + getMetricDuration(name) { if (name in kNoTimeMetrics) return 0; return this[name]; } - getFirstEvent() { - if (this.firstEventTimestamp === -1) { - this.firstEventTimestamp = timestampMin( - [this.parseTimestamp, this.preparseTimestamp, - this.resolutionTimestamp, this.executionTimestamp - ]); - if (!(this.firstEventTimestamp > 0)) { - this.firstEventTimestamp = 0; - } - } - return this.firstEventTimestamp; - } - - getFirstParseEvent() { - if (this.firstParseEventTimestamp === -1) { - this.firstParseEventTimestamp = timestampMin( - [this.parseTimestamp, this.preparseTimestamp, - this.resolutionTimestamp - ]); - if (!(this.firstParseEventTimestamp > 0)) { - this.firstParseEventTimestamp = 0; - } - } - return this.firstParseEventTimestamp; - } - - getLastParseEvent() { - if (this.lastParseTimestamp === -1) { - this.lastParseTimestamp = Math.max( - this.preparseTimestamp + this.preparseTime, - this.parseTimestamp + this.parseTime, - this.resolutionTimestamp + this.resolutionTime); - if (!(this.lastParseTimestamp > 0)) { - this.lastParseTimestamp = 0; - } - } - return this.lastParseTimestamp; - } - - getLastEvent() { - if (this.lastEventTimestamp === -1) { - this.lastEventTimestamp = Math.max( - this.getLastParseEvent(), this.executionTimestamp); - if (!(this.lastEventTimestamp > 0)) { - this.lastEventTimestamp = 0; - } - } - return this.lastEventTimestamp; - } - isNestedIn(funktion) { if (this.script != funktion.script) throw "Incompatible script"; return funktion.start < this.start && this.end <= funktion.end; } isToplevel() { - return this.parent === null + return this.parent === null; } - hasBeenExecuted() { - return this.executionTimestamp > 0 + containsPosition(position) { + return this.start <= position && position <= this.end; } accumulateNestingLevel(accumulator) { @@ -641,12 +707,6 @@ class Funktion { } getOwnBytes() { - if (this.ownBytes === -1) { - this.ownBytes = this.nested.reduce( - (bytes, each) => bytes - each.getBytes(), - this.getBytes()); - if (this.ownBytes < 0) throw "Own bytes must be positive"; - } return this.ownBytes; } @@ -661,7 +721,7 @@ class Funktion { toString(details = true) { let result = 'function' + (this.name ? ' ' + this.name : '') + - `() range=${this.start}-${this.end}`; + `() range=${this.start}-${this.end}`; if (details) result += ` script=${this.script ? this.script.id : 'X'}`; return result; } @@ -687,25 +747,60 @@ function startOf(timestamp, time) { class ParseProcessor extends LogReader { constructor() { super(); - let config = (processor) => { - // {script file},{script id},{start position},{end position}, - // {time},{timestamp},{function name} - return { - parsers: [null, parseInt, parseInt, parseInt, parseFloat, parseInt, null], - processor: processor - } - }; - this.dispatchTable_ = { - 'parse-full': config(this.processFull), - 'parse-function': config(this.processFunction), - 'parse-script': config(this.processScript), - 'parse-eval': config(this.processEval), - 'preparse-no-resolution': config(this.processPreparseNoResolution), - 'preparse-resolution': config(this.processPreparseResolution), - 'first-execution': config(this.processFirstExecution), - 'compile-lazy': config(this.processCompileLazy), - 'compile': config(this.processCompile) + // Avoid accidental leaking of __proto__ properties and force this object + // to be in dictionary-mode. + __proto__: null, + // "function",{event type}, + // {script id},{start position},{end position},{time},{timestamp}, + // {function name} + 'function': { + parsers: [ + parseString, parseInt, parseInt, parseInt, parseFloat, parseInt, + parseString + ], + processor: this.processFunctionEvent + }, + // "compilation-cache","hit"|"put",{type},{scriptid},{start position}, + // {end position},{timestamp} + 'compilation-cache': { + parsers: + [parseString, parseString, parseInt, parseInt, parseInt, parseInt], + processor: this.processCompilationCacheEvent + }, + 'script': { + parsers: [parseString, parseInt, parseInt], + processor: this.processScriptEvent + }, + // "script-details", {script_id}, {file}, {line}, {column}, {size} + 'script-details': { + parsers: [parseInt, parseString, parseInt, parseInt, parseInt], + processor: this.processScriptDetails + }, + 'script-source': { + parsers: [parseInt, parseString, parseString], + processor: this.processScriptSource + }, + }; + this.functionEventDispatchTable_ = { + // Avoid accidental leaking of __proto__ properties and force this object + // to be in dictionary-mode. + __proto__: null, + 'full-parse': this.processFull.bind(this), + 'parse-function': this.processParseFunction.bind(this), + // TODO(cbruni): make sure arrow functions emit a normal parse-function + // event. + 'parse': this.processParseFunction.bind(this), + 'parse-script': this.processParseScript.bind(this), + 'parse-eval': this.processParseEval.bind(this), + 'preparse-no-resolution': this.processPreparseNoResolution.bind(this), + 'preparse-resolution': this.processPreparseResolution.bind(this), + 'first-execution': this.processFirstExecution.bind(this), + 'compile-lazy': this.processCompileLazy.bind(this), + 'compile': this.processCompile.bind(this), + 'compile-eval': this.processCompileEval.bind(this), + 'optimize-lazy': this.processOptimizeLazy.bind(this), + 'deserialize': this.processDeserialize.bind(this), }; this.idToScript = new Map(); @@ -713,9 +808,9 @@ class ParseProcessor extends LogReader { this.nameToFunction = new Map(); this.scripts = []; this.totalScript = new TotalScript(); - this.firstEvent = -1; - this.lastParseEvent = -1; - this.lastEvent = -1; + this.firstEventTimestamp = -1; + this.lastParseEventTimestamp = -1; + this.lastEventTimestamp = -1; } print() { @@ -755,152 +850,283 @@ class ParseProcessor extends LogReader { this.scripts = Array.from(this.idToScript.values()) .filter(each => !each.isNative); - this.scripts.forEach(script => script.finalize()); - this.scripts.forEach(script => script.calculateMetrics(false)); - - this.firstEvent = - timestampMin(this.scripts.map(each => each.firstEvent)); - this.lastParseEvent = this.scripts.reduce( - (max, script) => Math.max(max, script.lastParseEvent), -1); - this.lastEvent = this.scripts.reduce( - (max, script) => Math.max(max, script.lastEvent), -1); + this.scripts.forEach(script => { + script.finalize(); + script.calculateMetrics(false) + }); this.scripts.forEach(script => this.totalScript.addAllFunktions(script)); this.totalScript.calculateMetrics(true); - const series = [ - ['firstParseEvent', 'Any Parse Event'], - ['parse', 'Parsing'], - ['preparse', 'Preparsing'], - ['resolution', 'Preparsing with Var. Resolution'], - ['lazyCompile', 'Lazy Compilation'], - ['compile', 'Eager Compilation'], - ['execution', 'First Execution'], - ]; - let metrics = series.map(each => each[0]); - this.totalScript.getAccumulatedTimeMetrics(metrics, 0, this.lastEvent, 10); - }; + + this.firstEventTimestamp = this.totalScript.timestampMin( + this.scripts.map(each => each.firstEventTimestamp)); + this.lastParseEventTimestamp = this.totalScript.timestampMax( + this.scripts.map(each => each.lastParseEventTimestamp)); + this.lastEventTimestamp = this.totalScript.timestampMax( + this.scripts.map(each => each.lastEventTimestamp)); + + const series = { + firstParseEvent: 'Any Parse Event', + parse: 'Parsing', + preparse: 'Preparsing', + resolution: 'Preparsing with Var. Resolution', + lazyCompile: 'Lazy Compilation', + compile: 'Eager Compilation', + execution: 'First Execution', + }; + let metrics = Object.keys(series); + this.totalScript.getAccumulatedTimeMetrics( + metrics, 0, this.lastEventTimestamp, 10); + } + + processFunctionEvent( + eventName, scriptId, startPosition, endPosition, duration, timestamp, + functionName) { + let handlerFn = this.functionEventDispatchTable_[eventName]; + if (handlerFn === undefined) { + console.error('Couldn\'t find handler for function event:' + eventName); + } + handlerFn( + scriptId, startPosition, endPosition, duration, timestamp, + functionName); + } addEntry(entry) { this.entries.push(entry); } - lookupScript(file, id) { - // During preparsing we only have the temporary ranges and no script yet. - let script; - if (this.idToScript.has(id)) { - script = this.idToScript.get(id); - } else { - script = new Script(file, id); - this.idToScript.set(id, script); - } - if (file.length > 0 && script.file.length === 0) { - script.setFile(file); - this.fileToScript.set(file, script); - } - return script; + lookupScript(id) { + return this.idToScript.get(id); } - lookupFunktion(file, scriptId, - startPosition, endPosition, time, timestamp, functionName) { - let script = this.lookupScript(file, scriptId); - let funktion = script.funktionAtPosition(startPosition); + getOrCreateFunction( + scriptId, startPosition, endPosition, duration, timestamp, functionName) { + if (scriptId == -1) { + return this.lookupFunktionByRange(startPosition, endPosition); + } + let script = this.lookupScript(scriptId); + let funktion = script.getFunktionAtStartPosition(startPosition); if (funktion === void 0) { funktion = new Funktion(functionName, startPosition, endPosition, script); } return funktion; } - processEval(file, scriptId, startPosition, - endPosition, time, timestamp, functionName) { - let script = this.lookupScript(file, scriptId); + // Iterates over all functions and tries to find matching ones. + lookupFunktionsByRange(start, end) { + let results = []; + this.idToScript.forEach(script => { + script.forEach(funktion => { + if (funktion.startPostion == start && funktion.endPosition == end) { + results.push(funktion); + } + }); + }); + return results; + } + lookupFunktionByRange(start, end) { + let results = this.lookupFunktionsByRange(start, end); + if (results.length != 1) throw "Could not find unique function by range"; + return results[0]; + } + + processScriptEvent(eventName, scriptId, timestamp) { + let script = this.idToScript.get(scriptId); + switch (eventName) { + case 'create': + case 'reserve-id': + case 'deserialize': { + if (script !== undefined) return; + script = new Script(scriptId); + this.idToScript.set(scriptId, script); + if (eventName == 'deserialize') { + script.deserializationTimestamp = toTimestamp(timestamp); + } + return; + } + case 'background-compile': + if (script.isBackgroundCompiled) { + throw 'Cannot background-compile twice'; + } + script.isBackgroundCompiled = true; + // TODO(cbruni): remove once backwards compatibility is no longer needed. + script.isStreamingCompiled = true; + // TODO(cbruni): fix parse events for background compilation scripts + script.preparseTimestamp = toTimestamp(timestamp); + return; + case 'streaming-compile': + if (script.isStreamingCompiled) throw 'Cannot stream-compile twice'; + // TODO(cbruni): remove once backwards compatibility is no longer needed. + script.isBackgroundCompiled = true; + script.isStreamingCompiled = true; + // TODO(cbruni): fix parse events for background compilation scripts + script.preparseTimestamp = toTimestamp(timestamp); + return; + default: + console.error('Unhandled script event: ' + eventName); + } + } + + processScriptDetails(scriptId, file, startLine, startColumn, size) { + let script = this.lookupScript(scriptId); + script.setFile(file); + } + + processScriptSource(scriptId, url, source) { + let script = this.lookupScript(scriptId); + script.source = source; + } + + processParseEval( + scriptId, startPosition, endPosition, duration, timestamp, functionName) { + if (startPosition != 0 && startPosition != -1) { + console.error('Invalid start position for parse-eval', arguments); + } + let script = this.processParseScript(...arguments); script.isEval = true; } - processFull(file, scriptId, startPosition, - endPosition, time, timestamp, functionName) { - let funktion = this.lookupFunktion(...arguments); + processFull( + scriptId, startPosition, endPosition, duration, timestamp, functionName) { + if (startPosition == 0) { + // This should only happen for eval. + let script = this.lookupScript(scriptId); + script.isEval = true; + return; + } + let funktion = this.getOrCreateFunction(...arguments); // TODO(cbruni): this should never happen, emit differen event from the // parser. if (funktion.parseTimestamp > 0) return; - funktion.parseTimestamp = startOf(timestamp, time); - funktion.parseTime = time; + funktion.parseTimestamp = startOf(timestamp, duration); + funktion.parseDuration = duration; } - processFunction(file, scriptId, startPosition, - endPosition, time, timestamp, functionName) { - let funktion = this.lookupFunktion(...arguments); - funktion.parseTimestamp = startOf(timestamp, time); - funktion.parseTime = time; + processParseFunction( + scriptId, startPosition, endPosition, duration, timestamp, functionName) { + let funktion = this.getOrCreateFunction(...arguments); + funktion.parseTimestamp = startOf(timestamp, duration); + funktion.parseDuration = duration; } - processScript(file, scriptId, startPosition, - endPosition, time, timestamp, functionName) { - // TODO timestamp and time - let script = this.lookupScript(file, scriptId); - let ts = startOf(timestamp, time); + processParseScript( + scriptId, startPosition, endPosition, duration, timestamp, functionName) { + // TODO timestamp and duration + let script = this.lookupScript(scriptId); + let ts = startOf(timestamp, duration); script.parseTimestamp = ts; - script.firstEventTimestamp = ts; - script.firstParseEventTimestamp = ts; - script.parseTime = time; + script.parseDuration = duration; + return script; } - processPreparseResolution(file, scriptId, - startPosition, endPosition, time, timestamp, functionName) { - let funktion = this.lookupFunktion(...arguments); + processPreparseResolution( + scriptId, startPosition, endPosition, duration, timestamp, functionName) { + let funktion = this.getOrCreateFunction(...arguments); // TODO(cbruni): this should never happen, emit different event from the // parser. if (funktion.resolutionTimestamp > 0) return; - funktion.resolutionTimestamp = startOf(timestamp, time); - funktion.resolutionTime = time; + funktion.resolutionTimestamp = startOf(timestamp, duration); + funktion.resolutionDuration = duration; } - processPreparseNoResolution(file, scriptId, - startPosition, endPosition, time, timestamp, functionName) { - let funktion = this.lookupFunktion(...arguments); - funktion.preparseTimestamp = startOf(timestamp, time); - funktion.preparseTime = time; + processPreparseNoResolution( + scriptId, startPosition, endPosition, duration, timestamp, functionName) { + let funktion = this.getOrCreateFunction(...arguments); + funktion.preparseTimestamp = startOf(timestamp, duration); + funktion.preparseDuration = duration; } - processFirstExecution(file, scriptId, - startPosition, endPosition, time, timestamp, functionName) { - let script = this.lookupScript(file, scriptId); + processFirstExecution( + scriptId, startPosition, endPosition, duration, timestamp, functionName) { + let script = this.lookupScript(scriptId); if (startPosition === 0) { // undefined = eval fn execution if (script) { script.executionTimestamp = toTimestamp(timestamp); } } else { - let funktion = script.funktionAtPosition(startPosition); + let funktion = script.getFunktionAtStartPosition(startPosition); if (funktion) { funktion.executionTimestamp = toTimestamp(timestamp); - } else if (functionName.length > 0) { - // throw new Error("Could not find function: " + functionName); + } else { + // TODO(cbruni): handle funktions from compilation-cache hits. } } } - processCompileLazy(file, scriptId, - startPosition, endPosition, time, timestamp, functionName) { - let funktion = this.lookupFunktion(...arguments); - funktion.lazyCompileTimestamp = startOf(timestamp, time); - funktion.lazyCompileTime = time; - script.firstPar + processCompileLazy( + scriptId, startPosition, endPosition, duration, timestamp, functionName) { + let funktion = this.getOrCreateFunction(...arguments); + funktion.lazyCompileTimestamp = startOf(timestamp, duration); + funktion.lazyCompileDuration = duration; } - processCompile(file, scriptId, - startPosition, endPosition, time, timestamp, functionName) { - - let script = this.lookupScript(file, scriptId); + processCompile( + scriptId, startPosition, endPosition, duration, timestamp, functionName) { + let script = this.lookupScript(scriptId); if (startPosition === 0) { - script.compileTimestamp = startOf(timestamp, time); - script.compileTime = time; + script.compileTimestamp = startOf(timestamp, duration); + script.compileDuration = duration; script.bytesTotal = endPosition; + return script; } else { - let funktion = script.funktionAtPosition(startPosition); - funktion.compileTimestamp = startOf(timestamp, time); - funktion.compileTime = time; + let funktion = script.getFunktionAtStartPosition(startPosition); + if (funktion === undefined) { + // This should not happen since any funktion has to be parsed first. + console.error('processCompile funktion not found', ...arguments); + return; + } + funktion.compileTimestamp = startOf(timestamp, duration); + funktion.compileDuration = duration; + return funktion; } } + + processCompileEval( + scriptId, startPosition, endPosition, duration, timestamp, functionName) { + let compilationUnit = this.processCompile(...arguments); + compilationUnit.isEval = true; + } + + processOptimizeLazy( + scriptId, startPosition, endPosition, duration, timestamp, functionName) { + let compilationUnit = this.lookupScript(scriptId); + if (startPosition > 0) { + compilationUnit = + compilationUnit.getFunktionAtStartPosition(startPosition); + if (compilationUnit === undefined) { + // This should not happen since any funktion has to be parsed first. + console.error('processOptimizeLazy funktion not found', ...arguments); + return; + } + } + compilationUnit.optimizationTimestamp = startOf(timestamp, duration); + compilationUnit.optimizationDuration = duration; + } + + processDeserialize( + scriptId, startPosition, endPosition, duration, timestamp, functionName) { + let compilationUnit = this.lookupScript(scriptId); + if (startPosition === 0) { + compilationUnit.bytesTotal = endPosition; + } else { + compilationUnit = this.getOrCreateFunction(...arguments); + } + compilationUnit.deserializationTimestamp = startOf(timestamp, duration); + compilationUnit.deserializationDuration = duration; + } + + processCompilationCacheEvent( + eventType, cacheType, scriptId, startPosition, endPosition, timestamp) { + if (eventType !== 'hit') return; + let compilationUnit = this.lookupScript(scriptId); + if (startPosition > 0) { + compilationUnit = + compilationUnit.getFunktionAtStartPosition(startPosition); + } + compilationUnit.addCompilationCacheHit(toTimestamp(timestamp)); + } + } diff --git a/deps/v8/tools/presubmit.py b/deps/v8/tools/presubmit.py index 40d4630ec71ffb..13b4abd86cf45b 100755 --- a/deps/v8/tools/presubmit.py +++ b/deps/v8/tools/presubmit.py @@ -297,7 +297,7 @@ def CreateRuntimeFunctionCallMatcher(self): m = pattern.match(line) if m: runtime_functions.append(m.group(1)) - if len(runtime_functions) < 500: + if len(runtime_functions) < 450: print ("Runtime functions list is suspiciously short. " "Consider updating the presubmit script.") sys.exit(1) diff --git a/deps/v8/tools/profviz/composer.js b/deps/v8/tools/profviz/composer.js index ce625addca8f3b..411a7248ebd8f9 100644 --- a/deps/v8/tools/profviz/composer.js +++ b/deps/v8/tools/profviz/composer.js @@ -176,7 +176,9 @@ function PlotScriptComposer(kResX, kResY, error_output) { } function MergeRanges(ranges) { - ranges.sort(function(a, b) { return a.start - b.start; }); + ranges.sort(function(a, b) { + return (a.start == b.start) ? a.end - b.end : a.start - b.start; + }); var result = []; var j = 0; for (var i = 0; i < ranges.length; i = j) { @@ -306,13 +308,14 @@ function PlotScriptComposer(kResX, kResY, error_output) { }; // Collect data from log. var logreader = new LogReader( - { 'timer-event-start': { parsers: [null, parseTimeStamp], + { 'timer-event-start': { parsers: [parseString, parseTimeStamp], processor: processTimerEventStart }, - 'timer-event-end': { parsers: [null, parseTimeStamp], + 'timer-event-end': { parsers: [parseString, parseTimeStamp], processor: processTimerEventEnd }, - 'shared-library': { parsers: [null, parseInt, parseInt], + 'shared-library': { parsers: [parseString, parseInt, parseInt], processor: processSharedLibrary }, - 'code-creation': { parsers: [null, parseInt, parseInt, parseInt, null], + 'code-creation': { parsers: [parseString, parseInt, parseInt, + parseInt, parseString], processor: processCodeCreateEvent }, 'code-move': { parsers: [parseInt, parseInt], processor: processCodeMoveEvent }, @@ -322,8 +325,8 @@ function PlotScriptComposer(kResX, kResY, error_output) { processor: processCodeDeoptEvent }, 'current-time': { parsers: [parseTimeStamp], processor: processCurrentTimeEvent }, - 'tick': { parsers: [parseInt, parseTimeStamp, - null, null, parseInt, 'var-args'], + 'tick': { parsers: [parseInt, parseTimeStamp, parseString, + parseString, parseInt, parseVarArgs], processor: processTickEvent } }); @@ -516,8 +519,13 @@ function PlotScriptComposer(kResX, kResY, error_output) { // Label the longest pauses. execution_pauses = RestrictRangesTo(execution_pauses, range_start, range_end); - execution_pauses.sort( - function(a, b) { return b.duration() - a.duration(); }); + execution_pauses.sort(function(a, b) { + if (a.duration() == b.duration() && b.end == a.end) + return b.start - a.start; + + return (a.duration() == b.duration()) + ? b.end - a.end : b.duration() - a.duration(); + }); var max_pause_time = execution_pauses.length > 0 ? execution_pauses[0].duration() : 0; diff --git a/deps/v8/tools/run-tests.py.vpython b/deps/v8/tools/run-tests.py.vpython new file mode 100644 index 00000000000000..6a12277f6b77b8 --- /dev/null +++ b/deps/v8/tools/run-tests.py.vpython @@ -0,0 +1,32 @@ +# This is a vpython "spec" file. +# +# It describes patterns for python wheel dependencies of the python scripts in +# the chromium repo, particularly for dependencies that have compiled components +# (since pure-python dependencies can be easily vendored into third_party). +# +# When vpython is invoked, it finds this file and builds a python VirtualEnv, +# containing all of the dependencies described in this file, fetching them from +# CIPD (the "Chrome Infrastructure Package Deployer" service). Unlike `pip`, +# this never requires the end-user machine to have a working python extension +# compilation environment. All of these packages are built using: +# https://chromium.googlesource.com/infra/infra/+/master/infra/tools/dockerbuild/ +# +# All python scripts in the repo share this same spec, to avoid dependency +# fragmentation. +# +# If you have depot_tools installed in your $PATH, you can invoke python scripts +# in this repo by running them as you normally would run them, except +# substituting `vpython` instead of `python` on the command line, e.g.: +# vpython path/to/script.py some --arguments +# +# Read more about `vpython` and how to modify this file here: +# https://chromium.googlesource.com/infra/infra/+/master/doc/users/vpython.md + +python_version: "2.7" + +# Used by: +# test/test262 +wheel: < + name: "infra/python/wheels/pyyaml/${vpython_platform}" + version: "version:3.12" +> diff --git a/deps/v8/tools/testrunner/base_runner.py b/deps/v8/tools/testrunner/base_runner.py index cfea1527d4af37..d7d2373f2d5df8 100644 --- a/deps/v8/tools/testrunner/base_runner.py +++ b/deps/v8/tools/testrunner/base_runner.py @@ -280,6 +280,8 @@ def _add_parser_default_options(self, parser): " and buildbot builds): %s" % MODES.keys()) parser.add_option("--shell-dir", help="DEPRECATED! Executables from build " "directory will be used") + parser.add_option("--test-root", help="Root directory of the test suites", + default=os.path.join(self.basedir, 'test')) parser.add_option("--total-timeout-sec", default=0, type="int", help="How long should fuzzer run") parser.add_option("--swarming", default=False, action="store_true", @@ -560,12 +562,12 @@ def expand_test_group(name): return reduce(list.__add__, map(expand_test_group, args), []) def _get_suites(self, args, options): - names = self._args_to_suite_names(args) + names = self._args_to_suite_names(args, options.test_root) return self._load_suites(names, options) - def _args_to_suite_names(self, args): + def _args_to_suite_names(self, args, test_root): # Use default tests if no test configuration was provided at the cmd line. - all_names = set(utils.GetSuitePaths(os.path.join(self.basedir, 'test'))) + all_names = set(utils.GetSuitePaths(test_root)) args_names = OrderedDict([(arg.split('/')[0], None) for arg in args]) # set return [name for name in args_names if name in all_names] @@ -578,7 +580,7 @@ def load_suite(name): if options.verbose: print '>>> Loading test suite: %s' % name return testsuite.TestSuite.LoadTestSuite( - os.path.join(self.basedir, 'test', name), + os.path.join(options.test_root, name), test_config) return map(load_suite, names) diff --git a/deps/v8/tools/testrunner/local/variants.py b/deps/v8/tools/testrunner/local/variants.py index f7669c39b941f8..80710ff05521e4 100644 --- a/deps/v8/tools/testrunner/local/variants.py +++ b/deps/v8/tools/testrunner/local/variants.py @@ -10,7 +10,7 @@ "gc_stats": [["--gc_stats=1"]], # Alias of exhaustive variants, but triggering new test framework features. "infra_staging": [[]], - "liftoff": [["--liftoff"]], + "no_liftoff": [["--no-wasm-tier-up"]], "minor_mc": [["--minor-mc"]], # No optimization means disable all optimizations. OptimizeFunctionOnNextCall # would not force optimization too. It turns into a Nop. Please see diff --git a/deps/v8/tools/testrunner/objects/testcase.py b/deps/v8/tools/testrunner/objects/testcase.py index 775ddfeb07b809..39d4fbd2a77f55 100644 --- a/deps/v8/tools/testrunner/objects/testcase.py +++ b/deps/v8/tools/testrunner/objects/testcase.py @@ -153,9 +153,10 @@ def _get_cmd_params(self): - random seed - extra flags (from command line) - user flags (variant/fuzzer flags) - - statusfile flags - mode flags (based on chosen mode) - source flags (from source code) [empty by default] + - test-suite flags + - statusfile flags The best way to modify how parameters are created is to only override methods for getting partial parameters. @@ -165,10 +166,10 @@ def _get_cmd_params(self): self._get_random_seed_flags() + self._get_extra_flags() + self._get_variant_flags() + - self._get_statusfile_flags() + self._get_mode_flags() + self._get_source_flags() + - self._get_suite_flags() + self._get_suite_flags() + + self._get_statusfile_flags() ) def _get_cmd_env(self): diff --git a/deps/v8/tools/testrunner/standard_runner.py b/deps/v8/tools/testrunner/standard_runner.py index 6957ad5205e3b8..bd5df9b4823f88 100755 --- a/deps/v8/tools/testrunner/standard_runner.py +++ b/deps/v8/tools/testrunner/standard_runner.py @@ -43,7 +43,7 @@ # Shortcut for the two above ("more" first - it has the longer running tests). "exhaustive": MORE_VARIANTS + VARIANTS, # Additional variants, run on a subset of bots. - "extra": ["future", "liftoff", "no_wasm_traps", "trusted"], + "extra": ["future", "no_liftoff", "no_wasm_traps", "trusted"], } GC_STRESS_FLAGS = ["--gc-interval=500", "--stress-compaction", diff --git a/deps/v8/tools/tickprocessor.js b/deps/v8/tools/tickprocessor.js index 057d32865978ea..b5efa3f69c1131 100644 --- a/deps/v8/tools/tickprocessor.js +++ b/deps/v8/tools/tickprocessor.js @@ -102,42 +102,43 @@ function TickProcessor( preprocessJson) { this.preprocessJson = preprocessJson; LogReader.call(this, { - 'shared-library': { parsers: [null, parseInt, parseInt, parseInt], + 'shared-library': { parsers: [parseString, parseInt, parseInt, parseInt], processor: this.processSharedLibrary }, 'code-creation': { - parsers: [null, parseInt, parseInt, parseInt, parseInt, - null, 'var-args'], + parsers: [parseString, parseInt, parseInt, parseInt, parseInt, + parseString, parseVarArgs], processor: this.processCodeCreation }, 'code-deopt': { parsers: [parseInt, parseInt, parseInt, parseInt, parseInt, - null, null, null], + parseString, parseString, parseString], processor: this.processCodeDeopt }, 'code-move': { parsers: [parseInt, parseInt, ], processor: this.processCodeMove }, 'code-delete': { parsers: [parseInt], processor: this.processCodeDelete }, 'code-source-info': { - parsers: [parseInt, parseInt, parseInt, parseInt, null, null, null], + parsers: [parseInt, parseInt, parseInt, parseInt, parseString, + parseString, parseString], processor: this.processCodeSourceInfo }, - 'script': { - parsers: [parseInt, null, null], - processor: this.processCodeScript }, + 'script-source': { + parsers: [parseInt, parseString, parseString], + processor: this.processScriptSource }, 'sfi-move': { parsers: [parseInt, parseInt], processor: this.processFunctionMove }, 'active-runtime-timer': { - parsers: [null], + parsers: [parseString], processor: this.processRuntimeTimerEvent }, 'tick': { parsers: [parseInt, parseInt, parseInt, - parseInt, parseInt, 'var-args'], + parseInt, parseInt, parseVarArgs], processor: this.processTick }, - 'heap-sample-begin': { parsers: [null, null, parseInt], + 'heap-sample-begin': { parsers: [parseString, parseString, parseInt], processor: this.processHeapSampleBegin }, - 'heap-sample-end': { parsers: [null, null], + 'heap-sample-end': { parsers: [parseString, parseString], processor: this.processHeapSampleEnd }, - 'timer-event-start' : { parsers: [null, null, null], + 'timer-event-start' : { parsers: [parseString, parseString, parseString], processor: this.advanceDistortion }, - 'timer-event-end' : { parsers: [null, null, null], + 'timer-event-end' : { parsers: [parseString, parseString, parseString], processor: this.advanceDistortion }, // Ignored events. 'profiler': null, @@ -332,7 +333,7 @@ TickProcessor.prototype.processCodeSourceInfo = function( endPos, sourcePositions, inliningPositions, inlinedFunctions); }; -TickProcessor.prototype.processCodeScript = function(script, url, source) { +TickProcessor.prototype.processScriptSource = function(script, url, source) { this.profile_.addScriptSource(script, url, source); }; diff --git a/deps/v8/tools/format-torque.py b/deps/v8/tools/torque/format-torque.py similarity index 100% rename from deps/v8/tools/format-torque.py rename to deps/v8/tools/torque/format-torque.py diff --git a/deps/v8/tools/make-torque-parser.py b/deps/v8/tools/torque/make-torque-parser.py similarity index 95% rename from deps/v8/tools/make-torque-parser.py rename to deps/v8/tools/torque/make-torque-parser.py index 43ed7840cc3c5d..8151d151e1d6e1 100755 --- a/deps/v8/tools/make-torque-parser.py +++ b/deps/v8/tools/torque/make-torque-parser.py @@ -14,7 +14,7 @@ cwd = os.getcwd() tools = ntpath.dirname(sys.argv[0]); -grammar = tools + '/../src/torque/Torque.g4' +grammar = tools + '/../../src/torque/Torque.g4' basename = ntpath.basename(grammar) dirname = ntpath.dirname(grammar) os.chdir(dirname) @@ -31,7 +31,7 @@ def fix_file(filename): copyright = '// Copyright 2018 the V8 project authors. All rights reserved.\n' copyright += '// Use of this source code is governed by a BSD-style license that can be\n' copyright += '// found in the LICENSE file.\n' - file_path = tools + '/../src/torque/' + filename; + file_path = tools + '/../../src/torque/' + filename; temp_file_path = file_path + '.tmp' output_file = open(temp_file_path, 'w') output_file.write(copyright); diff --git a/deps/v8/tools/torque/vscode-torque/README.md b/deps/v8/tools/torque/vscode-torque/README.md new file mode 100644 index 00000000000000..1d01daa3b9cbb0 --- /dev/null +++ b/deps/v8/tools/torque/vscode-torque/README.md @@ -0,0 +1,14 @@ +# Torque syntax support + +This extensions adds rudimentary syntax highlighting support for the WIP +Torque language used in V8. + +## Installation + +Since the extension is not published to the marketplace, the easiest way to +install the extension is to symlink the extension to your local extension +directory: + +``` +ln -s $V8/tools/torque/vscode-torque $HOME/.vscode/extensions/vscode-torque +``` \ No newline at end of file diff --git a/deps/v8/tools/torque/vscode-torque/language-configuration.json b/deps/v8/tools/torque/vscode-torque/language-configuration.json new file mode 100644 index 00000000000000..d43e282cc7d8b6 --- /dev/null +++ b/deps/v8/tools/torque/vscode-torque/language-configuration.json @@ -0,0 +1,25 @@ +{ + "comments": { + "lineComment": "//", + "blockComment": [ "/*", "*/" ] + }, + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ], + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +} \ No newline at end of file diff --git a/deps/v8/tools/torque/vscode-torque/package.json b/deps/v8/tools/torque/vscode-torque/package.json new file mode 100644 index 00000000000000..ac79161ae33fda --- /dev/null +++ b/deps/v8/tools/torque/vscode-torque/package.json @@ -0,0 +1,26 @@ +{ + "name": "vscode-torque", + "displayName": "Torque syntax support", + "description": "Basic Torque syntax highlighting support", + "version": "0.0.1", + "publisher": "szuend", + "engines": { + "vscode": "^1.22.0" + }, + "categories": [ + "Languages" + ], + "contributes": { + "languages": [{ + "id": "torque", + "aliases": ["Torque", "torque"], + "extensions": [".tq"], + "configuration": "./language-configuration.json" + }], + "grammars": [{ + "language": "torque", + "scopeName": "source.torque", + "path": "./syntaxes/torque.tmLanguage.json" + }] + } +} \ No newline at end of file diff --git a/deps/v8/tools/torque/vscode-torque/syntaxes/torque.tmLanguage.json b/deps/v8/tools/torque/vscode-torque/syntaxes/torque.tmLanguage.json new file mode 100644 index 00000000000000..ece8527c2de4a7 --- /dev/null +++ b/deps/v8/tools/torque/vscode-torque/syntaxes/torque.tmLanguage.json @@ -0,0 +1,88 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "Torque", + "patterns": [ + { + "include": "#keywords" + }, + { + "include": "#strings" + }, + { + "name": "comment.line.double-slash.torque", + "begin": "//", + "end": "$" + }, + { + "name": "comment.block.torque", + "begin": "/\\*", + "end": "\\*/" + }, + { + "name": "string.quoted.single.torque", + "begin": "'", + "end": "'", + "patterns": [ + { + "name": "constant.character.escape.torque", + "match": "\\\\." + }] + }, + { + "name": "support.function.torque", + "match": "\\b(min|max|assert|check|debug|unreachable)\\b" + }, + { + "name": "support.variable.torque", + "match": "\\b(true|True|false|False|Undefined|Hole|Null)\\b" + }, + { + "begin": "<(?=[A-Za-z][0-9A-Za-z_]*>)", + "end": ">", + "patterns": [ + { + "name": "support.type.torque", + "match": "([A-Za-z][0-9A-Za-z_]*)" + } + ] + }, + { + "begin": ":(\\s*)?", + "end": "(?=[^0-9A-Za-z_])", + "patterns": [ + { + "name": "support.type.torque", + "match": "([A-Za-z][0-9A-Za-z_]*)" + } + ] + } + ], + "repository": { + "keywords": { + "patterns": [{ + "name": "keyword.control.torque", + "match": "\\b(if|else|while|for|return|continue|break|goto|otherwise|try|catch)\\b" + }, + { + "name": "keyword.other.torque", + "match": "\\b(constexpr|module|macro|builtin|runtime|javascript|implicit|deferred|cast|convert|label|labels|tail|isnt|is|let|generates|type|extends|extern|const)\\b" + }, + { + "name": "keyword.operator.torque", + "match": "\\b(=|\\*=)\\b" + }] + }, + "strings": { + "name": "string.quoted.double.torque", + "begin": "\"", + "end": "\"", + "patterns": [ + { + "name": "constant.character.escape.torque", + "match": "\\\\." + } + ] + } + }, + "scopeName": "source.torque" +} \ No newline at end of file diff --git a/deps/v8/tools/turbolizer/README.md b/deps/v8/tools/turbolizer/README.md index d4010d83888cfc..01d5099c3e9aad 100644 --- a/deps/v8/tools/turbolizer/README.md +++ b/deps/v8/tools/turbolizer/README.md @@ -8,8 +8,13 @@ source code, Turbofan IR graphs, scheduled IR nodes and generated assembly code. Turbolizer consumes .json files that are generated per-function by d8 by passing the '--trace-turbo' command-line flag. -Host the turbolizer locally by starting a web server that serves the contents of -the turbolizer directory, e.g.: +Turbolizer is build using npm: + + npm i + npm run-script build + +Afterwards, turbolizer can be hosted locally by starting a web server that serve +the contents of the turbolizer directory, e.g.: cd src/tools/turbolizer python -m SimpleHTTPServer 8000 @@ -60,3 +65,11 @@ script command must be piped to a file for uploading to turbolizer. There are many options that can be added to the first command, for example '-e' can be used to specify the counting of specific events (default: cycles), as well as '--cpu' to specify which CPU to sample. + +Turbolizer build process +------------------------ + +Turbolizer is currently migrating to TypeScript. The typescript sources reside in +tools/turbolizer/src, and the typescript compiler will put the JavaScript output +into tools/turbolizer/build/. The index.html file is set up to load the JavaScript +from that directory. diff --git a/deps/v8/tools/turbolizer/constants.js b/deps/v8/tools/turbolizer/constants.js deleted file mode 100644 index 7e9045ef226c45..00000000000000 --- a/deps/v8/tools/turbolizer/constants.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2014 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. - -var MAX_RANK_SENTINEL = 0; -var GRAPH_MARGIN = 250; -var WIDTH = 'width'; -var HEIGHT = 'height'; -var VISIBILITY = 'visibility'; -var SOURCE_PANE_ID = 'left'; -var SOURCE_COLLAPSE_ID = 'source-shrink'; -var SOURCE_EXPAND_ID = 'source-expand'; -var INTERMEDIATE_PANE_ID = 'middle'; -var GRAPH_PANE_ID = 'graph'; -var SCHEDULE_PANE_ID = 'schedule'; -var GENERATED_PANE_ID = 'right'; -var DISASSEMBLY_PANE_ID = 'disassembly'; -var DISASSEMBLY_COLLAPSE_ID = 'disassembly-shrink'; -var DISASSEMBLY_EXPAND_ID = 'disassembly-expand'; -var COLLAPSE_PANE_BUTTON_VISIBLE = 'button-input'; -var COLLAPSE_PANE_BUTTON_INVISIBLE = 'button-input-invisible'; -var UNICODE_BLOCK = '▋'; -var PROF_COLS = [ - { perc: 0, col: { r: 255, g: 255, b: 255 } }, - { perc: 0.5, col: { r: 255, g: 255, b: 128 } }, - { perc: 5, col: { r: 255, g: 128, b: 0 } }, - { perc: 15, col: { r: 255, g: 0, b: 0 } }, - { perc: 100, col: { r: 0, g: 0, b: 0 } } -]; diff --git a/deps/v8/tools/turbolizer/deploy.sh b/deps/v8/tools/turbolizer/deploy.sh new file mode 100755 index 00000000000000..db76dca490899a --- /dev/null +++ b/deps/v8/tools/turbolizer/deploy.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +DEST=$1 + +if [ ! -d "$DEST" ]; then + echo -e "Destination \"$DEST\" is not a directory. Run\n\tnpm deploy -- [destination-directory]" + exit 1 +fi + +echo "Deploying..." + +cp *.jpg $DEST/ +cp *.png $DEST/ +cp *.css $DEST/ +cp index.html $DEST/ +cp -R build $DEST/ + +echo "Deployed to $DEST/." diff --git a/deps/v8/tools/turbolizer/edge.js b/deps/v8/tools/turbolizer/edge.js deleted file mode 100644 index c0f63a0204ffc0..00000000000000 --- a/deps/v8/tools/turbolizer/edge.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2014 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. - -var MINIMUM_EDGE_SEPARATION = 20; - -function isEdgeInitiallyVisible(target, index, source, type) { - return type == "control" && (target.cfg || source.cfg); -} - -var Edge = function(target, index, source, type) { - this.target = target; - this.source = source; - this.index = index; - this.type = type; - this.backEdgeNumber = 0; - this.visible = isEdgeInitiallyVisible(target, index, source, type); -}; - -Edge.prototype.stringID = function() { - return this.source.id + "," + this.index + "," + this.target.id; -}; - -Edge.prototype.isVisible = function() { - return this.visible && this.source.visible && this.target.visible; -}; - -Edge.prototype.getInputHorizontalPosition = function(graph) { - if (this.backEdgeNumber > 0) { - return graph.maxGraphNodeX + this.backEdgeNumber * MINIMUM_EDGE_SEPARATION; - } - var source = this.source; - var target = this.target; - var index = this.index; - var input_x = target.x + target.getInputX(index); - var inputApproach = target.getInputApproach(this.index); - var outputApproach = source.getOutputApproach(graph); - if (inputApproach > outputApproach) { - return input_x; - } else { - var inputOffset = MINIMUM_EDGE_SEPARATION * (index + 1); - return (target.x < source.x) - ? (target.x + target.getTotalNodeWidth() + inputOffset) - : (target.x - inputOffset) - } -} - -Edge.prototype.generatePath = function(graph) { - var target = this.target; - var source = this.source; - var input_x = target.x + target.getInputX(this.index); - var arrowheadHeight = 7; - var input_y = target.y - 2 * DEFAULT_NODE_BUBBLE_RADIUS - arrowheadHeight; - var output_x = source.x + source.getOutputX(); - var output_y = source.y + graph.getNodeHeight(source) + DEFAULT_NODE_BUBBLE_RADIUS; - var inputApproach = target.getInputApproach(this.index); - var outputApproach = source.getOutputApproach(graph); - var horizontalPos = this.getInputHorizontalPosition(graph); - - var result = "M" + output_x + "," + output_y + - "L" + output_x + "," + outputApproach + - "L" + horizontalPos + "," + outputApproach; - - if (horizontalPos != input_x) { - result += "L" + horizontalPos + "," + inputApproach; - } else { - if (inputApproach < outputApproach) { - inputApproach = outputApproach; - } - } - - result += "L" + input_x + "," + inputApproach + - "L" + input_x + "," + input_y; - return result; -} - -Edge.prototype.isBackEdge = function() { - return this.target.hasBackEdges() && (this.target.rank < this.source.rank); -} diff --git a/deps/v8/tools/turbolizer/index.html b/deps/v8/tools/turbolizer/index.html index a37fdda491f99c..ea89a61261d874 100644 --- a/deps/v8/tools/turbolizer/index.html +++ b/deps/v8/tools/turbolizer/index.html @@ -58,23 +58,6 @@ src="right-arrow.png" class="button-input"> - - - - - - - - - - - - - - - - - - + diff --git a/deps/v8/tools/turbolizer/lang-disassembly.js b/deps/v8/tools/turbolizer/lang-disassembly.js deleted file mode 100644 index 590f9fd804f6a8..00000000000000 --- a/deps/v8/tools/turbolizer/lang-disassembly.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2015 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. - -PR.registerLangHandler( - PR.createSimpleLexer( - [ - [PR.PR_STRING, /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$))/, null, '\''], - [PR.PR_PLAIN, /^\s+/, null, ' \r\n\t\xA0'] - ], - [ // fallthroughStylePatterns - [PR.PR_COMMENT, /;; debug: position \d+/, null], - ]), - ['disassembly']); diff --git a/deps/v8/tools/turbolizer/monkey.js b/deps/v8/tools/turbolizer/monkey.js deleted file mode 100644 index 29eaaebb36ee5d..00000000000000 --- a/deps/v8/tools/turbolizer/monkey.js +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2014 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. - -Math.alignUp = function(raw, multiple) { - return Math.floor((raw + multiple - 1) / multiple) * multiple; -} diff --git a/deps/v8/tools/turbolizer/package-lock.json b/deps/v8/tools/turbolizer/package-lock.json new file mode 100644 index 00000000000000..fc9557f76df95d --- /dev/null +++ b/deps/v8/tools/turbolizer/package-lock.json @@ -0,0 +1,1005 @@ +{ + "name": "turbolizer", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/commander": { + "version": "2.12.2", + "resolved": "https://registry.npmjs.org/@types/commander/-/commander-2.12.2.tgz", + "integrity": "sha512-0QEFiR8ljcHp9bAbWxecjVRuAMr16ivPiGOw6KFQBVrVd0RQIcM3xKdRisH2EDWgVWujiYtHwhSkSUoAAGzH7Q==", + "dev": true, + "requires": { + "commander": "*" + } + }, + "@types/d3": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/d3/-/d3-5.0.0.tgz", + "integrity": "sha512-BVfPw7ha+UgsG24v6ymerMY4+pJgQ/6p+hJA4loCeaaqV9snGS/G6ReVaQEn8Himn67dWn/Je9WhRbnDO7MzLw==", + "requires": { + "@types/d3-array": "*", + "@types/d3-axis": "*", + "@types/d3-brush": "*", + "@types/d3-chord": "*", + "@types/d3-collection": "*", + "@types/d3-color": "*", + "@types/d3-contour": "*", + "@types/d3-dispatch": "*", + "@types/d3-drag": "*", + "@types/d3-dsv": "*", + "@types/d3-ease": "*", + "@types/d3-fetch": "*", + "@types/d3-force": "*", + "@types/d3-format": "*", + "@types/d3-geo": "*", + "@types/d3-hierarchy": "*", + "@types/d3-interpolate": "*", + "@types/d3-path": "*", + "@types/d3-polygon": "*", + "@types/d3-quadtree": "*", + "@types/d3-random": "*", + "@types/d3-scale": "*", + "@types/d3-scale-chromatic": "*", + "@types/d3-selection": "*", + "@types/d3-shape": "*", + "@types/d3-time": "*", + "@types/d3-time-format": "*", + "@types/d3-timer": "*", + "@types/d3-transition": "*", + "@types/d3-voronoi": "*", + "@types/d3-zoom": "*" + } + }, + "@types/d3-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-1.2.1.tgz", + "integrity": "sha512-YBaAfimGdWE4nDuoGVKsH89/dkz2hWZ0i8qC+xxqmqi+XJ/aXiRF0jPtzXmN7VdkpVjy1xuDmM5/m1FNuB6VWA==" + }, + "@types/d3-axis": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@types/d3-axis/-/d3-axis-1.0.10.tgz", + "integrity": "sha512-5YF0wfdQMPKw01VAAupLIlg/T4pn5M3/vL9u0KZjiemnVnnKBEWE24na4X1iW+TfZiYJ8j+BgK2KFYnAAT54Ug==", + "requires": { + "@types/d3-selection": "*" + } + }, + "@types/d3-brush": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/d3-brush/-/d3-brush-1.0.8.tgz", + "integrity": "sha512-9Thv09jvolu9T1BE3fHmIeYSgbwSpdxtF6/A5HZEDjSTfgtA0mtaXRk5AiWOo0KjuLsI+/7ggD3ZGN5Ye8KXPQ==", + "requires": { + "@types/d3-selection": "*" + } + }, + "@types/d3-chord": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-chord/-/d3-chord-1.0.7.tgz", + "integrity": "sha512-WbCN7SxhZMpQQw46oSjAovAmvl3IdjhLuQ4r7AXCzNKyxtXXBWuihSPZ4bVwFQF3+S2z37i9d4hfUBatcSJpog==" + }, + "@types/d3-collection": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-collection/-/d3-collection-1.0.7.tgz", + "integrity": "sha512-vR3BT0GwHc5y93Jv6bxn3zoxP/vGu+GdXu/r1ApjbP9dLk9I2g6NiV7iP/QMQSuFZd0It0n/qWrfXHxCWwHIkg==" + }, + "@types/d3-color": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-1.2.1.tgz", + "integrity": "sha512-xwb1tqvYNWllbHuhMFhiXk63Imf+QNq/dJdmbXmr2wQVnwGenCuj3/0IWJ9hdIFQIqzvhT7T37cvx93jtAsDbQ==" + }, + "@types/d3-contour": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/d3-contour/-/d3-contour-1.2.1.tgz", + "integrity": "sha512-p8iC4KeVFyT3qRTGQRj0Jf5QDdPsDUevBEnma7gEsY1yDolVSLanG2eFAiLV+xj8/5DK7oU7Ey8z0drs3pbsug==", + "requires": { + "@types/d3-array": "*", + "@types/geojson": "*" + } + }, + "@types/d3-dispatch": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-dispatch/-/d3-dispatch-1.0.6.tgz", + "integrity": "sha512-xyWJQMr832vqhu6fD/YqX+MSFBWnkxasNhcStvlhqygXxj0cKqPft0wuGoH5TIq5ADXgP83qeNVa4R7bEYN3uA==" + }, + "@types/d3-drag": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/d3-drag/-/d3-drag-1.2.1.tgz", + "integrity": "sha512-J9liJ4NNeV0oN40MzPiqwWjqNi3YHCRtHNfNMZ1d3uL9yh1+vDuo346LBEr8yyBm30WHvrHssAkExVZrGCswtA==", + "requires": { + "@types/d3-selection": "*" + } + }, + "@types/d3-dsv": { + "version": "1.0.33", + "resolved": "https://registry.npmjs.org/@types/d3-dsv/-/d3-dsv-1.0.33.tgz", + "integrity": "sha512-jx5YvaVC3Wfh6LobaiWTeU1NkvL2wPmmpmajk618bD+xVz98yNWzmZMvmlPHGK0HXbMeHmW/6oVX48V9AH1bRQ==" + }, + "@types/d3-ease": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-1.0.7.tgz", + "integrity": "sha1-k6MBhovp4VBh89RDQ7GrP4rLbwk=" + }, + "@types/d3-fetch": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@types/d3-fetch/-/d3-fetch-1.1.2.tgz", + "integrity": "sha512-w6ANZv/mUh+6IV3drT22zgPWMRobzuGXhzOZC8JPD+ygce0/Vx6vTci3m3dizkocnQQCOwNbrWWWPYqpWiKzRQ==", + "requires": { + "@types/d3-dsv": "*" + } + }, + "@types/d3-force": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-1.1.1.tgz", + "integrity": "sha512-ePkELuaFWY4yOuf+Bvx5Xd+ihFiYG4bdnW0BlvigovIm8Sob2t76e9RGO6lybQbv6AlW9Icn9HuZ9fmdzEoJyg==" + }, + "@types/d3-format": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@types/d3-format/-/d3-format-1.3.0.tgz", + "integrity": "sha512-ZiY4j3iJvAdOwzwW24WjlZbUNvqOsnPAMfPBmdXqxj3uKJbrzBlRrdGl5uC89pZpFs9Dc92E81KcwG2uEgkIZA==" + }, + "@types/d3-geo": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/@types/d3-geo/-/d3-geo-1.10.3.tgz", + "integrity": "sha512-hfdaxM2L0wA9mDZrrSf2o+DyhEpnJYCiAN+lHFtpfZOVCQrYBA5g33sGRpUbAvjSMyO5jkHbftMWPEhuCMChSg==", + "requires": { + "@types/geojson": "*" + } + }, + "@types/d3-hierarchy": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@types/d3-hierarchy/-/d3-hierarchy-1.1.2.tgz", + "integrity": "sha512-L+Ht4doqlCIH8jYN2AC1mYIOj13OxlRhdWNWXv2pc3o5A9i3YmQ0kz6A7w8c+Ujylfusi/FO+zVlVnQoOHc2Qw==" + }, + "@types/d3-interpolate": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-1.2.0.tgz", + "integrity": "sha512-qM9KlUrqbwIhBRtw9OtAEbkis1AxsOJEun2uxaX/vEsBp3vyNBmhPz9boXXEqic9ZRi7fCpUNRwyZvxa0PioIw==", + "requires": { + "@types/d3-color": "*" + } + }, + "@types/d3-path": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-1.0.7.tgz", + "integrity": "sha512-U8dFRG+8WhkLJr2sxZ9Cw/5WeRgBnNqMxGdA1+Z0+ZG6tK0s75OQ4OXnxeyfKuh6E4wQPY8OAKr1+iNDx01BEQ==" + }, + "@types/d3-polygon": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-polygon/-/d3-polygon-1.0.6.tgz", + "integrity": "sha512-E6Kyodn9JThgLq20nxSbEce9ow5/ePgm9PX2EO6W1INIL4DayM7cFaiG10DStuamjYAd0X4rntW2q+GRjiIktw==" + }, + "@types/d3-quadtree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/d3-quadtree/-/d3-quadtree-1.0.5.tgz", + "integrity": "sha1-HOHmWerkUw3wyxJ/KX8XQaNnqC4=" + }, + "@types/d3-random": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/d3-random/-/d3-random-1.1.1.tgz", + "integrity": "sha512-jUPeBq1XKK9/5XasTvy5QAUwFeMsjma2yt/nP02yC2Tijovx7i/W5776U/HZugxc5SSmtpx4Z3g9KFVon0QrjQ==" + }, + "@types/d3-scale": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-2.0.1.tgz", + "integrity": "sha512-D5ZWv8ToLvqacE7XkdMNHMiiVDULdDxT7FMMGU0YJC3/nVzBmApjyTyxracUWOQyY3KK7YhZ05on8pOcNi0dfQ==", + "requires": { + "@types/d3-time": "*" + } + }, + "@types/d3-scale-chromatic": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-1.2.0.tgz", + "integrity": "sha512-bhS2SVzUzRtrxp1REhGCfHmj8pyDv9oDmsonYiPvBl8KCxPJTxnfXBF39PzAJrYnRKM41TR0kQzsJvL+NmcDtg==" + }, + "@types/d3-selection": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-1.3.1.tgz", + "integrity": "sha512-G+eO+2G1iW3GNrROxhoU+ar+bIJbQq1QkxcfhwjQ19xA20n3T31j5pSJqAOWvPSoFTz4Ets/DQgYhmgT4jepDg==" + }, + "@types/d3-shape": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-1.2.3.tgz", + "integrity": "sha512-iP9TcX0EVi+LlX+jK9ceS+yhEz5abTitF+JaO2ugpRE/J+bccaYLe/0/3LETMmdaEkYarIyboZW8OF67Mpnj1w==", + "requires": { + "@types/d3-path": "*" + } + }, + "@types/d3-time": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-1.0.8.tgz", + "integrity": "sha512-/UCphyyw97YAq4zKsuXH33R3UNB4jDSza0fLvMubWr/ONh9IePi1NbgFP222blhiCe724ebJs8U87+aDuAq/jA==" + }, + "@types/d3-time-format": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/d3-time-format/-/d3-time-format-2.1.0.tgz", + "integrity": "sha512-/myT3I7EwlukNOX2xVdMzb8FRgNzRMpsZddwst9Ld/VFe6LyJyRp0s32l/V9XoUzk+Gqu56F/oGk6507+8BxrA==" + }, + "@types/d3-timer": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-1.0.7.tgz", + "integrity": "sha512-830pT+aYZrgbA91AuynP3KldfB1A1s60d0gKiV+L7JcSKSJapUzUffAm8VZod7RQOxF5SzoItV6cvrTzjbmrJQ==" + }, + "@types/d3-transition": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/d3-transition/-/d3-transition-1.1.1.tgz", + "integrity": "sha512-GHTghl0YYB8gGgbyKxVLHyAp9Na0HqsX2U7M0u0lGw4IdfEaslooykweZ8fDHW13T+KZeZAuzhbmqBZVFO+6kg==", + "requires": { + "@types/d3-selection": "*" + } + }, + "@types/d3-voronoi": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@types/d3-voronoi/-/d3-voronoi-1.1.7.tgz", + "integrity": "sha512-/dHFLK5jhXTb/W4XEQcFydVk8qlIAo85G3r7+N2fkBFw190l0R1GQ8C1VPeXBb2GfSU5GbT2hjlnE7i7UY5Gvg==" + }, + "@types/d3-zoom": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@types/d3-zoom/-/d3-zoom-1.7.1.tgz", + "integrity": "sha512-Ofjwz6Pt53tRef9TAwwayN+JThNVYC/vFOepa/H4KtwjhsqkmEseHvc2jpJM7vye5PQ5XHtTSOpdY4Y/6xZWEg==", + "requires": { + "@types/d3-interpolate": "*", + "@types/d3-selection": "*" + } + }, + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" + }, + "@types/geojson": { + "version": "7946.0.3", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.3.tgz", + "integrity": "sha512-BYHiG1vQJ7T93uswzuXZ0OBPWqj5tsAPtaMDQADV8sn2InllXarwg9llr6uaW22q1QCwBZ81gVajOpYWzjesug==" + }, + "@types/node": { + "version": "10.5.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.2.tgz", + "integrity": "sha512-m9zXmifkZsMHZBOyxZWilMwmTlpC8x5Ty360JKTiXvlXZfBWYpsg9ZZvP/Ye+iZUh+Q+MxDLjItVTWIsfwz+8Q==" + }, + "@types/semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ==", + "dev": true + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "builtin-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-2.0.0.tgz", + "integrity": "sha512-3U5kUA5VPsRUA3nofm/BXX7GVHKfxz0hOBAPxXrIvHzlDRkQVqEn6yi8QJegxl4LzOHLdvb7XF5dVawa/VVYBg==" + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==" + }, + "commandpost": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/commandpost/-/commandpost-1.3.0.tgz", + "integrity": "sha512-T62tyrmYTkaRDbV2z1k2yXTyxk0cFptXYwo1cUbnfHtp7ThLgQ9/90jG1Ym5WLZgFhvOTaHA5VSARWJ9URpLDw==", + "dev": true + }, + "d3": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/d3/-/d3-5.5.0.tgz", + "integrity": "sha512-HRDSYvT3n7kMvJH7Avp7iR0Xsz97bkCFka9aOg04EdyXyiAP8yQzUpLH3712y9R7ffVo1g94t1OYFHBB0yI9vQ==", + "requires": { + "d3-array": "1", + "d3-axis": "1", + "d3-brush": "1", + "d3-chord": "1", + "d3-collection": "1", + "d3-color": "1", + "d3-contour": "1", + "d3-dispatch": "1", + "d3-drag": "1", + "d3-dsv": "1", + "d3-ease": "1", + "d3-fetch": "1", + "d3-force": "1", + "d3-format": "1", + "d3-geo": "1", + "d3-hierarchy": "1", + "d3-interpolate": "1", + "d3-path": "1", + "d3-polygon": "1", + "d3-quadtree": "1", + "d3-random": "1", + "d3-scale": "2", + "d3-scale-chromatic": "1", + "d3-selection": "1", + "d3-shape": "1", + "d3-time": "1", + "d3-time-format": "2", + "d3-timer": "1", + "d3-transition": "1", + "d3-voronoi": "1", + "d3-zoom": "1" + } + }, + "d3-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.1.tgz", + "integrity": "sha512-CyINJQ0SOUHojDdFDH4JEM0552vCR1utGyLHegJHyYH0JyCpSeTPxi4OBqHMA2jJZq4NH782LtaJWBImqI/HBw==" + }, + "d3-axis": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-1.0.8.tgz", + "integrity": "sha1-MacFoLU15ldZ3hQXOjGTMTfxjvo=" + }, + "d3-brush": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-1.0.4.tgz", + "integrity": "sha1-AMLyOAGfJPbAoZSibUGhUw/+e8Q=", + "requires": { + "d3-dispatch": "1", + "d3-drag": "1", + "d3-interpolate": "1", + "d3-selection": "1", + "d3-transition": "1" + } + }, + "d3-chord": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-1.0.4.tgz", + "integrity": "sha1-fexPC6iG9xP+ERxF92NBT290yiw=", + "requires": { + "d3-array": "1", + "d3-path": "1" + } + }, + "d3-collection": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/d3-collection/-/d3-collection-1.0.4.tgz", + "integrity": "sha1-NC39EoN8kJdPM/HMCnha6lcNzcI=" + }, + "d3-color": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.2.0.tgz", + "integrity": "sha512-dmL9Zr/v39aSSMnLOTd58in2RbregCg4UtGyUArvEKTTN6S3HKEy+ziBWVYo9PTzRyVW+pUBHUtRKz0HYX+SQg==" + }, + "d3-contour": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-1.3.0.tgz", + "integrity": "sha512-6zccxidQRtcydx0lWqHawdW1UcBzKZTxv0cW90Dlx98pY/L7GjQJmftH1tWopYFDaLCoXU0ECg9x/z2EuFT8tg==", + "requires": { + "d3-array": "^1.1.1" + } + }, + "d3-dispatch": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.3.tgz", + "integrity": "sha1-RuFJHqqbWMNY/OW+TovtYm54cfg=" + }, + "d3-drag": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-1.2.1.tgz", + "integrity": "sha512-Cg8/K2rTtzxzrb0fmnYOUeZHvwa4PHzwXOLZZPwtEs2SKLLKLXeYwZKBB+DlOxUvFmarOnmt//cU4+3US2lyyQ==", + "requires": { + "d3-dispatch": "1", + "d3-selection": "1" + } + }, + "d3-dsv": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-1.0.8.tgz", + "integrity": "sha512-IVCJpQ+YGe3qu6odkPQI0KPqfxkhbP/oM1XhhE/DFiYmcXKfCRub4KXyiuehV1d4drjWVXHUWx4gHqhdZb6n/A==", + "requires": { + "commander": "2", + "iconv-lite": "0.4", + "rw": "1" + } + }, + "d3-ease": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.3.tgz", + "integrity": "sha1-aL+8NJM4o4DETYrMT7wzBKotjA4=" + }, + "d3-fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-1.1.0.tgz", + "integrity": "sha512-j+V4vtT6dceQbcKYLtpTueB8Zvc+wb9I93WaFtEQIYNADXl0c1ZJMN3qQo0CssiTsAqK8pePwc7f4qiW+b0WOg==", + "requires": { + "d3-dsv": "1" + } + }, + "d3-force": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-1.1.0.tgz", + "integrity": "sha512-2HVQz3/VCQs0QeRNZTYb7GxoUCeb6bOzMp/cGcLa87awY9ZsPvXOGeZm0iaGBjXic6I1ysKwMn+g+5jSAdzwcg==", + "requires": { + "d3-collection": "1", + "d3-dispatch": "1", + "d3-quadtree": "1", + "d3-timer": "1" + } + }, + "d3-format": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.3.0.tgz", + "integrity": "sha512-ycfLEIzHVZC3rOvuBOKVyQXSiUyCDjeAPIj9n/wugrr+s5AcTQC2Bz6aKkubG7rQaQF0SGW/OV4UEJB9nfioFg==" + }, + "d3-geo": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.10.0.tgz", + "integrity": "sha512-VK/buVGgexthTTqGRNXQ/LSo3EbOFu4p2Pjud5drSIaEnOaF2moc8A3P7WEljEO1JEBEwbpAJjFWMuJiUtoBcw==", + "requires": { + "d3-array": "1" + } + }, + "d3-hierarchy": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-1.1.6.tgz", + "integrity": "sha512-nn4bhBnwWnMSoZgkBXD7vRyZ0xVUsNMQRKytWYHhP1I4qHw+qzApCTgSQTZqMdf4XXZbTMqA59hFusga+THA/g==" + }, + "d3-interpolate": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.2.0.tgz", + "integrity": "sha512-zLvTk8CREPFfc/2XglPQriAsXkzoRDAyBzndtKJWrZmHw7kmOWHNS11e40kPTd/oGk8P5mFJW5uBbcFQ+ybxyA==", + "requires": { + "d3-color": "1" + } + }, + "d3-path": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.5.tgz", + "integrity": "sha1-JB6xhJvZ6egCHA0KeZ+KDo5EF2Q=" + }, + "d3-polygon": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-1.0.3.tgz", + "integrity": "sha1-FoiOkCZGCTPysXllKtN4Ik04LGI=" + }, + "d3-quadtree": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-1.0.3.tgz", + "integrity": "sha1-rHmH4+I/6AWpkPKOG1DTj8uCJDg=" + }, + "d3-random": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-1.1.0.tgz", + "integrity": "sha1-ZkLlBsb6OmSFldKyRpeIqNElKdM=" + }, + "d3-scale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-2.1.0.tgz", + "integrity": "sha512-Bb2N3ZgzPdKVEoWGkt8lPV6R7YdpSBWI70Xf26NQHOVjs77a6gLUmBOOPt9d9nB8JiQhwXY1RHCa+eSyWCJZIQ==", + "requires": { + "d3-array": "^1.2.0", + "d3-collection": "1", + "d3-format": "1", + "d3-interpolate": "1", + "d3-time": "1", + "d3-time-format": "2" + } + }, + "d3-scale-chromatic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-1.3.0.tgz", + "integrity": "sha512-YwMbiaW2bStWvQFByK8hA6hk7ToWflspIo2TRukCqERd8isiafEMBXmwfh8c7/0Z94mVvIzIveRLVC6RAjhgeA==", + "requires": { + "d3-color": "1", + "d3-interpolate": "1" + } + }, + "d3-selection": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.3.0.tgz", + "integrity": "sha512-qgpUOg9tl5CirdqESUAu0t9MU/t3O9klYfGfyKsXEmhyxyzLpzpeh08gaxBUTQw1uXIOkr/30Ut2YRjSSxlmHA==" + }, + "d3-shape": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.2.0.tgz", + "integrity": "sha1-RdAVOPBkuv0F6j1tLLdI/YxB93c=", + "requires": { + "d3-path": "1" + } + }, + "d3-time": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-1.0.8.tgz", + "integrity": "sha512-YRZkNhphZh3KcnBfitvF3c6E0JOFGikHZ4YqD+Lzv83ZHn1/u6yGenRU1m+KAk9J1GnZMnKcrtfvSktlA1DXNQ==" + }, + "d3-time-format": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.1.1.tgz", + "integrity": "sha512-8kAkymq2WMfzW7e+s/IUNAtN/y3gZXGRrdGfo6R8NKPAA85UBTxZg5E61bR6nLwjPjj4d3zywSQe1CkYLPFyrw==", + "requires": { + "d3-time": "1" + } + }, + "d3-timer": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.7.tgz", + "integrity": "sha512-vMZXR88XujmG/L5oB96NNKH5lCWwiLM/S2HyyAQLcjWJCloK5shxta4CwOFYLZoY3AWX73v8Lgv4cCAdWtRmOA==" + }, + "d3-transition": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-1.1.1.tgz", + "integrity": "sha512-xeg8oggyQ+y5eb4J13iDgKIjUcEfIOZs2BqV/eEmXm2twx80wTzJ4tB4vaZ5BKfz7XsI/DFmQL5me6O27/5ykQ==", + "requires": { + "d3-color": "1", + "d3-dispatch": "1", + "d3-ease": "1", + "d3-interpolate": "1", + "d3-selection": "^1.1.0", + "d3-timer": "1" + } + }, + "d3-voronoi": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/d3-voronoi/-/d3-voronoi-1.1.2.tgz", + "integrity": "sha1-Fodmfo8TotFYyAwUgMWinLDYlzw=" + }, + "d3-zoom": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-1.7.1.tgz", + "integrity": "sha512-sZHQ55DGq5BZBFGnRshUT8tm2sfhPHFnOlmPbbwTkAoPeVdRTkB4Xsf9GCY0TSHrTD8PeJPZGmP/TpGicwJDJQ==", + "requires": { + "d3-dispatch": "1", + "d3-drag": "1", + "d3-interpolate": "1", + "d3-selection": "1", + "d3-transition": "1" + } + }, + "editorconfig": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.0.tgz", + "integrity": "sha512-j7JBoj/bpNzvoTQylfRZSc85MlLNKWQiq5y6gwKhmqD2h1eZ+tH4AXbkhEJD468gjDna/XMx2YtSkCxBRX9OGg==", + "dev": true, + "requires": { + "@types/commander": "^2.11.0", + "@types/semver": "^5.4.0", + "commander": "^2.11.0", + "lru-cache": "^4.1.1", + "semver": "^5.4.1", + "sigmund": "^1.0.1" + } + }, + "estree-walker": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", + "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==" + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "requires": { + "fill-range": "^2.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "requires": { + "is-extglob": "^1.0.0" + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=" + }, + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "requires": { + "for-in": "^1.0.1" + } + }, + "fs-extra": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", + "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "requires": { + "is-glob": "^2.0.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=" + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=" + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=" + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=" + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + } + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" + }, + "pegjs": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz", + "integrity": "sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0=" + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "randomatic": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz", + "integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==", + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + } + } + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=" + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "resolve": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "requires": { + "path-parse": "^1.0.5" + } + }, + "rollup": { + "version": "0.62.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.62.0.tgz", + "integrity": "sha512-mZS0aIGfYzuJySJD78znu9/hCJsNfBzg4lDuZGMj0hFVcYHt2evNRHv8aqiu9/w6z6Qn8AQoVl4iyEjDmisGeA==", + "requires": { + "@types/estree": "0.0.39", + "@types/node": "*" + } + }, + "rollup-plugin-node-resolve": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.3.0.tgz", + "integrity": "sha512-9zHGr3oUJq6G+X0oRMYlzid9fXicBdiydhwGChdyeNRGPcN/majtegApRKHLR5drboUvEWU+QeUmGTyEZQs3WA==", + "requires": { + "builtin-modules": "^2.0.0", + "is-module": "^1.0.0", + "resolve": "^1.1.6" + } + }, + "rollup-plugin-typescript2": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.15.1.tgz", + "integrity": "sha512-lJ/yfIj1fmp0KyfgPmd2QFeRpLgXlc58fS3Ha9Loc7/p3qByDL7CRndcI9MflE/pUSrfUdDjZMR0mHSKvqrZ+g==", + "requires": { + "fs-extra": "^5.0.0", + "resolve": "^1.7.1", + "rollup-pluginutils": "^2.0.1", + "tslib": "1.9.2" + } + }, + "rollup-pluginutils": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.3.0.tgz", + "integrity": "sha512-xB6hsRsjdJdIYWEyYUJy/3ki5g69wrf0luHPGNK3ZSocV6HLNfio59l3dZ3TL4xUwEKgROhFi9jOCt6c5gfUWw==", + "requires": { + "estree-walker": "^0.5.2", + "micromatch": "^2.3.11" + } + }, + "rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha1-P4Yt+pGrdmsUiF700BEkv9oHT7Q=" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + "dev": true + }, + "tslib": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.2.tgz", + "integrity": "sha512-AVP5Xol3WivEr7hnssHDsaM+lVrVXWUvd1cfXTRkTj80b//6g2wIFEH6hZG0muGZRnHGrfttpdzRk3YlBkWjKw==" + }, + "typescript": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.1.tgz", + "integrity": "sha512-h6pM2f/GDchCFlldnriOhs1QHuwbnmj6/v7499eMHqPeW4V2G0elua2eIc2nu8v2NdHV0Gm+tzX83Hr6nUFjQA==", + "dev": true + }, + "typescript-formatter": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/typescript-formatter/-/typescript-formatter-7.2.2.tgz", + "integrity": "sha512-V7vfI9XArVhriOTYHPzMU2WUnm5IMdu9X/CPxs8mIMGxmTBFpDABlbkBka64PZJ9/xgQeRpK8KzzAG4MPzxBDQ==", + "dev": true, + "requires": { + "commandpost": "^1.0.0", + "editorconfig": "^0.15.0" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + } + } +} diff --git a/deps/v8/tools/turbolizer/package.json b/deps/v8/tools/turbolizer/package.json new file mode 100644 index 00000000000000..1d8efc5286e963 --- /dev/null +++ b/deps/v8/tools/turbolizer/package.json @@ -0,0 +1,29 @@ +{ + "name": "turbolizer", + "version": "0.1.0", + "description": "Visualization tool for V8 TurboFan IR graphs", + "scripts": { + "build": "rollup -c", + "watch": "tsc --watch", + "deploy": "./deploy.sh", + "format": "tsfmt -r" + }, + "author": "The V8 team", + "license": "MIT", + "dependencies": { + "@types/d3": "^5.0.0", + "d3": "^5.5.0", + "pegjs": "^0.10.0", + "rollup": "^0.62.0", + "rollup-plugin-node-resolve": "^3.3.0", + "rollup-plugin-typescript2": "^0.15.1" + }, + "repository": { + "type": "git", + "url": "https://github.com/v8/v8.git" + }, + "devDependencies": { + "typescript": "^2.9.1", + "typescript-formatter": "^7.2.2" + } +} diff --git a/deps/v8/tools/turbolizer/rollup.config.js b/deps/v8/tools/turbolizer/rollup.config.js new file mode 100644 index 00000000000000..844e6e186d07fd --- /dev/null +++ b/deps/v8/tools/turbolizer/rollup.config.js @@ -0,0 +1,13 @@ +// 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. + +import typescript from 'rollup-plugin-typescript2'; +import node from 'rollup-plugin-node-resolve'; + +export default { + entry: "src/turbo-visualizer.ts", + format: "iife", + plugins: [node(), typescript({abortOnError:false})], + dest: "build/turbolizer.js" +}; diff --git a/deps/v8/tools/turbolizer/code-view.js b/deps/v8/tools/turbolizer/src/code-view.ts similarity index 78% rename from deps/v8/tools/turbolizer/code-view.js rename to deps/v8/tools/turbolizer/src/code-view.ts index 0b190b92ba1169..5975ff7a60d051 100644 --- a/deps/v8/tools/turbolizer/code-view.js +++ b/deps/v8/tools/turbolizer/src/code-view.ts @@ -2,15 +2,26 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -"use strict"; +import {Source,SourceResolver,sourcePositionToStringKey} from "./source-resolver.js" +import {SelectionBroker} from "./selection-broker.js" +import {View} from "./view.js" +import {MySelection} from "./selection.js" +import {anyToString,ViewElements} from "./util.js" -class CodeView extends View { - static get MAIN_SOURCE() { - return "main function"; - } - static get INLINED_SOURCE() { - return "inlined function"; - } +export enum CodeMode { + MAIN_SOURCE = "main function", + INLINED_SOURCE = "inlined function" +}; + +export class CodeView extends View { + broker: SelectionBroker; + source: Source; + sourceResolver: SourceResolver; + codeMode: CodeMode; + sourcePositionToHtmlElement: Map; + showAdditionalInliningPosition: boolean; + selectionHandler: SelectionHandler; + selection: MySelection; createViewElement() { const sourceContainer = document.createElement("div"); @@ -18,16 +29,14 @@ class CodeView extends View { return sourceContainer; } - constructor(parentId, broker, sourceResolver, sourceFunction, codeMode) { - super(parentId, broker, null, false); + constructor(parentId, broker, sourceResolver, sourceFunction, codeMode: CodeMode) { + super(parentId); let view = this; - view.mouseDown = false; view.broker = broker; view.source = null; view.sourceResolver = sourceResolver; view.source = sourceFunction; view.codeMode = codeMode; - this.lineToSourcePositions = new Map(); this.sourcePositionToHtmlElement = new Map(); this.showAdditionalInliningPosition = false; @@ -62,20 +71,12 @@ class CodeView extends View { view.updateSelection(); }, }; - view.selection = new Selection(sourcePositionToStringKey); + view.selection = new MySelection(sourcePositionToStringKey); broker.addSourcePositionHandler(selectionHandler); this.selectionHandler = selectionHandler; this.initializeCode(); } - addSourcePositionToLine(lineNumber, sourcePosition) { - const lineNumberString = anyToString(lineNumber); - if (!this.lineToSourcePositions.has(lineNumberString)) { - this.lineToSourcePositions.set(lineNumberString, []); - } - this.lineToSourcePositions.get(lineNumberString).push(sourcePosition); - } - addHtmlElementToSourcePosition(sourcePosition, element) { const key = sourcePositionToStringKey(sourcePosition); if (this.sourcePositionToHtmlElement.has(key)) { @@ -85,12 +86,12 @@ class CodeView extends View { } getHtmlElementForSourcePosition(sourcePosition) { - const key = sourcePositionToStringKey(lineNumber); + const key = sourcePositionToStringKey(sourcePosition); return this.sourcePositionToHtmlElement.get(key); } - updateSelection(scrollIntoView) { - const mkVisible = new ViewElements(this.divNode.parentNode); + updateSelection(scrollIntoView: boolean = false): void { + const mkVisible = new ViewElements(this.divNode.parentNode as HTMLElement); for (const [sp, el] of this.sourcePositionToHtmlElement.entries()) { const isSelected = this.selection.isKeySelected(sp); mkVisible.consider(el, isSelected); @@ -100,7 +101,6 @@ class CodeView extends View { } initializeContent(data, rememberedSelection) { - this.data = data; } getCodeHtmlElementName() { @@ -111,18 +111,20 @@ class CodeView extends View { return `source-pre-${this.source.sourceId}-header`; } - getHtmlCodeLines() { - const lineListDiv = this.divNode.querySelector(`#${this.getCodeHtmlElementName()} ol`).childNodes; - return lineListDiv; + getHtmlCodeLines(): NodeListOf { + const ordereList = this.divNode.querySelector(`#${this.getCodeHtmlElementName()} ol`); + return ordereList.childNodes as NodeListOf; } - onSelectLine(lineNumber, doClear) { - const sourcePositions = this.lineToSourcePositions.get(anyToString(lineNumber)); + onSelectLine(lineNumber: number, doClear: boolean) { + const key = anyToString(lineNumber); if (doClear) { this.selectionHandler.clear(); } - if (!sourcePositions) return; - this.selectionHandler.select(sourcePositions, undefined); + const positions = this.sourceResolver.linetoSourcePositions(lineNumber - 1); + if (positions !== undefined) { + this.selectionHandler.select(positions, undefined); + } } onSelectSourcePosition(sourcePosition, doClear) { @@ -138,7 +140,7 @@ class CodeView extends View { const sourceText = source.sourceText; if (!sourceText) return; const sourceContainer = view.divNode; - if (this.codeMode == CodeView.MAIN_SOURCE) { + if (this.codeMode == CodeMode.MAIN_SOURCE) { sourceContainer.classList.add("main-source"); } else { sourceContainer.classList.add("inlined-source"); @@ -154,8 +156,8 @@ class CodeView extends View { codeModeDiv.classList.add("code-mode"); codeModeDiv.innerHTML = `${this.codeMode}`; codeHeader.appendChild(codeModeDiv); - var clearDiv = document.createElement("div"); - clearDiv.style = "clear:both;" + const clearDiv = document.createElement("div"); + clearDiv.style.clear = "both"; codeHeader.appendChild(clearDiv); sourceContainer.appendChild(codeHeader); var codePre = document.createElement("pre"); @@ -184,7 +186,7 @@ class CodeView extends View { view.selectionHandler.clear(); } - const base = source.startPosition; + const base: number = source.startPosition; let current = 0; const lineListDiv = this.getHtmlCodeLines(); let newlineAdjust = 0; @@ -193,7 +195,7 @@ class CodeView extends View { const lineNumber = i + 1; const currentLineElement = lineListDiv[i]; currentLineElement.id = "li" + i; - currentLineElement.dataset.lineNumber = lineNumber; + currentLineElement.dataset.lineNumber = "" + lineNumber; const spans = currentLineElement.childNodes; for (let j = 0; j < spans.length; ++j) { const currentSpan = spans[j]; @@ -219,7 +221,7 @@ class CodeView extends View { const view = this; const sps = this.sourceResolver.sourcePositionsInRange(this.source.sourceId, pos - adjust, end); for (const sourcePosition of sps) { - view.addSourcePositionToLine(lineNumber, sourcePosition); + this.sourceResolver.addAnyPositionToLine(lineNumber, sourcePosition); const textnode = currentSpan.tagName == 'SPAN' ? currentSpan.firstChild : currentSpan; const replacementNode = textnode.splitText(Math.max(0, sourcePosition.scriptOffset - pos)); const span = document.createElement('span'); @@ -249,13 +251,21 @@ class CodeView extends View { const view = this; const lineNumberElement = document.createElement("div"); lineNumberElement.classList.add("line-number"); + lineNumberElement.dataset.lineNumber = lineNumber; lineNumberElement.innerText = lineNumber; lineNumberElement.onclick = function (e) { e.stopPropagation(); view.onSelectLine(lineNumber, !e.shiftKey); } lineElement.insertBefore(lineNumberElement, lineElement.firstChild) + // Don't add lines to source positions of not in backwardsCompatibility mode. + if (this.source.backwardsCompatibility === true) { + for (const sourcePosition of this.sourceResolver.linetoSourcePositions(lineNumber - 1)) { + view.addHtmlElementToSourcePosition(sourcePosition, lineElement); + } + } } deleteContent() { } + detachSelection() { return null; } } diff --git a/deps/v8/tools/turbolizer/src/constants.ts b/deps/v8/tools/turbolizer/src/constants.ts new file mode 100644 index 00000000000000..1551d486eb6f06 --- /dev/null +++ b/deps/v8/tools/turbolizer/src/constants.ts @@ -0,0 +1,26 @@ +// Copyright 2014 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. + +export const MAX_RANK_SENTINEL = 0; +export const GRAPH_MARGIN = 250; +export const SOURCE_PANE_ID = 'left'; +export const SOURCE_COLLAPSE_ID = 'source-shrink'; +export const SOURCE_EXPAND_ID = 'source-expand'; +export const INTERMEDIATE_PANE_ID = 'middle'; +export const GRAPH_PANE_ID = 'graph'; +export const SCHEDULE_PANE_ID = 'schedule'; +export const GENERATED_PANE_ID = 'right'; +export const DISASSEMBLY_PANE_ID = 'disassembly'; +export const DISASSEMBLY_COLLAPSE_ID = 'disassembly-shrink'; +export const DISASSEMBLY_EXPAND_ID = 'disassembly-expand'; +export const COLLAPSE_PANE_BUTTON_VISIBLE = 'button-input'; +export const COLLAPSE_PANE_BUTTON_INVISIBLE = 'button-input-invisible'; +export const UNICODE_BLOCK = '▋'; +export const PROF_COLS = [ + { perc: 0, col: { r: 255, g: 255, b: 255 } }, + { perc: 0.5, col: { r: 255, g: 255, b: 128 } }, + { perc: 5, col: { r: 255, g: 128, b: 0 } }, + { perc: 15, col: { r: 255, g: 0, b: 0 } }, + { perc: 100, col: { r: 0, g: 0, b: 0 } } +]; diff --git a/deps/v8/tools/turbolizer/disassembly-view.js b/deps/v8/tools/turbolizer/src/disassembly-view.ts similarity index 81% rename from deps/v8/tools/turbolizer/disassembly-view.js rename to deps/v8/tools/turbolizer/src/disassembly-view.ts index 75ef061262d949..8142b2aa0d55ce 100644 --- a/deps/v8/tools/turbolizer/disassembly-view.js +++ b/deps/v8/tools/turbolizer/src/disassembly-view.ts @@ -2,9 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -"use strict"; +import {PROF_COLS, UNICODE_BLOCK} from "./constants.js" +import {SelectionBroker} from "./selection-broker.js" +import {TextView} from "./text-view.js" -class DisassemblyView extends TextView { +export class DisassemblyView extends TextView { + SOURCE_POSITION_HEADER_REGEX: any; + addr_event_counts: any; + total_event_counts: any; + max_event_counts: any; + pos_lines: Array; createViewElement() { const pane = document.createElement('div'); @@ -17,23 +24,33 @@ class DisassemblyView extends TextView { return pane; } - constructor(parentId, broker) { - super(parentId, broker, null, false); + constructor(parentId, broker: SelectionBroker) { + super(parentId, broker, null); let view = this; + const sourceResolver = broker.sourceResolver; let ADDRESS_STYLE = { css: 'tag', - assignSourcePosition: function (text) { - return SOURCE_POSITION_HEADER_STYLE.currentSourcePosition; - }, linkHandler: function (text, fragment) { - if (fragment.sourcePosition === undefined) return undefined; - return (e) => { - e.stopPropagation(); - if (!e.shiftKey) { - view.sourcePositionSelectionHandler.clear(); + const matches = text.match(/0x[0-9a-f]{8,16}\s*(?[0-9a-f]+)/); + const offset = Number.parseInt(matches.groups["offset"], 16); + if (!Number.isNaN(offset)) { + const [nodes, blockId] = sourceResolver.nodesForPCOffset(offset) + console.log("nodes for", offset, offset.toString(16), " are ", nodes); + if (nodes.length > 0) { + for (const nodeId of nodes) { + view.addHtmlElementForNodeId(nodeId, fragment); + } + return (e) => { + console.log(offset, nodes); + e.stopPropagation(); + if (!e.shiftKey) { + view.selectionHandler.clear(); + } + view.selectionHandler.select(nodes, true); + }; } - view.sourcePositionSelectionHandler.select([fragment.sourcePosition], true); - }; + } + return undefined; } }; let ADDRESS_LINK_STYLE = { @@ -50,15 +67,13 @@ class DisassemblyView extends TextView { }; let POSITION_STYLE = { css: 'com', - location: function (text) { - view.pos_start = Number(text); - } }; let OPCODE_STYLE = { css: 'kwd', }; const BLOCK_HEADER_STYLE = { css: ['com', 'block'], + block_id: null, blockId: function (text) { let matches = /\d+/.exec(text); if (!matches) return undefined; @@ -79,26 +94,18 @@ class DisassemblyView extends TextView { } }; const SOURCE_POSITION_HEADER_STYLE = { - css: 'com', - sourcePosition: function (text) { - let matches = view.SOURCE_POSITION_HEADER_REGEX.exec(text); - if (!matches) return undefined; - const scriptOffset = Number(matches[3]); - const inliningId = matches[1] === 'not inlined' ? -1 : Number(matches[2]); - const sp = { scriptOffset: scriptOffset, inliningId: inliningId }; - SOURCE_POSITION_HEADER_STYLE.currentSourcePosition = sp; - return sp; - }, + css: 'com' }; view.SOURCE_POSITION_HEADER_REGEX = /^\s*--[^<]*<.*(not inlined|inlined\((\d+)\)):(\d+)>\s*--/; let patterns = [ [ - [/^0x[0-9a-f]{8,16}/, ADDRESS_STYLE, 1], + [/^0x[0-9a-f]{8,16}\s*[0-9a-f]+\ /, ADDRESS_STYLE, 1], [view.SOURCE_POSITION_HEADER_REGEX, SOURCE_POSITION_HEADER_STYLE, -1], [/^\s+-- B\d+ start.*/, BLOCK_HEADER_STYLE, -1], [/^.*/, UNCLASSIFIED_STYLE, -1] ], [ + [/^\s+[0-9a-f]+\s+/, NUMBER_STYLE, 2], [/^\s+[0-9a-f]+\s+[0-9a-f]+\s+/, NUMBER_STYLE, 2], [/^.*/, null, -1] ], @@ -131,14 +138,8 @@ class DisassemblyView extends TextView { view.setPatterns(patterns); } - initializeContent(data, rememberedSelection) { - this.data = data; - super.initializeContent(data, rememberedSelection); - } - initializeCode(sourceText, sourcePosition) { let view = this; - view.pos_start = -1; view.addr_event_counts = null; view.total_event_counts = null; view.max_event_counts = null; @@ -242,4 +243,6 @@ class DisassemblyView extends TextView { } return fragments; } + + detachSelection() { return null; } } diff --git a/deps/v8/tools/turbolizer/src/edge.ts b/deps/v8/tools/turbolizer/src/edge.ts new file mode 100644 index 00000000000000..7ca6d9dba09d20 --- /dev/null +++ b/deps/v8/tools/turbolizer/src/edge.ts @@ -0,0 +1,94 @@ +// Copyright 2014 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. + +import {GNode, DEFAULT_NODE_BUBBLE_RADIUS} from "./node.js" + +export const MINIMUM_EDGE_SEPARATION = 20; + +export function isEdgeInitiallyVisible(target, index, source, type) { + return type == "control" && (target.cfg || source.cfg); +} + +export class Edge { + target: GNode; + source: GNode; + index: number; + type: String; + backEdgeNumber: number; + visible: boolean; + + constructor(target: GNode, index: number, source: GNode, type: string) { + this.target = target; + this.source = source; + this.index = index; + this.type = type; + this.backEdgeNumber = 0; + this.visible = isEdgeInitiallyVisible(target, index, source, type); + } + + + stringID() { + return this.source.id + "," + this.index + "," + this.target.id; + }; + + isVisible() { + return this.visible && this.source.visible && this.target.visible; + }; + + getInputHorizontalPosition(graph) { + if (this.backEdgeNumber > 0) { + return graph.maxGraphNodeX + this.backEdgeNumber * MINIMUM_EDGE_SEPARATION; + } + var source = this.source; + var target = this.target; + var index = this.index; + var input_x = target.x + target.getInputX(index); + var inputApproach = target.getInputApproach(this.index); + var outputApproach = source.getOutputApproach(graph); + if (inputApproach > outputApproach) { + return input_x; + } else { + var inputOffset = MINIMUM_EDGE_SEPARATION * (index + 1); + return (target.x < source.x) + ? (target.x + target.getTotalNodeWidth() + inputOffset) + : (target.x - inputOffset) + } + } + + generatePath(graph) { + var target = this.target; + var source = this.source; + var input_x = target.x + target.getInputX(this.index); + var arrowheadHeight = 7; + var input_y = target.y - 2 * DEFAULT_NODE_BUBBLE_RADIUS - arrowheadHeight; + var output_x = source.x + source.getOutputX(); + var output_y = source.y + graph.getNodeHeight(source) + DEFAULT_NODE_BUBBLE_RADIUS; + var inputApproach = target.getInputApproach(this.index); + var outputApproach = source.getOutputApproach(graph); + var horizontalPos = this.getInputHorizontalPosition(graph); + + var result = "M" + output_x + "," + output_y + + "L" + output_x + "," + outputApproach + + "L" + horizontalPos + "," + outputApproach; + + if (horizontalPos != input_x) { + result += "L" + horizontalPos + "," + inputApproach; + } else { + if (inputApproach < outputApproach) { + inputApproach = outputApproach; + } + } + + result += "L" + input_x + "," + inputApproach + + "L" + input_x + "," + input_y; + return result; + } + + isBackEdge() { + return this.target.hasBackEdges() && (this.target.rank < this.source.rank); + } + +} + +export const edgeToStr = (e: Edge) => e.stringID(); diff --git a/deps/v8/tools/turbolizer/graph-layout.js b/deps/v8/tools/turbolizer/src/graph-layout.ts similarity index 87% rename from deps/v8/tools/turbolizer/graph-layout.js rename to deps/v8/tools/turbolizer/src/graph-layout.ts index 1c52aac4a1c1e9..302a98aacc938d 100644 --- a/deps/v8/tools/turbolizer/graph-layout.js +++ b/deps/v8/tools/turbolizer/src/graph-layout.ts @@ -2,11 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -var DEFAULT_NODE_ROW_SEPARATION = 130 + +import {MAX_RANK_SENTINEL} from "./constants.js" +import {MINIMUM_EDGE_SEPARATION} from "./edge.js" +import {NODE_INPUT_WIDTH, MINIMUM_NODE_OUTPUT_APPROACH, DEFAULT_NODE_BUBBLE_RADIUS} from "./node.js" + + +const DEFAULT_NODE_ROW_SEPARATION = 130 var traceLayout = false; -function newGraphOccupation(graph){ +function newGraphOccupation(graph) { var isSlotFilled = []; var maxSlot = 0; var minSlot = 0; @@ -42,7 +48,7 @@ function newGraphOccupation(graph){ function findSpace(pos, width, direction) { var widthSlots = Math.floor((width + NODE_INPUT_WIDTH - 1) / - NODE_INPUT_WIDTH); + NODE_INPUT_WIDTH); var currentSlot = positionToSlot(pos + width / 2); var currentScanSlot = currentSlot; var widthSlotsRemainingLeft = widthSlots; @@ -53,14 +59,14 @@ function newGraphOccupation(graph){ currentScanSlot = currentSlot + (mod ? -1 : 1) * (slotsChecked >> 1); if (!isSlotFilled[slotToIndex(currentScanSlot)]) { if (mod) { - if (direction <= 0) --widthSlotsRemainingLeft + if (direction <= 0)--widthSlotsRemainingLeft } else { - if (direction >= 0) --widthSlotsRemainingRight + if (direction >= 0)--widthSlotsRemainingRight } if (widthSlotsRemainingLeft == 0 || - widthSlotsRemainingRight == 0 || - (widthSlotsRemainingLeft + widthSlotsRemainingRight) == widthSlots && - (widthSlots == slotsChecked)) { + widthSlotsRemainingRight == 0 || + (widthSlotsRemainingLeft + widthSlotsRemainingRight) == widthSlots && + (widthSlots == slotsChecked)) { if (mod) { return [currentScanSlot, widthSlots]; } else { @@ -79,7 +85,7 @@ function newGraphOccupation(graph){ function setIndexRange(from, to, value) { if (to < from) { - throw("illegal slot range"); + throw ("illegal slot range"); } while (from <= to) { if (from > maxSlot) { @@ -127,7 +133,7 @@ function newGraphOccupation(graph){ } var occupation = { - occupyNodeInputs: function(node) { + occupyNodeInputs: function (node) { for (var i = 0; i < node.inputs.length; ++i) { if (node.inputs[i].isVisible()) { var edge = node.inputs[i]; @@ -138,14 +144,14 @@ function newGraphOccupation(graph){ console.log("Occupying input " + i + " of " + node.id + " at " + horizontalPos); } occupyPositionRangeWithMargin(horizontalPos, - horizontalPos, - NODE_INPUT_WIDTH / 2); + horizontalPos, + NODE_INPUT_WIDTH / 2); } } } }, - occupyNode: function(node) { - var getPlacementHint = function(n) { + occupyNode: function (node) { + var getPlacementHint = function (n) { var pos = 0; var direction = -1; var outputEdges = 0; @@ -201,28 +207,28 @@ function newGraphOccupation(graph){ return slotToLeftPosition(firstSlot + slotWidth / 2) - (width / 2); } }, - clearOccupiedNodes: function() { - nodeOccupation.forEach(function(o) { + clearOccupiedNodes: function () { + nodeOccupation.forEach(function (o) { clearSlotRange(o[0], o[1]); }); nodeOccupation = []; }, - clearNodeOutputs: function(source) { - source.outputs.forEach(function(edge) { + clearNodeOutputs: function (source) { + source.outputs.forEach(function (edge) { if (edge.isVisible()) { var target = edge.target; for (var i = 0; i < target.inputs.length; ++i) { if (target.inputs[i].source === source) { var horizontalPos = edge.getInputHorizontalPosition(graph); clearPositionRangeWithMargin(horizontalPos, - horizontalPos, - NODE_INPUT_WIDTH / 2); + horizontalPos, + NODE_INPUT_WIDTH / 2); } } } }); }, - print: function() { + print: function () { var s = ""; for (var currentSlot = -40; currentSlot < 40; ++currentSlot) { if (currentSlot != 0) { @@ -246,16 +252,16 @@ function newGraphOccupation(graph){ return occupation; } -function layoutNodeGraph(graph) { +export function layoutNodeGraph(graph) { // First determine the set of nodes that have no outputs. Those are the // basis for bottom-up DFS to determine rank and node placement. var endNodesHasNoOutputs = []; var startNodesHasNoInputs = []; - graph.nodes.forEach(function(n, i){ + graph.nodes.forEach(function (n, i) { endNodesHasNoOutputs[n.id] = true; startNodesHasNoInputs[n.id] = true; }); - graph.edges.forEach(function(e, i){ + graph.edges.forEach(function (e, i) { endNodesHasNoOutputs[e.source.id] = false; startNodesHasNoInputs[e.target.id] = false; }); @@ -265,7 +271,7 @@ function layoutNodeGraph(graph) { var startNodes = []; var visited = []; var rank = []; - graph.nodes.forEach(function(n, i){ + graph.nodes.forEach(function (n, i) { if (endNodesHasNoOutputs[n.id]) { endNodes.push(n); } @@ -323,7 +329,7 @@ function layoutNodeGraph(graph) { } } - visited = []; + visited = []; function dfsFindRankLate(n) { if (visited[n.id]) return; visited[n.id] = true; @@ -335,7 +341,7 @@ function layoutNodeGraph(graph) { dfsFindRankLate(output); var outputRank = output.rank; if (output.visible && (firstInput || outputRank <= newRank) && - (outputRank > originalRank)) { + (outputRank > originalRank)) { newRank = outputRank - 1; } firstInput = false; @@ -364,15 +370,15 @@ function layoutNodeGraph(graph) { } startNodes.forEach(dfsRankOrder); - endNodes.forEach(function(n) { + endNodes.forEach(function (n) { n.rank = maxRank + 1; }); var rankSets = []; // Collect sets for each rank. - graph.nodes.forEach(function(n, i){ + graph.nodes.forEach(function (n, i) { n.y = n.rank * (DEFAULT_NODE_ROW_SEPARATION + graph.getNodeHeight(n) + - 2 * DEFAULT_NODE_BUBBLE_RADIUS); + 2 * DEFAULT_NODE_BUBBLE_RADIUS); if (n.visible) { if (rankSets[n.rank] === undefined) { rankSets[n.rank] = [n]; @@ -388,7 +394,7 @@ function layoutNodeGraph(graph) { var occupation = newGraphOccupation(graph); var rankCount = 0; - rankSets.reverse().forEach(function(rankSet) { + rankSets.reverse().forEach(function (rankSet) { for (var i = 0; i < rankSet.length; ++i) { occupation.clearNodeOutputs(rankSet[i]); @@ -400,7 +406,7 @@ function layoutNodeGraph(graph) { } var placedCount = 0; - rankSet = rankSet.sort(function(a,b) { + rankSet = rankSet.sort(function (a, b) { return a.visitOrderWithinRank < b.visitOrderWithinRank; }); for (var i = 0; i < rankSet.length; ++i) { @@ -456,7 +462,6 @@ function layoutNodeGraph(graph) { }); redetermineGraphBoundingBox(graph); - } function redetermineGraphBoundingBox(graph) { @@ -489,4 +494,16 @@ function redetermineGraphBoundingBox(graph) { graph.maxGraphX = graph.maxGraphNodeX + graph.maxBackEdgeNumber * MINIMUM_EDGE_SEPARATION; + + const width = (graph.maxGraphX - graph.minGraphX); + const height = graph.maxGraphY - graph.minGraphY; + graph.width = width; + graph.height = height; + + const extent = [ + [graph.minGraphX - width / 2, graph.minGraphY - height / 2], + [graph.maxGraphX + width / 2, graph.maxGraphY + height / 2] + ]; + graph.panZoom.translateExtent(extent); + graph.minScale(); } diff --git a/deps/v8/tools/turbolizer/graph-view.js b/deps/v8/tools/turbolizer/src/graph-view.ts similarity index 69% rename from deps/v8/tools/turbolizer/graph-view.js rename to deps/v8/tools/turbolizer/src/graph-view.ts index 31669de8032a94..9e136f8225fd36 100644 --- a/deps/v8/tools/turbolizer/graph-view.js +++ b/deps/v8/tools/turbolizer/src/graph-view.ts @@ -2,29 +2,72 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -"use strict"; +import * as d3 from "d3" +import {layoutNodeGraph} from "./graph-layout.js" +import {MAX_RANK_SENTINEL} from "./constants.js" +import {GNode, nodeToStr, isNodeInitiallyVisible} from "./node.js" +import {NODE_INPUT_WIDTH, MINIMUM_NODE_OUTPUT_APPROACH} from "./node.js" +import {DEFAULT_NODE_BUBBLE_RADIUS} from "./node.js" +import {Edge, edgeToStr} from "./edge.js" +import {View, PhaseView} from "./view.js" +import {MySelection} from "./selection.js" +import {partial, alignUp} from "./util.js" function nodeToStringKey(n) { return "" + n.id; } -class GraphView extends View { +interface GraphState { + showTypes: boolean; + selection: MySelection; + mouseDownNode: any; + justDragged: boolean, + justScaleTransGraph: boolean, + lastKeyDown: number, + hideDead: boolean +} + +export class GraphView extends View implements PhaseView { + divElement: d3.Selection; + svg: d3.Selection; + showPhaseByName: (string) => void; + state: GraphState; + nodes: Array; + edges: Array; + selectionHandler: NodeSelectionHandler; + graphElement: d3.Selection; + visibleNodes: d3.Selection; + visibleEdges: d3.Selection; + minGraphX: number; + maxGraphX: number; + minGraphY: number; + maxGraphY: number; + width: number; + height: number; + maxGraphNodeX: number; + drag: d3.DragBehavior; + panZoom: d3.ZoomBehavior; + nodeMap: Array; + visibleBubbles: d3.Selection; + transitionTimout: number; + createViewElement() { const pane = document.createElement('div'); pane.setAttribute('id', "graph"); return pane; } - constructor(d3, id, broker, showPhaseByName) { - super(id, broker); + constructor(id, broker, showPhaseByName: (string) => void) { + super(id); var graph = this; - this.showPhaseByName = showPhaseByName - - var svg = this.divElement.append("svg").attr('version', '1.1') + this.showPhaseByName = showPhaseByName; + this.divElement = d3.select(this.divNode); + const svg = this.divElement.append("svg").attr('version', '1.1') .attr("width", "100%") .attr("height", "100%"); - svg.on("mousedown", function (d) { graph.svgMouseDown.call(graph, d); }); - svg.on("mouseup", function (d) { graph.svgMouseUp.call(graph, d); }); + svg.on("click", function (d) { + graph.selectionHandler.clear(); + }); graph.svg = svg; graph.nodes = []; @@ -57,6 +100,9 @@ class GraphView extends View { if (node.sourcePosition) { locations.push(node.sourcePosition); } + if (node.origin && node.origin.bytecodePosition) { + locations.push({ bytecodePosition: node.origin.bytecodePosition }); + } } graph.state.selection.select(nodes, selected); broker.broadcastSourcePositionSelect(this, locations, selected); @@ -86,9 +132,9 @@ class GraphView extends View { }; broker.addNodeHandler(this.selectionHandler); - graph.state.selection = new Selection(nodeToStringKey); + graph.state.selection = new MySelection(nodeToStringKey); - var defs = svg.append('svg:defs'); + const defs = svg.append('svg:defs'); defs.append('svg:marker') .attr('id', 'end-arrow') .attr('viewBox', '0 -4 8 8') @@ -103,14 +149,13 @@ class GraphView extends View { graph.visibleEdges = this.graphElement.append("g"); graph.visibleNodes = this.graphElement.append("g"); - graph.drag = d3.behavior.drag() - .origin(function (d) { - return { x: d.x, y: d.y }; - }) - .on("drag", function (args) { - graph.state.justDragged = true; - graph.dragmove.call(graph, args); - }) + graph.drag = d3.drag() + .on("drag", function (d) { + d.x += d3.event.dx; + d.y += d3.event.dy; + graph.updateGraphVisibility(); + }); + d3.select("#layout").on("click", partial(this.layoutAction, graph)); d3.select("#show-all").on("click", partial(this.showAllAction, graph)); @@ -123,30 +168,33 @@ class GraphView extends View { // listen for key events d3.select(window).on("keydown", function (e) { graph.svgKeyDown.call(graph); - }) - .on("keyup", function () { - graph.svgKeyUp.call(graph); - }); + }).on("keyup", function () { + graph.svgKeyUp.call(graph); + }); - graph.dragSvg = d3.behavior.zoom() - .on("zoom", function () { - if (d3.event.sourceEvent.shiftKey) { - return false; - } else { - graph.zoomed.call(graph); - } - return true; - }) - .on("zoomstart", function () { - if (!d3.event.sourceEvent.shiftKey) d3.select('body').style("cursor", "move"); + function zoomed() { + if (d3.event.shiftKey) return false; + graph.graphElement.attr("transform", d3.event.transform); + } + + const zoomSvg = d3.zoom() + .scaleExtent([0.2, 40]) + .on("zoom", zoomed) + .on("start", function () { + if (d3.event.shiftKey) return; + d3.select('body').style("cursor", "move"); }) - .on("zoomend", function () { + .on("end", function () { d3.select('body').style("cursor", "auto"); }); - svg.call(graph.dragSvg).on("dblclick.zoom", null); + svg.call(zoomSvg).on("dblclick.zoom", null); + + graph.panZoom = zoomSvg; + } + static get selectedClass() { return "selected"; } @@ -160,7 +208,7 @@ class GraphView extends View { return 50; } - getNodeHeight(d) { + getNodeHeight(d): number { if (this.state.showTypes) { return d.normalheight + d.labelbbox.height; } else { @@ -212,22 +260,15 @@ class GraphView extends View { } } - dragmove(d) { - var graph = this; - d.x += d3.event.dx; - d.y += d3.event.dy; - graph.updateGraphVisibility(); - } - initializeContent(data, rememberedSelection) { this.createGraph(data, rememberedSelection); if (rememberedSelection != null) { this.attachSelection(rememberedSelection); this.connectVisibleSelectedNodes(); this.viewSelection(); + } else { + this.viewWholeGraph(); } - this.updateGraphVisibility(); - this.fitGraphViewToWindow(); } deleteContent() { @@ -240,7 +281,7 @@ class GraphView extends View { }; measureText(text) { - var textMeasure = document.getElementById('text-measure'); + const textMeasure = document.getElementById('text-measure') as SVGTSpanElement; textMeasure.textContent = text; return { width: textMeasure.getBBox().width, @@ -250,10 +291,10 @@ class GraphView extends View { createGraph(data, rememberedSelection) { var g = this; - g.nodes = data.nodes; + g.nodes = []; g.nodeMap = []; - g.nodes.forEach(function (n, i) { - n.__proto__ = Node; + data.nodes.forEach(function (n, i) { + n.__proto__ = GNode.prototype; n.visible = false; n.x = 0; n.y = 0; @@ -272,10 +313,11 @@ class GraphView extends View { n.labelbbox = g.measureText(n.displayLabel); n.typebbox = g.measureText(n.getDisplayType()); var innerwidth = Math.max(n.labelbbox.width, n.typebbox.width); - n.width = Math.alignUp(innerwidth + NODE_INPUT_WIDTH * 2, + n.width = alignUp(innerwidth + NODE_INPUT_WIDTH * 2, NODE_INPUT_WIDTH); var innerheight = Math.max(n.labelbbox.height, n.typebbox.height); n.normalheight = innerheight + 20; + g.nodes.push(n); }); g.edges = []; data.edges.forEach(function (e, i) { @@ -297,7 +339,6 @@ class GraphView extends View { } } }); - g.fitGraphViewToWindow(); g.updateGraphVisibility(); g.layoutGraph(); g.updateGraphVisibility(); @@ -373,42 +414,7 @@ class GraphView extends View { return this.state.selection.detachSelection(); } - pathMouseUp(path, d) { - d3.event.stopPropagation(); - const edge = path.datum(); - if (!d3.event.shiftKey) { - this.selectionHandler.clear(); - } - this.selectionHandler.select([edge.source, edge.target], true); - return false; - }; - - nodeMouseDown(node, d) { - d3.event.stopPropagation(); - this.state.mouseDownNode = d; - } - - nodeMouseUp(d3node, d) { - let graph = this; - let state = graph.state; - - if (!state.mouseDownNode) return; - - if (state.justDragged) { - // dragged, not clicked - redetermineGraphBoundingBox(graph); - state.justDragged = false; - } else { - // clicked, not dragged - var extend = d3.event.shiftKey; - if (!extend) { - graph.selectionHandler.clear(); - } - graph.selectionHandler.select([d3node.datum()], undefined); - } - } - - selectAllNodes(inEdges, filter) { + selectAllNodes() { var graph = this; if (!d3.event.shiftKey) { graph.state.selection.clear(); @@ -480,8 +486,9 @@ class GraphView extends View { graph.toggleTypes(); } - searchInputAction(graph, searchBar) { - if (d3.event.keyCode == 13) { + searchInputAction(searchBar, e: KeyboardEvent) { + const graph = this; + if (e.keyCode == 13) { graph.selectionHandler.clear(); var query = searchBar.value; window.sessionStorage.setItem("lastSearch", query); @@ -497,8 +504,8 @@ class GraphView extends View { const selection = graph.nodes.filter( function (n, i) { - if ((d3.event.ctrlKey || n.visible) && filterFunction(n)) { - if (d3.event.ctrlKey) n.visible = true; + if ((e.ctrlKey || n.visible) && filterFunction(n)) { + if (e.ctrlKey) n.visible = true; return true; } return false; @@ -510,27 +517,7 @@ class GraphView extends View { searchBar.blur(); graph.viewSelection(); } - d3.event.stopPropagation(); - } - - svgMouseDown() { - this.state.graphMouseDown = true; - } - - svgMouseUp() { - const graph = this; - const state = graph.state; - if (state.justScaleTransGraph) { - // Dragged - state.justScaleTransGraph = false; - } else { - // Clicked - if (state.mouseDownNode == null && !d3.event.shiftKey) { - graph.selectionHandler.clear(); - } - } - state.mouseDownNode = null; - state.graphMouseDown = false; + e.stopPropagation(); } svgKeyDown() { @@ -594,8 +581,8 @@ class GraphView extends View { case 69: // 'e' showSelectionFrontierNodes(d3.event.altKey, - (edge, index) => { return edge.type == 'effect'; }, - true); + (edge, index) => { return edge.type == 'effect'; }, + true); break; case 79: // 'o' @@ -630,7 +617,6 @@ class GraphView extends View { case 191: // '/' document.getElementById("search-input").focus(); - document.getElementById("search-input").select(); break; default: eventHandled = false; @@ -680,9 +666,7 @@ class GraphView extends View { var filteredEdges = graph.edges.filter(function (e) { return e.isVisible(); }); - const selEdges = graph.visibleEdges.selectAll("path").data(filteredEdges, function (edge) { - return edge.stringID(); - }); + const selEdges = graph.visibleEdges.selectAll("path").data(filteredEdges, edgeToStr); // remove old links selEdges.exit().remove(); @@ -695,8 +679,12 @@ class GraphView extends View { return !e.isVisible(); }) .attr("id", function (edge) { return "e," + edge.stringID(); }) - .on("mouseup", function (d) { - graph.pathMouseUp.call(graph, d3.select(this), d); + .on("click", function (edge) { + d3.event.stopPropagation(); + if (!d3.event.shiftKey) { + graph.selectionHandler.clear(); + } + graph.selectionHandler.select([edge.source, edge.target], true); }) .attr("adjacentToHover", "false"); @@ -715,12 +703,9 @@ class GraphView extends View { }); // select existing nodes - var filteredNodes = graph.nodes.filter(function (n) { - return n.visible; - }); - let selNodes = graph.visibleNodes.selectAll("g").data(filteredNodes, function (d) { - return d.id; - }); + const filteredNodes = graph.nodes.filter(n => n.visible); + const allNodes = graph.visibleNodes.selectAll("g"); + const selNodes = allNodes.data(filteredNodes, nodeToStr); // remove old nodes selNodes.exit().remove(); @@ -737,53 +722,45 @@ class GraphView extends View { .classed("input", function (n) { return n.isInput(); }) .classed("simplified", function (n) { return n.isSimplified(); }) .classed("machine", function (n) { return n.isMachine(); }) - .on("mousedown", function (d) { - graph.nodeMouseDown.call(graph, d3.select(this), d); - }) - .on("mouseup", function (d) { - graph.nodeMouseUp.call(graph, d3.select(this), d); - }) - .on('mouseover', function (d) { - var nodeSelection = d3.select(this); - let node = graph.nodeMap[d.id]; - let visibleEdges = graph.visibleEdges.selectAll('path'); - let adjInputEdges = visibleEdges.filter(e => { return e.target === node; }); - let adjOutputEdges = visibleEdges.filter(e => { return e.source === node; }); + .on('mouseenter', function (node) { + const visibleEdges = graph.visibleEdges.selectAll('path'); + const adjInputEdges = visibleEdges.filter(e => { return e.target === node; }); + const adjOutputEdges = visibleEdges.filter(e => { return e.source === node; }); adjInputEdges.attr('relToHover', "input"); adjOutputEdges.attr('relToHover', "output"); - let adjInputNodes = adjInputEdges.data().map(e => e.source); - let visibleNodes = graph.visibleNodes.selectAll("g"); - visibleNodes.data(adjInputNodes, function (d) { - return d.id; - }).attr('relToHover', "input"); - let adjOutputNodes = adjOutputEdges.data().map(e => e.target); - visibleNodes.data(adjOutputNodes, function (d) { - return d.id; - }).attr('relToHover', "output"); + const adjInputNodes = adjInputEdges.data().map(e => e.source); + const visibleNodes = graph.visibleNodes.selectAll("g"); + const input = visibleNodes.data(adjInputNodes, nodeToStr) + .attr('relToHover', "input"); + const adjOutputNodes = adjOutputEdges.data().map(e => e.target); + const output = visibleNodes.data(adjOutputNodes, nodeToStr) + .attr('relToHover', "output"); graph.updateGraphVisibility(); }) - .on('mouseout', function (d) { - var nodeSelection = d3.select(this); - let node = graph.nodeMap[d.id]; - let visibleEdges = graph.visibleEdges.selectAll('path'); - let adjEdges = visibleEdges.filter(e => { return e.target === node || e.source === node; }); + .on('mouseleave', function (node) { + const visibleEdges = graph.visibleEdges.selectAll('path'); + const adjEdges = visibleEdges.filter(e => { return e.target === node || e.source === node; }); adjEdges.attr('relToHover', "none"); - let adjNodes = adjEdges.data().map(e => e.target).concat(adjEdges.data().map(e => e.source)); - let visibleNodes = graph.visibleNodes.selectAll("g"); - let nodes = visibleNodes.data(adjNodes, function (d) { - return d.id; - }).attr('relToHover', "none"); + const adjNodes = adjEdges.data().map(e => e.target).concat(adjEdges.data().map(e => e.source)); + const visibleNodes = graph.visibleNodes.selectAll("g"); + const nodes = visibleNodes.data(adjNodes, nodeToStr) + .attr('relToHover', "none"); graph.updateGraphVisibility(); }) + .on("click", (d) => { + if (!d3.event.shiftKey) graph.selectionHandler.clear(); + graph.selectionHandler.select([d], undefined); + d3.event.stopPropagation(); + }) .call(graph.drag) newGs.append("rect") .attr("rx", 10) .attr("ry", 10) - .attr(WIDTH, function (d) { + .attr('width', function (d) { return d.getTotalNodeWidth(); }) - .attr(HEIGHT, function (d) { + .attr('height', function (d) { return graph.getNodeHeight(d); }) @@ -803,7 +780,7 @@ class GraphView extends View { .attr("transform", function (d) { return "translate(" + x + "," + y + ")"; }) - .on("mousedown", function (d) { + .on("click", function (d) { var components = this.id.split(','); var node = graph.nodeMap[components[3]]; var edge = node.inputs[components[2]]; @@ -831,7 +808,7 @@ class GraphView extends View { .attr("transform", function (d) { return "translate(" + x + "," + y + ")"; }) - .on("mousedown", function (d) { + .on("click", function (d) { d.setOutputVisibility(d.areAnyOutputsVisible() == 0); d3.event.stopPropagation(); graph.updateGraphVisibility(); @@ -875,18 +852,20 @@ class GraphView extends View { } }); - selNodes.select('.type').each(function (d) { + const newAndOldNodes = newGs.merge(selNodes); + + newAndOldNodes.select('.type').each(function (d) { this.setAttribute('visibility', graph.state.showTypes ? 'visible' : 'hidden'); }); - selNodes + newAndOldNodes .classed("selected", function (n) { if (state.selection.isSelected(n)) return true; return false; }) .attr("transform", function (d) { return "translate(" + d.x + "," + d.y + ")"; }) .select('rect') - .attr(HEIGHT, function (d) { return graph.getNodeHeight(d); }); + .attr('height', function (d) { return graph.getNodeHeight(d); }); graph.visibleBubbles = d3.selectAll('circle'); @@ -896,114 +875,30 @@ class GraphView extends View { selEdges.attr("d", function (edge) { return edge.generatePath(graph); }); - - graph.svg.style.height = '100%'; - redetermineGraphBoundingBox(this); - } - - getVisibleTranslation(translate, scale) { - var graph = this; - var height = (graph.maxGraphY - graph.minGraphY + 2 * GRAPH_MARGIN) * scale; - var width = (graph.maxGraphX - graph.minGraphX + 2 * GRAPH_MARGIN) * scale; - - var dimensions = this.getSvgViewDimensions(); - - var baseY = translate[1]; - var minY = (graph.minGraphY - GRAPH_MARGIN) * scale; - var maxY = (graph.maxGraphY + GRAPH_MARGIN) * scale; - - var adjustY = 0; - var adjustYCandidate = 0; - if ((maxY + baseY) < dimensions[1]) { - adjustYCandidate = dimensions[1] - (maxY + baseY); - if ((minY + baseY + adjustYCandidate) > 0) { - adjustY = (dimensions[1] / 2) - (maxY - (height / 2)) - baseY; - } else { - adjustY = adjustYCandidate; - } - } else if (-baseY < minY) { - adjustYCandidate = -(baseY + minY); - if ((maxY + baseY + adjustYCandidate) < dimensions[1]) { - adjustY = (dimensions[1] / 2) - (maxY - (height / 2)) - baseY; - } else { - adjustY = adjustYCandidate; - } - } - translate[1] += adjustY; - - var baseX = translate[0]; - var minX = (graph.minGraphX - GRAPH_MARGIN) * scale; - var maxX = (graph.maxGraphX + GRAPH_MARGIN) * scale; - - var adjustX = 0; - var adjustXCandidate = 0; - if ((maxX + baseX) < dimensions[0]) { - adjustXCandidate = dimensions[0] - (maxX + baseX); - if ((minX + baseX + adjustXCandidate) > 0) { - adjustX = (dimensions[0] / 2) - (maxX - (width / 2)) - baseX; - } else { - adjustX = adjustXCandidate; - } - } else if (-baseX < minX) { - adjustXCandidate = -(baseX + minX); - if ((maxX + baseX + adjustXCandidate) < dimensions[0]) { - adjustX = (dimensions[0] / 2) - (maxX - (width / 2)) - baseX; - } else { - adjustX = adjustXCandidate; - } - } - translate[0] += adjustX; - return translate; } - translateClipped(translate, scale, transition) { - var graph = this; - var graphNode = this.graphElement.node(); - var translate = this.getVisibleTranslation(translate, scale); - if (transition) { - graphNode.classList.add('visible-transition'); - clearTimeout(graph.transitionTimout); - graph.transitionTimout = setTimeout(function () { - graphNode.classList.remove('visible-transition'); - }, 1000); - } - var translateString = "translate(" + translate[0] + "px," + translate[1] + "px) scale(" + scale + ")"; - graphNode.style.transform = translateString; - graph.dragSvg.translate(translate); - graph.dragSvg.scale(scale); - } - - zoomed() { - this.state.justScaleTransGraph = true; - var scale = this.dragSvg.scale(); - this.translateClipped(d3.event.translate, scale); - } - - getSvgViewDimensions() { - var canvasWidth = this.container.clientWidth; - var documentElement = document.documentElement; - var canvasHeight = documentElement.clientHeight; - return [canvasWidth, canvasHeight]; + return [this.container.clientWidth, this.container.clientHeight]; } + getSvgExtent(): [[number, number], [number, number]] { + return [[0, 0], [this.container.clientWidth, this.container.clientHeight]]; + } minScale() { - var graph = this; - var dimensions = this.getSvgViewDimensions(); - var width = graph.maxGraphX - graph.minGraphX; - var height = graph.maxGraphY - graph.minGraphY; - var minScale = dimensions[0] / (width + GRAPH_MARGIN * 2); - var minScaleYCandidate = dimensions[1] / (height + GRAPH_MARGIN * 2); - if (minScaleYCandidate < minScale) { - minScale = minScaleYCandidate; - } - this.dragSvg.scaleExtent([minScale, 1.5]); + const graph = this; + const dimensions = this.getSvgViewDimensions(); + const minXScale = dimensions[0] / (2 * graph.width); + const minYScale = dimensions[1] / (2 * graph.height); + const minScale = Math.min(minXScale, minYScale); + this.panZoom.scaleExtent([minScale, 40]); return minScale; } - fitGraphViewToWindow() { - this.translateClipped(this.dragSvg.translate(), this.dragSvg.scale()); + onresize() { + const trans = d3.zoomTransform(this.svg.node()); + const ctrans = this.panZoom.constrain()(trans, this.getSvgExtent(), this.panZoom.translateExtent()) + this.panZoom.transform(this.svg, ctrans) } toggleTypes() { @@ -1018,7 +913,7 @@ class GraphView extends View { var graph = this; var minX, maxX, minY, maxY; var hasSelection = false; - graph.visibleNodes.selectAll("g").each(function (n) { + graph.visibleNodes.selectAll("g").each(function (n) { if (graph.state.selection.isSelected(n)) { hasSelection = true; minX = minX ? Math.min(minX, n.x) : n.x; @@ -1037,23 +932,21 @@ class GraphView extends View { } viewGraphRegion(minX, minY, maxX, maxY, transition) { - var graph = this; - var dimensions = this.getSvgViewDimensions(); - var width = maxX - minX; - var height = maxY - minY; - var scale = Math.min(dimensions[0] / width, dimensions[1] / height); - scale = Math.min(1.5, scale); - scale = Math.max(graph.minScale(), scale); - var translation = [-minX * scale, -minY * scale]; - translation = graph.getVisibleTranslation(translation, scale); - graph.translateClipped(translation, scale, transition); + const [width, height] = this.getSvgViewDimensions(); + const dx = maxX - minX; + const dy = maxY - minY; + const x = (minX + maxX) / 2; + const y = (minY + maxY) / 2; + const scale = Math.min(width / (1.1 * dx), height / (1.1 * dy)); + const transform = d3.zoomIdentity.translate(1500, 100).scale(0.75); + this.svg + .transition().duration(300).call(this.panZoom.translateTo, x, y) + .transition().duration(300).call(this.panZoom.scaleTo, scale) + .transition().duration(300).call(this.panZoom.translateTo, x, y); } viewWholeGraph() { - var graph = this; - var minScale = graph.minScale(); - var translation = [0, 0]; - translation = graph.getVisibleTranslation(translation, minScale); - graph.translateClipped(translation, minScale); + this.panZoom.scaleTo(this.svg, 0); + this.panZoom.translateTo(this.svg, this.minGraphX + this.width / 2, this.minGraphY + this.height / 2) } } diff --git a/deps/v8/tools/turbolizer/src/graphmultiview.ts b/deps/v8/tools/turbolizer/src/graphmultiview.ts new file mode 100644 index 00000000000000..66d1103e38ad02 --- /dev/null +++ b/deps/v8/tools/turbolizer/src/graphmultiview.ts @@ -0,0 +1,109 @@ +// 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. + +import {GraphView} from "./graph-view.js" +import {ScheduleView} from "./schedule-view.js" +import {SourceResolver} from "./source-resolver.js" +import {SelectionBroker} from "./selection-broker.js" +import {View, PhaseView} from "./view.js" + +export class GraphMultiView extends View { + sourceResolver: SourceResolver; + selectionBroker: SelectionBroker; + graph: GraphView; + schedule: ScheduleView; + selectMenu: HTMLSelectElement; + currentPhaseView: View & PhaseView; + + createViewElement() { + const pane = document.createElement('div'); + pane.setAttribute('id', "multiview"); + return pane; + } + + constructor(id, selectionBroker, sourceResolver) { + super(id); + const view = this; + view.sourceResolver = sourceResolver; + view.selectionBroker = selectionBroker; + const searchInput = document.getElementById("search-input") as HTMLInputElement; + searchInput.addEventListener("keyup", e => { + if (!view.currentPhaseView) return; + view.currentPhaseView.searchInputAction(searchInput, e) + }); + searchInput.setAttribute("value", window.sessionStorage.getItem("lastSearch") || ""); + this.graph = new GraphView(id, selectionBroker, + (phaseName) => view.displayPhaseByName(phaseName)); + this.schedule = new ScheduleView(id, selectionBroker); + this.selectMenu = (document.getElementById('display-selector')); + } + + initializeSelect() { + const view = this; + view.selectMenu.innerHTML = ''; + view.sourceResolver.forEachPhase((phase) => { + const optionElement = document.createElement("option"); + optionElement.text = phase.name; + view.selectMenu.add(optionElement); + }); + this.selectMenu.onchange = function (this: HTMLSelectElement) { + window.sessionStorage.setItem("lastSelectedPhase", this.selectedIndex.toString()); + view.displayPhase(view.sourceResolver.getPhase(this.selectedIndex)); + } + } + + show(data, rememberedSelection) { + super.show(data, rememberedSelection); + this.initializeSelect(); + const lastPhaseIndex = +window.sessionStorage.getItem("lastSelectedPhase"); + const initialPhaseIndex = this.sourceResolver.repairPhaseId(lastPhaseIndex); + this.selectMenu.selectedIndex = initialPhaseIndex; + this.displayPhase(this.sourceResolver.getPhase(initialPhaseIndex)); + } + + initializeContent() { } + + displayPhase(phase) { + if (phase.type == 'graph') { + this.displayPhaseView(this.graph, phase.data); + } else if (phase.type == 'schedule') { + this.displayPhaseView(this.schedule, phase); + } + } + + displayPhaseView(view, data) { + const rememberedSelection = this.hideCurrentPhase(); + view.show(data, rememberedSelection); + document.getElementById("middle").classList.toggle("scrollable", view.isScrollable()); + this.currentPhaseView = view; + } + + displayPhaseByName(phaseName) { + const phaseId = this.sourceResolver.getPhaseIdByName(phaseName); + this.selectMenu.selectedIndex = phaseId - 1; + this.displayPhase(this.sourceResolver.getPhase(phaseId)); + } + + hideCurrentPhase() { + let rememberedSelection = null; + if (this.currentPhaseView != null) { + rememberedSelection = this.currentPhaseView.detachSelection(); + this.currentPhaseView.hide(); + this.currentPhaseView = null; + } + return rememberedSelection; + } + + onresize() { + if (this.currentPhaseView) this.currentPhaseView.onresize(); + } + + deleteContent() { + this.hideCurrentPhase(); + } + + detachSelection() { + return null; + } +} diff --git a/deps/v8/tools/turbolizer/src/lang-disassembly.ts b/deps/v8/tools/turbolizer/src/lang-disassembly.ts new file mode 100644 index 00000000000000..9312627abd25ed --- /dev/null +++ b/deps/v8/tools/turbolizer/src/lang-disassembly.ts @@ -0,0 +1,14 @@ +// Copyright 2015 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. + +PR.registerLangHandler( + PR.createSimpleLexer( + [ + [PR.PR_STRING, /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$))/, null, '\''], + [PR.PR_PLAIN, /^\s+/, null, ' \r\n\t\xA0'] + ], + [ // fallthroughStylePatterns + [PR.PR_COMMENT, /;; debug: position \d+/, null], + ]), + ['disassembly']); diff --git a/deps/v8/tools/turbolizer/node.js b/deps/v8/tools/turbolizer/src/node.ts similarity index 60% rename from deps/v8/tools/turbolizer/node.js rename to deps/v8/tools/turbolizer/src/node.ts index 237b4d2b2d20f3..95c47cab20faed 100644 --- a/deps/v8/tools/turbolizer/node.js +++ b/deps/v8/tools/turbolizer/src/node.ts @@ -2,30 +2,62 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -var TYPE_HEIGHT = 25; -var DEFAULT_NODE_BUBBLE_RADIUS = 12; -var NODE_INPUT_WIDTH = 50; -var MINIMUM_NODE_INPUT_APPROACH = 15 + 2 * DEFAULT_NODE_BUBBLE_RADIUS; -var MINIMUM_NODE_OUTPUT_APPROACH = 15; +import {NodeOrigin} from "./source-resolver.js" +import {MINIMUM_EDGE_SEPARATION} from "./edge.js" -function isNodeInitiallyVisible(node) { +export const DEFAULT_NODE_BUBBLE_RADIUS = 12; +export const NODE_INPUT_WIDTH = 50; +export const MINIMUM_NODE_OUTPUT_APPROACH = 15; +const MINIMUM_NODE_INPUT_APPROACH = 15 + 2 * DEFAULT_NODE_BUBBLE_RADIUS; + +export function isNodeInitiallyVisible(node) { return node.cfg; } -var Node = { - isControl: function() { +function formatOrigin(origin) { + if (origin.nodeId) { + return `#${origin.nodeId} in phase ${origin.phase}/${origin.reducer}`; + } + if (origin.bytecodePosition) { + return `Bytecode line ${origin.bytecodePosition} in phase ${origin.phase}/${origin.reducer}`; + } + return "unknown origin"; +} + +export class GNode { + control: boolean; + opcode: string; + live: boolean; + inputs: Array; + width: number; + properties: string; + title: string; + label: string; + origin: NodeOrigin; + outputs: Array; + outputApproach: number; + type: string; + id: number; + x: number; + y: number; + visible: boolean; + rank: number; + opinfo: string; + labelbbox: { width: number, height: number }; + + isControl() { return this.control; - }, - isInput: function() { + } + isInput() { return this.opcode == 'Parameter' || this.opcode.endsWith('Constant'); - }, - isLive: function() { + } + isLive() { return this.live !== false; - }, - isJavaScript: function() { + } + isJavaScript() { return this.opcode.startsWith('JS'); - }, - isSimplified: function() { + } + isSimplified() { if (this.isJavaScript()) return false; return this.opcode.endsWith('Phi') || this.opcode.startsWith('Boolean') || @@ -39,16 +71,16 @@ var Node = { (this.opcode == 'AnyToBoolean') || (this.opcode.startsWith('Load') && this.opcode.length > 4) || (this.opcode.startsWith('Store') && this.opcode.length > 5); - }, - isMachine: function() { + } + isMachine() { return !(this.isControl() || this.isInput() || - this.isJavaScript() || this.isSimplified()); - }, - getTotalNodeWidth: function() { + this.isJavaScript() || this.isSimplified()); + } + getTotalNodeWidth() { var inputWidth = this.inputs.length * NODE_INPUT_WIDTH; return Math.max(inputWidth, this.width); - }, - getTitle: function() { + } + getTitle() { var propsString; if (this.properties === undefined) { propsString = ""; @@ -59,32 +91,32 @@ var Node = { } let title = this.title + "\n" + propsString + "\n" + this.opinfo; if (this.origin) { - title += `\nOrigin: #${this.origin.nodeId} in phase ${this.origin.phase}/${this.origin.reducer}`; + title += `\nOrigin: ${formatOrigin(this.origin)}`; } return title; - }, - getDisplayLabel: function() { + } + getDisplayLabel() { var result = this.id + ":" + this.label; if (result.length > 40) { return this.id + ":" + this.opcode; - } else { + } else { return result; } - }, - getType: function() { + } + getType() { return this.type; - }, - getDisplayType: function() { + } + getDisplayType() { var type_string = this.type; if (type_string == undefined) return ""; if (type_string.length > 24) { type_string = type_string.substr(0, 25) + "..."; } return type_string; - }, - deepestInputRank: function() { + } + deepestInputRank() { var deepestRank = 0; - this.inputs.forEach(function(e) { + this.inputs.forEach(function (e) { if (e.isVisible() && !e.isBackEdge()) { if (e.source.rank > deepestRank) { deepestRank = e.source.rank; @@ -92,17 +124,17 @@ var Node = { } }); return deepestRank; - }, - areAnyOutputsVisible: function() { + } + areAnyOutputsVisible() { var visibleCount = 0; - this.outputs.forEach(function(e) { if (e.isVisible()) ++visibleCount; }); + this.outputs.forEach(function (e) { if (e.isVisible())++visibleCount; }); if (this.outputs.length == visibleCount) return 2; if (visibleCount != 0) return 1; return 0; - }, - setOutputVisibility: function(v) { + } + setOutputVisibility(v) { var result = false; - this.outputs.forEach(function(e) { + this.outputs.forEach(function (e) { e.visible = v; if (v) { if (!e.target.visible) { @@ -112,8 +144,8 @@ var Node = { } }); return result; - }, - setInputVisibility: function(i, v) { + } + setInputVisibility(i, v) { var edge = this.inputs[i]; edge.visible = v; if (v) { @@ -123,29 +155,28 @@ var Node = { } } return false; - }, - getInputApproach: function(index) { + } + getInputApproach(index) { return this.y - MINIMUM_NODE_INPUT_APPROACH - (index % 4) * MINIMUM_EDGE_SEPARATION - DEFAULT_NODE_BUBBLE_RADIUS - }, - getOutputApproach: function(graph, index) { + } + getOutputApproach(graph) { return this.y + this.outputApproach + graph.getNodeHeight(this) + + DEFAULT_NODE_BUBBLE_RADIUS; - }, - getInputX: function(index) { + } + getInputX(index) { var result = this.getTotalNodeWidth() - (NODE_INPUT_WIDTH / 2) + - (index - this.inputs.length + 1) * NODE_INPUT_WIDTH; + (index - this.inputs.length + 1) * NODE_INPUT_WIDTH; return result; - }, - getOutputX: function() { + } + getOutputX() { return this.getTotalNodeWidth() - (NODE_INPUT_WIDTH / 2); - }, - getFunctionRelativeSourcePosition: function(graph) { - return this.pos - graph.sourcePosition; - }, - hasBackEdges: function() { + } + hasBackEdges() { return (this.opcode == "Loop") || ((this.opcode == "Phi" || this.opcode == "EffectPhi") && - this.inputs[this.inputs.length - 1].source.opcode == "Loop"); + this.inputs[this.inputs.length - 1].source.opcode == "Loop"); } }; + +export const nodeToStr = (n: GNode) => "N" + n.id; diff --git a/deps/v8/tools/turbolizer/schedule-view.js b/deps/v8/tools/turbolizer/src/schedule-view.ts similarity index 70% rename from deps/v8/tools/turbolizer/schedule-view.js rename to deps/v8/tools/turbolizer/src/schedule-view.ts index 0864fceea7362b..f62aba0c866cbc 100644 --- a/deps/v8/tools/turbolizer/schedule-view.js +++ b/deps/v8/tools/turbolizer/src/schedule-view.ts @@ -2,23 +2,24 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -"use strict"; +import {Schedule,SourceResolver} from "./source-resolver.js" +import {isIterable} from "./util.js" +import {PhaseView} from "./view.js" +import {TextView} from "./text-view.js" -class ScheduleView extends TextView { +export class ScheduleView extends TextView implements PhaseView { + schedule: Schedule; + sourceResolver: SourceResolver; createViewElement() { const pane = document.createElement('div'); pane.setAttribute('id', "schedule"); - pane.innerHTML = - `
-       
    -
-
`; return pane; } constructor(parentId, broker) { - super(parentId, broker, null, false); + super(parentId, broker, null); + this.sourceResolver = broker.sourceResolver; } attachSelection(s) { @@ -26,22 +27,32 @@ class ScheduleView extends TextView { if (!(s instanceof Set)) return; view.selectionHandler.clear(); view.blockSelectionHandler.clear(); - view.sourcePositionSelectionHandler.clear(); const selected = new Array(); for (const key of s) selected.push(key); view.selectionHandler.select(selected, true); } + detachSelection() { + this.blockSelection.clear(); + return this.selection.detachSelection(); + } + + initializeContent(data, rememberedSelection) { + this.divNode.innerHTML = ''; + this.schedule = data.schedule + this.addBlocks(data.schedule.blocks); + this.attachSelection(rememberedSelection); + } + createElementFromString(htmlString) { var div = document.createElement('div'); div.innerHTML = htmlString.trim(); return div.firstChild; } - elementForBlock(block) { const view = this; - function createElement(tag, cls, content) { + function createElement(tag: string, cls: string | Array, content?: string) { const el = document.createElement(tag); if (isIterable(cls)) { for (const c of cls) el.classList.add(c); @@ -62,8 +73,31 @@ class ScheduleView extends TextView { }; } + function getMarker(start, end) { + if (start != end) { + return ["⊙", `This node generated instructions in range [${start},${end}). ` + + `This is currently unreliable for constants.`]; + } + if (start != -1) { + return ["·", `The instruction selector did not generate instructions ` + + `for this node, but processed the node at instruction ${start}. ` + + `This usually means that this node was folded into another node; ` + + `the highlighted machine code is a guess.`]; + } + return ["", `This not is not in the final schedule.`] + } + function createElementForNode(node) { const nodeEl = createElement("div", "node"); + + const [start, end] = view.sourceResolver.getInstruction(node.id); + const [marker, tooltip] = getMarker(start, end); + const instrMarker = createElement("div", ["instr-marker", "com"], marker); + instrMarker.setAttribute("title", tooltip); + instrMarker.onclick = mkNodeLinkHandler(node.id); + nodeEl.appendChild(instrMarker); + + const node_id = createElement("div", ["node-id", "tag", "clickable"], node.id); node_id.onclick = mkNodeLinkHandler(node.id); view.addHtmlElementForNodeId(node.id, node_id); @@ -80,6 +114,7 @@ class ScheduleView extends TextView { } nodeEl.appendChild(node_parameters); } + return nodeEl; } @@ -94,6 +129,13 @@ class ScheduleView extends TextView { } const schedule_block = createElement("div", "schedule-block"); + + const [start, end] = view.sourceResolver.getInstructionRangeForBlock(block.id); + const instrMarker = createElement("div", ["instr-marker", "com"], "⊙"); + instrMarker.setAttribute("title", `Instructions range for this block is [${start}, ${end})`) + instrMarker.onclick = mkBlockLinkHandler(block.id); + schedule_block.appendChild(instrMarker); + const block_id = createElement("div", ["block-id", "com", "clickable"], block.id); block_id.onclick = mkBlockLinkHandler(block.id); schedule_block.appendChild(block_id); @@ -106,7 +148,7 @@ class ScheduleView extends TextView { if (block.pred.length) schedule_block.appendChild(block_pred); const nodes = createElement("div", "nodes"); for (const node of block.nodes) { - nodes.appendChild(createElementForNode(node, block.id)); + nodes.appendChild(createElementForNode(node)); } schedule_block.appendChild(nodes); const block_succ = createElement("div", ["successor-list", "block-list", "comma-sep-list"]); @@ -127,25 +169,12 @@ class ScheduleView extends TextView { } } - initializeContent(data, rememberedSelection) { - this.clearText(); - this.schedule = data.schedule - this.addBlocks(data.schedule.blocks); - this.attachSelection(rememberedSelection); - } - - detachSelection() { - this.blockSelection.clear(); - this.sourcePositionSelection.clear(); - return this.selection.detachSelection(); - } - lineString(node) { return `${node.id}: ${node.label}(${node.inputs.join(", ")})` } - searchInputAction(view, searchBar) { - d3.event.stopPropagation(); + searchInputAction(searchBar, e) { + e.stopPropagation(); this.selectionHandler.clear(); const query = searchBar.value; if (query.length == 0) return; @@ -160,4 +189,6 @@ class ScheduleView extends TextView { } this.selectionHandler.select(select, true); } + + onresize() { } } diff --git a/deps/v8/tools/turbolizer/selection-broker.js b/deps/v8/tools/turbolizer/src/selection-broker.ts similarity index 78% rename from deps/v8/tools/turbolizer/selection-broker.js rename to deps/v8/tools/turbolizer/src/selection-broker.ts index 0ae006aa0151bd..e20fd977d29aa3 100644 --- a/deps/v8/tools/turbolizer/selection-broker.js +++ b/deps/v8/tools/turbolizer/src/selection-broker.ts @@ -2,7 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -class SelectionBroker { +import {SourceResolver, sourcePositionValid} from "./source-resolver.js" + +export class SelectionBroker { + sourceResolver: SourceResolver; + sourcePositionHandlers: Array; + nodeHandlers: Array; + blockHandlers: Array; + constructor(sourceResolver) { this.sourcePositionHandlers = []; this.nodeHandlers = []; @@ -25,29 +32,28 @@ class SelectionBroker { broadcastSourcePositionSelect(from, sourcePositions, selected) { let broker = this; sourcePositions = sourcePositions.filter((l) => { - if (typeof l.scriptOffset == 'undefined' - || typeof l.inliningId == 'undefined') { + if (!sourcePositionValid(l)) { console.log("Warning: invalid source position"); return false; } return true; }); - for (var b of this.sourcePositionHandlers) { + for (const b of this.sourcePositionHandlers) { if (b != from) b.brokeredSourcePositionSelect(sourcePositions, selected); } const nodes = this.sourceResolver.sourcePositionsToNodeIds(sourcePositions); - for (var b of this.nodeHandlers) { + for (const b of this.nodeHandlers) { if (b != from) b.brokeredNodeSelect(nodes, selected); } } broadcastNodeSelect(from, nodes, selected) { let broker = this; - for (var b of this.nodeHandlers) { + for (const b of this.nodeHandlers) { if (b != from) b.brokeredNodeSelect(nodes, selected); } const sourcePositions = this.sourceResolver.nodeIdsToSourcePositions(nodes); - for (var b of this.sourcePositionHandlers) { + for (const b of this.sourcePositionHandlers) { if (b != from) b.brokeredSourcePositionSelect(sourcePositions, selected); } } diff --git a/deps/v8/tools/turbolizer/src/selection-handler.ts b/deps/v8/tools/turbolizer/src/selection-handler.ts new file mode 100644 index 00000000000000..bf0719c8a6626c --- /dev/null +++ b/deps/v8/tools/turbolizer/src/selection-handler.ts @@ -0,0 +1,24 @@ +// 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. + +interface SelectionHandler { + clear(): void; + select(nodeIds: any, selected: any): void; + brokeredClear(): void; + brokeredSourcePositionSelect(sourcePositions: any, selected: any): void; +}; + +interface NodeSelectionHandler { + clear(): void; + select(nodeIds: any, selected: any): void; + brokeredClear(): void; + brokeredNodeSelect(nodeIds: any, selected: any): void; +}; + +interface BlockSelectionHandler { + clear(): void; + select(nodeIds: any, selected: any): void; + brokeredClear(): void; + brokeredBlockSelect(blockIds: any, selected: any): void; +}; diff --git a/deps/v8/tools/turbolizer/selection.js b/deps/v8/tools/turbolizer/src/selection.ts similarity index 84% rename from deps/v8/tools/turbolizer/selection.js rename to deps/v8/tools/turbolizer/src/selection.ts index 9bd937c84a5916..b02a3e9cbb7565 100644 --- a/deps/v8/tools/turbolizer/selection.js +++ b/deps/v8/tools/turbolizer/src/selection.ts @@ -2,17 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -class Selection { +import {isIterable} from "./util.js" + +export class MySelection { + selection: any; + stringKey: (o: any) => string; + constructor(stringKeyFnc) { this.selection = new Map(); this.stringKey = stringKeyFnc; } - isEmpty() { + isEmpty(): boolean { return this.selection.size == 0; } - clear() { + clear(): void { this.selection = new Map(); } @@ -31,11 +36,11 @@ class Selection { } } - isSelected(i) { + isSelected(i): boolean { return this.selection.has(this.stringKey(i)); } - isKeySelected(key) { + isKeySelected(key: string): boolean { return this.selection.has(key); } diff --git a/deps/v8/tools/turbolizer/source-resolver.js b/deps/v8/tools/turbolizer/src/source-resolver.ts similarity index 55% rename from deps/v8/tools/turbolizer/source-resolver.js rename to deps/v8/tools/turbolizer/src/source-resolver.ts index dd3732ad569524..b2412d3e3108f9 100644 --- a/deps/v8/tools/turbolizer/source-resolver.js +++ b/deps/v8/tools/turbolizer/src/source-resolver.ts @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import {sortUnique, anyToString} from "./util.js" + function sourcePositionLe(a, b) { if (a.inliningId == b.inliningId) { return a.scriptOffset - b.scriptOffset; @@ -14,12 +16,82 @@ function sourcePositionEq(a, b) { a.scriptOffset == b.scriptOffset; } -function sourcePositionToStringKey(sourcePosition) { +export function sourcePositionToStringKey(sourcePosition): string { if (!sourcePosition) return "undefined"; - return "" + sourcePosition.inliningId + ":" + sourcePosition.scriptOffset; + if (sourcePosition.inliningId && sourcePosition.scriptOffset) + return "SP:" + sourcePosition.inliningId + ":" + sourcePosition.scriptOffset; + if (sourcePosition.bytecodePosition) + return "BCP:" + sourcePosition.bytecodePosition; + return "undefined"; +} + +export function sourcePositionValid(l) { + return (typeof l.scriptOffset !== undefined + && typeof l.inliningId !== undefined) || typeof l.bytecodePosition != undefined; +} + +export interface SourcePosition { + scriptOffset: number; + inliningId: number; +} + +interface TurboFanOrigin { + phase: string; + reducer: string; +} + +export interface NodeOrigin { + nodeId: number; +} + +interface BytecodePosition { + bytecodePosition: number; +} + +type Origin = NodeOrigin | BytecodePosition; +type TurboFanNodeOrigin = NodeOrigin & TurboFanOrigin; +type TurboFanBytecodeOrigin = BytecodePosition & TurboFanOrigin; + +type AnyPosition = SourcePosition | BytecodePosition; + +export interface Source { + sourcePositions: Array; + sourceName: string; + functionName: string; + sourceText: string; + sourceId: number; + startPosition?: number; +} +interface Inlining { + inliningPosition: SourcePosition; + sourceId: number; +} +interface Phase { + type: string; + name: string; + data: any; +} + +export interface Schedule { + nodes: Array; } -class SourceResolver { +export class SourceResolver { + nodePositionMap: Array; + sources: Array; + inlinings: Array; + inliningsMap: Map; + positionToNodes: Map>; + phases: Array; + phaseNames: Map; + disassemblyPhase: Phase; + lineToSourcePositions: Map>; + nodeIdToInstructionRange: Array<[number, number]>; + blockIdToInstructionRange: Array<[number, number]>; + instructionToPCOffset: Array; + pcOffsetToInstructions: Map>; + + constructor() { // Maps node ids to source positions. this.nodePositionMap = []; @@ -37,6 +109,16 @@ class SourceResolver { this.phaseNames = new Map(); // The disassembly phase is stored separately. this.disassemblyPhase = undefined; + // Maps line numbers to source positions + this.lineToSourcePositions = new Map(); + // Maps node ids to instruction ranges. + this.nodeIdToInstructionRange = []; + // Maps block ids to instruction ranges. + this.blockIdToInstructionRange = []; + // Maps instruction numbers to PC offsets. + this.instructionToPCOffset = []; + // Maps PC offsets to instructions. + this.pcOffsetToInstructions = new Map(); } setSources(sources, mainBackup) { @@ -55,27 +137,27 @@ class SourceResolver { setInlinings(inlinings) { if (inlinings) { - for (const [inliningId, inlining] of Object.entries(inlinings)) { + for (const [inliningId, inlining] of Object.entries(inlinings)) { this.inlinings[inliningId] = inlining; this.inliningsMap.set(sourcePositionToStringKey(inlining.inliningPosition), inlining); } } // This is a default entry for the script itself that helps // keep other code more uniform. - this.inlinings[-1] = { sourceId: -1 }; + this.inlinings[-1] = { sourceId: -1, inliningPosition: null }; } setNodePositionMap(map) { if (!map) return; if (typeof map[0] != 'object') { const alternativeMap = {}; - for (const [nodeId, scriptOffset] of Object.entries(map)) { + for (const [nodeId, scriptOffset] of Object.entries(map)) { alternativeMap[nodeId] = { scriptOffset: scriptOffset, inliningId: -1 }; } map = alternativeMap; }; - for (const [nodeId, sourcePosition] of Object.entries(map)) { + for (const [nodeId, sourcePosition] of Object.entries(map)) { if (sourcePosition == undefined) { console.log("Warning: undefined source position ", sourcePosition, " for nodeId ", nodeId); } @@ -111,7 +193,7 @@ class SourceResolver { return nodeIds; } - nodeIdsToSourcePositions(nodeIds) { + nodeIdsToSourcePositions(nodeIds): Array { const sourcePositions = new Map(); for (const nodeId of nodeIds) { let sp = this.nodePositionMap[nodeId]; @@ -213,15 +295,109 @@ class SourceResolver { return inliningStack; } + recordOrigins(phase) { + if (phase.type != "graph") return; + for (const node of phase.data.nodes) { + if (node.origin != undefined && + node.origin.bytecodePosition != undefined) { + const position = { bytecodePosition: node.origin.bytecodePosition }; + this.nodePositionMap[node.id] = position; + let key = sourcePositionToStringKey(position); + if (!this.positionToNodes.has(key)) { + this.positionToNodes.set(key, []); + } + const A = this.positionToNodes.get(key); + if (!A.includes(node.id)) A.push("" + node.id); + } + } + } + + readNodeIdToInstructionRange(nodeIdToInstructionRange) { + for (const [nodeId, range] of Object.entries<[number, number]>(nodeIdToInstructionRange)) { + this.nodeIdToInstructionRange[nodeId] = range; + } + } + + readBlockIdToInstructionRange(blockIdToInstructionRange) { + for (const [blockId, range] of Object.entries<[number, number]>(blockIdToInstructionRange)) { + this.blockIdToInstructionRange[blockId] = range; + } + } + + getInstruction(nodeId):[number, number] { + const X = this.nodeIdToInstructionRange[nodeId]; + if (X === undefined) return [-1, -1]; + return X; + } + + getInstructionRangeForBlock(blockId):[number, number] { + const X = this.blockIdToInstructionRange[blockId]; + if (X === undefined) return [-1, -1]; + return X; + } + + readInstructionOffsetToPCOffset(instructionToPCOffset) { + for (const [instruction, offset] of Object.entries(instructionToPCOffset)) { + this.instructionToPCOffset[instruction] = offset; + if (!this.pcOffsetToInstructions.has(offset)) { + this.pcOffsetToInstructions.set(offset, []); + } + this.pcOffsetToInstructions.get(offset).push(instruction); + } + console.log(this.pcOffsetToInstructions); + } + + hasPCOffsets() { + return this.pcOffsetToInstructions.size > 0; + } + + + nodesForPCOffset(offset): [Array, Array] { + const keys = Array.from(this.pcOffsetToInstructions.keys()).sort((a, b) => b - a); + if (keys.length === 0) return [[],[]]; + for (const key of keys) { + if (key <= offset) { + const instrs = this.pcOffsetToInstructions.get(key); + const nodes = []; + const blocks = []; + for (const instr of instrs) { + for (const [nodeId, range] of this.nodeIdToInstructionRange.entries()) { + if (!range) continue; + const [start, end] = range; + if (start == end && instr == start) { + nodes.push("" + nodeId); + } + if (start <= instr && instr < end) { + nodes.push("" + nodeId); + } + } + } + return [nodes, blocks]; + } + } + return [[],[]]; + } + parsePhases(phases) { - for (const [phaseId, phase] of Object.entries(phases)) { + for (const [phaseId, phase] of Object.entries(phases)) { if (phase.type == 'disassembly') { this.disassemblyPhase = phase; } else if (phase.type == 'schedule') { this.phases.push(this.parseSchedule(phase)) this.phaseNames.set(phase.name, this.phases.length); + } else if (phase.type == 'instructions') { + if (phase.nodeIdToInstructionRange) { + this.readNodeIdToInstructionRange(phase.nodeIdToInstructionRange); + } + if (phase.blockIdtoInstructionRange) { + this.readBlockIdToInstructionRange(phase.blockIdtoInstructionRange); + } + if (phase.instructionOffsetToPCOffset) { + this.readInstructionOffsetToPCOffset(phase.instructionOffsetToPCOffset); + } } else { this.phases.push(phase); + this.recordOrigins(phase); this.phaseNames.set(phase.name, this.phases.length); } } @@ -243,6 +419,28 @@ class SourceResolver { this.phases.forEach(f); } + addAnyPositionToLine(lineNumber: number | String, sourcePosition: AnyPosition) { + const lineNumberString = anyToString(lineNumber); + if (!this.lineToSourcePositions.has(lineNumberString)) { + this.lineToSourcePositions.set(lineNumberString, []); + } + const A = this.lineToSourcePositions.get(lineNumberString); + if (!A.includes(sourcePosition)) A.push(sourcePosition); + } + + setSourceLineToBytecodePosition(sourceLineToBytecodePosition: Array | undefined) { + if (!sourceLineToBytecodePosition) return; + sourceLineToBytecodePosition.forEach((pos, i) => { + this.addAnyPositionToLine(i, { bytecodePosition: pos }); + }); + } + + linetoSourcePositions(lineNumber: number | String) { + const positions = this.lineToSourcePositions.get(anyToString(lineNumber)); + if (positions === undefined) return []; + return positions; + } + parseSchedule(phase) { function createNode(state, match) { let inputs = []; @@ -251,11 +449,13 @@ class SourceResolver { const nodeIdStrings = nodeIdsString.split(','); inputs = nodeIdStrings.map((n) => Number.parseInt(n, 10)); } - const node = {id: Number.parseInt(match.groups.id, 10), - label: match.groups.label, - inputs: inputs}; + const node = { + id: Number.parseInt(match.groups.id, 10), + label: match.groups.label, + inputs: inputs + }; if (match.groups.blocks) { - const nodeIdsString = match.groups.blocks.replace(/\s/g, '').replace(/B/g,''); + const nodeIdsString = match.groups.blocks.replace(/\s/g, '').replace(/B/g, ''); const nodeIdStrings = nodeIdsString.split(','); const successors = nodeIdStrings.map((n) => Number.parseInt(n, 10)); state.currentBlock.succ = successors; @@ -270,11 +470,13 @@ class SourceResolver { const blockIdStrings = blockIdsString.split(','); predecessors = blockIdStrings.map((n) => Number.parseInt(n, 10)); } - const block = {id: Number.parseInt(match.groups.id, 10), - isDeferred: match.groups.deferred != undefined, - pred: predecessors.sort(), - succ: [], - nodes: []}; + const block = { + id: Number.parseInt(match.groups.id, 10), + isDeferred: match.groups.deferred != undefined, + pred: predecessors.sort(), + succ: [], + nodes: [] + }; state.blocks[block.id] = block; state.currentBlock = block; } @@ -284,7 +486,7 @@ class SourceResolver { const rules = [ { lineRegexps: - [ /^\s*(?\d+):\ (?