diff --git a/deps/v8/.DEPS.git b/deps/v8/.DEPS.git index e1e6982c05e..7775744953a 100644 --- a/deps/v8/.DEPS.git +++ b/deps/v8/.DEPS.git @@ -13,8 +13,14 @@ vars = { deps = { 'v8/build/gyp': Var('git_url') + '/external/gyp.git@a3e2a5caf24a1e0a45401e09ad131210bf16b852', + 'v8/buildtools': + Var('git_url') + '/chromium/buildtools.git@fb782d4369d5ae04f17a2fceef7de5a63e50f07b', + 'v8/testing/gmock': + Var('git_url') + '/external/googlemock.git@896ba0e03f520fb9b6ed582bde2bd00847e3c3f2', + 'v8/testing/gtest': + Var('git_url') + '/external/googletest.git@4650552ff637bb44ecf7784060091cbed3252211', 'v8/third_party/icu': - Var('git_url') + '/chromium/deps/icu46.git@7a1ec88f69e25b3efcf76196d07f7815255db025', + Var('git_url') + '/chromium/deps/icu52.git@26d8859357ac0bfb86b939bf21c087b8eae22494', } deps_os = { @@ -28,14 +34,68 @@ deps_os = { } include_rules = [ - + '+include', + '+unicode', + '+third_party/fdlibm' ] skip_child_includes = [ - + 'build', + 'third_party' ] hooks = [ + { + 'action': + [ + 'download_from_google_storage', + '--no_resume', + '--platform=win32', + '--no_auth', + '--bucket', + 'chromium-clang-format', + '-s', + 'v8/buildtools/win/clang-format.exe.sha1' +], + 'pattern': + '.', + 'name': + 'clang_format_win' +}, + { + 'action': + [ + 'download_from_google_storage', + '--no_resume', + '--platform=darwin', + '--no_auth', + '--bucket', + 'chromium-clang-format', + '-s', + 'v8/buildtools/mac/clang-format.sha1' +], + 'pattern': + '.', + 'name': + 'clang_format_mac' +}, + { + 'action': + [ + 'download_from_google_storage', + '--no_resume', + '--platform=linux*', + '--no_auth', + '--bucket', + 'chromium-clang-format', + '-s', + 'v8/buildtools/linux64/clang-format.sha1' +], + 'pattern': + '.', + 'name': + 'clang_format_linux' +}, { 'action': [ diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index ebcb5816b7d..d0d4b436df1 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -21,11 +21,18 @@ #*# *~ .cpplint-cache +.cproject .d8_history +.gclient_entries +.project +.pydevproject +.settings .*.sw? bsuite d8 d8_g +gccauses +gcsuspects shell shell_g /_* @@ -33,6 +40,7 @@ shell_g /build/gyp /build/ipch/ /build/Release +/buildtools /hydrogen.cfg /obj /out @@ -45,13 +53,18 @@ shell_g /test/benchmarks/sunspider /test/mozilla/CHECKED_OUT_VERSION /test/mozilla/data +/test/mozilla/data.old /test/mozilla/downloaded_* /test/promises-aplus/promises-tests /test/promises-aplus/promises-tests.tar.gz /test/promises-aplus/sinon /test/test262/data +/test/test262/data.old /test/test262/tc39-test262-* -/third_party +/testing/gmock +/testing/gtest +/third_party/icu +/third_party/llvm /tools/jsfunfuzz /tools/jsfunfuzz.zip /tools/oom_dump/oom_dump diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index 4ef2bcca339..7ac08156994 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -13,6 +13,7 @@ Bloomberg Finance L.P. NVIDIA Corporation BlackBerry Limited Opera Software ASA +Intel Corporation Akinori MUSHA Alexander Botero-Lowry @@ -24,6 +25,7 @@ Baptiste Afsa Bert Belder Burcu Dogan Craig Schlenter +Chunyang Dai Daniel Andersson Daniel James Derek J Conrod @@ -64,6 +66,7 @@ Subrato K De Tobias Burnus Vincent Belliard Vlad Burlik +Weiliang Lin Xi Qian Yuqiang Xian Zaheer Ahmad diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index 2a6178eab07..efa4b717c9a 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -14,17 +14,11 @@ v8_enable_verify_heap = false v8_interpreted_regexp = false v8_object_print = false v8_postmortem_support = false -v8_use_default_platform = true v8_use_snapshot = true - -if (is_debug) { - v8_enable_extra_checks = true -} else { - v8_enable_extra_checks = false -} - -# TODO(jochen): Add support for want_seperate_host_toolset. -# TODO(jochen): Add toolchain.gypi support. +v8_use_external_startup_data = false +v8_enable_extra_checks = is_debug +v8_target_arch = cpu_arch +v8_random_seed = "314159265" ############################################################################### @@ -33,14 +27,32 @@ if (is_debug) { config("internal_config") { visibility = ":*" # Only targets in this file can depend on this. - include_dirs = [ "src" ] + include_dirs = [ "." ] if (component_mode == "shared_library") { defines = [ + "V8_SHARED", "BUILDING_V8_SHARED", + ] + } +} + +config("internal_config_base") { + visibility = ":*" # Only targets in this file can depend on this. + + include_dirs = [ "." ] +} + +# This config should only be applied to code using V8 and not any V8 code +# itself. +config("external_config") { + if (is_component_build) { + defines = [ "V8_SHARED", + "USING_V8_SHARED", ] } + include_dirs = [ "include" ] } config("features") { @@ -83,11 +95,6 @@ config("features") { "V8_I18N_SUPPORT", ] } - if (v8_use_default_platform == true) { - defines += [ - "V8_USE_DEFAULT_PLATFORM", - ] - } if (v8_compress_startup_data == "bz2") { defines += [ "COMPRESS_STARTUP_DATA_BZ2", @@ -103,25 +110,62 @@ config("features") { "ENABLE_HANDLE_ZAPPING", ] } + if (v8_use_external_startup_data == true) { + defines += [ + "V8_USE_EXTERNAL_STARTUP_DATA", + ] + } } -############################################################################### -# Actions -# - -# TODO(jochen): Do actions need visibility settings as well? -action("generate_trig_table") { +config("toolchain") { visibility = ":*" # Only targets in this file can depend on this. - script = "tools/generate-trig-table.py" + defines = [] + cflags = [] - outputs = [ - "$target_gen_dir/trig-table.cc" - ] + # TODO(jochen): Add support for arm, mips, mipsel. - args = rebase_path(outputs, root_build_dir) + if (v8_target_arch == "arm64") { + defines += [ + "V8_TARGET_ARCH_ARM64", + ] + } + if (v8_target_arch == "x86") { + defines += [ + "V8_TARGET_ARCH_IA32", + ] + } + if (v8_target_arch == "x64") { + defines += [ + "V8_TARGET_ARCH_X64", + ] + } + if (is_win) { + defines += [ + "WIN32", + ] + # TODO(jochen): Support v8_enable_prof. + } + + # TODO(jochen): Add support for compiling with simulators. + + if (is_debug) { + # TODO(jochen): Add support for different debug optimization levels. + defines += [ + "ENABLE_DISASSEMBLER", + "V8_ENABLE_CHECKS", + "OBJECT_PRINT", + "VERIFY_HEAP", + "DEBUG", + "OPTIMIZED_DEBUG", + ] + } } +############################################################################### +# Actions +# + action("js2c") { visibility = ":*" # Only targets in this file can depend on this. @@ -134,9 +178,11 @@ action("js2c") { sources = [ "src/runtime.js", "src/v8natives.js", + "src/symbol.js", "src/array.js", "src/string.js", "src/uri.js", + "third_party/fdlibm/fdlibm.js", "src/math.js", "src/messages.js", "src/apinatives.js", @@ -148,8 +194,14 @@ action("js2c") { "src/regexp.js", "src/arraybuffer.js", "src/typedarray.js", + "src/collection.js", + "src/collection-iterator.js", + "src/weak_collection.js", + "src/promise.js", "src/object-observe.js", "src/macros.py", + "src/array-iterator.js", + "src/string-iterator.js", ] outputs = [ @@ -160,10 +212,19 @@ action("js2c") { sources += [ "src/i18n.js" ] } - args = - rebase_path(outputs, root_build_dir) + - [ "EXPERIMENTAL", v8_compress_startup_data ] + - rebase_path(sources, root_build_dir) + args = [ + rebase_path("$target_gen_dir/libraries.cc", root_build_dir), + "CORE", + v8_compress_startup_data + ] + rebase_path(sources, root_build_dir) + + if (v8_use_external_startup_data) { + outputs += [ "$target_gen_dir/libraries.bin" ] + args += [ + "--startup_blob", + rebase_path("$target_gen_dir/libraries.bin", root_build_dir) + ] + } } action("js2c_experimental") { @@ -177,26 +238,53 @@ action("js2c_experimental") { sources = [ "src/macros.py", - "src/symbol.js", "src/proxy.js", - "src/collection.js", - "src/weak_collection.js", - "src/promise.js", "src/generator.js", - "src/array-iterator.js", "src/harmony-string.js", "src/harmony-array.js", - "src/harmony-math.js", ] outputs = [ "$target_gen_dir/experimental-libraries.cc" ] - args = - rebase_path(outputs, root_build_dir) + - [ "CORE", v8_compress_startup_data ] + - rebase_path(sources, root_build_dir) + args = [ + rebase_path("$target_gen_dir/experimental-libraries.cc", root_build_dir), + "EXPERIMENTAL", + v8_compress_startup_data + ] + rebase_path(sources, root_build_dir) + + if (v8_use_external_startup_data) { + outputs += [ "$target_gen_dir/libraries_experimental.bin" ] + args += [ + "--startup_blob", + rebase_path("$target_gen_dir/libraries_experimental.bin", root_build_dir) + ] + } +} + +if (v8_use_external_startup_data) { + action("natives_blob") { + visibility = ":*" # Only targets in this file can depend on this. + + deps = [ + ":js2c", + ":js2c_experimental" + ] + + sources = [ + "$target_gen_dir/libraries.bin", + "$target_gen_dir/libraries_experimental.bin" + ] + + outputs = [ + "$root_gen_dir/natives_blob.bin" + ] + + script = "tools/concatenate-files.py" + + args = rebase_path(sources + outputs, root_build_dir) + } } action("postmortem-metadata") { @@ -218,6 +306,40 @@ action("postmortem-metadata") { rebase_path(sources, root_build_dir) } +action("run_mksnapshot") { + visibility = ":*" # Only targets in this file can depend on this. + + deps = [ ":mksnapshot($host_toolchain)" ] + + script = "tools/run.py" + + outputs = [ + "$target_gen_dir/snapshot.cc" + ] + + args = [ + "./" + rebase_path(get_label_info(":mksnapshot($host_toolchain)", + "root_out_dir") + "/mksnapshot", + root_build_dir), + "--log-snapshot-positions", + "--logfile", rebase_path("$target_gen_dir/snapshot.log", root_build_dir), + rebase_path("$target_gen_dir/snapshot.cc", root_build_dir) + ] + + if (v8_random_seed != "0") { + args += [ "--random-seed", v8_random_seed ] + } + + if (v8_use_external_startup_data) { + outputs += [ "$root_gen_dir/snapshot_blob.bin" ] + args += [ + "--startup_blob", + rebase_path("$root_gen_dir/snapshot_blob.bin", root_build_dir) + ] + } +} + + ############################################################################### # Source Sets (aka static libraries) # @@ -228,18 +350,64 @@ source_set("v8_nosnapshot") { deps = [ ":js2c", ":js2c_experimental", - ":generate_trig_table", ":v8_base", ] sources = [ "$target_gen_dir/libraries.cc", "$target_gen_dir/experimental-libraries.cc", - "$target_gen_dir/trig-table.cc", "src/snapshot-empty.cc", + "src/snapshot-common.cc", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ ":internal_config", ":features", ":toolchain" ] +} + +source_set("v8_snapshot") { + visibility = ":*" # Only targets in this file can depend on this. + + deps = [ + ":js2c", + ":js2c_experimental", + ":run_mksnapshot", + ":v8_base", + ] + + sources = [ + "$target_gen_dir/libraries.cc", + "$target_gen_dir/experimental-libraries.cc", + "$target_gen_dir/snapshot.cc", + "src/snapshot-common.cc", ] - configs += [ ":internal_config", ":features" ] + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ ":internal_config", ":features", ":toolchain" ] +} + +if (v8_use_external_startup_data) { + source_set("v8_external_snapshot") { + visibility = ":*" # Only targets in this file can depend on this. + + deps = [ + ":js2c", + ":js2c_experimental", + ":run_mksnapshot", + ":v8_base", + ":natives_blob", + ] + + sources = [ + "src/natives-external.cc", + "src/snapshot-external.cc", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ ":internal_config", ":features", ":toolchain" ] + } } source_set("v8_base") { @@ -262,10 +430,10 @@ source_set("v8_base") { "src/assembler.h", "src/assert-scope.h", "src/assert-scope.cc", + "src/ast-value-factory.cc", + "src/ast-value-factory.h", "src/ast.cc", "src/ast.h", - "src/atomicops.h", - "src/atomicops_internals_x86_gcc.cc", "src/bignum-dtoa.cc", "src/bignum-dtoa.h", "src/bignum.cc", @@ -291,6 +459,95 @@ source_set("v8_base") { "src/codegen.h", "src/compilation-cache.cc", "src/compilation-cache.h", + "src/compiler/ast-graph-builder.cc", + "src/compiler/ast-graph-builder.h", + "src/compiler/code-generator-impl.h", + "src/compiler/code-generator.cc", + "src/compiler/code-generator.h", + "src/compiler/common-node-cache.h", + "src/compiler/common-operator.h", + "src/compiler/control-builders.cc", + "src/compiler/control-builders.h", + "src/compiler/frame.h", + "src/compiler/gap-resolver.cc", + "src/compiler/gap-resolver.h", + "src/compiler/generic-algorithm-inl.h", + "src/compiler/generic-algorithm.h", + "src/compiler/generic-graph.h", + "src/compiler/generic-node-inl.h", + "src/compiler/generic-node.h", + "src/compiler/graph-builder.cc", + "src/compiler/graph-builder.h", + "src/compiler/graph-inl.h", + "src/compiler/graph-reducer.cc", + "src/compiler/graph-reducer.h", + "src/compiler/graph-replay.cc", + "src/compiler/graph-replay.h", + "src/compiler/graph-visualizer.cc", + "src/compiler/graph-visualizer.h", + "src/compiler/graph.cc", + "src/compiler/graph.h", + "src/compiler/instruction-codes.h", + "src/compiler/instruction-selector-impl.h", + "src/compiler/instruction-selector.cc", + "src/compiler/instruction-selector.h", + "src/compiler/instruction.cc", + "src/compiler/instruction.h", + "src/compiler/js-context-specialization.cc", + "src/compiler/js-context-specialization.h", + "src/compiler/js-generic-lowering.cc", + "src/compiler/js-generic-lowering.h", + "src/compiler/js-graph.cc", + "src/compiler/js-graph.h", + "src/compiler/js-operator.h", + "src/compiler/js-typed-lowering.cc", + "src/compiler/js-typed-lowering.h", + "src/compiler/linkage-impl.h", + "src/compiler/linkage.cc", + "src/compiler/linkage.h", + "src/compiler/lowering-builder.cc", + "src/compiler/lowering-builder.h", + "src/compiler/machine-node-factory.h", + "src/compiler/machine-operator-reducer.cc", + "src/compiler/machine-operator-reducer.h", + "src/compiler/machine-operator.h", + "src/compiler/node-aux-data-inl.h", + "src/compiler/node-aux-data.h", + "src/compiler/node-cache.cc", + "src/compiler/node-cache.h", + "src/compiler/node-matchers.h", + "src/compiler/node-properties-inl.h", + "src/compiler/node-properties.h", + "src/compiler/node.cc", + "src/compiler/node.h", + "src/compiler/opcodes.h", + "src/compiler/operator-properties-inl.h", + "src/compiler/operator-properties.h", + "src/compiler/operator.h", + "src/compiler/phi-reducer.h", + "src/compiler/pipeline.cc", + "src/compiler/pipeline.h", + "src/compiler/raw-machine-assembler.cc", + "src/compiler/raw-machine-assembler.h", + "src/compiler/register-allocator.cc", + "src/compiler/register-allocator.h", + "src/compiler/representation-change.h", + "src/compiler/schedule.cc", + "src/compiler/schedule.h", + "src/compiler/scheduler.cc", + "src/compiler/scheduler.h", + "src/compiler/simplified-lowering.cc", + "src/compiler/simplified-lowering.h", + "src/compiler/simplified-node-factory.h", + "src/compiler/simplified-operator.h", + "src/compiler/source-position.cc", + "src/compiler/source-position.h", + "src/compiler/structured-machine-assembler.cc", + "src/compiler/structured-machine-assembler.h", + "src/compiler/typer.cc", + "src/compiler/typer.h", + "src/compiler/verifier.cc", + "src/compiler/verifier.h", "src/compiler.cc", "src/compiler.h", "src/contexts.cc", @@ -303,8 +560,6 @@ source_set("v8_base") { "src/cpu-profiler-inl.h", "src/cpu-profiler.cc", "src/cpu-profiler.h", - "src/cpu.cc", - "src/cpu.h", "src/data-flow.cc", "src/data-flow.h", "src/date.cc", @@ -312,8 +567,6 @@ source_set("v8_base") { "src/dateparser-inl.h", "src/dateparser.cc", "src/dateparser.h", - "src/debug-agent.cc", - "src/debug-agent.h", "src/debug.cc", "src/debug.h", "src/deoptimizer.cc", @@ -348,6 +601,9 @@ source_set("v8_base") { "src/fast-dtoa.cc", "src/fast-dtoa.h", "src/feedback-slots.h", + "src/field-index.cc", + "src/field-index.h", + "src/field-index-inl.h", "src/fixed-dtoa.cc", "src/fixed-dtoa.h", "src/flag-definitions.h", @@ -369,14 +625,32 @@ source_set("v8_base") { "src/handles.cc", "src/handles.h", "src/hashmap.h", - "src/heap-inl.h", "src/heap-profiler.cc", "src/heap-profiler.h", "src/heap-snapshot-generator-inl.h", "src/heap-snapshot-generator.cc", "src/heap-snapshot-generator.h", - "src/heap.cc", - "src/heap.h", + "src/heap/gc-tracer.cc", + "src/heap/gc-tracer.h", + "src/heap/heap-inl.h", + "src/heap/heap.cc", + "src/heap/heap.h", + "src/heap/incremental-marking.cc", + "src/heap/incremental-marking.h", + "src/heap/mark-compact-inl.h", + "src/heap/mark-compact.cc", + "src/heap/mark-compact.h", + "src/heap/objects-visiting-inl.h", + "src/heap/objects-visiting.cc", + "src/heap/objects-visiting.h", + "src/heap/spaces-inl.h", + "src/heap/spaces.cc", + "src/heap/spaces.h", + "src/heap/store-buffer-inl.h", + "src/heap/store-buffer.cc", + "src/heap/store-buffer.h", + "src/heap/sweeper-thread.h", + "src/heap/sweeper-thread.cc", "src/hydrogen-alias-analysis.h", "src/hydrogen-bce.cc", "src/hydrogen-bce.h", @@ -425,6 +699,8 @@ source_set("v8_base") { "src/hydrogen-sce.h", "src/hydrogen-store-elimination.cc", "src/hydrogen-store-elimination.h", + "src/hydrogen-types.cc", + "src/hydrogen-types.h", "src/hydrogen-uint32-analysis.cc", "src/hydrogen-uint32-analysis.h", "src/i18n.cc", @@ -434,8 +710,6 @@ source_set("v8_base") { "src/ic-inl.h", "src/ic.cc", "src/ic.h", - "src/incremental-marking.cc", - "src/incremental-marking.h", "src/interface.cc", "src/interface.h", "src/interpreter-irregexp.cc", @@ -447,14 +721,6 @@ source_set("v8_base") { "src/jsregexp-inl.h", "src/jsregexp.cc", "src/jsregexp.h", - "src/lazy-instance.h", - # TODO(jochen): move libplatform/ files to their own target. - "src/libplatform/default-platform.cc", - "src/libplatform/default-platform.h", - "src/libplatform/task-queue.cc", - "src/libplatform/task-queue.h", - "src/libplatform/worker-thread.cc", - "src/libplatform/worker-thread.h", "src/list-inl.h", "src/list.h", "src/lithium-allocator-inl.h", @@ -471,9 +737,10 @@ source_set("v8_base") { "src/log-utils.h", "src/log.cc", "src/log.h", + "src/lookup-inl.h", + "src/lookup.cc", + "src/lookup.h", "src/macro-assembler.h", - "src/mark-compact.cc", - "src/mark-compact.h", "src/messages.cc", "src/messages.h", "src/msan.h", @@ -481,28 +748,16 @@ source_set("v8_base") { "src/objects-debug.cc", "src/objects-inl.h", "src/objects-printer.cc", - "src/objects-visiting.cc", - "src/objects-visiting.h", "src/objects.cc", "src/objects.h", - "src/once.cc", - "src/once.h", - "src/optimizing-compiler-thread.h", "src/optimizing-compiler-thread.cc", + "src/optimizing-compiler-thread.h", + "src/ostreams.cc", + "src/ostreams.h", "src/parser.cc", "src/parser.h", - "src/platform/elapsed-timer.h", - "src/platform/time.cc", - "src/platform/time.h", - "src/platform.h", - "src/platform/condition-variable.cc", - "src/platform/condition-variable.h", - "src/platform/mutex.cc", - "src/platform/mutex.h", - "src/platform/semaphore.cc", - "src/platform/semaphore.h", - "src/platform/socket.cc", - "src/platform/socket.h", + "src/perf-jit.cc", + "src/perf-jit.h", "src/preparse-data-format.h", "src/preparse-data.cc", "src/preparse-data.h", @@ -516,6 +771,7 @@ source_set("v8_base") { "src/property-details.h", "src/property.cc", "src/property.h", + "src/prototype.h", "src/regexp-macro-assembler-irregexp-inl.h", "src/regexp-macro-assembler-irregexp.cc", "src/regexp-macro-assembler-irregexp.h", @@ -547,14 +803,9 @@ source_set("v8_base") { "src/serialize.h", "src/small-pointer-list.h", "src/smart-pointers.h", - "src/snapshot-common.cc", + "src/snapshot-source-sink.cc", + "src/snapshot-source-sink.h", "src/snapshot.h", - "src/spaces-inl.h", - "src/spaces.cc", - "src/spaces.h", - "src/store-buffer-inl.h", - "src/store-buffer.cc", - "src/store-buffer.h", "src/string-search.cc", "src/string-search.h", "src/string-stream.cc", @@ -563,8 +814,6 @@ source_set("v8_base") { "src/strtod.h", "src/stub-cache.cc", "src/stub-cache.h", - "src/sweeper-thread.h", - "src/sweeper-thread.cc", "src/token.cc", "src/token.h", "src/transitions-inl.h", @@ -587,12 +836,8 @@ source_set("v8_base") { "src/utils-inl.h", "src/utils.cc", "src/utils.h", - "src/utils/random-number-generator.cc", - "src/utils/random-number-generator.h", "src/v8.cc", "src/v8.h", - "src/v8checks.h", - "src/v8globals.h", "src/v8memory.h", "src/v8threads.cc", "src/v8threads.h", @@ -605,9 +850,11 @@ source_set("v8_base") { "src/zone-inl.h", "src/zone.cc", "src/zone.h", + "third_party/fdlibm/fdlibm.cc", + "third_party/fdlibm/fdlibm.h", ] - if (cpu_arch == "x86") { + if (v8_target_arch == "x86") { sources += [ "src/ia32/assembler-ia32-inl.h", "src/ia32/assembler-ia32.cc", @@ -636,8 +883,12 @@ source_set("v8_base") { "src/ia32/regexp-macro-assembler-ia32.cc", "src/ia32/regexp-macro-assembler-ia32.h", "src/ia32/stub-cache-ia32.cc", + "src/compiler/ia32/code-generator-ia32.cc", + "src/compiler/ia32/instruction-codes-ia32.h", + "src/compiler/ia32/instruction-selector-ia32.cc", + "src/compiler/ia32/linkage-ia32.cc", ] - } else if (cpu_arch == "x64") { + } else if (v8_target_arch == "x64") { sources += [ "src/x64/assembler-x64-inl.h", "src/x64/assembler-x64.cc", @@ -666,8 +917,12 @@ source_set("v8_base") { "src/x64/regexp-macro-assembler-x64.cc", "src/x64/regexp-macro-assembler-x64.h", "src/x64/stub-cache-x64.cc", + "src/compiler/x64/code-generator-x64.cc", + "src/compiler/x64/instruction-codes-x64.h", + "src/compiler/x64/instruction-selector-x64.cc", + "src/compiler/x64/linkage-x64.cc", ] - } else if (cpu_arch == "arm") { + } else if (v8_target_arch == "arm") { sources += [ "src/arm/assembler-arm-inl.h", "src/arm/assembler-arm.cc", @@ -699,8 +954,12 @@ source_set("v8_base") { "src/arm/regexp-macro-assembler-arm.h", "src/arm/simulator-arm.cc", "src/arm/stub-cache-arm.cc", + "src/compiler/arm/code-generator-arm.cc", + "src/compiler/arm/instruction-codes-arm.h", + "src/compiler/arm/instruction-selector-arm.cc", + "src/compiler/arm/linkage-arm.cc", ] - } else if (cpu_arch == "arm64") { + } else if (v8_target_arch == "arm64") { sources += [ "src/arm64/assembler-arm64.cc", "src/arm64/assembler-arm64.h", @@ -712,7 +971,6 @@ source_set("v8_base") { "src/arm64/code-stubs-arm64.h", "src/arm64/constants-arm64.h", "src/arm64/cpu-arm64.cc", - "src/arm64/cpu-arm64.h", "src/arm64/debug-arm64.cc", "src/arm64/decoder-arm64.cc", "src/arm64/decoder-arm64.h", @@ -744,8 +1002,12 @@ source_set("v8_base") { "src/arm64/stub-cache-arm64.cc", "src/arm64/utils-arm64.cc", "src/arm64/utils-arm64.h", + "src/compiler/arm64/code-generator-arm64.cc", + "src/compiler/arm64/instruction-codes-arm64.h", + "src/compiler/arm64/instruction-selector-arm64.cc", + "src/compiler/arm64/linkage-arm64.cc", ] - } else if (cpu_arch == "mipsel") { + } else if (v8_target_arch == "mipsel") { sources += [ "src/mips/assembler-mips.cc", "src/mips/assembler-mips.h", @@ -780,41 +1042,122 @@ source_set("v8_base") { ] } - configs += [ ":internal_config", ":features" ] + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ ":internal_config", ":features", ":toolchain" ] + + defines = [] + deps = [ ":v8_libbase" ] + + if (is_linux) { + if (v8_compress_startup_data == "bz2") { + libs += [ "bz2" ] + } + } + + if (v8_enable_i18n_support) { + deps += [ "//third_party/icu" ] + if (is_win) { + deps += [ "//third_party/icu:icudata" ] + } + # TODO(jochen): Add support for icu_use_data_file_flag + defines += [ "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE" ] + } else { + sources -= [ + "src/i18n.cc", + "src/i18n.h", + ] + } + + if (v8_postmortem_support) { + sources += [ "$target_gen_dir/debug-support.cc" ] + deps += [ ":postmortem-metadata" ] + } +} + +source_set("v8_libbase") { + visibility = ":*" # Only targets in this file can depend on this. + + sources = [ + "src/base/atomicops.h", + "src/base/atomicops_internals_arm64_gcc.h", + "src/base/atomicops_internals_arm_gcc.h", + "src/base/atomicops_internals_atomicword_compat.h", + "src/base/atomicops_internals_mac.h", + "src/base/atomicops_internals_mips_gcc.h", + "src/base/atomicops_internals_tsan.h", + "src/base/atomicops_internals_x86_gcc.cc", + "src/base/atomicops_internals_x86_gcc.h", + "src/base/atomicops_internals_x86_msvc.h", + "src/base/build_config.h", + "src/base/cpu.cc", + "src/base/cpu.h", + "src/base/lazy-instance.h", + "src/base/logging.cc", + "src/base/logging.h", + "src/base/macros.h", + "src/base/once.cc", + "src/base/once.h", + "src/base/platform/elapsed-timer.h", + "src/base/platform/time.cc", + "src/base/platform/time.h", + "src/base/platform/condition-variable.cc", + "src/base/platform/condition-variable.h", + "src/base/platform/mutex.cc", + "src/base/platform/mutex.h", + "src/base/platform/platform.h", + "src/base/platform/semaphore.cc", + "src/base/platform/semaphore.h", + "src/base/safe_conversions.h", + "src/base/safe_conversions_impl.h", + "src/base/safe_math.h", + "src/base/safe_math_impl.h", + "src/base/utils/random-number-generator.cc", + "src/base/utils/random-number-generator.h", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ ":internal_config_base", ":features", ":toolchain" ] defines = [] - deps = [] if (is_posix) { sources += [ - "src/platform-posix.cc" + "src/base/platform/platform-posix.cc" ] } if (is_linux) { sources += [ - "src/platform-linux.cc" + "src/base/platform/platform-linux.cc" ] - # TODO(brettw) - # 'conditions': [ - # ['v8_compress_startup_data=="bz2"', { - # 'libraries': [ - # '-lbz2', - # ] - # }], - # ], - libs = [ "rt" ] } else if (is_android) { - # TODO(brettw) OS=="android" condition from tools/gyp/v8.gyp + defines += [ "CAN_USE_VFP_INSTRUCTIONS" ] + + if (build_os == "mac") { + if (current_toolchain == host_toolchain) { + sources += [ "src/base/platform/platform-macos.cc" ] + } else { + sources += [ "src/base/platform/platform-linux.cc" ] + } + } else { + sources += [ "src/base/platform/platform-linux.cc" ] + if (current_toolchain == host_toolchain) { + defines += [ "V8_LIBRT_NOT_AVAILABLE" ] + } + } } else if (is_mac) { - sources += [ "src/platform-macos,cc" ] + sources += [ "src/base/platform/platform-macos.cc" ] } else if (is_win) { + # TODO(jochen): Add support for cygwin. sources += [ - "src/platform-win32.cc", - "src/win32-math.cc", - "src/win32-math.h", + "src/base/platform/platform-win32.cc", + "src/base/win32-headers.h", + "src/base/win32-math.cc", + "src/base/win32-math.h", ] defines += [ "_CRT_RAND_S" ] # for rand_s() @@ -822,52 +1165,117 @@ source_set("v8_base") { libs = [ "winmm.lib", "ws2_32.lib" ] } + # TODO(jochen): Add support for qnx, freebsd, openbsd, netbsd, and solaris. +} + +source_set("v8_libplatform") { + sources = [ + "include/libplatform/libplatform.h", + "src/libplatform/default-platform.cc", + "src/libplatform/default-platform.h", + "src/libplatform/task-queue.cc", + "src/libplatform/task-queue.h", + "src/libplatform/worker-thread.cc", + "src/libplatform/worker-thread.h", + ] - if (v8_enable_i18n_support) { - deps += [ "//third_party/icu" ] - if (is_win) { - deps += [ "//third_party/icu:icudata" ] - } - } else { - sources -= [ - "src/i18n.cc", - "src/i18n.h", - ] - } + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ ":internal_config_base", ":features", ":toolchain" ] - # TODO(brettw) other conditions from v8.gyp - # TODO(brettw) icu_use_data_file_flag + deps = [ + ":v8_libbase", + ] } ############################################################################### # Executables # -# TODO(jochen): Remove this as soon as toolchain.gypi is integrated. -if (build_cpu_arch != cpu_arch) { +if (current_toolchain == host_toolchain) { + executable("mksnapshot") { + visibility = ":*" # Only targets in this file can depend on this. -executable("mksnapshot") { - sources = [ - ] + sources = [ + "src/mksnapshot.cc", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ ":internal_config", ":features", ":toolchain" ] + + deps = [ + ":v8_base", + ":v8_libplatform", + ":v8_nosnapshot", + ] + + if (v8_compress_startup_data == "bz2") { + libs = [ "bz2" ] + } + } } -} else { +############################################################################### +# Public targets +# + +if (component_mode == "shared_library") { -executable("mksnapshot") { +component("v8") { sources = [ - "src/mksnapshot.cc", + "src/v8dll-main.cc", ] - configs += [ ":internal_config", ":features" ] + if (v8_use_external_startup_data) { + deps = [ + ":v8_base", + ":v8_external_snapshot", + ] + } else if (v8_use_snapshot) { + deps = [ + ":v8_base", + ":v8_snapshot", + ] + } else { + deps = [ + ":v8_base", + ":v8_nosnapshot", + ] + } - deps = [ - ":v8_base", - ":v8_nosnapshot", - ] + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ ":internal_config", ":features", ":toolchain" ] - if (v8_compress_startup_data == "bz2") { - libs = [ "bz2" ] + direct_dependent_configs = [ ":external_config" ] + + if (is_android && current_toolchain != host_toolchain) { + libs += [ "log" ] } } +} else { + +group("v8") { + if (v8_use_external_startup_data) { + deps = [ + ":v8_base", + ":v8_external_snapshot", + ] + } else if (v8_use_snapshot) { + deps = [ + ":v8_base", + ":v8_snapshot", + ] + } else { + deps = [ + ":v8_base", + ":v8_nosnapshot", + ] + } + + direct_dependent_configs = [ ":external_config" ] +} + } diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index 8f1d2563859..0b2872a7c21 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,726 @@ +2014-08-13: Version 3.28.73 + + Performance and stability improvements on all platforms. + + +2014-08-12: Version 3.28.71 + + ToNumber(Symbol) should throw TypeError (issue 3499). + + Performance and stability improvements on all platforms. + + +2014-08-11: Version 3.28.69 + + Performance and stability improvements on all platforms. + + +2014-08-09: Version 3.28.65 + + Performance and stability improvements on all platforms. + + +2014-08-08: Version 3.28.64 + + ES6: Implement WeakMap and WeakSet constructor logic (issue 3399). + + Enable ES6 unscopables (issue 3401). + + Turn on harmony_unscopables for es_staging (issue 3401). + + Remove proxies from --harmony switch for M38, because problems. + + Reland "Add initial support for compiler unit tests using GTest/GMock." + (issue 3489). + + Enable ES6 iteration by default (issue 2214). + + Performance and stability improvements on all platforms. + + +2014-08-07: Version 3.28.62 + + Only escape U+0022 in argument values of `String.prototype` HTML methods + (issue 2217). + + Update webkit test for expected own properties. + + This implements unscopables (issue 3401). + + Add `CheckObjectCoercible` for the `String.prototype` HTML methods + (issue 2218). + + Add initial support for compiler unit tests using GTest/GMock (issue + 3489). + + Trigger exception debug events on Promise reject (Chromium issue + 393913). + + Refactor unit tests for the base library to use GTest (issue 3489). + + Performance and stability improvements on all platforms. + + +2014-08-06: Version 3.28.60 + + Enable ES6 Map and Set by default (issue 1622). + + Performance and stability improvements on all platforms. + + +2014-08-06: Version 3.28.59 + + Removed GetConstructor from the API. Instead either get the + "constructor" property stored in the prototype, or keep a side-table. + + Enable ES6 Symbols by default (issue 2158). + + Performance and stability improvements on all platforms. + + +2014-08-05: Version 3.28.57 + + Add dependencies on gtest and gmock. + + Performance and stability improvements on all platforms. + + +2014-08-04: Version 3.28.54 + + Performance and stability improvements on all platforms. + + +2014-08-01: Version 3.28.53 + + Performance and stability improvements on all platforms. + + +2014-07-31: Version 3.28.52 + + Performance and stability improvements on all platforms. + + +2014-07-31: Version 3.28.51 + + Drop deprecated memory related notification API (Chromium issue 397026). + + Performance and stability improvements on all platforms. + + +2014-07-31: Version 3.28.50 + + Use emergency memory in the case of out of memory during evacuation + (Chromium issue 395314). + + Performance and stability improvements on all platforms. + + +2014-07-30: Version 3.28.48 + + Fix Object.freeze with field type tracking. Keep the descriptor properly + intact while update the field type (issue 3458). + + Performance and stability improvements on all platforms. + + +2014-07-29: Version 3.28.45 + + Performance and stability improvements on all platforms. + + +2014-07-28: Version 3.28.43 + + Performance and stability improvements on all platforms. + + +2014-07-25: Version 3.28.38 + + Fix issue with setters and their holders in accessors.cc (Chromium issue + 3462). + + Introduce more debug events for promises (issue 3093). + + Move gc notifications from V8 to Isolate and make idle hint mandatory + (Chromium issue 397026). + + The accessors should get the value from the holder and not from this + (issue 3461). + + Performance and stability improvements on all platforms. + + +2014-07-24: Version 3.28.35 + + Rebaseline/update the intl tests with ICU 52 (issue 3454). + + Expose the content of Sets and WeakSets through SetMirror (issue 3093). + + Performance and stability improvements on all platforms. + + +2014-07-23: Version 3.28.32 + + Update ICU to 5.2 (matching chromium) (issue 3452). + + Performance and stability improvements on all platforms. + + +2014-07-22: Version 3.28.31 + + Remove harmony-typeof. + + Implement String.prototype.codePointAt and String.fromCodePoint (issue + 2840). + + Performance and stability improvements on all platforms. + + +2014-07-21: Version 3.28.30 + + Performance and stability improvements on all platforms. + + +2014-07-21: Version 3.28.29 + + Performance and stability improvements on all platforms. + + +2014-07-18: Version 3.28.28 + + Performance and stability improvements on all platforms. + + +2014-07-17: Version 3.28.26 + + Ship ES6 Math functions (issue 2938). + + Make ToPrimitive throw on symbol wrappers (issue 3442). + + Performance and stability improvements on all platforms. + + +2014-07-16: Version 3.28.25 + + Performance and stability improvements on all platforms. + + +2014-07-16: Version 3.28.24 + + Removed some copy-n-paste from StackFrame::Foo API entries (issue 3436). + + Performance and stability improvements on all platforms. + + +2014-07-15: Version 3.28.23 + + Fix error message about read-only symbol properties (issue 3441). + + Include symbol properties in Object.{create,defineProperties} (issue + 3440). + + Performance and stability improvements on all platforms. + + +2014-07-14: Version 3.28.22 + + Performance and stability improvements on all platforms. + + +2014-07-11: Version 3.28.21 + + Make `let` usable as an identifier in ES6 sloppy mode (issue 2198). + + Support ES6 Map and Set in heap profiler (issue 3368). + + Performance and stability improvements on all platforms. + + +2014-07-10: Version 3.28.20 + + Remove deprecate counter/histogram methods. + + Fixed printing of external references (Chromium issue 392068). + + Fix several issues with ES6 redeclaration checks (issue 3426). + + Performance and stability improvements on all platforms. + + +2014-07-09: Version 3.28.19 + + Performance and stability improvements on all platforms. + + +2014-07-09: Version 3.28.18 + + Reland "Postpone termination exceptions in debug scope." (issue 3408). + + Performance and stability improvements on all platforms. + + +2014-07-08: Version 3.28.17 + + MIPS: Fix computed properties on object literals with a double as + propertyname (Chromium issue 390732). + + Performance and stability improvements on all platforms. + + +2014-07-08: Version 3.28.16 + + Fix computed properties on object literals with a double as propertyname + (Chromium issue 390732). + + Avoid brittle use of .bind in Promise.all (issue 3420). + + Performance and stability improvements on all platforms. + + +2014-07-07: Version 3.28.15 + + Remove a bunch of Isolate::UncheckedCurrent calls. + + Performance and stability improvements on all platforms. + + +2014-07-07: Version 3.28.14 + + Use the HeapObjectIterator to scan-on-scavenge map pages (Chromium issue + 390732). + + Introduce debug events for Microtask queue (Chromium issue 272416). + + Split out libplatform into a separate libary. + + Add clang-format to presubmit checks. + + Stack traces exposed to Javascript should omit extensions (issue 311). + + Remove deprecated v8::Context::HasOutOfMemoryException. + + Postpone termination exceptions in debug scope (issue 3408). + + Performance and stability improvements on all platforms. + + +2014-07-04: Version 3.28.13 + + Rollback to r22134. + + +2014-07-04: Version 3.28.12 + + Use the HeapObjectIterator to scan-on-scavenge map pages (Chromium issue + 390732). + + Introduce debug events for Microtask queue (Chromium issue 272416). + + Performance and stability improvements on all platforms. + + +2014-07-03: Version 3.28.11 + + Split out libplatform into a separate libary. + + Performance and stability improvements on all platforms. + + +2014-07-03: Version 3.28.10 + + Add clang-format to presubmit checks. + + Stack traces exposed to Javascript should omit extensions (issue 311). + + Remove deprecated v8::Context::HasOutOfMemoryException. + + Postpone termination exceptions in debug scope (issue 3408). + + Performance and stability improvements on all platforms. + + +2014-07-02: Version 3.28.9 + + Make freeze & friends ignore private properties (issue 3419). + + Introduce a builddeps make target (issue 3418). + + Performance and stability improvements on all platforms. + + +2014-07-01: Version 3.28.8 + + Remove static initializer from isolate. + + ES6: Add missing Set.prototype.keys function (issue 3411). + + Introduce debug events for promises (issue 3093). + + Performance and stability improvements on all platforms. + + +2014-06-30: Version 3.28.7 + + Performance and stability improvements on all platforms. + + +2014-06-30: Version 3.28.6 + + Unbreak "os" stuff in shared d8 builds (issue 3407). + + Performance and stability improvements on all platforms. + + +2014-06-26: Version 3.28.4 + + Compile optimized code with active debugger but no break points + (Chromium issue 386492). + + Optimize Map/Set.prototype.forEach. + + Collect garbage with kReduceMemoryFootprintMask in IdleNotification + (Chromium issue 350720). + + Performance and stability improvements on all platforms. + + +2014-06-26: Version 3.28.3 + + Grow heap slower if GC freed many global handles (Chromium issue + 263503). + + Performance and stability improvements on all platforms. + + +2014-06-25: Version 3.28.2 + + Remove bogus assertions in HCompareObjectEqAndBranch (Chromium issue + 387636). + + Do not eagerly update allow_osr_at_loop_nesting_level (Chromium issue + 387599). + + Set host_arch to ia32 on machines with a 32bit userland but a 64bit + kernel (Chromium issue 368384). + + Map/Set: Implement constructor parameter handling (issue 3398). + + Performance and stability improvements on all platforms. + + +2014-06-24: Version 3.28.1 + + Support LiveEdit on Arm64 (Chromium issue 368580). + + Run JS micro tasks in the appropriate context (Chromium issue 385349). + + Add a use counter API. + + Set host_arch to ia32 on machines with a 32bit userland but a 64bit + kernel. + + Performance and stability improvements on all platforms. + + +2014-06-23: Version 3.28.0 + + MIPS: Support LiveEdit (Chromium issue 368580). + + Array.concat: properly go to dictionary mode when required (Chromium + issue 387031). + + Support LiveEdit on ARM (Chromium issue 368580). + + Performance and stability improvements on all platforms. + + +2014-06-18: Version 3.27.34 + + Reduce number of writes to DependentCode array when inserting dependent + IC (Chromium issue 305878). + + Performance and stability improvements on all platforms. + + +2014-06-17: Version 3.27.33 + + Do GC if CodeRange fails to allocate a block (Chromium issue 305878). + + Throw syntax error when a getter/setter has the wrong number of params + (issue 3371). + + Performance and stability improvements on all platforms. + + +2014-06-17: Version 3.27.32 + + Performance and stability improvements on all platforms. + + +2014-06-16: Version 3.27.31 + + Version fix. + + +2014-06-16: Version 3.27.30 + + Fix representation of Phis for mutable-heapnumber-in-object-literal + properties (issue 3392). + + Performance and stability improvements on all platforms. + + +2014-06-16: Version 3.27.29 + + Emulate MLS on pre-ARMv6T2. Cleaned up thumbee vs. thumb2 confusion. + + X87: Fixed flooring division by a power of 2, once again.. (issue 3259). + + Fixed undefined behavior in RNG (Chromium issue 377790). + + Performance and stability improvements on all platforms. + + +2014-06-13: Version 3.27.28 + + Add v8::Promise::Then (Chromium issue 371288). + + Performance and stability improvements on all platforms. + + +2014-06-12: Version 3.27.27 + + Fix detection of VFP3D16 on Galaxy Tab 10.1 (issue 3387). + + Performance and stability improvements on all platforms. + + +2014-06-12: Version 3.27.26 + + MIPS: Fixed flooring division by a power of 2, once again.. (issue + 3259). + + Fixed flooring division by a power of 2, once again.. (issue 3259). + + Fix unsigned comparisons (issue 3380). + + Performance and stability improvements on all platforms. + + +2014-06-11: Version 3.27.25 + + Performance and stability improvements on all platforms. + + +2014-06-11: Version 3.27.24 + + Fix invalid attributes when generalizing because of incompatible map + change (Chromium issue 382143). + + Fix missing smi check in inlined indexOf/lastIndexOf (Chromium issue + 382513). + + Performance and stability improvements on all platforms. + + +2014-06-06: Version 3.27.23 + + Performance and stability improvements on all platforms. + + +2014-06-06: Version 3.27.22 + + Performance and stability improvements on all platforms. + + +2014-06-06: Version 3.27.21 + + Turn on harmony_collections for es_staging (issue 1622). + + Do not make heap iterable eagerly (Chromium issue 379740). + + Performance and stability improvements on all platforms. + + +2014-06-05: Version 3.27.20 + + Fix invalid loop condition for Array.lastIndexOf() (Chromium issue + 380512). + + Add API support for passing a C++ function as a microtask callback. + + Performance and stability improvements on all platforms. + + +2014-06-04: Version 3.27.19 + + Split Put into Put and Remove. + + ES6: Add support for values/keys/entries for Map and Set (issue 1793). + + Performance and stability improvements on all platforms. + + +2014-06-03: Version 3.27.18 + + Remove PROHIBITS_OVERWRITING as it is subsumed by non-configurable + properties. + + Performance and stability improvements on all platforms. + + +2014-06-02: Version 3.27.17 + + BuildNumberToString: Check for undefined keys in the cache (Chromium + issue 368114). + + HRor and HSar can deoptimize (issue 3359). + + Simplify, speed-up correct-context ObjectObserve calls. + + Performance and stability improvements on all platforms. + + +2014-05-29: Version 3.27.16 + + Allow microtasks to throw exceptions and handle them gracefully + (Chromium issue 371566). + + Performance and stability improvements on all platforms. + + +2014-05-28: Version 3.27.15 + + Performance and stability improvements on all platforms. + + +2014-05-27: Version 3.27.14 + + Reland "Customized support for feedback on calls to Array." and follow- + up fixes (Chromium issues 377198, 377290). + + Performance and stability improvements on all platforms. + + +2014-05-26: Version 3.27.13 + + Performance and stability improvements on all platforms. + + +2014-05-26: Version 3.27.12 + + Check for cached transition to ExternalArray elements kind (issue 3337). + + Support ES6 weak collections in heap profiler (Chromium issue 376196). + + Performance and stability improvements on all platforms. + + +2014-05-23: Version 3.27.11 + + Add support for ES6 Symbol in heap profiler (Chromium issue 376194). + + Performance and stability improvements on all platforms. + + +2014-05-22: Version 3.27.10 + + Implement Mirror object for Symbols (issue 3290). + + Allow debugger to step into Map and Set forEach callbacks (issue 3341). + + Fix ArrayShift hydrogen support (Chromium issue 374838). + + Use SameValueZero for Map and Set (issue 1622). + + Array Iterator next should check for own property. + + Performance and stability improvements on all platforms. + + +2014-05-21: Version 3.27.9 + + Disable ArrayShift hydrogen support (Chromium issue 374838). + + ES6 Map/Set iterators/forEach improvements (issue 1793). + + Performance and stability improvements on all platforms. + + +2014-05-20: Version 3.27.8 + + Move microtask queueing logic from JavaScript to C++. + + Partial revert of "Next bunch of fixes for check elimination" (Chromium + issue 372173). + + Performance and stability improvements on all platforms. + + +2014-05-19: Version 3.27.7 + + Performance and stability improvements on all platforms. + + +2014-05-19: Version 3.27.6 + + Performance and stability improvements on all platforms. + + +2014-05-16: Version 3.27.5 + + Performance and stability improvements on all platforms. + + +2014-05-15: Version 3.27.4 + + Drop thenable coercion cache (Chromium issue 372788). + + Skip write barriers when updating the weak hash table (Chromium issue + 359401). + + Performance and stability improvements on all platforms. + + +2014-05-14: Version 3.27.3 + + Performance and stability improvements on all platforms. + + +2014-05-13: Version 3.27.2 + + Harden %SetIsObserved with RUNTIME_ASSERTs (Chromium issue 371782). + + Drop unused static microtask API. + + Introduce an api to query the microtask autorun state of an isolate. + + Performance and stability improvements on all platforms. + + +2014-05-12: Version 3.27.1 + + Object.observe: avoid accessing acceptList properties more than once + (issue 3315). + + Array Iterator prototype should not have a constructor (issue 3293). + + Fix typos in unit test for Array.prototype.fill(). + + Shorten autogenerated error message for functions only (issue 3019, + Chromium issue 331971). + + Reland "Removed default Isolate." (Chromium issue 359977). + + Performance and stability improvements on all platforms. + + +2014-05-09: Version 3.27.0 + + Unbreak samples and tools. + + Performance and stability improvements on all platforms. + + 2014-05-08: Version 3.26.33 Removed default Isolate (Chromium issue 359977). diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 24b7841584f..9459204f2cb 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -2,26 +2,89 @@ # directory and assume that the root of the checkout is in ./v8/, so # all paths in here must match this assumption. +vars = { + "chromium_trunk": "https://src.chromium.org/svn/trunk", + + "buildtools_revision": "fb782d4369d5ae04f17a2fceef7de5a63e50f07b", +} + deps = { # Remember to keep the revision in sync with the Makefile. "v8/build/gyp": "http://gyp.googlecode.com/svn/trunk@1831", "v8/third_party/icu": - "https://src.chromium.org/svn/trunk/deps/third_party/icu46@258359", + Var("chromium_trunk") + "/deps/third_party/icu52@277999", + + "v8/buildtools": + "https://chromium.googlesource.com/chromium/buildtools.git@" + + Var("buildtools_revision"), + + "v8/testing/gtest": + "http://googletest.googlecode.com/svn/trunk@692", + + "v8/testing/gmock": + "http://googlemock.googlecode.com/svn/trunk@485", } deps_os = { "win": { "v8/third_party/cygwin": - "http://src.chromium.org/svn/trunk/deps/third_party/cygwin@66844", + Var("chromium_trunk") + "/deps/third_party/cygwin@66844", "v8/third_party/python_26": - "http://src.chromium.org/svn/trunk/tools/third_party/python_26@89111", + Var("chromium_trunk") + "/tools/third_party/python_26@89111", } } +include_rules = [ + # Everybody can use some things. + "+include", + "+unicode", + "+third_party/fdlibm", +] + +# checkdeps.py shouldn't check for includes in these directories: +skip_child_includes = [ + "build", + "third_party", +] + hooks = [ + # Pull clang-format binaries using checked-in hashes. + { + "name": "clang_format_win", + "pattern": ".", + "action": [ "download_from_google_storage", + "--no_resume", + "--platform=win32", + "--no_auth", + "--bucket", "chromium-clang-format", + "-s", "v8/buildtools/win/clang-format.exe.sha1", + ], + }, + { + "name": "clang_format_mac", + "pattern": ".", + "action": [ "download_from_google_storage", + "--no_resume", + "--platform=darwin", + "--no_auth", + "--bucket", "chromium-clang-format", + "-s", "v8/buildtools/mac/clang-format.sha1", + ], + }, + { + "name": "clang_format_linux", + "pattern": ".", + "action": [ "download_from_google_storage", + "--no_resume", + "--platform=linux*", + "--no_auth", + "--bucket", "chromium-clang-format", + "-s", "v8/buildtools/linux64/clang-format.sha1", + ], + }, { # A change to a .gyp, .gypi, or to GYP itself should run the generator. "pattern": ".", diff --git a/deps/v8/Makefile b/deps/v8/Makefile index a99b09c0705..96d7a7ae4d3 100644 --- a/deps/v8/Makefile +++ b/deps/v8/Makefile @@ -70,6 +70,10 @@ ifeq ($(backtrace), off) else GYPFLAGS += -Dv8_enable_backtrace=1 endif +# verifypredictable=on +ifeq ($(verifypredictable), on) + GYPFLAGS += -Dv8_enable_verify_predictable=1 +endif # snapshot=off ifeq ($(snapshot), off) GYPFLAGS += -Dv8_use_snapshot='false' @@ -156,11 +160,6 @@ ifeq ($(armv7), true) endif endif endif -# vfp2=off. Deprecated, use armfpu= -# vfp3=off. Deprecated, use armfpu= -ifeq ($(vfp3), off) - GYPFLAGS += -Darm_fpu=vfp -endif # hardfp=on/off. Deprecated, use armfloatabi ifeq ($(hardfp),on) GYPFLAGS += -Darm_float_abi=hard @@ -169,16 +168,10 @@ ifeq ($(hardfp),off) GYPFLAGS += -Darm_float_abi=softfp endif endif -# armneon=on/off -ifeq ($(armneon), on) - GYPFLAGS += -Darm_neon=1 -endif # fpu: armfpu=xxx # xxx: vfp, vfpv3-d16, vfpv3, neon. ifeq ($(armfpu),) -ifneq ($(vfp3), off) GYPFLAGS += -Darm_fpu=default -endif else GYPFLAGS += -Darm_fpu=$(armfpu) endif @@ -198,19 +191,19 @@ ifeq ($(armthumb), on) GYPFLAGS += -Darm_thumb=1 endif endif -# armtest=on +# arm_test_noprobe=on # With this flag set, by default v8 will only use features implied # by the compiler (no probe). This is done by modifying the default -# values of enable_armv7, enable_vfp2, enable_vfp3 and enable_32dregs. +# values of enable_armv7, enable_vfp3, enable_32dregs and enable_neon. # Modifying these flags when launching v8 will enable the probing for # the specified values. -# When using the simulator, this flag is implied. -ifeq ($(armtest), on) - GYPFLAGS += -Darm_test=on +ifeq ($(arm_test_noprobe), on) + GYPFLAGS += -Darm_test_noprobe=on endif # ----------------- available targets: -------------------- -# - "dependencies": pulls in external dependencies (currently: GYP) +# - "builddeps": pulls in external dependencies for building +# - "dependencies": pulls in all external dependencies # - "grokdump": rebuilds heap constants lists used by grokdump # - any arch listed in ARCHES (see below) # - any mode listed in MODES @@ -228,11 +221,11 @@ endif # Architectures and modes to be compiled. Consider these to be internal # variables, don't override them (use the targets instead). -ARCHES = ia32 x64 arm arm64 mips mipsel +ARCHES = ia32 x64 x32 arm arm64 mips mipsel mips64el x87 DEFAULT_ARCHES = ia32 x64 arm MODES = release debug optdebug DEFAULT_MODES = release debug -ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel +ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel android_x87 NACL_ARCHES = nacl_ia32 nacl_x64 # List of files that trigger Makefile regeneration: @@ -258,7 +251,7 @@ NACL_CHECKS = $(addsuffix .check,$(NACL_BUILDS)) # File where previously used GYPFLAGS are stored. ENVFILE = $(OUTDIR)/environment -.PHONY: all check clean dependencies $(ENVFILE).new native \ +.PHONY: all check clean builddeps dependencies $(ENVFILE).new native \ qc quickcheck $(QUICKCHECKS) \ $(addsuffix .quickcheck,$(MODES)) $(addsuffix .quickcheck,$(ARCHES)) \ $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ @@ -406,18 +399,22 @@ clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)) native.cl # GYP file generation targets. OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(BUILDS)) $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE) - PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \ - PYTHONPATH="$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \ + $(eval CXX_TARGET_ARCH:=$(shell $(CXX) -v 2>&1 | grep ^Target: | \ + cut -f 2 -d " " | cut -f 1 -d "-" )) + $(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH))) + $(eval V8_TARGET_ARCH:=$(subst .,,$(suffix $(basename $@)))) + PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \ GYP_GENERATORS=make \ build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ -Ibuild/standalone.gypi --depth=. \ - -Dv8_target_arch=$(subst .,,$(suffix $(basename $@))) \ + -Dv8_target_arch=$(V8_TARGET_ARCH) \ + $(if $(findstring $(CXX_TARGET_ARCH),$(V8_TARGET_ARCH)), \ + -Dtarget_arch=$(V8_TARGET_ARCH),) \ $(if $(findstring optdebug,$@),-Dv8_optimized_debug=2,) \ -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS) $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) - PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \ - PYTHONPATH="$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \ + PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \ GYP_GENERATORS=make \ build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS) @@ -471,11 +468,26 @@ GPATH GRTAGS GSYMS GTAGS: gtags.files $(shell cat gtags.files 2> /dev/null) gtags.clean: rm -f gtags.files GPATH GRTAGS GSYMS GTAGS -# Dependencies. +# Dependencies. "builddeps" are dependencies required solely for building, +# "dependencies" includes also dependencies required for development. # Remember to keep these in sync with the DEPS file. -dependencies: +builddeps: svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ --revision 1831 - svn checkout --force \ - https://src.chromium.org/chrome/trunk/deps/third_party/icu46 \ - third_party/icu --revision 258359 + if svn info third_party/icu 2>&1 | grep -q icu46 ; then \ + svn switch --force \ + https://src.chromium.org/chrome/trunk/deps/third_party/icu52 \ + third_party/icu --revision 277999 ; \ + else \ + svn checkout --force \ + https://src.chromium.org/chrome/trunk/deps/third_party/icu52 \ + third_party/icu --revision 277999 ; \ + fi + svn checkout --force http://googletest.googlecode.com/svn/trunk \ + testing/gtest --revision 692 + svn checkout --force http://googlemock.googlecode.com/svn/trunk \ + testing/gmock --revision 485 + +dependencies: builddeps + # The spec is a copy of the hooks in v8's DEPS file. + gclient sync -r fb782d4369d5ae04f17a2fceef7de5a63e50f07b --spec="solutions = [{u'managed': False, u'name': u'buildtools', u'url': u'https://chromium.googlesource.com/chromium/buildtools.git', u'custom_deps': {}, u'custom_hooks': [{u'name': u'clang_format_win',u'pattern': u'.',u'action': [u'download_from_google_storage',u'--no_resume',u'--platform=win32',u'--no_auth',u'--bucket',u'chromium-clang-format',u'-s',u'buildtools/win/clang-format.exe.sha1']},{u'name': u'clang_format_mac',u'pattern': u'.',u'action': [u'download_from_google_storage',u'--no_resume',u'--platform=darwin',u'--no_auth',u'--bucket',u'chromium-clang-format',u'-s',u'buildtools/mac/clang-format.sha1']},{u'name': u'clang_format_linux',u'pattern': u'.',u'action': [u'download_from_google_storage',u'--no_resume',u'--platform=linux*',u'--no_auth',u'--bucket',u'chromium-clang-format',u'-s',u'buildtools/linux64/clang-format.sha1']}],u'deps_file': u'.DEPS.git', u'safesync_url': u''}]" diff --git a/deps/v8/Makefile.android b/deps/v8/Makefile.android index 396b58d7444..d46af31fdb7 100644 --- a/deps/v8/Makefile.android +++ b/deps/v8/Makefile.android @@ -26,7 +26,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Those definitions should be consistent with the main Makefile -ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel +ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel android_x87 MODES = release debug # Generates all combinations of ANDROID ARCHES and MODES, @@ -51,13 +51,13 @@ ifeq ($(ARCH), android_arm) DEFINES += arm_neon=0 arm_version=7 TOOLCHAIN_ARCH = arm-linux-androideabi TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) - TOOLCHAIN_VER = 4.6 + TOOLCHAIN_VER = 4.8 else ifeq ($(ARCH), android_arm64) - DEFINES = target_arch=arm64 v8_target_arch=arm64 android_target_arch=arm64 android_target_platform=20 + DEFINES = target_arch=arm64 v8_target_arch=arm64 android_target_arch=arm64 android_target_platform=L TOOLCHAIN_ARCH = aarch64-linux-android TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) - TOOLCHAIN_VER = 4.8 + TOOLCHAIN_VER = 4.9 else ifeq ($(ARCH), android_mipsel) DEFINES = target_arch=mipsel v8_target_arch=mipsel android_target_platform=14 @@ -73,7 +73,14 @@ else TOOLCHAIN_PREFIX = i686-linux-android TOOLCHAIN_VER = 4.6 else - $(error Target architecture "${ARCH}" is not supported) + ifeq ($(ARCH), android_x87) + DEFINES = target_arch=x87 v8_target_arch=x87 android_target_arch=x86 android_target_platform=14 + TOOLCHAIN_ARCH = x86 + TOOLCHAIN_PREFIX = i686-linux-android + TOOLCHAIN_VER = 4.6 + else + $(error Target architecture "${ARCH}" is not supported) + endif endif endif endif @@ -91,6 +98,7 @@ endif # For mksnapshot host generation. DEFINES += host_os=${HOST_OS} +DEFINES += OS=android .SECONDEXPANSION: $(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$@ @@ -112,7 +120,7 @@ $(ANDROID_MAKEFILES): GYP_DEFINES="${DEFINES}" \ CC="${ANDROID_TOOLCHAIN}/bin/${TOOLCHAIN_PREFIX}-gcc" \ CXX="${ANDROID_TOOLCHAIN}/bin/${TOOLCHAIN_PREFIX}-g++" \ - PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \ + PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH)" \ build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \ -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \ -S$(suffix $(basename $@))$(suffix $@) ${GYPFLAGS} diff --git a/deps/v8/Makefile.nacl b/deps/v8/Makefile.nacl index 1d34a3b30aa..34bd960fed1 100644 --- a/deps/v8/Makefile.nacl +++ b/deps/v8/Makefile.nacl @@ -97,7 +97,7 @@ $(NACL_MAKEFILES): GYP_DEFINES="${GYPENV}" \ CC=${NACL_CC} \ CXX=${NACL_CXX} \ - PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \ + PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH)" \ build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \ -Ibuild/standalone.gypi --depth=. \ -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS) \ diff --git a/deps/v8/OWNERS b/deps/v8/OWNERS index 2fbb3ef2ac1..f67b3ec5c62 100644 --- a/deps/v8/OWNERS +++ b/deps/v8/OWNERS @@ -18,4 +18,5 @@ titzer@chromium.org ulan@chromium.org vegorov@chromium.org verwaest@chromium.org +vogelheim@chromium.org yangguo@chromium.org diff --git a/deps/v8/PRESUBMIT.py b/deps/v8/PRESUBMIT.py index 41d79eb5300..55bb99ab8ac 100644 --- a/deps/v8/PRESUBMIT.py +++ b/deps/v8/PRESUBMIT.py @@ -31,6 +31,9 @@ for more details about the presubmit API built into gcl. """ +import sys + + def _V8PresubmitChecks(input_api, output_api): """Runs the V8 presubmit checks.""" import sys @@ -38,6 +41,8 @@ def _V8PresubmitChecks(input_api, output_api): input_api.PresubmitLocalPath(), 'tools')) from presubmit import CppLintProcessor from presubmit import SourceProcessor + from presubmit import CheckGeneratedRuntimeTests + from presubmit import CheckExternalReferenceRegistration results = [] if not CppLintProcessor().Run(input_api.PresubmitLocalPath()): @@ -46,6 +51,65 @@ def _V8PresubmitChecks(input_api, output_api): results.append(output_api.PresubmitError( "Copyright header, trailing whitespaces and two empty lines " \ "between declarations check failed")) + if not CheckGeneratedRuntimeTests(input_api.PresubmitLocalPath()): + results.append(output_api.PresubmitError( + "Generated runtime tests check failed")) + if not CheckExternalReferenceRegistration(input_api.PresubmitLocalPath()): + results.append(output_api.PresubmitError( + "External references registration check failed")) + return results + + +def _CheckUnwantedDependencies(input_api, output_api): + """Runs checkdeps on #include statements added in this + change. Breaking - rules is an error, breaking ! rules is a + warning. + """ + # We need to wait until we have an input_api object and use this + # roundabout construct to import checkdeps because this file is + # eval-ed and thus doesn't have __file__. + original_sys_path = sys.path + try: + sys.path = sys.path + [input_api.os_path.join( + input_api.PresubmitLocalPath(), 'buildtools', 'checkdeps')] + import checkdeps + from cpp_checker import CppChecker + from rules import Rule + finally: + # Restore sys.path to what it was before. + sys.path = original_sys_path + + added_includes = [] + for f in input_api.AffectedFiles(): + if not CppChecker.IsCppFile(f.LocalPath()): + continue + + changed_lines = [line for line_num, line in f.ChangedContents()] + added_includes.append([f.LocalPath(), changed_lines]) + + deps_checker = checkdeps.DepsChecker(input_api.PresubmitLocalPath()) + + error_descriptions = [] + warning_descriptions = [] + for path, rule_type, rule_description in deps_checker.CheckAddedCppIncludes( + added_includes): + description_with_path = '%s\n %s' % (path, rule_description) + if rule_type == Rule.DISALLOW: + error_descriptions.append(description_with_path) + else: + warning_descriptions.append(description_with_path) + + results = [] + if error_descriptions: + results.append(output_api.PresubmitError( + 'You added one or more #includes that violate checkdeps rules.', + error_descriptions)) + if warning_descriptions: + results.append(output_api.PresubmitPromptOrNotify( + 'You added one or more #includes of files that are temporarily\n' + 'allowed but being removed. Can you avoid introducing the\n' + '#include? See relevant DEPS file(s) for details and contacts.', + warning_descriptions)) return results @@ -54,7 +118,10 @@ def _CommonChecks(input_api, output_api): results = [] results.extend(input_api.canned_checks.CheckOwners( input_api, output_api, source_file_filter=None)) + results.extend(input_api.canned_checks.CheckPatchFormatted( + input_api, output_api)) results.extend(_V8PresubmitChecks(input_api, output_api)) + results.extend(_CheckUnwantedDependencies(input_api, output_api)) return results @@ -110,7 +177,9 @@ def GetPreferredTryMasters(project, change): 'v8_linux64_rel': set(['defaulttests']), 'v8_linux_arm_dbg': set(['defaulttests']), 'v8_linux_arm64_rel': set(['defaulttests']), + 'v8_linux_layout_dbg': set(['defaulttests']), 'v8_mac_rel': set(['defaulttests']), 'v8_win_rel': set(['defaulttests']), + 'v8_win64_rel': set(['defaulttests']), }, } diff --git a/deps/v8/benchmarks/v8.json b/deps/v8/benchmarks/v8.json new file mode 100644 index 00000000000..f4210d9d406 --- /dev/null +++ b/deps/v8/benchmarks/v8.json @@ -0,0 +1,16 @@ +{ + "path": ["."], + "main": "run.js", + "run_count": 2, + "results_regexp": "^%s: (.+)$", + "benchmarks": [ + {"name": "Richards"}, + {"name": "DeltaBlue"}, + {"name": "Crypto"}, + {"name": "RayTrace"}, + {"name": "EarleyBoyer"}, + {"name": "RegExp"}, + {"name": "Splay"}, + {"name": "NavierStokes"} + ] +} diff --git a/deps/v8/build/all.gyp b/deps/v8/build/all.gyp index 3860379ea9c..5e410a3d0f2 100644 --- a/deps/v8/build/all.gyp +++ b/deps/v8/build/all.gyp @@ -10,7 +10,9 @@ 'dependencies': [ '../samples/samples.gyp:*', '../src/d8.gyp:d8', + '../test/base-unittests/base-unittests.gyp:*', '../test/cctest/cctest.gyp:*', + '../test/compiler-unittests/compiler-unittests.gyp:*', ], 'conditions': [ ['component!="shared_library"', { diff --git a/deps/v8/build/android.gypi b/deps/v8/build/android.gypi index 73ac93a434a..46ece08524e 100644 --- a/deps/v8/build/android.gypi +++ b/deps/v8/build/android.gypi @@ -35,9 +35,6 @@ 'variables': { 'android_ndk_root%': ' %r' % (func.__name__, val[0]) + return val[0] + return inner + return memoizer + + +@memoize() +def IsWindows(): + return sys.platform in ['win32', 'cygwin'] + + +@memoize() +def IsLinux(): + return sys.platform.startswith(('linux', 'freebsd')) + + +@memoize() +def IsMac(): + return sys.platform == 'darwin' + + +@memoize() +def gyp_defines(): + """Parses and returns GYP_DEFINES env var as a dictionary.""" + return dict(arg.split('=', 1) + for arg in shlex.split(os.environ.get('GYP_DEFINES', ''))) + +@memoize() +def gyp_msvs_version(): + return os.environ.get('GYP_MSVS_VERSION', '') + +@memoize() +def distributor(): + """ + Returns a string which is the distributed build engine in use (if any). + Possible values: 'goma', 'ib', '' + """ + if 'goma' in gyp_defines(): + return 'goma' + elif IsWindows(): + if 'CHROME_HEADLESS' in os.environ: + return 'ib' # use (win and !goma and headless) as approximation of ib + + +@memoize() +def platform(): + """ + Returns a string representing the platform this build is targetted for. + Possible values: 'win', 'mac', 'linux', 'ios', 'android' + """ + if 'OS' in gyp_defines(): + if 'android' in gyp_defines()['OS']: + return 'android' + else: + return gyp_defines()['OS'] + elif IsWindows(): + return 'win' + elif IsLinux(): + return 'linux' + else: + return 'mac' + + +@memoize() +def builder(): + """ + Returns a string representing the build engine (not compiler) to use. + Possible values: 'make', 'ninja', 'xcode', 'msvs', 'scons' + """ + if 'GYP_GENERATORS' in os.environ: + # for simplicity, only support the first explicit generator + generator = os.environ['GYP_GENERATORS'].split(',')[0] + if generator.endswith('-android'): + return generator.split('-')[0] + elif generator.endswith('-ninja'): + return 'ninja' + else: + return generator + else: + if platform() == 'android': + # Good enough for now? Do any android bots use make? + return 'make' + elif platform() == 'ios': + return 'xcode' + elif IsWindows(): + return 'msvs' + elif IsLinux(): + return 'make' + elif IsMac(): + return 'xcode' + else: + assert False, 'Don\'t know what builder we\'re using!' diff --git a/deps/v8/build/landmines.py b/deps/v8/build/landmines.py new file mode 100755 index 00000000000..bd1fb28f719 --- /dev/null +++ b/deps/v8/build/landmines.py @@ -0,0 +1,139 @@ +#!/usr/bin/env python +# 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. + +""" +This script runs every build as a hook. If it detects that the build should +be clobbered, it will touch the file /.landmine_triggered. The +various build scripts will then check for the presence of this file and clobber +accordingly. The script will also emit the reasons for the clobber to stdout. + +A landmine is tripped when a builder checks out a different revision, and the +diff between the new landmines and the old ones is non-null. At this point, the +build is clobbered. +""" + +import difflib +import logging +import optparse +import os +import sys +import subprocess +import time + +import landmine_utils + + +SRC_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + + +def get_target_build_dir(build_tool, target): + """ + Returns output directory absolute path dependent on build and targets. + Examples: + r'c:\b\build\slave\win\build\src\out\Release' + '/mnt/data/b/build/slave/linux/build/src/out/Debug' + '/b/build/slave/ios_rel_device/build/src/xcodebuild/Release-iphoneos' + + Keep this function in sync with tools/build/scripts/slave/compile.py + """ + ret = None + if build_tool == 'xcode': + ret = os.path.join(SRC_DIR, 'xcodebuild', target) + elif build_tool in ['make', 'ninja', 'ninja-ios']: # TODO: Remove ninja-ios. + ret = os.path.join(SRC_DIR, 'out', target) + elif build_tool in ['msvs', 'vs', 'ib']: + ret = os.path.join(SRC_DIR, 'build', target) + else: + raise NotImplementedError('Unexpected GYP_GENERATORS (%s)' % build_tool) + return os.path.abspath(ret) + + +def set_up_landmines(target, new_landmines): + """Does the work of setting, planting, and triggering landmines.""" + out_dir = get_target_build_dir(landmine_utils.builder(), target) + + landmines_path = os.path.join(out_dir, '.landmines') + if not os.path.exists(out_dir): + return + + if not os.path.exists(landmines_path): + print "Landmines tracker didn't exists." + + # FIXME(machenbach): Clobber deletes the .landmines tracker. Difficult + # to know if we are right after a clobber or if it is first-time landmines + # deployment. Also, a landmine-triggered clobber right after a clobber is + # not possible. Different clobber methods for msvs, xcode and make all + # have different blacklists of files that are not deleted. + if os.path.exists(landmines_path): + triggered = os.path.join(out_dir, '.landmines_triggered') + with open(landmines_path, 'r') as f: + old_landmines = f.readlines() + if old_landmines != new_landmines: + old_date = time.ctime(os.stat(landmines_path).st_ctime) + diff = difflib.unified_diff(old_landmines, new_landmines, + fromfile='old_landmines', tofile='new_landmines', + fromfiledate=old_date, tofiledate=time.ctime(), n=0) + + with open(triggered, 'w') as f: + f.writelines(diff) + print "Setting landmine: %s" % triggered + elif os.path.exists(triggered): + # Remove false triggered landmines. + os.remove(triggered) + print "Removing landmine: %s" % triggered + with open(landmines_path, 'w') as f: + f.writelines(new_landmines) + + +def process_options(): + """Returns a list of landmine emitting scripts.""" + parser = optparse.OptionParser() + parser.add_option( + '-s', '--landmine-scripts', action='append', + default=[os.path.join(SRC_DIR, 'build', 'get_landmines.py')], + help='Path to the script which emits landmines to stdout. The target ' + 'is passed to this script via option -t. Note that an extra ' + 'script can be specified via an env var EXTRA_LANDMINES_SCRIPT.') + parser.add_option('-v', '--verbose', action='store_true', + default=('LANDMINES_VERBOSE' in os.environ), + help=('Emit some extra debugging information (default off). This option ' + 'is also enabled by the presence of a LANDMINES_VERBOSE environment ' + 'variable.')) + + options, args = parser.parse_args() + + if args: + parser.error('Unknown arguments %s' % args) + + logging.basicConfig( + level=logging.DEBUG if options.verbose else logging.ERROR) + + extra_script = os.environ.get('EXTRA_LANDMINES_SCRIPT') + if extra_script: + return options.landmine_scripts + [extra_script] + else: + return options.landmine_scripts + + +def main(): + landmine_scripts = process_options() + + if landmine_utils.builder() in ('dump_dependency_json', 'eclipse'): + return 0 + + landmines = [] + for s in landmine_scripts: + proc = subprocess.Popen([sys.executable, s], stdout=subprocess.PIPE) + output, _ = proc.communicate() + landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) + + for target in ('Debug', 'Release'): + set_up_landmines(target, landmines) + + return 0 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/deps/v8/build/standalone.gypi b/deps/v8/build/standalone.gypi index befa73851e3..2ed19f65eac 100644 --- a/deps/v8/build/standalone.gypi +++ b/deps/v8/build/standalone.gypi @@ -33,8 +33,8 @@ 'includes': ['toolchain.gypi'], 'variables': { 'component%': 'static_library', - 'clang%': 0, 'asan%': 0, + 'tsan%': 0, 'visibility%': 'hidden', 'v8_enable_backtrace%': 0, 'v8_enable_i18n_support%': 1, @@ -51,13 +51,7 @@ # Anything else gets passed through, which probably won't work # very well; such hosts should pass an explicit target_arch # to gyp. - 'host_arch%': - '&1 | grep -q "^Target: arm" && echo "yes" || echo "no")', - }, 'conditions': [ - ['armcompiler=="yes"', { + ['v8_target_arch==host_arch and android_webview_build==0', { + # Host built with an Arm CXX compiler. 'conditions': [ [ 'arm_version==7', { 'cflags': ['-march=armv7-a',], }], [ 'arm_version==7 or arm_version=="default"', { 'conditions': [ - [ 'arm_neon==1', { - 'cflags': ['-mfpu=neon',], - }, - { - 'conditions': [ - [ 'arm_fpu!="default"', { - 'cflags': ['-mfpu=<(arm_fpu)',], - }], - ], + [ 'arm_fpu!="default"', { + 'cflags': ['-mfpu=<(arm_fpu)',], }], ], }], @@ -123,44 +173,11 @@ [ 'arm_thumb==0', { 'cflags': ['-marm',], }], - [ 'arm_test=="on"', { - 'defines': [ - 'ARM_TEST', - ], - }], ], }, { - # armcompiler=="no" + # 'v8_target_arch!=host_arch' + # Host not built with an Arm CXX compiler (simulator build). 'conditions': [ - [ 'arm_version==7 or arm_version=="default"', { - 'defines': [ - 'CAN_USE_ARMV7_INSTRUCTIONS=1', - ], - 'conditions': [ - [ 'arm_fpu=="default"', { - 'defines': [ - 'CAN_USE_VFP3_INSTRUCTIONS', - ], - }], - [ 'arm_fpu=="vfpv3-d16"', { - 'defines': [ - 'CAN_USE_VFP3_INSTRUCTIONS', - ], - }], - [ 'arm_fpu=="vfpv3"', { - 'defines': [ - 'CAN_USE_VFP3_INSTRUCTIONS', - 'CAN_USE_VFP32DREGS', - ], - }], - [ 'arm_fpu=="neon" or arm_neon==1', { - 'defines': [ - 'CAN_USE_VFP3_INSTRUCTIONS', - 'CAN_USE_VFP32DREGS', - ], - }], - ], - }], [ 'arm_float_abi=="hard"', { 'defines': [ 'USE_EABI_HARDFLOAT=1', @@ -172,33 +189,21 @@ ], }], ], - 'defines': [ - 'ARM_TEST', - ], }], ], }], # _toolset=="host" ['_toolset=="target"', { - 'variables': { - 'armcompiler': '&1 | grep -q "^Target: arm" && echo "yes" || echo "no")', - }, 'conditions': [ - ['armcompiler=="yes"', { + ['v8_target_arch==target_arch and android_webview_build==0', { + # Target built with an Arm CXX compiler. 'conditions': [ [ 'arm_version==7', { 'cflags': ['-march=armv7-a',], }], [ 'arm_version==7 or arm_version=="default"', { 'conditions': [ - [ 'arm_neon==1', { - 'cflags': ['-mfpu=neon',], - }, - { - 'conditions': [ - [ 'arm_fpu!="default"', { - 'cflags': ['-mfpu=<(arm_fpu)',], - }], - ], + [ 'arm_fpu!="default"', { + 'cflags': ['-mfpu=<(arm_fpu)',], }], ], }], @@ -211,44 +216,11 @@ [ 'arm_thumb==0', { 'cflags': ['-marm',], }], - [ 'arm_test=="on"', { - 'defines': [ - 'ARM_TEST', - ], - }], ], }, { - # armcompiler=="no" + # 'v8_target_arch!=target_arch' + # Target not built with an Arm CXX compiler (simulator build). 'conditions': [ - [ 'arm_version==7 or arm_version=="default"', { - 'defines': [ - 'CAN_USE_ARMV7_INSTRUCTIONS=1', - ], - 'conditions': [ - [ 'arm_fpu=="default"', { - 'defines': [ - 'CAN_USE_VFP3_INSTRUCTIONS', - ], - }], - [ 'arm_fpu=="vfpv3-d16"', { - 'defines': [ - 'CAN_USE_VFP3_INSTRUCTIONS', - ], - }], - [ 'arm_fpu=="vfpv3"', { - 'defines': [ - 'CAN_USE_VFP3_INSTRUCTIONS', - 'CAN_USE_VFP32DREGS', - ], - }], - [ 'arm_fpu=="neon" or arm_neon==1', { - 'defines': [ - 'CAN_USE_VFP3_INSTRUCTIONS', - 'CAN_USE_VFP32DREGS', - ], - }], - ], - }], [ 'arm_float_abi=="hard"', { 'defines': [ 'USE_EABI_HARDFLOAT=1', @@ -260,9 +232,6 @@ ], }], ], - 'defines': [ - 'ARM_TEST', - ], }], ], }], # _toolset=="target" @@ -278,15 +247,19 @@ 'V8_TARGET_ARCH_IA32', ], }], # v8_target_arch=="ia32" + ['v8_target_arch=="x87"', { + 'defines': [ + 'V8_TARGET_ARCH_X87', + ], + 'cflags': ['-march=i586'], + }], # v8_target_arch=="x87" ['v8_target_arch=="mips"', { 'defines': [ 'V8_TARGET_ARCH_MIPS', ], - 'variables': { - 'mipscompiler': '&1 | grep -q "^Target: mips" && echo "yes" || echo "no")', - }, 'conditions': [ - ['mipscompiler=="yes"', { + ['v8_target_arch==target_arch and android_webview_build==0', { + # Target built with a Mips CXX compiler. 'target_conditions': [ ['_toolset=="target"', { 'cflags': ['-EB'], @@ -299,10 +272,10 @@ 'cflags': ['-msoft-float'], 'ldflags': ['-msoft-float'], }], - ['mips_arch_variant=="mips32r2"', { + ['mips_arch_variant=="r2"', { 'cflags': ['-mips32r2', '-Wa,-mips32r2'], }], - ['mips_arch_variant=="mips32r1"', { + ['mips_arch_variant=="r1"', { 'cflags': ['-mips32', '-Wa,-mips32'], }], ], @@ -324,7 +297,7 @@ '__mips_soft_float=1' ], }], - ['mips_arch_variant=="mips32r2"', { + ['mips_arch_variant=="r2"', { 'defines': ['_MIPS_ARCH_MIPS32R2',], }], ], @@ -333,11 +306,9 @@ 'defines': [ 'V8_TARGET_ARCH_MIPS', ], - 'variables': { - 'mipscompiler': '&1 | grep -q "^Target: mips" && echo "yes" || echo "no")', - }, 'conditions': [ - ['mipscompiler=="yes"', { + ['v8_target_arch==target_arch and android_webview_build==0', { + # Target built with a Mips CXX compiler. 'target_conditions': [ ['_toolset=="target"', { 'cflags': ['-EL'], @@ -350,10 +321,10 @@ 'cflags': ['-msoft-float'], 'ldflags': ['-msoft-float'], }], - ['mips_arch_variant=="mips32r2"', { + ['mips_arch_variant=="r2"', { 'cflags': ['-mips32r2', '-Wa,-mips32r2'], }], - ['mips_arch_variant=="mips32r1"', { + ['mips_arch_variant=="r1"', { 'cflags': ['-mips32', '-Wa,-mips32'], }], ['mips_arch_variant=="loongson"', { @@ -378,7 +349,7 @@ '__mips_soft_float=1' ], }], - ['mips_arch_variant=="mips32r2"', { + ['mips_arch_variant=="r2"', { 'defines': ['_MIPS_ARCH_MIPS32R2',], }], ['mips_arch_variant=="loongson"', { @@ -386,6 +357,68 @@ }], ], }], # v8_target_arch=="mipsel" + ['v8_target_arch=="mips64el"', { + 'defines': [ + 'V8_TARGET_ARCH_MIPS64', + ], + 'conditions': [ + ['v8_target_arch==target_arch and android_webview_build==0', { + # Target built with a Mips CXX compiler. + 'target_conditions': [ + ['_toolset=="target"', { + 'cflags': ['-EL'], + 'ldflags': ['-EL'], + 'conditions': [ + [ 'v8_use_mips_abi_hardfloat=="true"', { + 'cflags': ['-mhard-float'], + 'ldflags': ['-mhard-float'], + }, { + 'cflags': ['-msoft-float'], + 'ldflags': ['-msoft-float'], + }], + ['mips_arch_variant=="r6"', { + 'cflags': ['-mips64r6', '-mabi=64', '-Wa,-mips64r6'], + 'ldflags': [ + '-mips64r6', '-mabi=64', + '-Wl,--dynamic-linker=$(LDSO_PATH)', + '-Wl,--rpath=$(LD_R_PATH)', + ], + }], + ['mips_arch_variant=="r2"', { + 'cflags': ['-mips64r2', '-mabi=64', '-Wa,-mips64r2'], + 'ldflags': [ + '-mips64r2', '-mabi=64', + '-Wl,--dynamic-linker=$(LDSO_PATH)', + '-Wl,--rpath=$(LD_R_PATH)', + ], + }], + ], + }], + ], + }], + [ 'v8_can_use_fpu_instructions=="true"', { + 'defines': [ + 'CAN_USE_FPU_INSTRUCTIONS', + ], + }], + [ 'v8_use_mips_abi_hardfloat=="true"', { + 'defines': [ + '__mips_hard_float=1', + 'CAN_USE_FPU_INSTRUCTIONS', + ], + }, { + 'defines': [ + '__mips_soft_float=1' + ], + }], + ['mips_arch_variant=="r6"', { + 'defines': ['_MIPS_ARCH_MIPS64R6',], + }], + ['mips_arch_variant=="r2"', { + 'defines': ['_MIPS_ARCH_MIPS64R2',], + }], + ], + }], # v8_target_arch=="mips64el" ['v8_target_arch=="x64"', { 'defines': [ 'V8_TARGET_ARCH_X64', @@ -400,16 +433,42 @@ }, 'msvs_configuration_platform': 'x64', }], # v8_target_arch=="x64" + ['v8_target_arch=="x32"', { + 'defines': [ + # x32 port shares the source code with x64 port. + 'V8_TARGET_ARCH_X64', + 'V8_TARGET_ARCH_32_BIT', + ], + 'cflags': [ + '-mx32', + # Inhibit warning if long long type is used. + '-Wno-long-long', + ], + 'ldflags': [ + '-mx32', + ], + }], # v8_target_arch=="x32" ['OS=="win"', { 'defines': [ 'WIN32', ], + # 4351: VS 2005 and later are warning us that they've fixed a bug + # present in VS 2003 and earlier. + 'msvs_disabled_warnings': [4351], 'msvs_configuration_attributes': { 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)', 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', 'CharacterSet': '1', }, }], + ['OS=="win" and v8_target_arch=="ia32"', { + 'msvs_settings': { + 'VCCLCompilerTool': { + # Ensure no surprising artifacts from 80bit double math with x86. + 'AdditionalOptions': ['/arch:SSE2'], + }, + }, + }], ['OS=="win" and v8_enable_prof==1', { 'msvs_settings': { 'VCLinkerTool': { @@ -417,44 +476,28 @@ }, }, }], - ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ - or OS=="netbsd" or OS=="qnx"', { - 'conditions': [ - [ 'v8_no_strict_aliasing==1', { - 'cflags': [ '-fno-strict-aliasing' ], - }], - ], # conditions - }], - ['OS=="solaris"', { - 'defines': [ '__C99FEATURES__=1' ], # isinf() etc. - }], - ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ + ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \ (v8_target_arch=="arm" or v8_target_arch=="ia32" or \ - v8_target_arch=="mips" or v8_target_arch=="mipsel")', { - # Check whether the host compiler and target compiler support the - # '-m32' option and set it if so. + v8_target_arch=="x87" or v8_target_arch=="mips" or \ + v8_target_arch=="mipsel")', { 'target_conditions': [ ['_toolset=="host"', { - 'variables': { - 'm32flag': ' /dev/null 2>&1 < /dev/null) && echo "-m32" || true)', - }, - 'cflags': [ '<(m32flag)' ], - 'ldflags': [ '<(m32flag)' ], + 'conditions': [ + ['host_cxx_is_biarch==1', { + 'cflags': [ '-m32' ], + 'ldflags': [ '-m32' ] + }], + ], 'xcode_settings': { 'ARCHS': [ 'i386' ], }, }], ['_toolset=="target"', { - 'variables': { - 'm32flag': ' /dev/null 2>&1 < /dev/null) && echo "-m32" || true)', - 'clang%': 0, - }, 'conditions': [ - ['((OS!="android" and OS!="qnx") or clang==1) and \ - nacl_target_arch!="nacl_x64"', { - 'cflags': [ '<(m32flag)' ], - 'ldflags': [ '<(m32flag)' ], + ['target_cxx_is_biarch==1 and nacl_target_arch!="nacl_x64"', { + 'cflags': [ '-m32' ], + 'ldflags': [ '-m32' ], }], ], 'xcode_settings': { @@ -465,28 +508,35 @@ }], ['(OS=="linux" or OS=="android") and \ (v8_target_arch=="x64" or v8_target_arch=="arm64")', { - # Check whether the host compiler and target compiler support the - # '-m64' option and set it if so. 'target_conditions': [ ['_toolset=="host"', { - 'variables': { - 'm64flag': ' /dev/null 2>&1 < /dev/null) && echo "-m64" || true)', - }, - 'cflags': [ '<(m64flag)' ], - 'ldflags': [ '<(m64flag)' ], - }], - ['_toolset=="target"', { - 'variables': { - 'm64flag': ' /dev/null 2>&1 < /dev/null) && echo "-m64" || true)', - }, 'conditions': [ - ['((OS!="android" and OS!="qnx") or clang==1)', { - 'cflags': [ '<(m64flag)' ], - 'ldflags': [ '<(m64flag)' ], + ['host_cxx_is_biarch==1', { + 'cflags': [ '-m64' ], + 'ldflags': [ '-m64' ] }], - ], - }] - ], + ], + }], + ['_toolset=="target"', { + 'conditions': [ + ['target_cxx_is_biarch==1', { + 'cflags': [ '-m64' ], + 'ldflags': [ '-m64' ], + }], + ] + }], + ], + }], + ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ + or OS=="netbsd" or OS=="qnx"', { + 'conditions': [ + [ 'v8_no_strict_aliasing==1', { + 'cflags': [ '-fno-strict-aliasing' ], + }], + ], # conditions + }], + ['OS=="solaris"', { + 'defines': [ '__C99FEATURES__=1' ], # isinf() etc. }], ['OS=="freebsd" or OS=="openbsd"', { 'cflags': [ '-I/usr/local/include' ], diff --git a/deps/v8/codereview.settings b/deps/v8/codereview.settings index 3f642f13bd9..b7f853cd594 100644 --- a/deps/v8/codereview.settings +++ b/deps/v8/codereview.settings @@ -5,3 +5,4 @@ STATUS: http://v8-status.appspot.com/status TRY_ON_UPLOAD: False TRYSERVER_SVN_URL: svn://svn.chromium.org/chrome-try-v8 TRYSERVER_ROOT: v8 +PROJECT: v8 diff --git a/deps/v8/include/libplatform/libplatform.h b/deps/v8/include/libplatform/libplatform.h new file mode 100644 index 00000000000..2125e9746b9 --- /dev/null +++ b/deps/v8/include/libplatform/libplatform.h @@ -0,0 +1,38 @@ +// 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. + +#ifndef V8_LIBPLATFORM_LIBPLATFORM_H_ +#define V8_LIBPLATFORM_LIBPLATFORM_H_ + +#include "include/v8-platform.h" + +namespace v8 { +namespace platform { + +/** + * Returns a new instance of the default v8::Platform implementation. + * + * The caller will take ownership of the returned pointer. |thread_pool_size| + * is the number of worker threads to allocate for background jobs. If a value + * of zero is passed, a suitable default based on the current number of + * processors online will be chosen. + */ +v8::Platform* CreateDefaultPlatform(int thread_pool_size = 0); + + +/** + * Pumps the message loop for the given isolate. + * + * The caller has to make sure that this is called from the right thread. + * Returns true if a task was executed, and false otherwise. This call does + * not block if no task is pending. The |platform| has to be created using + * |CreateDefaultPlatform|. + */ +bool PumpMessageLoop(v8::Platform* platform, v8::Isolate* isolate); + + +} // namespace platform +} // namespace v8 + +#endif // V8_LIBPLATFORM_LIBPLATFORM_H_ diff --git a/deps/v8/include/v8-debug.h b/deps/v8/include/v8-debug.h index bd3eb77c4d7..e72415952d9 100644 --- a/deps/v8/include/v8-debug.h +++ b/deps/v8/include/v8-debug.h @@ -19,8 +19,10 @@ enum DebugEvent { NewFunction = 3, BeforeCompile = 4, AfterCompile = 5, - ScriptCollected = 6, - BreakForCommand = 7 + CompileError = 6, + PromiseEvent = 7, + AsyncTaskEvent = 8, + BreakForCommand = 9 }; @@ -137,7 +139,7 @@ class V8_EXPORT Debug { * A EventCallback2 does not take possession of the event data, * and must not rely on the data persisting after the handler returns. */ - typedef void (*EventCallback2)(const EventDetails& event_details); + typedef void (*EventCallback)(const EventDetails& event_details); /** * Debug message callback function. @@ -147,23 +149,14 @@ class V8_EXPORT Debug { * A MessageHandler2 does not take possession of the message data, * and must not rely on the data persisting after the handler returns. */ - typedef void (*MessageHandler2)(const Message& message); - - /** - * Debug host dispatch callback function. - */ - typedef void (*HostDispatchHandler)(); + typedef void (*MessageHandler)(const Message& message); /** * Callback function for the host to ensure debug messages are processed. */ typedef void (*DebugMessageDispatchHandler)(); - static bool SetDebugEventListener2(EventCallback2 that, - Handle data = Handle()); - - // Set a JavaScript debug event listener. - static bool SetDebugEventListener(v8::Handle that, + static bool SetDebugEventListener(EventCallback that, Handle data = Handle()); // Schedule a debugger break to happen when JavaScript code is run @@ -181,36 +174,13 @@ class V8_EXPORT Debug { // stops. static void DebugBreakForCommand(Isolate* isolate, ClientData* data); - // TODO(svenpanne) Remove this when Chrome is updated. - static void DebugBreakForCommand(ClientData* data, Isolate* isolate) { - DebugBreakForCommand(isolate, data); - } - // Message based interface. The message protocol is JSON. - static void SetMessageHandler2(MessageHandler2 handler); + static void SetMessageHandler(MessageHandler handler); static void SendCommand(Isolate* isolate, const uint16_t* command, int length, ClientData* client_data = NULL); - // Dispatch interface. - static void SetHostDispatchHandler(HostDispatchHandler handler, - int period = 100); - - /** - * Register a callback function to be called when a debug message has been - * received and is ready to be processed. For the debug messages to be - * processed V8 needs to be entered, and in certain embedding scenarios this - * callback can be used to make sure V8 is entered for the debug message to - * be processed. Note that debug messages will only be processed if there is - * a V8 break. This can happen automatically by using the option - * --debugger-auto-break. - * \param provide_locker requires that V8 acquires v8::Locker for you before - * calling handler - */ - static void SetDebugMessageDispatchHandler( - DebugMessageDispatchHandler handler, bool provide_locker = false); - /** * Run a JavaScript function in the debugger. * \param fun the function to call @@ -237,22 +207,6 @@ class V8_EXPORT Debug { */ static Local GetMirror(v8::Handle obj); - /** - * Enable the V8 builtin debug agent. The debugger agent will listen on the - * supplied TCP/IP port for remote debugger connection. - * \param name the name of the embedding application - * \param port the TCP/IP port to listen on - * \param wait_for_connection whether V8 should pause on a first statement - * allowing remote debugger to connect before anything interesting happened - */ - static bool EnableAgent(const char* name, int port, - bool wait_for_connection = false); - - /** - * Disable the V8 builtin debug agent. The TCP/IP connection will be closed. - */ - static void DisableAgent(); - /** * Makes V8 process all pending debug messages. * @@ -271,10 +225,6 @@ class V8_EXPORT Debug { * until V8 gets control again; however, embedding application may improve * this by manually calling this method. * - * It makes sense to call this method whenever a new debug message arrived and - * V8 is not already running. Method v8::Debug::SetDebugMessageDispatchHandler - * should help with the former condition. - * * Technically this method in many senses is equivalent to executing empty * script: * 1. It does nothing except for processing all pending debug messages. @@ -305,11 +255,6 @@ class V8_EXPORT Debug { * unexpectedly used. LiveEdit is enabled by default. */ static void SetLiveEditEnabled(Isolate* isolate, bool enable); - - // TODO(svenpanne) Remove this when Chrome is updated. - static void SetLiveEditEnabled(bool enable, Isolate* isolate) { - SetLiveEditEnabled(isolate, enable); - } }; diff --git a/deps/v8/include/v8-platform.h b/deps/v8/include/v8-platform.h index 5667211c321..1f1679f0e0b 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -5,10 +5,10 @@ #ifndef V8_V8_PLATFORM_H_ #define V8_V8_PLATFORM_H_ -#include "v8.h" - namespace v8 { +class Isolate; + /** * A Task represents a unit of work. */ @@ -37,6 +37,8 @@ class Platform { kLongRunningTask }; + virtual ~Platform() {} + /** * Schedules a task to be invoked on a background thread. |expected_runtime| * indicates that the task will run a long time. The Platform implementation @@ -53,9 +55,6 @@ class Platform { * scheduling. The definition of "foreground" is opaque to V8. */ virtual void CallOnForegroundThread(Isolate* isolate, Task* task) = 0; - - protected: - virtual ~Platform() {} }; } // namespace v8 diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index 19d143e01bb..7fc193db58e 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -219,19 +219,20 @@ class V8_EXPORT HeapGraphEdge { class V8_EXPORT HeapGraphNode { public: enum Type { - kHidden = 0, // Hidden node, may be filtered when shown to user. - kArray = 1, // An array of elements. - kString = 2, // A string. - kObject = 3, // A JS object (except for arrays and strings). - kCode = 4, // Compiled code. - kClosure = 5, // Function closure. - kRegExp = 6, // RegExp. - kHeapNumber = 7, // Number stored in the heap. - kNative = 8, // Native object (not from V8 heap). - kSynthetic = 9, // Synthetic object, usualy used for grouping - // snapshot items together. - kConsString = 10, // Concatenated string. A pair of pointers to strings. - kSlicedString = 11 // Sliced string. A fragment of another string. + kHidden = 0, // Hidden node, may be filtered when shown to user. + kArray = 1, // An array of elements. + kString = 2, // A string. + kObject = 3, // A JS object (except for arrays and strings). + kCode = 4, // Compiled code. + kClosure = 5, // Function closure. + kRegExp = 6, // RegExp. + kHeapNumber = 7, // Number stored in the heap. + kNative = 8, // Native object (not from V8 heap). + kSynthetic = 9, // Synthetic object, usualy used for grouping + // snapshot items together. + kConsString = 10, // Concatenated string. A pair of pointers to strings. + kSlicedString = 11, // Sliced string. A fragment of another string. + kSymbol = 12 // A Symbol (ES6). }; /** Returns node type (see HeapGraphNode::Type). */ @@ -292,7 +293,7 @@ class V8_EXPORT OutputStream { // NOLINT */ virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate* data, int count) { return kAbort; - }; + } }; diff --git a/deps/v8/include/v8-util.h b/deps/v8/include/v8-util.h index 60feff549d9..1eaf1ab68f6 100644 --- a/deps/v8/include/v8-util.h +++ b/deps/v8/include/v8-util.h @@ -154,7 +154,7 @@ class PersistentValueMap { */ bool SetReturnValue(const K& key, ReturnValue returnValue) { - return SetReturnValueFromVal(returnValue, Traits::Get(&impl_, key)); + return SetReturnValueFromVal(&returnValue, Traits::Get(&impl_, key)); } /** @@ -227,7 +227,7 @@ class PersistentValueMap { } template bool SetReturnValue(ReturnValue returnValue) { - return SetReturnValueFromVal(returnValue, value_); + return SetReturnValueFromVal(&returnValue, value_); } void Reset() { value_ = kPersistentContainerNotFound; @@ -300,6 +300,7 @@ class PersistentValueMap { K key = Traits::KeyFromWeakCallbackData(data); Traits::Dispose(data.GetIsolate(), persistentValueMap->Remove(key).Pass(), key); + Traits::DisposeCallbackData(data.GetParameter()); } } @@ -308,10 +309,10 @@ class PersistentValueMap { } static bool SetReturnValueFromVal( - ReturnValue& returnValue, PersistentContainerValue value) { + ReturnValue* returnValue, PersistentContainerValue value) { bool hasValue = value != kPersistentContainerNotFound; if (hasValue) { - returnValue.SetInternal( + returnValue->SetInternal( *reinterpret_cast(FromVal(value))); } return hasValue; @@ -337,7 +338,7 @@ class PersistentValueMap { static UniquePersistent Release(PersistentContainerValue v) { UniquePersistent p; p.val_ = FromVal(v); - if (Traits::kCallbackType != kNotWeak && !p.IsEmpty()) { + if (Traits::kCallbackType != kNotWeak && p.IsWeak()) { Traits::DisposeCallbackData( p.template ClearWeak()); } @@ -422,7 +423,7 @@ class PersistentValueVector { */ void Append(UniquePersistent persistent) { Traits::Append(&impl_, ClearAndLeak(&persistent)); - }; + } /** * Are there any values in the vector? diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 538b6581f1d..ef0bda63f43 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -895,6 +895,13 @@ struct Maybe { }; +// Convenience wrapper. +template +inline Maybe maybe(T t) { + return Maybe(t); +} + + // --- Special objects --- @@ -916,20 +923,24 @@ class ScriptOrigin { Handle resource_name, Handle resource_line_offset = Handle(), Handle resource_column_offset = Handle(), - Handle resource_is_shared_cross_origin = Handle()) + Handle resource_is_shared_cross_origin = Handle(), + Handle script_id = Handle()) : resource_name_(resource_name), resource_line_offset_(resource_line_offset), resource_column_offset_(resource_column_offset), - resource_is_shared_cross_origin_(resource_is_shared_cross_origin) { } + resource_is_shared_cross_origin_(resource_is_shared_cross_origin), + script_id_(script_id) { } V8_INLINE Handle ResourceName() const; V8_INLINE Handle ResourceLineOffset() const; V8_INLINE Handle ResourceColumnOffset() const; V8_INLINE Handle ResourceIsSharedCrossOrigin() const; + V8_INLINE Handle ScriptID() const; private: Handle resource_name_; Handle resource_line_offset_; Handle resource_column_offset_; Handle resource_is_shared_cross_origin_; + Handle script_id_; }; @@ -946,6 +957,15 @@ class V8_EXPORT UnboundScript { int GetId(); Handle GetScriptName(); + /** + * Data read from magic sourceURL comments. + */ + Handle GetSourceURL(); + /** + * Data read from magic sourceMappingURL comments. + */ + Handle GetSourceMappingURL(); + /** * Returns zero based line number of the code_pos location in the script. * -1 will be returned if no information available. @@ -984,24 +1004,9 @@ class V8_EXPORT Script { */ Local GetUnboundScript(); - // To be deprecated; use GetUnboundScript()->GetId(); - int GetId() { - return GetUnboundScript()->GetId(); - } - - // Use GetUnboundScript()->GetId(); V8_DEPRECATED("Use GetUnboundScript()->GetId()", - Handle GetScriptName()) { - return GetUnboundScript()->GetScriptName(); - } - - /** - * Returns zero based line number of the code_pos location in the script. - * -1 will be returned if no information available. - */ - V8_DEPRECATED("Use GetUnboundScript()->GetLineNumber()", - int GetLineNumber(int code_pos)) { - return GetUnboundScript()->GetLineNumber(code_pos); + int GetId()) { + return GetUnboundScript()->GetId(); } }; @@ -1039,15 +1044,14 @@ class V8_EXPORT ScriptCompiler { int length; BufferPolicy buffer_policy; - private: - // Prevent copying. Not implemented. - CachedData(const CachedData&); - CachedData& operator=(const CachedData&); + private: + // Prevent copying. Not implemented. + CachedData(const CachedData&); + CachedData& operator=(const CachedData&); }; /** - * Source code which can be then compiled to a UnboundScript or - * BoundScript. + * Source code which can be then compiled to a UnboundScript or Script. */ class Source { public: @@ -1065,7 +1069,7 @@ class V8_EXPORT ScriptCompiler { private: friend class ScriptCompiler; - // Prevent copying. Not implemented. + // Prevent copying. Not implemented. Source(const Source&); Source& operator=(const Source&); @@ -1077,19 +1081,31 @@ class V8_EXPORT ScriptCompiler { Handle resource_column_offset; Handle resource_is_shared_cross_origin; - // Cached data from previous compilation (if any), or generated during - // compilation (if the generate_cached_data flag is passed to - // ScriptCompiler). + // Cached data from previous compilation (if a kConsume*Cache flag is + // set), or hold newly generated cache data (kProduce*Cache flags) are + // set when calling a compile method. CachedData* cached_data; }; enum CompileOptions { - kNoCompileOptions, - kProduceDataToCache = 1 << 0 + kNoCompileOptions = 0, + kProduceParserCache, + kConsumeParserCache, + kProduceCodeCache, + kConsumeCodeCache, + + // Support the previous API for a transition period. + kProduceDataToCache }; /** * Compiles the specified script (context-independent). + * Cached data as part of the source object can be optionally produced to be + * consumed later to speed up compilation of identical source scripts. + * + * Note that when producing cached data, the source must point to NULL for + * cached data. When consuming cached data, the cached data must have been + * produced by the same version of V8. * * \param source Script source code. * \return Compiled script object (context independent; for running it must be @@ -1124,6 +1140,12 @@ class V8_EXPORT Message { Local Get() const; Local GetSourceLine() const; + /** + * Returns the origin for the script from where the function causing the + * error originates. + */ + ScriptOrigin GetScriptOrigin() const; + /** * Returns the resource name for the script from where the function causing * the error originates. @@ -1201,6 +1223,7 @@ class V8_EXPORT StackTrace { kIsConstructor = 1 << 5, kScriptNameOrSourceURL = 1 << 6, kScriptId = 1 << 7, + kExposeFramesAcrossSecurityOrigins = 1 << 8, kOverview = kLineNumber | kColumnOffset | kScriptName | kFunctionName, kDetailed = kOverview | kIsEval | kIsConstructor | kScriptNameOrSourceURL }; @@ -2071,11 +2094,7 @@ typedef void (*AccessorSetterCallback)( * accessors have an explicit access control parameter which specifies * the kind of cross-context access that should be allowed. * - * Additionally, for security, accessors can prohibit overwriting by - * accessors defined in JavaScript. For objects that have such - * accessors either locally or in their prototype chain it is not - * possible to overwrite the accessor by using __defineGetter__ or - * __defineSetter__ from JavaScript code. + * TODO(dcarney): Remove PROHIBITS_OVERWRITING as it is now unused. */ enum AccessControl { DEFAULT = 0, @@ -2090,13 +2109,11 @@ enum AccessControl { */ class V8_EXPORT Object : public Value { public: - bool Set(Handle key, - Handle value, - PropertyAttribute attribs = None); + bool Set(Handle key, Handle value); bool Set(uint32_t index, Handle value); - // Sets a local property on this object bypassing interceptors and + // Sets an own property on this object bypassing interceptors and // overriding accessors or read-only properties. // // Note that if the object has an interceptor the property will be set @@ -2119,6 +2136,11 @@ class V8_EXPORT Object : public Value { */ PropertyAttribute GetPropertyAttributes(Handle key); + /** + * Returns Object.getOwnPropertyDescriptor as per ES5 section 15.2.3.3. + */ + Local GetOwnPropertyDescriptor(Local key); + bool Has(Handle key); bool Delete(Handle key); @@ -2203,12 +2225,6 @@ class V8_EXPORT Object : public Value { */ Local ObjectProtoToString(); - /** - * Returns the function invoked as a constructor for this object. - * May be the null value. - */ - Local GetConstructor(); - /** * Returns the name of the function invoked as a constructor for this object. */ @@ -2429,6 +2445,10 @@ class ReturnValue { // Convenience getter for Isolate V8_INLINE Isolate* GetIsolate(); + // Pointer setter: Uncompilable to prevent inadvertent misuse. + template + V8_INLINE void Set(S* whatever); + private: template friend class ReturnValue; template friend class FunctionCallbackInfo; @@ -2629,6 +2649,7 @@ class V8_EXPORT Promise : public Object { */ Local Chain(Handle handler); Local Catch(Handle handler); + Local Then(Handle handler); V8_INLINE static Promise* Cast(Value* obj); @@ -3865,8 +3886,8 @@ class V8_EXPORT ResourceConstraints { uint64_t virtual_memory_limit, uint32_t number_of_processors); - int max_new_space_size() const { return max_new_space_size_; } - void set_max_new_space_size(int value) { max_new_space_size_ = value; } + int max_semi_space_size() const { return max_semi_space_size_; } + void set_max_semi_space_size(int value) { max_semi_space_size_ = value; } int max_old_space_size() const { return max_old_space_size_; } void set_max_old_space_size(int value) { max_old_space_size_ = value; } int max_executable_size() const { return max_executable_size_; } @@ -3879,18 +3900,18 @@ class V8_EXPORT ResourceConstraints { void set_max_available_threads(int value) { max_available_threads_ = value; } - int code_range_size() const { return code_range_size_; } - void set_code_range_size(int value) { + size_t code_range_size() const { return code_range_size_; } + void set_code_range_size(size_t value) { code_range_size_ = value; } private: - int max_new_space_size_; + int max_semi_space_size_; int max_old_space_size_; int max_executable_size_; uint32_t* stack_limit_; int max_available_threads_; - int code_range_size_; + size_t code_range_size_; }; @@ -3965,6 +3986,9 @@ typedef void (*MemoryAllocationCallback)(ObjectSpace space, // --- Leave Script Callback --- typedef void (*CallCompletedCallback)(); +// --- Microtask Callback --- +typedef void (*MicrotaskCallback)(void* data); + // --- Failed Access Check Callback --- typedef void (*FailedAccessCheckCallback)(Local target, AccessType type, @@ -4133,6 +4157,20 @@ class V8_EXPORT Isolate { kMinorGarbageCollection }; + /** + * Features reported via the SetUseCounterCallback callback. Do not chang + * assigned numbers of existing items; add new features to the end of this + * list. + */ + enum UseCounterFeature { + kUseAsm = 0, + kUseCounterFeatureCount // This enum value must be last. + }; + + typedef void (*UseCounterCallback)(Isolate* isolate, + UseCounterFeature feature); + + /** * Creates a new isolate. Does not change the currently entered * isolate. @@ -4211,7 +4249,8 @@ class V8_EXPORT Isolate { * kept alive by JavaScript objects. * \returns the adjusted value. */ - int64_t AdjustAmountOfExternalAllocatedMemory(int64_t change_in_bytes); + V8_INLINE int64_t + AdjustAmountOfExternalAllocatedMemory(int64_t change_in_bytes); /** * Returns heap profiler for this isolate. Will return NULL until the isolate @@ -4375,6 +4414,7 @@ class V8_EXPORT Isolate { /** * Experimental: Runs the Microtask Work Queue until empty + * Any exceptions thrown by microtask callbacks are swallowed. */ void RunMicrotasks(); @@ -4383,12 +4423,71 @@ class V8_EXPORT Isolate { */ void EnqueueMicrotask(Handle microtask); + /** + * Experimental: Enqueues the callback to the Microtask Work Queue + */ + void EnqueueMicrotask(MicrotaskCallback microtask, void* data = NULL); + /** * Experimental: Controls whether the Microtask Work Queue is automatically * run when the script call depth decrements to zero. */ void SetAutorunMicrotasks(bool autorun); + /** + * Experimental: Returns whether the Microtask Work Queue is automatically + * run when the script call depth decrements to zero. + */ + bool WillAutorunMicrotasks() const; + + /** + * Sets a callback for counting the number of times a feature of V8 is used. + */ + void SetUseCounterCallback(UseCounterCallback callback); + + /** + * Enables the host application to provide a mechanism for recording + * statistics counters. + */ + void SetCounterFunction(CounterLookupCallback); + + /** + * Enables the host application to provide a mechanism for recording + * histograms. The CreateHistogram function returns a + * histogram which will later be passed to the AddHistogramSample + * function. + */ + void SetCreateHistogramFunction(CreateHistogramCallback); + void SetAddHistogramSampleFunction(AddHistogramSampleCallback); + + /** + * Optional notification that the embedder is idle. + * V8 uses the notification to reduce memory footprint. + * This call can be used repeatedly if the embedder remains idle. + * Returns true if the embedder should stop calling IdleNotification + * until real work has been done. This indicates that V8 has done + * as much cleanup as it will be able to do. + * + * The idle_time_in_ms argument specifies the time V8 has to do reduce + * the memory footprint. There is no guarantee that the actual work will be + * done within the time limit. + */ + bool IdleNotification(int idle_time_in_ms); + + /** + * Optional notification that the system is running low on memory. + * V8 uses these notifications to attempt to free memory. + */ + void LowMemoryNotification(); + + /** + * Optional notification that a context has been disposed. V8 uses + * these notifications to guide the GC heuristic. Returns the number + * of context disposals - including this one - since the last time + * V8 had a chance to clean up. + */ + int ContextDisposedNotification(); + private: template friend class PersistentValueMap; @@ -4402,6 +4501,7 @@ class V8_EXPORT Isolate { void SetObjectGroupId(internal::Object** object, UniqueId id); void SetReferenceFromGroup(UniqueId id, internal::Object** object); void SetReference(internal::Object** parent, internal::Object** child); + void CollectAllGarbage(const char* gc_reason); }; class V8_EXPORT StartupData { @@ -4512,7 +4612,7 @@ struct JitCodeEvent { // Size of the instructions. size_t code_len; // Script info for CODE_ADDED event. - Handle