diff --git a/Makefile b/Makefile index fcc0b83720ecfe..35b89164a9b883 100644 --- a/Makefile +++ b/Makefile @@ -242,9 +242,17 @@ else ifeq ($(DESTCPU),arm) ARCH=arm else +ifeq ($(DESTCPU),ppc64) +ARCH=ppc64 +else +ifeq ($(DESTCPU),ppc) +ARCH=ppc +else ARCH=x86 endif endif +endif +endif # enforce "x86" over "ia32" as the generally accepted way of referring to 32-bit intel ifeq ($(ARCH),ia32) diff --git a/common.gypi b/common.gypi index 4c1b90b29ad2ca..a84ff139690894 100644 --- a/common.gypi +++ b/common.gypi @@ -223,6 +223,14 @@ 'cflags': [ '-m64' ], 'ldflags': [ '-m64' ], }], + [ 'target_arch=="ppc"', { + 'cflags': [ '-m32' ], + 'ldflags': [ '-m32' ], + }], + [ 'target_arch=="ppc64"', { + 'cflags': [ '-m64', '-mminimal-toc' ], + 'ldflags': [ '-m64' ], + }], [ 'OS=="solaris"', { 'cflags': [ '-pthreads' ], 'ldflags': [ '-pthreads' ], diff --git a/configure b/configure index d198d79fd2dd89..fe98fd254f9e94 100755 --- a/configure +++ b/configure @@ -26,7 +26,8 @@ import nodedownload parser = optparse.OptionParser() valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux', 'android') -valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'x32', 'x64', 'x86') +valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 'x32', + 'x64') valid_arm_float_abi = ('soft', 'softfp', 'hard') valid_mips_arch = ('loongson', 'r1', 'r2', 'r6', 'rx') valid_mips_fpu = ('fp32', 'fp64', 'fpxx') @@ -538,6 +539,8 @@ def host_arch_cc(): '__arm__' : 'arm', '__i386__' : 'ia32', '__mips__' : 'mips', + '__PPC64__' : 'ppc64', + '__PPC__' : 'ppc', '__x86_64__' : 'x64', } @@ -613,6 +616,7 @@ def configure_node(o): target_arch = 'ia32' o['variables']['host_arch'] = host_arch o['variables']['target_arch'] = target_arch + o['variables']['node_byteorder'] = sys.byteorder cross_compiling = target_arch != host_arch want_snapshots = not options.without_snapshot diff --git a/deps/npm/node_modules/node-gyp/addon.gypi b/deps/npm/node_modules/node-gyp/addon.gypi index 09ee70d9c22a64..1872c48c7fa279 100644 --- a/deps/npm/node_modules/node-gyp/addon.gypi +++ b/deps/npm/node_modules/node-gyp/addon.gypi @@ -5,6 +5,7 @@ 'product_prefix': '', 'include_dirs': [ + '<(node_root_dir)/include/node', '<(node_root_dir)/src', '<(node_root_dir)/deps/uv/include', '<(node_root_dir)/deps/v8/include' diff --git a/deps/npm/node_modules/node-gyp/lib/configure.js b/deps/npm/node_modules/node-gyp/lib/configure.js index 0a33e70088f325..337bce51d1658f 100644 --- a/deps/npm/node_modules/node-gyp/lib/configure.js +++ b/deps/npm/node_modules/node-gyp/lib/configure.js @@ -310,7 +310,11 @@ function configure (gyp, argv, callback) { // this logic ported from the old `gyp_addon` python file var gyp_script = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py') var addon_gypi = path.resolve(__dirname, '..', 'addon.gypi') - var common_gypi = path.resolve(nodeDir, 'common.gypi') + var common_gypi = path.resolve(nodeDir, 'include/node/common.gypi') + //TODO: ideally async + if (!fs.existsSync(common_gypi)) + common_gypi = path.resolve(nodeDir, 'common.gypi') + var output_dir = 'build' if (win) { // Windows expects an absolute path diff --git a/deps/npm/node_modules/node-gyp/lib/install.js b/deps/npm/node_modules/node-gyp/lib/install.js index 0407feba0e8bdb..cecd7fd4af4e54 100644 --- a/deps/npm/node_modules/node-gyp/lib/install.js +++ b/deps/npm/node_modules/node-gyp/lib/install.js @@ -39,8 +39,8 @@ function install (gyp, argv, callback) { } } - var distUrl = gyp.opts['dist-url'] || gyp.opts.disturl || 'https://iojs.org/dist' - + var defaultUrl = getDefaultIojsUrl(process.version) + var distUrl = gyp.opts['dist-url'] || gyp.opts.disturl || defaultUrl // Determine which node dev files version we are installing var versionStr = argv[0] || gyp.opts.target || process.version @@ -185,7 +185,7 @@ function install (gyp, argv, callback) { // now download the node tarball var tarPath = gyp.opts['tarball'] - var tarballUrl = tarPath ? tarPath : distUrl + '/v' + version + '/iojs-v' + version + '.tar.gz' + var tarballUrl = tarPath ? tarPath : distUrl + '/v' + version + '/iojs-v' + version + '-headers.tar.gz' , badDownload = false , extractCount = 0 , gunzip = zlib.createGunzip() @@ -455,3 +455,26 @@ function install (gyp, argv, callback) { } } + + +// pick out 'nightly', 'next-nightly' or 'rc' from the version string if it's there +// adjust URL accordingly +function getDefaultIojsUrl(version) { + var versionMatch = version.match(/^v\d+\.\d+\.\d+-(?:(?:(nightly|next-nightly)\d{8}[0-9a-f]{10})|(?:(rc)\d+))$/) + var distType = versionMatch ? versionMatch[1] || versionMatch[2] : 'release' + var defaultUrl = `https://iojs.org/download/${distType}` + return defaultUrl +} + + +if (require.main === module) { + var assert = require('assert') + console.log('test v2.3.4 -> https://iojs.org/download/release') + assert(getDefaultIojsUrl('v2.3.4', 'https://iojs.org/download/release')) + console.log('test v2.3.4-nightly12345678aaaaaaaaaa -> https://iojs.org/download/nightly') + assert(getDefaultIojsUrl('v2.3.4-nightly12345678aaaaaaaaaa', 'https://iojs.org/download/nightly')) + console.log('test v2.3.4-next-nightly12345678aaaaaaaaaa -> https://iojs.org/download/release/next-nightly') + assert(getDefaultIojsUrl('v2.3.4-next-nightly12345678aaaaaaaaaa', 'https://iojs.org/download/next-nightly')) + console.log('test v2.3.4-rc100 -> https://iojs.org/download/rc') + assert(getDefaultIojsUrl('v2.3.4-rc100', 'https://iojs.org/download/rc')) +} diff --git a/deps/openssl/config/Makefile b/deps/openssl/config/Makefile index 02f926e7362275..91339a9e5a2e02 100644 --- a/deps/openssl/config/Makefile +++ b/deps/openssl/config/Makefile @@ -4,7 +4,8 @@ COPT = no-shared no-symlinks ARCHS = BSD-x86 BSD-x86_64 VC-WIN32 VC-WIN64A darwin64-x86_64-cc \ darwin-i386-cc linux-aarch64 linux-armv4 linux-elf linux-x32 \ -linux-x86_64 solaris-x86-gcc solaris64-x86_64-gcc +linux-x86_64 linux-ppc linux-ppc64 solaris-x86-gcc \ +solaris64-x86_64-gcc CFG = opensslconf.h SRC_CFG = ../openssl/crypto/$(CFG) diff --git a/deps/openssl/config/archs/linux-ppc/opensslconf.h b/deps/openssl/config/archs/linux-ppc/opensslconf.h new file mode 100644 index 00000000000000..bd5d3befeda038 --- /dev/null +++ b/deps/openssl/config/archs/linux-ppc/opensslconf.h @@ -0,0 +1,258 @@ +/* opensslconf.h */ +/* WARNING: Generated automatically from opensslconf.h.in by Configure. */ + +#ifdef __cplusplus +extern "C" { +#endif +/* OpenSSL was configured with the following options: */ +#ifndef OPENSSL_DOING_MAKEDEPEND + + +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 +# define OPENSSL_NO_EC_NISTP_64_GCC_128 +#endif +#ifndef OPENSSL_NO_GMP +# define OPENSSL_NO_GMP +#endif +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif +#ifndef OPENSSL_NO_KRB5 +# define OPENSSL_NO_KRB5 +#endif +#ifndef OPENSSL_NO_LIBUNBOUND +# define OPENSSL_NO_LIBUNBOUND +#endif +#ifndef OPENSSL_NO_MD2 +# define OPENSSL_NO_MD2 +#endif +#ifndef OPENSSL_NO_RC5 +# define OPENSSL_NO_RC5 +#endif +#ifndef OPENSSL_NO_RFC3779 +# define OPENSSL_NO_RFC3779 +#endif +#ifndef OPENSSL_NO_SCTP +# define OPENSSL_NO_SCTP +#endif +#ifndef OPENSSL_NO_SSL_TRACE +# define OPENSSL_NO_SSL_TRACE +#endif +#ifndef OPENSSL_NO_STORE +# define OPENSSL_NO_STORE +#endif +#ifndef OPENSSL_NO_UNIT_TEST +# define OPENSSL_NO_UNIT_TEST +#endif + +#endif /* OPENSSL_DOING_MAKEDEPEND */ + +#ifndef OPENSSL_THREADS +# define OPENSSL_THREADS +#endif +#ifndef OPENSSL_NO_DYNAMIC_ENGINE +# define OPENSSL_NO_DYNAMIC_ENGINE +#endif + +/* The OPENSSL_NO_* macros are also defined as NO_* if the application + asks for it. This is a transient feature that is provided for those + who haven't had the time to do the appropriate changes in their + applications. */ +#ifdef OPENSSL_ALGORITHM_DEFINES +# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) +# define NO_EC_NISTP_64_GCC_128 +# endif +# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) +# define NO_GMP +# endif +# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) +# define NO_JPAKE +# endif +# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) +# define NO_KRB5 +# endif +# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND) +# define NO_LIBUNBOUND +# endif +# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2) +# define NO_MD2 +# endif +# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5) +# define NO_RC5 +# endif +# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779) +# define NO_RFC3779 +# endif +# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) +# define NO_SCTP +# endif +# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) +# define NO_SSL_TRACE +# endif +# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) +# define NO_STORE +# endif +# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) +# define NO_UNIT_TEST +# endif +#endif + + + +/* crypto/opensslconf.h.in */ + +/* Generate 80386 code? */ +#undef I386_ONLY + +#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ +#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) +#define ENGINESDIR "/usr/local/ssl/lib/engines" +#define OPENSSLDIR "/usr/local/ssl" +#endif +#endif + +#undef OPENSSL_UNISTD +#define OPENSSL_UNISTD + +#undef OPENSSL_EXPORT_VAR_AS_FUNCTION + +#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) +#define IDEA_INT unsigned int +#endif + +#if defined(HEADER_MD2_H) && !defined(MD2_INT) +#define MD2_INT unsigned int +#endif + +#if defined(HEADER_RC2_H) && !defined(RC2_INT) +/* I need to put in a mod for the alpha - eay */ +#define RC2_INT unsigned int +#endif + +#if defined(HEADER_RC4_H) +#if !defined(RC4_INT) +/* using int types make the structure larger but make the code faster + * on most boxes I have tested - up to %20 faster. */ +/* + * I don't know what does "most" mean, but declaring "int" is a must on: + * - Intel P6 because partial register stalls are very expensive; + * - elder Alpha because it lacks byte load/store instructions; + */ +#define RC4_INT unsigned char +#endif +#if !defined(RC4_CHUNK) +/* + * This enables code handling data aligned at natural CPU word + * boundary. See crypto/rc4/rc4_enc.c for further details. + */ +#define RC4_CHUNK unsigned long +#endif +#endif + +#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) +/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a + * %20 speed up (longs are 8 bytes, int's are 4). */ +#ifndef DES_LONG +#define DES_LONG unsigned long +#endif +#endif + +#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) +#define CONFIG_HEADER_BN_H +#define BN_LLONG + +/* Should we define BN_DIV2W here? */ + +/* Only one for the following should be defined */ +#undef SIXTY_FOUR_BIT_LONG +#undef SIXTY_FOUR_BIT +#define THIRTY_TWO_BIT +#endif + +#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) +#define CONFIG_HEADER_RC4_LOCL_H +/* if this is defined data[i] is used instead of *data, this is a %20 + * speedup on x86 */ +#undef RC4_INDEX +#endif + +#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) +#define CONFIG_HEADER_BF_LOCL_H +#undef BF_PTR +#endif /* HEADER_BF_LOCL_H */ + +#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) +#define CONFIG_HEADER_DES_LOCL_H +#ifndef DES_DEFAULT_OPTIONS +/* the following is tweaked from a config script, that is why it is a + * protected undef/define */ +#ifndef DES_PTR +#undef DES_PTR +#endif + +/* This helps C compiler generate the correct code for multiple functional + * units. It reduces register dependancies at the expense of 2 more + * registers */ +#ifndef DES_RISC1 +#define DES_RISC1 +#endif + +#ifndef DES_RISC2 +#undef DES_RISC2 +#endif + +#if defined(DES_RISC1) && defined(DES_RISC2) +YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! +#endif + +/* Unroll the inner loop, this sometimes helps, sometimes hinders. + * Very mucy CPU dependant */ +#ifndef DES_UNROLL +#define DES_UNROLL +#endif + +/* These default values were supplied by + * Peter Gutman + * They are only used if nothing else has been defined */ +#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) +/* Special defines which change the way the code is built depending on the + CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find + even newer MIPS CPU's, but at the moment one size fits all for + optimization options. Older Sparc's work better with only UNROLL, but + there's no way to tell at compile time what it is you're running on */ + +#if defined( sun ) /* Newer Sparc's */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#elif defined( __ultrix ) /* Older MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined( __osf1__ ) /* Alpha */ +# define DES_PTR +# define DES_RISC2 +#elif defined ( _AIX ) /* RS6000 */ + /* Unknown */ +#elif defined( __hpux ) /* HP-PA */ + /* Unknown */ +#elif defined( __aux ) /* 68K */ + /* Unknown */ +#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ +# define DES_UNROLL +#elif defined( __sgi ) /* Newer MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#endif /* Systems-specific speed defines */ +#endif + +#endif /* DES_DEFAULT_OPTIONS */ +#endif /* HEADER_DES_LOCL_H */ +#ifdef __cplusplus +} +#endif diff --git a/deps/openssl/config/archs/linux-ppc64/opensslconf.h b/deps/openssl/config/archs/linux-ppc64/opensslconf.h new file mode 100644 index 00000000000000..dc671aad0d66bd --- /dev/null +++ b/deps/openssl/config/archs/linux-ppc64/opensslconf.h @@ -0,0 +1,258 @@ +/* opensslconf.h */ +/* WARNING: Generated automatically from opensslconf.h.in by Configure. */ + +#ifdef __cplusplus +extern "C" { +#endif +/* OpenSSL was configured with the following options: */ +#ifndef OPENSSL_DOING_MAKEDEPEND + + +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 +# define OPENSSL_NO_EC_NISTP_64_GCC_128 +#endif +#ifndef OPENSSL_NO_GMP +# define OPENSSL_NO_GMP +#endif +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif +#ifndef OPENSSL_NO_KRB5 +# define OPENSSL_NO_KRB5 +#endif +#ifndef OPENSSL_NO_LIBUNBOUND +# define OPENSSL_NO_LIBUNBOUND +#endif +#ifndef OPENSSL_NO_MD2 +# define OPENSSL_NO_MD2 +#endif +#ifndef OPENSSL_NO_RC5 +# define OPENSSL_NO_RC5 +#endif +#ifndef OPENSSL_NO_RFC3779 +# define OPENSSL_NO_RFC3779 +#endif +#ifndef OPENSSL_NO_SCTP +# define OPENSSL_NO_SCTP +#endif +#ifndef OPENSSL_NO_SSL_TRACE +# define OPENSSL_NO_SSL_TRACE +#endif +#ifndef OPENSSL_NO_STORE +# define OPENSSL_NO_STORE +#endif +#ifndef OPENSSL_NO_UNIT_TEST +# define OPENSSL_NO_UNIT_TEST +#endif + +#endif /* OPENSSL_DOING_MAKEDEPEND */ + +#ifndef OPENSSL_THREADS +# define OPENSSL_THREADS +#endif +#ifndef OPENSSL_NO_DYNAMIC_ENGINE +# define OPENSSL_NO_DYNAMIC_ENGINE +#endif + +/* The OPENSSL_NO_* macros are also defined as NO_* if the application + asks for it. This is a transient feature that is provided for those + who haven't had the time to do the appropriate changes in their + applications. */ +#ifdef OPENSSL_ALGORITHM_DEFINES +# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) +# define NO_EC_NISTP_64_GCC_128 +# endif +# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) +# define NO_GMP +# endif +# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) +# define NO_JPAKE +# endif +# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) +# define NO_KRB5 +# endif +# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND) +# define NO_LIBUNBOUND +# endif +# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2) +# define NO_MD2 +# endif +# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5) +# define NO_RC5 +# endif +# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779) +# define NO_RFC3779 +# endif +# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) +# define NO_SCTP +# endif +# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) +# define NO_SSL_TRACE +# endif +# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) +# define NO_STORE +# endif +# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) +# define NO_UNIT_TEST +# endif +#endif + + + +/* crypto/opensslconf.h.in */ + +/* Generate 80386 code? */ +#undef I386_ONLY + +#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ +#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) +#define ENGINESDIR "/usr/local/ssl/lib/engines" +#define OPENSSLDIR "/usr/local/ssl" +#endif +#endif + +#undef OPENSSL_UNISTD +#define OPENSSL_UNISTD + +#undef OPENSSL_EXPORT_VAR_AS_FUNCTION + +#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) +#define IDEA_INT unsigned int +#endif + +#if defined(HEADER_MD2_H) && !defined(MD2_INT) +#define MD2_INT unsigned int +#endif + +#if defined(HEADER_RC2_H) && !defined(RC2_INT) +/* I need to put in a mod for the alpha - eay */ +#define RC2_INT unsigned int +#endif + +#if defined(HEADER_RC4_H) +#if !defined(RC4_INT) +/* using int types make the structure larger but make the code faster + * on most boxes I have tested - up to %20 faster. */ +/* + * I don't know what does "most" mean, but declaring "int" is a must on: + * - Intel P6 because partial register stalls are very expensive; + * - elder Alpha because it lacks byte load/store instructions; + */ +#define RC4_INT unsigned char +#endif +#if !defined(RC4_CHUNK) +/* + * This enables code handling data aligned at natural CPU word + * boundary. See crypto/rc4/rc4_enc.c for further details. + */ +#define RC4_CHUNK unsigned long +#endif +#endif + +#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) +/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a + * %20 speed up (longs are 8 bytes, int's are 4). */ +#ifndef DES_LONG +#define DES_LONG unsigned long +#endif +#endif + +#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) +#define CONFIG_HEADER_BN_H +#undef BN_LLONG + +/* Should we define BN_DIV2W here? */ + +/* Only one for the following should be defined */ +#define SIXTY_FOUR_BIT_LONG +#undef SIXTY_FOUR_BIT +#undef THIRTY_TWO_BIT +#endif + +#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) +#define CONFIG_HEADER_RC4_LOCL_H +/* if this is defined data[i] is used instead of *data, this is a %20 + * speedup on x86 */ +#undef RC4_INDEX +#endif + +#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) +#define CONFIG_HEADER_BF_LOCL_H +#undef BF_PTR +#endif /* HEADER_BF_LOCL_H */ + +#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) +#define CONFIG_HEADER_DES_LOCL_H +#ifndef DES_DEFAULT_OPTIONS +/* the following is tweaked from a config script, that is why it is a + * protected undef/define */ +#ifndef DES_PTR +#undef DES_PTR +#endif + +/* This helps C compiler generate the correct code for multiple functional + * units. It reduces register dependancies at the expense of 2 more + * registers */ +#ifndef DES_RISC1 +#define DES_RISC1 +#endif + +#ifndef DES_RISC2 +#undef DES_RISC2 +#endif + +#if defined(DES_RISC1) && defined(DES_RISC2) +YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! +#endif + +/* Unroll the inner loop, this sometimes helps, sometimes hinders. + * Very mucy CPU dependant */ +#ifndef DES_UNROLL +#define DES_UNROLL +#endif + +/* These default values were supplied by + * Peter Gutman + * They are only used if nothing else has been defined */ +#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) +/* Special defines which change the way the code is built depending on the + CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find + even newer MIPS CPU's, but at the moment one size fits all for + optimization options. Older Sparc's work better with only UNROLL, but + there's no way to tell at compile time what it is you're running on */ + +#if defined( sun ) /* Newer Sparc's */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#elif defined( __ultrix ) /* Older MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined( __osf1__ ) /* Alpha */ +# define DES_PTR +# define DES_RISC2 +#elif defined ( _AIX ) /* RS6000 */ + /* Unknown */ +#elif defined( __hpux ) /* HP-PA */ + /* Unknown */ +#elif defined( __aux ) /* 68K */ + /* Unknown */ +#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ +# define DES_UNROLL +#elif defined( __sgi ) /* Newer MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#endif /* Systems-specific speed defines */ +#endif + +#endif /* DES_DEFAULT_OPTIONS */ +#endif /* HEADER_DES_LOCL_H */ +#ifdef __cplusplus +} +#endif diff --git a/deps/openssl/config/opensslconf.h b/deps/openssl/config/opensslconf.h index 76efd0863e8bca..5db8d046cf69b2 100644 --- a/deps/openssl/config/opensslconf.h +++ b/deps/openssl/config/opensslconf.h @@ -23,6 +23,8 @@ | linux | x64 | linux-x86_64 | o | | linux | arm | linux-armv4 | o | | linux | arm64 | linux-aarch64 | o | + | linux | ppc | linux-ppc | o | + | linux | ppc64 | linux-ppc64 | o | | mac | ia32 | darwin-i386-cc | o | | mac | x64 | darwin64-x86-cc | o | | win | ia32 | VC-WIN32 | - | @@ -59,6 +61,8 @@ | x32 | __ILP32__ | | x64 | __x86_64__ | | x64(win) | _M_X64 | + | ppc | __PPC__ | + | ppc64 | __PPC64__ | These are the list which is not implemented yet. @@ -107,6 +111,10 @@ # include "./archs/solaris-x86-gcc/opensslconf.h" #elif defined(__sun) && defined(__x86_64__) # include "./archs/solaris64-x86_64-gcc/opensslconf.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/opensslconf.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/opensslconf.h" #else # include "./archs/linux-elf/opensslconf.h" #endif diff --git a/deps/openssl/openssl.gyp b/deps/openssl/openssl.gyp index d5bb16e5e388f6..0389abdd149184 100644 --- a/deps/openssl/openssl.gyp +++ b/deps/openssl/openssl.gyp @@ -43,7 +43,13 @@ ], }, }], - + [ 'node_byteorder=="big"', { + # Define Big Endian + 'defines': ['B_ENDIAN'] + }, { + # Define Little Endian + 'defines':['L_ENDIAN'] + }], ['openssl_no_asm!=0', { # Disable asm 'defines': [ diff --git a/deps/openssl/openssl.gypi b/deps/openssl/openssl.gypi index 840b479e05d634..e2e06d8333172c 100644 --- a/deps/openssl/openssl.gypi +++ b/deps/openssl/openssl.gypi @@ -1249,7 +1249,6 @@ ], 'openssl_default_defines_all': [ # No clue what these are for. - 'L_ENDIAN', 'PURIFY', '_REENTRANT', diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index 2eac3035c33dbb..cc424333d31334 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -24,6 +24,7 @@ .cproject .d8_history .gclient_entries +.landmines .project .pydevproject .settings diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index 39fb88c57b7975..b0a9765b4436a5 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -64,6 +64,7 @@ Jianghua Yang Joel Stanley Johan Bergström Jonathan Liu +JunHo Seo Kang-Hao (Kenny) Lu Luis Reis Luke Zarko @@ -75,6 +76,7 @@ Maxim Mossienko Michael Lutz Michael Smith Mike Gilbert +Mike Pennisi Nicolas Antonius Ernst Leopold Maria Kaiser Paolo Giarrusso Patrick Gansterer diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index 713ab6de57d461..feaec2505e8359 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -2,6 +2,10 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/android/config.gni") +import("//build/config/arm.gni") +import("//build/config/mips.gni") + # Because standalone V8 builds are not supported, assume this is part of a # Chromium build. import("//build/module_args/v8.gni") @@ -18,10 +22,28 @@ v8_interpreted_regexp = false v8_object_print = false v8_postmortem_support = false v8_use_snapshot = true -v8_target_arch = cpu_arch +v8_target_arch = target_cpu v8_random_seed = "314159265" v8_toolset_for_d8 = "host" +# The snapshot needs to be compiled for the host, but compiled with +# a toolchain that matches the bit-width of the target. +# +# TODO(GYP): For now we only support 32-bit little-endian target builds from an +# x64 Linux host. Eventually we need to support all of the host/target +# configurations v8 runs on. +if (host_cpu == "x64" && host_os == "linux") { + if (target_cpu == "arm" || target_cpu == "mipsel" || target_cpu == "x86") { + snapshot_toolchain = "//build/toolchain/linux:clang_x86" + } else if (target_cpu == "x64") { + snapshot_toolchain = "//build/toolchain/linux:clang_x64" + } else { + assert(false, "Need environment for this arch") + } +} else { + snapshot_toolchain = default_toolchain +} + ############################################################################### # Configurations # @@ -96,37 +118,49 @@ config("toolchain") { defines = [] cflags = [] - # TODO(jochen): Add support for arm subarchs, mips, mipsel. + # TODO(jochen): Add support for arm subarchs, mips, mipsel, mips64el. 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") { + if (current_cpu == "arm") { + if (arm_version == 7) { + defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ] + } + if (arm_fpu == "vfpv3-d16") { + defines += [ "CAN_USE_VFP3_INSTRUCTIONS" ] + } else if (arm_fpu == "vfpv3") { + defines += [ + "CAN_USE_VFP3_INSTRUCTIONS", + "CAN_USE_VFP32DREGS", + ] + } else if (arm_fpu == "neon") { + defines += [ + "CAN_USE_VFP3_INSTRUCTIONS", + "CAN_USE_VFP32DREGS", + "CAN_USE_NEON", + ] + } + } else { + # These defines ares used for the ARM simulator. defines += [ + "CAN_USE_ARMV7_INSTRUCTIONS", "CAN_USE_VFP3_INSTRUCTIONS", "CAN_USE_VFP32DREGS", - "CAN_USE_NEON", + "USE_EABI_HARDFLOAT=0", ] } # 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" ] } + if (v8_target_arch == "mipsel") { + defines += [ "V8_TARGET_ARCH_MIPS" ] + } + if (v8_target_arch == "mips64el") { + defines += [ "V8_TARGET_ARCH_MIPS64" ] + } if (v8_target_arch == "x86") { defines += [ "V8_TARGET_ARCH_IA32" ] } @@ -167,14 +201,16 @@ action("js2c") { inputs = [ "tools/jsmin.py" ] sources = [ + "src/macros.py", + "src/messages.h", "src/runtime.js", "src/v8natives.js", "src/symbol.js", "src/array.js", "src/string.js", "src/uri.js", - "src/third_party/fdlibm/fdlibm.js", "src/math.js", + "src/third_party/fdlibm/fdlibm.js", "src/date.js", "src/regexp.js", "src/arraybuffer.js", @@ -192,7 +228,7 @@ action("js2c") { "src/debug-debugger.js", "src/mirror-debugger.js", "src/liveedit-debugger.js", - "src/macros.py", + "src/templates.js", ] outputs = [ @@ -228,15 +264,17 @@ action("js2c_experimental") { sources = [ "src/macros.py", + "src/messages.h", "src/proxy.js", "src/generator.js", - "src/harmony-string.js", "src/harmony-array.js", "src/harmony-array-includes.js", "src/harmony-typedarray.js", "src/harmony-tostring.js", - "src/harmony-templates.js", "src/harmony-regexp.js", + "src/harmony-reflect.js", + "src/harmony-spread.js", + "src/harmony-object.js" ] outputs = [ @@ -258,6 +296,36 @@ action("js2c_experimental") { } } +action("js2c_extras") { + visibility = [ ":*" ] # Only targets in this file can depend on this. + + script = "tools/js2c.py" + + # The script depends on this other script, this rule causes a rebuild if it + # changes. + inputs = [ "tools/jsmin.py" ] + + sources = v8_extra_library_files + + outputs = [ + "$target_gen_dir/extras-libraries.cc", + ] + + args = [ + rebase_path("$target_gen_dir/extras-libraries.cc", + root_build_dir), + "EXTRAS", + ] + rebase_path(sources, root_build_dir) + + if (v8_use_external_startup_data) { + outputs += [ "$target_gen_dir/libraries_extras.bin" ] + args += [ + "--startup_blob", + rebase_path("$target_gen_dir/libraries_extras.bin", root_build_dir), + ] + } +} + action("d8_js2c") { visibility = [ ":*" ] # Only targets in this file can depend on this. @@ -283,11 +351,13 @@ if (v8_use_external_startup_data) { deps = [ ":js2c", ":js2c_experimental", + ":js2c_extras", ] sources = [ "$target_gen_dir/libraries.bin", "$target_gen_dir/libraries_experimental.bin", + "$target_gen_dir/libraries_extras.bin", ] outputs = [ @@ -301,7 +371,12 @@ if (v8_use_external_startup_data) { } action("postmortem-metadata") { - visibility = [ ":*" ] # Only targets in this file can depend on this. + # Only targets in this file and the top-level visibility target can + # depend on this. + visibility = [ + ":*", + "//:gn_visibility", + ] script = "tools/gen-postmortem-metadata.py" @@ -322,7 +397,7 @@ action("run_mksnapshot") { visibility = [ ":*" ] # Only targets in this file can depend on this. deps = [ - ":mksnapshot($host_toolchain)", + ":mksnapshot($snapshot_toolchain)", ] script = "tools/run.py" @@ -332,7 +407,7 @@ action("run_mksnapshot") { ] args = [ - "./" + rebase_path(get_label_info(":mksnapshot($host_toolchain)", + "./" + rebase_path(get_label_info(":mksnapshot($snapshot_toolchain)", "root_out_dir") + "/mksnapshot", root_build_dir), "--log-snapshot-positions", @@ -367,13 +442,15 @@ source_set("v8_nosnapshot") { deps = [ ":js2c", ":js2c_experimental", + ":js2c_extras", ":v8_base", ] sources = [ "$target_gen_dir/libraries.cc", "$target_gen_dir/experimental-libraries.cc", - "src/snapshot-empty.cc", + "$target_gen_dir/extras-libraries.cc", + "src/snapshot/snapshot-empty.cc", ] configs -= [ "//build/config/compiler:chromium_code" ] @@ -386,11 +463,17 @@ source_set("v8_nosnapshot") { } source_set("v8_snapshot") { - visibility = [ ":*" ] # Only targets in this file can depend on this. + # Only targets in this file and the top-level visibility target can + # depend on this. + visibility = [ + ":*", + "//:gn_visibility", + ] deps = [ ":js2c", ":js2c_experimental", + ":js2c_extras", ":run_mksnapshot", ":v8_base", ] @@ -398,6 +481,7 @@ source_set("v8_snapshot") { sources = [ "$target_gen_dir/libraries.cc", "$target_gen_dir/experimental-libraries.cc", + "$target_gen_dir/extras-libraries.cc", "$target_gen_dir/snapshot.cc", ] @@ -417,14 +501,15 @@ if (v8_use_external_startup_data) { deps = [ ":js2c", ":js2c_experimental", + ":js2c_extras", ":run_mksnapshot", ":v8_base", ":natives_blob", ] sources = [ - "src/natives-external.cc", - "src/snapshot-external.cc", + "src/snapshot/natives-external.cc", + "src/snapshot/snapshot-external.cc", ] configs -= [ "//build/config/compiler:chromium_code" ] @@ -501,6 +586,8 @@ source_set("v8_base") { "src/codegen.h", "src/compilation-cache.cc", "src/compilation-cache.h", + "src/compilation-dependencies.cc", + "src/compilation-dependencies.h", "src/compilation-statistics.cc", "src/compilation-statistics.h", "src/compiler/access-builder.cc", @@ -526,6 +613,7 @@ source_set("v8_base") { "src/compiler/common-operator.h", "src/compiler/control-builders.cc", "src/compiler/control-builders.h", + "src/compiler/control-equivalence.cc", "src/compiler/control-equivalence.h", "src/compiler/control-flow-optimizer.cc", "src/compiler/control-flow-optimizer.h", @@ -533,11 +621,13 @@ source_set("v8_base") { "src/compiler/control-reducer.h", "src/compiler/diamond.h", "src/compiler/frame.h", + "src/compiler/frame-elider.cc", + "src/compiler/frame-elider.h", + "src/compiler/frame-states.cc", + "src/compiler/frame-states.h", "src/compiler/gap-resolver.cc", "src/compiler/gap-resolver.h", - "src/compiler/generic-algorithm.h", "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", @@ -566,6 +656,8 @@ source_set("v8_base") { "src/compiler/js-intrinsic-lowering.h", "src/compiler/js-operator.cc", "src/compiler/js-operator.h", + "src/compiler/js-type-feedback.cc", + "src/compiler/js-type-feedback.h", "src/compiler/js-typed-lowering.cc", "src/compiler/js-typed-lowering.h", "src/compiler/jump-threading.cc", @@ -573,6 +665,8 @@ source_set("v8_base") { "src/compiler/linkage-impl.h", "src/compiler/linkage.cc", "src/compiler/linkage.h", + "src/compiler/liveness-analyzer.cc", + "src/compiler/liveness-analyzer.h", "src/compiler/load-elimination.cc", "src/compiler/load-elimination.h", "src/compiler/loop-peeling.cc", @@ -591,6 +685,7 @@ source_set("v8_base") { "src/compiler/node-cache.h", "src/compiler/node-marker.cc", "src/compiler/node-marker.h", + "src/compiler/node-matchers.cc", "src/compiler/node-matchers.h", "src/compiler/node-properties.cc", "src/compiler/node-properties.h", @@ -631,6 +726,10 @@ source_set("v8_base") { "src/compiler/simplified-operator.h", "src/compiler/source-position.cc", "src/compiler/source-position.h", + "src/compiler/state-values-utils.cc", + "src/compiler/state-values-utils.h", + "src/compiler/tail-call-optimization.cc", + "src/compiler/tail-call-optimization.h", "src/compiler/typer.cc", "src/compiler/typer.h", "src/compiler/value-numbering-reducer.cc", @@ -724,6 +823,8 @@ source_set("v8_base") { "src/heap/heap-inl.h", "src/heap/heap.cc", "src/heap/heap.h", + "src/heap/identity-map.cc", + "src/heap/identity-map.h", "src/heap/incremental-marking.cc", "src/heap/incremental-marking.h", "src/heap/mark-compact-inl.h", @@ -848,18 +949,19 @@ source_set("v8_base") { "src/modules.cc", "src/modules.h", "src/msan.h", - "src/natives.h", "src/objects-debug.cc", "src/objects-inl.h", "src/objects-printer.cc", "src/objects.cc", "src/objects.h", - "src/optimizing-compiler-thread.cc", - "src/optimizing-compiler-thread.h", + "src/optimizing-compile-dispatcher.cc", + "src/optimizing-compile-dispatcher.h", "src/ostreams.cc", "src/ostreams.h", "src/parser.cc", "src/parser.h", + "src/pending-compilation-error-handler.cc", + "src/pending-compilation-error-handler.h", "src/perf-jit.cc", "src/perf-jit.h", "src/preparse-data-format.h", @@ -929,20 +1031,24 @@ source_set("v8_base") { "src/scopeinfo.h", "src/scopes.cc", "src/scopes.h", - "src/serialize.cc", - "src/serialize.h", + "src/signature.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/snapshot/natives.h", + "src/snapshot/serialize.cc", + "src/snapshot/serialize.h", + "src/snapshot/snapshot-common.cc", + "src/snapshot/snapshot-source-sink.cc", + "src/snapshot/snapshot-source-sink.h", + "src/snapshot/snapshot.h", "src/string-builder.cc", "src/string-builder.h", "src/string-search.cc", "src/string-search.h", "src/string-stream.cc", "src/string-stream.h", + "src/strings-storage.cc", + "src/strings-storage.h", "src/strtod.cc", "src/strtod.h", "src/token.cc", @@ -968,7 +1074,6 @@ source_set("v8_base") { "src/unicode-decoder.cc", "src/unicode-decoder.h", "src/unique.h", - "src/utils-inl.h", "src/utils.cc", "src/utils.h", "src/v8.cc", @@ -1287,6 +1392,7 @@ source_set("v8_libbase") { visibility = [ ":*" ] # Only targets in this file can depend on this. sources = [ + "src/base/adapters.h", "src/base/atomicops.h", "src/base/atomicops_internals_arm64_gcc.h", "src/base/atomicops_internals_arm_gcc.h", @@ -1356,21 +1462,19 @@ source_set("v8_libbase") { if (is_linux) { sources += [ "src/base/platform/platform-linux.cc" ] - libs = [ "rt" ] + libs = [ "dl", "rt" ] } else if (is_android) { defines += [ "CAN_USE_VFP_INSTRUCTIONS" ] - if (build_os == "mac") { - if (current_toolchain == host_toolchain) { + if (current_toolchain == host_toolchain) { + libs = [ "dl", "rt" ] + if (host_os == "mac") { 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/base/platform/platform-macos.cc" ] @@ -1425,12 +1529,12 @@ source_set("v8_libplatform") { # Executables # -if (current_toolchain == host_toolchain) { +if (current_toolchain == snapshot_toolchain) { executable("mksnapshot") { visibility = [ ":*" ] # Only targets in this file can depend on this. sources = [ - "src/mksnapshot.cc", + "src/snapshot/mksnapshot.cc", ] configs -= [ "//build/config/compiler:chromium_code" ] @@ -1486,7 +1590,7 @@ if (component_mode == "shared_library") { ":toolchain", ] - direct_dependent_configs = [ ":external_config" ] + public_configs = [ ":external_config" ] libs = [] if (is_android && current_toolchain != host_toolchain) { @@ -1513,7 +1617,7 @@ if (component_mode == "shared_library") { ] } - direct_dependent_configs = [ ":external_config" ] + public_configs = [ ":external_config" ] } } @@ -1530,7 +1634,10 @@ if ((current_toolchain == host_toolchain && v8_toolset_for_d8 == "host") || configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] configs += [ - ":internal_config", + # Note: don't use :internal_config here because this target will get + # the :external_config applied to it by virtue of depending on :v8, and + # you can't have both applied to the same target. + ":internal_config_base", ":features", ":toolchain", ] diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index 0f835dc8c43f90..c665f1763eb431 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,927 @@ +2015-05-11: Version 4.4.63 + + Let Runtime_GrowArrayElements accept non-Smi numbers as |key| (Chromium + issue 485410). + + Make one copy for all TypedArray methods (issue 4085). + + Performance and stability improvements on all platforms. + + +2015-05-09: Version 4.4.62 + + [turbofan] Fix handling of OsrLoopEntry in ControlReducer::ConnectNTL() + (Chromium issue 485908). + + Performance and stability improvements on all platforms. + + +2015-05-08: Version 4.4.61 + + Performance and stability improvements on all platforms. + + +2015-05-08: Version 4.4.60 + + Performance and stability improvements on all platforms. + + +2015-05-08: Version 4.4.59 + + Performance and stability improvements on all platforms. + + +2015-05-07: Version 4.4.58 + + TypedArray.prototype.every method (issue 3578). + + [V8] Reland https://codereview.chromium.org/1121833003/ (Chromium issue + 480652). + + Performance and stability improvements on all platforms. + + +2015-05-07: Version 4.4.57 + + Performance and stability improvements on all platforms. + + +2015-05-06: Version 4.4.56 + + Shard v8_base.lib on Windows to avoid 2G .lib limit (Chromium issue + 485155). + + Implement a 'trial parse' step, that will abort pre-parsing excessively + long and trivial functions, so that they can be eagerly compiled after + all. This essentially allows the parser to renege on its earlier + decision to lazy-parse, if additional information suggests it was a bad + decision (Chromium issue 470930). + + Performance and stability improvements on all platforms. + + +2015-05-06: Version 4.4.55 + + Handle the case when derived constructor is [[Call]]ed with 0 args + (Chromium issue 474783). + + freed_nodes in global-handles should be addititive (Chromium issues + 479796, 484671). + + [V8] Reland https://codereview.chromium.org/1100993003/ (Chromium issue + 480652). + + [es6] When comparing two symbols we may need to throw a TypeError (issue + 4073). + + Performance and stability improvements on all platforms. + + +2015-05-06: Version 4.4.54 + + Performance and stability improvements on all platforms. + + +2015-05-05: Version 4.4.53 + + Performance and stability improvements on all platforms. + + +2015-05-05: Version 4.4.52 + + Performance and stability improvements on all platforms. + + +2015-05-04: Version 4.4.51 + + Performance and stability improvements on all platforms. + + +2015-05-04: Version 4.4.50 + + Performance and stability improvements on all platforms. + + +2015-05-01: Version 4.4.49 + + Performance and stability improvements on all platforms. + + +2015-05-01: Version 4.4.48 + + [V8] Use previous token location as EOS token location (Chromium issue + 480652). + + Implement kToBeExecutedOnceCodeAge (Chromium issue 470930). + + Performance and stability improvements on all platforms. + + +2015-04-30: Version 4.4.47 + + Performance and stability improvements on all platforms. + + +2015-04-30: Version 4.4.46 + + Performance and stability improvements on all platforms. + + +2015-04-29: Version 4.4.45 + + Performance and stability improvements on all platforms. + + +2015-04-29: Version 4.4.44 + + Pass ArrayBuffer::Allocator via Isolate::CreateParams. + + Fix unobservable constructor replacement on prototype maps (Chromium + issue 478522). + + Performance and stability improvements on all platforms. + + +2015-04-29: Version 4.4.43 + + Performance and stability improvements on all platforms. + + +2015-04-28: Version 4.4.42 + + MIPS: Fix FP load/store with large offsets from base register (Chromium + issue 481519). + + Extending v8::GetHeapStatistics to return total available size (Chromium + issue 476013). + + Performance and stability improvements on all platforms. + + +2015-04-28: Version 4.4.41 + + Performance and stability improvements on all platforms. + + +2015-04-28: Version 4.4.40 + + Do more to avoid last-resort stop-the-world GC (Chromium issue 481433). + + Performance and stability improvements on all platforms. + + +2015-04-27: Version 4.4.39 + + Performance and stability improvements on all platforms. + + +2015-04-27: Version 4.4.38 + + Performance and stability improvements on all platforms. + + +2015-04-25: Version 4.4.37 + + Performance and stability improvements on all platforms. + + +2015-04-24: Version 4.4.36 + + Performance and stability improvements on all platforms. + + +2015-04-24: Version 4.4.35 + + Performance and stability improvements on all platforms. + + +2015-04-24: Version 4.4.34 + + Performance and stability improvements on all platforms. + + +2015-04-23: Version 4.4.33 + + Performance and stability improvements on all platforms. + + +2015-04-23: Version 4.4.32 + + Performance and stability improvements on all platforms. + + +2015-04-23: Version 4.4.31 + + Performance and stability improvements on all platforms. + + +2015-04-22: Version 4.4.30 + + Performance and stability improvements on all platforms. + + +2015-04-22: Version 4.4.29 + + Performance and stability improvements on all platforms. + + +2015-04-21: Version 4.4.28 + + Performance and stability improvements on all platforms. + + +2015-04-21: Version 4.4.27 + + Performance and stability improvements on all platforms. + + +2015-04-20: Version 4.4.26 + + Allow for accessing an ArrayBuffer contents without externalizing it. + + Remove support for externally backed elements from the API (issue 3996). + + Deprecate 3-args ResourceConstraints::ConfigureDefaults. + + Indicate that low-memory-notificatin triggered GCs are "forced". + + Adding missing V8_EXPORT flag in SpaceStatistics class in v8.h (Chromium + issues 466141, 476013). + + Performance and stability improvements on all platforms. + + +2015-04-20: Version 4.4.25 + + Turn off SupportsFlexibleFloorAndRound for Arm64 due to a bug (Chromium + issue 476477). + + Adding V8 api to get memory statistics of spaces in V8::Heap (Chromium + issues 466141, 476013). + + Performance and stability improvements on all platforms. + + +2015-04-17: Version 4.4.24 + + Performance and stability improvements on all platforms. + + +2015-04-17: Version 4.4.23 + + Don't crash when reporting an access check failure for a detached global + proxy (Chromium issue 475884). + + Use smaller heap growing factor in idle notification to start + incremental marking when there is idle time >16ms (Chromium issue + 477323). + + Performance and stability improvements on all platforms. + + +2015-04-16: Version 4.4.22 + + Reduce regexp compiler stack size when not optimizing regexps (Chromium + issue 475705). + + Performance and stability improvements on all platforms. + + +2015-04-15: Version 4.4.21 + + Remove support for specifying the number of available threads. + + When converting Maybe and MaybeLocal values with a check, always check. + + Performance and stability improvements on all platforms. + + +2015-04-15: Version 4.4.20 + + Performance and stability improvements on all platforms. + + +2015-04-15: Version 4.4.19 + + Reland "Remove support for thread-based recompilation" (issue 3608). + + Performance and stability improvements on all platforms. + + +2015-04-14: Version 4.4.18 + + Reland "Remove support for thread-based recompilation" (issue 3608). + + Performance and stability improvements on all platforms. + + +2015-04-14: Version 4.4.17 + + Performance and stability improvements on all platforms. + + +2015-04-13: Version 4.4.16 + + Expose ArrayBufferView::HasBuffer (issue 3996). + + Performance and stability improvements on all platforms. + + +2015-04-13: Version 4.4.15 + + Performance and stability improvements on all platforms. + + +2015-04-12: Version 4.4.14 + + Performance and stability improvements on all platforms. + + +2015-04-12: Version 4.4.13 + + Performance and stability improvements on all platforms. + + +2015-04-10: Version 4.4.12 + + Performance and stability improvements on all platforms. + + +2015-04-10: Version 4.4.11 + + Performance and stability improvements on all platforms. + + +2015-04-10: Version 4.4.10 + + Don't #define snprintf in VS2015 - it's illegal and unneeded (Chromium + issue 440500). + + Performance and stability improvements on all platforms. + + +2015-04-09: Version 4.4.9 + + Performance and stability improvements on all platforms. + + +2015-04-09: Version 4.4.8 + + Performance and stability improvements on all platforms. + + +2015-04-08: Version 4.4.7 + + Make GetDebugContext a bit more robust (Chromium issue 474538). + + Performance and stability improvements on all platforms. + + +2015-04-08: Version 4.4.6 + + Performance and stability improvements on all platforms. + + +2015-04-08: Version 4.4.5 + + More robust when allocation fails during compaction (Chromium issue + 473307). + + MIPS: JSEntryTrampoline: check for stack space before pushing arguments + (Chromium issue 469768). + + Performance and stability improvements on all platforms. + + +2015-04-07: Version 4.4.4 + + Debugger: remove debug command API. + + Remove support for thread-based recompilation (issue 3608). + + JSEntryTrampoline: check for stack space before pushing arguments + (Chromium issue 469768). + + Performance and stability improvements on all platforms. + + +2015-04-07: Version 4.4.3 + + Performance and stability improvements on all platforms. + + +2015-04-06: Version 4.4.2 + + Performance and stability improvements on all platforms. + + +2015-04-06: Version 4.4.1 + + Support for typed arrays added to Heap::RightTrimFixedArray() (Chromium + issue 472513). + + Expose an API on ArrayBufferView to copy out content w/o changing the + buffer (issue 3996). + + Performance and stability improvements on all platforms. + + +2015-04-02: Version 4.3.66 + + Reland: Fix JSON parser Handle leak (previous CL 1041483004) (issue + 3976, Chromium issue 472504). + + Turn off overapproximation of the weak closure again (issue 3862). + + Performance and stability improvements on all platforms. + + +2015-04-01: Version 4.3.65 + + Performance and stability improvements on all platforms. + + +2015-04-01: Version 4.3.64 + + Performance and stability improvements on all platforms. + + +2015-04-01: Version 4.3.63 + + [V8] Don't ignore sourceURL comment in inline scripts in .stack (issue + 3920). + + Deprecate IdleNotification(). + + Remove --harmony-numeric-literal flag. + + Performance and stability improvements on all platforms. + + +2015-03-31: Version 4.3.62 + + Put newspace evacuation in an EvacuationScope (Chromium issue 471554). + + Fix libdl dependency on Android and remove librt hack (Chromium issue + 469973). + + Ensure that GC idle notifications either make progress or stop + requesting more GCs (Chromium issue 470615). + + Layout descriptor must be trimmed when corresponding descriptors array + is trimmed to stay in sync (Chromium issue 470804). + + Fix JSON parser Handle leak (issue 3976). + + Performance and stability improvements on all platforms. + + +2015-03-30: Version 4.3.61 + + Performance and stability improvements on all platforms. + + +2015-03-28: Version 4.3.60 + + Reland^2 "Filter invalid slots out from the SlotsBuffer after marking." + (Chromium issues 454297, 470801). + + This fixes missing incremental write barrier issue when double fields + unboxing is enabled (Chromium issue 469146). + + Performance and stability improvements on all platforms. + + +2015-03-27: Version 4.3.59 + + Use a slot that is located on a heap page when removing invalid entries + from the SlotsBuffer (Chromium issue 470801). + + Performance and stability improvements on all platforms. + + +2015-03-26: Version 4.3.58 + + Return timestamp of the last recorded interval to the caller of + HeapProfiler::GetHeapStats (Chromium issue 467222). + + Performance and stability improvements on all platforms. + + +2015-03-26: Version 4.3.57 + + Reland [V8] Removed SourceLocationRestrict (Chromium issue 468781). + + Performance and stability improvements on all platforms. + + +2015-03-25: Version 4.3.56 + + Remove v8::Isolate::ClearInterrupt. + + Performance and stability improvements on all platforms. + + +2015-03-25: Version 4.3.55 + + Performance and stability improvements on all platforms. + + +2015-03-24: Version 4.3.54 + + Do not assign positions to parser-generated desugarings (Chromium issue + 468661). + + Performance and stability improvements on all platforms. + + +2015-03-24: Version 4.3.53 + + Filter invalid slots out from the SlotsBuffer after marking (Chromium + issue 454297). + + Fix OOM bug 3976 (issue 3976). + + Performance and stability improvements on all platforms. + + +2015-03-24: Version 4.3.52 + + Remove calls to IdleNotification(). + + Save heap object tracking data in heap snapshot (Chromium issue 467222). + + Performance and stability improvements on all platforms. + + +2015-03-24: Version 4.3.51 + + [V8] Removed SourceLocationRestrict (Chromium issue 468781). + + [turbofan] Fix control reducer bug with walking non-control edges during + ConnectNTL phase (Chromium issue 469605). + + Performance and stability improvements on all platforms. + + +2015-03-23: Version 4.3.50 + + Performance and stability improvements on all platforms. + + +2015-03-23: Version 4.3.49 + + Ensure we don't overflow in BCE (Chromium issue 469148). + + [turbofan] Fix lowering of Math.max for integral inputs (Chromium issue + 468162). + + Use libdl to get symbols for backtraces. + + Performance and stability improvements on all platforms. + + +2015-03-19: Version 4.3.48 + + Clarify what APIs return Maybe and MaybeLocal values (issue 3929). + + Introduce explicit constant for per Context debug data set by embedder + (Chromium issue 466631). + + Adjust key behaviour for weak collections (issues 3970, 3971, Chromium + issue 460083). + + Turn on overapproximation of the weak closure (issue 3862). + + Performance and stability improvements on all platforms. + + +2015-03-18: Version 4.3.47 + + Performance and stability improvements on all platforms. + + +2015-03-17: Version 4.3.46 + + Performance and stability improvements on all platforms. + + +2015-03-17: Version 4.3.45 + + Performance and stability improvements on all platforms. + + +2015-03-17: Version 4.3.44 + + Performance and stability improvements on all platforms. + + +2015-03-16: Version 4.3.43 + + Bugfix in hydrogen GVN (Chromium issue 467481). + + Remove obsolete TakeHeapSnapshot method from API (Chromium issue + 465651). + + Beautify syntax error for unterminated argument list (Chromium issue + 339474). + + Performance and stability improvements on all platforms. + + +2015-03-16: Version 4.3.42 + + Performance and stability improvements on all platforms. + + +2015-03-15: Version 4.3.41 + + Performance and stability improvements on all platforms. + + +2015-03-14: Version 4.3.40 + + Performance and stability improvements on all platforms. + + +2015-03-14: Version 4.3.39 + + Performance and stability improvements on all platforms. + + +2015-03-14: Version 4.3.38 + + Remove --harmony-scoping flag. + + Performance and stability improvements on all platforms. + + +2015-03-13: Version 4.3.37 + + Implement TDZ in StoreIC for top-level lexicals (issue 3941). + + Turn on job-based optimizing compiler (issue 3608). + + Performance and stability improvements on all platforms. + + +2015-03-13: Version 4.3.36 + + Performance and stability improvements on all platforms. + + +2015-03-12: Version 4.3.35 + + Add Cast() for Int32 and Uint32 (Chromium issue 462402). + + Incorrect handling of HTransitionElementsKind in hydrogen check + elimination phase fixed (Chromium issue 460917). + + Performance and stability improvements on all platforms. + + +2015-03-12: Version 4.3.34 + + Performance and stability improvements on all platforms. + + +2015-03-12: Version 4.3.33 + + Fix the toolchain used to build the snapshots in GN (Chromium issues + 395249, 465456). + + Performance and stability improvements on all platforms. + + +2015-03-11: Version 4.3.32 + + Reland of Remove slots that point to unboxed doubles from the + StoreBuffer/SlotsBuffer (Chromium issues 454297, 465273). + + Performance and stability improvements on all platforms. + + +2015-03-11: Version 4.3.31 + + Performance and stability improvements on all platforms. + + +2015-03-11: Version 4.3.30 + + Remove uid and title from HeapSnapshot (Chromium issue 465651). + + Remove deprecated CpuProfiler methods. + + [turbofan] Fix --turbo-osr for OSRing into inner loop inside for-in + (Chromium issue 462775). + + Performance and stability improvements on all platforms. + + +2015-03-10: Version 4.3.29 + + Performance and stability improvements on all platforms. + + +2015-03-10: Version 4.3.28 + + Performance and stability improvements on all platforms. + + +2015-03-10: Version 4.3.27 + + Performance and stability improvements on all platforms. + + +2015-03-07: Version 4.3.26 + + Remove slots that point to unboxed doubles from the + StoreBuffer/SlotsBuffer (Chromium issue 454297). + + Performance and stability improvements on all platforms. + + +2015-03-06: Version 4.3.25 + + Performance and stability improvements on all platforms. + + +2015-03-06: Version 4.3.24 + + convert more things to maybe (issue 3929). + + Performance and stability improvements on all platforms. + + +2015-03-05: Version 4.3.23 + + [V8] Use Function.name for stack frames in v8::StackTrace (Chromium + issue 17356). + + Allow passing sourceMapUrl when compiling scripts (Chromium issue + 462572). + + convert compile functions to use maybe (issue 3929). + + Performance and stability improvements on all platforms. + + +2015-03-05: Version 4.3.22 + + give UniquePersistent full move semantics (issue 3669). + + Performance and stability improvements on all platforms. + + +2015-03-05: Version 4.3.21 + + Performance and stability improvements on all platforms. + + +2015-03-04: Version 4.3.20 + + convert remaining object functions to maybes (issue 3929). + + Performance and stability improvements on all platforms. + + +2015-03-04: Version 4.3.19 + + ARM assembler: fix undefined behaviour in fits_shifter (Chromium issues + 444089, 463436). + + Implement subclassing Arrays (issue 3930). + + [es6] Fix for-const loops (issue 3983). + + Performance and stability improvements on all platforms. + + +2015-03-04: Version 4.3.18 + + Implement subclassing Arrays (issue 3930). + + Performance and stability improvements on all platforms. + + +2015-03-04: Version 4.3.17 + + Implement subclassing Arrays (issue 3930). + + convert more object functions to return maybes (issue 3929). + + Performance and stability improvements on all platforms. + + +2015-03-03: Version 4.3.16 + + check for null context on execution entry (issue 3929). + + convert object::* to return maybe values (issue 3929). + + Removed funky Maybe constructor and made fields private (issue 3929). + + Polish Maybe API a bit, removing useless creativity and fixing some + signatures (issue 3929). + + Performance and stability improvements on all platforms. + + +2015-03-02: Version 4.3.15 + + Performance and stability improvements on all platforms. + + +2015-03-02: Version 4.3.14 + + Performance and stability improvements on all platforms. + + +2015-02-28: Version 4.3.13 + + Disallow subclassing Arrays (issue 3930). + + Performance and stability improvements on all platforms. + + +2015-02-28: Version 4.3.12 + + Performance and stability improvements on all platforms. + + +2015-02-27: Version 4.3.11 + + Disallow subclassing Arrays (issue 3930). + + convert Value::*Value() function to return Maybe results (issue 3929). + + Performance and stability improvements on all platforms. + + +2015-02-27: Version 4.3.10 + + Convert v8::Value::To* to use MaybeLocal (issue 3929). + + Performance and stability improvements on all platforms. + + +2015-02-26: Version 4.3.9 + + Add public version macros (issue 3075). + + Performance and stability improvements on all platforms. + + +2015-02-26: Version 4.3.8 + + Performance and stability improvements on all platforms. + + +2015-02-25: Version 4.3.7 + + Performance and stability improvements on all platforms. + + +2015-02-25: Version 4.3.6 + + Performance and stability improvements on all platforms. + + +2015-02-25: Version 4.3.5 + + Turn on job based recompilation (issue 3608). + + Performance and stability improvements on all platforms. + + +2015-02-24: Version 4.3.4 + + Reland "Correctly propagate terminate exception in TryCall." (issue + 3892). + + Performance and stability improvements on all platforms. + + +2015-02-24: Version 4.3.3 + + Performance and stability improvements on all platforms. + + +2015-02-24: Version 4.3.2 + + Update GN build files with the cpu_arch -> current_cpu change. + + Performance and stability improvements on all platforms. + + +2015-02-23: Version 4.3.1 + + Limit size of first page based on serialized data (Chromium issue + 453111). + + Performance and stability improvements on all platforms. + + 2015-02-19: Version 4.2.77 Make generator constructors configurable (issue 3902). diff --git a/deps/v8/DEPS b/deps/v8/DEPS index b829d05dabb9ad..711cc53b7e3574 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -8,17 +8,17 @@ vars = { deps = { "v8/build/gyp": - Var("git_url") + "/external/gyp.git" + "@" + "34640080d08ab2a37665512e52142947def3056d", + Var("git_url") + "/external/gyp.git" + "@" + "0bb67471bca068996e15b56738fa4824dfa19de0", "v8/third_party/icu": - Var("git_url") + "/chromium/deps/icu.git" + "@" + "4e3266f32c62d30a3f9e2232a753c60129d1e670", + Var("git_url") + "/chromium/deps/icu.git" + "@" + "f8c0e585b0a046d83d72b5d37356cb50d5b2031a", "v8/buildtools": - Var("git_url") + "/chromium/buildtools.git" + "@" + "5c5e924788fe40f7d6e0a3841ac572de2475e689", + Var("git_url") + "/chromium/buildtools.git" + "@" + "b0ede9c89f9d5fbe5387d961ad4c0ec665b6c821", "v8/testing/gtest": 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" + "@" + "f6daa55d03995e82201a3278203e7c0421a59546", + Var("git_url") + "/chromium/src/tools/clang.git" + "@" + "5bab78c6ced45a71a8e095a09697ca80492e57e1", } deps_os = { @@ -46,6 +46,17 @@ skip_child_includes = [ ] hooks = [ + { + # This clobbers when necessary (based on get_landmines.py). It must be the + # first hook so that other things that get/generate into the output + # directory will not subsequently be clobbered. + 'name': 'landmines', + 'pattern': '.', + 'action': [ + 'python', + 'v8/build/landmines.py', + ], + }, # Pull clang-format binaries using checked-in hashes. { "name": "clang_format_win", diff --git a/deps/v8/Makefile b/deps/v8/Makefile index 5468d913341e31..db6cf3b7da534a 100644 --- a/deps/v8/Makefile +++ b/deps/v8/Makefile @@ -97,6 +97,10 @@ endif ifeq ($(slowdchecks), off) GYPFLAGS += -Dv8_enable_slow_dchecks=0 endif +# debugsymbols=on +ifeq ($(debugsymbols), on) + GYPFLAGS += -Drelease_extra_cflags=-ggdb3 +endif # gdbjit=on/off ifeq ($(gdbjit), on) GYPFLAGS += -Dv8_enable_gdbjit=1 @@ -234,7 +238,8 @@ 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 -ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel android_x87 +ANDROID_ARCHES = android_ia32 android_x64 android_arm android_arm64 \ + android_mipsel android_x87 NACL_ARCHES = nacl_ia32 nacl_x64 # List of files that trigger Makefile regeneration: diff --git a/deps/v8/Makefile.android b/deps/v8/Makefile.android index 2a3640382b4f5f..f89fd21fda004e 100644 --- a/deps/v8/Makefile.android +++ b/deps/v8/Makefile.android @@ -26,7 +26,8 @@ # 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_x87 +ANDROID_ARCHES = android_ia32 android_x64 android_arm android_arm64 \ + android_mipsel android_x87 MODES = release debug # Generates all combinations of ANDROID ARCHES and MODES, @@ -66,6 +67,11 @@ else ifeq ($(ARCH), android_ia32) TOOLCHAIN_ARCH = x86 TOOLCHAIN_PREFIX = i686-linux-android TOOLCHAIN_VER = 4.8 +else ifeq ($(ARCH), android_x64) + DEFINES = target_arch=x64 v8_target_arch=x64 android_target_arch=x86_64 android_target_platform=21 + TOOLCHAIN_ARCH = x86_64 + TOOLCHAIN_PREFIX = x86_64-linux-android + TOOLCHAIN_VER = 4.9 else ifeq ($(ARCH), android_x87) DEFINES = target_arch=x87 v8_target_arch=x87 android_target_arch=x86 android_target_platform=14 TOOLCHAIN_ARCH = x86 diff --git a/deps/v8/PRESUBMIT.py b/deps/v8/PRESUBMIT.py index fd0601f17bbfd8..34e09b8ec51b25 100644 --- a/deps/v8/PRESUBMIT.py +++ b/deps/v8/PRESUBMIT.py @@ -244,16 +244,21 @@ def GetPreferredTryMasters(project, change): return { 'tryserver.v8': { 'v8_linux_rel': set(['defaulttests']), + 'v8_linux_dbg': set(['defaulttests']), 'v8_linux_nodcheck_rel': set(['defaulttests']), 'v8_linux_gcc_compile_rel': set(['defaulttests']), 'v8_linux64_rel': set(['defaulttests']), 'v8_linux64_asan_rel': set(['defaulttests']), + 'v8_linux64_avx2_rel': set(['defaulttests']), 'v8_win_rel': set(['defaulttests']), 'v8_win_compile_dbg': set(['defaulttests']), + 'v8_win_nosnap_shared_compile_rel': 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_mipsel_compile_rel': set(['defaulttests']), + 'v8_linux_mips64el_compile_rel': set(['defaulttests']), 'v8_android_arm_compile_rel': set(['defaulttests']), 'v8_linux_chromium_gn_rel': set(['defaulttests']), }, diff --git a/deps/v8/README.md b/deps/v8/README.md index bc1685affa99dc..5cd4b5811a4b47 100644 --- a/deps/v8/README.md +++ b/deps/v8/README.md @@ -18,13 +18,13 @@ Getting the Code Checkout [depot tools](http://www.chromium.org/developers/how-tos/install-depot-tools), and run -> `fetch v8` + fetch v8 This will checkout V8 into the directory `v8` and fetch all of its dependencies. To stay up to date, run -> `git pull origin` -> `gclient sync` + git pull origin + gclient sync For fetching all branches, add the following into your remote configuration in `.git/config`: diff --git a/deps/v8/WATCHLISTS b/deps/v8/WATCHLISTS index 9c2bce9c5589c2..64771bc27dc61e 100644 --- a/deps/v8/WATCHLISTS +++ b/deps/v8/WATCHLISTS @@ -36,11 +36,23 @@ 'public_api': { 'filepath': 'include/', }, + 'snapshot': { + 'filepath': 'src/snapshot/', + }, + 'debugger': { + 'filepath': 'src/debug\.(cc|h)|src/.*-debugger\.js|src/runtime/runtime-debug\.cc', + }, }, 'WATCHLISTS': { 'public_api': [ 'phajdan.jr@chromium.org', ], + 'snapshot': [ + 'yangguo@chromium.org', + ], + 'debugger': [ + 'yangguo@chromium.org', + ], }, } diff --git a/deps/v8/build/OWNERS b/deps/v8/build/OWNERS new file mode 100644 index 00000000000000..0e56af312942fa --- /dev/null +++ b/deps/v8/build/OWNERS @@ -0,0 +1 @@ +machenbach@chromium.org diff --git a/deps/v8/build/android.gypi b/deps/v8/build/android.gypi index 5d3b25a74636ca..7bbf12eed6d99b 100644 --- a/deps/v8/build/android.gypi +++ b/deps/v8/build/android.gypi @@ -43,7 +43,13 @@ 'android_stlport': '<(android_toolchain)/sources/cxx-stl/stlport/', }, 'android_include': '<(android_sysroot)/usr/include', - 'android_lib': '<(android_sysroot)/usr/lib', + 'conditions': [ + ['target_arch=="x64"', { + 'android_lib': '<(android_sysroot)/usr/lib64', + }, { + 'android_lib': '<(android_sysroot)/usr/lib', + }], + ], 'android_stlport_include': '<(android_stlport)/stlport', 'android_stlport_libs': '<(android_stlport)/libs', }, { @@ -52,14 +58,17 @@ 'android_stlport': '<(android_ndk_root)/sources/cxx-stl/stlport/', }, 'android_include': '<(android_sysroot)/usr/include', - 'android_lib': '<(android_sysroot)/usr/lib', + 'conditions': [ + ['target_arch=="x64"', { + 'android_lib': '<(android_sysroot)/usr/lib64', + }, { + 'android_lib': '<(android_sysroot)/usr/lib', + }], + ], 'android_stlport_include': '<(android_stlport)/stlport', 'android_stlport_libs': '<(android_stlport)/libs', }], ], - # Enable to use the system stlport, otherwise statically - # link the NDK one? - 'use_system_stlport%': '<(android_webview_build)', 'android_stlport_library': 'stlport_static', }, # variables 'target_defaults': { @@ -96,6 +105,7 @@ # Note: This include is in cflags to ensure that it comes after # all of the includes. '-I<(android_include)', + '-I<(android_stlport_include)', ], 'cflags_cc': [ '-Wno-error=non-virtual-dtor', # TODO(michaelbai): Fix warnings. @@ -115,6 +125,8 @@ 'ldflags': [ '-nostdlib', '-Wl,--no-undefined', + '-Wl,-rpath-link=<(android_lib)', + '-L<(android_lib)', ], 'libraries!': [ '-lrt', # librt is built into Bionic. @@ -134,12 +146,6 @@ '-lm', ], 'conditions': [ - ['android_webview_build==0', { - 'ldflags': [ - '-Wl,-rpath-link=<(android_lib)', - '-L<(android_lib)', - ], - }], ['target_arch == "arm"', { 'ldflags': [ # Enable identical code folding to reduce size. @@ -152,48 +158,23 @@ '-mtune=cortex-a8', '-mfpu=vfp3', ], + 'ldflags': [ + '-L<(android_stlport_libs)/armeabi-v7a', + ], }], - # NOTE: The stlport header include paths below are specified in - # cflags rather than include_dirs because they need to come - # after include_dirs. Think of them like system headers, but - # don't use '-isystem' because the arm-linux-androideabi-4.4.3 - # toolchain (circa Gingerbread) will exhibit strange errors. - # The include ordering here is important; change with caution. - ['use_system_stlport==0', { - 'cflags': [ - '-I<(android_stlport_include)', + ['target_arch=="arm" and arm_version < 7', { + 'ldflags': [ + '-L<(android_stlport_libs)/armeabi', ], - 'conditions': [ - ['target_arch=="arm" and arm_version==7', { - 'ldflags': [ - '-L<(android_stlport_libs)/armeabi-v7a', - ], - }], - ['target_arch=="arm" and arm_version < 7', { - 'ldflags': [ - '-L<(android_stlport_libs)/armeabi', - ], - }], - ['target_arch=="mipsel"', { - 'ldflags': [ - '-L<(android_stlport_libs)/mips', - ], - }], - ['target_arch=="ia32" or target_arch=="x87"', { - 'ldflags': [ - '-L<(android_stlport_libs)/x86', - ], - }], - ['target_arch=="x64"', { - 'ldflags': [ - '-L<(android_stlport_libs)/x86_64', - ], - }], - ['target_arch=="arm64"', { - 'ldflags': [ - '-L<(android_stlport_libs)/arm64-v8a', - ], - }], + }], + ['target_arch=="x64"', { + 'ldflags': [ + '-L<(android_stlport_libs)/x86_64', + ], + }], + ['target_arch=="arm64"', { + 'ldflags': [ + '-L<(android_stlport_libs)/arm64-v8a', ], }], ['target_arch=="ia32" or target_arch=="x87"', { @@ -204,6 +185,9 @@ 'cflags': [ '-fno-stack-protector', ], + 'ldflags': [ + '-L<(android_stlport_libs)/x86', + ], }], ['target_arch=="mipsel"', { # The mips toolchain currently has problems with stack-protector. @@ -214,6 +198,9 @@ 'cflags': [ '-fno-stack-protector', ], + 'ldflags': [ + '-L<(android_stlport_libs)/mips', + ], }], ['(target_arch=="arm" or target_arch=="arm64" or target_arch=="x64") and component!="shared_library"', { 'cflags': [ @@ -227,7 +214,7 @@ 'target_conditions': [ ['_type=="executable"', { 'conditions': [ - ['target_arch=="arm64"', { + ['target_arch=="arm64" or target_arch=="x64"', { 'ldflags': [ '-Wl,-dynamic-linker,/system/bin/linker64', ], diff --git a/deps/v8/build/detect_v8_host_arch.py b/deps/v8/build/detect_v8_host_arch.py index 3460a9a404f0ce..89e8286e1fdb45 100644 --- a/deps/v8/build/detect_v8_host_arch.py +++ b/deps/v8/build/detect_v8_host_arch.py @@ -41,6 +41,7 @@ def DoMain(_): """Hook to be called from gyp without starting a separate python interpreter.""" host_arch = platform.machine() + host_system = platform.system(); # Convert machine type to format recognized by gyp. if re.match(r'i.86', host_arch) or host_arch == 'i86pc': @@ -56,6 +57,13 @@ def DoMain(_): elif host_arch.startswith('mips'): host_arch = 'mipsel' + # Under AIX the value returned by platform.machine is not + # the best indicator of the host architecture + # AIX 6.1 which is the lowest level supported only provides + # a 64 bit kernel + if host_system == 'AIX': + host_arch = 'ppc64' + # platform.machine is based on running kernel. It's possible to use 64-bit # kernel with 32-bit userland, e.g. to give linker slightly more memory. # Distinguish between different userland bitness by querying diff --git a/deps/v8/build/get_landmines.py b/deps/v8/build/get_landmines.py index 66a86cbb5082ad..f61c04de44361e 100755 --- a/deps/v8/build/get_landmines.py +++ b/deps/v8/build/get_landmines.py @@ -20,6 +20,7 @@ def main(): print 'Activating MSVS 2013.' print 'Revert activation of MSVS 2013.' print 'Activating MSVS 2013 again.' + print 'Clobber after ICU roll.' return 0 diff --git a/deps/v8/build/gyp_environment.py b/deps/v8/build/gyp_environment.py new file mode 100644 index 00000000000000..f1cee6ef8e00f6 --- /dev/null +++ b/deps/v8/build/gyp_environment.py @@ -0,0 +1,52 @@ +# 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. + +""" +Sets up various automatic gyp environment variables. These are used by +gyp_v8 and landmines.py which run at different stages of runhooks. To +make sure settings are consistent between them, all setup should happen here. +""" + +import os +import sys + +SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) +V8_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir)) + + +def apply_gyp_environment(file_path=None): + """ + Reads in a *.gyp_env file and applies the valid keys to os.environ. + """ + if not file_path or not os.path.exists(file_path): + return + file_contents = open(file_path).read() + try: + file_data = eval(file_contents, {'__builtins__': None}, None) + except SyntaxError, e: + e.filename = os.path.abspath(file_path) + raise + supported_vars = ( 'V8_GYP_FILE', + 'V8_GYP_SYNTAX_CHECK', + 'GYP_DEFINES', + 'GYP_GENERATOR_FLAGS', + 'GYP_GENERATOR_OUTPUT', ) + for var in supported_vars: + val = file_data.get(var) + if val: + if var in os.environ: + print 'INFO: Environment value for "%s" overrides value in %s.' % ( + var, os.path.abspath(file_path) + ) + else: + os.environ[var] = val + + +def set_environment(): + """Sets defaults for GYP_* variables.""" + + if 'SKIP_V8_GYP_ENV' not in os.environ: + # Update the environment based on v8.gyp_env + gyp_env_path = os.path.join(os.path.dirname(V8_ROOT), 'v8.gyp_env') + apply_gyp_environment(gyp_env_path) diff --git a/deps/v8/build/gyp_v8 b/deps/v8/build/gyp_v8 index 14467eccaad29f..1e8a5c806ecca6 100755 --- a/deps/v8/build/gyp_v8 +++ b/deps/v8/build/gyp_v8 @@ -31,6 +31,7 @@ # is invoked by V8 beyond what can be done in the gclient hooks. import glob +import gyp_environment import os import platform import shlex @@ -48,34 +49,6 @@ sys.path.insert( 1, os.path.abspath(os.path.join(v8_root, 'tools', 'generate_shim_headers'))) -def apply_gyp_environment(file_path=None): - """ - Reads in a *.gyp_env file and applies the valid keys to os.environ. - """ - if not file_path or not os.path.exists(file_path): - return - file_contents = open(file_path).read() - try: - file_data = eval(file_contents, {'__builtins__': None}, None) - except SyntaxError, e: - e.filename = os.path.abspath(file_path) - raise - supported_vars = ( 'V8_GYP_FILE', - 'V8_GYP_SYNTAX_CHECK', - 'GYP_DEFINES', - 'GYP_GENERATOR_FLAGS', - 'GYP_GENERATOR_OUTPUT', ) - for var in supported_vars: - val = file_data.get(var) - if val: - if var in os.environ: - print 'INFO: Environment value for "%s" overrides value in %s.' % ( - var, os.path.abspath(file_path) - ) - else: - os.environ[var] = val - - def additional_include_files(args=[]): """ Returns a list of additional (.gypi) files to include, without @@ -109,13 +82,6 @@ def additional_include_files(args=[]): def run_gyp(args): rc = gyp.main(args) - # Check for landmines (reasons to clobber the build). This must be run here, - # rather than a separate runhooks step so that any environment modifications - # from above are picked up. - print 'Running build/landmines.py...' - subprocess.check_call( - [sys.executable, os.path.join(script_dir, 'landmines.py')]) - if rc != 0: print 'Error running GYP' sys.exit(rc) @@ -124,10 +90,7 @@ def run_gyp(args): if __name__ == '__main__': args = sys.argv[1:] - if 'SKIP_V8_GYP_ENV' not in os.environ: - # Update the environment based on v8.gyp_env - gyp_env_path = os.path.join(os.path.dirname(v8_root), 'v8.gyp_env') - apply_gyp_environment(gyp_env_path) + gyp_environment.set_environment() # This could give false positives since it doesn't actually do real option # parsing. Oh well. diff --git a/deps/v8/build/landmine_utils.py b/deps/v8/build/landmine_utils.py index e8b7c98d5fc6a3..cb3499132a3c2f 100644 --- a/deps/v8/build/landmine_utils.py +++ b/deps/v8/build/landmine_utils.py @@ -47,10 +47,19 @@ def gyp_defines(): return dict(arg.split('=', 1) for arg in shlex.split(os.environ.get('GYP_DEFINES', ''))) + +@memoize() +def gyp_generator_flags(): + """Parses and returns GYP_GENERATOR_FLAGS env var as a dictionary.""" + return dict(arg.split('=', 1) + for arg in shlex.split(os.environ.get('GYP_GENERATOR_FLAGS', ''))) + + @memoize() def gyp_msvs_version(): return os.environ.get('GYP_MSVS_VERSION', '') + @memoize() def distributor(): """ diff --git a/deps/v8/build/landmines.py b/deps/v8/build/landmines.py index bd1fb28f719c62..97c63901c1a904 100755 --- a/deps/v8/build/landmines.py +++ b/deps/v8/build/landmines.py @@ -4,10 +4,9 @@ # 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. +This script runs every build as the first hook (See DEPS). If it detects that +the build should be clobbered, it will delete the contents of the build +directory. 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 @@ -15,9 +14,13 @@ """ import difflib +import errno +import gyp_environment import logging import optparse import os +import re +import shutil import sys import subprocess import time @@ -28,46 +31,109 @@ SRC_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) -def get_target_build_dir(build_tool, target): +def get_build_dir(build_tool, is_iphone=False): """ 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' + r'c:\b\build\slave\win\build\src\out' + '/mnt/data/b/build/slave/linux/build/src/out' + '/b/build/slave/ios_rel_device/build/src/xcodebuild' 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) + ret = os.path.join(SRC_DIR, 'xcodebuild') elif build_tool in ['make', 'ninja', 'ninja-ios']: # TODO: Remove ninja-ios. - ret = os.path.join(SRC_DIR, 'out', target) + if 'CHROMIUM_OUT_DIR' in os.environ: + output_dir = os.environ.get('CHROMIUM_OUT_DIR').strip() + if not output_dir: + raise Error('CHROMIUM_OUT_DIR environment variable is set but blank!') + else: + output_dir = landmine_utils.gyp_generator_flags().get('output_dir', 'out') + ret = os.path.join(SRC_DIR, output_dir) elif build_tool in ['msvs', 'vs', 'ib']: - ret = os.path.join(SRC_DIR, 'build', target) + ret = os.path.join(SRC_DIR, 'build') 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): +def extract_gn_build_commands(build_ninja_file): + """Extracts from a build.ninja the commands to run GN. + + The commands to run GN are the gn rule and build.ninja build step at the + top of the build.ninja file. We want to keep these when deleting GN builds + since we want to preserve the command-line flags to GN. + + On error, returns the empty string.""" + result = "" + with open(build_ninja_file, 'r') as f: + # Read until the second blank line. The first thing GN writes to the file + # is the "rule gn" and the second is the section for "build build.ninja", + # separated by blank lines. + num_blank_lines = 0 + while num_blank_lines < 2: + line = f.readline() + if len(line) == 0: + return '' # Unexpected EOF. + result += line + if line[0] == '\n': + num_blank_lines = num_blank_lines + 1 + return result + +def delete_build_dir(build_dir): + # GN writes a build.ninja.d file. Note that not all GN builds have args.gn. + build_ninja_d_file = os.path.join(build_dir, 'build.ninja.d') + if not os.path.exists(build_ninja_d_file): + shutil.rmtree(build_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. + # GN builds aren't automatically regenerated when you sync. To avoid + # messing with the GN workflow, erase everything but the args file, and + # write a dummy build.ninja file that will automatically rerun GN the next + # time Ninja is run. + build_ninja_file = os.path.join(build_dir, 'build.ninja') + build_commands = extract_gn_build_commands(build_ninja_file) + + try: + gn_args_file = os.path.join(build_dir, 'args.gn') + with open(gn_args_file, 'r') as f: + args_contents = f.read() + except IOError: + args_contents = '' + + shutil.rmtree(build_dir) + + # Put back the args file (if any). + os.mkdir(build_dir) + if args_contents != '': + with open(gn_args_file, 'w') as f: + f.write(args_contents) + + # Write the build.ninja file sufficiently to regenerate itself. + with open(os.path.join(build_dir, 'build.ninja'), 'w') as f: + if build_commands != '': + f.write(build_commands) + else: + # Couldn't parse the build.ninja file, write a default thing. + f.write('''rule gn +command = gn -q gen //out/%s/ +description = Regenerating ninja files + +build build.ninja: gn +generator = 1 +depfile = build.ninja.d +''' % (os.path.split(build_dir)[1])) + + # Write a .d file for the build which references a nonexistant file. This + # will make Ninja always mark the build as dirty. + with open(build_ninja_d_file, 'w') as f: + f.write('build.ninja: nonexistant_file.gn\n') + + +def needs_clobber(landmines_path, new_landmines): 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: @@ -75,14 +141,54 @@ def set_up_landmines(target, new_landmines): diff = difflib.unified_diff(old_landmines, new_landmines, fromfile='old_landmines', tofile='new_landmines', fromfiledate=old_date, tofiledate=time.ctime(), n=0) + sys.stdout.write('Clobbering due to:\n') + sys.stdout.writelines(diff) + return True + else: + sys.stdout.write('Clobbering due to missing landmines file.\n') + return True + return False - 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 + +def clobber_if_necessary(new_landmines): + """Does the work of setting, planting, and triggering landmines.""" + out_dir = get_build_dir(landmine_utils.builder()) + landmines_path = os.path.normpath(os.path.join(out_dir, '..', '.landmines')) + try: + os.makedirs(out_dir) + except OSError as e: + if e.errno == errno.EEXIST: + pass + + if needs_clobber(landmines_path, new_landmines): + # Clobber contents of build directory but not directory itself: some + # checkouts have the build directory mounted. + for f in os.listdir(out_dir): + path = os.path.join(out_dir, f) + if os.path.basename(out_dir) == 'build': + # Only delete build directories and files for MSVS builds as the folder + # shares some checked out files and directories. + if (os.path.isdir(path) and + re.search(r'(?:[Rr]elease)|(?:[Dd]ebug)', f)): + delete_build_dir(path) + elif (os.path.isfile(path) and + (path.endswith('.sln') or + path.endswith('.vcxproj') or + path.endswith('.vcxproj.user'))): + os.unlink(path) + else: + if os.path.isfile(path): + os.unlink(path) + elif os.path.isdir(path): + delete_build_dir(path) + if os.path.basename(out_dir) == 'xcodebuild': + # Xcodebuild puts an additional project file structure into build, + # while the output folder is xcodebuild. + project_dir = os.path.join(SRC_DIR, 'build', 'all.xcodeproj') + if os.path.exists(project_dir) and os.path.isdir(project_dir): + delete_build_dir(project_dir) + + # Save current set of landmines for next time. with open(landmines_path, 'w') as f: f.writelines(new_landmines) @@ -123,14 +229,14 @@ def main(): if landmine_utils.builder() in ('dump_dependency_json', 'eclipse'): return 0 + gyp_environment.set_environment() + 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) + clobber_if_necessary(landmines) return 0 diff --git a/deps/v8/build/standalone.gypi b/deps/v8/build/standalone.gypi index 56cebbe1f3fd27..7c967206734d77 100644 --- a/deps/v8/build/standalone.gypi +++ b/deps/v8/build/standalone.gypi @@ -35,12 +35,17 @@ 'component%': 'static_library', 'clang_dir%': 'third_party/llvm-build/Release+Asserts', 'clang_xcode%': 0, + # Track where uninitialized memory originates from. From fastest to + # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2 + # - track the chain of stores leading from allocation site to use site. + 'msan_track_origins%': 1, 'visibility%': 'hidden', 'v8_enable_backtrace%': 0, 'v8_enable_i18n_support%': 1, 'v8_deprecation_warnings': 1, 'msvs_multi_core_compile%': '1', 'mac_deployment_target%': '10.5', + 'release_extra_cflags%': '', 'variables': { 'variables': { 'variables': { @@ -65,6 +70,10 @@ 'host_arch%': '<(host_arch)', 'target_arch%': '<(target_arch)', 'v8_target_arch%': '<(target_arch)', + 'asan%': 0, + 'lsan%': 0, + 'msan%': 0, + 'tsan%': 0, # goma settings. # 1 to use goma. @@ -86,6 +95,10 @@ 'werror%': '-Werror', 'use_goma%': '<(use_goma)', 'gomadir%': '<(gomadir)', + 'asan%': '<(asan)', + 'lsan%': '<(lsan)', + 'msan%': '<(msan)', + 'tsan%': '<(tsan)', # .gyp files or targets should set v8_code to 1 if they build V8 specific # code, as opposed to external code. This variable is used to control such @@ -146,11 +159,21 @@ }, { 'v8_enable_gdbjit%': 0, }], - ['(OS=="linux" or OS=="mac") and (target_arch=="ia32" or target_arch=="x64")', { + ['(OS=="linux" or OS=="mac") and (target_arch=="ia32" or target_arch=="x64") and \ + (v8_target_arch!="x87")', { 'clang%': 1, }, { 'clang%': 0, }], + ['host_arch!="ppc" and host_arch!="ppc64" and host_arch!="ppc64le"', { + 'host_clang%': '1', + }, { + 'host_clang%': '0', + }], + ['asan==1 or lsan==1 or msan==1 or tsan==1', { + 'clang%': 1, + 'use_allocator%': 'none', + }], ], # Default ARM variable settings. 'arm_version%': 'default', @@ -175,16 +198,11 @@ 'default_configuration': 'Debug', 'configurations': { 'DebugBaseCommon': { - 'cflags': [ '-g', '-O0' ], 'conditions': [ - ['(v8_target_arch=="ia32" or v8_target_arch=="x87") and \ - OS=="linux"', { - 'defines': [ - '_GLIBCXX_DEBUG' - ], - }], - [ 'OS=="aix"', { - 'cflags': [ '-gxcoff' ], + ['OS=="aix"', { + 'cflags': [ '-g', '-Og', '-gxcoff' ], + }, { + 'cflags': [ '-g', '-O0' ], }], ], }, @@ -195,9 +213,22 @@ # Xcode insists on this empty entry. }, 'Release': { - # Xcode insists on this empty entry. + 'cflags+': ['<@(release_extra_cflags)'], }, }, + 'conditions':[ + ['(clang==1 or host_clang==1) and OS!="win"', { + # This is here so that all files get recompiled after a clang roll and + # when turning clang on or off. + # (defines are passed via the command line, and build systems rebuild + # things when their commandline changes). Nothing should ever read this + # define. + 'defines': ['CR_CLANG_REVISION= Call(v8::Handle fun, - Handle data = Handle()); + static V8_DEPRECATE_SOON( + "Use maybe version", + Local Call(v8::Handle fun, + Handle data = Handle())); + // TODO(dcarney): data arg should be a MaybeLocal + static MaybeLocal Call(Local context, + v8::Handle fun, + Handle data = Handle()); /** * Returns a mirror object for the given object. */ - static Local GetMirror(v8::Handle obj); + static V8_DEPRECATE_SOON("Use maybe version", + Local GetMirror(v8::Handle obj)); + static MaybeLocal GetMirror(Local context, + v8::Handle obj); /** * Makes V8 process all pending debug messages. diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index d0215205f5fa97..82a14d66003001 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -5,6 +5,7 @@ #ifndef V8_V8_PROFILER_H_ #define V8_V8_PROFILER_H_ +#include #include "v8.h" /** @@ -17,6 +18,34 @@ struct HeapStatsUpdate; typedef uint32_t SnapshotObjectId; + +struct CpuProfileDeoptFrame { + int script_id; + size_t position; +}; + +} // namespace v8 + +#ifdef V8_OS_WIN +template class V8_EXPORT std::vector; +#endif + +namespace v8 { + +struct V8_EXPORT CpuProfileDeoptInfo { + /** A pointer to a static string owned by v8. */ + const char* deopt_reason; + std::vector stack; +}; + +} // namespace v8 + +#ifdef V8_OS_WIN +template class V8_EXPORT std::vector; +#endif + +namespace v8 { + /** * CpuProfileNode represents a node in a call graph. */ @@ -85,6 +114,9 @@ class V8_EXPORT CpuProfileNode { /** Retrieves a child node by index. */ const CpuProfileNode* GetChild(int index) const; + /** Retrieves deopt infos for the node. */ + const std::vector& GetDeoptInfos() const; + static const int kNoLineNumberInfo = Message::kNoLineNumberInfo; static const int kNoColumnNumberInfo = Message::kNoColumnInfo; }; @@ -168,21 +200,12 @@ class V8_EXPORT CpuProfiler { */ void StartProfiling(Handle title, bool record_samples = false); - /** Deprecated. Use StartProfiling instead. */ - V8_DEPRECATED("Use StartProfiling", - void StartCpuProfiling(Handle title, - bool record_samples = false)); - /** * Stops collecting CPU profile with a given title and returns it. * If the title given is empty, finishes the last profile started. */ CpuProfile* StopProfiling(Handle title); - /** Deprecated. Use StopProfiling instead. */ - V8_DEPRECATED("Use StopProfiling", - const CpuProfile* StopCpuProfiling(Handle title)); - /** * Tells the profiler whether the embedder is idle. */ @@ -271,10 +294,6 @@ class V8_EXPORT HeapGraphNode { */ SnapshotObjectId GetId() const; - /** Returns node's own size, in bytes. */ - V8_DEPRECATED("Use GetShallowSize instead", - int GetSelfSize() const); - /** Returns node's own size, in bytes. */ size_t GetShallowSize() const; @@ -326,12 +345,6 @@ class V8_EXPORT HeapSnapshot { kJSON = 0 // See format description near 'Serialize' method. }; - /** Returns heap snapshot UID (assigned by the profiler.) */ - unsigned GetUid() const; - - /** Returns heap snapshot title. */ - Handle GetTitle() const; - /** Returns the root node of the heap graph. */ const HeapGraphNode* GetRoot() const; @@ -380,7 +393,8 @@ class V8_EXPORT HeapSnapshot { * Nodes reference strings, other nodes, and edges by their indexes * in corresponding arrays. */ - void Serialize(OutputStream* stream, SerializationFormat format) const; + void Serialize(OutputStream* stream, + SerializationFormat format = kJSON) const; }; @@ -465,10 +479,9 @@ class V8_EXPORT HeapProfiler { }; /** - * Takes a heap snapshot and returns it. Title may be an empty string. + * Takes a heap snapshot and returns it. */ const HeapSnapshot* TakeHeapSnapshot( - Handle title, ActivityControl* control = NULL, ObjectNameResolver* global_object_name_resolver = NULL); @@ -490,17 +503,19 @@ class V8_EXPORT HeapProfiler { * reports updates for all previous time intervals via the OutputStream * object. Updates on each time interval are provided as a stream of the * HeapStatsUpdate structure instances. - * The return value of the function is the last seen heap object Id. + * If |timestamp_us| is supplied, timestamp of the new entry will be written + * into it. The return value of the function is the last seen heap object Id. * * StartTrackingHeapObjects must be called before the first call to this * method. */ - SnapshotObjectId GetHeapStats(OutputStream* stream); + SnapshotObjectId GetHeapStats(OutputStream* stream, + int64_t* timestamp_us = NULL); /** * Stops tracking of heap objects population statistics, cleans up all * collected data. StartHeapObjectsTracking must be called again prior to - * calling PushHeapObjectsStats next time. + * calling GetHeapStats next time. */ void StopTrackingHeapObjects(); diff --git a/deps/v8/include/v8-util.h b/deps/v8/include/v8-util.h index ca36b6c58bcf0c..6454a19b7e4fe1 100644 --- a/deps/v8/include/v8-util.h +++ b/deps/v8/include/v8-util.h @@ -12,7 +12,7 @@ /** * Support for Persistent containers. * - * C++11 embedders can use STL containers with UniquePersistent values, + * C++11 embedders can use STL containers with Global values, * but pre-C++11 does not support the required move semantic and hence * may want these container classes. */ @@ -22,7 +22,10 @@ typedef uintptr_t PersistentContainerValue; static const uintptr_t kPersistentContainerNotFound = 0; enum PersistentContainerCallbackType { kNotWeak, - kWeak + // These correspond to v8::WeakCallbackType + kWeakWithParameter, + kWeakWithInternalFields, + kWeak = kWeakWithParameter // For backwards compatibility. Deprecate. }; @@ -101,12 +104,12 @@ class DefaultPersistentValueMapTraits : public StdMapTraits { return K(); } static void DisposeCallbackData(WeakCallbackDataType* data) { } - static void Dispose(Isolate* isolate, UniquePersistent value, K key) { } + static void Dispose(Isolate* isolate, Global value, K key) {} }; template -class DefaultPhantomPersistentValueMapTraits : public StdMapTraits { +class DefaultGlobalMapTraits : public StdMapTraits { private: template struct RemovePointer; @@ -114,25 +117,25 @@ class DefaultPhantomPersistentValueMapTraits : public StdMapTraits { public: // Weak callback & friends: static const PersistentContainerCallbackType kCallbackType = kNotWeak; - typedef PersistentValueMap< - K, V, DefaultPhantomPersistentValueMapTraits > MapType; - typedef void PhantomCallbackDataType; + typedef GlobalValueMap > MapType; + typedef void WeakCallbackDataType; - static PhantomCallbackDataType* PhantomCallbackParameter(MapType* map, - const K& key, - Local value) { - return NULL; + static WeakCallbackDataType* WeakCallbackParameter(MapType* map, const K& key, + Local value) { + return nullptr; } - static MapType* MapFromPhantomCallbackData( - const PhantomCallbackData& data) { - return NULL; + static MapType* MapFromWeakCallbackInfo( + const WeakCallbackInfo& data) { + return nullptr; } - static K KeyFromPhantomCallbackData( - const PhantomCallbackData& data) { + static K KeyFromWeakCallbackInfo( + const WeakCallbackInfo& data) { return K(); } - static void DisposeCallbackData(PhantomCallbackDataType* data) {} - static void Dispose(Isolate* isolate, UniquePersistent value, K key) {} + static void DisposeCallbackData(WeakCallbackDataType* data) {} + static void Dispose(Isolate* isolate, Global value, K key) {} + // This is a second pass callback, so SetSecondPassCallback cannot be called. + static void DisposeWeak(const WeakCallbackInfo& data) {} private: template @@ -143,8 +146,8 @@ class DefaultPhantomPersistentValueMapTraits : public StdMapTraits { /** - * A map wrapper that allows using UniquePersistent as a mapped value. - * C++11 embedders don't need this class, as they can use UniquePersistent + * A map wrapper that allows using Global as a mapped value. + * C++11 embedders don't need this class, as they can use Global * directly in std containers. * * The map relies on a backing map, whose type and accessors are described @@ -203,7 +206,7 @@ class PersistentValueMapBase { /** * Return value for key and remove it from the map. */ - UniquePersistent Remove(const K& key) { + Global Remove(const K& key) { return Release(Traits::Remove(&impl_, key)).Pass(); } @@ -255,7 +258,7 @@ class PersistentValueMapBase { private: friend class PersistentValueMapBase; friend class PersistentValueMap; - friend class PhantomPersistentValueMap; + friend class GlobalValueMap; explicit PersistentValueReference(PersistentContainerValue value) : value_(value) { } @@ -293,24 +296,23 @@ class PersistentValueMapBase { return reinterpret_cast(v); } - static PersistentContainerValue ClearAndLeak( - UniquePersistent* persistent) { + static PersistentContainerValue ClearAndLeak(Global* persistent) { V* v = persistent->val_; persistent->val_ = 0; return reinterpret_cast(v); } - static PersistentContainerValue Leak(UniquePersistent* persistent) { + static PersistentContainerValue Leak(Global* persistent) { return reinterpret_cast(persistent->val_); } /** - * Return a container value as UniquePersistent and make sure the weak + * Return a container value as Global and make sure the weak * callback is properly disposed of. All remove functionality should go * through this. */ - static UniquePersistent Release(PersistentContainerValue v) { - UniquePersistent p; + static Global Release(PersistentContainerValue v) { + Global p; p.val_ = FromVal(v); if (Traits::kCallbackType != kNotWeak && p.IsWeak()) { Traits::DisposeCallbackData( @@ -319,6 +321,12 @@ class PersistentValueMapBase { return p.Pass(); } + void RemoveWeak(const K& key) { + Global p; + p.val_ = FromVal(Traits::Remove(&impl_, key)); + p.Reset(); + } + private: PersistentValueMapBase(PersistentValueMapBase&); void operator=(PersistentValueMapBase&); @@ -351,17 +359,17 @@ class PersistentValueMap : public PersistentValueMapBase { /** * Put value into map. Depending on Traits::kIsWeak, the value will be held * by the map strongly or weakly. - * Returns old value as UniquePersistent. + * Returns old value as Global. */ - UniquePersistent Set(const K& key, Local value) { - UniquePersistent persistent(this->isolate(), value); + Global Set(const K& key, Local value) { + Global persistent(this->isolate(), value); return SetUnique(key, &persistent); } /** * Put value into map, like Set(const K&, Local). */ - UniquePersistent Set(const K& key, UniquePersistent value) { + Global Set(const K& key, Global value) { return SetUnique(key, &value); } @@ -369,7 +377,7 @@ class PersistentValueMap : public PersistentValueMapBase { * Put the value into the map, and set the 'weak' callback when demanded * by the Traits class. */ - UniquePersistent SetUnique(const K& key, UniquePersistent* persistent) { + Global SetUnique(const K& key, Global* persistent) { if (Traits::kCallbackType != kNotWeak) { Local value(Local::New(this->isolate(), *persistent)); persistent->template SetWeak( @@ -384,8 +392,8 @@ class PersistentValueMap : public PersistentValueMapBase { * 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) { + Global Set(const K& key, Global value, + PersistentValueReference* reference) { *reference = this->Leak(&value); return SetUnique(key, &value); } @@ -406,9 +414,9 @@ class PersistentValueMap : public PersistentValueMapBase { template -class PhantomPersistentValueMap : public PersistentValueMapBase { +class GlobalValueMap : public PersistentValueMapBase { public: - explicit PhantomPersistentValueMap(Isolate* isolate) + explicit GlobalValueMap(Isolate* isolate) : PersistentValueMapBase(isolate) {} typedef @@ -418,17 +426,17 @@ class PhantomPersistentValueMap : public PersistentValueMapBase { /** * Put value into map. Depending on Traits::kIsWeak, the value will be held * by the map strongly or weakly. - * Returns old value as UniquePersistent. + * Returns old value as Global. */ - UniquePersistent Set(const K& key, Local value) { - UniquePersistent persistent(this->isolate(), value); + Global Set(const K& key, Local value) { + Global persistent(this->isolate(), value); return SetUnique(key, &persistent); } /** * Put value into map, like Set(const K&, Local). */ - UniquePersistent Set(const K& key, UniquePersistent value) { + Global Set(const K& key, Global value) { return SetUnique(key, &value); } @@ -436,11 +444,16 @@ class PhantomPersistentValueMap : public PersistentValueMapBase { * Put the value into the map, and set the 'weak' callback when demanded * by the Traits class. */ - UniquePersistent SetUnique(const K& key, UniquePersistent* persistent) { + Global SetUnique(const K& key, Global* persistent) { if (Traits::kCallbackType != kNotWeak) { + WeakCallbackType callback_type = + Traits::kCallbackType == kWeakWithInternalFields + ? WeakCallbackType::kInternalFields + : WeakCallbackType::kParameter; Local value(Local::New(this->isolate(), *persistent)); - persistent->template SetPhantom( - Traits::WeakCallbackParameter(this, key, value), WeakCallback, 0, 1); + persistent->template SetWeak( + Traits::WeakCallbackParameter(this, key, value), FirstWeakCallback, + callback_type); } PersistentContainerValue old_value = Traits::Set(this->impl(), key, this->ClearAndLeak(persistent)); @@ -451,33 +464,36 @@ class PhantomPersistentValueMap : public PersistentValueMapBase { * 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) { + Global Set(const K& key, Global value, + PersistentValueReference* reference) { *reference = this->Leak(&value); return SetUnique(key, &value); } private: - static void WeakCallback( - const PhantomCallbackData& data) { + static void FirstWeakCallback( + const WeakCallbackInfo& 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()); + auto map = Traits::MapFromWeakCallbackInfo(data); + K key = Traits::KeyFromWeakCallbackInfo(data); + map->RemoveWeak(key); + data.SetSecondPassCallback(SecondWeakCallback); } } + + static void SecondWeakCallback( + const WeakCallbackInfo& data) { + Traits::DisposeWeak(data); + } }; /** - * A map that uses UniquePersistent as value and std::map as the backing + * A map that uses Global as value and std::map as the backing * implementation. Persistents are held non-weak. * * C++11 embedders don't need this class, as they can use - * UniquePersistent directly in std containers. + * Global directly in std containers. */ template > @@ -488,6 +504,22 @@ class StdPersistentValueMap : public PersistentValueMap { }; +/** + * A map that uses Global as value and std::map as the backing + * implementation. Globals are held non-weak. + * + * C++11 embedders don't need this class, as they can use + * Global directly in std containers. + */ +template > +class StdGlobalValueMap : public GlobalValueMap { + public: + explicit StdGlobalValueMap(Isolate* isolate) + : GlobalValueMap(isolate) {} +}; + + class DefaultPersistentValueVectorTraits { public: typedef std::vector Impl; @@ -514,8 +546,8 @@ class DefaultPersistentValueVectorTraits { /** - * A vector wrapper that safely stores UniquePersistent values. - * C++11 embedders don't need this class, as they can use UniquePersistent + * A vector wrapper that safely stores Global values. + * C++11 embedders don't need this class, as they can use Global * directly in std containers. * * This class relies on a backing vector implementation, whose type and methods @@ -536,14 +568,14 @@ class PersistentValueVector { * Append a value to the vector. */ void Append(Local value) { - UniquePersistent persistent(isolate_, value); + Global persistent(isolate_, value); Traits::Append(&impl_, ClearAndLeak(&persistent)); } /** * Append a persistent's value to the vector. */ - void Append(UniquePersistent persistent) { + void Append(Global persistent) { Traits::Append(&impl_, ClearAndLeak(&persistent)); } @@ -574,7 +606,7 @@ class PersistentValueVector { void Clear() { size_t length = Traits::Size(&impl_); for (size_t i = 0; i < length; i++) { - UniquePersistent p; + Global p; p.val_ = FromVal(Traits::Get(&impl_, i)); } Traits::Clear(&impl_); @@ -589,8 +621,7 @@ class PersistentValueVector { } private: - static PersistentContainerValue ClearAndLeak( - UniquePersistent* persistent) { + static PersistentContainerValue ClearAndLeak(Global* persistent) { V* v = persistent->val_; persistent->val_ = 0; return reinterpret_cast(v); @@ -606,4 +637,4 @@ class PersistentValueVector { } // namespace v8 -#endif // V8_UTIL_H_ +#endif // V8_UTIL_H diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index f10bf50780a9cb..2f2ea5533387d0 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 2 -#define V8_BUILD_NUMBER 77 -#define V8_PATCH_LEVEL 20 +#define V8_MINOR_VERSION 4 +#define V8_BUILD_NUMBER 63 +#define V8_PATCH_LEVEL 12 // 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 e325fd6d752e73..910279b52e6b29 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -81,6 +81,8 @@ class ImplementationUtilities; class Int32; class Integer; class Isolate; +template +class Maybe; class Name; class Number; class NumberObject; @@ -93,6 +95,7 @@ class Promise; class RawOperationDescriptor; class Script; class Signature; +class StartupData; class StackFrame; class StackTrace; class String; @@ -103,19 +106,21 @@ class Private; class Uint32; class Utils; class Value; -template class Handle; template class Local; +template +class MaybeLocal; template class Eternal; template class NonCopyablePersistentTraits; template class PersistentBase; template > class Persistent; -template class UniquePersistent; +template +class Global; template class PersistentValueMap; template class PersistentValueMapBase; template -class PhantomPersistentValueMap; +class GlobalValueMap; template class PersistentValueVector; template class WeakCallbackObject; class FunctionTemplate; @@ -141,20 +146,6 @@ template class CustomArguments; class PropertyCallbackArguments; class FunctionCallbackArguments; class GlobalHandles; - -template -class CallbackData { - public: - V8_INLINE v8::Isolate* GetIsolate() const { return 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_; -}; } @@ -211,28 +202,16 @@ class UniqueId { * * It is safe to extract the object stored in the handle by * dereferencing the handle (for instance, to extract the Object* from - * a Handle); the value will still be governed by a handle + * a Local); the value will still be governed by a handle * behind the scenes and the same rules apply to these values as to * their handles. */ -template class Handle { +template +class Local { public: - /** - * Creates an empty handle. - */ - V8_INLINE Handle() : val_(0) {} - - /** - * Creates a handle for the contents of the specified handle. This - * constructor allows you to pass handles as arguments by value and - * to assign between handles. However, if you try to assign between - * incompatible handles, for instance from a Handle to a - * Handle it will cause a compile-time error. Assigning - * between compatible handles, for instance assigning a - * Handle to a variable declared as Handle, is legal - * because String is a subclass of Value. - */ - template V8_INLINE Handle(Handle that) + V8_INLINE Local() : val_(0) {} + template + V8_INLINE Local(Local that) : val_(reinterpret_cast(*that)) { /** * This check fails when trying to convert between incompatible @@ -262,7 +241,8 @@ template class Handle { * to which they refer are identical. * The handles' references are not checked. */ - template V8_INLINE bool operator==(const Handle& that) const { + template + V8_INLINE bool operator==(const Local& that) const { internal::Object** a = reinterpret_cast(this->val_); internal::Object** b = reinterpret_cast(that.val_); if (a == 0) return b == 0; @@ -285,7 +265,8 @@ template class Handle { * the objects to which they refer are different. * The handles' references are not checked. */ - template V8_INLINE bool operator!=(const Handle& that) const { + template + V8_INLINE bool operator!=(const Local& that) const { return !operator==(that); } @@ -294,77 +275,6 @@ template class Handle { return !operator==(that); } - template V8_INLINE static Handle Cast(Handle that) { -#ifdef V8_ENABLE_CHECKS - // If we're going to perform the type check then we have to check - // that the handle isn't empty before doing the checked cast. - if (that.IsEmpty()) return Handle(); -#endif - return Handle(T::Cast(*that)); - } - - template V8_INLINE Handle As() { - return Handle::Cast(*this); - } - - V8_INLINE static Handle New(Isolate* isolate, Handle that) { - return New(isolate, that.val_); - } - V8_INLINE static Handle New(Isolate* isolate, - const PersistentBase& that) { - return New(isolate, that.val_); - } - - private: - friend class Utils; - template friend class Persistent; - template friend class PersistentBase; - template friend class Handle; - template friend class Local; - template friend class FunctionCallbackInfo; - template friend class PropertyCallbackInfo; - template friend class internal::CustomArguments; - friend Handle Undefined(Isolate* isolate); - friend Handle Null(Isolate* isolate); - friend Handle True(Isolate* isolate); - friend Handle False(Isolate* isolate); - friend class Context; - friend class HandleScope; - friend class Object; - friend class Private; - - /** - * Creates a new handle for the specified value. - */ - V8_INLINE explicit Handle(T* val) : val_(val) {} - - V8_INLINE static Handle New(Isolate* isolate, T* that); - - T* val_; -}; - - -/** - * A light-weight stack-allocated object handle. All operations - * that return objects from within v8 return them in local handles. They - * are created within HandleScopes, and all local handles allocated within a - * handle scope are destroyed when the handle scope is destroyed. Hence it - * is not necessary to explicitly deallocate local handles. - */ -template class Local : public Handle { - public: - V8_INLINE Local(); - template V8_INLINE Local(Local that) - : Handle(reinterpret_cast(*that)) { - /** - * This check fails when trying to convert between incompatible - * handles. For example, converting from a Handle to a - * Handle. - */ - TYPE_CHECK(T, S); - } - - template V8_INLINE static Local Cast(Local that) { #ifdef V8_ENABLE_CHECKS // If we're going to perform the type check then we have to check @@ -373,10 +283,7 @@ template class Local : public Handle { #endif return Local(T::Cast(*that)); } - template V8_INLINE Local(Handle that) - : Handle(reinterpret_cast(*that)) { - TYPE_CHECK(T, S); - } + template V8_INLINE Local As() { return Local::Cast(*this); @@ -387,7 +294,7 @@ template class Local : public Handle { * The referee is kept alive by the local handle even when * the original handle is destroyed/disposed. */ - V8_INLINE static Local New(Isolate* isolate, Handle that); + V8_INLINE static Local New(Isolate* isolate, Local that); V8_INLINE static Local New(Isolate* isolate, const PersistentBase& that); @@ -396,22 +303,77 @@ template class Local : public Handle { template friend class Eternal; template friend class PersistentBase; template friend class Persistent; - template friend class Handle; template friend class Local; + template + friend class MaybeLocal; template friend class FunctionCallbackInfo; template friend class PropertyCallbackInfo; friend class String; friend class Object; friend class Context; + friend class Private; template friend class internal::CustomArguments; + friend Local Undefined(Isolate* isolate); + friend Local Null(Isolate* isolate); + friend Local True(Isolate* isolate); + friend Local False(Isolate* isolate); friend class HandleScope; friend class EscapableHandleScope; template friend class PersistentValueMapBase; template friend class PersistentValueVector; - template V8_INLINE Local(S* that) : Handle(that) { } + template + V8_INLINE Local(S* that) + : val_(that) {} V8_INLINE static Local New(Isolate* isolate, T* that); + T* val_; +}; + + +// Handle is an alias for Local for historical reasons. +template +using Handle = Local; + + +/** + * A MaybeLocal<> is a wrapper around Local<> that enforces a check whether + * the Local<> is empty before it can be used. + * + * If an API method returns a MaybeLocal<>, the API method can potentially fail + * either because an exception is thrown, or because an exception is pending, + * e.g. because a previous API call threw an exception that hasn't been caught + * yet, or because a TerminateExecution exception was thrown. In that case, an + * empty MaybeLocal is returned. + */ +template +class MaybeLocal { + public: + V8_INLINE MaybeLocal() : val_(nullptr) {} + template + V8_INLINE MaybeLocal(Local that) + : val_(reinterpret_cast(*that)) { + TYPE_CHECK(T, S); + } + + V8_INLINE bool IsEmpty() const { return val_ == nullptr; } + + template + V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local* out) const { + out->val_ = IsEmpty() ? nullptr : this->val_; + return !IsEmpty(); + } + + // Will crash if the MaybeLocal<> is empty. + V8_INLINE Local ToLocalChecked(); + + template + V8_INLINE Local FromMaybe(Local default_value) const { + return IsEmpty() ? default_value : Local(val_); + } + + private: + T* val_; }; @@ -434,42 +396,79 @@ template class Eternal { }; +static const int kInternalFieldsInWeakCallback = 2; + + template -class PhantomCallbackData : public internal::CallbackData { +class WeakCallbackInfo { public: - typedef void (*Callback)(const PhantomCallbackData& data); + typedef void (*Callback)(const WeakCallbackInfo& data); + + WeakCallbackInfo(Isolate* isolate, T* parameter, + void* internal_fields[kInternalFieldsInWeakCallback], + Callback* callback) + : isolate_(isolate), parameter_(parameter), callback_(callback) { + for (int i = 0; i < kInternalFieldsInWeakCallback; ++i) { + internal_fields_[i] = internal_fields[i]; + } + } + + V8_INLINE Isolate* GetIsolate() const { return isolate_; } + V8_INLINE T* GetParameter() const { return parameter_; } + V8_INLINE void* GetInternalField(int index) const; + + V8_INLINE V8_DEPRECATE_SOON("use indexed version", + void* GetInternalField1()) const { + return internal_fields_[0]; + } + V8_INLINE V8_DEPRECATE_SOON("use indexed version", + void* GetInternalField2()) const { + return internal_fields_[1]; + } - V8_INLINE void* GetInternalField1() const { return internal_field1_; } - V8_INLINE void* GetInternalField2() const { return internal_field2_; } + bool IsFirstPass() const { return callback_ != nullptr; } - PhantomCallbackData(Isolate* isolate, T* parameter, void* internal_field1, - void* internal_field2) - : internal::CallbackData(isolate, parameter), - internal_field1_(internal_field1), - internal_field2_(internal_field2) {} + // When first called, the embedder MUST Reset() the Global which triggered the + // callback. The Global itself is unusable for anything else. No v8 other api + // calls may be called in the first callback. Should additional work be + // required, the embedder must set a second pass callback, which will be + // called after all the initial callbacks are processed. + // Calling SetSecondPassCallback on the second pass will immediately crash. + void SetSecondPassCallback(Callback callback) const { *callback_ = callback; } private: - void* internal_field1_; - void* internal_field2_; + Isolate* isolate_; + T* parameter_; + Callback* callback_; + void* internal_fields_[kInternalFieldsInWeakCallback]; }; template -class WeakCallbackData : public internal::CallbackData

{ +class WeakCallbackData { public: typedef void (*Callback)(const WeakCallbackData& data); + WeakCallbackData(Isolate* isolate, P* parameter, Local handle) + : isolate_(isolate), parameter_(parameter), handle_(handle) {} + + V8_INLINE Isolate* GetIsolate() const { return isolate_; } + V8_INLINE P* GetParameter() const { return parameter_; } V8_INLINE Local GetValue() const { return handle_; } private: - friend class internal::GlobalHandles; - WeakCallbackData(Isolate* isolate, P* parameter, Local handle) - : internal::CallbackData

(isolate, parameter), handle_(handle) {} + Isolate* isolate_; + P* parameter_; Local handle_; }; -static const int kNoInternalFieldIndex = -1; +// TODO(dcarney): delete this with WeakCallbackData +template +using PhantomCallbackData = WeakCallbackInfo; + + +enum class WeakCallbackType { kParameter, kInternalFields }; /** @@ -542,15 +541,17 @@ template class PersistentBase { * As always, GC-based finalization should *not* be relied upon for any * critical form of resource management! */ - template - V8_INLINE void SetWeak( - P* parameter, - typename WeakCallbackData::Callback callback); + template + V8_INLINE V8_DEPRECATE_SOON( + "use WeakCallbackInfo version", + void SetWeak(P* parameter, + typename WeakCallbackData::Callback callback)); - template - V8_INLINE void SetWeak( - P* parameter, - typename WeakCallbackData::Callback callback); + template + V8_INLINE V8_DEPRECATE_SOON( + "use WeakCallbackInfo version", + void SetWeak(P* parameter, + typename WeakCallbackData::Callback callback)); // Phantom persistents work like weak persistents, except that the pointer to // the object being collected is not available in the finalization callback. @@ -559,10 +560,17 @@ template class PersistentBase { // specify a parameter for the callback or the location of two internal // fields in the dying object. template - V8_INLINE void SetPhantom(P* parameter, - typename PhantomCallbackData

::Callback callback, - int internal_field_index1 = kNoInternalFieldIndex, - int internal_field_index2 = kNoInternalFieldIndex); + V8_INLINE V8_DEPRECATE_SOON( + "use SetWeak", + void SetPhantom(P* parameter, + typename WeakCallbackInfo

::Callback callback, + int internal_field_index1 = -1, + int internal_field_index2 = -1)); + + template + V8_INLINE void SetWeak(P* parameter, + typename WeakCallbackInfo

::Callback callback, + WeakCallbackType type); template V8_INLINE P* ClearWeak(); @@ -611,10 +619,10 @@ template class PersistentBase { private: friend class Isolate; friend class Utils; - template friend class Handle; template friend class Local; template friend class Persistent; - template friend class UniquePersistent; + template + friend class Global; template friend class PersistentBase; template friend class ReturnValue; template @@ -623,8 +631,8 @@ template class PersistentBase { friend class Object; explicit V8_INLINE PersistentBase(T* val) : val_(val) {} - PersistentBase(PersistentBase& other); // NOLINT - void operator=(PersistentBase&); + PersistentBase(PersistentBase& other) = delete; // NOLINT + void operator=(PersistentBase&) = delete; V8_INLINE static T* New(Isolate* isolate, T* that); T* val_; @@ -753,7 +761,6 @@ template class Persistent : public PersistentBase { private: friend class Isolate; friend class Utils; - template friend class Handle; template friend class Local; template friend class Persistent; template friend class ReturnValue; @@ -770,72 +777,74 @@ template class Persistent : public PersistentBase { * * Note: Persistent class hierarchy is subject to future changes. */ -template -class UniquePersistent : public PersistentBase { - struct RValue { - V8_INLINE explicit RValue(UniquePersistent* obj) : object(obj) {} - UniquePersistent* object; - }; - +template +class Global : public PersistentBase { public: /** - * A UniquePersistent with no storage cell. + * A Global with no storage cell. */ - V8_INLINE UniquePersistent() : PersistentBase(0) { } + V8_INLINE Global() : PersistentBase(nullptr) {} /** - * Construct a UniquePersistent from a Handle. + * Construct a Global from a Handle. * When the Handle is non-empty, a new storage cell is created * pointing to the same object, and no flags are set. */ template - V8_INLINE UniquePersistent(Isolate* isolate, Handle that) + V8_INLINE Global(Isolate* isolate, Handle that) : PersistentBase(PersistentBase::New(isolate, *that)) { TYPE_CHECK(T, S); } /** - * Construct a UniquePersistent from a PersistentBase. + * Construct a Global from a PersistentBase. * When the Persistent is non-empty, a new storage cell is created * pointing to the same object, and no flags are set. */ template - V8_INLINE UniquePersistent(Isolate* isolate, const PersistentBase& that) - : PersistentBase(PersistentBase::New(isolate, that.val_)) { + V8_INLINE Global(Isolate* isolate, const PersistentBase& that) + : PersistentBase(PersistentBase::New(isolate, that.val_)) { TYPE_CHECK(T, S); } /** * Move constructor. */ - V8_INLINE UniquePersistent(RValue rvalue) - : PersistentBase(rvalue.object->val_) { - rvalue.object->val_ = 0; + V8_INLINE Global(Global&& other) : PersistentBase(other.val_) { + other.val_ = nullptr; } - V8_INLINE ~UniquePersistent() { this->Reset(); } + V8_INLINE ~Global() { this->Reset(); } /** * Move via assignment. */ - template - V8_INLINE UniquePersistent& operator=(UniquePersistent rhs) { + template + V8_INLINE Global& operator=(Global&& rhs) { TYPE_CHECK(T, S); - this->Reset(); - this->val_ = rhs.val_; - rhs.val_ = 0; + if (this != &rhs) { + this->Reset(); + this->val_ = rhs.val_; + rhs.val_ = nullptr; + } return *this; } - /** - * Cast operator for moves. - */ - V8_INLINE operator RValue() { return RValue(this); } /** * Pass allows returning uniques from functions, etc. */ - UniquePersistent Pass() { return UniquePersistent(RValue(this)); } + Global Pass() { return static_cast(*this); } + + /* + * For compatibility with Chromium's base::Bind (base::Passed). + */ + typedef void MoveOnlyTypeForCPP03; private: - UniquePersistent(UniquePersistent&); - void operator=(UniquePersistent&); + Global(Global&) = delete; + void operator=(Global&) = delete; }; +// UniquePersistent is an alias for Global for historical reason. +template +using UniquePersistent = Global; + + /** * A stack-allocated class that governs a number of local handles. * After a handle scope has been created, all local handles will be @@ -951,28 +960,6 @@ class V8_EXPORT SealHandleScope { }; -/** - * A simple Maybe type, representing an object which may or may not have a - * value. - */ -template -struct Maybe { - Maybe() : has_value(false) {} - explicit Maybe(T t) : has_value(true), value(t) {} - Maybe(bool has, T t) : has_value(has), value(t) {} - - bool has_value; - T value; -}; - - -// Convenience wrapper. -template -inline Maybe maybe(T t) { - return Maybe(t); -} - - // --- Special objects --- @@ -996,13 +983,15 @@ class ScriptOrigin { Handle resource_column_offset = Handle(), Handle resource_is_shared_cross_origin = Handle(), Handle script_id = Handle(), - Handle resource_is_embedder_debug_script = Handle()) + Handle resource_is_embedder_debug_script = Handle(), + Handle source_map_url = 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), + source_map_url_(source_map_url) {} V8_INLINE Handle ResourceName() const; V8_INLINE Handle ResourceLineOffset() const; V8_INLINE Handle ResourceColumnOffset() const; @@ -1012,6 +1001,7 @@ class ScriptOrigin { V8_INLINE Handle ResourceIsEmbedderDebugScript() const; V8_INLINE Handle ResourceIsSharedCrossOrigin() const; V8_INLINE Handle ScriptID() const; + V8_INLINE Handle SourceMapUrl() const; private: Handle resource_name_; @@ -1020,6 +1010,7 @@ class ScriptOrigin { Handle resource_is_embedder_debug_script_; Handle resource_is_shared_cross_origin_; Handle script_id_; + Handle source_map_url_; }; @@ -1064,19 +1055,25 @@ class V8_EXPORT Script { /** * A shorthand for ScriptCompiler::Compile(). */ - static Local