diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index cc424333d31334..d0a859c12dacf9 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -60,6 +60,8 @@ shell_g /test/promises-aplus/promises-tests /test/promises-aplus/promises-tests.tar.gz /test/promises-aplus/sinon +/test/simdjs/ecmascript_simd* +/test/simdjs/data* /test/test262/data /test/test262/data.old /test/test262/tc39-test262-* diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index feaec2505e8359..5e8166c07230dd 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -52,7 +52,7 @@ config("internal_config") { include_dirs = [ "." ] - if (component_mode == "shared_library") { + if (is_component_build) { defines = [ "V8_SHARED", "BUILDING_V8_SHARED", @@ -202,8 +202,9 @@ action("js2c") { sources = [ "src/macros.py", - "src/messages.h", + "src/messages.h", "src/runtime.js", + "src/prologue.js", "src/v8natives.js", "src/symbol.js", "src/array.js", @@ -215,6 +216,7 @@ action("js2c") { "src/regexp.js", "src/arraybuffer.js", "src/typedarray.js", + "src/iterator-prototype.js", "src/generator.js", "src/object-observe.js", "src/collection.js", @@ -264,9 +266,10 @@ action("js2c_experimental") { sources = [ "src/macros.py", - "src/messages.h", + "src/messages.h", "src/proxy.js", "src/generator.js", + "src/harmony-atomics.js", "src/harmony-array.js", "src/harmony-array-includes.js", "src/harmony-typedarray.js", @@ -274,7 +277,8 @@ action("js2c_experimental") { "src/harmony-regexp.js", "src/harmony-reflect.js", "src/harmony-spread.js", - "src/harmony-object.js" + "src/harmony-object.js", + "src/harmony-sharedarraybuffer.js" ] outputs = [ @@ -474,9 +478,13 @@ source_set("v8_snapshot") { ":js2c", ":js2c_experimental", ":js2c_extras", - ":run_mksnapshot", ":v8_base", ] + public_deps = [ + # This should be public so downstream targets can declare the snapshot + # output file as their inputs. + ":run_mksnapshot", + ] sources = [ "$target_gen_dir/libraries.cc", @@ -502,9 +510,11 @@ if (v8_use_external_startup_data) { ":js2c", ":js2c_experimental", ":js2c_extras", - ":run_mksnapshot", ":v8_base", + ] + public_deps = [ ":natives_blob", + ":run_mksnapshot", ] sources = [ @@ -526,6 +536,14 @@ source_set("v8_base") { visibility = [ ":*" ] # Only targets in this file can depend on this. sources = [ + "include/v8-debug.h", + "include/v8-platform.h", + "include/v8-profiler.h", + "include/v8-testing.h", + "include/v8-util.h", + "include/v8-version.h", + "include/v8.h", + "include/v8config.h", "src/accessors.cc", "src/accessors.h", "src/allocation.cc", @@ -544,6 +562,8 @@ source_set("v8_base") { "src/assembler.h", "src/assert-scope.h", "src/assert-scope.cc", + "src/ast-literal-reindexer.cc", + "src/ast-literal-reindexer.h", "src/ast-numbering.cc", "src/ast-numbering.h", "src/ast-value-factory.cc", @@ -602,6 +622,8 @@ source_set("v8_base") { "src/compiler/basic-block-instrumentor.h", "src/compiler/change-lowering.cc", "src/compiler/change-lowering.h", + "src/compiler/coalesced-live-ranges.cc", + "src/compiler/coalesced-live-ranges.h", "src/compiler/code-generator-impl.h", "src/compiler/code-generator.cc", "src/compiler/code-generator.h", @@ -617,8 +639,8 @@ source_set("v8_base") { "src/compiler/control-equivalence.h", "src/compiler/control-flow-optimizer.cc", "src/compiler/control-flow-optimizer.h", - "src/compiler/control-reducer.cc", - "src/compiler/control-reducer.h", + "src/compiler/dead-code-elimination.cc", + "src/compiler/dead-code-elimination.h", "src/compiler/diamond.h", "src/compiler/frame.h", "src/compiler/frame-elider.cc", @@ -632,10 +654,14 @@ source_set("v8_base") { "src/compiler/graph-reducer.h", "src/compiler/graph-replay.cc", "src/compiler/graph-replay.h", + "src/compiler/graph-trimmer.cc", + "src/compiler/graph-trimmer.h", "src/compiler/graph-visualizer.cc", "src/compiler/graph-visualizer.h", "src/compiler/graph.cc", "src/compiler/graph.h", + "src/compiler/greedy-allocator.cc", + "src/compiler/greedy-allocator.h", "src/compiler/instruction-codes.h", "src/compiler/instruction-selector-impl.h", "src/compiler/instruction-selector.cc", @@ -703,8 +729,6 @@ source_set("v8_base") { "src/compiler/pipeline.h", "src/compiler/pipeline-statistics.cc", "src/compiler/pipeline-statistics.h", - "src/compiler/raw-machine-assembler.cc", - "src/compiler/raw-machine-assembler.h", "src/compiler/register-allocator.cc", "src/compiler/register-allocator.h", "src/compiler/register-allocator-verifier.cc", @@ -774,6 +798,7 @@ source_set("v8_base") { "src/elements.h", "src/execution.cc", "src/execution.h", + "src/expression-classifier.h", "src/extensions/externalize-string-extension.cc", "src/extensions/externalize-string-extension.h", "src/extensions/free-buffer-extension.cc", @@ -958,12 +983,11 @@ source_set("v8_base") { "src/optimizing-compile-dispatcher.h", "src/ostreams.cc", "src/ostreams.h", + "src/pattern-rewriter.cc", "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", "src/preparse-data.cc", "src/preparse-data.h", @@ -992,11 +1016,13 @@ source_set("v8_base") { "src/runtime-profiler.cc", "src/runtime-profiler.h", "src/runtime/runtime-array.cc", + "src/runtime/runtime-atomics.cc", "src/runtime/runtime-classes.cc", "src/runtime/runtime-collections.cc", "src/runtime/runtime-compiler.cc", "src/runtime/runtime-date.cc", "src/runtime/runtime-debug.cc", + "src/runtime/runtime-forin.cc", "src/runtime/runtime-function.cc", "src/runtime/runtime-generator.cc", "src/runtime/runtime-i18n.cc", @@ -1032,6 +1058,7 @@ source_set("v8_base") { "src/scopes.cc", "src/scopes.h", "src/signature.h", + "src/simulator.h", "src/small-pointer-list.h", "src/smart-pointers.h", "src/snapshot/natives.h", @@ -1040,6 +1067,8 @@ source_set("v8_base") { "src/snapshot/snapshot-common.cc", "src/snapshot/snapshot-source-sink.cc", "src/snapshot/snapshot-source-sink.h", + "src/splay-tree.h", + "src/splay-tree-inl.h", "src/snapshot/snapshot.h", "src/string-builder.cc", "src/string-builder.h", @@ -1089,6 +1118,8 @@ source_set("v8_base") { "src/vm-state.h", "src/zone.cc", "src/zone.h", + "src/zone-allocator.h", + "src/zone-containers.h", "src/third_party/fdlibm/fdlibm.cc", "src/third_party/fdlibm/fdlibm.h", ] @@ -1201,6 +1232,7 @@ source_set("v8_base") { "src/arm/regexp-macro-assembler-arm.cc", "src/arm/regexp-macro-assembler-arm.h", "src/arm/simulator-arm.cc", + "src/arm/simulator-arm.h", "src/compiler/arm/code-generator-arm.cc", "src/compiler/arm/instruction-codes-arm.h", "src/compiler/arm/instruction-selector-arm.cc", @@ -1295,6 +1327,7 @@ source_set("v8_base") { "src/mips/regexp-macro-assembler-mips.cc", "src/mips/regexp-macro-assembler-mips.h", "src/mips/simulator-mips.cc", + "src/mips/simulator-mips.h", "src/compiler/mips/code-generator-mips.cc", "src/compiler/mips/instruction-codes-mips.h", "src/compiler/mips/instruction-selector-mips.cc", @@ -1336,6 +1369,7 @@ source_set("v8_base") { "src/mips64/regexp-macro-assembler-mips64.cc", "src/mips64/regexp-macro-assembler-mips64.h", "src/mips64/simulator-mips64.cc", + "src/mips64/simulator-mips64.h", "src/ic/mips64/access-compiler-mips64.cc", "src/ic/mips64/handler-compiler-mips64.cc", "src/ic/mips64/ic-mips64.cc", @@ -1399,6 +1433,8 @@ source_set("v8_libbase") { "src/base/atomicops_internals_atomicword_compat.h", "src/base/atomicops_internals_mac.h", "src/base/atomicops_internals_mips_gcc.h", + "src/base/atomicops_internals_mips64_gcc.h", + "src/base/atomicops_internals_portable.h", "src/base/atomicops_internals_tsan.h", "src/base/atomicops_internals_x86_gcc.cc", "src/base/atomicops_internals_x86_gcc.h", @@ -1558,7 +1594,7 @@ if (current_toolchain == snapshot_toolchain) { # Public targets # -if (component_mode == "shared_library") { +if (is_component_build) { component("v8") { sources = [ "src/v8dll-main.cc", @@ -1567,11 +1603,17 @@ if (component_mode == "shared_library") { if (v8_use_snapshot && v8_use_external_startup_data) { deps = [ ":v8_base", + ] + public_deps = [ ":v8_external_snapshot", ] } else if (v8_use_snapshot) { deps = [ ":v8_base", + ] + # v8_snapshot should be public so downstream targets can declare the + # snapshot file as their input. + public_deps = [ ":v8_snapshot", ] } else { @@ -1607,6 +1649,8 @@ if (component_mode == "shared_library") { } else if (v8_use_snapshot) { deps = [ ":v8_base", + ] + public_deps = [ ":v8_snapshot", ] } else { @@ -1657,9 +1701,10 @@ if ((current_toolchain == host_toolchain && v8_toolset_for_d8 == "host") || sources += [ "src/d8-windows.cc" ] } - if (component_mode != "shared_library") { + if (!is_component_build) { sources += [ "src/d8-debug.cc", + "src/d8-debug.h", "$target_gen_dir/d8-js.cc", ] } diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index c665f1763eb431..9ebdad7d7e3635 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,615 @@ +2015-07-02: Version 4.5.92 + + Performance and stability improvements on all platforms. + + +2015-07-01: Version 4.5.91 + + Performance and stability improvements on all platforms. + + +2015-07-01: Version 4.5.90 + + Performance and stability improvements on all platforms. + + +2015-07-01: Version 4.5.89 + + Performance and stability improvements on all platforms. + + +2015-06-30: Version 4.5.88 + + Performance and stability improvements on all platforms. + + +2015-06-30: Version 4.5.87 + + Performance and stability improvements on all platforms. + + +2015-06-30: Version 4.5.86 + + Ensure mjsunit tests use dashes not underscores in flags directives + (Chromium issue 505228). + + Performance and stability improvements on all platforms. + + +2015-06-29: Version 4.5.85 + + Fix flag convention in handle count tests and comment (Chromium issue + 505228). + + Performance and stability improvements on all platforms. + + +2015-06-29: Version 4.5.84 + + Performance and stability improvements on all platforms. + + +2015-06-27: Version 4.5.83 + + Performance and stability improvements on all platforms. + + +2015-06-26: Version 4.5.82 + + Performance and stability improvements on all platforms. + + +2015-06-26: Version 4.5.81 + + Remove obsolete options in ScriptCompiler::CompileOptions (Chromium + issue 399580). + + Performance and stability improvements on all platforms. + + +2015-06-25: Version 4.5.80 + + Performance and stability improvements on all platforms. + + +2015-06-25: Version 4.5.79 + + Performance and stability improvements on all platforms. + + +2015-06-25: Version 4.5.78 + + Serializer: clear next link in weak cells (Chromium issue 503552). + + Performance and stability improvements on all platforms. + + +2015-06-24: Version 4.5.77 + + Performance and stability improvements on all platforms. + + +2015-06-24: Version 4.5.76 + + Performance and stability improvements on all platforms. + + +2015-06-24: Version 4.5.75 + + Date() should not depend on Date.prototype.toString (issue 4225). + + Performance and stability improvements on all platforms. + + +2015-06-23: Version 4.5.74 + + Expose Map/Set methods through the API (issue 3340). + + [turbofan] NaN is never truish (issue 4207). + + Performance and stability improvements on all platforms. + + +2015-06-23: Version 4.5.73 + + Re-ship Harmony Array/TypedArray methods (issue 3578). + + Performance and stability improvements on all platforms. + + +2015-06-23: Version 4.5.72 + + Performance and stability improvements on all platforms. + + +2015-06-23: Version 4.5.71 + + Performance and stability improvements on all platforms. + + +2015-06-20: Version 4.5.70 + + Ship Harmony Array/TypedArray methods (issue 3578). + + Performance and stability improvements on all platforms. + + +2015-06-20: Version 4.5.69 + + Ship arrow functions (issue 2700). + + Performance and stability improvements on all platforms. + + +2015-06-19: Version 4.5.68 + + Performance and stability improvements on all platforms. + + +2015-06-19: Version 4.5.67 + + Performance and stability improvements on all platforms. + + +2015-06-19: Version 4.5.66 + + Ship arrow functions (issue 2700). + + Performance and stability improvements on all platforms. + + +2015-06-18: Version 4.5.65 + + Performance and stability improvements on all platforms. + + +2015-06-18: Version 4.5.64 + + Performance and stability improvements on all platforms. + + +2015-06-18: Version 4.5.63 + + Performance and stability improvements on all platforms. + + +2015-06-17: Version 4.5.62 + + Hydrogen object literals: always initialize in-object properties + (Chromium issue 500497). + + Performance and stability improvements on all platforms. + + +2015-06-17: Version 4.5.61 + + Add %TypedArray% to proto chain (issue 4085). + + Performance and stability improvements on all platforms. + + +2015-06-17: Version 4.5.60 + + Performance and stability improvements on all platforms. + + +2015-06-17: Version 4.5.59 + + [crankshaft] Fix wrong bailout points in for-in loop body (Chromium + issue 500435). + + Performance and stability improvements on all platforms. + + +2015-06-16: Version 4.5.58 + + Performance and stability improvements on all platforms. + + +2015-06-16: Version 4.5.57 + + Inline code generation for %_IsTypedArray (issue 4085). + + Allow TypedArrays to be initialized with iterables (issue 4090). + + Performance and stability improvements on all platforms. + + +2015-06-15: Version 4.5.56 + + Performance and stability improvements on all platforms. + + +2015-06-15: Version 4.5.55 + + Performance and stability improvements on all platforms. + + +2015-06-14: Version 4.5.54 + + Performance and stability improvements on all platforms. + + +2015-06-13: Version 4.5.53 + + Performance and stability improvements on all platforms. + + +2015-06-12: Version 4.5.52 + + Map::TryUpdate() must be in sync with Map::Update() (issue 4173). + + Add ToObject call in Array.prototype.sort (issue 4125). + + In Array.of and Array.from, fall back to DefineOwnProperty (issue 4168). + + Performance and stability improvements on all platforms. + + +2015-06-12: Version 4.5.51 + + Performance and stability improvements on all platforms. + + +2015-06-11: Version 4.5.50 + + Performance and stability improvements on all platforms. + + +2015-06-11: Version 4.5.49 + + Performance and stability improvements on all platforms. + + +2015-06-11: Version 4.5.48 + + Support rest parameters in arrow functions (issue 2700). + + Performance and stability improvements on all platforms. + + +2015-06-10: Version 4.5.47 + + Implement %TypedArray%.prototype.slice (issue 3578). + + Performance and stability improvements on all platforms. + + +2015-06-09: Version 4.5.46 + + Stage ES6 arrow functions (issue 2700). + + Performance and stability improvements on all platforms. + + +2015-06-09: Version 4.5.45 + + Performance and stability improvements on all platforms. + + +2015-06-09: Version 4.5.44 + + Performance and stability improvements on all platforms. + + +2015-06-08: Version 4.5.43 + + [for-in] Make ForInNext and ForInFilter deal properly with exceptions + (Chromium issue 496331). + + Performance and stability improvements on all platforms. + + +2015-06-08: Version 4.5.42 + + Performance and stability improvements on all platforms. + + +2015-06-06: Version 4.5.41 + + Performance and stability improvements on all platforms. + + +2015-06-05: Version 4.5.40 + + Performance and stability improvements on all platforms. + + +2015-06-05: Version 4.5.39 + + Stage ES6 Array and TypedArray methods (issue 3578). + + Performance and stability improvements on all platforms. + + +2015-06-05: Version 4.5.38 + + Implement %TypedArray%.prototype.{reduce,reduceRight} (issue 3578). + + Add support for Embedded Constant Pools for PPC and Arm (Chromium issue + 478811). + + Performance and stability improvements on all platforms. + + +2015-06-04: Version 4.5.37 + + Performance and stability improvements on all platforms. + + +2015-06-04: Version 4.5.36 + + Performance and stability improvements on all platforms. + + +2015-06-04: Version 4.5.35 + + Flatten the Arrays returned and consumed by the v8::Map API (Chromium + issue 478263). + + Performance and stability improvements on all platforms. + + +2015-06-03: Version 4.5.34 + + Also allocate small typed arrays on heap when initialized from an array- + like (issue 3996). + + Implement %TypedArray%.prototype.{reduce,reduceRight} (issue 3578). + + Performance and stability improvements on all platforms. + + +2015-06-03: Version 4.5.33 + + Add support for Embedded Constant Pools for PPC and Arm (Chromium issue + 478811). + + Implement %TypedArray%.prototype.{toString,toLocaleString,join} (issue + 3578). + + Performance and stability improvements on all platforms. + + +2015-06-03: Version 4.5.32 + + Performance and stability improvements on all platforms. + + +2015-06-02: Version 4.5.31 + + Performance and stability improvements on all platforms. + + +2015-06-02: Version 4.5.30 + + Performance and stability improvements on all platforms. + + +2015-06-01: Version 4.5.29 + + Reland "Re-enable on-heap typed array allocation" (issue 3996). + + Performance and stability improvements on all platforms. + + +2015-06-01: Version 4.5.28 + + Re-enable on-heap typed array allocation (issue 3996). + + Also expose DefineOwnProperty (Chromium issue 475206). + + Performance and stability improvements on all platforms. + + +2015-06-01: Version 4.5.27 + + Performance and stability improvements on all platforms. + + +2015-05-31: Version 4.5.26 + + Performance and stability improvements on all platforms. + + +2015-05-30: Version 4.5.25 + + Performance and stability improvements on all platforms. + + +2015-05-29: Version 4.5.24 + + Debugger: consider try-finally scopes not catching wrt debug events + (Chromium issue 492522). + + Performance and stability improvements on all platforms. + + +2015-05-29: Version 4.5.23 + + Performance and stability improvements on all platforms. + + +2015-05-29: Version 4.5.22 + + Do not eagerly convert exception to string when creating a message + object (Chromium issue 490680). + + Performance and stability improvements on all platforms. + + +2015-05-28: Version 4.5.21 + + Performance and stability improvements on all platforms. + + +2015-05-28: Version 4.5.20 + + Introduce v8::Object::CreateDataProperty (Chromium issue 475206). + + Performance and stability improvements on all platforms. + + +2015-05-27: Version 4.5.19 + + Performance and stability improvements on all platforms. + + +2015-05-27: Version 4.5.18 + + Add {Map,Set}::FromArray to the API (issue 3340). + + Add {Map,Set}::AsArray to the API (issue 3340). + + Add basic API support for Map & Set (issue 3340). + + Performance and stability improvements on all platforms. + + +2015-05-26: Version 4.5.17 + + Correctly hook up materialized receiver into the evaluation context + chain (Chromium issue 491943). + + Implement bookmarks for ExternalStreamingStream (Chromium issue 470930). + + Performance and stability improvements on all platforms. + + +2015-05-26: Version 4.5.16 + + Performance and stability improvements on all platforms. + + +2015-05-26: Version 4.5.15 + + Performance and stability improvements on all platforms. + + +2015-05-23: Version 4.5.14 + + Performance and stability improvements on all platforms. + + +2015-05-22: Version 4.5.13 + + Remove v8::Private. + + Performance and stability improvements on all platforms. + + +2015-05-22: Version 4.5.12 + + Performance and stability improvements on all platforms. + + +2015-05-22: Version 4.5.11 + + Performance and stability improvements on all platforms. + + +2015-05-21: Version 4.5.10 + + Re-land %TypedArray%.prototype.{map,filter,some} (issue 3578). + + Performance and stability improvements on all platforms. + + +2015-05-21: Version 4.5.9 + + Performance and stability improvements on all platforms. + + +2015-05-20: Version 4.5.8 + + Performance and stability improvements on all platforms. + + +2015-05-20: Version 4.5.7 + + Implement %TypedArray%.{lastI,i}ndexOf (issue 3578). + + Implement %TypedArray%.prototype.sort (issue 3578). + + Implement %TypedArray%.reverse (issue 3578). + + Implement %TypedArray%.prototype.{map,filter,some,reduce,reduceRight} + (issue 3578). + + Fix has_pending_exception logic in API's Array::CloneElementAt (issue + 4103). + + Adding api to get last gc object statistics for chrome://tracing + (Chromium issue 476013). + + Fix harmless HGraph verification failure after hoisting inlined bounds + checks (Chromium issue 487608). + + Performance and stability improvements on all platforms. + + +2015-05-20: Version 4.5.6 + + Add TypedArray.from method (issue 3578). + + Performance and stability improvements on all platforms. + + +2015-05-19: Version 4.5.5 + + ARM64: Propagate notification about aborted compilation from + RegExpEngine to MacroAssembler (Chromium issue 489290). + + Performance and stability improvements on all platforms. + + +2015-05-18: Version 4.5.4 + + Performance and stability improvements on all platforms. + + +2015-05-18: Version 4.5.3 + + Performance and stability improvements on all platforms. + + +2015-05-17: Version 4.5.2 + + Performance and stability improvements on all platforms. + + +2015-05-16: Version 4.5.1 + + Test that TypedArray methods don't read length (issue 3578). + + Implement %TypedArray%.{fill,find,findIndex} (issue 3578). + + TypedArray.prototype.copyWithin method (issue 3578). + + Provide accessor for object internal properties that doesn't require + debugger to be active (Chromium issue 481845). + + Don't create debug context if debug listener is not set (Chromium issue + 482290). + + Performance and stability improvements on all platforms. + + +2015-05-13: Version 4.4.65 + + Deprecate Isolate::New. + + Factor out core of Array.forEach and .every, for use in TypedArrays + (issue 3578). + + Performance and stability improvements on all platforms. + + +2015-05-12: Version 4.4.64 + + Performance and stability improvements on all platforms. + + 2015-05-11: Version 4.4.63 Let Runtime_GrowArrayElements accept non-Smi numbers as |key| (Chromium diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 711cc53b7e3574..2466cd74772eb7 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -8,23 +8,23 @@ vars = { deps = { "v8/build/gyp": - Var("git_url") + "/external/gyp.git" + "@" + "0bb67471bca068996e15b56738fa4824dfa19de0", + Var("git_url") + "/external/gyp.git" + "@" + "5122240c5e5c4d8da12c543d82b03d6089eb77c5", "v8/third_party/icu": - Var("git_url") + "/chromium/deps/icu.git" + "@" + "f8c0e585b0a046d83d72b5d37356cb50d5b2031a", + Var("git_url") + "/chromium/deps/icu.git" + "@" + "1b697da5c2c0112e2b70e7e75d3e3d985f464a8f", "v8/buildtools": - Var("git_url") + "/chromium/buildtools.git" + "@" + "b0ede9c89f9d5fbe5387d961ad4c0ec665b6c821", + Var("git_url") + "/chromium/buildtools.git" + "@" + "ecc8e253abac3b6186a97573871a084f4c0ca3ae", "v8/testing/gtest": - Var("git_url") + "/external/googletest.git" + "@" + "be1868139ffe0ccd0e8e3b37292b84c821d9c8ad", + Var("git_url") + "/external/googletest.git" + "@" + "23574bf2333f834ff665f894c97bef8a5b33a0a9", "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" + "@" + "5bab78c6ced45a71a8e095a09697ca80492e57e1", + Var("git_url") + "/chromium/src/tools/clang.git" + "@" + "73ec8804ed395b0886d6edf82a9f33583f4a7902", } deps_os = { "android": { "v8/third_party/android_tools": - Var("git_url") + "/android_tools.git" + "@" + "4f723e2a5fa5b7b8a198072ac19b92344be2b271", + Var("git_url") + "/android_tools.git" + "@" + "21f4bcbd6cd927e4b4227cfde7d5f13486be1236", }, "win": { "v8/third_party/cygwin": diff --git a/deps/v8/LICENSE b/deps/v8/LICENSE index 2f5bce83697d0f..da779eebb27bcf 100644 --- a/deps/v8/LICENSE +++ b/deps/v8/LICENSE @@ -3,12 +3,12 @@ maintained libraries. The externally maintained libraries used by V8 are: - PCRE test suite, located in - test/mjsunit/third_party/regexp-pcre.js. This is based on the + test/mjsunit/third_party/regexp-pcre/regexp-pcre.js. This is based on the test suite from PCRE-7.3, which is copyrighted by the University of Cambridge and Google, Inc. The copyright notice and license are embedded in regexp-pcre.js. - - Layout tests, located in test/mjsunit/third_party. These are + - Layout tests, located in test/mjsunit/third_party/object-keys. These are based on layout tests from webkit.org which are copyrighted by Apple Computer, Inc. and released under a 3-clause BSD license. @@ -26,6 +26,9 @@ are: These libraries have their own licenses; we recommend you read them, as their terms may differ from the terms below. +Further license information can be found in LICENSE files located in +sub-directories. + Copyright 2014, the V8 project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are diff --git a/deps/v8/Makefile b/deps/v8/Makefile index db6cf3b7da534a..97612655a7b1ae 100644 --- a/deps/v8/Makefile +++ b/deps/v8/Makefile @@ -31,9 +31,7 @@ OUTDIR ?= out TESTJOBS ?= GYPFLAGS ?= TESTFLAGS ?= -ANDROID_NDK_ROOT ?= ANDROID_NDK_HOST_ARCH ?= -ANDROID_TOOLCHAIN ?= ANDROID_V8 ?= /data/local/tmp/v8 NACL_SDK_ROOT ?= @@ -145,10 +143,14 @@ ifeq ($(i18nsupport), off) GYPFLAGS += -Dv8_enable_i18n_support=0 TESTFLAGS += --noi18n endif -# deprecation_warnings=on +# deprecationwarnings=on ifeq ($(deprecationwarnings), on) GYPFLAGS += -Dv8_deprecation_warnings=1 endif +# imminentdeprecationwarnings=on +ifeq ($(imminentdeprecationwarnings), on) + GYPFLAGS += -Dv8_imminent_deprecation_warnings=1 +endif # asan=on ifeq ($(asan), on) GYPFLAGS += -Dasan=1 -Dclang=1 @@ -246,7 +248,7 @@ NACL_ARCHES = nacl_ia32 nacl_x64 GYPFILES = third_party/icu/icu.gypi third_party/icu/icu.gyp \ build/shim_headers.gypi build/features.gypi build/standalone.gypi \ build/toolchain.gypi build/all.gyp build/mac/asan.gyp \ - build/android.gypi test/cctest/cctest.gyp \ + test/cctest/cctest.gyp \ test/unittests/unittests.gyp tools/gyp/v8.gyp \ tools/parser-shell.gyp testing/gmock.gyp testing/gtest.gyp \ buildtools/third_party/libc++abi/libc++abi.gyp \ @@ -277,7 +279,6 @@ ENVFILE = $(OUTDIR)/environment $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \ $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \ - must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN \ $(NACL_ARCHES) $(NACL_BUILDS) $(NACL_CHECKS) \ must-set-NACL_SDK_ROOT @@ -311,8 +312,7 @@ native: $(OUTDIR)/Makefile.native $(ANDROID_ARCHES): $(addprefix $$@.,$(MODES)) -$(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \ - must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN Makefile.android +$(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) Makefile.android @$(MAKE) -f Makefile.android $@ \ ARCH="$(basename $@)" \ MODE="$(subst .,,$(suffix $@))" \ @@ -448,13 +448,6 @@ $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS) -must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN: -ifndef ANDROID_NDK_ROOT -ifndef ANDROID_TOOLCHAIN - $(error ANDROID_NDK_ROOT or ANDROID_TOOLCHAIN must be set)) -endif -endif - # Note that NACL_SDK_ROOT must be set to point to an appropriate # Native Client SDK before using this makefile. You can download # an SDK here: diff --git a/deps/v8/Makefile.android b/deps/v8/Makefile.android index f89fd21fda004e..c49cb85b9b6514 100644 --- a/deps/v8/Makefile.android +++ b/deps/v8/Makefile.android @@ -35,75 +35,28 @@ MODES = release debug ANDROID_BUILDS = $(foreach mode,$(MODES), \ $(addsuffix .$(mode),$(ANDROID_ARCHES))) -HOST_OS = $(shell uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') -ANDROID_NDK_HOST_ARCH ?= $(shell uname -m | sed -e 's/i[3456]86/x86/') -ifeq ($(HOST_OS), linux) - TOOLCHAIN_DIR = linux-$(ANDROID_NDK_HOST_ARCH) -else ifeq ($(HOST_OS), mac) - TOOLCHAIN_DIR = darwin-$(ANDROID_NDK_HOST_ARCH) -else - $(error Host platform "${HOST_OS}" is not supported) -endif - ifeq ($(ARCH), android_arm) - DEFINES = target_arch=arm v8_target_arch=arm android_target_arch=arm android_target_platform=14 - DEFINES += arm_neon=0 arm_version=7 - TOOLCHAIN_ARCH = arm-linux-androideabi - TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) - TOOLCHAIN_VER = 4.8 + DEFINES = target_arch=arm v8_target_arch=arm else ifeq ($(ARCH), android_arm64) - DEFINES = target_arch=arm64 v8_target_arch=arm64 android_target_arch=arm64 android_target_platform=21 - TOOLCHAIN_ARCH = aarch64-linux-android - TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) - TOOLCHAIN_VER = 4.9 + DEFINES = target_arch=arm64 v8_target_arch=arm64 else ifeq ($(ARCH), android_mipsel) - DEFINES = target_arch=mipsel v8_target_arch=mipsel android_target_platform=14 - DEFINES += android_target_arch=mips mips_arch_variant=mips32r2 - TOOLCHAIN_ARCH = mipsel-linux-android - TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) - TOOLCHAIN_VER = 4.8 + DEFINES = target_arch=mipsel v8_target_arch=mipsel else ifeq ($(ARCH), android_ia32) - DEFINES = target_arch=ia32 v8_target_arch=ia32 android_target_arch=x86 android_target_platform=14 - TOOLCHAIN_ARCH = x86 - TOOLCHAIN_PREFIX = i686-linux-android - TOOLCHAIN_VER = 4.8 + DEFINES = target_arch=ia32 v8_target_arch=ia32 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 + DEFINES = target_arch=x64 v8_target_arch=x64 else ifeq ($(ARCH), android_x87) - DEFINES = target_arch=x87 v8_target_arch=x87 android_target_arch=x86 android_target_platform=14 - TOOLCHAIN_ARCH = x86 - TOOLCHAIN_PREFIX = i686-linux-android - TOOLCHAIN_VER = 4.8 + DEFINES = target_arch=ia32 v8_target_arch=x87 else $(error Target architecture "${ARCH}" is not supported) endif -TOOLCHAIN_PATH = \ - ${ANDROID_NDK_ROOT}/toolchains/${TOOLCHAIN_ARCH}-${TOOLCHAIN_VER}/prebuilt -ANDROID_TOOLCHAIN ?= ${TOOLCHAIN_PATH}/${TOOLCHAIN_DIR} - -ifeq ($(wildcard $(ANDROID_TOOLCHAIN)),) - $(error Cannot find Android toolchain in "${ANDROID_TOOLCHAIN}". Please \ - check that ANDROID_NDK_ROOT and ANDROID_NDK_HOST_ARCH are set \ - correctly) -endif - -# For mksnapshot host generation. -DEFINES += host_os=${HOST_OS} +# Common flags. DEFINES += OS=android .SECONDEXPANSION: $(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$@ @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ - CXX="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-g++" \ - AR="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-ar" \ - RANLIB="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-ranlib" \ - CC="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-gcc" \ - LD="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-ld" \ - LINK="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-g++" \ BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ python -c "print raw_input().capitalize()") \ builddir="$(shell pwd)/$(OUTDIR)/$@" @@ -113,9 +66,7 @@ ANDROID_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ANDROID_BUILDS)) $(ANDROID_MAKEFILES): GYP_GENERATORS=make-android \ GYP_DEFINES="${DEFINES}" \ - CC="${ANDROID_TOOLCHAIN}/bin/${TOOLCHAIN_PREFIX}-gcc" \ - CXX="${ANDROID_TOOLCHAIN}/bin/${TOOLCHAIN_PREFIX}-g++" \ PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH)" \ build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \ - -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \ + -Ibuild/standalone.gypi --depth=. \ -S$(suffix $(basename $@))$(suffix $@) ${GYPFLAGS} diff --git a/deps/v8/build/android.gypi b/deps/v8/build/android.gypi deleted file mode 100644 index 7bbf12eed6d99b..00000000000000 --- a/deps/v8/build/android.gypi +++ /dev/null @@ -1,266 +0,0 @@ -# Copyright 2012 the V8 project authors. All rights reserved. -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# Definitions for building standalone V8 binaries to run on Android. -# This is mostly excerpted from: -# http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi - -{ - 'variables': { - # Location of Android NDK. - 'variables': { - 'android_ndk_root%': ' GetDebugContext(); @@ -259,6 +260,14 @@ class V8_EXPORT Debug { * unexpectedly used. LiveEdit is enabled by default. */ static void SetLiveEditEnabled(Isolate* isolate, bool enable); + + /** + * Returns array of internal properties specific to the value type. Result has + * the following format: [, ,...,, ]. Result array + * will be allocated in the current context. + */ + static MaybeLocal GetInternalProperties(Isolate* isolate, + Local value); }; diff --git a/deps/v8/include/v8-platform.h b/deps/v8/include/v8-platform.h index 67fb384c99ba52..be9e5c0c6b46ed 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -56,6 +56,17 @@ class Platform { */ virtual void CallOnForegroundThread(Isolate* isolate, Task* task) = 0; + /** + * Schedules a task to be invoked on a foreground thread wrt a specific + * |isolate| after the given number of seconds |delay_in_seconds|. + * Tasks posted for the same isolate should be execute in order of + * scheduling. The definition of "foreground" is opaque to V8. + */ + virtual void CallDelayedOnForegroundThread(Isolate* isolate, Task* task, + double delay_in_seconds) { + // TODO(ulan): Make this function abstract after V8 roll in Chromium. + } + /** * Monotonically increasing time in seconds from an arbitrary fixed point in * the past. This function is expected to return at least diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index 82a14d66003001..d0375a79ec4e20 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -275,7 +275,8 @@ class V8_EXPORT HeapGraphNode { // snapshot items together. kConsString = 10, // Concatenated string. A pair of pointers to strings. kSlicedString = 11, // Sliced string. A fragment of another string. - kSymbol = 12 // A Symbol (ES6). + kSymbol = 12, // A Symbol (ES6). + kSimdValue = 13 // A SIMD value stored in the heap (Proposed ES7). }; /** Returns node type (see HeapGraphNode::Type). */ diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 2f2ea5533387d0..7ab7da1e8e2dd2 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 4 -#define V8_BUILD_NUMBER 63 -#define V8_PATCH_LEVEL 12 +#define V8_MINOR_VERSION 5 +#define V8_BUILD_NUMBER 92 +#define V8_PATCH_LEVEL 0 // 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 910279b52e6b29..fafd1681715f4a 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -94,6 +94,7 @@ class Primitive; class Promise; class RawOperationDescriptor; class Script; +class SharedArrayBuffer; class Signature; class StartupData; class StackFrame; @@ -102,7 +103,6 @@ class String; class StringObject; class Symbol; class SymbolObject; -class Private; class Uint32; class Utils; class Value; @@ -311,7 +311,6 @@ class Local { 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); @@ -418,11 +417,11 @@ class WeakCallbackInfo { V8_INLINE void* GetInternalField(int index) const; V8_INLINE V8_DEPRECATE_SOON("use indexed version", - void* GetInternalField1()) const { + void* GetInternalField1() const) { return internal_fields_[0]; } V8_INLINE V8_DEPRECATE_SOON("use indexed version", - void* GetInternalField2()) const { + void* GetInternalField2() const) { return internal_fields_[1]; } @@ -835,8 +834,11 @@ class Global : public PersistentBase { typedef void MoveOnlyTypeForCPP03; private: + template + friend class ReturnValue; Global(Global&) = delete; void operator=(Global&) = delete; + V8_INLINE T* operator*() const { return this->val_; } }; @@ -972,6 +974,38 @@ class V8_EXPORT Data { }; +/** + * The optional attributes of ScriptOrigin. + */ +class ScriptOriginOptions { + public: + V8_INLINE ScriptOriginOptions(bool is_embedder_debug_script = false, + bool is_shared_cross_origin = false, + bool is_opaque = false) + : flags_((is_embedder_debug_script ? kIsEmbedderDebugScript : 0) | + (is_shared_cross_origin ? kIsSharedCrossOrigin : 0) | + (is_opaque ? kIsOpaque : 0)) {} + V8_INLINE ScriptOriginOptions(int flags) + : flags_(flags & + (kIsEmbedderDebugScript | kIsSharedCrossOrigin | kIsOpaque)) {} + bool IsEmbedderDebugScript() const { + return (flags_ & kIsEmbedderDebugScript) != 0; + } + bool IsSharedCrossOrigin() const { + return (flags_ & kIsSharedCrossOrigin) != 0; + } + bool IsOpaque() const { return (flags_ & kIsOpaque) != 0; } + int Flags() const { return flags_; } + + private: + enum { + kIsEmbedderDebugScript = 1, + kIsSharedCrossOrigin = 1 << 1, + kIsOpaque = 1 << 2 + }; + const int flags_; +}; + /** * The origin, within a file, of a script. */ @@ -984,31 +1018,23 @@ class ScriptOrigin { Handle resource_is_shared_cross_origin = Handle(), Handle script_id = 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), - source_map_url_(source_map_url) {} + Handle source_map_url = Handle(), + Handle resource_is_opaque = Handle()); V8_INLINE Handle ResourceName() const; V8_INLINE Handle ResourceLineOffset() const; V8_INLINE Handle ResourceColumnOffset() const; /** * Returns true for embedder's debugger scripts */ - V8_INLINE Handle ResourceIsEmbedderDebugScript() const; - V8_INLINE Handle ResourceIsSharedCrossOrigin() const; V8_INLINE Handle ScriptID() const; V8_INLINE Handle SourceMapUrl() const; + V8_INLINE ScriptOriginOptions Options() const { return options_; } private: Handle resource_name_; Handle resource_line_offset_; Handle resource_column_offset_; - Handle resource_is_embedder_debug_script_; - Handle resource_is_shared_cross_origin_; + ScriptOriginOptions options_; Handle script_id_; Handle source_map_url_; }; @@ -1160,8 +1186,7 @@ class V8_EXPORT ScriptCompiler { Handle resource_name; Handle resource_line_offset; Handle resource_column_offset; - Handle resource_is_embedder_debug_script; - Handle resource_is_shared_cross_origin; + ScriptOriginOptions resource_options; Handle source_map_url; // Cached data from previous compilation (if a kConsume*Cache flag is @@ -1174,7 +1199,7 @@ class V8_EXPORT ScriptCompiler { * For streaming incomplete script data to V8. The embedder should implement a * subclass of this class. */ - class ExternalSourceStream { + class V8_EXPORT ExternalSourceStream { public: virtual ~ExternalSourceStream() {} @@ -1196,6 +1221,23 @@ class V8_EXPORT ScriptCompiler { * V8 has parsed the data it received so far. */ virtual size_t GetMoreData(const uint8_t** src) = 0; + + /** + * V8 calls this method to set a 'bookmark' at the current position in + * the source stream, for the purpose of (maybe) later calling + * ResetToBookmark. If ResetToBookmark is called later, then subsequent + * calls to GetMoreData should return the same data as they did when + * SetBookmark was called earlier. + * + * The embedder may return 'false' to indicate it cannot provide this + * functionality. + */ + virtual bool SetBookmark(); + + /** + * V8 calls this to return to a previously set bookmark. + */ + virtual void ResetToBookmark(); }; @@ -1242,10 +1284,7 @@ class V8_EXPORT ScriptCompiler { kProduceParserCache, kConsumeParserCache, kProduceCodeCache, - kConsumeCodeCache, - - // Support the previous API for a transition period. - kProduceDataToCache + kConsumeCodeCache }; /** @@ -1390,7 +1429,7 @@ class V8_EXPORT Message { public: Local Get() const; - V8_DEPRECATE_SOON("Use maybe version", Local GetSourceLine()) const; + V8_DEPRECATE_SOON("Use maybe version", Local GetSourceLine() const); V8_WARN_UNUSED_RESULT MaybeLocal GetSourceLine( Local context) const; @@ -1416,7 +1455,7 @@ class V8_EXPORT Message { /** * Returns the number, 1-based, of the line where the error occurred. */ - V8_DEPRECATE_SOON("Use maybe version", int GetLineNumber()) const; + V8_DEPRECATE_SOON("Use maybe version", int GetLineNumber() const); V8_WARN_UNUSED_RESULT Maybe GetLineNumber(Local context) const; /** @@ -1435,14 +1474,14 @@ class V8_EXPORT Message { * Returns the index within the line of the first character where * the error occurred. */ - V8_DEPRECATE_SOON("Use maybe version", int GetStartColumn()) const; + V8_DEPRECATE_SOON("Use maybe version", int GetStartColumn() const); V8_WARN_UNUSED_RESULT Maybe GetStartColumn(Local context) const; /** * Returns the index within the line of the last character where * the error occurred. */ - V8_DEPRECATE_SOON("Use maybe version", int GetEndColumn()) const; + V8_DEPRECATE_SOON("Use maybe version", int GetEndColumn() const); V8_WARN_UNUSED_RESULT Maybe GetEndColumn(Local context) const; /** @@ -1450,6 +1489,7 @@ class V8_EXPORT Message { * this Message was generated to V8. */ bool IsSharedCrossOrigin() const; + bool IsOpaque() const; // TODO(1245381): Print to a string instead of on a FILE. static void PrintCurrentStackTrace(Isolate* isolate, FILE* out); @@ -1781,37 +1821,31 @@ class V8_EXPORT Value : public Data { /** * Returns true if this value is a Map. - * This is an experimental feature. */ bool IsMap() const; /** * Returns true if this value is a Set. - * This is an experimental feature. */ bool IsSet() const; /** * Returns true if this value is a Map Iterator. - * This is an experimental feature. */ bool IsMapIterator() const; /** * Returns true if this value is a Set Iterator. - * This is an experimental feature. */ bool IsSetIterator() const; /** * Returns true if this value is a WeakMap. - * This is an experimental feature. */ bool IsWeakMap() const; /** * Returns true if this value is a WeakSet. - * This is an experimental feature. */ bool IsWeakSet() const; @@ -1887,12 +1921,25 @@ class V8_EXPORT Value : public Data { */ bool IsFloat64Array() const; + /** + * Returns true if this value is a SIMD Float32x4. + * This is an experimental feature. + */ + bool IsFloat32x4() const; + /** * Returns true if this value is a DataView. * This is an experimental feature. */ bool IsDataView() const; + /** + * Returns true if this value is a SharedArrayBuffer. + * This is an experimental feature. + */ + bool IsSharedArrayBuffer() const; + + V8_WARN_UNUSED_RESULT MaybeLocal ToBoolean( Local context) const; V8_WARN_UNUSED_RESULT MaybeLocal ToNumber( @@ -1910,39 +1957,39 @@ class V8_EXPORT Value : public Data { V8_WARN_UNUSED_RESULT MaybeLocal ToInt32(Local context) const; V8_DEPRECATE_SOON("Use maybe version", - Local ToBoolean(Isolate* isolate)) const; + Local ToBoolean(Isolate* isolate) const); V8_DEPRECATE_SOON("Use maybe version", - Local ToNumber(Isolate* isolate)) const; + Local ToNumber(Isolate* isolate) const); V8_DEPRECATE_SOON("Use maybe version", - Local ToString(Isolate* isolate)) const; + Local ToString(Isolate* isolate) const); V8_DEPRECATE_SOON("Use maybe version", - Local ToDetailString(Isolate* isolate)) const; + Local ToDetailString(Isolate* isolate) const); V8_DEPRECATE_SOON("Use maybe version", - Local ToObject(Isolate* isolate)) const; + Local ToObject(Isolate* isolate) const); V8_DEPRECATE_SOON("Use maybe version", - Local ToInteger(Isolate* isolate)) const; + Local ToInteger(Isolate* isolate) const); V8_DEPRECATE_SOON("Use maybe version", - Local ToUint32(Isolate* isolate)) const; + Local ToUint32(Isolate* isolate) const); V8_DEPRECATE_SOON("Use maybe version", - Local ToInt32(Isolate* isolate)) const; + Local ToInt32(Isolate* isolate) const); inline V8_DEPRECATE_SOON("Use maybe version", - Local ToBoolean()) const; - inline V8_DEPRECATE_SOON("Use maybe version", Local ToNumber()) const; - inline V8_DEPRECATE_SOON("Use maybe version", Local ToString()) const; + Local ToBoolean() const); + inline V8_DEPRECATE_SOON("Use maybe version", Local ToNumber() const); + inline V8_DEPRECATE_SOON("Use maybe version", Local ToString() const); inline V8_DEPRECATE_SOON("Use maybe version", - Local ToDetailString()) const; - inline V8_DEPRECATE_SOON("Use maybe version", Local ToObject()) const; + Local ToDetailString() const); + inline V8_DEPRECATE_SOON("Use maybe version", Local ToObject() const); inline V8_DEPRECATE_SOON("Use maybe version", - Local ToInteger()) const; - inline V8_DEPRECATE_SOON("Use maybe version", Local ToUint32()) const; - inline V8_DEPRECATE_SOON("Use maybe version", Local ToInt32()) const; + Local ToInteger() const); + inline V8_DEPRECATE_SOON("Use maybe version", Local ToUint32() const); + inline V8_DEPRECATE_SOON("Use maybe version", Local ToInt32() const); /** * Attempts to convert a string to an array index. * Returns an empty handle if the conversion fails. */ - V8_DEPRECATE_SOON("Use maybe version", Local ToArrayIndex()) const; + V8_DEPRECATE_SOON("Use maybe version", Local ToArrayIndex() const); V8_WARN_UNUSED_RESULT MaybeLocal ToArrayIndex( Local context) const; @@ -1954,14 +2001,14 @@ class V8_EXPORT Value : public Data { Local context) const; V8_WARN_UNUSED_RESULT Maybe Int32Value(Local context) const; - V8_DEPRECATE_SOON("Use maybe version", bool BooleanValue()) const; - V8_DEPRECATE_SOON("Use maybe version", double NumberValue()) const; - V8_DEPRECATE_SOON("Use maybe version", int64_t IntegerValue()) const; - V8_DEPRECATE_SOON("Use maybe version", uint32_t Uint32Value()) const; - V8_DEPRECATE_SOON("Use maybe version", int32_t Int32Value()) const; + V8_DEPRECATE_SOON("Use maybe version", bool BooleanValue() const); + V8_DEPRECATE_SOON("Use maybe version", double NumberValue() const); + V8_DEPRECATE_SOON("Use maybe version", int64_t IntegerValue() const); + V8_DEPRECATE_SOON("Use maybe version", uint32_t Uint32Value() const); + V8_DEPRECATE_SOON("Use maybe version", int32_t Int32Value() const); /** JS == */ - V8_DEPRECATE_SOON("Use maybe version", bool Equals(Handle that)) const; + V8_DEPRECATE_SOON("Use maybe version", bool Equals(Handle that) const); V8_WARN_UNUSED_RESULT Maybe Equals(Local context, Handle that) const; bool StrictEquals(Handle that) const; @@ -2424,34 +2471,6 @@ class V8_EXPORT Symbol : public Name { }; -/** - * A private symbol - * - * This is an experimental feature. Use at your own risk. - */ -class V8_EXPORT Private : public Data { - public: - // Returns the print name string of the private symbol, or undefined if none. - Local Name() const; - - // Create a private symbol. If name is not empty, it will be the description. - static Local New( - Isolate *isolate, Local name = Local()); - - // Retrieve a global private symbol. If a symbol with this name has not - // been retrieved in the same isolate before, it is created. - // Note that private symbols created this way are never collected, so - // they should only be used for statically fixed properties. - // Also, there is only one global name space for the names used as keys. - // To minimize the potential for clashes, use qualified names as keys, - // e.g., "Class#property". - static Local ForApi(Isolate *isolate, Local name); - - private: - Private(); -}; - - /** * A JavaScript number value (ECMA-262, 4.3.20) */ @@ -2571,6 +2590,30 @@ class V8_EXPORT Object : public Value { V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index, Local value); + // Implements CreateDataProperty (ECMA-262, 7.3.4). + // + // Defines a configurable, writable, enumerable property with the given value + // on the object unless the property already exists and is not configurable + // or the object is not extensible. + // + // Returns true on success. + V8_WARN_UNUSED_RESULT Maybe CreateDataProperty(Local context, + Local key, + Local value); + V8_WARN_UNUSED_RESULT Maybe CreateDataProperty(Local context, + uint32_t index, + Local value); + + // Implements DefineOwnProperty. + // + // In general, CreateDataProperty will be faster, however, does not allow + // for specifying attributes. + // + // Returns true on success. + V8_WARN_UNUSED_RESULT Maybe DefineOwnProperty( + Local context, Local key, Local value, + PropertyAttribute attributes = None); + // Sets an own property on this object bypassing interceptors and // overriding accessors or read-only properties. // @@ -2579,12 +2622,13 @@ class V8_EXPORT Object : public Value { // will only be returned if the interceptor doesn't return a value. // // Note also that this only works for named properties. - V8_DEPRECATE_SOON("Use maybe version", + V8_DEPRECATE_SOON("Use CreateDataProperty", bool ForceSet(Handle key, Handle value, PropertyAttribute attribs = None)); - // TODO(dcarney): mark V8_WARN_UNUSED_RESULT - Maybe ForceSet(Local context, Local key, - Local value, PropertyAttribute attribs = None); + V8_DEPRECATE_SOON("Use CreateDataProperty", + Maybe ForceSet(Local context, + Local key, Local value, + PropertyAttribute attribs = None)); V8_DEPRECATE_SOON("Use maybe version", Local Get(Handle key)); V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context, @@ -2655,18 +2699,6 @@ class V8_EXPORT Object : public Value { PropertyAttribute attribute = None, AccessControl settings = DEFAULT); - /** - * Functionality for private properties. - * This is an experimental feature, use at your own risk. - * Note: Private properties are inherited. Do not rely on this, since it may - * change. - */ - // TODO(dcarney): convert these or remove? - bool HasPrivate(Handle key); - bool SetPrivate(Handle key, Handle value); - bool DeletePrivate(Handle key); - Local GetPrivate(Handle key); - /** * Returns an array containing the names of the enumerable properties * of this object, including properties from prototype objects. The @@ -2941,6 +2973,89 @@ class V8_EXPORT Array : public Object { }; +/** + * An instance of the built-in Map constructor (ECMA-262, 6th Edition, 23.1.1). + */ +class V8_EXPORT Map : public Object { + public: + size_t Size() const; + void Clear(); + V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context, + Local key); + V8_WARN_UNUSED_RESULT MaybeLocal Set(Local context, + Local key, + Local value); + V8_WARN_UNUSED_RESULT Maybe Has(Local context, + Local key); + V8_WARN_UNUSED_RESULT Maybe Delete(Local context, + Local key); + + /** + * Returns an array of length Size() * 2, where index N is the Nth key and + * index N + 1 is the Nth value. + */ + Local AsArray() const; + + /** + * Creates a new empty Map. + */ + static Local New(Isolate* isolate); + + /** + * Creates a new Map containing the elements of array, which must be formatted + * in the same manner as the array returned from AsArray(). + * Guaranteed to be side-effect free if the array contains no holes. + */ + static V8_WARN_UNUSED_RESULT MaybeLocal FromArray(Local context, + Local array); + + V8_INLINE static Map* Cast(Value* obj); + + private: + Map(); + static void CheckCast(Value* obj); +}; + + +/** + * An instance of the built-in Set constructor (ECMA-262, 6th Edition, 23.2.1). + */ +class V8_EXPORT Set : public Object { + public: + size_t Size() const; + void Clear(); + V8_WARN_UNUSED_RESULT MaybeLocal Add(Local context, + Local key); + V8_WARN_UNUSED_RESULT Maybe Has(Local context, + Local key); + V8_WARN_UNUSED_RESULT Maybe Delete(Local context, + Local key); + + /** + * Returns an array of the keys in this Set. + */ + Local AsArray() const; + + /** + * Creates a new empty Set. + */ + static Local New(Isolate* isolate); + + /** + * Creates a new Set containing the items in array. + * Guaranteed to be side-effect free if the array contains no holes. + */ + static V8_WARN_UNUSED_RESULT MaybeLocal FromArray(Local context, + Local array); + + V8_INLINE static Set* Cast(Value* obj); + + private: + Set(); + static void CheckCast(Value* obj); +}; + + template class ReturnValue { public: @@ -2949,8 +3064,13 @@ class ReturnValue { TYPE_CHECK(T, S); } // Handle setters - template V8_INLINE void Set(const Persistent& handle); - template V8_INLINE void Set(const Handle handle); + template + V8_INLINE V8_DEPRECATE_SOON("Use Global<> instead", + void Set(const Persistent& handle)); + template + V8_INLINE void Set(const Global& handle); + template + V8_INLINE void Set(const Local handle); // Fast primitive setters V8_INLINE void Set(bool value); V8_INLINE void Set(double i); @@ -3066,18 +3186,22 @@ class V8_EXPORT Function : public Object { * Create a function in the current execution context * for a given FunctionCallback. */ - static Local New(Isolate* isolate, - FunctionCallback callback, - Local data = Local(), - int length = 0); + static MaybeLocal New(Local context, + FunctionCallback callback, + Local data = Local(), + int length = 0); + static V8_DEPRECATE_SOON( + "Use maybe version", + Local New(Isolate* isolate, FunctionCallback callback, + Local data = Local(), int length = 0)); V8_DEPRECATE_SOON("Use maybe version", - Local NewInstance(int argc, - Handle argv[])) const; + Local NewInstance(int argc, Handle argv[]) + const); V8_WARN_UNUSED_RESULT MaybeLocal NewInstance( Local context, int argc, Handle argv[]) const; - V8_DEPRECATE_SOON("Use maybe version", Local NewInstance()) const; + V8_DEPRECATE_SOON("Use maybe version", Local NewInstance() const); V8_WARN_UNUSED_RESULT MaybeLocal NewInstance( Local context) const { return NewInstance(context, 0, nullptr); @@ -3312,7 +3436,7 @@ class V8_EXPORT ArrayBuffer : public Object { ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized); /** - * Returns true if ArrayBuffer is extrenalized, that is, does not + * Returns true if ArrayBuffer is externalized, that is, does not * own its memory block. */ bool IsExternal() const; @@ -3447,6 +3571,8 @@ class V8_EXPORT Uint8Array : public TypedArray { public: static Local New(Handle array_buffer, size_t byte_offset, size_t length); + static Local New(Handle shared_array_buffer, + size_t byte_offset, size_t length); V8_INLINE static Uint8Array* Cast(Value* obj); private: @@ -3463,6 +3589,9 @@ class V8_EXPORT Uint8ClampedArray : public TypedArray { public: static Local New(Handle array_buffer, size_t byte_offset, size_t length); + static Local New( + Handle shared_array_buffer, size_t byte_offset, + size_t length); V8_INLINE static Uint8ClampedArray* Cast(Value* obj); private: @@ -3478,6 +3607,8 @@ class V8_EXPORT Int8Array : public TypedArray { public: static Local New(Handle array_buffer, size_t byte_offset, size_t length); + static Local New(Handle shared_array_buffer, + size_t byte_offset, size_t length); V8_INLINE static Int8Array* Cast(Value* obj); private: @@ -3494,6 +3625,8 @@ class V8_EXPORT Uint16Array : public TypedArray { public: static Local New(Handle array_buffer, size_t byte_offset, size_t length); + static Local New(Handle shared_array_buffer, + size_t byte_offset, size_t length); V8_INLINE static Uint16Array* Cast(Value* obj); private: @@ -3510,6 +3643,8 @@ class V8_EXPORT Int16Array : public TypedArray { public: static Local New(Handle array_buffer, size_t byte_offset, size_t length); + static Local New(Handle shared_array_buffer, + size_t byte_offset, size_t length); V8_INLINE static Int16Array* Cast(Value* obj); private: @@ -3526,6 +3661,8 @@ class V8_EXPORT Uint32Array : public TypedArray { public: static Local New(Handle array_buffer, size_t byte_offset, size_t length); + static Local New(Handle shared_array_buffer, + size_t byte_offset, size_t length); V8_INLINE static Uint32Array* Cast(Value* obj); private: @@ -3542,6 +3679,8 @@ class V8_EXPORT Int32Array : public TypedArray { public: static Local New(Handle array_buffer, size_t byte_offset, size_t length); + static Local New(Handle shared_array_buffer, + size_t byte_offset, size_t length); V8_INLINE static Int32Array* Cast(Value* obj); private: @@ -3558,6 +3697,8 @@ class V8_EXPORT Float32Array : public TypedArray { public: static Local New(Handle array_buffer, size_t byte_offset, size_t length); + static Local New(Handle shared_array_buffer, + size_t byte_offset, size_t length); V8_INLINE static Float32Array* Cast(Value* obj); private: @@ -3574,6 +3715,8 @@ class V8_EXPORT Float64Array : public TypedArray { public: static Local New(Handle array_buffer, size_t byte_offset, size_t length); + static Local New(Handle shared_array_buffer, + size_t byte_offset, size_t length); V8_INLINE static Float64Array* Cast(Value* obj); private: @@ -3590,6 +3733,8 @@ class V8_EXPORT DataView : public ArrayBufferView { public: static Local New(Handle array_buffer, size_t byte_offset, size_t length); + static Local New(Handle shared_array_buffer, + size_t byte_offset, size_t length); V8_INLINE static DataView* Cast(Value* obj); private: @@ -3598,6 +3743,105 @@ class V8_EXPORT DataView : public ArrayBufferView { }; +/** + * An instance of the built-in SharedArrayBuffer constructor. + * This API is experimental and may change significantly. + */ +class V8_EXPORT SharedArrayBuffer : public Object { + public: + /** + * The contents of an |SharedArrayBuffer|. Externalization of + * |SharedArrayBuffer| returns an instance of this class, populated, with a + * pointer to data and byte length. + * + * The Data pointer of SharedArrayBuffer::Contents is always allocated with + * |ArrayBuffer::Allocator::Allocate| by the allocator specified in + * v8::Isolate::CreateParams::array_buffer_allocator. + * + * This API is experimental and may change significantly. + */ + class V8_EXPORT Contents { // NOLINT + public: + Contents() : data_(NULL), byte_length_(0) {} + + void* Data() const { return data_; } + size_t ByteLength() const { return byte_length_; } + + private: + void* data_; + size_t byte_length_; + + friend class SharedArrayBuffer; + }; + + + /** + * Data length in bytes. + */ + size_t ByteLength() const; + + /** + * Create a new SharedArrayBuffer. Allocate |byte_length| bytes. + * Allocated memory will be owned by a created SharedArrayBuffer and + * will be deallocated when it is garbage-collected, + * unless the object is externalized. + */ + static Local New(Isolate* isolate, size_t byte_length); + + /** + * Create a new SharedArrayBuffer over an existing memory block. The created + * array buffer is immediately in externalized state unless otherwise + * specified. The memory block will not be reclaimed when a created + * SharedArrayBuffer is garbage-collected. + */ + static Local New( + Isolate* isolate, void* data, size_t byte_length, + ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized); + + /** + * Returns true if SharedArrayBuffer is externalized, that is, does not + * own its memory block. + */ + bool IsExternal() const; + + /** + * Make this SharedArrayBuffer external. The pointer to underlying memory + * block and byte length are returned as |Contents| structure. After + * SharedArrayBuffer had been etxrenalized, it does no longer owns the memory + * block. The caller should take steps to free memory when it is no longer + * needed. + * + * The memory block is guaranteed to be allocated with |Allocator::Allocate| + * by the allocator specified in + * v8::Isolate::CreateParams::array_buffer_allocator. + * + */ + Contents Externalize(); + + /** + * Get a pointer to the ArrayBuffer's underlying memory block without + * externalizing it. If the ArrayBuffer is not externalized, this pointer + * will become invalid as soon as the ArrayBuffer became garbage collected. + * + * The embedder should make sure to hold a strong reference to the + * ArrayBuffer while accessing this pointer. + * + * The memory block is guaranteed to be allocated with |Allocator::Allocate| + * by the allocator specified in + * v8::Isolate::CreateParams::array_buffer_allocator. + */ + Contents GetContents(); + + V8_INLINE static SharedArrayBuffer* Cast(Value* obj); + + static const int kInternalFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT; + + private: + SharedArrayBuffer(); + static void CheckCast(Value* obj); +}; + + /** * An instance of the built-in Date constructor (ECMA-262, 15.9). */ @@ -4815,6 +5059,24 @@ class V8_EXPORT HeapSpaceStatistics { }; +class V8_EXPORT HeapObjectStatistics { + public: + HeapObjectStatistics(); + const char* object_type() { return object_type_; } + const char* object_sub_type() { return object_sub_type_; } + size_t object_count() { return object_count_; } + size_t object_size() { return object_size_; } + + private: + const char* object_type_; + const char* object_sub_type_; + size_t object_count_; + size_t object_size_; + + friend class Isolate; +}; + + class RetainedObjectInfo; @@ -5107,6 +5369,7 @@ class V8_EXPORT Isolate { kStoreBufferOverflow = 4, kSlotsBufferOverflow = 5, kObjectObserve = 6, + kForcedGC = 7, kUseCounterFeatureCount // This enum value must be last. }; @@ -5125,7 +5388,7 @@ class V8_EXPORT Isolate { */ static Isolate* New(const CreateParams& params); - static V8_DEPRECATE_SOON("Always pass CreateParams", Isolate* New()); + static V8_DEPRECATED("Always pass CreateParams", Isolate* New()); /** * Returns the entered isolate for the current thread or NULL in @@ -5202,6 +5465,23 @@ class V8_EXPORT Isolate { bool GetHeapSpaceStatistics(HeapSpaceStatistics* space_statistics, size_t index); + /** + * Returns the number of types of objects tracked in the heap at GC. + */ + size_t NumberOfTrackedHeapObjectTypes(); + + /** + * Get statistics about objects in the heap. + * + * \param object_statistics The HeapObjectStatistics object to fill in + * statistics of objects of given type, which were live in the previous GC. + * \param type_index The index of the type of object to fill details about, + * which ranges from 0 to NumberOfTrackedHeapObjectTypes() - 1. + * \returns true on success. + */ + bool GetHeapObjectStatisticsAtLastGC(HeapObjectStatistics* object_statistics, + size_t type_index); + /** * Get a call stack sample from the isolate. * \param state Execution state. @@ -6174,7 +6454,7 @@ class V8_EXPORT TryCatch { * Returns the .stack property of the thrown object. If no .stack * property is present an empty handle is returned. */ - V8_DEPRECATE_SOON("Use maybe version.", Local StackTrace()) const; + V8_DEPRECATE_SOON("Use maybe version.", Local StackTrace() const); V8_WARN_UNUSED_RESULT MaybeLocal StackTrace( Local context) const; @@ -6370,6 +6650,12 @@ class V8_EXPORT Context { */ V8_INLINE Local GetEmbedderData(int index); + /** + * Gets the exports object used by V8 extras. Extra natives get a reference + * to this object and can use it to export functionality. + */ + Local GetExtrasExportsObject(); + /** * Sets the embedder data with the given index, growing the data as * needed. Note that index 0 currently has a special meaning for Chrome's @@ -6672,7 +6958,7 @@ class Internals { static const int kJSObjectHeaderSize = 3 * kApiPointerSize; static const int kFixedArrayHeaderSize = 2 * kApiPointerSize; static const int kContextHeaderSize = 2 * kApiPointerSize; - static const int kContextEmbedderDataIndex = 77; + static const int kContextEmbedderDataIndex = 80; static const int kFullStringRepresentationMask = 0x07; static const int kStringEncodingMask = 0x4; static const int kExternalTwoByteRepresentationTag = 0x02; @@ -6708,7 +6994,7 @@ class Internals { static const int kJSObjectType = 0xbe; static const int kFirstNonstringType = 0x80; static const int kOddballType = 0x83; - static const int kForeignType = 0x86; + static const int kForeignType = 0x87; static const int kUndefinedOddballKind = 5; static const int kNullOddballKind = 3; @@ -7064,9 +7350,20 @@ void ReturnValue::Set(const Persistent& handle) { } } -template -template -void ReturnValue::Set(const Handle handle) { +template +template +void ReturnValue::Set(const Global& handle) { + TYPE_CHECK(T, S); + if (V8_UNLIKELY(handle.IsEmpty())) { + *value_ = GetDefaultValue(); + } else { + *value_ = *reinterpret_cast(*handle); + } +} + +template +template +void ReturnValue::Set(const Local handle) { TYPE_CHECK(T, S); if (V8_UNLIKELY(handle.IsEmpty())) { *value_ = GetDefaultValue(); @@ -7225,6 +7522,24 @@ int FunctionCallbackInfo::Length() const { return length_; } +ScriptOrigin::ScriptOrigin(Handle resource_name, + Handle resource_line_offset, + Handle resource_column_offset, + Handle resource_is_shared_cross_origin, + Handle script_id, + Handle resource_is_embedder_debug_script, + Handle source_map_url, + Handle resource_is_opaque) + : resource_name_(resource_name), + resource_line_offset_(resource_line_offset), + resource_column_offset_(resource_column_offset), + options_(!resource_is_embedder_debug_script.IsEmpty() && + resource_is_embedder_debug_script->IsTrue(), + !resource_is_shared_cross_origin.IsEmpty() && + resource_is_shared_cross_origin->IsTrue(), + !resource_is_opaque.IsEmpty() && resource_is_opaque->IsTrue()), + script_id_(script_id), + source_map_url_(source_map_url) {} Handle ScriptOrigin::ResourceName() const { return resource_name_; @@ -7241,16 +7556,6 @@ Handle ScriptOrigin::ResourceColumnOffset() const { } -Handle ScriptOrigin::ResourceIsEmbedderDebugScript() const { - return resource_is_embedder_debug_script_; -} - - -Handle ScriptOrigin::ResourceIsSharedCrossOrigin() const { - return resource_is_shared_cross_origin_; -} - - Handle ScriptOrigin::ScriptID() const { return script_id_; } @@ -7265,8 +7570,7 @@ ScriptCompiler::Source::Source(Local string, const ScriptOrigin& origin, resource_name(origin.ResourceName()), resource_line_offset(origin.ResourceLineOffset()), resource_column_offset(origin.ResourceColumnOffset()), - resource_is_embedder_debug_script(origin.ResourceIsEmbedderDebugScript()), - resource_is_shared_cross_origin(origin.ResourceIsSharedCrossOrigin()), + resource_options(origin.Options()), source_map_url(origin.SourceMapUrl()), cached_data(data) {} @@ -7293,7 +7597,9 @@ Handle Boolean::New(Isolate* isolate, bool value) { void Template::Set(Isolate* isolate, const char* name, v8::Handle value) { - Set(v8::String::NewFromUtf8(isolate, name), value); + Set(v8::String::NewFromUtf8(isolate, name, NewStringType::kNormal) + .ToLocalChecked(), + value); } @@ -7446,41 +7752,51 @@ template Value* Value::Cast(T* value) { Local Value::ToBoolean() const { - return ToBoolean(Isolate::GetCurrent()); + return ToBoolean(Isolate::GetCurrent()->GetCurrentContext()) + .FromMaybe(Local()); } Local Value::ToNumber() const { - return ToNumber(Isolate::GetCurrent()); + return ToNumber(Isolate::GetCurrent()->GetCurrentContext()) + .FromMaybe(Local()); } Local Value::ToString() const { - return ToString(Isolate::GetCurrent()); + return ToString(Isolate::GetCurrent()->GetCurrentContext()) + .FromMaybe(Local()); } Local Value::ToDetailString() const { - return ToDetailString(Isolate::GetCurrent()); + return ToDetailString(Isolate::GetCurrent()->GetCurrentContext()) + .FromMaybe(Local()); } Local Value::ToObject() const { - return ToObject(Isolate::GetCurrent()); + return ToObject(Isolate::GetCurrent()->GetCurrentContext()) + .FromMaybe(Local()); } Local Value::ToInteger() const { - return ToInteger(Isolate::GetCurrent()); + return ToInteger(Isolate::GetCurrent()->GetCurrentContext()) + .FromMaybe(Local()); } Local Value::ToUint32() const { - return ToUint32(Isolate::GetCurrent()); + return ToUint32(Isolate::GetCurrent()->GetCurrentContext()) + .FromMaybe(Local()); } -Local Value::ToInt32() const { return ToInt32(Isolate::GetCurrent()); } +Local Value::ToInt32() const { + return ToInt32(Isolate::GetCurrent()->GetCurrentContext()) + .FromMaybe(Local()); +} Boolean* Boolean::Cast(v8::Value* value) { @@ -7603,6 +7919,22 @@ Array* Array::Cast(v8::Value* value) { } +Map* Map::Cast(v8::Value* value) { +#ifdef V8_ENABLE_CHECKS + CheckCast(value); +#endif + return static_cast(value); +} + + +Set* Set::Cast(v8::Value* value) { +#ifdef V8_ENABLE_CHECKS + CheckCast(value); +#endif + return static_cast(value); +} + + Promise* Promise::Cast(v8::Value* value) { #ifdef V8_ENABLE_CHECKS CheckCast(value); @@ -7723,6 +8055,14 @@ DataView* DataView::Cast(v8::Value* value) { } +SharedArrayBuffer* SharedArrayBuffer::Cast(v8::Value* value) { +#ifdef V8_ENABLE_CHECKS + CheckCast(value); +#endif + return static_cast(value); +} + + Function* Function::Cast(v8::Value* value) { #ifdef V8_ENABLE_CHECKS CheckCast(value); diff --git a/deps/v8/include/v8config.h b/deps/v8/include/v8config.h index 991a43afd445c0..4f4b2cd55eae9b 100644 --- a/deps/v8/include/v8config.h +++ b/deps/v8/include/v8config.h @@ -5,6 +5,8 @@ #ifndef V8CONFIG_H_ #define V8CONFIG_H_ +// clang-format off + // Platform headers for feature detection below. #if defined(__ANDROID__) # include @@ -183,6 +185,7 @@ // V8_HAS_BUILTIN_POPCOUNT - __builtin_popcount() supported // V8_HAS_BUILTIN_SADD_OVERFLOW - __builtin_sadd_overflow() supported // V8_HAS_BUILTIN_SSUB_OVERFLOW - __builtin_ssub_overflow() supported +// V8_HAS_BUILTIN_UADD_OVERFLOW - __builtin_uadd_overflow() supported // V8_HAS_DECLSPEC_ALIGN - __declspec(align(n)) supported // V8_HAS_DECLSPEC_DEPRECATED - __declspec(deprecated) supported // V8_HAS_DECLSPEC_NOINLINE - __declspec(noinline) supported @@ -199,8 +202,6 @@ #if defined(__GNUC__) // Clang in gcc mode. # define V8_CC_GNU 1 -#elif defined(_MSC_VER) // Clang in cl mode. -# define V8_CC_MSVC 1 #endif // Clang defines __alignof__ as alias for __alignof @@ -223,6 +224,7 @@ # define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount)) # define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow)) # define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow)) +# define V8_HAS_BUILTIN_UADD_OVERFLOW (__has_builtin(__builtin_uadd_overflow)) # define V8_HAS_CXX11_ALIGNAS (__has_feature(cxx_alignas)) # define V8_HAS_CXX11_STATIC_ASSERT (__has_feature(cxx_static_assert)) @@ -230,10 +232,15 @@ #elif defined(__GNUC__) # define V8_CC_GNU 1 -// Intel C++ also masquerades as GCC 3.2.0 -# define V8_CC_INTEL (defined(__INTEL_COMPILER)) -# define V8_CC_MINGW32 (defined(__MINGW32__)) -# define V8_CC_MINGW64 (defined(__MINGW64__)) +# if defined(__INTEL_COMPILER) // Intel C++ also masquerades as GCC 3.2.0 +# define V8_CC_INTEL 1 +# endif +# if defined(__MINGW32__) +# define V8_CC_MINGW32 1 +# endif +# if defined(__MINGW64__) +# define V8_CC_MINGW64 1 +# endif # define V8_CC_MINGW (V8_CC_MINGW32 || V8_CC_MINGW64) # define V8_HAS___ALIGNOF__ (V8_GNUC_PREREQ(4, 3, 0)) @@ -268,11 +275,10 @@ # define V8_HAS_CXX11_ALIGNOF (V8_GNUC_PREREQ(4, 8, 0)) # define V8_HAS_CXX11_STATIC_ASSERT (V8_GNUC_PREREQ(4, 3, 0)) # endif +#endif -#elif defined(_MSC_VER) - +#if defined(_MSC_VER) # define V8_CC_MSVC 1 - # define V8_HAS___ALIGNOF 1 # define V8_HAS_DECLSPEC_ALIGN 1 @@ -313,22 +319,33 @@ #endif -// A macro to mark classes or functions as deprecated. +// A macro (V8_DEPRECATED) to mark classes or functions as deprecated. #if defined(V8_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED_MESSAGE -# define V8_DEPRECATED(message, declarator) \ -declarator __attribute__((deprecated(message))) +#define V8_DEPRECATED(message, declarator) \ + declarator __attribute__((deprecated(message))) #elif defined(V8_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED -# define V8_DEPRECATED(message, declarator) \ -declarator __attribute__((deprecated)) +#define V8_DEPRECATED(message, declarator) \ + declarator __attribute__((deprecated)) #elif defined(V8_DEPRECATION_WARNINGS) && V8_HAS_DECLSPEC_DEPRECATED -# define V8_DEPRECATED(message, declarator) __declspec(deprecated) declarator +#define V8_DEPRECATED(message, declarator) __declspec(deprecated) declarator #else -# define V8_DEPRECATED(message, declarator) declarator +#define V8_DEPRECATED(message, declarator) declarator #endif -// a macro to make it easier to see what will be deprecated. +// A macro (V8_DEPRECATE_SOON) to make it easier to see what will be deprecated. +#if defined(V8_IMMINENT_DEPRECATION_WARNINGS) && \ + V8_HAS_ATTRIBUTE_DEPRECATED_MESSAGE +#define V8_DEPRECATE_SOON(message, declarator) \ + declarator __attribute__((deprecated(message))) +#elif defined(V8_IMMINENT_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED +#define V8_DEPRECATE_SOON(message, declarator) \ + declarator __attribute__((deprecated)) +#elif defined(V8_IMMINENT_DEPRECATION_WARNINGS) && V8_HAS_DECLSPEC_DEPRECATED +#define V8_DEPRECATE_SOON(message, declarator) __declspec(deprecated) declarator +#else #define V8_DEPRECATE_SOON(message, declarator) declarator +#endif // A macro to provide the compiler with branch prediction information. @@ -402,4 +419,6 @@ namespace v8 { template class AlignOfHelper { char c; T t; }; } #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ #endif +// clang-format on + #endif // V8CONFIG_H_ diff --git a/deps/v8/infra/OWNERS b/deps/v8/infra/OWNERS new file mode 100644 index 00000000000000..ea6f5446ee7e90 --- /dev/null +++ b/deps/v8/infra/OWNERS @@ -0,0 +1,3 @@ +machenbach@chromium.org +sergiyb@chromium.org +tandrii@chromium.org diff --git a/deps/v8/infra/README.md b/deps/v8/infra/README.md new file mode 100644 index 00000000000000..5788e8ad72a95d --- /dev/null +++ b/deps/v8/infra/README.md @@ -0,0 +1 @@ +This directory contains infra-specific files. diff --git a/deps/v8/testing/commit_queue/OWNERS b/deps/v8/infra/config/OWNERS similarity index 100% rename from deps/v8/testing/commit_queue/OWNERS rename to deps/v8/infra/config/OWNERS diff --git a/deps/v8/infra/config/cq.cfg b/deps/v8/infra/config/cq.cfg new file mode 100644 index 00000000000000..ae745bfca57e90 --- /dev/null +++ b/deps/v8/infra/config/cq.cfg @@ -0,0 +1,51 @@ +# See http://luci-config.appspot.com/schemas/projects/refs:cq.cfg for the +# documentation of this file format. + +version: 1 +cq_name: "v8" +cq_status_url: "https://chromium-cq-status.appspot.com" +hide_ref_in_committed_msg: true +commit_burst_delay: 60 +max_commit_burst: 1 +target_ref: "refs/pending/heads/master" + +rietveld { + url: "https://codereview.chromium.org" +} + +verifiers { + reviewer_lgtm { + committer_list: "v8" + } + + tree_status { + tree_status_url: "https://v8-status.appspot.com" + } + + try_job { + buckets { + name: "tryserver.v8" + builders { name: "v8_android_arm_compile_rel" } + builders { name: "v8_linux64_asan_rel" } + builders { name: "v8_linux64_avx2_rel" } + builders { name: "v8_linux64_rel" } + builders { name: "v8_linux_arm64_rel" } + builders { name: "v8_linux_arm_rel" } + builders { name: "v8_linux_chromium_gn_rel" } + builders { name: "v8_linux_dbg" } + builders { name: "v8_linux_gcc_compile_rel" } + builders { name: "v8_linux_mipsel_compile_rel" } + builders { name: "v8_linux_mips64el_compile_rel" } + builders { name: "v8_linux_nodcheck_rel" } + builders { name: "v8_linux_rel" } + builders { name: "v8_mac_rel" } + builders { name: "v8_presubmit" } + builders { name: "v8_win64_rel" } + builders { name: "v8_win_compile_dbg" } + builders { name: "v8_win_nosnap_shared_compile_rel" } + builders { name: "v8_win_rel" } + } + } + + sign_cla {} +} diff --git a/deps/v8/infra/project-config/README.md b/deps/v8/infra/project-config/README.md new file mode 100644 index 00000000000000..34a89cef0acee2 --- /dev/null +++ b/deps/v8/infra/project-config/README.md @@ -0,0 +1 @@ +This directory contains v8 project-wide configurations for infra services. diff --git a/deps/v8/infra/project-config/cr-buildbucket.cfg b/deps/v8/infra/project-config/cr-buildbucket.cfg new file mode 100644 index 00000000000000..544940bbaf3bf6 --- /dev/null +++ b/deps/v8/infra/project-config/cr-buildbucket.cfg @@ -0,0 +1,23 @@ +# Defines buckets on cr-buildbucket.appspot.com, used to schedule builds +# on buildbot. In particular, CQ uses some of these buckets to schedule tryjobs. +# +# See http://luci-config.appspot.com/schemas/projects:buildbucket.cfg for +# schema of this file and documentation. +# +# Please keep this list sorted by bucket name. + +buckets { + name: "master.tryserver.v8" + acls { + role: READER + group: "all" + } + acls { + role: SCHEDULER + group: "service-account-cq" + } + acls { + role: WRITER + group: "service-account-v8-master" + } +} diff --git a/deps/v8/samples/hello-world.cc b/deps/v8/samples/hello-world.cc new file mode 100644 index 00000000000000..c38c76022cd67e --- /dev/null +++ b/deps/v8/samples/hello-world.cc @@ -0,0 +1,69 @@ +// 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. + +#include +#include +#include + +#include "include/libplatform/libplatform.h" +#include "include/v8.h" + +using namespace v8; + +class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { + public: + virtual void* Allocate(size_t length) { + void* data = AllocateUninitialized(length); + return data == NULL ? data : memset(data, 0, length); + } + virtual void* AllocateUninitialized(size_t length) { return malloc(length); } + virtual void Free(void* data, size_t) { free(data); } +}; + + +int main(int argc, char* argv[]) { + // Initialize V8. + V8::InitializeICU(); + Platform* platform = platform::CreateDefaultPlatform(); + V8::InitializePlatform(platform); + V8::Initialize(); + + // Create a new Isolate and make it the current one. + ArrayBufferAllocator allocator; + Isolate::CreateParams create_params; + create_params.array_buffer_allocator = &allocator; + Isolate* isolate = Isolate::New(create_params); + { + Isolate::Scope isolate_scope(isolate); + + // Create a stack-allocated handle scope. + HandleScope handle_scope(isolate); + + // Create a new context. + Local context = Context::New(isolate); + + // Enter the context for compiling and running the hello world script. + Context::Scope context_scope(context); + + // Create a string containing the JavaScript source code. + Local source = String::NewFromUtf8(isolate, "'Hello' + ', World!'"); + + // Compile the source code. + Local