From 67e078094b53861a5aa7e9354e33487d0bd4f73b Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 31 Mar 2014 14:38:28 +0200 Subject: [PATCH] deps: upgrade v8 to 3.25.30 --- deps/v8/.gitignore | 3 +- deps/v8/AUTHORS | 4 + deps/v8/ChangeLog | 399 + deps/v8/DEPS | 2 +- deps/v8/LICENSE | 2 +- deps/v8/Makefile | 44 +- deps/v8/Makefile.android | 60 +- deps/v8/PRESUBMIT.py | 9 + deps/v8/build/all.gyp | 1 + deps/v8/build/android.gypi | 34 +- deps/v8/build/features.gypi | 2 +- deps/v8/build/standalone.gypi | 30 +- deps/v8/build/toolchain.gypi | 19 +- deps/v8/include/v8-debug.h | 0 deps/v8/include/v8-profiler.h | 68 +- deps/v8/include/v8-util.h | 355 + deps/v8/include/v8.h | 573 +- deps/v8/samples/lineprocessor.cc | 3 +- deps/v8/samples/shell.cc | 3 +- deps/v8/src/accessors.cc | 41 +- deps/v8/src/accessors.h | 2 - deps/v8/src/allocation-tracker.cc | 173 +- deps/v8/src/allocation-tracker.h | 56 +- deps/v8/src/api.cc | 806 +- deps/v8/src/api.h | 3 +- deps/v8/src/arm/OWNERS | 1 + deps/v8/src/arm/assembler-arm-inl.h | 82 +- deps/v8/src/arm/assembler-arm.cc | 438 +- deps/v8/src/arm/assembler-arm.h | 120 +- deps/v8/src/arm/builtins-arm.cc | 178 +- deps/v8/src/arm/code-stubs-arm.cc | 516 +- deps/v8/src/arm/code-stubs-arm.h | 2 +- deps/v8/src/arm/constants-arm.h | 2 +- deps/v8/src/arm/debug-arm.cc | 12 +- deps/v8/src/arm/deoptimizer-arm.cc | 33 +- deps/v8/src/arm/disasm-arm.cc | 12 +- deps/v8/src/arm/full-codegen-arm.cc | 494 +- deps/v8/src/arm/ic-arm.cc | 26 +- deps/v8/src/arm/lithium-arm.cc | 278 +- deps/v8/src/arm/lithium-arm.h | 234 +- deps/v8/src/arm/lithium-codegen-arm.cc | 740 +- deps/v8/src/arm/lithium-codegen-arm.h | 23 +- deps/v8/src/arm/macro-assembler-arm.cc | 167 +- deps/v8/src/arm/macro-assembler-arm.h | 87 +- deps/v8/src/arm/simulator-arm.cc | 10 +- deps/v8/src/arm/simulator-arm.h | 4 + deps/v8/src/arm/stub-cache-arm.cc | 190 +- deps/v8/src/arm64/OWNERS | 1 + deps/v8/src/arm64/assembler-arm64-inl.h | 1229 ++ deps/v8/src/arm64/assembler-arm64.cc | 2813 ++++ deps/v8/src/arm64/assembler-arm64.h | 2233 ++++ deps/v8/src/arm64/builtins-arm64.cc | 1562 +++ deps/v8/src/arm64/code-stubs-arm64.cc | 5743 ++++++++ deps/v8/src/arm64/code-stubs-arm64.h | 500 + deps/v8/src/arm64/codegen-arm64.cc | 615 + deps/v8/src/arm64/codegen-arm64.h | 71 + deps/v8/src/arm64/constants-arm64.h | 1271 ++ deps/v8/src/arm64/cpu-arm64.cc | 199 + deps/v8/src/arm64/cpu-arm64.h | 107 + deps/v8/src/arm64/debug-arm64.cc | 393 + deps/v8/src/arm64/decoder-arm64-inl.h | 671 + deps/v8/src/arm64/decoder-arm64.cc | 109 + deps/v8/src/arm64/decoder-arm64.h | 210 + deps/v8/src/arm64/deoptimizer-arm64.cc | 388 + deps/v8/src/arm64/disasm-arm64.cc | 1856 +++ deps/v8/src/arm64/disasm-arm64.h | 115 + deps/v8/src/arm64/frames-arm64.cc | 65 + deps/v8/src/arm64/frames-arm64.h | 133 + deps/v8/src/arm64/full-codegen-arm64.cc | 5015 +++++++ deps/v8/src/arm64/ic-arm64.cc | 1407 ++ deps/v8/src/arm64/instructions-arm64.cc | 333 + deps/v8/src/arm64/instructions-arm64.h | 501 + deps/v8/src/arm64/instrument-arm64.cc | 618 + deps/v8/src/arm64/instrument-arm64.h | 107 + deps/v8/src/arm64/lithium-arm64.cc | 2576 ++++ deps/v8/src/arm64/lithium-arm64.h | 3100 +++++ deps/v8/src/arm64/lithium-codegen-arm64.cc | 5901 +++++++++ deps/v8/src/arm64/lithium-codegen-arm64.h | 490 + .../src/arm64/lithium-gap-resolver-arm64.cc | 334 + .../v8/src/arm64/lithium-gap-resolver-arm64.h | 90 + deps/v8/src/arm64/macro-assembler-arm64-inl.h | 1677 +++ deps/v8/src/arm64/macro-assembler-arm64.cc | 5184 ++++++++ deps/v8/src/arm64/macro-assembler-arm64.h | 2310 ++++ .../src/arm64/regexp-macro-assembler-arm64.cc | 1728 +++ .../src/arm64/regexp-macro-assembler-arm64.h | 315 + deps/v8/src/arm64/simulator-arm64.cc | 3645 ++++++ deps/v8/src/arm64/simulator-arm64.h | 908 ++ deps/v8/src/arm64/stub-cache-arm64.cc | 1496 +++ deps/v8/src/arm64/utils-arm64.cc | 112 + deps/v8/src/arm64/utils-arm64.h | 135 + deps/v8/src/array-iterator.js | 10 +- deps/v8/src/array.js | 14 +- deps/v8/src/assembler.cc | 95 +- deps/v8/src/assembler.h | 87 +- deps/v8/src/assert-scope.cc | 21 + deps/v8/src/assert-scope.h | 129 +- deps/v8/src/ast.cc | 49 +- deps/v8/src/ast.h | 90 +- deps/v8/src/atomicops.h | 33 +- deps/v8/src/atomicops_internals_arm64_gcc.h | 372 + deps/v8/src/atomicops_internals_arm_gcc.h | 237 +- .../atomicops_internals_atomicword_compat.h | 122 + ...x86_macosx.h => atomicops_internals_mac.h} | 104 +- deps/v8/src/atomicops_internals_tsan.h | 194 +- deps/v8/src/atomicops_internals_x86_msvc.h | 14 + deps/v8/src/bootstrapper.cc | 190 +- deps/v8/src/bootstrapper.h | 1 + deps/v8/src/builtins.cc | 503 +- deps/v8/src/builtins.h | 6 +- deps/v8/src/char-predicates.h | 21 + deps/v8/src/checks.cc | 37 +- deps/v8/src/checks.h | 26 +- deps/v8/src/circular-queue.h | 1 + deps/v8/src/code-stubs-hydrogen.cc | 251 +- deps/v8/src/code-stubs.cc | 23 +- deps/v8/src/code-stubs.h | 205 +- deps/v8/src/codegen.cc | 10 +- deps/v8/src/codegen.h | 2 + deps/v8/src/collection.js | 173 - deps/v8/src/compilation-cache.cc | 10 +- deps/v8/src/compilation-cache.h | 9 +- deps/v8/src/compiler.cc | 129 +- deps/v8/src/compiler.h | 94 +- deps/v8/src/contexts.cc | 14 +- deps/v8/src/contexts.h | 81 +- deps/v8/src/conversions-inl.h | 2 +- deps/v8/src/counters.cc | 8 +- deps/v8/src/d8-debug.cc | 2 + deps/v8/src/d8-debug.h | 1 + deps/v8/src/d8.cc | 82 +- deps/v8/src/d8.h | 4 +- deps/v8/src/date.cc | 1 + deps/v8/src/date.h | 15 +- deps/v8/src/date.js | 23 +- deps/v8/src/dateparser.h | 2 +- deps/v8/src/debug.cc | 47 +- deps/v8/src/deoptimizer.cc | 170 +- deps/v8/src/deoptimizer.h | 4 +- deps/v8/src/disassembler.cc | 2 +- deps/v8/src/elements-kind.cc | 21 +- deps/v8/src/elements-kind.h | 17 +- deps/v8/src/elements.cc | 695 +- deps/v8/src/elements.h | 55 +- deps/v8/src/execution.cc | 56 +- deps/v8/src/execution.h | 9 +- .../externalize-string-extension.cc | 4 +- deps/v8/src/factory.cc | 150 +- deps/v8/src/factory.h | 66 +- deps/v8/src/feedback-slots.h | 110 + deps/v8/src/flag-definitions.h | 79 +- deps/v8/src/frames-inl.h | 7 + deps/v8/src/frames.cc | 8 + deps/v8/src/frames.h | 21 +- deps/v8/src/full-codegen.cc | 65 +- deps/v8/src/full-codegen.h | 43 +- deps/v8/src/func-name-inferrer.cc | 11 +- deps/v8/src/func-name-inferrer.h | 4 + deps/v8/src/global-handles.cc | 10 +- deps/v8/src/global-handles.h | 3 +- deps/v8/src/globals.h | 56 +- deps/v8/src/handles-inl.h | 3 +- deps/v8/src/handles.cc | 39 +- deps/v8/src/harmony-array.js | 4 +- deps/v8/src/harmony-math.js | 104 +- deps/v8/src/heap-inl.h | 84 +- deps/v8/src/heap-profiler.cc | 5 +- deps/v8/src/heap-snapshot-generator.cc | 294 +- deps/v8/src/heap-snapshot-generator.h | 62 +- deps/v8/src/heap.cc | 576 +- deps/v8/src/heap.h | 203 +- deps/v8/src/hydrogen-bce.cc | 47 +- deps/v8/src/hydrogen-check-elimination.cc | 296 +- deps/v8/src/hydrogen-flow-engine.h | 19 +- deps/v8/src/hydrogen-gvn.cc | 510 +- deps/v8/src/hydrogen-gvn.h | 94 +- deps/v8/src/hydrogen-instructions.cc | 577 +- deps/v8/src/hydrogen-instructions.h | 636 +- deps/v8/src/hydrogen-load-elimination.cc | 92 +- deps/v8/src/hydrogen-minus-zero.cc | 91 - deps/v8/src/hydrogen-range-analysis.cc | 99 +- deps/v8/src/hydrogen-range-analysis.h | 15 +- .../v8/src/hydrogen-representation-changes.cc | 10 +- deps/v8/src/hydrogen-store-elimination.cc | 139 + ...us-zero.h => hydrogen-store-elimination.h} | 27 +- deps/v8/src/hydrogen.cc | 1267 +- deps/v8/src/hydrogen.h | 191 +- deps/v8/src/i18n.cc | 80 +- deps/v8/src/ia32/assembler-ia32-inl.h | 27 +- deps/v8/src/ia32/assembler-ia32.cc | 30 +- deps/v8/src/ia32/assembler-ia32.h | 35 +- deps/v8/src/ia32/builtins-ia32.cc | 133 +- deps/v8/src/ia32/code-stubs-ia32.cc | 500 +- deps/v8/src/ia32/code-stubs-ia32.h | 3 +- deps/v8/src/ia32/debug-ia32.cc | 16 +- deps/v8/src/ia32/deoptimizer-ia32.cc | 35 +- deps/v8/src/ia32/disasm-ia32.cc | 63 +- deps/v8/src/ia32/frames-ia32.h | 2 + deps/v8/src/ia32/full-codegen-ia32.cc | 426 +- deps/v8/src/ia32/ic-ia32.cc | 26 +- deps/v8/src/ia32/lithium-codegen-ia32.cc | 825 +- deps/v8/src/ia32/lithium-codegen-ia32.h | 12 +- deps/v8/src/ia32/lithium-gap-resolver-ia32.cc | 4 +- deps/v8/src/ia32/lithium-ia32.cc | 403 +- deps/v8/src/ia32/lithium-ia32.h | 248 +- deps/v8/src/ia32/macro-assembler-ia32.cc | 165 +- deps/v8/src/ia32/macro-assembler-ia32.h | 30 +- .../src/ia32/regexp-macro-assembler-ia32.cc | 2 +- deps/v8/src/ia32/stub-cache-ia32.cc | 168 +- deps/v8/src/ic-inl.h | 61 +- deps/v8/src/ic.cc | 402 +- deps/v8/src/ic.h | 115 +- deps/v8/src/icu_util.cc | 58 +- deps/v8/src/icu_util.h | 2 +- deps/v8/src/incremental-marking.cc | 22 - deps/v8/src/incremental-marking.h | 6 +- deps/v8/src/interpreter-irregexp.cc | 22 +- deps/v8/src/isolate.cc | 189 +- deps/v8/src/isolate.h | 216 +- deps/v8/src/json-parser.h | 8 +- deps/v8/src/json-stringifier.h | 56 +- deps/v8/src/json.js | 22 + deps/v8/src/jsregexp.cc | 20 +- deps/v8/src/libplatform/default-platform.h | 4 +- deps/v8/src/lithium-allocator-inl.h | 2 + deps/v8/src/lithium-allocator.cc | 2 + deps/v8/src/lithium-allocator.h | 4 - deps/v8/src/lithium-codegen.cc | 19 +- deps/v8/src/lithium-codegen.h | 2 +- deps/v8/src/lithium.cc | 48 +- deps/v8/src/lithium.h | 157 +- deps/v8/src/liveedit.cc | 154 +- deps/v8/src/log.cc | 30 +- deps/v8/src/log.h | 9 +- deps/v8/src/macro-assembler.h | 9 + deps/v8/src/macros.py | 1 + deps/v8/src/mark-compact-inl.h | 5 +- deps/v8/src/mark-compact.cc | 261 +- deps/v8/src/mark-compact.h | 23 +- deps/v8/src/messages.cc | 6 - deps/v8/src/messages.h | 1 - deps/v8/src/messages.js | 49 +- deps/v8/src/mips/assembler-mips-inl.h | 28 +- deps/v8/src/mips/assembler-mips.cc | 24 +- deps/v8/src/mips/assembler-mips.h | 30 +- deps/v8/src/mips/builtins-mips.cc | 129 +- deps/v8/src/mips/code-stubs-mips.cc | 474 +- deps/v8/src/mips/code-stubs-mips.h | 2 +- deps/v8/src/mips/debug-mips.cc | 10 +- deps/v8/src/mips/deoptimizer-mips.cc | 33 +- deps/v8/src/mips/frames-mips.h | 2 + deps/v8/src/mips/full-codegen-mips.cc | 393 +- deps/v8/src/mips/ic-mips.cc | 34 +- deps/v8/src/mips/lithium-codegen-mips.cc | 688 +- deps/v8/src/mips/lithium-codegen-mips.h | 12 +- deps/v8/src/mips/lithium-mips.cc | 252 +- deps/v8/src/mips/lithium-mips.h | 243 +- deps/v8/src/mips/macro-assembler-mips.cc | 109 +- deps/v8/src/mips/macro-assembler-mips.h | 15 +- deps/v8/src/mips/simulator-mips.cc | 10 +- deps/v8/src/mips/simulator-mips.h | 4 + deps/v8/src/mips/stub-cache-mips.cc | 185 +- deps/v8/src/mirror-debugger.js | 111 +- deps/v8/src/object-observe.js | 153 +- deps/v8/src/objects-debug.cc | 25 +- deps/v8/src/objects-inl.h | 689 +- deps/v8/src/objects-printer.cc | 68 +- deps/v8/src/objects-visiting-inl.h | 33 +- deps/v8/src/objects-visiting.h | 2 + deps/v8/src/objects.cc | 1885 ++- deps/v8/src/objects.h | 669 +- deps/v8/src/optimizing-compiler-thread.cc | 10 +- deps/v8/src/parser.cc | 2325 +--- deps/v8/src/parser.h | 425 +- deps/v8/src/platform-cygwin.cc | 4 +- deps/v8/src/platform-freebsd.cc | 4 +- deps/v8/src/platform-linux.cc | 7 +- deps/v8/src/platform-macos.cc | 4 +- deps/v8/src/platform-openbsd.cc | 4 +- deps/v8/src/platform-posix.cc | 43 +- deps/v8/src/platform-qnx.cc | 4 +- deps/v8/src/platform-solaris.cc | 4 +- deps/v8/src/platform-win32.cc | 272 +- deps/v8/src/platform.h | 13 +- deps/v8/src/preparse-data-format.h | 2 +- deps/v8/src/preparse-data.cc | 104 +- deps/v8/src/preparse-data.h | 235 +- deps/v8/src/preparser.cc | 941 +- deps/v8/src/preparser.h | 2088 ++- deps/v8/src/profile-generator-inl.h | 2 +- deps/v8/src/promise.js | 154 +- deps/v8/src/property-details-inl.h | 51 + deps/v8/src/property-details.h | 18 +- deps/v8/src/property.h | 87 +- deps/v8/src/regexp-macro-assembler-tracer.cc | 5 +- deps/v8/src/regexp-macro-assembler.h | 1 + deps/v8/src/runtime.cc | 1363 +- deps/v8/src/runtime.h | 260 +- deps/v8/src/runtime.js | 14 +- deps/v8/src/sampler.cc | 58 +- deps/v8/src/scanner.cc | 144 +- deps/v8/src/scanner.h | 211 +- deps/v8/src/scopeinfo.cc | 8 +- deps/v8/src/scopes.cc | 65 +- deps/v8/src/scopes.h | 40 +- deps/v8/src/serialize.cc | 64 +- deps/v8/src/serialize.h | 1 - deps/v8/src/simulator.h | 2 + deps/v8/src/spaces.cc | 78 +- deps/v8/src/spaces.h | 81 +- deps/v8/src/store-buffer.cc | 31 +- deps/v8/src/stub-cache.cc | 99 +- deps/v8/src/stub-cache.h | 81 +- deps/v8/src/sweeper-thread.cc | 1 + deps/v8/src/symbol.js | 85 +- deps/v8/src/token.h | 2 +- deps/v8/src/transitions-inl.h | 1 - deps/v8/src/type-info.cc | 124 +- deps/v8/src/type-info.h | 22 +- deps/v8/src/typedarray.js | 24 +- deps/v8/src/types.cc | 115 +- deps/v8/src/types.h | 205 +- deps/v8/src/typing.cc | 22 +- deps/v8/src/unicode.cc | 40 +- deps/v8/src/unicode.h | 3 - deps/v8/src/unique.h | 4 + deps/v8/src/uri.h | 9 +- deps/v8/src/utils.cc | 14 - deps/v8/src/utils.h | 103 +- deps/v8/src/v8.cc | 33 +- deps/v8/src/v8.h | 2 + deps/v8/src/v8globals.h | 7 +- deps/v8/src/v8natives.js | 40 +- deps/v8/src/variables.cc | 4 +- deps/v8/src/variables.h | 2 +- deps/v8/src/version.cc | 6 +- deps/v8/src/vm-state-inl.h | 3 +- deps/v8/src/weak_collection.js | 206 + deps/v8/src/win32-headers.h | 1 + deps/v8/src/x64/assembler-x64-inl.h | 23 +- deps/v8/src/x64/assembler-x64.cc | 329 +- deps/v8/src/x64/assembler-x64.h | 761 +- deps/v8/src/x64/builtins-x64.cc | 340 +- deps/v8/src/x64/code-stubs-x64.cc | 867 +- deps/v8/src/x64/code-stubs-x64.h | 22 +- deps/v8/src/x64/codegen-x64.cc | 36 +- deps/v8/src/x64/debug-x64.cc | 32 +- deps/v8/src/x64/deoptimizer-x64.cc | 86 +- deps/v8/src/x64/disasm-x64.cc | 60 +- deps/v8/src/x64/frames-x64.h | 2 + deps/v8/src/x64/full-codegen-x64.cc | 751 +- deps/v8/src/x64/ic-x64.cc | 112 +- deps/v8/src/x64/lithium-codegen-x64.cc | 1097 +- deps/v8/src/x64/lithium-codegen-x64.h | 7 +- deps/v8/src/x64/lithium-gap-resolver-x64.cc | 12 +- deps/v8/src/x64/lithium-x64.cc | 435 +- deps/v8/src/x64/lithium-x64.h | 259 +- deps/v8/src/x64/macro-assembler-x64.cc | 790 +- deps/v8/src/x64/macro-assembler-x64.h | 43 +- deps/v8/src/x64/regexp-macro-assembler-x64.cc | 222 +- deps/v8/src/x64/stub-cache-x64.cc | 248 +- deps/v8/src/zone-allocator.h | 14 +- deps/v8/src/zone-inl.h | 29 +- deps/v8/src/zone.cc | 6 + deps/v8/src/zone.h | 12 +- deps/v8/test/benchmarks/benchmarks.status | 8 +- deps/v8/test/cctest/cctest.gyp | 15 + deps/v8/test/cctest/cctest.h | 74 +- deps/v8/test/cctest/cctest.status | 61 +- deps/v8/test/cctest/test-accessors.cc | 15 +- deps/v8/test/cctest/test-api.cc | 1339 +- deps/v8/test/cctest/test-assembler-arm.cc | 21 +- deps/v8/test/cctest/test-assembler-arm64.cc | 10801 ++++++++++++++++ deps/v8/test/cctest/test-assembler-x64.cc | 76 +- deps/v8/test/cctest/test-atomicops.cc | 276 + deps/v8/test/cctest/test-code-stubs-arm64.cc | 189 + deps/v8/test/cctest/test-code-stubs-x64.cc | 24 +- deps/v8/test/cctest/test-code-stubs.cc | 33 +- deps/v8/test/cctest/test-compiler.cc | 5 +- deps/v8/test/cctest/test-constantpool.cc | 40 +- deps/v8/test/cctest/test-cpu-profiler.cc | 16 +- deps/v8/test/cctest/test-date.cc | 22 + deps/v8/test/cctest/test-debug.cc | 144 +- deps/v8/test/cctest/test-decls.cc | 3 - deps/v8/test/cctest/test-deoptimization.cc | 2 - deps/v8/test/cctest/test-disasm-arm.cc | 12 +- deps/v8/test/cctest/test-disasm-arm64.cc | 1763 +++ deps/v8/test/cctest/test-disasm-ia32.cc | 15 +- deps/v8/test/cctest/test-disasm-x64.cc | 110 +- deps/v8/test/cctest/test-fuzz-arm64.cc | 71 + deps/v8/test/cctest/test-hashing.cc | 70 +- deps/v8/test/cctest/test-heap-profiler.cc | 167 +- deps/v8/test/cctest/test-heap.cc | 375 +- deps/v8/test/cctest/test-javascript-arm64.cc | 266 + .../v8/test/cctest/test-js-arm64-variables.cc | 143 + deps/v8/test/cctest/test-log.cc | 4 +- .../test/cctest/test-macro-assembler-ia32.cc | 28 + .../test/cctest/test-macro-assembler-mips.cc | 42 + .../test/cctest/test-macro-assembler-x64.cc | 140 +- deps/v8/test/cctest/test-mark-compact.cc | 10 +- deps/v8/test/cctest/test-mementos.cc | 74 +- .../v8/test/cctest/test-microtask-delivery.cc | 135 + deps/v8/test/cctest/test-object-observe.cc | 194 +- deps/v8/test/cctest/test-parsing.cc | 737 +- deps/v8/test/cctest/test-platform.cc | 6 + deps/v8/test/cctest/test-regexp.cc | 35 +- deps/v8/test/cctest/test-strings.cc | 97 +- deps/v8/test/cctest/test-symbols.cc | 2 +- deps/v8/test/cctest/test-types.cc | 247 +- deps/v8/test/cctest/test-utils-arm64.cc | 425 + deps/v8/test/cctest/test-utils-arm64.h | 233 + deps/v8/test/cctest/testcfg.py | 6 +- deps/v8/test/intl/intl.status | 3 +- deps/v8/test/message/message.status | 3 +- deps/v8/test/message/testcfg.py | 2 +- deps/v8/test/mjsunit/allocation-site-info.js | 9 +- .../mjsunit/array-constructor-feedback.js | 29 +- deps/v8/test/mjsunit/array-reduce.js | 0 deps/v8/test/mjsunit/assert-opt-and-deopt.js | 3 +- ...ompare_map_elim.js => compare-map-elim.js} | 0 .../mjsunit/compiler/compare-map-elim2.js | 130 + ...re_objeq_elim.js => compare-objeq-elim.js} | 0 .../concurrent-invalidate-transition-map.js | 7 +- .../compiler/dead-string-char-code-at.js | 10 +- .../mjsunit/compiler/division-by-constant.js | 131 + .../test/mjsunit/compiler/smi-stores-opt.js | 49 + .../mjsunit/compiler/store-elimination.js | 94 + .../mjsunit/compiler/to-fast-properties.js | 43 + .../constant-fold-control-instructions.js | 47 + deps/v8/test/mjsunit/debug-scopes.js | 27 +- deps/v8/test/mjsunit/debug-script.js | 2 +- deps/v8/test/mjsunit/dehoisted-array-index.js | 163 + deps/v8/test/mjsunit/deopt-with-fp-regs.js | 90 + deps/v8/test/mjsunit/div-mod.js | 6 + deps/v8/test/mjsunit/double-intrinsics.js | 36 + deps/v8/test/mjsunit/elements-kind.js | 113 +- deps/v8/test/mjsunit/es6/math-cbrt.js | 27 + deps/v8/test/mjsunit/es6/math-clz32.js | 36 + deps/v8/test/mjsunit/es6/math-expm1.js | 38 + deps/v8/test/mjsunit/es6/math-fround.js | 99 + .../{harmony => es6}/math-hyperbolic.js | 8 +- .../mjsunit/{harmony => es6}/math-hypot.js | 0 deps/v8/test/mjsunit/es6/math-log1p.js | 41 + .../{harmony => es6}/math-log2-log10.js | 0 .../mjsunit/{harmony => es6}/math-sign.js | 0 .../mjsunit/{harmony => es6}/math-trunc.js | 0 .../v8/test/mjsunit/es6/microtask-delivery.js | 168 + .../test/mjsunit/{harmony => es6}/promises.js | 210 +- .../mjsunit/{ => es6}/regress/regress-2034.js | 2 - .../mjsunit/{ => es6}/regress/regress-2156.js | 2 +- .../mjsunit/{ => es6}/regress/regress-2829.js | 2 - deps/v8/test/mjsunit/es6/weak_collections.js | 333 + .../{harmony => es7}/object-observe.js | 2 +- deps/v8/test/mjsunit/external-array.js | 1 + .../mjsunit/function-arguments-duplicate.js | 36 + deps/v8/test/mjsunit/fuzz-natives-part1.js | 35 +- deps/v8/test/mjsunit/fuzz-natives-part2.js | 36 +- deps/v8/test/mjsunit/fuzz-natives-part3.js | 35 +- deps/v8/test/mjsunit/fuzz-natives-part4.js | 35 +- deps/v8/test/mjsunit/getters-on-elements.js | 7 + .../mjsunit/harmony/block-let-declaration.js | 4 +- deps/v8/test/mjsunit/harmony/collections.js | 20 +- .../mjsunit/harmony/generators-objects.js | 4 +- .../mjsunit/harmony/generators-parsing.js | 4 +- deps/v8/test/mjsunit/harmony/private.js | 60 +- .../harmony/proxies-example-membrane.js | 2 +- .../test/mjsunit/harmony/proxies-function.js | 8 +- deps/v8/test/mjsunit/harmony/proxies.js | 6 +- .../{ => harmony}/regress/regress-173361.js | 0 .../{ => harmony}/regress/regress-2186.js | 0 .../{ => harmony}/regress/regress-2219.js | 0 .../{ => harmony}/regress/regress-2225.js | 0 .../{ => harmony}/regress/regress-2243.js | 0 .../{ => harmony}/regress/regress-2322.js | 0 .../{ => harmony}/regress/regress-2681.js | 0 .../{ => harmony}/regress/regress-2691.js | 0 .../mjsunit/harmony/regress/regress-343928.js | 22 + .../regress/regress-crbug-248025.js | 0 .../harmony/regress/regress-crbug-346141.js | 11 + .../harmony/regress/regress-crbug-347528.js | 36 + .../regress/regress-lookup-transition.js | 14 + .../regress-observe-empty-double-array.js | 2 +- .../mjsunit/{ => harmony}/set-prototype-of.js | 0 deps/v8/test/mjsunit/harmony/symbols.js | 153 +- deps/v8/test/mjsunit/invalid-lhs.js | 52 +- deps/v8/test/mjsunit/math-floor-of-div.js | 11 + deps/v8/test/mjsunit/mjsunit.status | 105 +- deps/v8/test/mjsunit/neuter-twice.js | 9 + deps/v8/test/mjsunit/pixel-array-rounding.js | 0 deps/v8/test/mjsunit/proto-accessor.js | 144 +- deps/v8/test/mjsunit/readonly.js | 9 +- deps/v8/test/mjsunit/regexp-capture-3.js | 0 deps/v8/test/mjsunit/regexp-capture.js | 0 deps/v8/test/mjsunit/regress-3225.js | 48 + ...egress-keyed-store-non-strict-arguments.js | 16 + .../mjsunit/regress-sync-optimized-lists.js | 45 + .../test/mjsunit/regress/compare-map-elim1.js | 57 + .../comparison-in-effect-context-deopt.js | 47 + .../regress/number-named-call-deopt.js | 41 + .../polymorphic-accessor-test-context.js | 25 + deps/v8/test/mjsunit/regress/regress-2273.js | 4 +- deps/v8/test/mjsunit/regress/regress-2318.js | 2 +- deps/v8/test/mjsunit/regress/regress-2564.js | 2 +- deps/v8/test/mjsunit/regress/regress-3032.js | 0 deps/v8/test/mjsunit/regress/regress-3135.js | 73 + deps/v8/test/mjsunit/regress/regress-3138.js | 40 + deps/v8/test/mjsunit/regress/regress-3158.js | 24 + deps/v8/test/mjsunit/regress/regress-3159.js | 10 + deps/v8/test/mjsunit/regress/regress-3183.js | 96 + .../regress/regress-319722-ArrayBuffer.js | 2 +- .../regress/regress-319722-TypedArrays.js | 2 +- deps/v8/test/mjsunit/regress/regress-3204.js | 25 + deps/v8/test/mjsunit/regress/regress-3220.js | 30 + .../mjsunit/{ => regress}/regress-330046.js | 0 .../mjsunit/{ => regress}/regress-333594.js | 0 .../v8/test/mjsunit/regress/regress-343609.js | 66 + .../v8/test/mjsunit/regress/regress-346587.js | 18 + .../v8/test/mjsunit/regress/regress-347530.js | 12 + .../v8/test/mjsunit/regress/regress-347542.js | 11 + .../v8/test/mjsunit/regress/regress-347906.js | 14 + .../v8/test/mjsunit/regress/regress-347912.js | 10 + .../v8/test/mjsunit/regress/regress-347914.js | 89 + .../v8/test/mjsunit/regress/regress-348280.js | 16 + .../v8/test/mjsunit/regress/regress-349870.js | 7 + .../v8/test/mjsunit/regress/regress-349885.js | 15 + .../v8/test/mjsunit/regress/regress-350865.js | 17 + .../v8/test/mjsunit/regress/regress-350887.js | 12 + .../v8/test/mjsunit/regress/regress-351261.js | 19 + .../v8/test/mjsunit/regress/regress-351263.js | 37 + .../v8/test/mjsunit/regress/regress-351315.js | 49 + .../v8/test/mjsunit/regress/regress-351319.js | 39 + .../v8/test/mjsunit/regress/regress-352059.js | 35 + .../v8/test/mjsunit/regress/regress-353551.js | 40 + .../v8/test/mjsunit/regress/regress-354357.js | 38 + .../v8/test/mjsunit/regress/regress-354433.js | 54 + .../v8/test/mjsunit/regress/regress-355485.js | 5 + .../v8/test/mjsunit/regress/regress-355523.js | 37 + .../v8/test/mjsunit/regress/regress-356053.js | 9 + .../v8/test/mjsunit/regress/regress-356589.js | 34 + .../v8/test/mjsunit/regress/regress-357108.js | 20 + deps/v8/test/mjsunit/regress/regress-485.js | 0 .../regress-check-eliminate-loop-phis.js | 21 + .../test/mjsunit/regress/regress-cr-344285.js | 37 + .../mjsunit/regress/regress-crbug-347903.js | 19 + .../mjsunit/regress/regress-crbug-349853.js | 21 + .../mjsunit/regress/regress-crbug-350434.js | 33 + .../mjsunit/regress/regress-crbug-350864.js | 36 + .../mjsunit/regress/regress-crbug-350867.js | 15 + .../mjsunit/regress/regress-crbug-350890.js | 42 + .../mjsunit/regress/regress-crbug-351262.js | 6 + .../mjsunit/regress/regress-crbug-351320.js | 21 + .../mjsunit/regress/regress-crbug-351658.js | 14 + .../mjsunit/regress/regress-crbug-352058.js | 17 + .../mjsunit/regress/regress-crbug-352586.js | 15 + .../mjsunit/regress/regress-crbug-354391.js | 21 + .../regress-dictionary-to-fast-arguments.js | 11 + .../regress/regress-fast-empty-string.js | 13 + .../regress/regress-force-representation.js | 22 + .../mjsunit/regress/regress-is-smi-repr.js | 18 + .../regress/regress-keyed-store-global.js | 12 + .../regress/regress-migrate-callbacks.js | 11 + .../regress-prepare-break-while-recompile.js | 2 +- .../mjsunit/regress/regress-sort-arguments.js | 10 + .../regress/regress-store-global-proxy.js | 12 + .../regress/regress-store-heapobject.js | 27 + .../test/mjsunit/regress/setvalueof-deopt.js | 42 + .../mjsunit/regress/string-set-char-deopt.js | 85 + deps/v8/test/mjsunit/shift-for-integer-div.js | 13 +- deps/v8/test/mjsunit/simple-constructor.js | 0 deps/v8/test/mjsunit/smi-mul-const.js | 87 + deps/v8/test/mjsunit/string-case.js | 16 +- deps/v8/test/mjsunit/string-match.js | 0 deps/v8/test/mjsunit/string-oom-array-join.js | 14 + deps/v8/test/mjsunit/string-oom-concat.js | 12 + ...g-oom-replace-global-regexp-with-string.js | 26 + ...oom-replace-regexp-global-with-function.js | 14 + deps/v8/test/mjsunit/string-slices.js | 0 deps/v8/test/mjsunit/substr.js | 0 deps/v8/test/mjsunit/test-hidden-string.js | 11 + .../test/mjsunit/third_party/array-isarray.js | 48 - .../third_party/array-splice-webkit.js | 62 - .../test/mjsunit/third_party/string-trim.js | 107 - .../v8/test/mjsunit/value-wrapper-accessor.js | 2 +- deps/v8/test/mjsunit/whitespaces.js | 115 + deps/v8/test/mozilla/mozilla.status | 44 +- deps/v8/test/mozilla/testcfg.py | 5 +- deps/v8/test/preparser/preparser.status | 4 + deps/v8/test/promises-aplus/README | 29 + deps/v8/test/promises-aplus/lib/adapter.js | 41 + deps/v8/test/promises-aplus/lib/assert.js | 97 + deps/v8/test/promises-aplus/lib/global.js | 76 + deps/v8/test/promises-aplus/lib/mocha.js | 264 + .../lib/require.js} | 41 +- deps/v8/test/promises-aplus/lib/run-tests.js | 29 + .../test/promises-aplus/promises-aplus.status | 34 + deps/v8/test/promises-aplus/testcfg.py | 148 + deps/v8/test/test262/README | 10 +- deps/v8/test/test262/test262.status | 4 +- deps/v8/test/test262/testcfg.py | 17 +- .../Object-getOwnPropertyNames-expected.txt | 4 +- .../js/Promise-already-rejected-expected.txt | 9 + .../fast/js/Promise-already-rejected.js | 41 + .../js/Promise-already-resolved-expected.txt | 9 + .../fast/js/Promise-already-resolved.js | 43 + .../webkit/fast/js/Promise-catch-expected.txt | 15 + deps/v8/test/webkit/fast/js/Promise-catch.js | 71 + .../fast/js/Promise-chained-then-expected.txt | 19 + .../webkit/fast/js/Promise-chained-then.js | 72 + .../fast/js/Promise-exception-expected.txt | 10 + .../test/webkit/fast/js/Promise-exception.js | 43 + ...romise-init-callback-receiver-expected.txt | 9 + .../fast/js/Promise-init-callback-receiver.js | 32 + .../webkit/fast/js/Promise-init-expected.txt | 19 + deps/v8/test/webkit/fast/js/Promise-init.js | 70 + .../js/Promise-onFulfilled-deep-expected.txt | 10 + .../fast/js/Promise-onFulfilled-deep.js | 42 + .../js/Promise-onRejected-deep-expected.txt | 10 + .../webkit/fast/js/Promise-onRejected-deep.js | 42 + .../fast/js/Promise-reject-expected.txt | 12 + deps/v8/test/webkit/fast/js/Promise-reject.js | 53 + .../js/Promise-resolve-chain-expected.txt | 10 + .../webkit/fast/js/Promise-resolve-chain.js | 60 + .../fast/js/Promise-resolve-expected.txt | 10 + .../js/Promise-resolve-state-expected.txt | 12 + .../webkit/fast/js/Promise-resolve-state.js | 53 + .../Promise-resolve-with-itself-expected.txt | 10 + .../fast/js/Promise-resolve-with-itself.js | 40 + ...e-resolve-with-then-exception-expected.txt | 11 + .../js/Promise-resolve-with-then-exception.js | 43 + ...ise-resolve-with-then-fulfill-expected.txt | 13 + .../js/Promise-resolve-with-then-fulfill.js | 51 + ...mise-resolve-with-then-reject-expected.txt | 13 + .../js/Promise-resolve-with-then-reject.js | 51 + .../v8/test/webkit/fast/js/Promise-resolve.js | 42 + .../fast/js/Promise-simple-expected.txt | 11 + deps/v8/test/webkit/fast/js/Promise-simple.js | 46 + .../fast/js/Promise-static-all-expected.txt | 32 + .../test/webkit/fast/js/Promise-static-all.js | 117 + .../fast/js/Promise-static-cast-expected.txt | 14 + .../webkit/fast/js/Promise-static-cast.js | 56 + .../fast/js/Promise-static-race-expected.txt | 21 + .../webkit/fast/js/Promise-static-race.js | 108 + .../js/Promise-static-reject-expected.txt | 10 + .../webkit/fast/js/Promise-static-reject.js | 38 + .../js/Promise-static-resolve-expected.txt | 10 + .../webkit/fast/js/Promise-static-resolve.js | 43 + ...romise-then-callback-receiver-expected.txt | 12 + .../fast/js/Promise-then-callback-receiver.js | 47 + .../webkit/fast/js/Promise-then-expected.txt | 17 + ...romise-then-without-callbacks-expected.txt | 9 + .../fast/js/Promise-then-without-callbacks.js | 35 + deps/v8/test/webkit/fast/js/Promise-then.js | 68 + .../fast/js/basic-strict-mode-expected.txt | 24 +- ...function-toString-parentheses-expected.txt | 174 +- .../js/kde/exception_propagation-expected.txt | 1 - .../fast/js/kde/exception_propagation.js | 20 - .../js/modify-non-references-expected.txt | 12 +- .../fast/js/parser-syntax-check-expected.txt | 4 +- .../parser-xml-close-comment-expected.txt | 6 +- deps/v8/test/webkit/string-trim-expected.txt | 44 +- ...refix-postfix-preserve-parens-expected.txt | 36 - ...toString-prefix-postfix-preserve-parens.js | 5 + deps/v8/test/webkit/webkit.status | 6 + deps/v8/tools/bash-completion.sh | 4 +- deps/v8/tools/blink_tests/TestExpectations | 2 - deps/v8/tools/cross_build_gcc.sh | 72 + deps/v8/tools/draw_instruction_graph.sh | 130 + deps/v8/tools/gcmole/gcmole.lua | 6 +- deps/v8/tools/grokdump.py | 1151 +- deps/v8/tools/gyp/v8.gyp | 69 +- deps/v8/tools/lexer-shell.cc | 42 +- deps/v8/tools/lexer-shell.gyp | 23 + deps/v8/tools/merge-to-branch.sh | 1 - deps/v8/tools/parser-shell.cc | 171 + deps/v8/tools/push-to-trunk.sh | 412 - deps/v8/tools/push-to-trunk/auto_push.py | 156 + deps/v8/tools/push-to-trunk/auto_roll.py | 217 - deps/v8/tools/push-to-trunk/chromium_roll.py | 170 + .../v8/tools/push-to-trunk/common_includes.py | 240 +- deps/v8/tools/push-to-trunk/git_recipes.py | 168 + .../v8/tools/push-to-trunk/merge_to_branch.py | 331 + deps/v8/tools/push-to-trunk/push_to_trunk.py | 563 +- deps/v8/tools/push-to-trunk/script_test.py | 54 + deps/v8/tools/push-to-trunk/test_scripts.py | 758 +- deps/v8/tools/run-deopt-fuzzer.py | 4 +- deps/v8/tools/run-tests.py | 20 +- deps/v8/tools/shell-utils.h | 67 + deps/v8/tools/testrunner/local/statusfile.py | 6 +- deps/v8/tools/testrunner/local/utils.py | 2 +- deps/v8/tools/v8heapconst.py | 288 +- 689 files changed, 112843 insertions(+), 22917 deletions(-) mode change 100755 => 100644 deps/v8/include/v8-debug.h create mode 100644 deps/v8/include/v8-util.h create mode 100644 deps/v8/src/arm/OWNERS create mode 100644 deps/v8/src/arm64/OWNERS create mode 100644 deps/v8/src/arm64/assembler-arm64-inl.h create mode 100644 deps/v8/src/arm64/assembler-arm64.cc create mode 100644 deps/v8/src/arm64/assembler-arm64.h create mode 100644 deps/v8/src/arm64/builtins-arm64.cc create mode 100644 deps/v8/src/arm64/code-stubs-arm64.cc create mode 100644 deps/v8/src/arm64/code-stubs-arm64.h create mode 100644 deps/v8/src/arm64/codegen-arm64.cc create mode 100644 deps/v8/src/arm64/codegen-arm64.h create mode 100644 deps/v8/src/arm64/constants-arm64.h create mode 100644 deps/v8/src/arm64/cpu-arm64.cc create mode 100644 deps/v8/src/arm64/cpu-arm64.h create mode 100644 deps/v8/src/arm64/debug-arm64.cc create mode 100644 deps/v8/src/arm64/decoder-arm64-inl.h create mode 100644 deps/v8/src/arm64/decoder-arm64.cc create mode 100644 deps/v8/src/arm64/decoder-arm64.h create mode 100644 deps/v8/src/arm64/deoptimizer-arm64.cc create mode 100644 deps/v8/src/arm64/disasm-arm64.cc create mode 100644 deps/v8/src/arm64/disasm-arm64.h create mode 100644 deps/v8/src/arm64/frames-arm64.cc create mode 100644 deps/v8/src/arm64/frames-arm64.h create mode 100644 deps/v8/src/arm64/full-codegen-arm64.cc create mode 100644 deps/v8/src/arm64/ic-arm64.cc create mode 100644 deps/v8/src/arm64/instructions-arm64.cc create mode 100644 deps/v8/src/arm64/instructions-arm64.h create mode 100644 deps/v8/src/arm64/instrument-arm64.cc create mode 100644 deps/v8/src/arm64/instrument-arm64.h create mode 100644 deps/v8/src/arm64/lithium-arm64.cc create mode 100644 deps/v8/src/arm64/lithium-arm64.h create mode 100644 deps/v8/src/arm64/lithium-codegen-arm64.cc create mode 100644 deps/v8/src/arm64/lithium-codegen-arm64.h create mode 100644 deps/v8/src/arm64/lithium-gap-resolver-arm64.cc create mode 100644 deps/v8/src/arm64/lithium-gap-resolver-arm64.h create mode 100644 deps/v8/src/arm64/macro-assembler-arm64-inl.h create mode 100644 deps/v8/src/arm64/macro-assembler-arm64.cc create mode 100644 deps/v8/src/arm64/macro-assembler-arm64.h create mode 100644 deps/v8/src/arm64/regexp-macro-assembler-arm64.cc create mode 100644 deps/v8/src/arm64/regexp-macro-assembler-arm64.h create mode 100644 deps/v8/src/arm64/simulator-arm64.cc create mode 100644 deps/v8/src/arm64/simulator-arm64.h create mode 100644 deps/v8/src/arm64/stub-cache-arm64.cc create mode 100644 deps/v8/src/arm64/utils-arm64.cc create mode 100644 deps/v8/src/arm64/utils-arm64.h create mode 100644 deps/v8/src/assert-scope.cc create mode 100644 deps/v8/src/atomicops_internals_arm64_gcc.h create mode 100644 deps/v8/src/atomicops_internals_atomicword_compat.h rename deps/v8/src/{atomicops_internals_x86_macosx.h => atomicops_internals_mac.h} (63%) create mode 100644 deps/v8/src/feedback-slots.h delete mode 100644 deps/v8/src/hydrogen-minus-zero.cc create mode 100644 deps/v8/src/hydrogen-store-elimination.cc rename deps/v8/src/{hydrogen-minus-zero.h => hydrogen-store-elimination.h} (76%) create mode 100644 deps/v8/src/property-details-inl.h create mode 100644 deps/v8/src/weak_collection.js create mode 100644 deps/v8/test/cctest/test-assembler-arm64.cc create mode 100644 deps/v8/test/cctest/test-atomicops.cc create mode 100644 deps/v8/test/cctest/test-code-stubs-arm64.cc create mode 100644 deps/v8/test/cctest/test-disasm-arm64.cc create mode 100644 deps/v8/test/cctest/test-fuzz-arm64.cc create mode 100644 deps/v8/test/cctest/test-javascript-arm64.cc create mode 100644 deps/v8/test/cctest/test-js-arm64-variables.cc create mode 100644 deps/v8/test/cctest/test-microtask-delivery.cc create mode 100644 deps/v8/test/cctest/test-utils-arm64.cc create mode 100644 deps/v8/test/cctest/test-utils-arm64.h mode change 100755 => 100644 deps/v8/test/mjsunit/array-reduce.js rename deps/v8/test/mjsunit/compiler/{compare_map_elim.js => compare-map-elim.js} (100%) create mode 100644 deps/v8/test/mjsunit/compiler/compare-map-elim2.js rename deps/v8/test/mjsunit/compiler/{compare_objeq_elim.js => compare-objeq-elim.js} (100%) create mode 100644 deps/v8/test/mjsunit/compiler/division-by-constant.js create mode 100644 deps/v8/test/mjsunit/compiler/smi-stores-opt.js create mode 100644 deps/v8/test/mjsunit/compiler/store-elimination.js create mode 100644 deps/v8/test/mjsunit/compiler/to-fast-properties.js create mode 100644 deps/v8/test/mjsunit/constant-fold-control-instructions.js create mode 100644 deps/v8/test/mjsunit/dehoisted-array-index.js create mode 100644 deps/v8/test/mjsunit/deopt-with-fp-regs.js create mode 100644 deps/v8/test/mjsunit/double-intrinsics.js create mode 100644 deps/v8/test/mjsunit/es6/math-cbrt.js create mode 100644 deps/v8/test/mjsunit/es6/math-clz32.js create mode 100644 deps/v8/test/mjsunit/es6/math-expm1.js create mode 100644 deps/v8/test/mjsunit/es6/math-fround.js rename deps/v8/test/mjsunit/{harmony => es6}/math-hyperbolic.js (95%) rename deps/v8/test/mjsunit/{harmony => es6}/math-hypot.js (100%) create mode 100644 deps/v8/test/mjsunit/es6/math-log1p.js rename deps/v8/test/mjsunit/{harmony => es6}/math-log2-log10.js (100%) rename deps/v8/test/mjsunit/{harmony => es6}/math-sign.js (100%) rename deps/v8/test/mjsunit/{harmony => es6}/math-trunc.js (100%) create mode 100644 deps/v8/test/mjsunit/es6/microtask-delivery.js rename deps/v8/test/mjsunit/{harmony => es6}/promises.js (81%) rename deps/v8/test/mjsunit/{ => es6}/regress/regress-2034.js (98%) rename deps/v8/test/mjsunit/{ => es6}/regress/regress-2156.js (97%) rename deps/v8/test/mjsunit/{ => es6}/regress/regress-2829.js (98%) create mode 100644 deps/v8/test/mjsunit/es6/weak_collections.js rename deps/v8/test/mjsunit/{harmony => es7}/object-observe.js (99%) create mode 100644 deps/v8/test/mjsunit/function-arguments-duplicate.js rename deps/v8/test/mjsunit/{ => harmony}/regress/regress-173361.js (100%) rename deps/v8/test/mjsunit/{ => harmony}/regress/regress-2186.js (100%) rename deps/v8/test/mjsunit/{ => harmony}/regress/regress-2219.js (100%) rename deps/v8/test/mjsunit/{ => harmony}/regress/regress-2225.js (100%) rename deps/v8/test/mjsunit/{ => harmony}/regress/regress-2243.js (100%) rename deps/v8/test/mjsunit/{ => harmony}/regress/regress-2322.js (100%) rename deps/v8/test/mjsunit/{ => harmony}/regress/regress-2681.js (100%) rename deps/v8/test/mjsunit/{ => harmony}/regress/regress-2691.js (100%) create mode 100644 deps/v8/test/mjsunit/harmony/regress/regress-343928.js rename deps/v8/test/mjsunit/{ => harmony}/regress/regress-crbug-248025.js (100%) create mode 100644 deps/v8/test/mjsunit/harmony/regress/regress-crbug-346141.js create mode 100644 deps/v8/test/mjsunit/harmony/regress/regress-crbug-347528.js create mode 100644 deps/v8/test/mjsunit/harmony/regress/regress-lookup-transition.js rename deps/v8/test/mjsunit/{ => harmony}/regress/regress-observe-empty-double-array.js (97%) rename deps/v8/test/mjsunit/{ => harmony}/set-prototype-of.js (100%) create mode 100644 deps/v8/test/mjsunit/neuter-twice.js mode change 100755 => 100644 deps/v8/test/mjsunit/pixel-array-rounding.js mode change 100755 => 100644 deps/v8/test/mjsunit/regexp-capture-3.js mode change 100755 => 100644 deps/v8/test/mjsunit/regexp-capture.js create mode 100644 deps/v8/test/mjsunit/regress-3225.js create mode 100644 deps/v8/test/mjsunit/regress-keyed-store-non-strict-arguments.js create mode 100644 deps/v8/test/mjsunit/regress-sync-optimized-lists.js create mode 100644 deps/v8/test/mjsunit/regress/compare-map-elim1.js create mode 100644 deps/v8/test/mjsunit/regress/comparison-in-effect-context-deopt.js create mode 100644 deps/v8/test/mjsunit/regress/number-named-call-deopt.js create mode 100644 deps/v8/test/mjsunit/regress/polymorphic-accessor-test-context.js mode change 100755 => 100644 deps/v8/test/mjsunit/regress/regress-3032.js create mode 100644 deps/v8/test/mjsunit/regress/regress-3135.js create mode 100644 deps/v8/test/mjsunit/regress/regress-3138.js create mode 100644 deps/v8/test/mjsunit/regress/regress-3158.js create mode 100644 deps/v8/test/mjsunit/regress/regress-3159.js create mode 100644 deps/v8/test/mjsunit/regress/regress-3183.js create mode 100644 deps/v8/test/mjsunit/regress/regress-3204.js create mode 100644 deps/v8/test/mjsunit/regress/regress-3220.js rename deps/v8/test/mjsunit/{ => regress}/regress-330046.js (100%) rename deps/v8/test/mjsunit/{ => regress}/regress-333594.js (100%) create mode 100644 deps/v8/test/mjsunit/regress/regress-343609.js create mode 100644 deps/v8/test/mjsunit/regress/regress-346587.js create mode 100644 deps/v8/test/mjsunit/regress/regress-347530.js create mode 100644 deps/v8/test/mjsunit/regress/regress-347542.js create mode 100644 deps/v8/test/mjsunit/regress/regress-347906.js create mode 100644 deps/v8/test/mjsunit/regress/regress-347912.js create mode 100644 deps/v8/test/mjsunit/regress/regress-347914.js create mode 100644 deps/v8/test/mjsunit/regress/regress-348280.js create mode 100644 deps/v8/test/mjsunit/regress/regress-349870.js create mode 100644 deps/v8/test/mjsunit/regress/regress-349885.js create mode 100644 deps/v8/test/mjsunit/regress/regress-350865.js create mode 100644 deps/v8/test/mjsunit/regress/regress-350887.js create mode 100644 deps/v8/test/mjsunit/regress/regress-351261.js create mode 100644 deps/v8/test/mjsunit/regress/regress-351263.js create mode 100644 deps/v8/test/mjsunit/regress/regress-351315.js create mode 100644 deps/v8/test/mjsunit/regress/regress-351319.js create mode 100644 deps/v8/test/mjsunit/regress/regress-352059.js create mode 100644 deps/v8/test/mjsunit/regress/regress-353551.js create mode 100644 deps/v8/test/mjsunit/regress/regress-354357.js create mode 100644 deps/v8/test/mjsunit/regress/regress-354433.js create mode 100644 deps/v8/test/mjsunit/regress/regress-355485.js create mode 100644 deps/v8/test/mjsunit/regress/regress-355523.js create mode 100644 deps/v8/test/mjsunit/regress/regress-356053.js create mode 100644 deps/v8/test/mjsunit/regress/regress-356589.js create mode 100644 deps/v8/test/mjsunit/regress/regress-357108.js mode change 100755 => 100644 deps/v8/test/mjsunit/regress/regress-485.js create mode 100644 deps/v8/test/mjsunit/regress/regress-check-eliminate-loop-phis.js create mode 100644 deps/v8/test/mjsunit/regress/regress-cr-344285.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-347903.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-349853.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-350434.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-350864.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-350867.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-350890.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-351262.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-351320.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-351658.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-352058.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-352586.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-354391.js create mode 100644 deps/v8/test/mjsunit/regress/regress-dictionary-to-fast-arguments.js create mode 100644 deps/v8/test/mjsunit/regress/regress-fast-empty-string.js create mode 100644 deps/v8/test/mjsunit/regress/regress-force-representation.js create mode 100644 deps/v8/test/mjsunit/regress/regress-is-smi-repr.js create mode 100644 deps/v8/test/mjsunit/regress/regress-keyed-store-global.js create mode 100644 deps/v8/test/mjsunit/regress/regress-migrate-callbacks.js create mode 100644 deps/v8/test/mjsunit/regress/regress-sort-arguments.js create mode 100644 deps/v8/test/mjsunit/regress/regress-store-global-proxy.js create mode 100644 deps/v8/test/mjsunit/regress/regress-store-heapobject.js create mode 100644 deps/v8/test/mjsunit/regress/setvalueof-deopt.js create mode 100644 deps/v8/test/mjsunit/regress/string-set-char-deopt.js mode change 100755 => 100644 deps/v8/test/mjsunit/simple-constructor.js create mode 100644 deps/v8/test/mjsunit/smi-mul-const.js mode change 100755 => 100644 deps/v8/test/mjsunit/string-match.js create mode 100644 deps/v8/test/mjsunit/string-oom-array-join.js create mode 100644 deps/v8/test/mjsunit/string-oom-concat.js create mode 100644 deps/v8/test/mjsunit/string-oom-replace-global-regexp-with-string.js create mode 100644 deps/v8/test/mjsunit/string-oom-replace-regexp-global-with-function.js mode change 100755 => 100644 deps/v8/test/mjsunit/string-slices.js mode change 100755 => 100644 deps/v8/test/mjsunit/substr.js create mode 100644 deps/v8/test/mjsunit/test-hidden-string.js delete mode 100644 deps/v8/test/mjsunit/third_party/array-isarray.js delete mode 100644 deps/v8/test/mjsunit/third_party/array-splice-webkit.js delete mode 100644 deps/v8/test/mjsunit/third_party/string-trim.js create mode 100644 deps/v8/test/mjsunit/whitespaces.js create mode 100644 deps/v8/test/promises-aplus/README create mode 100644 deps/v8/test/promises-aplus/lib/adapter.js create mode 100644 deps/v8/test/promises-aplus/lib/assert.js create mode 100644 deps/v8/test/promises-aplus/lib/global.js create mode 100644 deps/v8/test/promises-aplus/lib/mocha.js rename deps/v8/test/{mjsunit/limit-locals.js => promises-aplus/lib/require.js} (67%) create mode 100644 deps/v8/test/promises-aplus/lib/run-tests.js create mode 100644 deps/v8/test/promises-aplus/promises-aplus.status create mode 100644 deps/v8/test/promises-aplus/testcfg.py create mode 100644 deps/v8/test/webkit/fast/js/Promise-already-rejected-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-already-rejected.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-already-resolved-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-already-resolved.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-catch-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-catch.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-chained-then-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-chained-then.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-exception-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-exception.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-init-callback-receiver-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-init-callback-receiver.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-init-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-init.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-onFulfilled-deep-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-onFulfilled-deep.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-onRejected-deep-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-onRejected-deep.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-reject-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-reject.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-resolve-chain-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-resolve-chain.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-resolve-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-resolve-state-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-resolve-state.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-resolve-with-itself-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-resolve-with-itself.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-resolve-with-then-exception-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-resolve-with-then-exception.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-resolve-with-then-fulfill-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-resolve-with-then-fulfill.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-resolve-with-then-reject-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-resolve-with-then-reject.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-resolve.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-simple-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-simple.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-static-all-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-static-all.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-static-cast-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-static-cast.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-static-race-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-static-race.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-static-reject-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-static-reject.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-static-resolve-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-static-resolve.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-then-callback-receiver-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-then-callback-receiver.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-then-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-then-without-callbacks-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Promise-then-without-callbacks.js create mode 100644 deps/v8/test/webkit/fast/js/Promise-then.js create mode 100755 deps/v8/tools/cross_build_gcc.sh create mode 100755 deps/v8/tools/draw_instruction_graph.sh create mode 100644 deps/v8/tools/parser-shell.cc delete mode 100755 deps/v8/tools/push-to-trunk.sh create mode 100755 deps/v8/tools/push-to-trunk/auto_push.py delete mode 100755 deps/v8/tools/push-to-trunk/auto_roll.py create mode 100755 deps/v8/tools/push-to-trunk/chromium_roll.py create mode 100644 deps/v8/tools/push-to-trunk/git_recipes.py create mode 100755 deps/v8/tools/push-to-trunk/merge_to_branch.py create mode 100755 deps/v8/tools/push-to-trunk/script_test.py create mode 100644 deps/v8/tools/shell-utils.h diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index d554ec65d2..de51f8a1ee 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -22,6 +22,7 @@ *~ .cpplint-cache .d8_history +.*.sw? bsuite d8 d8_g @@ -46,7 +47,7 @@ shell_g /test/mozilla/data /test/mozilla/downloaded_* /test/test262/data -/test/test262/test262-* +/test/test262/tc39-test262-* /third_party /tools/jsfunfuzz /tools/jsfunfuzz.zip diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index 597b0ff0ae..4ef2bcca33 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -17,8 +17,10 @@ Opera Software ASA Akinori MUSHA Alexander Botero-Lowry Alexander Karpinsky +Alexandre Rames Alexandre Vassalotti Andreas Anyuru +Baptiste Afsa Bert Belder Burcu Dogan Craig Schlenter @@ -31,6 +33,7 @@ Fedor Indutny Filipe David Manana Haitao Feng Ioseb Dzmanashvili +Jacob Bramley Jan de Mooij Jay Freeman James Pike @@ -59,6 +62,7 @@ Sandro Santilli Sanjoy Das Subrato K De Tobias Burnus +Vincent Belliard Vlad Burlik Xi Qian Yuqiang Xian diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index 1d3f139e11..879515d743 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,402 @@ +2014-03-28: Version 3.25.30 + + NativeContext::map_cache reference should be strong in heap snapshots + (Chromium issue 357060). + + Performance and stability improvements on all platforms. + + +2014-03-27: Version 3.25.29 + + Performance and stability improvements on all platforms. + + +2014-03-27: Version 3.25.28 + + Performance and stability improvements on all platforms. + + +2014-03-26: Version 3.25.27 + + Promise constructor should not be enumerable (Chromium issue 352597). + + Performance and stability improvements on all platforms. + + +2014-03-26: Version 3.25.26 + + Performance and stability improvements on all platforms. + + +2014-03-25: Version 3.25.25 + + Roll ICU 239289:258359 and add support for external ICU data tables + (issue 3142, Chromium issue 72633). + + Performance and stability improvements on all platforms. + + +2014-03-25: Version 3.25.24 + + Add support for per-isolate private symbols. + + No longer OOM on invalid string length (issue 3060). + + Remove Failure::OutOfMemory propagation and + V8::IgnoreOutOfMemoryException (issue 3060). + + Tentative Windows dll build fix: Don't V8_EXPORT ScriptCompiler::Source + (issue 3228). + + Performance and stability improvements on all platforms. + + +2014-03-24: Version 3.25.23 + + Rename A64 port to ARM64 port (Chromium issue 354405). + + Fix missing access check in Runtime_SetPrototype (Chromium issue + 354123). + + Fix polymorphic hydrogen handling of SLOPPY_ARGUMENTS_ELEMENTS (Chromium + issue 354391). + + Performance and stability improvements on all platforms. + + +2014-03-20: Version 3.25.22 + + Increase the "local variables in a function" limit (issue 3205). + + Implement ES6 symbol registry and predefined symbols. + + Throw exception on invalid string length instead of OOM (Chromium issue + 349329). + + Performance and stability improvements on all platforms. + + +2014-03-20: Version 3.25.21 + + Performance and stability improvements on all platforms. + + +2014-03-20: Version 3.25.20 + + Fix polymorphic keyed loads for SLOPPY_ARGUMENTS_ELEMENTS (Chromium + issue 350867). + + Performance and stability improvements on all platforms. + + +2014-03-19: Version 3.25.19 + + Performance and stability improvements on all platforms. + + +2014-03-19: Version 3.25.18 + + Performance and stability improvements on all platforms. + + +2014-03-19: Version 3.25.17 + + Performance and stability improvements on all platforms. + + +2014-03-18: Version 3.25.16 + + Apply numeric casts correctly in typed arrays and related code (Chromium + issue 353004). + + Performance and stability improvements on all platforms. + + +2014-03-18: Version 3.25.15 + + Don't generate keyed store ICs for global proxies (Chromium issue + 352983). + + MIPS: Make invalid LHSs a parse-time (reference) error (Chromium issue + 351658). + + Make invalid LHSs a parse-time (reference) error (Chromium issue + 351658). + + Add Promises/A+ Compliance Test Suite (Chromium issue 347095). + + Split Promise API into Promise/Resolver. + + Performance and stability improvements on all platforms. + + +2014-03-17: Version 3.25.14 + + Performance and stability improvements on all platforms. + + +2014-03-17: Version 3.25.13 + + Move profiler callback interfaces from v8.h to v8-profiler.h. + + Performance and stability improvements on all platforms. + + +2014-03-14: Version 3.25.12 + + PromiseCoerce should deal with an error during accessing "then" + (Chromium issue 347095). + + Propagate updated offsets in BoundsCheckBbData (Chromium issue 350863). + + Add regression test for range analysis bug (issue 3204). + + Continued fix for 351257. Reusing the feedback vector is too complex + (Chromium issue 351257). + + StopCpuProfiling should return non-const CpuProfile (issue 3213). + + Allow for compiling with xcode 5.1 (which doesn't have gcc anymore). + + Performance and stability improvements on all platforms. + + +2014-03-14: Version 3.25.11 + + MIPS: Remove uses of CanBeNegative() in HMod (issue 3204). + + MIPS: Remove uses of RangeCanInclude() in flooring division by power of + 2 (issue 3204). + + MIPS: Fix uses of range analysis results in HChange (issue 3204). + + Make translation of modulus operation '--stress-opt'-proof (Chromium + issue 352059). + + Remove uses of CanBeNegative() in HMod (issue 3204). + + Remove uses of RangeCanInclude() in flooring division by power of 2 + (issue 3204). + + Fix uses of range analysis results in HChange (issue 3204). + + Performance and stability improvements on all platforms. + + +2014-03-14: Version 3.25.10 + + This version was not committed due to script failures. + + +2014-03-13: Version 3.25.9 + + Reland "Enable Object.observe by default" again (issue 2409). + + Use intrinsics for builtin ArrayBuffer property accesses (Chromium issue + 351787). + + Performance and stability improvements on all platforms. + + +2014-03-12: Version 3.25.8 + + Fix HIsSmiAndBranch::KnownSuccessorBlock() by deleting it (Chromium + issue 351320). + + Fix handling of polymorphic array accesses with constant index (Chromium + issue 351319). + + Fix lazy deopt after tagged binary ops (Chromium issue 350434). + + MIPS: Cleanup some of the range uses in ModI/DivI (issue 3204). + + Fix issue with getOwnPropertySymbols and hidden properties (Chromium + issue 350864). + + Cleanup some of the range uses in ModI/DivI (issue 3204). + + PromiseCoerce should ignore primitive values (Chromium issue 347095). + + Use a per-isolate cache for the date object JS bits (Chromium issue + 348856). + + Performance and stability improvements on all platforms. + + +2014-03-11: Version 3.25.7 + + Promise.all and Promise.race should reject non-array parameter (Chromium + issue 347453). + + Promise.all and Promise race should use "then" rather than "chain" + (Chromium issue 347427). + + Merge the "Compute Minus Zero Checks" phase into the range analysis + (issue 3204). + + Performance and stability improvements on all platforms. + + +2014-03-10: Version 3.25.6 + + Replace the recursion in PropagateMinusZeroChecks() with a loop and a + worklist (issue 3204). + + Reland "Enable Object.observe by default" (issue 2409). + + Enable Object.observe by default (issue 2409). + + AllocationTracker now maintains a map from address range to stack trace + that allocated the range. When snapshot is generated the map is used to + find construction stack trace for an object using its address (Chromium + issue 277984). + + Introduce Runtime_GetAllScopesDetails to get all scopes at once for a + frame (Chromium issue 340285). + + Reduce heavy runtime calls from debug mirrors (Chromium issue 340285). + + Check and clear date cache in DateCurrentTime, DateLocalTimezone and + getTimezoneOffset (Chromium issue 142141). + + Performance and stability improvements on all platforms. + + +2014-03-06: Version 3.25.5 + + Fix HConstants with Smi-ranged HeapNumber values (Chromium issue + 349878). + + Fix issues with JSON stringify replacer array (issues 3200, 3201). + + Performance and stability improvements on all platforms. + + +2014-03-05: Version 3.25.4 + + x64: Fix LMathMinMax for constant Smi right-hand operands (Chromium + issue 349079). + + Performance and stability improvements on all platforms. + + +2014-03-04: Version 3.25.3 + + Clear optimized code cache in shared function info when code gets + deoptimized (Chromium issue 343609). + + Fixed constant folding for Math.clz32 (Chromium issue 347906). + + Fix JSObject::PrintTransitions (Chromium issue 347912). + + Fix handling of constant global variable assignments (Chromium issue + 347904). + + Removed bogus ASSERT (Chromium issue 347542). + + Mark HCompareMap as having Tagged representation (Chromium issue + 346636). + + Fix crasher in Object.getOwnPropertySymbols (Chromium issue 346141). + + Fix the bit massaging code in CompleteParserRecorder::WriteNumber + (Chromium issue 346221). + + Don't eliminate loads with incompatible types or representations + (Chromium issue 346343). + + Check that after a weak callback, the handle is either dead or strong + (Chromium issue 346061). + + Lazy preparsing vs. lazy parsing fix (Chromium issue 346207). + + Performance and stability improvements on all platforms. + + +2014-02-25: Version 3.25.2 + + Fix the bit massaging code in CompleteParserRecorder::WriteNumber + (Chromium issue 346221). + + Revert r19455 "Load target types and handlers before IC computation." + (Chromium issue 346149). + + Don't eliminate loads with incompatible types or representations + (Chromium issue 346343). + + Fix for a smi stores optimization on x64 with a regression test + (Chromium issue 345715). + + Check that after a weak callback, the handle is either dead or strong + (Chromium issue 346061). + + negative bounds checking on realm calls (Chromium issue 344285). + + Lazy preparsing vs. lazy parsing fix (Chromium issue 346207). + + Fix optimistic BCE to back off after deopt (issue 3176). + + Performance and stability improvements on all platforms. + + +2014-02-21: Version 3.25.1 + + Performance and stability improvements on all platforms. + + +2014-02-19: Version 3.25.0 + + ES6: Tighten up Object.prototype.__proto__ (issue 3064). + + Fix Hydrogen bounds check elimination (Chromium issue 344186). + + Performance and stability improvements on all platforms. + + +2014-02-19: Version 3.24.40 + + A64: Let the MacroAssembler resolve branches to distant targets (issue + 3148). + + Fixed and improved code for integral division. Fixed and extended tests + (issue 3151). + + MIPS: Fix assignment of function name constant (issue 3138). + + Fix assignment of function name constant (issue 3138). + + Performance and stability improvements on all platforms. + + +2014-02-14: Version 3.24.39 + + Introduce --job-based-sweeping flag and use individual jobs for sweeping + if set (issue 3104). + + Performance and stability improvements on all platforms. + + +2014-02-13: Version 3.24.38 + + Merge experimental/a64 to bleeding_edge (issue 3113). + + Performance and stability improvements on all platforms. + + +2014-02-12: Version 3.24.37 + + Fix spec violations in JSON.stringify wrt replacer array (issue 3135). + + Performance and stability improvements on all platforms. + + +2014-02-11: Version 3.24.36 + + Fix inconsistencies wrt whitespaces (issue 3109). + + Performance and stability improvements on all platforms. + + 2014-02-10: Version 3.24.35 Fix inconsistencies wrt whitespaces (issue 3109). diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 66d21eb364..353c5c8b34 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -8,7 +8,7 @@ deps = { "http://gyp.googlecode.com/svn/trunk@1831", "v8/third_party/icu": - "https://src.chromium.org/chrome/trunk/deps/third_party/icu46@239289", + "https://src.chromium.org/chrome/trunk/deps/third_party/icu46@258359", } deps_os = { diff --git a/deps/v8/LICENSE b/deps/v8/LICENSE index 2e516bab62..2f5bce8369 100644 --- a/deps/v8/LICENSE +++ b/deps/v8/LICENSE @@ -26,7 +26,7 @@ are: These libraries have their own licenses; we recommend you read them, as their terms may differ from the terms below. -Copyright 2006-2012, the V8 project authors. All rights reserved. +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 met: diff --git a/deps/v8/Makefile b/deps/v8/Makefile index 2f47fa9a88..cdf5d74832 100644 --- a/deps/v8/Makefile +++ b/deps/v8/Makefile @@ -136,7 +136,16 @@ endif # deprecation_warnings=on ifeq ($(deprecationwarnings), on) GYPFLAGS += -Dv8_deprecation_warnings=1 -endif +endif +# asan=/path/to/clang++ +ifneq ($(strip $(asan)),) + GYPFLAGS += -Dasan=1 + export CXX="$(asan)" + export CXX_host="$(asan)" + export LINK="$(asan)" + export ASAN_SYMBOLIZER_PATH="$(dir $(asan))llvm-symbolizer" +endif + # arm specific flags. # arm_version= ifneq ($(strip $(arm_version)),) @@ -223,11 +232,11 @@ endif # Architectures and modes to be compiled. Consider these to be internal # variables, don't override them (use the targets instead). -ARCHES = ia32 x64 arm mipsel +ARCHES = ia32 x64 arm arm64 mipsel DEFAULT_ARCHES = ia32 x64 arm MODES = release debug optdebug DEFAULT_MODES = release debug -ANDROID_ARCHES = android_ia32 android_arm android_mipsel +ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel NACL_ARCHES = nacl_ia32 nacl_x64 # List of files that trigger Makefile regeneration: @@ -247,13 +256,15 @@ NACL_BUILDS = $(foreach mode,$(MODES), \ $(addsuffix .$(mode),$(NACL_ARCHES))) # Generates corresponding test targets, e.g. "ia32.release.check". CHECKS = $(addsuffix .check,$(BUILDS)) +QUICKCHECKS = $(addsuffix .quickcheck,$(BUILDS)) ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS)) NACL_CHECKS = $(addsuffix .check,$(NACL_BUILDS)) # File where previously used GYPFLAGS are stored. ENVFILE = $(OUTDIR)/environment .PHONY: all check clean dependencies $(ENVFILE).new native \ - qc quickcheck \ + qc quickcheck $(QUICKCHECKS) \ + $(addsuffix .quickcheck,$(MODES)) $(addsuffix .quickcheck,$(ARCHES)) \ $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \ $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \ @@ -332,6 +343,18 @@ $(CHECKS): $$(basename $$@) @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ --arch-and-mode=$(basename $@) $(TESTFLAGS) +$(addsuffix .quickcheck,$(MODES)): $$(basename $$@) + @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ + --mode=$(basename $@) $(TESTFLAGS) --quickcheck + +$(addsuffix .quickcheck,$(ARCHES)): $$(basename $$@) + @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ + --arch=$(basename $@) $(TESTFLAGS) --quickcheck + +$(QUICKCHECKS): $$(basename $$@) + @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ + --arch-and-mode=$(basename $@) $(TESTFLAGS) --quickcheck + $(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@) @tools/android-sync.sh $(basename $@) $(OUTDIR) \ $(shell pwd) $(ANDROID_V8) @@ -358,12 +381,17 @@ native.check: native @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ --arch-and-mode=. $(TESTFLAGS) -FASTTESTMODES = ia32.release,x64.release,ia32.optdebug,x64.optdebug,arm.optdebug +SUPERFASTTESTMODES = ia32.release +FASTTESTMODES = $(SUPERFASTTESTMODES),x64.release,ia32.optdebug,x64.optdebug,arm.optdebug,arm64.release +FASTCOMPILEMODES = $(FASTTESTMODES),arm64.optdebug COMMA = , EMPTY = SPACE = $(EMPTY) $(EMPTY) -quickcheck: $(subst $(COMMA),$(SPACE),$(FASTTESTMODES)) +quickcheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES)) + tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ + --arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) --quickcheck \ + --download-data mozilla webkit tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ --arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) --quickcheck qc: quickcheck @@ -392,7 +420,7 @@ $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE) build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ -Ibuild/standalone.gypi --depth=. \ -Dv8_target_arch=$(subst .,,$(suffix $(basename $@))) \ - -Dv8_optimized_debug=$(if $(findstring optdebug,$@),2,0) \ + $(if $(findstring optdebug,$@),-Dv8_optimized_debug=2,) \ -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS) $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) @@ -446,4 +474,4 @@ dependencies: --revision 1831 svn checkout --force \ https://src.chromium.org/chrome/trunk/deps/third_party/icu46 \ - third_party/icu --revision 239289 + third_party/icu --revision 258359 diff --git a/deps/v8/Makefile.android b/deps/v8/Makefile.android index fad5fe9943..f4e144f280 100644 --- a/deps/v8/Makefile.android +++ b/deps/v8/Makefile.android @@ -26,7 +26,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Those definitions should be consistent with the main Makefile -ANDROID_ARCHES = android_ia32 android_arm android_mipsel +ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel MODES = release debug # Generates all combinations of ANDROID ARCHES and MODES, @@ -49,24 +49,40 @@ endif ifeq ($(ARCH), android_arm) DEFINES = target_arch=arm v8_target_arch=arm android_target_arch=arm DEFINES += arm_neon=0 arm_version=7 - TOOLCHAIN_ARCH = arm-linux-androideabi-4.6 + TOOLCHAIN_ARCH = arm-linux-androideabi + TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) + TOOLCHAIN_VER = 4.6 else - ifeq ($(ARCH), android_mipsel) - DEFINES = target_arch=mipsel v8_target_arch=mipsel android_target_arch=mips - DEFINES += mips_arch_variant=mips32r2 - TOOLCHAIN_ARCH = mipsel-linux-android-4.6 + ifeq ($(ARCH), android_arm64) + DEFINES = target_arch=arm64 v8_target_arch=arm64 android_target_arch=arm64 + TOOLCHAIN_ARCH = aarch64-linux-android + TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) + TOOLCHAIN_VER = 4.8 else - ifeq ($(ARCH), android_ia32) - DEFINES = target_arch=ia32 v8_target_arch=ia32 android_target_arch=x86 - TOOLCHAIN_ARCH = x86-4.6 + ifeq ($(ARCH), android_mipsel) + DEFINES = target_arch=mipsel v8_target_arch=mipsel + DEFINES += android_target_arch=mips mips_arch_variant=mips32r2 + TOOLCHAIN_ARCH = mipsel-linux-android + TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) + TOOLCHAIN_VER = 4.6 + else - $(error Target architecture "${ARCH}" is not supported) + ifeq ($(ARCH), android_ia32) + DEFINES = target_arch=ia32 v8_target_arch=ia32 android_target_arch=x86 + TOOLCHAIN_ARCH = x86 + TOOLCHAIN_PREFIX = i686-linux-android + TOOLCHAIN_VER = 4.6 + else + $(error Target architecture "${ARCH}" is not supported) + endif endif endif endif -TOOLCHAIN_PATH = ${ANDROID_NDK_ROOT}/toolchains/${TOOLCHAIN_ARCH}/prebuilt +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 \ @@ -79,23 +95,23 @@ DEFINES += host_os=${HOST_OS} .SECONDEXPANSION: $(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$@ @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ - CXX="$(ANDROID_TOOLCHAIN)/bin/*-g++" \ - AR="$(ANDROID_TOOLCHAIN)/bin/*-ar" \ - RANLIB="$(ANDROID_TOOLCHAIN)/bin/*-ranlib" \ - CC="$(ANDROID_TOOLCHAIN)/bin/*-gcc" \ - LD="$(ANDROID_TOOLCHAIN)/bin/*-ld" \ - LINK="$(ANDROID_TOOLCHAIN)/bin/*-g++" \ - BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ - python -c "print raw_input().capitalize()") \ - builddir="$(shell pwd)/$(OUTDIR)/$@" + 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)/$@" # Android GYP file generation targets. ANDROID_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ANDROID_BUILDS)) $(ANDROID_MAKEFILES): GYP_GENERATORS=make-android \ GYP_DEFINES="${DEFINES}" \ - CC="${ANDROID_TOOLCHAIN}/bin/*-gcc" \ - CXX="${ANDROID_TOOLCHAIN}/bin/*-g++" \ + CC="${ANDROID_TOOLCHAIN}/bin/${TOOLCHAIN_PREFIX}-gcc" \ + CXX="${ANDROID_TOOLCHAIN}/bin/${TOOLCHAIN_PREFIX}-g++" \ PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \ build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \ -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \ diff --git a/deps/v8/PRESUBMIT.py b/deps/v8/PRESUBMIT.py index fe15157dde..4f7a960097 100644 --- a/deps/v8/PRESUBMIT.py +++ b/deps/v8/PRESUBMIT.py @@ -98,3 +98,12 @@ def CheckChangeOnCommit(input_api, output_api): input_api, output_api, json_url='http://v8-status.appspot.com/current?format=json')) return results + + +def GetPreferredTryMasters(project, change): + return { + 'tryserver.v8': { + 'v8_mac_rel': set(['defaulttests']), + 'v8_win_rel': set(['defaulttests']), + }, + } diff --git a/deps/v8/build/all.gyp b/deps/v8/build/all.gyp index 5fbd8c28e7..3860379ea9 100644 --- a/deps/v8/build/all.gyp +++ b/deps/v8/build/all.gyp @@ -16,6 +16,7 @@ ['component!="shared_library"', { 'dependencies': [ '../tools/lexer-shell.gyp:lexer-shell', + '../tools/lexer-shell.gyp:parser-shell', ], }], ] diff --git a/deps/v8/build/android.gypi b/deps/v8/build/android.gypi index 0ea899d6ed..9570f444f9 100644 --- a/deps/v8/build/android.gypi +++ b/deps/v8/build/android.gypi @@ -184,6 +184,16 @@ '-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=="ia32"', { @@ -208,10 +218,19 @@ ], 'target_conditions': [ ['_type=="executable"', { + 'conditions': [ + ['target_arch=="arm64"', { + 'ldflags': [ + '-Wl,-dynamic-linker,/system/bin/linker64', + ], + }, { + 'ldflags': [ + '-Wl,-dynamic-linker,/system/bin/linker', + ], + }] + ], 'ldflags': [ '-Bdynamic', - '-Wl,-dynamic-linker,/system/bin/linker', - '-Wl,--gc-sections', '-Wl,-z,nocopyreloc', # crtbegin_dynamic.o should be the last item in ldflags. '<(android_lib)/crtbegin_dynamic.o', @@ -238,8 +257,15 @@ }], # _toolset=="target" # Settings for building host targets using the system toolchain. ['_toolset=="host"', { - 'cflags': [ '-m32', '-pthread' ], - 'ldflags': [ '-m32', '-pthread' ], + 'conditions': [ + ['target_arch=="x64"', { + 'cflags': [ '-m64', '-pthread' ], + 'ldflags': [ '-m64', '-pthread' ], + }, { + 'cflags': [ '-m32', '-pthread' ], + 'ldflags': [ '-m32', '-pthread' ], + }], + ], 'ldflags!': [ '-Wl,-z,noexecstack', '-Wl,--gc-sections', diff --git a/deps/v8/build/features.gypi b/deps/v8/build/features.gypi index f0e7212096..85b8a38465 100644 --- a/deps/v8/build/features.gypi +++ b/deps/v8/build/features.gypi @@ -115,7 +115,7 @@ 'Release': { 'variables': { 'v8_enable_extra_checks%': 0, - 'v8_enable_handle_zapping%': 0, + 'v8_enable_handle_zapping%': 1, }, 'conditions': [ ['v8_enable_extra_checks==1', { diff --git a/deps/v8/build/standalone.gypi b/deps/v8/build/standalone.gypi index bcfce39ada..6ff0170b9c 100644 --- a/deps/v8/build/standalone.gypi +++ b/deps/v8/build/standalone.gypi @@ -34,6 +34,7 @@ 'variables': { 'component%': 'static_library', 'clang%': 0, + 'asan%': 0, 'visibility%': 'hidden', 'v8_enable_backtrace%': 0, 'v8_enable_i18n_support%': 1, @@ -52,7 +53,11 @@ # to gyp. 'host_arch%': ' /dev/null 2>&1 < /dev/null) && echo "-m64" || true)', }, - 'cflags': [ '<(m64flag)' ], - 'ldflags': [ '<(m64flag)' ], + 'conditions': [ + ['((OS!="android" and OS!="qnx") or clang==1)', { + 'cflags': [ '<(m64flag)' ], + 'ldflags': [ '<(m64flag)' ], + }], + ], }] ], }], @@ -513,7 +523,8 @@ OS=="qnx"', { 'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter', '-Wnon-virtual-dtor', '-Woverloaded-virtual', - '<(wno_array_bounds)' ], + '<(wno_array_bounds)', + ], 'conditions': [ ['v8_optimized_debug==0', { 'cflags!': [ diff --git a/deps/v8/include/v8-debug.h b/deps/v8/include/v8-debug.h old mode 100755 new mode 100644 diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index 46752e968d..1691f29739 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -35,6 +35,9 @@ */ namespace v8 { +class HeapGraphNode; +struct HeapStatsUpdate; + typedef uint32_t SnapshotObjectId; /** @@ -158,12 +161,18 @@ class V8_EXPORT CpuProfiler { * |record_samples| parameter controls whether individual samples should * be recorded in addition to the aggregated tree. */ + void StartProfiling(Handle title, bool record_samples = false); + + /** Deprecated. Use StartProfiling instead. */ 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. */ const CpuProfile* StopCpuProfiling(Handle title); /** @@ -179,9 +188,6 @@ class V8_EXPORT CpuProfiler { }; -class HeapGraphNode; - - /** * HeapSnapshotEdge represents a directed connection between heap * graph nodes: from retainers to retained nodes. @@ -257,7 +263,11 @@ class V8_EXPORT HeapGraphNode { SnapshotObjectId GetId() const; /** Returns node's own size, in bytes. */ - int GetSelfSize() const; + V8_DEPRECATED("Use GetShallowSize instead", + int GetSelfSize() const); + + /** Returns node's own size, in bytes. */ + size_t GetShallowSize() const; /** Returns child nodes count of the node. */ int GetChildrenCount() const; @@ -267,6 +277,37 @@ class V8_EXPORT HeapGraphNode { }; +/** + * An interface for exporting data from V8, using "push" model. + */ +class V8_EXPORT OutputStream { // NOLINT + public: + enum WriteResult { + kContinue = 0, + kAbort = 1 + }; + virtual ~OutputStream() {} + /** Notify about the end of stream. */ + virtual void EndOfStream() = 0; + /** Get preferred output chunk size. Called only once. */ + virtual int GetChunkSize() { return 1024; } + /** + * Writes the next chunk of snapshot data into the stream. Writing + * can be stopped by returning kAbort as function result. EndOfStream + * will not be called in case writing was aborted. + */ + virtual WriteResult WriteAsciiChunk(char* data, int size) = 0; + /** + * Writes the next chunk of heap stats data into the stream. Writing + * can be stopped by returning kAbort as function result. EndOfStream + * will not be called in case writing was aborted. + */ + virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate* data, int count) { + return kAbort; + }; +}; + + /** * HeapSnapshots record the state of the JS heap at some moment. */ @@ -334,7 +375,24 @@ class V8_EXPORT HeapSnapshot { }; -class RetainedObjectInfo; +/** + * An interface for reporting progress and controlling long-running + * activities. + */ +class V8_EXPORT ActivityControl { // NOLINT + public: + enum ControlOption { + kContinue = 0, + kAbort = 1 + }; + virtual ~ActivityControl() {} + /** + * Notify about current progress. The activity can be stopped by + * returning kAbort as the callback result. + */ + virtual ControlOption ReportProgressValue(int done, int total) = 0; +}; + /** * Interface for controlling heap profiling. Instance of the diff --git a/deps/v8/include/v8-util.h b/deps/v8/include/v8-util.h new file mode 100644 index 0000000000..3f8cc6d269 --- /dev/null +++ b/deps/v8/include/v8-util.h @@ -0,0 +1,355 @@ +// 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 +// 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. + +#ifndef V8_UTIL_H_ +#define V8_UTIL_H_ + +#include "v8.h" +#include + +/** + * Support for Persistent containers. + * + * C++11 embedders can use STL containers with UniquePersistent values, + * but pre-C++11 does not support the required move semantic and hence + * may want these container classes. + */ +namespace v8 { + +typedef uintptr_t PersistentContainerValue; +static const uintptr_t kPersistentContainerNotFound = 0; + + +/** + * A default trait implemenation for PersistentValueMap which uses std::map + * as a backing map. + * + * Users will have to implement their own weak callbacks & dispose traits. + */ +template +class StdMapTraits { + public: + // STL map & related: + typedef std::map Impl; + typedef typename Impl::iterator Iterator; + + static bool Empty(Impl* impl) { return impl->empty(); } + static size_t Size(Impl* impl) { return impl->size(); } + static void Swap(Impl& a, Impl& b) { std::swap(a, b); } // NOLINT + static Iterator Begin(Impl* impl) { return impl->begin(); } + static Iterator End(Impl* impl) { return impl->end(); } + static K Key(Iterator it) { return it->first; } + static PersistentContainerValue Value(Iterator it) { return it->second; } + static PersistentContainerValue Set(Impl* impl, K key, + PersistentContainerValue value) { + std::pair res = impl->insert(std::make_pair(key, value)); + PersistentContainerValue old_value = kPersistentContainerNotFound; + if (!res.second) { + old_value = res.first->second; + res.first->second = value; + } + return old_value; + } + static PersistentContainerValue Get(Impl* impl, K key) { + Iterator it = impl->find(key); + if (it == impl->end()) return kPersistentContainerNotFound; + return it->second; + } + static PersistentContainerValue Remove(Impl* impl, K key) { + Iterator it = impl->find(key); + if (it == impl->end()) return kPersistentContainerNotFound; + PersistentContainerValue value = it->second; + impl->erase(it); + return value; + } +}; + + +/** + * A default trait implementation for PersistentValueMap, which inherits + * a std:map backing map from StdMapTraits and holds non-weak persistent + * objects. + * + * Users have to implement their own dispose trait. + */ +template +class StrongMapTraits : public StdMapTraits { + public: + // Weak callback & friends: + static const bool kIsWeak = false; + typedef typename StdMapTraits::Impl Impl; + typedef void WeakCallbackDataType; + static WeakCallbackDataType* WeakCallbackParameter( + Impl* impl, const K& key, Local value); + static Impl* ImplFromWeakCallbackData( + const WeakCallbackData& data); + static K KeyFromWeakCallbackData( + const WeakCallbackData& data); + static void DisposeCallbackData(WeakCallbackDataType* data); +}; + + +/** + * A default trait implementation for PersistentValueMap, with a std::map + * backing map, non-weak persistents as values, and no special dispose + * handling. Can be used as-is. + */ +template +class DefaultPersistentValueMapTraits : public StrongMapTraits { + public: + typedef typename StrongMapTraits::Impl Impl; + static void Dispose(Isolate* isolate, UniquePersistent value, + Impl* impl, K key) { } +}; + + +/** + * A map wrapper that allows using UniquePersistent as a mapped value. + * C++11 embedders don't need this class, as they can use UniquePersistent + * directly in std containers. + * + * The map relies on a backing map, whose type and accessors are described + * by the Traits class. The backing map will handle values of type + * PersistentContainerValue, with all conversion into and out of V8 + * handles being transparently handled by this class. + */ +template +class PersistentValueMap { + public: + V8_INLINE explicit PersistentValueMap(Isolate* isolate) : isolate_(isolate) {} + + V8_INLINE ~PersistentValueMap() { Clear(); } + + V8_INLINE Isolate* GetIsolate() { return isolate_; } + + /** + * Return size of the map. + */ + V8_INLINE size_t Size() { return Traits::Size(&impl_); } + + /** + * Return whether the map holds weak persistents. + */ + V8_INLINE bool IsWeak() { return Traits::kIsWeak; } + + /** + * Get value stored in map. + */ + V8_INLINE Local Get(const K& key) { + return Local::New(isolate_, FromVal(Traits::Get(&impl_, key))); + } + + /** + * Check whether a value is contained in the map. + */ + V8_INLINE bool Contains(const K& key) { + return Traits::Get(&impl_, key) != 0; + } + + /** + * Get value stored in map and set it in returnValue. + * Return true if a value was found. + */ + V8_INLINE bool SetReturnValue(const K& key, + ReturnValue& returnValue) { + PersistentContainerValue value = Traits::Get(&impl_, key); + bool hasValue = value != 0; + if (hasValue) { + returnValue.SetInternal( + *reinterpret_cast(FromVal(value))); + } + return hasValue; + } + + /** + * Call Isolate::SetReference with the given parent and the map value. + */ + V8_INLINE void SetReference(const K& key, + const Persistent& parent) { + GetIsolate()->SetReference( + reinterpret_cast(parent.val_), + reinterpret_cast(FromVal(Traits::Get(&impl_, key)))); + } + + /** + * Put value into map. Depending on Traits::kIsWeak, the value will be held + * by the map strongly or weakly. + * Returns old value as UniquePersistent. + */ + UniquePersistent Set(const K& key, Local value) { + UniquePersistent persistent(isolate_, value); + return SetUnique(key, &persistent); + } + + /** + * Put value into map, like Set(const K&, Local). + */ + UniquePersistent Set(const K& key, UniquePersistent value) { + return SetUnique(key, &value); + } + + /** + * Return value for key and remove it from the map. + */ + V8_INLINE UniquePersistent Remove(const K& key) { + return Release(Traits::Remove(&impl_, key)).Pass(); + } + + /** + * Traverses the map repeatedly, + * in case side effects of disposal cause insertions. + **/ + void Clear() { + typedef typename Traits::Iterator It; + HandleScope handle_scope(isolate_); + // TODO(dcarney): figure out if this swap and loop is necessary. + while (!Traits::Empty(&impl_)) { + typename Traits::Impl impl; + Traits::Swap(impl_, impl); + for (It i = Traits::Begin(&impl); i != Traits::End(&impl); ++i) { + Traits::Dispose(isolate_, Release(Traits::Value(i)).Pass(), &impl, + Traits::Key(i)); + } + } + } + + private: + PersistentValueMap(PersistentValueMap&); + void operator=(PersistentValueMap&); + + /** + * Put the value into the map, and set the 'weak' callback when demanded + * by the Traits class. + */ + UniquePersistent SetUnique(const K& key, UniquePersistent* persistent) { + if (Traits::kIsWeak) { + Local value(Local::New(isolate_, *persistent)); + persistent->template SetWeak( + Traits::WeakCallbackParameter(&impl_, key, value), WeakCallback); + } + PersistentContainerValue old_value = + Traits::Set(&impl_, key, ClearAndLeak(persistent)); + return Release(old_value).Pass(); + } + + static void WeakCallback( + const WeakCallbackData& data) { + if (Traits::kIsWeak) { + typename Traits::Impl* impl = Traits::ImplFromWeakCallbackData(data); + K key = Traits::KeyFromWeakCallbackData(data); + PersistentContainerValue value = Traits::Remove(impl, key); + Traits::Dispose(data.GetIsolate(), Release(value).Pass(), impl, key); + } + } + + V8_INLINE static V* FromVal(PersistentContainerValue v) { + return reinterpret_cast(v); + } + + V8_INLINE static PersistentContainerValue ClearAndLeak( + UniquePersistent* persistent) { + V* v = persistent->val_; + persistent->val_ = 0; + return reinterpret_cast(v); + } + + /** + * Return a container value as UniquePersistent and make sure the weak + * callback is properly disposed of. All remove functionality should go + * through this. + */ + V8_INLINE static UniquePersistent Release(PersistentContainerValue v) { + UniquePersistent p; + p.val_ = FromVal(v); + if (Traits::kIsWeak && !p.IsEmpty()) { + Traits::DisposeCallbackData( + p.template ClearWeak()); + } + return p.Pass(); + } + + Isolate* isolate_; + typename Traits::Impl impl_; +}; + + +/** + * A map that uses UniquePersistent 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. + */ +template > +class StdPersistentValueMap : public PersistentValueMap { + public: + explicit StdPersistentValueMap(Isolate* isolate) + : PersistentValueMap(isolate) {} +}; + + +/** + * Empty default implementations for StrongTraits methods. + * + * These should not be necessary, since they're only used in code that + * is surrounded by if(Traits::kIsWeak), which for StrongMapTraits is + * compile-time false. Most compilers can live without them; however + * the compiler we use from 64-bit Win differs. + * + * TODO(vogelheim): Remove these once they're no longer necessary. + */ +template +typename StrongMapTraits::WeakCallbackDataType* + StrongMapTraits::WeakCallbackParameter( + Impl* impl, const K& key, Local value) { + return NULL; +} + + +template +typename StrongMapTraits::Impl* + StrongMapTraits::ImplFromWeakCallbackData( + const WeakCallbackData& data) { + return NULL; +} + + +template +K StrongMapTraits::KeyFromWeakCallbackData( + const WeakCallbackData& data) { + return K(); +} + + +template +void StrongMapTraits::DisposeCallbackData(WeakCallbackDataType* data) { +} + +} // namespace v8 + +#endif // V8_UTIL_H_ diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index fe3b020417..608e3c52c3 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -108,6 +108,7 @@ class ObjectTemplate; class Platform; class Primitive; class RawOperationDescriptor; +class Script; class Signature; class StackFrame; class StackTrace; @@ -127,10 +128,12 @@ template class PersistentBase; template > class Persistent; template class UniquePersistent; +template class PersistentValueMap; template class WeakCallbackObject; class FunctionTemplate; class ObjectTemplate; class Data; +template class FunctionCallbackInfo; template class PropertyCallbackInfo; class StackTrace; class StackFrame; @@ -140,6 +143,7 @@ class ObjectOperationDescriptor; class RawOperationDescriptor; class CallHandlerHelper; class EscapableHandleScope; +template class ReturnValue; namespace internal { class Arguments; @@ -412,6 +416,7 @@ template class Local : public Handle { template friend class internal::CustomArguments; friend class HandleScope; friend class EscapableHandleScope; + template friend class PersistentValueMap; V8_INLINE static Local New(Isolate* isolate, T* that); }; @@ -527,7 +532,11 @@ template class PersistentBase { P* parameter, typename WeakCallbackData::Callback callback); - V8_INLINE void ClearWeak(); + template + V8_INLINE P* ClearWeak(); + + // TODO(dcarney): remove this. + V8_INLINE void ClearWeak() { ClearWeak(); } /** * Marks the reference to this object independent. Garbage collector is free @@ -576,6 +585,8 @@ template class PersistentBase { template friend class UniquePersistent; template friend class PersistentBase; template friend class ReturnValue; + template friend class PersistentValueMap; + friend class Object; explicit V8_INLINE PersistentBase(T* val) : val_(val) {} PersistentBase(PersistentBase& other); // NOLINT @@ -743,7 +754,7 @@ class UniquePersistent : public PersistentBase { }; public: - /** + /** * A UniquePersistent with no storage cell. */ V8_INLINE UniquePersistent() : PersistentBase(0) { } @@ -781,6 +792,7 @@ class UniquePersistent : public PersistentBase { template V8_INLINE UniquePersistent& operator=(UniquePersistent rhs) { TYPE_CHECK(T, S); + this->Reset(); this->val_ = rhs.val_; rhs.val_ = 0; return *this; @@ -998,114 +1010,188 @@ class ScriptOrigin { /** - * A compiled JavaScript script. + * A compiled JavaScript script, not yet tied to a Context. */ -class V8_EXPORT Script { +class V8_EXPORT UnboundScript { public: /** - * Compiles the specified script (context-independent). - * - * \param source Script source code. - * \param origin Script origin, owned by caller, no references are kept - * when New() returns - * \param pre_data Pre-parsing data, as obtained by ScriptData::PreCompile() - * using pre_data speeds compilation if it's done multiple times. - * Owned by caller, no references are kept when New() returns. - * \param script_data Arbitrary data associated with script. Using - * this has same effect as calling SetData(), but allows data to be - * available to compile event handlers. - * \return Compiled script object (context independent; when run it - * will use the currently entered context). + * Binds the script to the currently entered context. */ - static Local + +Dump %(dump_name)s + + + +
+ + +
+
+
+""" + + +WEB_FOOTER = """ + + +""" + + +class WebParameterError(Exception): + def __init__(self, message): + Exception.__init__(self, message) + + +class InspectionWebHandler(BaseHTTPServer.BaseHTTPRequestHandler): + def formatter(self, query_components): + name = query_components.get("dump", [None])[0] + return self.server.get_dump_formatter(name) + + def send_success_html_headers(self): + self.send_response(200) + self.send_header("Cache-Control", "no-cache, no-store, must-revalidate") + self.send_header("Pragma", "no-cache") + self.send_header("Expires", "0") + self.send_header('Content-type','text/html') + self.end_headers() + return + + def do_GET(self): + try: + parsedurl = urlparse.urlparse(self.path) + query_components = urlparse.parse_qs(parsedurl.query) + if parsedurl.path == "/dumps.html": + self.send_success_html_headers() + self.server.output_dumps(self.wfile) + elif parsedurl.path == "/summary.html": + self.send_success_html_headers() + self.formatter(query_components).output_summary(self.wfile) + elif parsedurl.path == "/info.html": + self.send_success_html_headers() + self.formatter(query_components).output_info(self.wfile) + elif parsedurl.path == "/modules.html": + self.send_success_html_headers() + self.formatter(query_components).output_modules(self.wfile) + elif parsedurl.path == "/search.html": + address = query_components.get("val", []) + if len(address) != 1: + self.send_error(404, "Invalid params") + return + self.send_success_html_headers() + self.formatter(query_components).output_search_res( + self.wfile, address[0]) + elif parsedurl.path == "/disasm.html": + address = query_components.get("val", []) + exact = query_components.get("exact", ["on"]) + if len(address) != 1: + self.send_error(404, "Invalid params") + return + self.send_success_html_headers() + self.formatter(query_components).output_disasm( + self.wfile, address[0], exact[0]) + elif parsedurl.path == "/data.html": + address = query_components.get("val", []) + datakind = query_components.get("type", ["address"]) + if len(address) == 1 and len(datakind) == 1: + self.send_success_html_headers() + self.formatter(query_components).output_data( + self.wfile, address[0], datakind[0]) + else: + self.send_error(404,'Invalid params') + elif parsedurl.path == "/setdumpdesc": + name = query_components.get("dump", [""]) + description = query_components.get("description", [""]) + if len(name) == 1 and len(description) == 1: + name = name[0] + description = description[0] + if self.server.set_dump_desc(name, description): + self.send_success_html_headers() + self.wfile.write("OK") + return + self.send_error(404,'Invalid params') + elif parsedurl.path == "/setcomment": + address = query_components.get("address", []) + comment = query_components.get("comment", [""]) + if len(address) == 1 and len(comment) == 1: + address = address[0] + comment = comment[0] + self.formatter(query_components).set_comment(address, comment) + self.send_success_html_headers() + self.wfile.write("OK") + else: + self.send_error(404,'Invalid params') + elif parsedurl.path == "/setpageaddress": + kind = query_components.get("kind", []) + address = query_components.get("address", [""]) + if len(kind) == 1 and len(address) == 1: + kind = kind[0] + address = address[0] + self.formatter(query_components).set_page_address(kind, address) + self.send_success_html_headers() + self.wfile.write("OK") + else: + self.send_error(404,'Invalid params') + else: + self.send_error(404,'File Not Found: %s' % self.path) + + except IOError: + self.send_error(404,'File Not Found: %s' % self.path) + + except WebParameterError as e: + self.send_error(404, 'Web parameter error: %s' % e.message) + + +HTML_REG_FORMAT = "%s: %s\n" + + +class InspectionWebFormatter(object): + CONTEXT_FULL = 0 + CONTEXT_SHORT = 1 + + def __init__(self, switches, minidump_name, http_server): + self.dumpfilename = os.path.split(minidump_name)[1] + self.encfilename = urllib.urlencode({ 'dump' : self.dumpfilename }) + self.reader = MinidumpReader(switches, minidump_name) + self.server = http_server + + # Set up the heap + exception_thread = self.reader.thread_map[self.reader.exception.thread_id] + stack_top = self.reader.ExceptionSP() + stack_bottom = exception_thread.stack.start + \ + exception_thread.stack.memory.data_size + stack_map = {self.reader.ExceptionIP(): -1} + for slot in xrange(stack_top, stack_bottom, self.reader.PointerSize()): + maybe_address = self.reader.ReadUIntPtr(slot) + if not maybe_address in stack_map: + stack_map[maybe_address] = slot + self.heap = V8Heap(self.reader, stack_map) + + self.padawan = InspectionPadawan(self.reader, self.heap) + self.comments = InspectionInfo(minidump_name, self.reader) + self.padawan.known_first_data_page = ( + self.comments.get_page_address("datapage")) + self.padawan.known_first_map_page = ( + self.comments.get_page_address("mappage")) + self.padawan.known_first_pointer_page = ( + self.comments.get_page_address("pointerpage")) + + def set_comment(self, straddress, comment): + try: + address = int(straddress, 0) + self.comments.set_comment(address, comment) + except ValueError: + print "Invalid address" + + def set_page_address(self, kind, straddress): + try: + address = int(straddress, 0) + if kind == "datapage": + self.padawan.known_first_data_page = address + elif kind == "mappage": + self.padawan.known_first_map_page = address + elif kind == "pointerpage": + self.padawan.known_first_pointer_page = address + self.comments.save_page_address(kind, address) + except ValueError: + print "Invalid address" + + def td_from_address(self, f, address): + f.write("" % self.comments.get_style_class_string(address)) + + def format_address(self, maybeaddress, straddress = None): + if maybeaddress is None: + return "not in dump" + else: + if straddress is None: + straddress = "0x" + self.reader.FormatIntPtr(maybeaddress) + style_class = "" + if not self.reader.IsValidAddress(maybeaddress): + style_class = " class=\"nodump\"" + return ("%s" % + (style_class, self.encfilename, straddress, straddress)) + + def output_header(self, f): + f.write(WEB_HEADER % + { "query_dump" : self.encfilename, + "dump_name" : cgi.escape(self.dumpfilename) }) + + def output_footer(self, f): + f.write(WEB_FOOTER) + + MAX_CONTEXT_STACK = 4096 + + def output_summary(self, f): + self.output_header(f) + f.write('
') + self.output_context(f, InspectionWebFormatter.CONTEXT_SHORT) + self.output_disasm_pc(f) + + # Output stack + exception_thread = self.reader.thread_map[self.reader.exception.thread_id] + stack_bottom = exception_thread.stack.start + \ + min(exception_thread.stack.memory.data_size, self.MAX_CONTEXT_STACK) + stack_top = self.reader.ExceptionSP() + self.output_words(f, stack_top - 16, stack_bottom, stack_top, "Stack") + + f.write('
') + self.output_footer(f) + return + + def output_info(self, f): + self.output_header(f) + f.write("

Dump info

\n") + f.write("Description: ") + self.server.output_dump_desc_field(f, self.dumpfilename) + f.write("
\n") + f.write("Filename: ") + f.write("%s
\n" % (self.dumpfilename)) + dt = datetime.datetime.fromtimestamp(self.reader.header.time_date_stampt) + f.write("Timestamp: %s
\n" % dt.strftime('%Y-%m-%d %H:%M:%S')) + self.output_context(f, InspectionWebFormatter.CONTEXT_FULL) + self.output_address_ranges(f) + self.output_footer(f) + return + + def output_address_ranges(self, f): + regions = {} + def print_region(_reader, start, size, _location): + regions[start] = size + self.reader.ForEachMemoryRegion(print_region) + f.write("

Available memory regions

\n") + f.write('
') + f.write("\n") + f.write("") + f.write("") + f.write("") + f.write("") + f.write("\n") + for start in sorted(regions): + size = regions[start] + f.write("") + f.write("" % self.format_address(start)) + f.write("" % self.format_address(start + size)) + f.write("" % size) + f.write("\n") + f.write("
Start addressEnd addressNumber of bytes
%s %s %d
\n") + f.write('
') + return + + def output_module_details(self, f, module): + f.write("%s" % GetModuleName(self.reader, module)) + file_version = GetVersionString(module.version_info.dwFileVersionMS, + module.version_info.dwFileVersionLS) + product_version = GetVersionString(module.version_info.dwProductVersionMS, + module.version_info.dwProductVersionLS) + f.write("
  \n") + f.write("base: %s" % self.reader.FormatIntPtr(module.base_of_image)) + f.write("
  \n") + f.write(" end: %s" % self.reader.FormatIntPtr(module.base_of_image + + module.size_of_image)) + f.write("
  \n") + f.write(" file version: %s" % file_version) + f.write("
  \n") + f.write(" product version: %s" % product_version) + f.write("
  \n") + time_date_stamp = datetime.datetime.fromtimestamp(module.time_date_stamp) + f.write(" timestamp: %s" % time_date_stamp) + f.write("
\n"); + + def output_modules(self, f): + self.output_header(f) + f.write('
') + for module in self.reader.module_list.modules: + self.output_module_details(f, module) + f.write("
") + self.output_footer(f) + return + + def output_context(self, f, details): + exception_thread = self.reader.thread_map[self.reader.exception.thread_id] + f.write("

Exception context

") + f.write('
\n') + f.write("Thread id: %d" % exception_thread.id) + f.write("   Exception code: %08X\n" % + self.reader.exception.exception.code) + if details == InspectionWebFormatter.CONTEXT_FULL: + if self.reader.exception.exception.parameter_count > 0: + f.write("   Exception parameters: \n") + for i in xrange(0, self.reader.exception.exception.parameter_count): + f.write("%08x" % self.reader.exception.exception.information[i]) + f.write("

\n") + + for r in CONTEXT_FOR_ARCH[self.reader.arch]: + f.write(HTML_REG_FORMAT % + (r, self.format_address(self.reader.Register(r)))) + # TODO(vitalyr): decode eflags. + if self.reader.arch == MD_CPU_ARCHITECTURE_ARM: + f.write("cpsr: %s" % bin(self.reader.exception_context.cpsr)[2:]) + else: + f.write("eflags: %s" % + bin(self.reader.exception_context.eflags)[2:]) + f.write('
\n') + return + + def align_down(self, a, size): + alignment_correction = a % size + return a - alignment_correction + + def align_up(self, a, size): + alignment_correction = (size - 1) - ((a + size - 1) % size) + return a + alignment_correction + + def format_object(self, address): + heap_object = self.padawan.SenseObject(address) + return cgi.escape(str(heap_object or "")) + + def output_data(self, f, straddress, datakind): + try: + self.output_header(f) + address = int(straddress, 0) + if not self.reader.IsValidAddress(address): + f.write("

Address 0x%x not found in the dump.

" % address) + return + region = self.reader.FindRegion(address) + if datakind == "address": + self.output_words(f, region[0], region[0] + region[1], address, "Dump") + elif datakind == "ascii": + self.output_ascii(f, region[0], region[0] + region[1], address) + self.output_footer(f) + + except ValueError: + f.write("

Unrecognized address format \"%s\".

" % straddress) + return + + def output_words(self, f, start_address, end_address, + highlight_address, desc): + region = self.reader.FindRegion(highlight_address) + if region is None: + f.write("

Address 0x%x not found in the dump.

\n" % + (highlight_address)) + return + size = self.heap.PointerSize() + start_address = self.align_down(start_address, size) + low = self.align_down(region[0], size) + high = self.align_up(region[0] + region[1], size) + if start_address < low: + start_address = low + end_address = self.align_up(end_address, size) + if end_address > high: + end_address = high + + expand = "" + if start_address != low or end_address != high: + expand = ("(" + " more..." + " )" % + (self.encfilename, highlight_address)) + + f.write("

%s 0x%x - 0x%x, " + "highlighting 0x%x %s

\n" % + (desc, start_address, end_address, highlight_address, expand)) + f.write('
') + f.write("\n") + + for slot in xrange(start_address, end_address, size): + heap_object = "" + maybe_address = None + end_region = region[0] + region[1] + if slot < region[0] or slot + size > end_region: + straddress = "0x" + for i in xrange(end_region, slot + size): + straddress += "??" + for i in reversed( + xrange(max(slot, region[0]), min(slot + size, end_region))): + straddress += "%02x" % self.reader.ReadU8(i) + for i in xrange(slot, region[0]): + straddress += "??" + else: + maybe_address = self.reader.ReadUIntPtr(slot) + straddress = self.format_address(maybe_address) + if maybe_address: + heap_object = self.format_object(maybe_address) + + address_fmt = "%s \n" + if slot == highlight_address: + f.write("\n") + address_fmt = "%s \n" + elif slot < highlight_address and highlight_address < slot + size: + f.write("\n") + address_fmt = "%s \n" + else: + f.write("\n") + + f.write(" \n") + f.write(" ") + self.td_from_address(f, slot) + f.write(address_fmt % self.format_address(slot)) + f.write(" ") + self.td_from_address(f, maybe_address) + f.write(":  %s  \n" % straddress) + f.write(" \n") + f.write(" \n" % (heap_object or '')) + f.write("\n") + f.write("
") + self.output_comment_box(f, "da-", slot) + f.write("") + if maybe_address != None: + self.output_comment_box( + f, "sv-" + self.reader.FormatIntPtr(slot), maybe_address) + f.write(" %s
\n") + f.write("
") + return + + def output_ascii(self, f, start_address, end_address, highlight_address): + region = self.reader.FindRegion(highlight_address) + if region is None: + f.write("

Address %x not found in the dump.

" % + highlight_address) + return + if start_address < region[0]: + start_address = region[0] + if end_address > region[0] + region[1]: + end_address = region[0] + region[1] + + expand = "" + if start_address != region[0] or end_address != region[0] + region[1]: + link = ("data.html?%s&val=0x%x&type=ascii#highlight" % + (self.encfilename, highlight_address)) + expand = "(more...)" % link + + f.write("

ASCII dump 0x%x - 0x%x, highlighting 0x%x %s

" % + (start_address, end_address, highlight_address, expand)) + + line_width = 64 + + f.write('
') + + start = self.align_down(start_address, line_width) + + for address in xrange(start, end_address): + if address % 64 == 0: + if address != start: + f.write("
") + f.write("0x%08x: " % address) + if address < start_address: + f.write(" ") + else: + if address == highlight_address: + f.write("") + code = self.reader.ReadU8(address) + if code < 127 and code >= 32: + f.write("&#") + f.write(str(code)) + f.write(";") + else: + f.write("·") + if address == highlight_address: + f.write("") + f.write("
") + return + + def output_disasm(self, f, straddress, strexact): + try: + self.output_header(f) + address = int(straddress, 0) + if not self.reader.IsValidAddress(address): + f.write("

Address 0x%x not found in the dump.

" % address) + return + region = self.reader.FindRegion(address) + self.output_disasm_range( + f, region[0], region[0] + region[1], address, strexact == "on") + self.output_footer(f) + except ValueError: + f.write("

Unrecognized address format \"%s\".

" % straddress) + return + + def output_disasm_range( + self, f, start_address, end_address, highlight_address, exact): + region = self.reader.FindRegion(highlight_address) + if start_address < region[0]: + start_address = region[0] + if end_address > region[0] + region[1]: + end_address = region[0] + region[1] + count = end_address - start_address + lines = self.reader.GetDisasmLines(start_address, count) + found = False + if exact: + for line in lines: + if line[0] + start_address == highlight_address: + found = True + break + if not found: + start_address = highlight_address + count = end_address - start_address + lines = self.reader.GetDisasmLines(highlight_address, count) + expand = "" + if start_address != region[0] or end_address != region[0] + region[1]: + exactness = "" + if exact and not found and end_address == region[0] + region[1]: + exactness = "&exact=off" + expand = ("(more...)" % + (self.encfilename, exactness, highlight_address)) + + f.write("

Disassembling 0x%x - 0x%x, highlighting 0x%x %s

" % + (start_address, end_address, highlight_address, expand)) + f.write('
') + f.write("\n"); + for i in xrange(0, len(lines)): + line = lines[i] + next_address = count + if i + 1 < len(lines): + next_line = lines[i + 1] + next_address = next_line[0] + self.format_disasm_line( + f, start_address, line, next_address, highlight_address) + f.write("
\n") + f.write("
") + return + + def annotate_disasm_addresses(self, line): + extra = [] + for m in ADDRESS_RE.finditer(line): + maybe_address = int(m.group(0), 16) + formatted_address = self.format_address(maybe_address, m.group(0)) + line = line.replace(m.group(0), formatted_address) + object_info = self.padawan.SenseObject(maybe_address) + if not object_info: + continue + extra.append(cgi.escape(str(object_info))) + if len(extra) == 0: + return line + return ("%s ;; %s" % + (line, ", ".join(extra))) + + def format_disasm_line( + self, f, start, line, next_address, highlight_address): + line_address = start + line[0] + address_fmt = " %s\n" + if line_address == highlight_address: + f.write("\n") + address_fmt = " %s\n" + elif (line_address < highlight_address and + highlight_address < next_address + start): + f.write("\n") + address_fmt = " %s\n" + else: + f.write("\n") + num_bytes = next_address - line[0] + stack_slot = self.heap.stack_map.get(line_address) + marker = "" + if stack_slot: + marker = "=>" + op_offset = 3 * num_bytes - 1 + + code = line[1] + # Compute the actual call target which the disassembler is too stupid + # to figure out (it adds the call offset to the disassembly offset rather + # than the absolute instruction address). + if self.heap.reader.arch == MD_CPU_ARCHITECTURE_X86: + if code.startswith("e8"): + words = code.split() + if len(words) > 6 and words[5] == "call": + offset = int(words[4] + words[3] + words[2] + words[1], 16) + target = (line_address + offset + 5) & 0xFFFFFFFF + code = code.replace(words[6], "0x%08x" % target) + # TODO(jkummerow): port this hack to ARM and x64. + + opcodes = code[:op_offset] + code = self.annotate_disasm_addresses(code[op_offset:]) + f.write(" ") + self.output_comment_box(f, "codel-", line_address) + f.write("\n") + f.write(address_fmt % marker) + f.write(" ") + self.td_from_address(f, line_address) + f.write("%s (+0x%x)\n" % + (self.format_address(line_address), line[0])) + f.write(" : %s \n" % opcodes) + f.write(" %s\n" % code) + f.write("\n") + + def output_comment_box(self, f, prefix, address): + f.write("" % + (prefix, + self.reader.FormatIntPtr(address), + cgi.escape(self.comments.get_comment(address)) or "")) + + MAX_FOUND_RESULTS = 100 + + def output_find_results(self, f, results): + f.write("Addresses") + toomany = len(results) > self.MAX_FOUND_RESULTS + if toomany: + f.write("(found %i results, displaying only first %i)" % + (len(results), self.MAX_FOUND_RESULTS)) + f.write(": \n") + results = sorted(results) + results = results[:min(len(results), self.MAX_FOUND_RESULTS)] + for address in results: + f.write("%s\n" % + (self.comments.get_style_class_string(address), + self.format_address(address))) + if toomany: + f.write("...\n") + + + def output_page_info(self, f, page_kind, page_address, my_page_address): + if my_page_address == page_address and page_address != 0: + f.write("Marked first %s page.\n" % page_kind) + else: + f.write("" % page_kind) + f.write("Marked first %s page." % page_kind) + f.write("\n") + f.write("\n" % page_kind) + return + + def output_search_res(self, f, straddress): + try: + self.output_header(f) + f.write("

Search results for %s

" % straddress) + + address = int(straddress, 0) + + f.write("Comment: ") + self.output_comment_box(f, "search-", address) + f.write("
\n") + + page_address = address & ~self.heap.PageAlignmentMask() + + f.write("Page info: \n") + self.output_page_info(f, "data", self.padawan.known_first_data_page, \ + page_address) + self.output_page_info(f, "map", self.padawan.known_first_map_page, \ + page_address) + self.output_page_info(f, "pointer", \ + self.padawan.known_first_pointer_page, \ + page_address) + + if not self.reader.IsValidAddress(address): + f.write("

The contents at address %s not found in the dump.

" % \ + straddress) + else: + # Print as words + self.output_words(f, address - 8, address + 32, address, "Dump") + + # Print as ASCII + f.write("
\n") + self.output_ascii(f, address, address + 256, address) + + # Print as code + f.write("
\n") + self.output_disasm_range(f, address - 16, address + 16, address, True) + + aligned_res, unaligned_res = self.reader.FindWordList(address) + + if len(aligned_res) > 0: + f.write("

Occurrences of 0x%x at aligned addresses

\n" % + address) + self.output_find_results(f, aligned_res) + + if len(unaligned_res) > 0: + f.write("

Occurrences of 0x%x at unaligned addresses

\n" % \ + address) + self.output_find_results(f, unaligned_res) + + if len(aligned_res) + len(unaligned_res) == 0: + f.write("

No occurences of 0x%x found in the dump

\n" % address) + + self.output_footer(f) + + except ValueError: + f.write("

Unrecognized address format \"%s\".

" % straddress) + return + + def output_disasm_pc(self, f): + address = self.reader.ExceptionIP() + if not self.reader.IsValidAddress(address): + return + self.output_disasm_range(f, address - 16, address + 16, address, True) + + +WEB_DUMPS_HEADER = """ + + + + + + + + +Dump list + + + +""" + +WEB_DUMPS_FOOTER = """ + + +""" + +DUMP_FILE_RE = re.compile(r"[-_0-9a-zA-Z][-\._0-9a-zA-Z]*\.dmp$") + + +class InspectionWebServer(BaseHTTPServer.HTTPServer): + def __init__(self, port_number, switches, minidump_name): + BaseHTTPServer.HTTPServer.__init__( + self, ('', port_number), InspectionWebHandler) + splitpath = os.path.split(minidump_name) + self.dumppath = splitpath[0] + self.dumpfilename = splitpath[1] + self.default_formatter = InspectionWebFormatter( + switches, minidump_name, self) + self.formatters = { self.dumpfilename : self.default_formatter } + self.switches = switches + + def output_dump_desc_field(self, f, name): + try: + descfile = open(os.path.join(self.dumppath, name + ".desc"), "r") + desc = descfile.readline() + descfile.close() + except IOError: + desc = "" + f.write("\n" % + (cgi.escape(name), desc)) + + def set_dump_desc(self, name, description): + if not DUMP_FILE_RE.match(name): + return False + fname = os.path.join(self.dumppath, name) + if not os.path.isfile(fname): + return False + fname = fname + ".desc" + descfile = open(fname, "w") + descfile.write(description) + descfile.close() + return True + + def get_dump_formatter(self, name): + if name is None: + return self.default_formatter + else: + if not DUMP_FILE_RE.match(name): + raise WebParameterError("Invalid name '%s'" % name) + formatter = self.formatters.get(name, None) + if formatter is None: + try: + formatter = InspectionWebFormatter( + self.switches, os.path.join(self.dumppath, name), self) + self.formatters[name] = formatter + except IOError: + raise WebParameterError("Could not open dump '%s'" % name) + return formatter + + def output_dumps(self, f): + f.write(WEB_DUMPS_HEADER) + f.write("

List of available dumps

") + f.write("\n") + f.write("") + f.write("") + f.write("") + f.write("") + f.write("") + dumps_by_time = {} + for fname in os.listdir(self.dumppath): + if DUMP_FILE_RE.match(fname): + mtime = os.stat(os.path.join(self.dumppath, fname)).st_mtime + fnames = dumps_by_time.get(mtime, []) + fnames.append(fname) + dumps_by_time[mtime] = fnames + + for mtime in sorted(dumps_by_time, reverse=True): + fnames = dumps_by_time[mtime] + for fname in fnames: + f.write("\n") + f.write("\n" % ( + (urllib.urlencode({ 'dump' : fname }), fname))) + f.write("") + f.write("") + f.write("\n") + f.write("
NameFile timeComment
%s   ") + f.write(datetime.datetime.fromtimestamp(mtime)) + f.write("   ") + self.output_dump_desc_field(f, fname) + f.write("
\n") + f.write(WEB_DUMPS_FOOTER) + return class InspectionShell(cmd.Cmd): def __init__(self, reader, heap): @@ -1996,6 +3123,8 @@ if __name__ == "__main__": parser = optparse.OptionParser(USAGE) parser.add_option("-s", "--shell", dest="shell", action="store_true", help="start an interactive inspector shell") + parser.add_option("-w", "--web", dest="web", action="store_true", + help="start a web server on localhost:%i" % PORT_NUMBER) parser.add_option("-c", "--command", dest="command", default="", help="run an interactive inspector shell command and exit") parser.add_option("-f", "--full", dest="full", action="store_true", @@ -2014,4 +3143,14 @@ if __name__ == "__main__": if len(args) != 1: parser.print_help() sys.exit(1) - AnalyzeMinidump(options, args[0]) + if options.web: + try: + server = InspectionWebServer(PORT_NUMBER, options, args[0]) + print 'Started httpserver on port ' , PORT_NUMBER + webbrowser.open('http://localhost:%i/summary.html' % PORT_NUMBER) + server.serve_forever() + except KeyboardInterrupt: + print '^C received, shutting down the web server' + server.socket.close() + else: + AnalyzeMinidump(options, args[0]) diff --git a/deps/v8/tools/gyp/v8.gyp b/deps/v8/tools/gyp/v8.gyp index d78853789c..f7bdf52b96 100644 --- a/deps/v8/tools/gyp/v8.gyp +++ b/deps/v8/tools/gyp/v8.gyp @@ -27,6 +27,7 @@ { 'variables': { + 'icu_use_data_file_flag%': 0, 'v8_code': 1, 'v8_random_seed%': 314159265, }, @@ -258,6 +259,7 @@ '../../src/assembler.cc', '../../src/assembler.h', '../../src/assert-scope.h', + '../../src/assert-scope.cc', '../../src/ast.cc', '../../src/ast.h', '../../src/atomicops.h', @@ -343,6 +345,7 @@ '../../src/factory.h', '../../src/fast-dtoa.cc', '../../src/fast-dtoa.h', + '../../src/feedback-slots.h', '../../src/fixed-dtoa.cc', '../../src/fixed-dtoa.h', '../../src/flag-definitions.h', @@ -406,8 +409,6 @@ '../../src/hydrogen-mark-deoptimize.h', '../../src/hydrogen-mark-unreachable.cc', '../../src/hydrogen-mark-unreachable.h', - '../../src/hydrogen-minus-zero.cc', - '../../src/hydrogen-minus-zero.h', '../../src/hydrogen-osr.cc', '../../src/hydrogen-osr.h', '../../src/hydrogen-range-analysis.cc', @@ -420,6 +421,8 @@ '../../src/hydrogen-representation-changes.h', '../../src/hydrogen-sce.cc', '../../src/hydrogen-sce.h', + '../../src/hydrogen-store-elimination.cc', + '../../src/hydrogen-store-elimination.h', '../../src/hydrogen-uint32-analysis.cc', '../../src/hydrogen-uint32-analysis.h', '../../src/i18n.cc', @@ -645,6 +648,52 @@ '../../src/arm/stub-cache-arm.cc', ], }], + ['v8_target_arch=="arm64"', { + 'sources': [ ### gcmole(arch:arm64) ### + '../../src/arm64/assembler-arm64.cc', + '../../src/arm64/assembler-arm64.h', + '../../src/arm64/assembler-arm64-inl.h', + '../../src/arm64/builtins-arm64.cc', + '../../src/arm64/codegen-arm64.cc', + '../../src/arm64/codegen-arm64.h', + '../../src/arm64/code-stubs-arm64.cc', + '../../src/arm64/code-stubs-arm64.h', + '../../src/arm64/constants-arm64.h', + '../../src/arm64/cpu-arm64.cc', + '../../src/arm64/cpu-arm64.h', + '../../src/arm64/debug-arm64.cc', + '../../src/arm64/decoder-arm64.cc', + '../../src/arm64/decoder-arm64.h', + '../../src/arm64/decoder-arm64-inl.h', + '../../src/arm64/deoptimizer-arm64.cc', + '../../src/arm64/disasm-arm64.cc', + '../../src/arm64/disasm-arm64.h', + '../../src/arm64/frames-arm64.cc', + '../../src/arm64/frames-arm64.h', + '../../src/arm64/full-codegen-arm64.cc', + '../../src/arm64/ic-arm64.cc', + '../../src/arm64/instructions-arm64.cc', + '../../src/arm64/instructions-arm64.h', + '../../src/arm64/instrument-arm64.cc', + '../../src/arm64/instrument-arm64.h', + '../../src/arm64/lithium-arm64.cc', + '../../src/arm64/lithium-arm64.h', + '../../src/arm64/lithium-codegen-arm64.cc', + '../../src/arm64/lithium-codegen-arm64.h', + '../../src/arm64/lithium-gap-resolver-arm64.cc', + '../../src/arm64/lithium-gap-resolver-arm64.h', + '../../src/arm64/macro-assembler-arm64.cc', + '../../src/arm64/macro-assembler-arm64.h', + '../../src/arm64/macro-assembler-arm64-inl.h', + '../../src/arm64/regexp-macro-assembler-arm64.cc', + '../../src/arm64/regexp-macro-assembler-arm64.h', + '../../src/arm64/simulator-arm64.cc', + '../../src/arm64/simulator-arm64.h', + '../../src/arm64/stub-cache-arm64.cc', + '../../src/arm64/utils-arm64.cc', + '../../src/arm64/utils-arm64.h', + ], + }], ['v8_target_arch=="ia32" or v8_target_arch=="mac" or OS=="mac"', { 'sources': [ ### gcmole(arch:ia32) ### '../../src/ia32/assembler-ia32-inl.h', @@ -972,6 +1021,17 @@ '../../src/default-platform.h', ], }], + ['icu_use_data_file_flag==1', { + 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE'], + }, { # else icu_use_data_file_flag !=1 + 'conditions': [ + ['OS=="win"', { + 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED'], + }, { + 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC'], + }], + ], + }], ], }, { @@ -1013,6 +1073,9 @@ '../../src/regexp.js', '../../src/arraybuffer.js', '../../src/typedarray.js', + '../../src/weak_collection.js', + '../../src/promise.js', + '../../src/object-observe.js', '../../src/macros.py', ], 'experimental_library_files': [ @@ -1020,8 +1083,6 @@ '../../src/symbol.js', '../../src/proxy.js', '../../src/collection.js', - '../../src/object-observe.js', - '../../src/promise.js', '../../src/generator.js', '../../src/array-iterator.js', '../../src/harmony-string.js', diff --git a/deps/v8/tools/lexer-shell.cc b/deps/v8/tools/lexer-shell.cc index 0610e7f70d..e2e4a9c252 100644 --- a/deps/v8/tools/lexer-shell.cc +++ b/deps/v8/tools/lexer-shell.cc @@ -26,7 +26,6 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -#include #include #include #include @@ -35,53 +34,18 @@ #include "v8.h" #include "api.h" -#include "ast.h" -#include "char-predicates-inl.h" #include "messages.h" #include "platform.h" #include "runtime.h" #include "scanner-character-streams.h" #include "scopeinfo.h" +#include "shell-utils.h" #include "string-stream.h" #include "scanner.h" using namespace v8::internal; -enum Encoding { - LATIN1, - UTF8, - UTF16 -}; - - -const byte* ReadFile(const char* name, Isolate* isolate, - int* size, int repeat) { - FILE* file = fopen(name, "rb"); - *size = 0; - if (file == NULL) return NULL; - - fseek(file, 0, SEEK_END); - int file_size = ftell(file); - rewind(file); - - *size = file_size * repeat; - - byte* chars = new byte[*size + 1]; - for (int i = 0; i < file_size;) { - int read = static_cast(fread(&chars[i], 1, file_size - i, file)); - i += read; - } - fclose(file); - - for (int i = file_size; i < *size; i++) { - chars[i] = chars[i - file_size]; - } - chars[*size] = 0; - - return chars; -} - class BaselineScanner { public: @@ -92,7 +56,7 @@ class BaselineScanner { int repeat) : stream_(NULL) { int length = 0; - source_ = ReadFile(fname, isolate, &length, repeat); + source_ = ReadFileAndRepeat(fname, &length, repeat); unicode_cache_ = new UnicodeCache(); scanner_ = new Scanner(unicode_cache_); switch (encoding) { @@ -104,6 +68,7 @@ class BaselineScanner { Vector( reinterpret_cast(source_), length / 2)); + CHECK_NOT_EMPTY_HANDLE(isolate, result); stream_ = new GenericStringUtf16CharacterStream(result, 0, result->length()); break; @@ -111,6 +76,7 @@ class BaselineScanner { case LATIN1: { Handle result = isolate->factory()->NewStringFromOneByte( Vector(source_, length)); + CHECK_NOT_EMPTY_HANDLE(isolate, result); stream_ = new GenericStringUtf16CharacterStream(result, 0, result->length()); break; diff --git a/deps/v8/tools/lexer-shell.gyp b/deps/v8/tools/lexer-shell.gyp index 8e6ab7a844..623a503a0a 100644 --- a/deps/v8/tools/lexer-shell.gyp +++ b/deps/v8/tools/lexer-shell.gyp @@ -51,6 +51,29 @@ ], 'sources': [ 'lexer-shell.cc', + 'shell-utils.h', + ], + }, + { + 'target_name': 'parser-shell', + 'type': 'executable', + 'dependencies': [ + '../tools/gyp/v8.gyp:v8', + ], + 'conditions': [ + ['v8_enable_i18n_support==1', { + 'dependencies': [ + '<(icu_gyp_path):icui18n', + '<(icu_gyp_path):icuuc', + ], + }], + ], + 'include_dirs+': [ + '../src', + ], + 'sources': [ + 'parser-shell.cc', + 'shell-utils.h', ], }, ], diff --git a/deps/v8/tools/merge-to-branch.sh b/deps/v8/tools/merge-to-branch.sh index ccdae6c9bc..4e8a86c834 100755 --- a/deps/v8/tools/merge-to-branch.sh +++ b/deps/v8/tools/merge-to-branch.sh @@ -235,7 +235,6 @@ if [ $START_STEP -le $CURRENT_STEP ] ; then echo ">>> Step $CURRENT_STEP: Apply patches for selected revisions." restore_if_unset "MERGE_TO_BRANCH" restore_patch_commit_hashes_if_unset "PATCH_COMMIT_HASHES" - rm -f "$TOUCHED_FILES_FILE" for HASH in ${PATCH_COMMIT_HASHES[@]} ; do echo "Applying patch for $HASH to $MERGE_TO_BRANCH..." git log -1 -p $HASH > "$TEMPORARY_PATCH_FILE" diff --git a/deps/v8/tools/parser-shell.cc b/deps/v8/tools/parser-shell.cc new file mode 100644 index 0000000000..4da15fc7e3 --- /dev/null +++ b/deps/v8/tools/parser-shell.cc @@ -0,0 +1,171 @@ +// 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 +// 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. + +#include +#include +#include +#include +#include +#include +#include "v8.h" + +#include "api.h" +#include "compiler.h" +#include "scanner-character-streams.h" +#include "shell-utils.h" +#include "parser.h" +#include "preparse-data-format.h" +#include "preparse-data.h" +#include "preparser.h" + +using namespace v8::internal; + +enum TestMode { + PreParseAndParse, + PreParse, + Parse +}; + +std::pair RunBaselineParser( + const char* fname, Encoding encoding, int repeat, v8::Isolate* isolate, + v8::Handle context, TestMode test_mode) { + int length = 0; + const byte* source = ReadFileAndRepeat(fname, &length, repeat); + v8::Handle source_handle; + switch (encoding) { + case UTF8: { + source_handle = v8::String::NewFromUtf8( + isolate, reinterpret_cast(source)); + break; + } + case UTF16: { + source_handle = v8::String::NewFromTwoByte( + isolate, reinterpret_cast(source), + v8::String::kNormalString, length / 2); + break; + } + case LATIN1: { + source_handle = v8::String::NewFromOneByte(isolate, source); + break; + } + } + v8::ScriptData* cached_data = NULL; + TimeDelta preparse_time, parse_time; + if (test_mode == PreParseAndParse || test_mode == PreParse) { + ElapsedTimer timer; + timer.Start(); + cached_data = v8::ScriptData::PreCompile(source_handle); + preparse_time = timer.Elapsed(); + if (cached_data == NULL || cached_data->HasError()) { + fprintf(stderr, "Preparsing failed\n"); + return std::make_pair(TimeDelta(), TimeDelta()); + } + } + if (test_mode == PreParseAndParse || test_mode == Parse) { + Handle str = v8::Utils::OpenHandle(*source_handle); + i::Isolate* internal_isolate = str->GetIsolate(); + Handle