diff --git a/common.gypi b/common.gypi index ea7779ee097a69..8aee4eaaf749c1 100644 --- a/common.gypi +++ b/common.gypi @@ -20,16 +20,17 @@ # Enable disassembler for `--print-code` v8 options 'v8_enable_disassembler': 1, + # Disable support for postmortem debugging, continuously broken. + 'v8_postmortem_support%': 'false', + # Don't bake anything extra into the snapshot. 'v8_use_external_startup_data%': 0, 'conditions': [ ['OS == "win"', { 'os_posix': 0, - 'v8_postmortem_support%': 'false', }, { 'os_posix': 1, - 'v8_postmortem_support%': 'true', }], ['GENERATOR == "ninja" or OS== "mac"', { 'OBJ_DIR': '<(PRODUCT_DIR)/obj', diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index f720bee948660a..2eac3035c33dbb 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -29,6 +29,7 @@ .settings .*.sw? bsuite +compile_commands.json d8 d8_g gccauses diff --git a/deps/v8/.ycm_extra_conf.py b/deps/v8/.ycm_extra_conf.py new file mode 100644 index 00000000000000..e065a0896bdb82 --- /dev/null +++ b/deps/v8/.ycm_extra_conf.py @@ -0,0 +1,193 @@ +# Copyright 2015 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Autocompletion config for YouCompleteMe in V8. +# +# USAGE: +# +# 1. Install YCM [https://github.com/Valloric/YouCompleteMe] +# (Googlers should check out [go/ycm]) +# +# 2. Profit +# +# +# Usage notes: +# +# * You must use ninja & clang to build V8. +# +# * You must have run gyp_v8 and built V8 recently. +# +# +# Hacking notes: +# +# * The purpose of this script is to construct an accurate enough command line +# for YCM to pass to clang so it can build and extract the symbols. +# +# * Right now, we only pull the -I and -D flags. That seems to be sufficient +# for everything I've used it for. +# +# * That whole ninja & clang thing? We could support other configs if someone +# were willing to write the correct commands and a parser. +# +# * This has only been tested on gTrusty. + + +import os +import os.path +import subprocess +import sys + + +# Flags from YCM's default config. +flags = [ +'-DUSE_CLANG_COMPLETER', +'-std=gnu++0x', +'-x', +'c++', +] + + +def PathExists(*args): + return os.path.exists(os.path.join(*args)) + + +def FindV8SrcFromFilename(filename): + """Searches for the root of the V8 checkout. + + Simply checks parent directories until it finds .gclient and v8/. + + Args: + filename: (String) Path to source file being edited. + + Returns: + (String) Path of 'v8/', or None if unable to find. + """ + curdir = os.path.normpath(os.path.dirname(filename)) + while not (PathExists(curdir, 'v8') and PathExists(curdir, 'v8', 'DEPS') + and (PathExists(curdir, '.gclient') + or PathExists(curdir, 'v8', '.git'))): + nextdir = os.path.normpath(os.path.join(curdir, '..')) + if nextdir == curdir: + return None + curdir = nextdir + return os.path.join(curdir, 'v8') + + +def GetClangCommandFromNinjaForFilename(v8_root, filename): + """Returns the command line to build |filename|. + + Asks ninja how it would build the source file. If the specified file is a + header, tries to find its companion source file first. + + Args: + v8_root: (String) Path to v8/. + filename: (String) Path to source file being edited. + + Returns: + (List of Strings) Command line arguments for clang. + """ + if not v8_root: + return [] + + # Generally, everyone benefits from including V8's root, because all of + # V8's includes are relative to that. + v8_flags = ['-I' + os.path.join(v8_root)] + + # Version of Clang used to compile V8 can be newer then version of + # libclang that YCM uses for completion. So it's possible that YCM's libclang + # doesn't know about some used warning options, which causes compilation + # warnings (and errors, because of '-Werror'); + v8_flags.append('-Wno-unknown-warning-option') + + # Header files can't be built. Instead, try to match a header file to its + # corresponding source file. + if filename.endswith('.h'): + alternates = ['.cc', '.cpp'] + for alt_extension in alternates: + alt_name = filename[:-2] + alt_extension + if os.path.exists(alt_name): + filename = alt_name + break + else: + if filename.endswith('-inl.h'): + for alt_extension in alternates: + alt_name = filename[:-6] + alt_extension + if os.path.exists(alt_name): + filename = alt_name + break; + else: + # If this is a standalone -inl.h file with no source, the best we can + # do is try to use the default flags. + return v8_flags + else: + # If this is a standalone .h file with no source, the best we can do is + # try to use the default flags. + return v8_flags + + sys.path.append(os.path.join(v8_root, 'tools', 'ninja')) + from ninja_output import GetNinjaOutputDirectory + out_dir = os.path.realpath(GetNinjaOutputDirectory(v8_root)) + + # Ninja needs the path to the source file relative to the output build + # directory. + rel_filename = os.path.relpath(os.path.realpath(filename), out_dir) + + # Ask ninja how it would build our source file. + p = subprocess.Popen(['ninja', '-v', '-C', out_dir, '-t', + 'commands', rel_filename + '^'], + stdout=subprocess.PIPE) + stdout, stderr = p.communicate() + if p.returncode: + return v8_flags + + # Ninja might execute several commands to build something. We want the last + # clang command. + clang_line = None + for line in reversed(stdout.split('\n')): + if 'clang' in line: + clang_line = line + break + else: + return v8_flags + + # Parse flags that are important for YCM's purposes. + for flag in clang_line.split(' '): + if flag.startswith('-I'): + # Relative paths need to be resolved, because they're relative to the + # output dir, not the source. + if flag[2] == '/': + v8_flags.append(flag) + else: + abs_path = os.path.normpath(os.path.join(out_dir, flag[2:])) + v8_flags.append('-I' + abs_path) + elif flag.startswith('-std'): + v8_flags.append(flag) + elif flag.startswith('-') and flag[1] in 'DWFfmO': + if flag == '-Wno-deprecated-register' or flag == '-Wno-header-guard': + # These flags causes libclang (3.3) to crash. Remove it until things + # are fixed. + continue + v8_flags.append(flag) + + return v8_flags + + +def FlagsForFile(filename): + """This is the main entry point for YCM. Its interface is fixed. + + Args: + filename: (String) Path to source file being edited. + + Returns: + (Dictionary) + 'flags': (List of Strings) Command line flags. + 'do_cache': (Boolean) True if the result should be cached. + """ + v8_root = FindV8SrcFromFilename(filename) + v8_flags = GetClangCommandFromNinjaForFilename(v8_root, filename) + final_flags = flags + v8_flags + return { + 'flags': final_flags, + 'do_cache': True + } diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index 6cda4f239730b0..1965fb18c73430 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -3,78 +3,96 @@ # # Name/Organization -Google Inc. -Sigma Designs Inc. -ARM Ltd. -Hewlett-Packard Development Company, LP -Igalia, S.L. -Joyent, Inc. -Bloomberg Finance L.P. -NVIDIA Corporation -BlackBerry Limited -Opera Software ASA -Intel Corporation -MIPS Technologies, Inc. -Imagination Technologies, LLC -Loongson Technology Corporation Limited +Google Inc. <*@google.com> +The Chromium Authors <*@chromium.org> +Sigma Designs Inc. <*@sdesigns.com> +ARM Ltd. <*@arm.com> +Hewlett-Packard Development Company, LP <*@palm.com> +Igalia, S.L. <*@igalia.com> +Joyent, Inc. <*@joyent.com> +Bloomberg Finance L.P. <*@bloomberg.net> +NVIDIA Corporation <*@nvidia.com> +BlackBerry Limited <*@blackberry.com> +Opera Software ASA <*@opera.com> +Intel Corporation <*@intel.com> +MIPS Technologies, Inc. <*@mips.com> +Imagination Technologies, LLC <*@imgtec.com> +Loongson Technology Corporation Limited <*@loongson.cn> +Code Aurora Forum <*@codeaurora.org> +Home Jinni Inc. <*@homejinni.com> +IBM Inc. <*@*.ibm.com> +Samsung <*@*.samsung.com> +Joyent, Inc <*@joyent.com> +RT-RK Computer Based System <*@rt-rk.com> +Amazon, Inc <*@amazon.com> +ST Microelectronics <*@st.com> +Yandex LLC <*@yandex-team.ru> +StrongLoop, Inc. <*@strongloop.com> +Aaron Bieber +Abdulla Kamar Akinori MUSHA Alexander Botero-Lowry Alexander Karpinsky -Alexandre Rames Alexandre Vassalotti +Alexis Campailla Andreas Anyuru -Baptiste Afsa +Andrew Paprocki +Andrei Kashcha +Ben Noordhuis Bert Belder Burcu Dogan Caitlin Potter Craig Schlenter -Chunyang Dai +Christopher A. Taylor Daniel Andersson Daniel James -Derek J Conrod -Dineel D Sule +Douglas Crosher Erich Ocean Fedor Indutny +Felix Geisendörfer Filipe David Manana -Haitao Feng +Geoffrey Garside +Han Choongwoo +Hirofumi Mako Ioseb Dzmanashvili Isiah Meadows -Jacob Bramley Jan de Mooij Jay Freeman James Pike +Jianghua Yang Joel Stanley Johan Bergström -John Jozwiak Jonathan Liu -Kun Zhang +Kang-Hao (Kenny) Lu Luis Reis -Martyn Capewell +Luke Zarko +Maciej Małecki Mathias Bynens Matt Hanselman +Matthew Sporleder Maxim Mossienko Michael Lutz Michael Smith Mike Gilbert +Nicolas Antonius Ernst Leopold Maria Kaiser Paolo Giarrusso Patrick Gansterer Peter Varga +Paul Lind Rafal Krypa -Rajeev R Krithivasan Refael Ackermann Rene Rebe Robert Mustacchi -Rodolph Perfetta -Ryan Dahl +Robert Nagy +Ryan Dahl Sandro Santilli Sanjoy Das -Subrato K De +Seo Sanghyeon Tobias Burnus -Vincent Belliard +Victor Costan Vlad Burlik -Weiliang Lin -Xi Qian -Yuqiang Xian -Zaheer Ahmad +Vladimir Shutoff +Yu Yin Zhongping Wang +柳荣一 diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index 6534eea8594810..713ab6de57d461 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -18,10 +18,9 @@ v8_interpreted_regexp = false v8_object_print = false v8_postmortem_support = false v8_use_snapshot = true -v8_enable_extra_checks = is_debug v8_target_arch = cpu_arch v8_random_seed = "314159265" - +v8_toolset_for_d8 = "host" ############################################################################### # Configurations @@ -63,54 +62,31 @@ config("features") { defines = [] if (v8_enable_disassembler == true) { - defines += [ - "ENABLE_DISASSEMBLER", - ] + defines += [ "ENABLE_DISASSEMBLER" ] } if (v8_enable_gdbjit == true) { - defines += [ - "ENABLE_GDB_JIT_INTERFACE", - ] + defines += [ "ENABLE_GDB_JIT_INTERFACE" ] } if (v8_object_print == true) { - defines += [ - "OBJECT_PRINT", - ] + defines += [ "OBJECT_PRINT" ] } if (v8_enable_verify_heap == true) { - defines += [ - "VERIFY_HEAP", - ] + defines += [ "VERIFY_HEAP" ] } if (v8_interpreted_regexp == true) { - defines += [ - "V8_INTERPRETED_REGEXP", - ] + defines += [ "V8_INTERPRETED_REGEXP" ] } if (v8_deprecation_warnings == true) { - defines += [ - "V8_DEPRECATION_WARNINGS", - ] + defines += [ "V8_DEPRECATION_WARNINGS" ] } if (v8_enable_i18n_support == true) { - defines += [ - "V8_I18N_SUPPORT", - ] - } - if (v8_enable_extra_checks == true) { - defines += [ - "ENABLE_EXTRA_CHECKS", - ] + defines += [ "V8_I18N_SUPPORT" ] } if (v8_enable_handle_zapping == true) { - defines += [ - "ENABLE_HANDLE_ZAPPING", - ] + defines += [ "ENABLE_HANDLE_ZAPPING" ] } if (v8_use_external_startup_data == true) { - defines += [ - "V8_USE_EXTERNAL_STARTUP_DATA", - ] + defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ] } } @@ -120,27 +96,45 @@ config("toolchain") { defines = [] cflags = [] - # TODO(jochen): Add support for arm, mips, mipsel. + # TODO(jochen): Add support for arm subarchs, mips, mipsel. + + if (v8_target_arch == "arm") { + defines += [ "V8_TARGET_ARCH_ARM" ] + if (arm_version == 7) { + defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ] + } + if (arm_fpu == "vfpv3-d16") { + defines += [ "CAN_USE_VFP3_INSTRUCTIONS" ] + } + if (arm_fpu == "vfpv3") { + defines += [ + "CAN_USE_VFP3_INSTRUCTIONS", + "CAN_USE_VFP32DREGS", + ] + } + if (arm_fpu == "neon") { + defines += [ + "CAN_USE_VFP3_INSTRUCTIONS", + "CAN_USE_VFP32DREGS", + "CAN_USE_NEON", + ] + } + + # TODO(jochen): Add support for arm_test_noprobe. + # TODO(jochen): Add support for cpu_arch != v8_target_arch/ + } if (v8_target_arch == "arm64") { - defines += [ - "V8_TARGET_ARCH_ARM64", - ] + defines += [ "V8_TARGET_ARCH_ARM64" ] } if (v8_target_arch == "x86") { - defines += [ - "V8_TARGET_ARCH_IA32", - ] + defines += [ "V8_TARGET_ARCH_IA32" ] } if (v8_target_arch == "x64") { - defines += [ - "V8_TARGET_ARCH_X64", - ] + defines += [ "V8_TARGET_ARCH_X64" ] } if (is_win) { - defines += [ - "WIN32", - ] + defines += [ "WIN32" ] # TODO(jochen): Support v8_enable_prof. } @@ -170,7 +164,7 @@ action("js2c") { # The script depends on this other script, this rule causes a rebuild if it # changes. - source_prereqs = [ "tools/jsmin.py" ] + inputs = [ "tools/jsmin.py" ] sources = [ "src/runtime.js", @@ -181,7 +175,6 @@ action("js2c") { "src/uri.js", "src/third_party/fdlibm/fdlibm.js", "src/math.js", - "src/apinatives.js", "src/date.js", "src/regexp.js", "src/arraybuffer.js", @@ -203,7 +196,7 @@ action("js2c") { ] outputs = [ - "$target_gen_dir/libraries.cc" + "$target_gen_dir/libraries.cc", ] if (v8_enable_i18n_support) { @@ -211,15 +204,15 @@ action("js2c") { } args = [ - rebase_path("$target_gen_dir/libraries.cc", root_build_dir), - "CORE", - ] + rebase_path(sources, root_build_dir) + rebase_path("$target_gen_dir/libraries.cc", root_build_dir), + "CORE", + ] + 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) + rebase_path("$target_gen_dir/libraries.bin", root_build_dir), ] } } @@ -231,7 +224,7 @@ action("js2c_experimental") { # The script depends on this other script, this rule causes a rebuild if it # changes. - source_prereqs = [ "tools/jsmin.py" ] + inputs = [ "tools/jsmin.py" ] sources = [ "src/macros.py", @@ -241,46 +234,64 @@ action("js2c_experimental") { "src/harmony-array.js", "src/harmony-array-includes.js", "src/harmony-typedarray.js", - "src/harmony-classes.js", "src/harmony-tostring.js", "src/harmony-templates.js", - "src/harmony-regexp.js" + "src/harmony-regexp.js", ] outputs = [ - "$target_gen_dir/experimental-libraries.cc" + "$target_gen_dir/experimental-libraries.cc", ] args = [ - rebase_path("$target_gen_dir/experimental-libraries.cc", root_build_dir), - "EXPERIMENTAL", - ] + rebase_path(sources, root_build_dir) + rebase_path("$target_gen_dir/experimental-libraries.cc", + root_build_dir), + "EXPERIMENTAL", + ] + 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) + rebase_path("$target_gen_dir/libraries_experimental.bin", root_build_dir), ] } } +action("d8_js2c") { + visibility = [ ":*" ] # Only targets in this file can depend on this. + + script = "tools/js2c.py" + + inputs = [ + "src/d8.js", + "src/macros.py", + ] + + outputs = [ + "$target_gen_dir/d8-js.cc", + ] + + args = rebase_path(outputs, root_build_dir) + [ "D8" ] + + rebase_path(inputs, 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" + ":js2c_experimental", ] sources = [ "$target_gen_dir/libraries.bin", - "$target_gen_dir/libraries_experimental.bin" + "$target_gen_dir/libraries_experimental.bin", ] outputs = [ - "$root_out_dir/natives_blob.bin" + "$root_out_dir/natives_blob.bin", ] script = "tools/concatenate-files.py" @@ -300,23 +311,24 @@ action("postmortem-metadata") { ] outputs = [ - "$target_gen_dir/debug-support.cc" + "$target_gen_dir/debug-support.cc", ] - args = - rebase_path(outputs, root_build_dir) + - rebase_path(sources, root_build_dir) + args = rebase_path(outputs, root_build_dir) + + rebase_path(sources, root_build_dir) } action("run_mksnapshot") { visibility = [ ":*" ] # Only targets in this file can depend on this. - deps = [ ":mksnapshot($host_toolchain)" ] + deps = [ + ":mksnapshot($host_toolchain)", + ] script = "tools/run.py" outputs = [ - "$target_gen_dir/snapshot.cc" + "$target_gen_dir/snapshot.cc", ] args = [ @@ -324,24 +336,27 @@ action("run_mksnapshot") { "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) + "--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 ] + args += [ + "--random-seed", + v8_random_seed, + ] } if (v8_use_external_startup_data) { outputs += [ "$root_out_dir/snapshot_blob.bin" ] args += [ "--startup_blob", - rebase_path("$root_out_dir/snapshot_blob.bin", root_build_dir) + rebase_path("$root_out_dir/snapshot_blob.bin", root_build_dir), ] } } - ############################################################################### # Source Sets (aka static libraries) # @@ -363,7 +378,11 @@ source_set("v8_nosnapshot") { configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ ":internal_config", ":features", ":toolchain" ] + configs += [ + ":internal_config", + ":features", + ":toolchain", + ] } source_set("v8_snapshot") { @@ -384,7 +403,11 @@ source_set("v8_snapshot") { configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ ":internal_config", ":features", ":toolchain" ] + configs += [ + ":internal_config", + ":features", + ":toolchain", + ] } if (v8_use_external_startup_data) { @@ -406,7 +429,11 @@ if (v8_use_external_startup_data) { configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ ":internal_config", ":features", ":toolchain" ] + configs += [ + ":internal_config", + ":features", + ":toolchain", + ] } } @@ -424,6 +451,8 @@ source_set("v8_base") { "src/allocation-tracker.h", "src/api.cc", "src/api.h", + "src/api-natives.cc", + "src/api-natives.h", "src/arguments.cc", "src/arguments.h", "src/assembler.cc", @@ -432,8 +461,6 @@ source_set("v8_base") { "src/assert-scope.cc", "src/ast-numbering.cc", "src/ast-numbering.h", - "src/ast-this-access-visitor.cc", - "src/ast-this-access-visitor.h", "src/ast-value-factory.cc", "src/ast-value-factory.h", "src/ast.cc", @@ -478,6 +505,8 @@ source_set("v8_base") { "src/compilation-statistics.h", "src/compiler/access-builder.cc", "src/compiler/access-builder.h", + "src/compiler/all-nodes.cc", + "src/compiler/all-nodes.h", "src/compiler/ast-graph-builder.cc", "src/compiler/ast-graph-builder.h", "src/compiler/ast-loop-assignment-analyzer.cc", @@ -498,6 +527,8 @@ source_set("v8_base") { "src/compiler/control-builders.cc", "src/compiler/control-builders.h", "src/compiler/control-equivalence.h", + "src/compiler/control-flow-optimizer.cc", + "src/compiler/control-flow-optimizer.h", "src/compiler/control-reducer.cc", "src/compiler/control-reducer.h", "src/compiler/diamond.h", @@ -505,7 +536,6 @@ source_set("v8_base") { "src/compiler/gap-resolver.cc", "src/compiler/gap-resolver.h", "src/compiler/generic-algorithm.h", - "src/compiler/graph-builder.cc", "src/compiler/graph-builder.h", "src/compiler/graph-inl.h", "src/compiler/graph-reducer.cc", @@ -532,8 +562,8 @@ source_set("v8_base") { "src/compiler/js-graph.h", "src/compiler/js-inlining.cc", "src/compiler/js-inlining.h", - "src/compiler/js-intrinsic-builder.cc", - "src/compiler/js-intrinsic-builder.h", + "src/compiler/js-intrinsic-lowering.cc", + "src/compiler/js-intrinsic-lowering.h", "src/compiler/js-operator.cc", "src/compiler/js-operator.h", "src/compiler/js-typed-lowering.cc", @@ -545,6 +575,7 @@ source_set("v8_base") { "src/compiler/linkage.h", "src/compiler/load-elimination.cc", "src/compiler/load-elimination.h", + "src/compiler/loop-peeling.cc", "src/compiler/loop-analysis.cc", "src/compiler/loop-analysis.h", "src/compiler/machine-operator-reducer.cc", @@ -555,12 +586,13 @@ source_set("v8_base") { "src/compiler/machine-type.h", "src/compiler/move-optimizer.cc", "src/compiler/move-optimizer.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-marker.cc", + "src/compiler/node-marker.h", "src/compiler/node-matchers.h", - "src/compiler/node-properties-inl.h", + "src/compiler/node-properties.cc", "src/compiler/node-properties.h", "src/compiler/node.cc", "src/compiler/node.h", @@ -570,6 +602,8 @@ source_set("v8_base") { "src/compiler/operator-properties.h", "src/compiler/operator.cc", "src/compiler/operator.h", + "src/compiler/osr.cc", + "src/compiler/osr.h", "src/compiler/pipeline.cc", "src/compiler/pipeline.h", "src/compiler/pipeline-statistics.cc", @@ -775,8 +809,6 @@ source_set("v8_base") { "src/ic/ic-compiler.h", "src/ic/stub-cache.cc", "src/ic/stub-cache.h", - "src/interface.cc", - "src/interface.h", "src/interface-descriptors.cc", "src/interface-descriptors.h", "src/interpreter-irregexp.cc", @@ -813,6 +845,8 @@ source_set("v8_base") { "src/macro-assembler.h", "src/messages.cc", "src/messages.h", + "src/modules.cc", + "src/modules.h", "src/msan.h", "src/natives.h", "src/objects-debug.cc", @@ -855,7 +889,6 @@ source_set("v8_base") { "src/rewriter.h", "src/runtime-profiler.cc", "src/runtime-profiler.h", - "src/runtime/runtime-api.cc", "src/runtime/runtime-array.cc", "src/runtime/runtime-classes.cc", "src/runtime/runtime-collections.cc", @@ -949,7 +982,6 @@ source_set("v8_base") { "src/version.h", "src/vm-state-inl.h", "src/vm-state.h", - "src/zone-inl.h", "src/zone.cc", "src/zone.h", "src/third_party/fdlibm/fdlibm.cc", @@ -1209,7 +1241,11 @@ source_set("v8_base") { configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ ":internal_config", ":features", ":toolchain" ] + configs += [ + ":internal_config", + ":features", + ":toolchain", + ] if (!is_debug) { configs -= [ "//build/config/compiler:optimize" ] @@ -1217,7 +1253,9 @@ source_set("v8_base") { } defines = [] - deps = [ ":v8_libbase" ] + deps = [ + ":v8_libbase", + ] if (is_win) { # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. @@ -1229,6 +1267,7 @@ source_set("v8_base") { 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 { @@ -1297,7 +1336,11 @@ source_set("v8_libbase") { configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ ":internal_config_base", ":features", ":toolchain" ] + configs += [ + ":internal_config_base", + ":features", + ":toolchain", + ] if (!is_debug) { configs -= [ "//build/config/compiler:optimize" ] @@ -1307,15 +1350,11 @@ source_set("v8_libbase") { defines = [] if (is_posix) { - sources += [ - "src/base/platform/platform-posix.cc" - ] + sources += [ "src/base/platform/platform-posix.cc" ] } if (is_linux) { - sources += [ - "src/base/platform/platform-linux.cc" - ] + sources += [ "src/base/platform/platform-linux.cc" ] libs = [ "rt" ] } else if (is_android) { @@ -1344,7 +1383,10 @@ source_set("v8_libbase") { defines += [ "_CRT_RAND_S" ] # for rand_s() - libs = [ "winmm.lib", "ws2_32.lib" ] + libs = [ + "winmm.lib", + "ws2_32.lib", + ] } # TODO(jochen): Add support for qnx, freebsd, openbsd, netbsd, and solaris. @@ -1363,7 +1405,11 @@ source_set("v8_libplatform") { configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ ":internal_config_base", ":features", ":toolchain" ] + configs += [ + ":internal_config_base", + ":features", + ":toolchain", + ] if (!is_debug) { configs -= [ "//build/config/compiler:optimize" ] @@ -1389,7 +1435,11 @@ if (current_toolchain == host_toolchain) { configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ ":internal_config", ":features", ":toolchain" ] + configs += [ + ":internal_config", + ":features", + ":toolchain", + ] deps = [ ":v8_base", @@ -1405,64 +1455,109 @@ if (current_toolchain == host_toolchain) { # if (component_mode == "shared_library") { + component("v8") { + sources = [ + "src/v8dll-main.cc", + ] -component("v8") { - sources = [ - "src/v8dll-main.cc", - ] + if (v8_use_snapshot && v8_use_external_startup_data) { + deps = [ + ":v8_base", + ":v8_external_snapshot", + ] + } else if (v8_use_snapshot) { + deps = [ + ":v8_base", + ":v8_snapshot", + ] + } else { + assert(!v8_use_external_startup_data) + deps = [ + ":v8_base", + ":v8_nosnapshot", + ] + } - if (v8_use_snapshot && v8_use_external_startup_data) { - deps = [ - ":v8_base", - ":v8_external_snapshot", - ] - } else if (v8_use_snapshot) { - deps = [ - ":v8_base", - ":v8_snapshot", - ] - } else { - assert(!v8_use_external_startup_data) - deps = [ - ":v8_base", - ":v8_nosnapshot", + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ + ":internal_config", + ":features", + ":toolchain", ] - } - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ ":internal_config", ":features", ":toolchain" ] + direct_dependent_configs = [ ":external_config" ] - direct_dependent_configs = [ ":external_config" ] + libs = [] + if (is_android && current_toolchain != host_toolchain) { + libs += [ "log" ] + } + } +} else { + group("v8") { + if (v8_use_snapshot && v8_use_external_startup_data) { + deps = [ + ":v8_base", + ":v8_external_snapshot", + ] + } else if (v8_use_snapshot) { + deps = [ + ":v8_base", + ":v8_snapshot", + ] + } else { + assert(!v8_use_external_startup_data) + deps = [ + ":v8_base", + ":v8_nosnapshot", + ] + } - libs = [] - if (is_android && current_toolchain != host_toolchain) { - libs += [ "log" ] + direct_dependent_configs = [ ":external_config" ] } } -} else { - -group("v8") { - if (v8_use_snapshot && v8_use_external_startup_data) { - deps = [ - ":v8_base", - ":v8_external_snapshot", +if ((current_toolchain == host_toolchain && v8_toolset_for_d8 == "host") || + (current_toolchain != host_toolchain && v8_toolset_for_d8 == "target")) { + executable("d8") { + sources = [ + "src/d8.cc", + "src/d8.h", + "src/startup-data-util.h", + "src/startup-data-util.cc", ] - } else if (v8_use_snapshot) { - deps = [ - ":v8_base", - ":v8_snapshot", + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ + ":internal_config", + ":features", + ":toolchain", ] - } else { - assert(!v8_use_external_startup_data) + deps = [ - ":v8_base", - ":v8_nosnapshot", + ":d8_js2c", + ":v8", + ":v8_libplatform", + "//build/config/sanitizers:deps", ] - } - direct_dependent_configs = [ ":external_config" ] -} + # TODO(jochen): Add support for readline and vtunejit. + + if (is_posix) { + sources += [ "src/d8-posix.cc" ] + } else if (is_win) { + sources += [ "src/d8-windows.cc" ] + } + if (component_mode != "shared_library") { + sources += [ + "src/d8-debug.cc", + "$target_gen_dir/d8-js.cc", + ] + } + if (v8_enable_i18n_support) { + deps += [ "//third_party/icu" ] + } + } } diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index d42a2f1564de79..0f835dc8c43f90 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,533 @@ +2015-02-19: Version 4.2.77 + + Make generator constructors configurable (issue 3902). + + Performance and stability improvements on all platforms. + + +2015-02-19: Version 4.2.76 + + Performance and stability improvements on all platforms. + + +2015-02-18: Version 4.2.75 + + Performance and stability improvements on all platforms. + + +2015-02-18: Version 4.2.74 + + Correctly propagate terminate exception in TryCall (issue 3892). + + Performance and stability improvements on all platforms. + + +2015-02-17: Version 4.2.73 + + Performance and stability improvements on all platforms. + + +2015-02-17: Version 4.2.72 + + [turbofan] Fix control reducer with re-reducing branches (Chromium issue + 458876). + + Performance and stability improvements on all platforms. + + +2015-02-16: Version 4.2.71 + + Implement ES6 rest parameters (issue 2159). + + Performance and stability improvements on all platforms. + + +2015-02-13: Version 4.2.70 + + new classes: no longer experimental (issue 3834). + + Make it possible to define arguments for CompileFunctionInContext. + + Performance and stability improvements on all platforms. + + +2015-02-12: Version 4.2.69 + + Performance and stability improvements on all platforms. + + +2015-02-11: Version 4.2.68 + + Performance and stability improvements on all platforms. + + +2015-02-11: Version 4.2.67 + + Throw on range error when creating a string via API (issue 3853). + + Performance and stability improvements on all platforms. + + +2015-02-11: Version 4.2.66 + + Performance and stability improvements on all platforms. + + +2015-02-10: Version 4.2.65 + + Performance and stability improvements on all platforms. + + +2015-02-10: Version 4.2.64 + + Performance and stability improvements on all platforms. + + +2015-02-10: Version 4.2.63 + + Introduce a compile method that takes context extensions (Chromium issue + 456192). + + Performance and stability improvements on all platforms. + + +2015-02-09: Version 4.2.62 + + Performance and stability improvements on all platforms. + + +2015-02-09: Version 4.2.61 + + Performance and stability improvements on all platforms. + + +2015-02-07: Version 4.2.60 + + Performance and stability improvements on all platforms. + + +2015-02-07: Version 4.2.59 + + Performance and stability improvements on all platforms. + + +2015-02-07: Version 4.2.58 + + Performance and stability improvements on all platforms. + + +2015-02-06: Version 4.2.57 + + Performance and stability improvements on all platforms. + + +2015-02-06: Version 4.2.56 + + Performance and stability improvements on all platforms. + + +2015-02-06: Version 4.2.55 + + Protect against uninitialized lexical variables at top-level (Chromium + issue 452510). + + Performance and stability improvements on all platforms. + + +2015-02-05: Version 4.2.54 + + Fix HConstant(double, ...) constructor (issue 3865). + + Add NativeWeakMap to v8.h (Chromium issue 437416). + + Performance and stability improvements on all platforms. + + +2015-02-05: Version 4.2.53 + + Fix issue with multiple properties and emit store (issue 3856). + + Class methods should be non enumerable (issue 3330). + + Performance and stability improvements on all platforms. + + +2015-02-04: Version 4.2.52 + + Add WeakKeyMap to v8.h (Chromium issue 437416). + + Performance and stability improvements on all platforms. + + +2015-02-04: Version 4.2.51 + + Performance and stability improvements on all platforms. + + +2015-02-03: Version 4.2.50 + + Reset inlining limits due to overly long compilation times in + Speedometer, Dart2JS (Chromium issue 454625). + + Add WeakMap to v8.h (Chromium issue 437416). + + [V8] Added line, column and script symbols for SyntaxError (Chromium + issue 443140). + + Performance and stability improvements on all platforms. + + +2015-02-03: Version 4.2.49 + + Compute the same hash for all NaN values (issue 3859). + + Performance and stability improvements on all platforms. + + +2015-02-03: Version 4.2.48 + + Performance and stability improvements on all platforms. + + +2015-02-02: Version 4.2.47 + + Check global object behind global proxy for extensibility (Chromium + issue 454091). + + Performance and stability improvements on all platforms. + + +2015-02-02: Version 4.2.46 + + Performance and stability improvements on all platforms. + + +2015-02-02: Version 4.2.45 + + Performance and stability improvements on all platforms. + + +2015-02-01: Version 4.2.44 + + Performance and stability improvements on all platforms. + + +2015-02-01: Version 4.2.43 + + Performance and stability improvements on all platforms. + + +2015-01-31: Version 4.2.42 + + Performance and stability improvements on all platforms. + + +2015-01-31: Version 4.2.41 + + Layout descriptor sharing issue fixed (issue 3832, Chromium issue + 437713). + + Performance and stability improvements on all platforms. + + +2015-01-30: Version 4.2.40 + + Performance and stability improvements on all platforms. + + +2015-01-30: Version 4.2.38 + + Move object literal checking into checker classes (issue 3819). + + [turbofan] Fix OSR compilations of for-in. + + Performance and stability improvements on all platforms. + + +2015-01-30: Version 4.2.37 + + Do not create unresolved variables when parsing arrow functions lazily + (issue 3501). + + Performance and stability improvements on all platforms. + + +2015-01-29: Version 4.2.36 + + Performance and stability improvements on all platforms. + + +2015-01-29: Version 4.2.35 + + Performance and stability improvements on all platforms. + + +2015-01-28: Version 4.2.34 + + Performance and stability improvements on all platforms. + + +2015-01-28: Version 4.2.33 + + Performance and stability improvements on all platforms. + + +2015-01-27: Version 4.2.32 + + Do not generalize field representations when making elements kind or + observed transition (Chromium issue 448711). + + Performance and stability improvements on all platforms. + + +2015-01-27: Version 4.2.31 + + [x86] Disable AVX unless the operating system explicitly claims to + support it (issue 3846, Chromium issue 452033). + + Performance and stability improvements on all platforms. + + +2015-01-27: Version 4.2.30 + + Performance and stability improvements on all platforms. + + +2015-01-26: Version 4.2.29 + + MIPS: Fixed Hydrogen environment handling for mul-i ARM and ARM64 (issue + 451322). + + [turbofan] Simplify reduction if IfTrue and IfFalse and fix bugs + (Chromium issue 451958). + + Add HeapNumber fast path to v8::Value::{Uint,Int}32Value() (Chromium + issue 446097). + + Performance and stability improvements on all platforms. + + +2015-01-26: Version 4.2.28 + + Fixed Hydrogen environment handling for mul-i on ARM and ARM64 (issue + 451322). + + Performance and stability improvements on all platforms. + + +2015-01-25: Version 4.2.27 + + Performance and stability improvements on all platforms. + + +2015-01-24: Version 4.2.26 + + ES6 Array.prototype.toString falls back on Object.prototype.toString if + method "join" is not callable (issue 3793). + + Performance and stability improvements on all platforms. + + +2015-01-23: Version 4.2.25 + + Performance and stability improvements on all platforms. + + +2015-01-23: Version 4.2.24 + + Performance and stability improvements on all platforms. + + +2015-01-23: Version 4.2.23 + + [x86] Blacklist AVX for Windows versions before 6.1 (Windows 7) (issue + 3846). + + Performance and stability improvements on all platforms. + + +2015-01-23: Version 4.2.22 + + Fix run-time ARMv6 detection (issue 3844). + + Support concatenating with zero-size arrays with DICTIONARY_ELEMENTS in + Runtime_ArrayConcat (Chromium issue 450895). + + Performance and stability improvements on all platforms. + + +2015-01-22: Version 4.2.21 + + Performance and stability improvements on all platforms. + + +2015-01-22: Version 4.2.20 + + Add a pretty printer to improve the error message non-function calls + (Chromium issue 259443). + + Remove implicit uint8_t to char cast in string replace (Chromium issue + 446196). + + Performance and stability improvements on all platforms. + + +2015-01-21: Version 4.2.19 + + Performance and stability improvements on all platforms. + + +2015-01-20: Version 4.2.18 + + Fix issue with __proto__ when using ES6 object literals (issue 3818). + + Performance and stability improvements on all platforms. + + +2015-01-20: Version 4.2.17 + + Performance and stability improvements on all platforms. + + +2015-01-20: Version 4.2.16 + + Performance and stability improvements on all platforms. + + +2015-01-19: Version 4.2.15 + + Unobscurified OFStream (Chromium issue 448102). + + Performance and stability improvements on all platforms. + + +2015-01-19: Version 4.2.14 + + Performance and stability improvements on all platforms. + + +2015-01-18: Version 4.2.13 + + Performance and stability improvements on all platforms. + + +2015-01-18: Version 4.2.12 + + Performance and stability improvements on all platforms. + + +2015-01-17: Version 4.2.11 + + Performance and stability improvements on all platforms. + + +2015-01-16: Version 4.2.10 + + Performance and stability improvements on all platforms. + + +2015-01-16: Version 4.2.9 + + MIPS: ES6 computed property names (issue 3754). + + ES6 computed property names (issue 3754). + + Performance and stability improvements on all platforms. + + +2015-01-15: Version 4.2.8 + + Performance and stability improvements on all platforms. + + +2015-01-15: Version 4.2.7 + + Performance and stability improvements on all platforms. + + +2015-01-15: Version 4.2.6 + + Performance and stability improvements on all platforms. + + +2015-01-15: Version 4.2.5 + + Performance and stability improvements on all platforms. + + +2015-01-14: Version 4.2.4 + + Auto-generate v8 version based on tags (Chromium issue 446166). + + Remove support for signatures with arguments. + + Add proper support for proxies to HType (Chromium issue 448730). + + [turbofan] Fix truncation/representation sloppiness wrt. bool/bit (issue + 3812). + + Performance and stability improvements on all platforms. + + +2015-01-14: Version 4.2.3 + + Performance and stability improvements on all platforms. + + +2015-01-14: Version 4.2.2 + + Performance and stability improvements on all platforms. + + +2015-01-14: Version 4.2.1 + + Map -0 to integer 0 for typed array constructors (Chromium issue + 447756). + + Introduce a gyp variable to control whether or not slow dchecks are on. + + Correctly setup the freelist of the coderange on Win64 (Chromium issue + 447555). + + Fast forward V8 to version 4.2. + + Remove "extra checks". + + Performance and stability improvements on all platforms. + + +2015-01-08: Version 3.32.7 + + Correctly parse line ends for debugging (issue 2825). + + Fixed printing during DCE (issue 3679). + + Performance and stability improvements on all platforms. + + +2015-01-08: Version 3.32.6 + + Performance and stability improvements on all platforms. + + +2015-01-08: Version 3.32.5 + + Correct handling of exceptions occured during getting of exception stack + trace (Chromium issue 444805). + + Fix bug in Runtime_CompileOptimized resulting from stack overflow + (Chromium issue 446774). + + Turn on job-based recompilation (issue 3608). + + Performance and stability improvements on all platforms. + + +2015-01-07: Version 3.32.4 + + Performance and stability improvements on all platforms. + + 2015-01-07: Version 3.32.3 Performance and stability improvements on all platforms. diff --git a/deps/v8/DEPS b/deps/v8/DEPS index a81c7ecc38837f..b829d05dabb9ad 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -8,17 +8,17 @@ vars = { deps = { "v8/build/gyp": - Var("git_url") + "/external/gyp.git" + "@" + "fe00999dfaee449d3465a9316778434884da4fa7", # from svn revision 2010 + Var("git_url") + "/external/gyp.git" + "@" + "34640080d08ab2a37665512e52142947def3056d", "v8/third_party/icu": - Var("git_url") + "/chromium/deps/icu.git" + "@" + "51c1a4ce5f362676aa1f1cfdb5b7e52edabfa5aa", + Var("git_url") + "/chromium/deps/icu.git" + "@" + "4e3266f32c62d30a3f9e2232a753c60129d1e670", "v8/buildtools": - Var("git_url") + "/chromium/buildtools.git" + "@" + "23a4e2f545c7b6340d7e5a2b74801941b0a86535", + Var("git_url") + "/chromium/buildtools.git" + "@" + "5c5e924788fe40f7d6e0a3841ac572de2475e689", "v8/testing/gtest": - Var("git_url") + "/external/googletest.git" + "@" + "8245545b6dc9c4703e6496d1efd19e975ad2b038", # from svn revision 700 + Var("git_url") + "/external/googletest.git" + "@" + "be1868139ffe0ccd0e8e3b37292b84c821d9c8ad", "v8/testing/gmock": Var("git_url") + "/external/googlemock.git" + "@" + "29763965ab52f24565299976b936d1265cb6a271", # from svn revision 501 "v8/tools/clang": - Var("git_url") + "/chromium/src/tools/clang.git" + "@" + "c945be21f6485fa177b43814f910b76cce921653", + Var("git_url") + "/chromium/src/tools/clang.git" + "@" + "f6daa55d03995e82201a3278203e7c0421a59546", } deps_os = { @@ -80,6 +80,17 @@ hooks = [ "-s", "v8/buildtools/linux64/clang-format.sha1", ], }, + # Pull binutils for linux, enabled debug fission for faster linking / + # debugging when used with clang on Ubuntu Precise. + # https://code.google.com/p/chromium/issues/detail?id=352046 + { + 'name': 'binutils', + 'pattern': 'v8/third_party/binutils', + 'action': [ + 'python', + 'v8/third_party/binutils/download.py', + ], + }, { # Pull clang if needed or requested via GYP_DEFINES. # Note: On Win, this should run after win_toolchain, as it may use it. diff --git a/deps/v8/Makefile b/deps/v8/Makefile index 606b5d7bf176ab..5468d913341e31 100644 --- a/deps/v8/Makefile +++ b/deps/v8/Makefile @@ -27,8 +27,6 @@ # Variable default definitions. Override them by exporting them in your shell. -CXX ?= g++ -LINK ?= g++ OUTDIR ?= out TESTJOBS ?= GYPFLAGS ?= @@ -87,10 +85,17 @@ ifeq ($(snapshot), external) endif # extrachecks=on/off ifeq ($(extrachecks), on) - GYPFLAGS += -Dv8_enable_extra_checks=1 -Dv8_enable_handle_zapping=1 + GYPFLAGS += -Ddcheck_always_on=1 -Dv8_enable_handle_zapping=1 endif ifeq ($(extrachecks), off) - GYPFLAGS += -Dv8_enable_extra_checks=0 -Dv8_enable_handle_zapping=0 + GYPFLAGS += -Ddcheck_always_on=0 -Dv8_enable_handle_zapping=0 +endif +# slowdchecks=on/off +ifeq ($(slowdchecks), on) + GYPFLAGS += -Dv8_enable_slow_dchecks=1 +endif +ifeq ($(slowdchecks), off) + GYPFLAGS += -Dv8_enable_slow_dchecks=0 endif # gdbjit=on/off ifeq ($(gdbjit), on) @@ -103,10 +108,6 @@ endif ifeq ($(vtunejit), on) GYPFLAGS += -Dv8_enable_vtunejit=1 endif -# optdebug=on -ifeq ($(optdebug), on) - GYPFLAGS += -Dv8_optimized_debug=2 -endif # unalignedaccess=on ifeq ($(unalignedaccess), on) GYPFLAGS += -Dv8_can_use_unaligned_accesses=true @@ -144,19 +145,17 @@ endif ifeq ($(deprecationwarnings), on) GYPFLAGS += -Dv8_deprecation_warnings=1 endif -# asan=/path/to/clang++ -ifneq ($(strip $(asan)),) - GYPFLAGS += -Dasan=1 - export CC=$(dir $(asan))clang - export CXX=$(asan) - export CXX_host=$(asan) - export LINK=$(asan) - export ASAN_SYMBOLIZER_PATH=$(dir $(asan))llvm-symbolizer +# asan=on +ifeq ($(asan), on) + GYPFLAGS += -Dasan=1 -Dclang=1 TESTFLAGS += --asan ifeq ($(lsan), on) GYPFLAGS += -Dlsan=1 endif endif +ifdef embedscript + GYPFLAGS += -Dembed_script=$(embedscript) +endif # arm specific flags. # arm_version= @@ -214,8 +213,6 @@ ifeq ($(arm_test_noprobe), on) endif # ----------------- available targets: -------------------- -# - "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 @@ -233,7 +230,7 @@ endif # Architectures and modes to be compiled. Consider these to be internal # variables, don't override them (use the targets instead). -ARCHES = ia32 x64 x32 arm arm64 mips mipsel mips64el x87 +ARCHES = ia32 x64 x32 arm arm64 mips mipsel mips64el x87 ppc ppc64 DEFAULT_ARCHES = ia32 x64 arm MODES = release debug optdebug DEFAULT_MODES = release debug @@ -241,9 +238,15 @@ ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel android_x NACL_ARCHES = nacl_ia32 nacl_x64 # List of files that trigger Makefile regeneration: -GYPFILES = build/all.gyp build/features.gypi build/standalone.gypi \ - build/toolchain.gypi samples/samples.gyp src/d8.gyp \ - test/cctest/cctest.gyp test/unittests/unittests.gyp tools/gyp/v8.gyp +GYPFILES = third_party/icu/icu.gypi third_party/icu/icu.gyp \ + build/shim_headers.gypi build/features.gypi build/standalone.gypi \ + build/toolchain.gypi build/all.gyp build/mac/asan.gyp \ + build/android.gypi test/cctest/cctest.gyp \ + test/unittests/unittests.gyp tools/gyp/v8.gyp \ + tools/parser-shell.gyp testing/gmock.gyp testing/gtest.gyp \ + buildtools/third_party/libc++abi/libc++abi.gyp \ + buildtools/third_party/libc++/libc++.gyp samples/samples.gyp \ + src/third_party/vtune/v8vtune.gyp src/d8.gyp # If vtunejit=on, the v8vtune.gyp will be appended. ifeq ($(vtunejit), on) @@ -291,7 +294,6 @@ $(ARCHES): $(addprefix $$@.,$(DEFAULT_MODES)) # Defines how to build a particular target (e.g. ia32.release). $(BUILDS): $(OUTDIR)/Makefile.$$@ @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ - CXX="$(CXX)" LINK="$(LINK)" \ BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ python -c "print \ raw_input().replace('opt', '').capitalize()") \ @@ -299,7 +301,7 @@ $(BUILDS): $(OUTDIR)/Makefile.$$@ native: $(OUTDIR)/Makefile.native @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \ - CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \ + BUILDTYPE=Release \ builddir="$(shell pwd)/$(OUTDIR)/$@" $(ANDROID_ARCHES): $(addprefix $$@.,$(MODES)) @@ -423,6 +425,7 @@ $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE) $(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 CXX_TARGET_ARCH:=$(subst x86_64,x64,$(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 \ @@ -431,7 +434,7 @@ $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE) -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,) \ + $(if $(findstring optdebug,$@),-Dv8_optimized_debug=1,) \ -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS) $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) @@ -468,8 +471,11 @@ $(ENVFILE): $(ENVFILE).new # Stores current GYPFLAGS in a file. $(ENVFILE).new: - @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ - echo "CXX=$(CXX)" >> $(ENVFILE).new + $(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 CXX_TARGET_ARCH:=$(subst x86_64,x64,$(CXX_TARGET_ARCH))) + @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS) -Dtarget_arch=$(CXX_TARGET_ARCH)" > $(ENVFILE).new; # Heap constants for grokdump. DUMP_FILE = tools/v8heapconst.py @@ -489,26 +495,5 @@ GPATH GRTAGS GSYMS GTAGS: gtags.files $(shell cat gtags.files 2> /dev/null) gtags.clean: rm -f gtags.files GPATH GRTAGS GSYMS GTAGS -# 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. -builddeps: - svn checkout --force https://gyp.googlecode.com/svn/trunk build/gyp \ - --revision 1831 - 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 https://googletest.googlecode.com/svn/trunk \ - testing/gtest --revision 692 - svn checkout --force https://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''}]" +dependencies builddeps: + $(error Use 'gclient sync' instead) diff --git a/deps/v8/OWNERS b/deps/v8/OWNERS index 22a05cb17782de..d6db77ffe0f0d0 100644 --- a/deps/v8/OWNERS +++ b/deps/v8/OWNERS @@ -1,4 +1,5 @@ adamk@chromium.org +arv@chromium.org bmeurer@chromium.org danno@chromium.org dcarney@chromium.org diff --git a/deps/v8/PRESUBMIT.py b/deps/v8/PRESUBMIT.py index 040972e8da2db9..fd0601f17bbfd8 100644 --- a/deps/v8/PRESUBMIT.py +++ b/deps/v8/PRESUBMIT.py @@ -69,6 +69,7 @@ def _V8PresubmitChecks(input_api, output_api): from presubmit import SourceProcessor from presubmit import CheckRuntimeVsNativesNameClashes from presubmit import CheckExternalReferenceRegistration + from presubmit import CheckAuthorizedAuthor results = [] if not CppLintProcessor().Run(input_api.PresubmitLocalPath()): @@ -83,6 +84,7 @@ def _V8PresubmitChecks(input_api, output_api): if not CheckExternalReferenceRegistration(input_api.PresubmitLocalPath()): results.append(output_api.PresubmitError( "External references registration check failed")) + results.extend(CheckAuthorizedAuthor(input_api, output_api)) return results @@ -242,15 +244,17 @@ def GetPreferredTryMasters(project, change): return { 'tryserver.v8': { 'v8_linux_rel': set(['defaulttests']), - 'v8_linux_dbg': set(['defaulttests']), - 'v8_linux_nosnap_rel': set(['defaulttests']), + 'v8_linux_nodcheck_rel': set(['defaulttests']), + 'v8_linux_gcc_compile_rel': set(['defaulttests']), 'v8_linux64_rel': set(['defaulttests']), - 'v8_linux_arm_dbg': set(['defaulttests']), + 'v8_linux64_asan_rel': set(['defaulttests']), + 'v8_win_rel': set(['defaulttests']), + 'v8_win_compile_dbg': set(['defaulttests']), + 'v8_win64_rel': set(['defaulttests']), + 'v8_mac_rel': set(['defaulttests']), + 'v8_linux_arm_rel': set(['defaulttests']), 'v8_linux_arm64_rel': set(['defaulttests']), - 'v8_linux_layout_dbg': set(['defaulttests']), + 'v8_android_arm_compile_rel': set(['defaulttests']), 'v8_linux_chromium_gn_rel': set(['defaulttests']), - 'v8_mac_rel': set(['defaulttests']), - 'v8_win_rel': set(['defaulttests']), - 'v8_win64_compile_rel': set(['defaulttests']), }, } diff --git a/deps/v8/build/features.gypi b/deps/v8/build/features.gypi index 465eba91480d72..2eadca338438dc 100644 --- a/deps/v8/build/features.gypi +++ b/deps/v8/build/features.gypi @@ -102,13 +102,9 @@ 'DebugBaseCommon': { 'abstract': 1, 'variables': { - 'v8_enable_extra_checks%': 1, 'v8_enable_handle_zapping%': 1, }, 'conditions': [ - ['v8_enable_extra_checks==1', { - 'defines': ['ENABLE_EXTRA_CHECKS',], - }], ['v8_enable_handle_zapping==1', { 'defines': ['ENABLE_HANDLE_ZAPPING',], }], @@ -116,13 +112,9 @@ }, # Debug 'Release': { 'variables': { - 'v8_enable_extra_checks%': 0, 'v8_enable_handle_zapping%': 0, }, 'conditions': [ - ['v8_enable_extra_checks==1', { - 'defines': ['ENABLE_EXTRA_CHECKS',], - }], ['v8_enable_handle_zapping==1', { 'defines': ['ENABLE_HANDLE_ZAPPING',], }], diff --git a/deps/v8/build/mac/asan.gyp b/deps/v8/build/mac/asan.gyp new file mode 100644 index 00000000000000..3fc7f58d434915 --- /dev/null +++ b/deps/v8/build/mac/asan.gyp @@ -0,0 +1,31 @@ +# Copyright 2015 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + { + 'target_name': 'asan_dynamic_runtime', + 'toolsets': ['target', 'host'], + 'type': 'none', + 'variables': { + # Every target is going to depend on asan_dynamic_runtime, so allow + # this one to depend on itself. + 'prune_self_dependency': 1, + # Path is relative to this GYP file. + 'asan_rtl_mask_path': + '../../third_party/llvm-build/Release+Asserts/lib/clang/*/lib/darwin', + 'asan_osx_dynamic': + '<(asan_rtl_mask_path)/libclang_rt.asan_osx_dynamic.dylib', + }, + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)', + 'files': [ + ' { }; +template +class DefaultPhantomPersistentValueMapTraits : public StdMapTraits { + private: + template + struct RemovePointer; + + public: + // Weak callback & friends: + static const PersistentContainerCallbackType kCallbackType = kNotWeak; + typedef PersistentValueMap< + K, V, DefaultPhantomPersistentValueMapTraits > MapType; + typedef void PhantomCallbackDataType; + + static PhantomCallbackDataType* PhantomCallbackParameter(MapType* map, + const K& key, + Local value) { + return NULL; + } + static MapType* MapFromPhantomCallbackData( + const PhantomCallbackData& data) { + return NULL; + } + static K KeyFromPhantomCallbackData( + const PhantomCallbackData& data) { + return K(); + } + static void DisposeCallbackData(PhantomCallbackDataType* data) {} + static void Dispose(Isolate* isolate, UniquePersistent value, K key) {} + + private: + template + struct RemovePointer { + typedef T Type; + }; +}; + + /** * A map wrapper that allows using UniquePersistent as a mapped value. * C++11 embedders don't need this class, as they can use UniquePersistent @@ -115,13 +152,9 @@ class DefaultPersistentValueMapTraits : public StdMapTraits { * PersistentContainerValue, with all conversion into and out of V8 * handles being transparently handled by this class. */ -template -class PersistentValueMap { +template +class PersistentValueMapBase { public: - explicit PersistentValueMap(Isolate* isolate) : isolate_(isolate) {} - - ~PersistentValueMap() { Clear(); } - Isolate* GetIsolate() { return isolate_; } /** @@ -167,23 +200,6 @@ class PersistentValueMap { reinterpret_cast(FromVal(Traits::Get(&impl_, key)))); } - /** - * Put value into map. Depending on Traits::kIsWeak, the value will be held - * by the map strongly or weakly. - * Returns old value as UniquePersistent. - */ - UniquePersistent Set(const K& key, Local value) { - UniquePersistent persistent(isolate_, value); - return SetUnique(key, &persistent); - } - - /** - * Put value into map, like Set(const K&, Local). - */ - UniquePersistent Set(const K& key, UniquePersistent value) { - return SetUnique(key, &value); - } - /** * Return value for key and remove it from the map. */ @@ -237,7 +253,9 @@ class PersistentValueMap { } private: - friend class PersistentValueMap; + friend class PersistentValueMapBase; + friend class PersistentValueMap; + friend class PhantomPersistentValueMap; explicit PersistentValueReference(PersistentContainerValue value) : value_(value) { } @@ -263,19 +281,89 @@ class PersistentValueMap { return PersistentValueReference(Traits::Get(&impl_, key)); } + protected: + explicit PersistentValueMapBase(Isolate* isolate) : isolate_(isolate) {} + + ~PersistentValueMapBase() { Clear(); } + + Isolate* isolate() { return isolate_; } + typename Traits::Impl* impl() { return &impl_; } + + static V* FromVal(PersistentContainerValue v) { + return reinterpret_cast(v); + } + + static PersistentContainerValue ClearAndLeak( + UniquePersistent* persistent) { + V* v = persistent->val_; + persistent->val_ = 0; + return reinterpret_cast(v); + } + + static PersistentContainerValue Leak(UniquePersistent* persistent) { + return reinterpret_cast(persistent->val_); + } + /** - * Put a value into the map and update the reference. - * Restrictions of GetReference apply here as well. + * Return a container value as UniquePersistent and make sure the weak + * callback is properly disposed of. All remove functionality should go + * through this. */ - UniquePersistent Set(const K& key, UniquePersistent value, - PersistentValueReference* reference) { - *reference = Leak(&value); - return SetUnique(key, &value); + static UniquePersistent Release(PersistentContainerValue v) { + UniquePersistent p; + p.val_ = FromVal(v); + if (Traits::kCallbackType != kNotWeak && p.IsWeak()) { + Traits::DisposeCallbackData( + p.template ClearWeak()); + } + return p.Pass(); } private: - PersistentValueMap(PersistentValueMap&); - void operator=(PersistentValueMap&); + PersistentValueMapBase(PersistentValueMapBase&); + void operator=(PersistentValueMapBase&); + + static bool SetReturnValueFromVal(ReturnValue* returnValue, + PersistentContainerValue value) { + bool hasValue = value != kPersistentContainerNotFound; + if (hasValue) { + returnValue->SetInternal( + *reinterpret_cast(FromVal(value))); + } + return hasValue; + } + + Isolate* isolate_; + typename Traits::Impl impl_; +}; + + +template +class PersistentValueMap : public PersistentValueMapBase { + public: + explicit PersistentValueMap(Isolate* isolate) + : PersistentValueMapBase(isolate) {} + + typedef + typename PersistentValueMapBase::PersistentValueReference + PersistentValueReference; + + /** + * Put value into map. Depending on Traits::kIsWeak, the value will be held + * by the map strongly or weakly. + * Returns old value as UniquePersistent. + */ + UniquePersistent Set(const K& key, Local value) { + UniquePersistent persistent(this->isolate(), value); + return SetUnique(key, &persistent); + } + + /** + * Put value into map, like Set(const K&, Local). + */ + UniquePersistent Set(const K& key, UniquePersistent value) { + return SetUnique(key, &value); + } /** * Put the value into the map, and set the 'weak' callback when demanded @@ -283,15 +371,26 @@ class PersistentValueMap { */ UniquePersistent SetUnique(const K& key, UniquePersistent* persistent) { if (Traits::kCallbackType != kNotWeak) { - Local value(Local::New(isolate_, *persistent)); + Local value(Local::New(this->isolate(), *persistent)); persistent->template SetWeak( Traits::WeakCallbackParameter(this, key, value), WeakCallback); } PersistentContainerValue old_value = - Traits::Set(&impl_, key, ClearAndLeak(persistent)); - return Release(old_value).Pass(); + Traits::Set(this->impl(), key, this->ClearAndLeak(persistent)); + return this->Release(old_value).Pass(); + } + + /** + * Put a value into the map and update the reference. + * Restrictions of GetReference apply here as well. + */ + UniquePersistent Set(const K& key, UniquePersistent value, + PersistentValueReference* reference) { + *reference = this->Leak(&value); + return SetUnique(key, &value); } + private: static void WeakCallback( const WeakCallbackData& data) { if (Traits::kCallbackType != kNotWeak) { @@ -303,50 +402,73 @@ class PersistentValueMap { Traits::DisposeCallbackData(data.GetParameter()); } } +}; - static V* FromVal(PersistentContainerValue v) { - return reinterpret_cast(v); - } - static bool SetReturnValueFromVal( - ReturnValue* returnValue, PersistentContainerValue value) { - bool hasValue = value != kPersistentContainerNotFound; - if (hasValue) { - returnValue->SetInternal( - *reinterpret_cast(FromVal(value))); - } - return hasValue; - } +template +class PhantomPersistentValueMap : public PersistentValueMapBase { + public: + explicit PhantomPersistentValueMap(Isolate* isolate) + : PersistentValueMapBase(isolate) {} - static PersistentContainerValue ClearAndLeak( - UniquePersistent* persistent) { - V* v = persistent->val_; - persistent->val_ = 0; - return reinterpret_cast(v); + typedef + typename PersistentValueMapBase::PersistentValueReference + PersistentValueReference; + + /** + * Put value into map. Depending on Traits::kIsWeak, the value will be held + * by the map strongly or weakly. + * Returns old value as UniquePersistent. + */ + UniquePersistent Set(const K& key, Local value) { + UniquePersistent persistent(this->isolate(), value); + return SetUnique(key, &persistent); } - static PersistentContainerValue Leak( - UniquePersistent* persistent) { - return reinterpret_cast(persistent->val_); + /** + * Put value into map, like Set(const K&, Local). + */ + UniquePersistent Set(const K& key, UniquePersistent value) { + return SetUnique(key, &value); } /** - * Return a container value as UniquePersistent and make sure the weak - * callback is properly disposed of. All remove functionality should go - * through this. + * Put the value into the map, and set the 'weak' callback when demanded + * by the Traits class. */ - static UniquePersistent Release(PersistentContainerValue v) { - UniquePersistent p; - p.val_ = FromVal(v); - if (Traits::kCallbackType != kNotWeak && p.IsWeak()) { - Traits::DisposeCallbackData( - p.template ClearWeak()); + UniquePersistent SetUnique(const K& key, UniquePersistent* persistent) { + if (Traits::kCallbackType != kNotWeak) { + Local value(Local::New(this->isolate(), *persistent)); + persistent->template SetPhantom( + Traits::WeakCallbackParameter(this, key, value), WeakCallback, 0, 1); } - return p.Pass(); + PersistentContainerValue old_value = + Traits::Set(this->impl(), key, this->ClearAndLeak(persistent)); + return this->Release(old_value).Pass(); } - Isolate* isolate_; - typename Traits::Impl impl_; + /** + * Put a value into the map and update the reference. + * Restrictions of GetReference apply here as well. + */ + UniquePersistent Set(const K& key, UniquePersistent value, + PersistentValueReference* reference) { + *reference = this->Leak(&value); + return SetUnique(key, &value); + } + + private: + static void WeakCallback( + const PhantomCallbackData& data) { + if (Traits::kCallbackType != kNotWeak) { + PhantomPersistentValueMap* persistentValueMap = + Traits::MapFromPhantomCallbackData(data); + K key = Traits::KeyFromPhantomCallbackData(data); + Traits::Dispose(data.GetIsolate(), persistentValueMap->Remove(key).Pass(), + key); + Traits::DisposeCallbackData(data.GetParameter()); + } + } }; diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 61ee03872d2308..49f41f05073126 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -9,9 +9,9 @@ // NOTE these macros are used by some of the tool scripts and the build // system so their names cannot be changed without changing the scripts. #define V8_MAJOR_VERSION 4 -#define V8_MINOR_VERSION 1 -#define V8_BUILD_NUMBER 0 -#define V8_PATCH_LEVEL 27 +#define V8_MINOR_VERSION 2 +#define V8_BUILD_NUMBER 77 +#define V8_PATCH_LEVEL 13 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 218e919a167727..adc85efbc8f11d 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -73,7 +73,6 @@ class Context; class CpuProfiler; class Data; class Date; -class DeclaredAccessorDescriptor; class External; class Function; class FunctionTemplate; @@ -113,6 +112,10 @@ template > class Persistent; template class UniquePersistent; template class PersistentValueMap; +template +class PersistentValueMapBase; +template +class PhantomPersistentValueMap; template class PersistentValueVector; template class WeakCallbackObject; class FunctionTemplate; @@ -123,9 +126,6 @@ template class PropertyCallbackInfo; class StackTrace; class StackFrame; class Isolate; -class DeclaredAccessorDescriptor; -class ObjectOperationDescriptor; -class RawOperationDescriptor; class CallHandlerHelper; class EscapableHandleScope; template class ReturnValue; @@ -142,15 +142,18 @@ class PropertyCallbackArguments; class FunctionCallbackArguments; class GlobalHandles; +template class CallbackData { public: V8_INLINE v8::Isolate* GetIsolate() const { return isolate_; } - protected: - explicit CallbackData(v8::Isolate* isolate) : isolate_(isolate) {} + explicit CallbackData(v8::Isolate* isolate, T* parameter) + : isolate_(isolate), parameter_(parameter) {} + V8_INLINE T* GetParameter() const { return parameter_; } private: v8::Isolate* isolate_; + T* parameter_; }; } @@ -403,7 +406,8 @@ template class Local : public Handle { template friend class internal::CustomArguments; friend class HandleScope; friend class EscapableHandleScope; - template friend class PersistentValueMap; + template + friend class PersistentValueMapBase; template friend class PersistentValueVector; template V8_INLINE Local(S* that) : Handle(that) { } @@ -431,22 +435,27 @@ template class Eternal { template -class PhantomCallbackData : public internal::CallbackData { +class PhantomCallbackData : public internal::CallbackData { public: typedef void (*Callback)(const PhantomCallbackData& data); - V8_INLINE T* GetParameter() const { return parameter_; } + V8_INLINE void* GetInternalField1() const { return internal_field1_; } + V8_INLINE void* GetInternalField2() const { return internal_field2_; } - PhantomCallbackData(Isolate* isolate, T* parameter) - : internal::CallbackData(isolate), parameter_(parameter) {} + PhantomCallbackData(Isolate* isolate, T* parameter, void* internal_field1, + void* internal_field2) + : internal::CallbackData(isolate, parameter), + internal_field1_(internal_field1), + internal_field2_(internal_field2) {} private: - T* parameter_; + void* internal_field1_; + void* internal_field2_; }; template -class WeakCallbackData : public PhantomCallbackData

{ +class WeakCallbackData : public internal::CallbackData

{ public: typedef void (*Callback)(const WeakCallbackData& data); @@ -455,29 +464,12 @@ class WeakCallbackData : public PhantomCallbackData

{ private: friend class internal::GlobalHandles; WeakCallbackData(Isolate* isolate, P* parameter, Local handle) - : PhantomCallbackData

(isolate, parameter), handle_(handle) {} + : internal::CallbackData

(isolate, parameter), handle_(handle) {} Local handle_; }; -template -class InternalFieldsCallbackData : public internal::CallbackData { - public: - typedef void (*Callback)(const InternalFieldsCallbackData& data); - - InternalFieldsCallbackData(Isolate* isolate, T* internalField1, - U* internalField2) - : internal::CallbackData(isolate), - internal_field1_(internalField1), - internal_field2_(internalField2) {} - - V8_INLINE T* GetInternalField1() const { return internal_field1_; } - V8_INLINE U* GetInternalField2() const { return internal_field2_; } - - private: - T* internal_field1_; - U* internal_field2_; -}; +static const int kNoInternalFieldIndex = -1; /** @@ -568,12 +560,9 @@ template class PersistentBase { // fields in the dying object. template V8_INLINE void SetPhantom(P* parameter, - typename PhantomCallbackData

::Callback callback); - - template - V8_INLINE void SetPhantom( - void (*callback)(const InternalFieldsCallbackData&), - int internal_field_index1, int internal_field_index2); + typename PhantomCallbackData

::Callback callback, + int internal_field_index1 = kNoInternalFieldIndex, + int internal_field_index2 = kNoInternalFieldIndex); template V8_INLINE P* ClearWeak(); @@ -628,7 +617,8 @@ template class PersistentBase { template friend class UniquePersistent; template friend class PersistentBase; template friend class ReturnValue; - template friend class PersistentValueMap; + template + friend class PersistentValueMapBase; template friend class PersistentValueVector; friend class Object; @@ -987,21 +977,29 @@ class ScriptOrigin { Handle resource_line_offset = Handle(), Handle resource_column_offset = Handle(), Handle resource_is_shared_cross_origin = Handle(), - Handle script_id = Handle()) + Handle script_id = Handle(), + Handle resource_is_embedder_debug_script = Handle()) : resource_name_(resource_name), resource_line_offset_(resource_line_offset), resource_column_offset_(resource_column_offset), + resource_is_embedder_debug_script_(resource_is_embedder_debug_script), resource_is_shared_cross_origin_(resource_is_shared_cross_origin), - script_id_(script_id) { } + script_id_(script_id) {} V8_INLINE Handle ResourceName() const; V8_INLINE Handle ResourceLineOffset() const; V8_INLINE Handle ResourceColumnOffset() const; + /** + * Returns true for embedder's debugger scripts + */ + V8_INLINE Handle ResourceIsEmbedderDebugScript() 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_embedder_debug_script_; Handle resource_is_shared_cross_origin_; Handle script_id_; }; @@ -1165,6 +1163,7 @@ class V8_EXPORT ScriptCompiler { Handle resource_name; Handle resource_line_offset; Handle resource_column_offset; + Handle resource_is_embedder_debug_script; Handle resource_is_shared_cross_origin; // Cached data from previous compilation (if a kConsume*Cache flag is @@ -1328,6 +1327,39 @@ class V8_EXPORT ScriptCompiler { * compared when it is being used. */ static uint32_t CachedDataVersionTag(); + + /** + * Compile an ES6 module. + * + * This is an experimental feature. + * + * TODO(adamk): Script is likely the wrong return value for this; + * should return some new Module type. + */ + static Local