From 83261e789eb903da39f279cb5a161611482e7df5 Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Mon, 18 Mar 2013 13:49:34 -0700 Subject: [PATCH] deps: update v8 to 3.17.13 --- deps/v8/AUTHORS | 3 + deps/v8/ChangeLog | 514 ++ deps/v8/Makefile | 22 +- deps/v8/Makefile.android | 16 +- deps/v8/SConstruct | 24 - deps/v8/build/android.gypi | 36 +- deps/v8/build/common.gypi | 82 +- deps/v8/build/gyp_v8 | 2 +- deps/v8/build/standalone.gypi | 9 +- deps/v8/include/v8-profiler.h | 45 +- deps/v8/include/v8.h | 1523 +++--- deps/v8/samples/lineprocessor.cc | 41 +- deps/v8/samples/process.cc | 63 +- deps/v8/samples/shell.cc | 78 +- deps/v8/src/SConscript | 4 +- deps/v8/src/accessors.cc | 168 +- deps/v8/src/api.cc | 1701 ++++--- deps/v8/src/api.h | 12 +- deps/v8/src/apinatives.js | 2 +- deps/v8/src/arm/assembler-arm-inl.h | 97 +- deps/v8/src/arm/assembler-arm.cc | 707 ++- deps/v8/src/arm/assembler-arm.h | 335 +- deps/v8/src/arm/builtins-arm.cc | 205 +- deps/v8/src/arm/code-stubs-arm.cc | 2375 +++++---- deps/v8/src/arm/code-stubs-arm.h | 202 +- deps/v8/src/arm/codegen-arm.cc | 305 +- deps/v8/src/arm/codegen-arm.h | 22 + deps/v8/src/arm/constants-arm.cc | 8 +- deps/v8/src/arm/constants-arm.h | 23 +- deps/v8/src/arm/debug-arm.cc | 2 +- deps/v8/src/arm/deoptimizer-arm.cc | 522 +- deps/v8/src/arm/disasm-arm.cc | 93 +- deps/v8/src/arm/frames-arm.cc | 9 + deps/v8/src/arm/frames-arm.h | 30 +- deps/v8/src/arm/full-codegen-arm.cc | 359 +- deps/v8/src/arm/ic-arm.cc | 320 +- deps/v8/src/arm/lithium-arm.cc | 494 +- deps/v8/src/arm/lithium-arm.h | 369 +- deps/v8/src/arm/lithium-codegen-arm.cc | 2080 +++++--- deps/v8/src/arm/lithium-codegen-arm.h | 56 +- deps/v8/src/arm/lithium-gap-resolver-arm.cc | 13 +- deps/v8/src/arm/macro-assembler-arm.cc | 814 ++-- deps/v8/src/arm/macro-assembler-arm.h | 210 +- deps/v8/src/arm/regexp-macro-assembler-arm.cc | 59 +- deps/v8/src/arm/simulator-arm.cc | 270 +- deps/v8/src/arm/simulator-arm.h | 10 +- deps/v8/src/arm/stub-cache-arm.cc | 2044 +++----- deps/v8/src/array.js | 29 +- deps/v8/src/assembler.cc | 317 +- deps/v8/src/assembler.h | 160 +- deps/v8/src/ast.cc | 74 +- deps/v8/src/ast.h | 116 +- deps/v8/src/atomicops.h | 6 +- deps/v8/src/atomicops_internals_tsan.h | 335 ++ deps/v8/src/bootstrapper.cc | 651 +-- deps/v8/src/bootstrapper.h | 19 +- deps/v8/src/builtins.cc | 929 ++-- deps/v8/src/builtins.h | 116 +- deps/v8/src/checks.cc | 3 +- deps/v8/src/code-stubs-hydrogen.cc | 389 ++ deps/v8/src/code-stubs.cc | 330 +- deps/v8/src/code-stubs.h | 817 +++- deps/v8/src/codegen.cc | 57 +- deps/v8/src/codegen.h | 28 +- deps/v8/src/collection.js | 54 +- deps/v8/src/compilation-cache.cc | 4 +- deps/v8/src/compiler.cc | 262 +- deps/v8/src/compiler.h | 116 +- deps/v8/src/contexts.cc | 40 +- deps/v8/src/contexts.h | 20 +- deps/v8/src/conversions-inl.h | 8 +- deps/v8/src/counters.cc | 7 +- deps/v8/src/cpu-profiler.cc | 168 +- deps/v8/src/cpu-profiler.h | 113 +- deps/v8/src/d8-debug.cc | 32 +- deps/v8/src/d8-debug.h | 8 +- deps/v8/src/d8-posix.cc | 2 +- deps/v8/src/d8-readline.cc | 31 +- deps/v8/src/d8.cc | 628 +-- deps/v8/src/d8.gyp | 8 +- deps/v8/src/d8.h | 51 +- deps/v8/src/d8.js | 675 +-- deps/v8/src/data-flow.h | 55 + deps/v8/src/date.js | 2 +- deps/v8/src/debug-agent.cc | 19 +- deps/v8/src/debug-debugger.js | 258 +- deps/v8/src/debug.cc | 164 +- deps/v8/src/debug.h | 14 +- deps/v8/src/deoptimizer.cc | 1279 +++-- deps/v8/src/deoptimizer.h | 124 +- deps/v8/src/disassembler.cc | 36 +- deps/v8/src/disassembler.h | 2 +- deps/v8/src/elements-kind.cc | 9 +- deps/v8/src/elements-kind.h | 8 + deps/v8/src/elements.cc | 896 +++- deps/v8/src/elements.h | 51 +- deps/v8/src/execution.cc | 109 +- deps/v8/src/execution.h | 11 +- .../externalize-string-extension.cc | 13 +- deps/v8/src/extensions/gc-extension.cc | 6 +- deps/v8/src/factory.cc | 169 +- deps/v8/src/factory.h | 61 +- deps/v8/src/flag-definitions.h | 80 +- deps/v8/src/flags.cc | 1 + deps/v8/src/frames-inl.h | 10 + deps/v8/src/frames.cc | 125 +- deps/v8/src/frames.h | 120 +- deps/v8/src/full-codegen.cc | 263 +- deps/v8/src/full-codegen.h | 27 +- deps/v8/src/func-name-inferrer.cc | 6 +- deps/v8/src/global-handles.cc | 347 +- deps/v8/src/global-handles.h | 52 +- deps/v8/src/globals.h | 6 +- deps/v8/src/handles-inl.h | 75 +- deps/v8/src/handles.cc | 266 +- deps/v8/src/handles.h | 68 +- deps/v8/src/heap-inl.h | 128 +- deps/v8/src/heap-profiler.cc | 54 +- deps/v8/src/heap-profiler.h | 36 +- deps/v8/src/heap-snapshot-generator-inl.h | 87 + deps/v8/src/heap-snapshot-generator.cc | 2707 +++++++++++ deps/v8/src/heap-snapshot-generator.h | 697 +++ deps/v8/src/heap.cc | 1800 ++++--- deps/v8/src/heap.h | 659 ++- deps/v8/src/hydrogen-instructions.cc | 1423 ++++-- deps/v8/src/hydrogen-instructions.h | 2275 ++++++--- deps/v8/src/hydrogen.cc | 3273 ++++++++----- deps/v8/src/hydrogen.h | 458 +- deps/v8/src/ia32/assembler-ia32-inl.h | 71 +- deps/v8/src/ia32/assembler-ia32.cc | 293 +- deps/v8/src/ia32/assembler-ia32.h | 251 +- deps/v8/src/ia32/builtins-ia32.cc | 176 +- deps/v8/src/ia32/code-stubs-ia32.cc | 1987 ++++---- deps/v8/src/ia32/code-stubs-ia32.h | 155 +- deps/v8/src/ia32/codegen-ia32.cc | 269 +- deps/v8/src/ia32/codegen-ia32.h | 14 + deps/v8/src/ia32/deoptimizer-ia32.cc | 462 +- deps/v8/src/ia32/disasm-ia32.cc | 9 + deps/v8/src/ia32/frames-ia32.cc | 7 + deps/v8/src/ia32/frames-ia32.h | 32 +- deps/v8/src/ia32/full-codegen-ia32.cc | 324 +- deps/v8/src/ia32/ic-ia32.cc | 307 +- deps/v8/src/ia32/lithium-codegen-ia32.cc | 1741 +++++-- deps/v8/src/ia32/lithium-codegen-ia32.h | 76 +- deps/v8/src/ia32/lithium-gap-resolver-ia32.cc | 12 +- deps/v8/src/ia32/lithium-gap-resolver-ia32.h | 4 +- deps/v8/src/ia32/lithium-ia32.cc | 460 +- deps/v8/src/ia32/lithium-ia32.h | 352 +- deps/v8/src/ia32/macro-assembler-ia32.cc | 322 +- deps/v8/src/ia32/macro-assembler-ia32.h | 86 +- .../src/ia32/regexp-macro-assembler-ia32.cc | 38 +- deps/v8/src/ia32/stub-cache-ia32.cc | 1728 ++----- deps/v8/src/ic-inl.h | 16 +- deps/v8/src/ic.cc | 2061 ++++---- deps/v8/src/ic.h | 456 +- deps/v8/src/incremental-marking-inl.h | 27 +- deps/v8/src/incremental-marking.cc | 289 +- deps/v8/src/incremental-marking.h | 21 +- deps/v8/src/interface.cc | 17 +- deps/v8/src/interface.h | 35 +- deps/v8/src/interpreter-irregexp.cc | 4 +- deps/v8/src/isolate.cc | 498 +- deps/v8/src/isolate.h | 136 +- deps/v8/src/json-parser.h | 167 +- deps/v8/src/json-stringifier.h | 791 +++ deps/v8/src/json.js | 147 +- deps/v8/src/jsregexp-inl.h | 106 + deps/v8/src/jsregexp.cc | 288 +- deps/v8/src/jsregexp.h | 69 +- deps/v8/src/list-inl.h | 11 +- deps/v8/src/list.h | 3 + deps/v8/src/lithium-allocator-inl.h | 24 +- deps/v8/src/lithium-allocator.cc | 137 +- deps/v8/src/lithium-allocator.h | 67 +- deps/v8/src/lithium.cc | 62 +- deps/v8/src/lithium.h | 27 +- deps/v8/src/liveedit-debugger.js | 37 +- deps/v8/src/liveedit.cc | 338 +- deps/v8/src/liveobjectlist-inl.h | 126 - deps/v8/src/liveobjectlist.cc | 2631 ---------- deps/v8/src/liveobjectlist.h | 319 -- deps/v8/src/log-utils.cc | 11 +- deps/v8/src/log.cc | 489 +- deps/v8/src/log.h | 102 +- deps/v8/src/macro-assembler.h | 39 + deps/v8/src/macros.py | 3 + deps/v8/src/mark-compact.cc | 708 ++- deps/v8/src/mark-compact.h | 162 +- deps/v8/src/marking-thread.cc | 85 + .../v8/src/{inspector.cc => marking-thread.h} | 56 +- deps/v8/src/math.js | 32 +- deps/v8/src/messages.cc | 37 +- deps/v8/src/messages.h | 8 +- deps/v8/src/messages.js | 537 ++- deps/v8/src/mips/assembler-mips-inl.h | 77 +- deps/v8/src/mips/assembler-mips.cc | 172 +- deps/v8/src/mips/assembler-mips.h | 164 +- deps/v8/src/mips/builtins-mips.cc | 191 +- deps/v8/src/mips/code-stubs-mips.cc | 2088 ++++---- deps/v8/src/mips/code-stubs-mips.h | 189 +- deps/v8/src/mips/codegen-mips.cc | 292 +- deps/v8/src/mips/codegen-mips.h | 22 + deps/v8/src/mips/constants-mips.cc | 2 + deps/v8/src/mips/constants-mips.h | 22 +- deps/v8/src/mips/deoptimizer-mips.cc | 477 +- deps/v8/src/mips/disasm-mips.cc | 13 + deps/v8/src/mips/frames-mips.cc | 9 + deps/v8/src/mips/frames-mips.h | 40 +- deps/v8/src/mips/full-codegen-mips.cc | 332 +- deps/v8/src/mips/ic-mips.cc | 312 +- deps/v8/src/mips/lithium-codegen-mips.cc | 1699 +++++-- deps/v8/src/mips/lithium-codegen-mips.h | 44 +- deps/v8/src/mips/lithium-gap-resolver-mips.cc | 7 + deps/v8/src/mips/lithium-mips.cc | 422 +- deps/v8/src/mips/lithium-mips.h | 334 +- deps/v8/src/mips/macro-assembler-mips.cc | 299 +- deps/v8/src/mips/macro-assembler-mips.h | 77 +- .../src/mips/regexp-macro-assembler-mips.cc | 31 +- deps/v8/src/mips/simulator-mips.cc | 134 +- deps/v8/src/mips/simulator-mips.h | 5 + deps/v8/src/mips/stub-cache-mips.cc | 1923 ++------ deps/v8/src/mirror-debugger.js | 25 + deps/v8/src/mksnapshot.cc | 7 +- deps/v8/src/object-observe.js | 235 + deps/v8/src/objects-debug.cc | 94 +- deps/v8/src/objects-inl.h | 1000 +++- deps/v8/src/objects-printer.cc | 130 +- deps/v8/src/objects-visiting-inl.h | 130 +- deps/v8/src/objects-visiting.cc | 9 +- deps/v8/src/objects-visiting.h | 71 +- deps/v8/src/objects.cc | 4262 ++++++++++------- deps/v8/src/objects.h | 2244 +++++---- deps/v8/src/optimizing-compiler-thread.cc | 62 +- deps/v8/src/optimizing-compiler-thread.h | 17 +- deps/v8/src/parser.cc | 206 +- deps/v8/src/parser.h | 6 - deps/v8/src/platform-cygwin.cc | 41 +- deps/v8/src/platform-freebsd.cc | 84 +- deps/v8/src/platform-linux.cc | 121 +- deps/v8/src/platform-macos.cc | 45 +- deps/v8/src/platform-nullos.cc | 17 + deps/v8/src/platform-openbsd.cc | 71 +- deps/v8/src/platform-posix.cc | 26 +- deps/v8/src/platform-solaris.cc | 80 +- deps/v8/src/platform-win32.cc | 82 +- deps/v8/src/platform.h | 16 +- deps/v8/src/preparse-data.cc | 4 +- deps/v8/src/preparse-data.h | 2 +- deps/v8/src/preparser.cc | 18 +- deps/v8/src/prettyprinter.cc | 20 +- deps/v8/src/prettyprinter.h | 2 + deps/v8/src/profile-generator-inl.h | 56 +- deps/v8/src/profile-generator.cc | 2703 +---------- deps/v8/src/profile-generator.h | 689 +-- deps/v8/src/property-details.h | 6 + deps/v8/src/property.cc | 2 +- deps/v8/src/property.h | 133 +- deps/v8/src/proxy.js | 16 +- deps/v8/src/regexp-macro-assembler.cc | 30 +- deps/v8/src/regexp-macro-assembler.h | 4 +- deps/v8/src/regexp-stack.cc | 1 + deps/v8/src/regexp.js | 38 +- deps/v8/src/rewriter.cc | 17 +- deps/v8/src/runtime-profiler.cc | 53 +- deps/v8/src/runtime-profiler.h | 25 - deps/v8/src/runtime.cc | 3228 +++++++------ deps/v8/src/runtime.h | 103 +- deps/v8/src/runtime.js | 12 +- deps/v8/src/safepoint-table.cc | 11 +- deps/v8/src/scanner.h | 14 +- deps/v8/src/scopeinfo.cc | 78 +- deps/v8/src/scopeinfo.h | 67 +- deps/v8/src/scopes.cc | 235 +- deps/v8/src/scopes.h | 36 +- deps/v8/src/serialize.cc | 61 +- deps/v8/src/serialize.h | 8 +- deps/v8/src/smart-pointers.h | 17 +- deps/v8/src/spaces-inl.h | 15 +- deps/v8/src/spaces.cc | 630 ++- deps/v8/src/spaces.h | 237 +- deps/v8/src/store-buffer.cc | 11 +- deps/v8/src/store-buffer.h | 4 +- deps/v8/src/string-search.h | 22 +- deps/v8/src/string-stream.cc | 20 +- deps/v8/src/string.js | 203 +- deps/v8/src/stub-cache.cc | 1258 +++-- deps/v8/src/stub-cache.h | 621 ++- deps/v8/src/sweeper-thread.cc | 103 + deps/v8/src/sweeper-thread.h | 75 + deps/v8/src/symbol.js | 39 + deps/v8/src/token.h | 13 +- deps/v8/src/transitions-inl.h | 14 +- deps/v8/src/transitions.cc | 6 +- deps/v8/src/transitions.h | 14 +- deps/v8/src/type-info.cc | 334 +- deps/v8/src/type-info.h | 65 +- deps/v8/src/unicode-inl.h | 180 +- deps/v8/src/unicode.cc | 124 +- deps/v8/src/unicode.h | 137 +- deps/v8/src/uri.h | 309 ++ deps/v8/src/uri.js | 86 +- deps/v8/src/utils.h | 51 +- deps/v8/src/v8-counters.cc | 11 - deps/v8/src/v8-counters.h | 19 +- deps/v8/src/v8.cc | 49 +- deps/v8/src/v8.h | 1 + deps/v8/src/v8conversions.cc | 48 +- deps/v8/src/v8globals.h | 63 +- deps/v8/src/v8natives.js | 237 +- deps/v8/src/v8threads.cc | 40 +- deps/v8/src/v8utils.cc | 93 - deps/v8/src/v8utils.h | 69 +- deps/v8/src/variables.cc | 8 +- deps/v8/src/variables.h | 4 +- deps/v8/src/version.cc | 6 +- deps/v8/src/vm-state-inl.h | 13 +- deps/v8/src/x64/assembler-x64-inl.h | 88 +- deps/v8/src/x64/assembler-x64.cc | 195 +- deps/v8/src/x64/assembler-x64.h | 135 +- deps/v8/src/x64/builtins-x64.cc | 181 +- deps/v8/src/x64/code-stubs-x64.cc | 1708 ++++--- deps/v8/src/x64/code-stubs-x64.h | 152 +- deps/v8/src/x64/codegen-x64.cc | 225 +- deps/v8/src/x64/codegen-x64.h | 21 +- deps/v8/src/x64/deoptimizer-x64.cc | 450 +- deps/v8/src/x64/disasm-x64.cc | 12 + deps/v8/src/x64/frames-x64.cc | 7 + deps/v8/src/x64/frames-x64.h | 30 +- deps/v8/src/x64/full-codegen-x64.cc | 335 +- deps/v8/src/x64/ic-x64.cc | 313 +- deps/v8/src/x64/lithium-codegen-x64.cc | 1461 ++++-- deps/v8/src/x64/lithium-codegen-x64.h | 54 +- deps/v8/src/x64/lithium-x64.cc | 397 +- deps/v8/src/x64/lithium-x64.h | 290 +- deps/v8/src/x64/macro-assembler-x64.cc | 293 +- deps/v8/src/x64/macro-assembler-x64.h | 100 +- deps/v8/src/x64/regexp-macro-assembler-x64.cc | 41 +- deps/v8/src/x64/stub-cache-x64.cc | 1657 ++----- deps/v8/test/cctest/SConscript | 2 + deps/v8/test/cctest/cctest.cc | 4 + deps/v8/test/cctest/cctest.gyp | 5 + deps/v8/test/cctest/cctest.h | 47 +- deps/v8/test/cctest/cctest.status | 3 + deps/v8/test/cctest/test-accessors.cc | 77 +- deps/v8/test/cctest/test-alloc.cc | 36 +- deps/v8/test/cctest/test-api.cc | 2168 +++++---- deps/v8/test/cctest/test-assembler-arm.cc | 261 +- deps/v8/test/cctest/test-assembler-ia32.cc | 107 +- deps/v8/test/cctest/test-assembler-mips.cc | 136 +- deps/v8/test/cctest/test-assembler-x64.cc | 13 +- deps/v8/test/cctest/test-circular-queue.cc | 25 + deps/v8/test/cctest/test-compiler.cc | 63 +- deps/v8/test/cctest/test-conversions.cc | 25 + deps/v8/test/cctest/test-cpu-profiler.cc | 138 +- deps/v8/test/cctest/test-date.cc | 6 +- deps/v8/test/cctest/test-debug.cc | 295 +- .../test/cctest/test-declarative-accessors.cc | 301 ++ deps/v8/test/cctest/test-decls.cc | 199 +- deps/v8/test/cctest/test-deoptimization.cc | 32 +- deps/v8/test/cctest/test-dictionary.cc | 12 +- deps/v8/test/cctest/test-disasm-arm.cc | 143 +- deps/v8/test/cctest/test-disasm-ia32.cc | 32 +- deps/v8/test/cctest/test-disasm-mips.cc | 7 +- deps/v8/test/cctest/test-disasm-x64.cc | 2 +- deps/v8/test/cctest/test-diy-fp.cc | 25 + deps/v8/test/cctest/test-double.cc | 25 + deps/v8/test/cctest/test-fast-dtoa.cc | 25 + .../test/cctest/test-func-name-inference.cc | 44 +- deps/v8/test/cctest/test-global-object.cc | 51 + deps/v8/test/cctest/test-hashing.cc | 55 +- deps/v8/test/cctest/test-heap-profiler.cc | 292 +- deps/v8/test/cctest/test-heap.cc | 1260 ++++- deps/v8/test/cctest/test-lock.cc | 25 + deps/v8/test/cctest/test-lockers.cc | 67 +- deps/v8/test/cctest/test-log-stack-tracer.cc | 13 +- deps/v8/test/cctest/test-log.cc | 47 +- .../test/cctest/test-macro-assembler-x64.cc | 158 +- deps/v8/test/cctest/test-mark-compact.cc | 74 +- deps/v8/test/cctest/test-object-observe.cc | 438 ++ deps/v8/test/cctest/test-parsing.cc | 100 +- deps/v8/test/cctest/test-platform-linux.cc | 25 + deps/v8/test/cctest/test-platform-macos.cc | 25 + deps/v8/test/cctest/test-platform-nullos.cc | 25 + deps/v8/test/cctest/test-platform-tls.cc | 25 + deps/v8/test/cctest/test-platform-win32.cc | 25 + deps/v8/test/cctest/test-platform.cc | 37 + deps/v8/test/cctest/test-profile-generator.cc | 136 +- deps/v8/test/cctest/test-random.cc | 7 +- deps/v8/test/cctest/test-regexp.cc | 45 +- deps/v8/test/cctest/test-serialize.cc | 55 +- deps/v8/test/cctest/test-sockets.cc | 25 + deps/v8/test/cctest/test-spaces.cc | 139 + deps/v8/test/cctest/test-strings.cc | 821 +++- deps/v8/test/cctest/test-strtod.cc | 25 + deps/v8/test/cctest/test-symbols.cc | 61 + .../v8/test/cctest/test-thread-termination.cc | 33 +- deps/v8/test/cctest/test-threads.cc | 14 +- deps/v8/test/cctest/test-unbound-queue.cc | 25 + deps/v8/test/cctest/test-weakmaps.cc | 116 +- deps/v8/test/cctest/testcfg.py | 11 +- deps/v8/test/message/overwritten-builtins.out | 2 + deps/v8/test/mjsunit/allocation-site-info.js | 272 ++ .../mjsunit/array-bounds-check-removal.js | 129 +- .../v8/test/mjsunit/array-natives-elements.js | 318 ++ deps/v8/test/mjsunit/array-reduce.js | 16 +- deps/v8/test/mjsunit/array-slice.js | 12 + deps/v8/test/mjsunit/array-store-and-grow.js | 5 +- deps/v8/test/mjsunit/assert-opt-and-deopt.js | 3 +- deps/v8/test/mjsunit/big-array-literal.js | 4 +- deps/v8/test/mjsunit/builtins.js | 2 +- .../test/mjsunit/compiler/inline-closures.js | 49 + .../mjsunit/compiler/inline-function-apply.js | 89 + .../test/mjsunit/compiler/inline-literals.js | 21 + deps/v8/test/mjsunit/compiler/multiply-add.js | 69 + deps/v8/test/mjsunit/compiler/multiply-sub.js | 56 + .../mjsunit/compiler/parallel-proto-change.js | 45 + .../test/mjsunit/compiler/property-static.js | 69 + .../mjsunit/compiler/proto-chain-constant.js | 55 + .../test/mjsunit/compiler/proto-chain-load.js | 44 + .../test/mjsunit/compiler/regress-177883.js | 179 + deps/v8/test/mjsunit/compiler/rotate.js | 223 + deps/v8/test/mjsunit/constant-folding-2.js | 258 + .../mjsunit/debug-liveedit-compile-error.js | 58 + .../test/mjsunit/debug-liveedit-literals.js | 94 + .../test/mjsunit/debug-set-variable-value.js | 308 ++ deps/v8/test/mjsunit/elements-kind.js | 8 +- .../test/mjsunit/elements-length-no-holey.js | 33 + deps/v8/test/mjsunit/elements-transition.js | 2 +- deps/v8/test/mjsunit/error-accessors.js | 53 + deps/v8/test/mjsunit/error-constructors.js | 15 +- deps/v8/test/mjsunit/error-tostring.js | 8 + deps/v8/test/mjsunit/eval-stack-trace.js | 9 +- deps/v8/test/mjsunit/fast-prototype.js | 4 + deps/v8/test/mjsunit/function-call.js | 32 +- deps/v8/test/mjsunit/fuzz-natives-part1.js | 7 +- deps/v8/test/mjsunit/fuzz-natives-part2.js | 6 +- deps/v8/test/mjsunit/fuzz-natives-part3.js | 6 +- deps/v8/test/mjsunit/fuzz-natives-part4.js | 6 +- .../test/mjsunit/generated-transition-stub.js | 218 + deps/v8/test/mjsunit/harmony/collections.js | 58 +- .../v8/test/mjsunit/harmony/module-linking.js | 2 +- .../v8/test/mjsunit/harmony/object-observe.js | 1056 ++++ deps/v8/test/mjsunit/harmony/proxies-json.js | 178 + deps/v8/test/mjsunit/harmony/proxies.js | 6 +- deps/v8/test/mjsunit/harmony/symbols.js | 244 + deps/v8/test/mjsunit/json-parser-recursive.js | 33 + .../test/mjsunit/json-stringify-recursive.js | 52 + deps/v8/test/mjsunit/json.js | 63 +- deps/v8/test/mjsunit/json2.js | 153 + .../test/mjsunit/manual-parallel-recompile.js | 62 + deps/v8/test/mjsunit/math-exp-precision.js | 64 + .../mjsunit/math-floor-of-div-minus-zero.js | 1 + .../test/mjsunit/math-floor-of-div-nosudiv.js | 288 ++ deps/v8/test/mjsunit/math-floor-of-div.js | 90 +- deps/v8/test/mjsunit/mjsunit.status | 18 + deps/v8/test/mjsunit/new-function.js | 4 +- .../mjsunit/object-get-own-property-names.js | 10 + .../mjsunit/parallel-optimize-disabled.js | 46 + deps/v8/test/mjsunit/regexp-capture-3.js | 33 +- deps/v8/test/mjsunit/regress/regress-1122.js | 6 +- .../v8/test/mjsunit/regress/regress-121407.js | 2 +- .../mjsunit/regress/regress-147497.js} | 39 +- .../v8/test/mjsunit/regress/regress-164442.js | 45 + .../v8/test/mjsunit/regress/regress-165637.js | 61 + .../v8/test/mjsunit/regress/regress-166379.js | 38 + .../v8/test/mjsunit/regress/regress-166553.js | 33 + deps/v8/test/mjsunit/regress/regress-1692.js | 2 +- .../v8/test/mjsunit/regress/regress-171641.js | 40 + deps/v8/test/mjsunit/regress/regress-1980.js | 2 +- deps/v8/test/mjsunit/regress/regress-2073.js | 99 + deps/v8/test/mjsunit/regress/regress-2185.js | 2 + deps/v8/test/mjsunit/regress/regress-2243.js | 31 + deps/v8/test/mjsunit/regress/regress-2263.js | 30 + deps/v8/test/mjsunit/regress/regress-2398.js | 41 + deps/v8/test/mjsunit/regress/regress-2410.js | 36 + deps/v8/test/mjsunit/regress/regress-2416.js | 75 + deps/v8/test/mjsunit/regress/regress-2419.js | 36 + deps/v8/test/mjsunit/regress/regress-2433.js | 36 + deps/v8/test/mjsunit/regress/regress-2437.js | 156 + deps/v8/test/mjsunit/regress/regress-2438.js | 51 + deps/v8/test/mjsunit/regress/regress-2441.js | 31 + deps/v8/test/mjsunit/regress/regress-2443.js | 129 + deps/v8/test/mjsunit/regress/regress-2444.js | 118 + deps/v8/test/mjsunit/regress/regress-2451.js | 40 + deps/v8/test/mjsunit/regress/regress-2470.js | 47 + deps/v8/test/mjsunit/regress/regress-2499.js | 40 + deps/v8/test/mjsunit/regress/regress-2537.js | 45 + deps/v8/test/mjsunit/regress/regress-2539.js | 55 + deps/v8/test/mjsunit/regress/regress-2565.js | 32 + deps/v8/test/mjsunit/regress/regress-2566.js | 34 + deps/v8/test/mjsunit/regress/regress-2568.js | 46 + deps/v8/test/mjsunit/regress/regress-2570.js | 31 + .../mjsunit/regress/regress-crbug-146910.js | 15 +- .../mjsunit/regress/regress-crbug-160010.js | 35 + .../mjsunit/regress/regress-crbug-162085.js | 71 + .../mjsunit/regress/regress-crbug-163530.js | 80 + .../mjsunit/regress/regress-crbug-168545.js | 34 + .../mjsunit/regress/regress-crbug-170856.js | 33 + .../mjsunit/regress/regress-crbug-172345.js | 34 + .../mjsunit/regress/regress-crbug-173907.js | 88 + .../mjsunit/regress/regress-crbug-173974.js | 36 + .../mjsunit/regress/regress-crbug-178790.js | 51 + .../mjsunit/regress/regress-crbug-181422.js | 32 + .../mjsunit/regress/regress-crbug-18639.js | 14 +- .../mjsunit/regress/regress-crbug-196583.js | 52 + .../regress/regress-delete-empty-double.js | 40 + .../regress/regress-json-stringify-gc.js | 40 + .../test/mjsunit/regress/regress-latin-1.js | 90 + .../regress-observe-empty-double-array.js | 38 + deps/v8/test/mjsunit/shift-for-integer-div.js | 58 + deps/v8/test/mjsunit/stack-traces-gc.js | 119 + deps/v8/test/mjsunit/stack-traces-overflow.js | 122 + deps/v8/test/mjsunit/stack-traces.js | 40 +- deps/v8/test/mjsunit/strict-mode.js | 47 +- deps/v8/test/mjsunit/string-natives.js | 71 + deps/v8/test/mjsunit/string-replace.js | 61 + deps/v8/test/mjsunit/string-split.js | 17 + deps/v8/test/mjsunit/testcfg.py | 5 +- .../test/mjsunit/tools/tickprocessor-test.log | 25 - deps/v8/test/mjsunit/tools/tickprocessor.js | 5 +- deps/v8/test/mjsunit/uri.js | 12 + deps/v8/test/mozilla/mozilla.status | 35 +- deps/v8/test/test262/README | 4 +- deps/v8/test/test262/test262.status | 15 +- deps/v8/test/test262/testcfg.py | 11 +- deps/v8/tools/disasm.py | 8 +- deps/v8/tools/gen-postmortem-metadata.py | 19 +- deps/v8/tools/grokdump.py | 601 ++- deps/v8/tools/gyp/v8.gyp | 82 +- deps/v8/tools/ll_prof.py | 63 +- deps/v8/tools/plot-timer-events | 70 + deps/v8/tools/plot-timer-events.js | 510 ++ deps/v8/tools/run-llprof.sh | 69 + deps/v8/tools/run-tests.py | 22 +- deps/v8/tools/run-valgrind.py | 2 +- deps/v8/tools/test.py | 6 +- deps/v8/tools/testrunner/local/execution.py | 6 +- deps/v8/tools/testrunner/local/testsuite.py | 3 + deps/v8/tools/testrunner/objects/context.py | 4 +- .../v8/tools/testrunner/server/compression.py | 1 - deps/v8/tools/tick-processor.html | 168 + deps/v8/tools/tickprocessor-driver.js | 4 +- deps/v8/tools/tickprocessor.js | 55 +- 543 files changed, 73770 insertions(+), 45812 deletions(-) create mode 100644 deps/v8/src/atomicops_internals_tsan.h create mode 100644 deps/v8/src/code-stubs-hydrogen.cc create mode 100644 deps/v8/src/heap-snapshot-generator-inl.h create mode 100644 deps/v8/src/heap-snapshot-generator.cc create mode 100644 deps/v8/src/heap-snapshot-generator.h create mode 100644 deps/v8/src/json-stringifier.h create mode 100644 deps/v8/src/jsregexp-inl.h delete mode 100644 deps/v8/src/liveobjectlist-inl.h delete mode 100644 deps/v8/src/liveobjectlist.cc delete mode 100644 deps/v8/src/liveobjectlist.h create mode 100644 deps/v8/src/marking-thread.cc rename deps/v8/src/{inspector.cc => marking-thread.h} (66%) create mode 100644 deps/v8/src/object-observe.js create mode 100644 deps/v8/src/sweeper-thread.cc create mode 100644 deps/v8/src/sweeper-thread.h create mode 100644 deps/v8/src/symbol.js create mode 100644 deps/v8/src/uri.h create mode 100644 deps/v8/test/cctest/test-declarative-accessors.cc create mode 100644 deps/v8/test/cctest/test-global-object.cc create mode 100644 deps/v8/test/cctest/test-object-observe.cc mode change 100755 => 100644 deps/v8/test/cctest/test-parsing.cc create mode 100644 deps/v8/test/cctest/test-platform.cc create mode 100644 deps/v8/test/cctest/test-symbols.cc create mode 100644 deps/v8/test/mjsunit/allocation-site-info.js create mode 100644 deps/v8/test/mjsunit/array-natives-elements.js create mode 100644 deps/v8/test/mjsunit/compiler/inline-closures.js create mode 100644 deps/v8/test/mjsunit/compiler/inline-function-apply.js create mode 100644 deps/v8/test/mjsunit/compiler/multiply-add.js create mode 100644 deps/v8/test/mjsunit/compiler/multiply-sub.js create mode 100644 deps/v8/test/mjsunit/compiler/parallel-proto-change.js create mode 100644 deps/v8/test/mjsunit/compiler/property-static.js create mode 100644 deps/v8/test/mjsunit/compiler/proto-chain-constant.js create mode 100644 deps/v8/test/mjsunit/compiler/proto-chain-load.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-177883.js create mode 100644 deps/v8/test/mjsunit/compiler/rotate.js create mode 100644 deps/v8/test/mjsunit/constant-folding-2.js create mode 100644 deps/v8/test/mjsunit/debug-liveedit-compile-error.js create mode 100644 deps/v8/test/mjsunit/debug-liveedit-literals.js create mode 100644 deps/v8/test/mjsunit/debug-set-variable-value.js create mode 100644 deps/v8/test/mjsunit/elements-length-no-holey.js create mode 100644 deps/v8/test/mjsunit/error-accessors.js create mode 100644 deps/v8/test/mjsunit/generated-transition-stub.js create mode 100644 deps/v8/test/mjsunit/harmony/object-observe.js create mode 100644 deps/v8/test/mjsunit/harmony/proxies-json.js create mode 100644 deps/v8/test/mjsunit/harmony/symbols.js create mode 100644 deps/v8/test/mjsunit/json-parser-recursive.js create mode 100644 deps/v8/test/mjsunit/json-stringify-recursive.js create mode 100644 deps/v8/test/mjsunit/json2.js create mode 100644 deps/v8/test/mjsunit/manual-parallel-recompile.js create mode 100644 deps/v8/test/mjsunit/math-exp-precision.js create mode 100644 deps/v8/test/mjsunit/math-floor-of-div-nosudiv.js create mode 100644 deps/v8/test/mjsunit/parallel-optimize-disabled.js rename deps/v8/{src/inspector.h => test/mjsunit/regress/regress-147497.js} (67%) create mode 100644 deps/v8/test/mjsunit/regress/regress-164442.js create mode 100644 deps/v8/test/mjsunit/regress/regress-165637.js create mode 100644 deps/v8/test/mjsunit/regress/regress-166379.js create mode 100644 deps/v8/test/mjsunit/regress/regress-166553.js create mode 100644 deps/v8/test/mjsunit/regress/regress-171641.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2073.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2243.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2263.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2398.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2410.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2416.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2419.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2433.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2437.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2438.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2441.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2443.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2444.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2451.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2470.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2499.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2537.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2539.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2565.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2566.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2568.js create mode 100644 deps/v8/test/mjsunit/regress/regress-2570.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-160010.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-162085.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-163530.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-168545.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-170856.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-172345.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-173907.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-173974.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-178790.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-181422.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-196583.js create mode 100644 deps/v8/test/mjsunit/regress/regress-delete-empty-double.js create mode 100644 deps/v8/test/mjsunit/regress/regress-json-stringify-gc.js create mode 100644 deps/v8/test/mjsunit/regress/regress-latin-1.js create mode 100644 deps/v8/test/mjsunit/regress/regress-observe-empty-double-array.js create mode 100644 deps/v8/test/mjsunit/shift-for-integer-div.js create mode 100644 deps/v8/test/mjsunit/stack-traces-gc.js create mode 100644 deps/v8/test/mjsunit/stack-traces-overflow.js create mode 100644 deps/v8/test/mjsunit/string-natives.js delete mode 100644 deps/v8/test/mjsunit/tools/tickprocessor-test.log create mode 100755 deps/v8/tools/plot-timer-events create mode 100644 deps/v8/tools/plot-timer-events.js create mode 100755 deps/v8/tools/run-llprof.sh create mode 100644 deps/v8/tools/tick-processor.html diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index 9c43bb525b..d25fc5af5c 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -34,6 +34,7 @@ Joel Stanley John Jozwiak Jonathan Liu Kun Zhang +Luis Reis Martyn Capewell Mathias Bynens Matt Hanselman @@ -45,6 +46,7 @@ Paolo Giarrusso Patrick Gansterer Peter Varga Rafal Krypa +Rajeev R Krithivasan Rene Rebe Robert Mustacchi Rodolph Perfetta @@ -54,6 +56,7 @@ Sanjoy Das Subrato K De Tobias Burnus Vlad Burlik +Xi Qian Yuqiang Xian Zaheer Ahmad Zhongping Wang diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index 7c435c8b62..11c80d7175 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,517 @@ +2013-03-19: Version 3.17.13 + + Turned Flags into a uint32_t typedef (Chromium issue 194749). + + Performance and stability improvements on all platforms. + + +2013-03-18: Version 3.17.12 + + Unified kMaxArguments with number of bits used to encode it. + (Chromium issue 211741) + + Fixed detection of |handle_smi| case in + HOptimizedGraphBuilder::HandlePolymorphicCallNamed. + (Chromium issue 196583) + + Performance and stability improvements on all platforms. + + +2013-03-15: Version 3.17.11 + + Added a version of the v8::HandleScope constructor with an v8::Isolate + parameter and made AdjustAmountOfExternalAllocatedMemory an instance + method of v8::Isolate. + (issue 2487) + + Fixed two register allocator bugs (off-by-one error/failure + propagation). (issue 2576) + + Fixed huge heap snapshot when a heavily shared context has many + variables. (Chromium issue 145687) + + Performance and stability improvements on all platforms. + + +2013-03-13: Version 3.17.10 + + Fixed heap snapshot creation for Harmony collections. (issue 2535) + + Fixed register allocation corner case. (Chromium issue 177883) + + Performance and stability improvements on all platforms. + + +2013-03-08: Version 3.17.9 + + Restored Function()'s expected string representation. (issue 2470) + + Enabled deprecatations (again). (issue 2487) + + Avoid bool to Oddball conversions by being lazy. (issue 2491) + + Added %p option to --logfile. + + Hardened Function()'s parsing of function literals. (issue 2470) + + ES6 symbols: Refine test for getOwnPropertyNames. (issue 2158) + + Performance and stability improvements on all platforms. + + +2013-03-07: Version 3.17.8 + + Added missing license headers. (Chromium issue 98597) + + Inserted missing type cast in JSON.stringify. (issue 2570) + + Reverted "Send SIGPROF signals on the profiler event processor thread" + (issue 2571) + + Fixed Array.length, String.length and Function.prototype LoadICs on x64. + (issue 2568) + + ES6 symbols: filter symbols form for-in loops and Object.keys. + (issue 2158) + + Properly handle misses for StoreArrayLengthStub on ia32 and x64 + (issue 2566) + + Fixed x32 handling of Atomic64. (Chromium issue chromium-os:36866) + + Removed "library" variable from standalone.gypi. (Chromium issue 111541) + + Fixed HCheckSmiOrInt <-> HBoundsCheck interaction wrt. representations. + (issue 2556) + + Enabled zapping of disposed global handles in release mode. + (Chromium issue 176056) + + Added workaround for redefinition of __proto__ property. (issue 2565) + + ES6 symbols: Allow symbols as property names. (issue 2158) + + Performance and stability improvements on all platforms. + + +2013-03-04: Version 3.17.7 + + Limited recursion in regexp compilation by a budget. + (Chromium issue 178790) + + ES6 symbols: Implemented Symbol intrinsic and basic functionality + (issue 2158) + + Performance and stability improvements on all platforms. + + +2013-02-28: Version 3.17.6 + + Fixed materialization of arguments objects with unknown values. + (Chromium issue 163530) + + Set default number of sweeper threads to at most four. + + Performance and stability improvements on all platforms. + + +2013-02-27: Version 3.17.5 + + Made __proto__ a foreign callback on Object.prototype. + (issue 621, issue 1949 and issue 2441) + + Performance and stability improvements on all platforms. + + +2013-02-25: Version 3.17.4 + + Performance and stability improvements on all platforms. + + +2013-02-21: Version 3.17.3 + + Performance and stability improvements on all platforms. + + +2013-02-19: Version 3.17.2 + + Removed bogus check for TOP register in deoptimizer. + (Chromium issue 176943) + + Made the Isolate parameter mandatory for internal HandleScopes. + (issue 2487) + + Fixed f.apply() optimization when declared arguments are mutated. + (issue 2539) + + Performance and stability improvements on all platforms. + + +2013-02-14: Version 3.17.1 + + Performance and stability improvements on all platforms. + + +2013-02-13: Version 3.17.0 + + Enabled parallel sweeping. + + Don't try to unlink instructions twice during GVN + (Chromium issue 175141) + + Fixed code flusher disabling while marking incrementally. + (Chromium issue 173458, 168582) + + Don't use TLS for space iterators. + (issue 2531) + + Added new GetHeapStatistics API entry and deprecated old one. + + Fixed DoubleStackSlot-to-DoubleStackSlot moves on ia32. Unified + platform-independent code. + (Chromium issue 173907) + + Added --trace-array-abuse to help find OOB accesses. + + Performance and stability improvements on all platforms. + + +2013-02-06: Version 3.16.14 + + Performance and stability improvements on all platforms. + + +2013-02-04: Version 3.16.13 + + Tagged stubs that rely on instance types as MEGAMORPHIC. + (Chromium issue 173974) + + Fixed clearing of dead dependent codes and verifing of weak + embedded maps on full GC. (Chromium issue 172488,172489) + + Made the arm port build cleanly with Clang. + + Performance and stability improvements on all platforms. + + +2013-01-31: Version 3.16.12 + + Performance and stability improvements on all platforms. + + +2013-01-30: Version 3.16.11 + + Put making embedded maps in optimized code weak behind a flag. + (Chromium issue 172488,172489) + + Performance and stability improvements on all platforms. + + +2013-01-25: Version 3.16.10 + + Avoid excessive memory usage during redundant phi elimination. + (issue 2510) + + Fixed additional spec violations wrt RegExp.lastIndex. + (issue 2437) + + Added Isolate parameter to Persistent class. + (issue 2487) + + Performance and stability improvements on all platforms. + + +2013-01-24: Version 3.16.9 + + Made embedded maps in optimized code weak. + (issue 2073) + + Fixed corner case when JSFunction is evicted from flusher. + (Chromium issue 168801) + + Correctly set kCanBeDivByZero flag for HMathFloorOfDiv. + (Chromium issue 171641) + + Performance and stability improvements on all platforms. + + +2013-01-23: Version 3.16.8 + + Correctly reset lastIndex in an RegExp object. + (Chromium issue 170856) + + Added a workaround for Windows compilation problems related to V8EXPORT. + (issue 2507) + + tools/run-tests.py: shlex.split() the value of --command-prefix + (Chromium issue 171553) + + Fixed pattern detection for replacing shifts by rotation. + (Chromium issue 2499) + + Performance and stability improvements on all platforms. + + +2013-01-21: Version 3.16.7 + + Removed <(library) usage from v8.gyp. + (Chromium issue 111541) + + Fixed out of bounds memory access in TestJSArrayForAllocationSiteInfo. + (Chromium issue 169928) + + Performance and stability improvements on all platforms. + + +2013-01-18: Version 3.16.6 + + Made the Isolate parameter mandatory in Locker and Unlocker classes. + (issue 2487) + + Avoid pointer underflow in CopyCharsUnsigned. + (issue 2493) + + Generate shim headers when using system v8. + (Chromium issue 165264) + + Fixed arguments materialization for inlined apply(). + (issue 2489) + + Sync'ed laziness between BuildFunctionInfo and MakeFunctionInfo. + (Chromium issue 147497) + + Added sanity check to CodeFlusher::AddCandidate. + (Chromium issue 169209) + + Performance and stability improvements on all platforms. + + +2013-01-15: Version 3.16.5 + + Removed deprecated functions from V8's external API. + + Prepared API for WebKit use of Latin-1. + + Fixed V8 issue 2486. + + Fixed Chromium issue 169723. + + Performance and stability improvements on all platforms. + + +2013-01-11: Version 3.16.4 + + Fixed Chromium issues 168545 and 169209. + + Performance and stability improvements on all platforms. + + +2013-01-09: Version 3.16.3 + + Improved GC performance when moving parts of a FixedArray (issue 2452). + + Enabled readline on d8 while building a shared lib (issue 1781). + + Fixed missing exception check in typed array constructor + (Chromium issue 168545). + + Check for read-only-ness when preparing for array sort (issue 2419). + + Performance and stability improvements on all platforms. + + +2013-01-04: Version 3.16.2 + + Added Makefile options to build for the Raspberry Pi (armv7=0, + arm_fpu=vfp2). + + Performance and stability improvements on all platforms. + + +2012-12-27: Version 3.16.1 + + Fixed x64 MathMinMax for negative untagged int32 arguments. + (Chromium issue 164442) + + Fixed FloatingPointHelper::CheckSSE2OperandIsInt32. + (issue 2458) + + Performance and stability improvements on all platforms. + + +2012-12-21: Version 3.16.0 + + V8_Fatal now prints C++ stack trace in debug mode. + + Added HTML-based tick processor. + + Continued implementation of Object.observe (V8 issue 2409). + + Fixed V8 issues 2243, 2340, 2393, 2399, 2457. + + Fixed Chromium issues 125308, 165637, 166379, 166553. + + Performance and stability improvements on all platforms. + + +2012-12-10: Version 3.15.11 + + Define CAN_USE_VFP2/3_INSTRUCTIONS based on arm_neon and arm_fpu GYP + flags. + + Performance and stability improvements on all platforms. + + +2012-12-07: Version 3.15.10 + + Enabled optimisation of functions inside eval. (issue 2315) + + Fixed spec violations in methods of Number.prototype. (issue 2443) + + Added GCTracer metrics for a scavenger GC for DOM wrappers. + + Performance and stability improvements on all platforms. + + +2012-12-06: Version 3.15.9 + + Fixed candidate eviction in code flusher. + (Chromium issue 159140) + + Iterate through all arguments for side effects in Math.min/max. + (issue 2444) + + Fixed spec violations related to regexp.lastIndex + (issue 2437, issue 2438) + + Performance and stability improvements on all platforms. + + +2012-12-04: Version 3.15.8 + + Enforced stack allocation of TryCatch blocks. + (issue 2166,chromium:152389) + + Fixed external exceptions in external try-catch handlers. + (issue 2166) + + Activated incremental code flushing by default. + + Performance and stability improvements on all platforms. + + +2012-11-30: Version 3.15.7 + + Activated code aging by default. + + Included more information in --prof log. + + Removed eager sweeping for lazy swept spaces. Try to find in + SlowAllocateRaw a bounded number of times a big enough memory slot. + (issue 2194) + + Performance and stability improvements on all platforms. + + +2012-11-26: Version 3.15.6 + + Ensure double arrays are filled with holes when extended from + variations of empty arrays. (Chromium issue 162085) + + Performance and stability improvements on all platforms. + + +2012-11-23: Version 3.15.5 + + Fixed JSON.stringify for objects with interceptor handlers. + (Chromium issue 161028) + + Fixed corner case in x64 compare stubs. (issue 2416) + + Performance and stability improvements on all platforms. + + +2012-11-16: Version 3.15.4 + + Fixed Array.prototype.join evaluation order. (issue 2263) + + Perform CPU sampling by CPU sampling thread only iff processing thread + is not running. (issue 2364) + + When using an Object as a set in Object.getOwnPropertyNames, null out + the proto. (issue 2410) + + Disabled EXTRA_CHECKS in Release build. + + Heap explorer: Show representation of strings. + + Removed 'type' and 'arguments' properties from Error object. + (issue 2397) + + Added atomics implementation for ThreadSanitizer v2. + (Chromium issue 128314) + + Fixed LiveEdit crashes when object/array literal is added. (issue 2368) + + Performance and stability improvements on all platforms. + + +2012-11-13: Version 3.15.3 + + Changed sample shell to send non-JS output (e.g. errors) to stderr + instead of stdout. + + Correctly check for stack overflow even when interrupt is pending. + (issue 214) + + Collect stack trace on stack overflow. (issue 2394) + + Performance and stability improvements on all platforms. + + +2012-11-12: Version 3.15.2 + + Function::GetScriptOrigin supplies sourceURL when script name is + not available. (Chromium issue 159413) + + Made formatting error message side-effect-free. (issue 2398) + + Fixed length check in JSON.stringify. (Chromium issue 160010) + + ES6: Added support for Set and Map clear method (issue 2400) + + Fixed slack tracking when instance prototype changes. + (Chromium issue 157019) + + Fixed disabling of code flusher while marking. (Chromium issue 159140) + + Added a test case for object grouping in a scavenger GC (issue 2077) + + Support shared library build of Android for v8. + (Chromium issue 158821) + + ES6: Added support for size to Set and Map (issue 2395) + + Performance and stability improvements on all platforms. + + +2012-11-06: Version 3.15.1 + + Put incremental code flushing behind a flag. (Chromium issue 159140) + + Performance and stability improvements on all platforms. + + +2012-10-31: Version 3.15.0 + + Loosened aligned code target requirement on ARM (issue 2380) + + Fixed JSON.parse to treat leading zeros correctly. + (Chromium issue 158185) + + Performance and stability improvements on all platforms. + + 2012-10-22: Version 3.14.5 Killed off the SCons based build. diff --git a/deps/v8/Makefile b/deps/v8/Makefile index b65ea4c9f9..8e550d0126 100644 --- a/deps/v8/Makefile +++ b/deps/v8/Makefile @@ -62,6 +62,12 @@ endif ifeq ($(verifyheap), on) GYPFLAGS += -Dv8_enable_verify_heap=1 endif +# backtrace=off +ifeq ($(backtrace), off) + GYPFLAGS += -Dv8_enable_backtrace=0 +else + GYPFLAGS += -Dv8_enable_backtrace=1 +endif # snapshot=off ifeq ($(snapshot), off) GYPFLAGS += -Dv8_use_snapshot='false' @@ -77,15 +83,17 @@ endif ifeq ($(gdbjit), on) GYPFLAGS += -Dv8_enable_gdbjit=1 endif -# liveobjectlist=on -ifeq ($(liveobjectlist), on) - GYPFLAGS += -Dv8_use_liveobjectlist=true +# vfp2=off +ifeq ($(vfp2), off) + GYPFLAGS += -Dv8_can_use_vfp2_instructions=false +else + GYPFLAGS += -Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2 endif # vfp3=off ifeq ($(vfp3), off) GYPFLAGS += -Dv8_can_use_vfp3_instructions=false else - GYPFLAGS += -Dv8_can_use_vfp3_instructions=true + GYPFLAGS += -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3 endif # debuggersupport=off ifeq ($(debuggersupport), off) @@ -115,6 +123,10 @@ endif ifeq ($(hardfp), on) GYPFLAGS += -Dv8_use_arm_eabi_hardfloat=true endif +# armv7=false +ifeq ($(armv7), false) + GYPFLAGS += -Darmv7=0 +endif # ----------------- available targets: -------------------- # - "dependencies": pulls in external dependencies (currently: GYP) @@ -136,7 +148,7 @@ endif ARCHES = ia32 x64 arm mipsel DEFAULT_ARCHES = ia32 x64 arm MODES = release debug -ANDROID_ARCHES = android_ia32 android_arm +ANDROID_ARCHES = android_ia32 android_arm android_mipsel # List of files that trigger Makefile regeneration: GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \ diff --git a/deps/v8/Makefile.android b/deps/v8/Makefile.android index 8e4ce0814a..aeff01c665 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_ARCHES = android_ia32 android_arm android_mipsel MODES = release debug # Generates all combinations of ANDROID ARCHES and MODES, @@ -50,11 +50,17 @@ ifeq ($(ARCH), android_arm) DEFINES += arm_neon=0 armv7=1 TOOLCHAIN_ARCH = arm-linux-androideabi-4.6 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 android_target_arch=mips + DEFINES += mips_arch_variant=mips32r2 + TOOLCHAIN_ARCH = mipsel-linux-android-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-4.6 + else + $(error Target architecture "${ARCH}" is not supported) + endif endif endif diff --git a/deps/v8/SConstruct b/deps/v8/SConstruct index 5f8616a6b8..21d1902733 100644 --- a/deps/v8/SConstruct +++ b/deps/v8/SConstruct @@ -67,16 +67,9 @@ LIBRARY_FLAGS = { 'debuggersupport:on': { 'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT'], }, - 'inspector:on': { - 'CPPDEFINES': ['INSPECTOR'], - }, 'fasttls:off': { 'CPPDEFINES': ['V8_NO_FAST_TLS'], }, - 'liveobjectlist:on': { - 'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT', 'INSPECTOR', - 'LIVE_OBJECT_LIST', 'OBJECT_PRINT'], - } }, 'gcc': { 'all': { @@ -1051,16 +1044,6 @@ SIMPLE_OPTIONS = { 'default': 'on', 'help': 'enable debugging of JavaScript code' }, - 'inspector': { - 'values': ['on', 'off'], - 'default': 'off', - 'help': 'enable inspector features' - }, - 'liveobjectlist': { - 'values': ['on', 'off'], - 'default': 'off', - 'help': 'enable live object list features in the debugger' - }, 'soname': { 'values': ['on', 'off'], 'default': 'off', @@ -1418,13 +1401,6 @@ def PostprocessOptions(options, os): options['msvcltcg'] = 'on' if (options['mipsabi'] != 'none') and (options['arch'] != 'mips') and (options['simulator'] != 'mips'): options['mipsabi'] = 'none' - if options['liveobjectlist'] == 'on': - if (options['debuggersupport'] != 'on') or (options['mode'] == 'release'): - # Print a warning that liveobjectlist will implicitly enable the debugger - print "Warning: forcing debuggersupport on for liveobjectlist" - options['debuggersupport'] = 'on' - options['inspector'] = 'on' - options['objectprint'] = 'on' def ParseEnvOverrides(arg, imports): diff --git a/deps/v8/build/android.gypi b/deps/v8/build/android.gypi index d2d1a35726..8400ab113a 100644 --- a/deps/v8/build/android.gypi +++ b/deps/v8/build/android.gypi @@ -35,9 +35,9 @@ 'variables': { 'android_ndk_root%': '&1 | grep -q "^Target: mips" && echo "yes" || echo "no")', + 'mipscompiler': '&1 | grep -q "^Target: mips" && echo "yes" || echo "no")', }, 'conditions': [ ['mipscompiler=="yes"', { @@ -200,10 +217,11 @@ ['mips_arch_variant=="mips32r2"', { 'cflags': ['-mips32r2', '-Wa,-mips32r2'], }], + ['mips_arch_variant=="mips32r1"', { + 'cflags': ['-mips32', '-Wa,-mips32'], + }], ['mips_arch_variant=="loongson"', { 'cflags': ['-mips3', '-Wa,-mips3'], - }, { - 'cflags': ['-mips32', '-Wa,-mips32'], }], ], }], @@ -246,14 +264,6 @@ }, 'msvs_configuration_platform': 'x64', }], # v8_target_arch=="x64" - ['v8_use_liveobjectlist=="true"', { - 'defines': [ - 'ENABLE_DEBUGGER_SUPPORT', - 'INSPECTOR', - 'OBJECT_PRINT', - 'LIVEOBJECTLIST', - ], - }], ['v8_compress_startup_data=="bz2"', { 'defines': [ 'COMPRESS_STARTUP_DATA_BZ2', @@ -306,7 +316,7 @@ }], ['_toolset=="target"', { 'variables': { - 'm32flag': ' /dev/null 2>&1) && echo "-m32" || true)', + 'm32flag': ' /dev/null 2>&1) && echo "-m32" || true)', 'clang%': 0, }, 'conditions': [ @@ -330,6 +340,9 @@ ], # conditions 'configurations': { 'Debug': { + 'variables': { + 'v8_enable_extra_checks%': 1, + }, 'defines': [ 'DEBUG', 'ENABLE_DISASSEMBLER', @@ -354,10 +367,17 @@ }, }, 'conditions': [ + ['v8_enable_extra_checks==1', { + 'defines': ['ENABLE_EXTRA_CHECKS',], + }], ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', { 'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter', '-Wnon-virtual-dtor', '-Woverloaded-virtual' ], }], + ['OS=="linux" and v8_enable_backtrace==1', { + # Support for backtrace_symbols. + 'ldflags': [ '-rdynamic' ], + }], ['OS=="android"', { 'variables': { 'android_full_debug%': 1, @@ -372,12 +392,32 @@ }], ], }], + ['OS=="mac"', { + 'xcode_settings': { + 'GCC_OPTIMIZATION_LEVEL': '0', # -O0 + }, + }], ], }, # Debug 'Release': { + 'variables': { + 'v8_enable_extra_checks%': 0, + }, 'conditions': [ + ['v8_enable_extra_checks==1', { + 'defines': ['ENABLE_EXTRA_CHECKS',], + }], ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \ or OS=="android"', { + 'cflags!': [ + '-O2', + '-Os', + ], + 'cflags': [ + '-fdata-sections', + '-ffunction-sections', + '-O3', + ], 'conditions': [ [ 'gcc_version==44 and clang==0', { 'cflags': [ diff --git a/deps/v8/build/gyp_v8 b/deps/v8/build/gyp_v8 index 345f777d79..bf81ad34dc 100755 --- a/deps/v8/build/gyp_v8 +++ b/deps/v8/build/gyp_v8 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # # Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without diff --git a/deps/v8/build/standalone.gypi b/deps/v8/build/standalone.gypi index 7145a16e0c..749755c7ce 100644 --- a/deps/v8/build/standalone.gypi +++ b/deps/v8/build/standalone.gypi @@ -29,9 +29,9 @@ { 'variables': { - 'library%': 'static_library', 'component%': 'static_library', 'visibility%': 'hidden', + 'v8_enable_backtrace%': 0, 'msvs_multi_core_compile%': '1', 'mac_deployment_target%': '10.5', 'variables': { @@ -86,6 +86,9 @@ 'Debug': { 'cflags': [ '-g', '-O0' ], }, + 'Release': { + # Xcode insists on this empty entry. + }, }, }, 'conditions': [ @@ -100,7 +103,7 @@ [ 'OS=="linux"', { 'cflags': [ '-ansi' ], }], - [ 'visibility=="hidden"', { + [ 'visibility=="hidden" and v8_enable_backtrace==0', { 'cflags': [ '-fvisibility=hidden' ], }], [ 'component=="shared_library"', { @@ -191,7 +194,7 @@ 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror - 'GCC_VERSION': '4.2', + 'GCC_VERSION': 'com.apple.compilers.llvmgcc42', 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)', diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index c1e9a9e0b8..41fe8a1999 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -105,6 +105,9 @@ class V8EXPORT CpuProfileNode { /** Returns function entry UID. */ unsigned GetCallUid() const; + /** Returns id of the node. The id is unique within the tree */ + unsigned GetNodeId() const; + /** Returns child nodes count of the node. */ int GetChildrenCount() const; @@ -116,9 +119,8 @@ class V8EXPORT CpuProfileNode { /** - * CpuProfile contains a CPU profile in a form of two call trees: - * - top-down (from main() down to functions that do all the work); - * - bottom-up call graph (in backward direction). + * CpuProfile contains a CPU profile in a form of top-down call tree + * (from main() down to functions that do all the work). */ class V8EXPORT CpuProfile { public: @@ -128,12 +130,21 @@ class V8EXPORT CpuProfile { /** Returns CPU profile title. */ Handle GetTitle() const; - /** Returns the root node of the bottom up call tree. */ - const CpuProfileNode* GetBottomUpRoot() const; - /** Returns the root node of the top down call tree. */ const CpuProfileNode* GetTopDownRoot() const; + /** + * Returns number of samples recorded. The samples are not recorded unless + * |record_samples| parameter of CpuProfiler::StartProfiling is true. + */ + int GetSamplesCount() const; + + /** + * Returns profile node corresponding to the top frame the sample at + * the given index. + */ + const CpuProfileNode* GetSample(int index) const; + /** * Deletes the profile and removes it from CpuProfiler's list. * All pointers to nodes previously returned become invalid. @@ -183,8 +194,11 @@ class V8EXPORT CpuProfiler { * title are silently ignored. While collecting a profile, functions * from all security contexts are included in it. The token-based * filtering is only performed when querying for a profile. + * + * |record_samples| parameter controls whether individual samples should + * be recorded in addition to the aggregated tree. */ - static void StartProfiling(Handle title); + static void StartProfiling(Handle title, bool record_samples = false); /** * Stops collecting CPU profile with a given title and returns it. @@ -406,6 +420,20 @@ class V8EXPORT HeapProfiler { */ static const SnapshotObjectId kUnknownObjectId = 0; + /** + * Callback interface for retrieving user friendly names of global objects. + */ + class ObjectNameResolver { + public: + /** + * Returns name to be used in the heap snapshot for given node. Returned + * string must stay alive until snapshot collection is completed. + */ + virtual const char* GetName(Handle object) = 0; + protected: + virtual ~ObjectNameResolver() {} + }; + /** * Takes a heap snapshot and returns it. Title may be an empty string. * See HeapSnapshot::Type for types description. @@ -413,7 +441,8 @@ class V8EXPORT HeapProfiler { static const HeapSnapshot* TakeSnapshot( Handle title, HeapSnapshot::Type type = HeapSnapshot::kFull, - ActivityControl* control = NULL); + ActivityControl* control = NULL, + ObjectNameResolver* global_object_name_resolver = NULL); /** * Starts tracking of heap objects population statistics. After calling diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 470661e10d..329576fa94 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -76,50 +76,68 @@ #endif // _WIN32 +#if defined(__GNUC__) && !defined(DEBUG) +#define V8_INLINE(declarator) inline __attribute__((always_inline)) declarator +#elif defined(_MSC_VER) && !defined(DEBUG) +#define V8_INLINE(declarator) __forceinline declarator +#else +#define V8_INLINE(declarator) inline declarator +#endif + +#if defined(__GNUC__) && !V8_DISABLE_DEPRECATIONS +#define V8_DEPRECATED(declarator) declarator __attribute__ ((deprecated)) +#elif defined(_MSC_VER) && !V8_DISABLE_DEPRECATIONS +#define V8_DEPRECATED(declarator) __declspec(deprecated) declarator +#else +#define V8_DEPRECATED(declarator) declarator +#endif + /** * The v8 JavaScript engine. */ namespace v8 { -class Context; -class String; -class StringObject; -class Value; -class Utils; -class Number; -class NumberObject; -class Object; +class AccessorInfo; +class AccessorSignature; class Array; -class Int32; -class Uint32; -class External; -class Primitive; class Boolean; class BooleanObject; -class Integer; -class Function; +class Context; +class Data; class Date; +class DeclaredAccessorDescriptor; +class External; +class Function; +class FunctionTemplate; class ImplementationUtilities; +class Int32; +class Integer; +class Isolate; +class Number; +class NumberObject; +class Object; +class ObjectOperationDescriptor; +class ObjectTemplate; +class Primitive; +class RawOperationDescriptor; class Signature; -class AccessorSignature; +class StackFrame; +class StackTrace; +class String; +class StringObject; +class Uint32; +class Utils; +class Value; template class Handle; template class Local; template class Persistent; -class FunctionTemplate; -class ObjectTemplate; -class Data; -class AccessorInfo; -class StackTrace; -class StackFrame; -class Isolate; namespace internal { - class Arguments; -class Object; class Heap; class HeapObject; class Isolate; +class Object; } @@ -138,6 +156,10 @@ class Isolate; typedef void (*WeakReferenceCallback)(Persistent object, void* parameter); +// TODO(svenpanne) Temporary definition until Chrome is in sync. +typedef void (*NearDeathCallback)(Isolate* isolate, + Persistent object, + void* parameter); // --- Handles --- @@ -176,12 +198,12 @@ template class Handle { /** * Creates an empty handle. */ - inline Handle() : val_(0) {} + V8_INLINE(Handle()) : val_(0) {} /** * Creates a new handle for the specified value. */ - inline explicit Handle(T* val) : val_(val) {} + V8_INLINE(explicit Handle(T* val)) : val_(val) {} /** * Creates a handle for the contents of the specified handle. This @@ -193,7 +215,7 @@ template class Handle { * Handle to a variable declared as Handle, is legal * because String is a subclass of Value. */ - template inline Handle(Handle that) + template V8_INLINE(Handle(Handle that)) : val_(reinterpret_cast(*that)) { /** * This check fails when trying to convert between incompatible @@ -206,16 +228,16 @@ template class Handle { /** * Returns true if the handle is empty. */ - inline bool IsEmpty() const { return val_ == 0; } + V8_INLINE(bool IsEmpty() const) { return val_ == 0; } /** * Sets the handle to be empty. IsEmpty() will then return true. */ - inline void Clear() { val_ = 0; } + V8_INLINE(void Clear()) { val_ = 0; } - inline T* operator->() const { return val_; } + V8_INLINE(T* operator->() const) { return val_; } - inline T* operator*() const { return val_; } + V8_INLINE(T* operator*() const) { return val_; } /** * Checks whether two handles are the same. @@ -223,7 +245,7 @@ template class Handle { * to which they refer are identical. * The handles' references are not checked. */ - template inline bool operator==(Handle that) const { + template V8_INLINE(bool operator==(Handle that) const) { internal::Object** a = reinterpret_cast(**this); internal::Object** b = reinterpret_cast(*that); if (a == 0) return b == 0; @@ -237,11 +259,11 @@ template class Handle { * the objects to which they refer are different. * The handles' references are not checked. */ - template inline bool operator!=(Handle that) const { + template V8_INLINE(bool operator!=(Handle that) const) { return !operator==(that); } - template static inline Handle Cast(Handle that) { + template V8_INLINE(static Handle Cast(Handle that)) { #ifdef V8_ENABLE_CHECKS // If we're going to perform the type check then we have to check // that the handle isn't empty before doing the checked cast. @@ -250,7 +272,7 @@ template class Handle { return Handle(T::Cast(*that)); } - template inline Handle As() { + template V8_INLINE(Handle As()) { return Handle::Cast(*this); } @@ -268,8 +290,8 @@ template class Handle { */ template class Local : public Handle { public: - inline Local(); - template inline Local(Local that) + V8_INLINE(Local()); + template V8_INLINE(Local(Local that)) : Handle(reinterpret_cast(*that)) { /** * This check fails when trying to convert between incompatible @@ -278,8 +300,8 @@ template class Local : public Handle { */ TYPE_CHECK(T, S); } - template inline Local(S* that) : Handle(that) { } - template static inline Local Cast(Local that) { + template V8_INLINE(Local(S* that) : Handle(that)) { } + template V8_INLINE(static Local Cast(Local that)) { #ifdef V8_ENABLE_CHECKS // If we're going to perform the type check then we have to check // that the handle isn't empty before doing the checked cast. @@ -288,15 +310,17 @@ template class Local : public Handle { return Local(T::Cast(*that)); } - template inline Local As() { + template V8_INLINE(Local As()) { return Local::Cast(*this); } - /** Create a local handle for the content of another handle. - * The referee is kept alive by the local handle even when - * the original handle is destroyed/disposed. + /** + * Create a local handle for the content of another handle. + * The referee is kept alive by the local handle even when + * the original handle is destroyed/disposed. */ - inline static Local New(Handle that); + V8_INLINE(static Local New(Handle that)); + V8_INLINE(static Local New(Isolate* isolate, Handle that)); }; @@ -323,7 +347,7 @@ template class Persistent : public Handle { * Creates an empty persistent handle that doesn't point to any * storage cell. */ - inline Persistent(); + V8_INLINE(Persistent()); /** * Creates a persistent handle for the same storage cell as the @@ -336,7 +360,7 @@ template class Persistent : public Handle { * Persistent to a variable declared as Persistent, * is allowed as String is a subclass of Value. */ - template inline Persistent(Persistent that) + template V8_INLINE(Persistent(Persistent that)) : Handle(reinterpret_cast(*that)) { /** * This check fails when trying to convert between incompatible @@ -346,16 +370,16 @@ template class Persistent : public Handle { TYPE_CHECK(T, S); } - template inline Persistent(S* that) : Handle(that) { } + template V8_INLINE(Persistent(S* that)) : Handle(that) { } /** * "Casts" a plain handle which is known to be a persistent handle * to a persistent handle. */ - template explicit inline Persistent(Handle that) + template explicit V8_INLINE(Persistent(Handle that)) : Handle(*that) { } - template static inline Persistent Cast(Persistent that) { + template V8_INLINE(static Persistent Cast(Persistent that)) { #ifdef V8_ENABLE_CHECKS // If we're going to perform the type check then we have to check // that the handle isn't empty before doing the checked cast. @@ -364,15 +388,20 @@ template class Persistent : public Handle { return Persistent(T::Cast(*that)); } - template inline Persistent As() { + template V8_INLINE(Persistent As()) { return Persistent::Cast(*this); } + /** Deprecated. Use Isolate version instead. */ + V8_DEPRECATED(static Persistent New(Handle that)); + /** - * Creates a new persistent handle for an existing local or - * persistent handle. + * Creates a new persistent handle for an existing local or persistent handle. */ - inline static Persistent New(Handle that); + V8_INLINE(static Persistent New(Isolate* isolate, Handle that)); + + /** Deprecated. Use Isolate version instead. */ + V8_DEPRECATED(void Dispose()); /** * Releases the storage cell referenced by this persistent handle. @@ -380,48 +409,87 @@ template class Persistent : public Handle { * This handle's reference, and any other references to the storage * cell remain and IsEmpty will still return false. */ - inline void Dispose(); + V8_INLINE(void Dispose(Isolate* isolate)); + + /** Deprecated. Use Isolate version instead. */ + V8_DEPRECATED(void MakeWeak(void* parameters, + WeakReferenceCallback callback)); /** * Make the reference to this object weak. When only weak handles * refer to the object, the garbage collector will perform a - * callback to the given V8::WeakReferenceCallback function, passing + * callback to the given V8::NearDeathCallback function, passing * it the object reference and the given parameters. */ - inline void MakeWeak(void* parameters, WeakReferenceCallback callback); + V8_INLINE(void MakeWeak(Isolate* isolate, + void* parameters, + NearDeathCallback callback)); + + /** Deprecated. Use Isolate version instead. */ + V8_DEPRECATED(void ClearWeak()); /** Clears the weak reference to this object. */ - inline void ClearWeak(); + V8_INLINE(void ClearWeak(Isolate* isolate)); + + /** Deprecated. Use Isolate version instead. */ + V8_DEPRECATED(void MarkIndependent()); + + /** + * Marks the reference to this object independent. Garbage collector is free + * to ignore any object groups containing this object. Weak callback for an + * independent handle should not assume that it will be preceded by a global + * GC prologue callback or followed by a global GC epilogue callback. + */ + V8_INLINE(void MarkIndependent(Isolate* isolate)); + + /** Deprecated. Use Isolate version instead. */ + V8_DEPRECATED(void MarkPartiallyDependent()); /** - * Marks the reference to this object independent. Garbage collector - * is free to ignore any object groups containing this object. - * Weak callback for an independent handle should not - * assume that it will be preceded by a global GC prologue callback - * or followed by a global GC epilogue callback. + * Marks the reference to this object partially dependent. Partially dependent + * handles only depend on other partially dependent handles and these + * dependencies are provided through object groups. It provides a way to build + * smaller object groups for young objects that represent only a subset of all + * external dependencies. This mark is automatically cleared after each + * garbage collection. */ - inline void MarkIndependent(); + V8_INLINE(void MarkPartiallyDependent(Isolate* isolate)); + + /** Deprecated. Use Isolate version instead. */ + V8_DEPRECATED(bool IsIndependent() const); /** Returns true if this handle was previously marked as independent. */ - inline bool IsIndependent() const; + V8_INLINE(bool IsIndependent(Isolate* isolate) const); + + /** Deprecated. Use Isolate version instead. */ + V8_DEPRECATED(bool IsNearDeath() const); /** Checks if the handle holds the only reference to an object. */ - inline bool IsNearDeath() const; + V8_INLINE(bool IsNearDeath(Isolate* isolate) const); + + /** Deprecated. Use Isolate version instead. */ + V8_DEPRECATED(bool IsWeak() const); /** Returns true if the handle's reference is weak. */ - inline bool IsWeak() const; + V8_INLINE(bool IsWeak(Isolate* isolate) const); + + /** Deprecated. Use Isolate version instead. */ + V8_DEPRECATED(void SetWrapperClassId(uint16_t class_id)); /** - * Assigns a wrapper class ID to the handle. See RetainedObjectInfo - * interface description in v8-profiler.h for details. + * Assigns a wrapper class ID to the handle. See RetainedObjectInfo interface + * description in v8-profiler.h for details. */ - inline void SetWrapperClassId(uint16_t class_id); + V8_INLINE(void SetWrapperClassId(Isolate* isolate, uint16_t class_id)); + + /** Deprecated. Use Isolate version instead. */ + V8_DEPRECATED(uint16_t WrapperClassId() const); /** - * Returns the class ID previously assigned to this handle or 0 if no class - * ID was previously assigned. + * Returns the class ID previously assigned to this handle or 0 if no class ID + * was previously assigned. */ - inline uint16_t WrapperClassId() const; + V8_INLINE(uint16_t WrapperClassId(Isolate* isolate) const); private: friend class ImplementationUtilities; @@ -445,8 +513,11 @@ template class Persistent : public Handle { */ class V8EXPORT HandleScope { public: + // TODO(svenpanne) Deprecate me when Chrome is fixed! HandleScope(); + HandleScope(Isolate* isolate); + ~HandleScope(); /** @@ -464,12 +535,14 @@ class V8EXPORT HandleScope { * Creates a new handle with the given value. */ static internal::Object** CreateHandle(internal::Object* value); + static internal::Object** CreateHandle(internal::Isolate* isolate, + internal::Object* value); // Faster version, uses HeapObject to obtain the current Isolate. static internal::Object** CreateHandle(internal::HeapObject* value); private: - // Make it impossible to create heap-allocated or illegal handle - // scopes by disallowing certain operations. + // Make it hard to create heap-allocated or illegal handle scopes by + // disallowing certain operations. HandleScope(const HandleScope&); void operator=(const HandleScope&); void* operator new(size_t size); @@ -482,12 +555,13 @@ class V8EXPORT HandleScope { internal::Object** next; internal::Object** limit; int level; - inline void Initialize() { + V8_INLINE(void Initialize()) { next = limit = NULL; level = 0; } }; + void Initialize(Isolate* isolate); void Leave(); internal::Isolate* isolate_; @@ -575,16 +649,16 @@ class V8EXPORT ScriptData { // NOLINT */ class ScriptOrigin { public: - inline ScriptOrigin( + V8_INLINE(ScriptOrigin( Handle resource_name, Handle resource_line_offset = Handle(), - Handle resource_column_offset = Handle()) + Handle resource_column_offset = Handle())) : resource_name_(resource_name), resource_line_offset_(resource_line_offset), resource_column_offset_(resource_column_offset) { } - inline Handle ResourceName() const; - inline Handle ResourceLineOffset() const; - inline Handle ResourceColumnOffset() const; + V8_INLINE(Handle ResourceName() const); + V8_INLINE(Handle ResourceLineOffset() const); + V8_INLINE(Handle ResourceColumnOffset() const); private: Handle resource_name_; Handle resource_line_offset_; @@ -866,178 +940,179 @@ class V8EXPORT StackFrame { /** * The superclass of all JavaScript values and objects. */ -class Value : public Data { +class V8EXPORT Value : public Data { public: /** * Returns true if this value is the undefined value. See ECMA-262 * 4.3.10. */ - inline bool IsUndefined() const; + V8_INLINE(bool IsUndefined() const); /** * Returns true if this value is the null value. See ECMA-262 * 4.3.11. */ - inline bool IsNull() const; + V8_INLINE(bool IsNull() const); /** * Returns true if this value is true. */ - V8EXPORT bool IsTrue() const; + bool IsTrue() const; /** * Returns true if this value is false. */ - V8EXPORT bool IsFalse() const; + bool IsFalse() const; /** * Returns true if this value is an instance of the String type. * See ECMA-262 8.4. */ - inline bool IsString() const; + V8_INLINE(bool IsString() const); /** * Returns true if this value is a function. */ - V8EXPORT bool IsFunction() const; + bool IsFunction() const; /** * Returns true if this value is an array. */ - V8EXPORT bool IsArray() const; + bool IsArray() const; /** * Returns true if this value is an object. */ - V8EXPORT bool IsObject() const; + bool IsObject() const; /** * Returns true if this value is boolean. */ - V8EXPORT bool IsBoolean() const; + bool IsBoolean() const; /** * Returns true if this value is a number. */ - V8EXPORT bool IsNumber() const; + bool IsNumber() const; /** * Returns true if this value is external. */ - V8EXPORT bool IsExternal() const; + bool IsExternal() const; /** * Returns true if this value is a 32-bit signed integer. */ - V8EXPORT bool IsInt32() const; + bool IsInt32() const; /** * Returns true if this value is a 32-bit unsigned integer. */ - V8EXPORT bool IsUint32() const; + bool IsUint32() const; /** * Returns true if this value is a Date. */ - V8EXPORT bool IsDate() const; + bool IsDate() const; /** * Returns true if this value is a Boolean object. */ - V8EXPORT bool IsBooleanObject() const; + bool IsBooleanObject() const; /** * Returns true if this value is a Number object. */ - V8EXPORT bool IsNumberObject() const; + bool IsNumberObject() const; /** * Returns true if this value is a String object. */ - V8EXPORT bool IsStringObject() const; + bool IsStringObject() const; /** * Returns true if this value is a NativeError. */ - V8EXPORT bool IsNativeError() const; + bool IsNativeError() const; /** * Returns true if this value is a RegExp. */ - V8EXPORT bool IsRegExp() const; + bool IsRegExp() const; - V8EXPORT Local ToBoolean() const; - V8EXPORT Local ToNumber() const; - V8EXPORT Local ToString() const; - V8EXPORT Local ToDetailString() const; - V8EXPORT Local ToObject() const; - V8EXPORT Local ToInteger() const; - V8EXPORT Local ToUint32() const; - V8EXPORT Local ToInt32() const; + Local ToBoolean() const; + Local ToNumber() const; + Local ToString() const; + Local ToDetailString() const; + Local ToObject() const; + Local ToInteger() const; + Local ToUint32() const; + Local ToInt32() const; /** * Attempts to convert a string to an array index. * Returns an empty handle if the conversion fails. */ - V8EXPORT Local ToArrayIndex() const; + Local ToArrayIndex() const; - V8EXPORT bool BooleanValue() const; - V8EXPORT double NumberValue() const; - V8EXPORT int64_t IntegerValue() const; - V8EXPORT uint32_t Uint32Value() const; - V8EXPORT int32_t Int32Value() const; + bool BooleanValue() const; + double NumberValue() const; + int64_t IntegerValue() const; + uint32_t Uint32Value() const; + int32_t Int32Value() const; /** JS == */ - V8EXPORT bool Equals(Handle that) const; - V8EXPORT bool StrictEquals(Handle that) const; + bool Equals(Handle that) const; + bool StrictEquals(Handle that) const; private: - inline bool QuickIsUndefined() const; - inline bool QuickIsNull() const; - inline bool QuickIsString() const; - V8EXPORT bool FullIsUndefined() const; - V8EXPORT bool FullIsNull() const; - V8EXPORT bool FullIsString() const; + V8_INLINE(bool QuickIsUndefined() const); + V8_INLINE(bool QuickIsNull() const); + V8_INLINE(bool QuickIsString() const); + bool FullIsUndefined() const; + bool FullIsNull() const; + bool FullIsString() const; }; /** * The superclass of primitive values. See ECMA-262 4.3.2. */ -class Primitive : public Value { }; +class V8EXPORT Primitive : public Value { }; /** * A primitive boolean value (ECMA-262, 4.3.14). Either the true * or false value. */ -class Boolean : public Primitive { +class V8EXPORT Boolean : public Primitive { public: - V8EXPORT bool Value() const; - static inline Handle New(bool value); + bool Value() const; + V8_INLINE(static Handle New(bool value)); }; /** * A JavaScript string value (ECMA-262, 4.3.17). */ -class String : public Primitive { +class V8EXPORT String : public Primitive { public: enum Encoding { UNKNOWN_ENCODING = 0x1, TWO_BYTE_ENCODING = 0x0, - ASCII_ENCODING = 0x4 + ASCII_ENCODING = 0x4, + ONE_BYTE_ENCODING = 0x4 }; /** * Returns the number of characters in this string. */ - V8EXPORT int Length() const; + int Length() const; /** * Returns the number of bytes in the UTF-8 encoded * representation of this string. */ - V8EXPORT int Utf8Length() const; + int Utf8Length() const; /** * A fast conservative check for non-ASCII characters. May @@ -1045,7 +1120,12 @@ class String : public Primitive { * false you can be sure that all characters are in the range * 0-127. */ - V8EXPORT bool MayContainNonAscii() const; + bool MayContainNonAscii() const; + + /** + * Returns whether this string contains only one byte data. + */ + bool IsOneByte() const; /** * Write the contents of the string to an external buffer. @@ -1080,36 +1160,41 @@ class String : public Primitive { }; // 16-bit character codes. - V8EXPORT int Write(uint16_t* buffer, - int start = 0, - int length = -1, - int options = NO_OPTIONS) const; + int Write(uint16_t* buffer, + int start = 0, + int length = -1, + int options = NO_OPTIONS) const; // ASCII characters. - V8EXPORT int WriteAscii(char* buffer, - int start = 0, - int length = -1, - int options = NO_OPTIONS) const; + int WriteAscii(char* buffer, + int start = 0, + int length = -1, + int options = NO_OPTIONS) const; + // One byte characters. + int WriteOneByte(uint8_t* buffer, + int start = 0, + int length = -1, + int options = NO_OPTIONS) const; // UTF-8 encoded characters. - V8EXPORT int WriteUtf8(char* buffer, - int length = -1, - int* nchars_ref = NULL, - int options = NO_OPTIONS) const; + int WriteUtf8(char* buffer, + int length = -1, + int* nchars_ref = NULL, + int options = NO_OPTIONS) const; /** * A zero length string. */ - V8EXPORT static v8::Local Empty(); - inline static v8::Local Empty(Isolate* isolate); + static v8::Local Empty(); + V8_INLINE(static v8::Local Empty(Isolate* isolate)); /** * Returns true if the string is external */ - V8EXPORT bool IsExternal() const; + bool IsExternal() const; /** * Returns true if the string is both external and ASCII */ - V8EXPORT bool IsExternalAscii() const; + bool IsExternalAscii() const; class V8EXPORT ExternalStringResourceBase { // NOLINT public: @@ -1190,52 +1275,48 @@ class String : public Primitive { ExternalAsciiStringResource() {} }; + typedef ExternalAsciiStringResource ExternalOneByteStringResource; + /** * If the string is an external string, return the ExternalStringResourceBase * regardless of the encoding, otherwise return NULL. The encoding of the * string is returned in encoding_out. */ - inline ExternalStringResourceBase* GetExternalStringResourceBase( - Encoding* encoding_out) const; + V8_INLINE(ExternalStringResourceBase* GetExternalStringResourceBase( + Encoding* encoding_out) const); /** * Get the ExternalStringResource for an external string. Returns * NULL if IsExternal() doesn't return true. */ - inline ExternalStringResource* GetExternalStringResource() const; + V8_INLINE(ExternalStringResource* GetExternalStringResource() const); /** * Get the ExternalAsciiStringResource for an external ASCII string. * Returns NULL if IsExternalAscii() doesn't return true. */ - V8EXPORT const ExternalAsciiStringResource* GetExternalAsciiStringResource() - const; + const ExternalAsciiStringResource* GetExternalAsciiStringResource() const; - static inline String* Cast(v8::Value* obj); + V8_INLINE(static String* Cast(v8::Value* obj)); /** * Allocates a new string from either UTF-8 encoded or ASCII data. - * The second parameter 'length' gives the buffer length. - * If the data is UTF-8 encoded, the caller must - * be careful to supply the length parameter. - * If it is not given, the function calls - * 'strlen' to determine the buffer length, it might be - * wrong if 'data' contains a null character. + * The second parameter 'length' gives the buffer length. If omitted, + * the function calls 'strlen' to determine the buffer length. */ - V8EXPORT static Local New(const char* data, int length = -1); + static Local New(const char* data, int length = -1); /** Allocates a new string from 16-bit character codes.*/ - V8EXPORT static Local New(const uint16_t* data, int length = -1); + static Local New(const uint16_t* data, int length = -1); /** Creates a symbol. Returns one if it exists already.*/ - V8EXPORT static Local NewSymbol(const char* data, int length = -1); + static Local NewSymbol(const char* data, int length = -1); /** * Creates a new string by concatenating the left and the right strings * passed in as parameters. */ - V8EXPORT static Local Concat(Handle left, - Handle right); + static Local Concat(Handle left, Handle right); /** * Creates a new external string using the data defined in the given @@ -1245,7 +1326,7 @@ class String : public Primitive { * should the underlying buffer be deallocated or modified except through the * destructor of the external string resource. */ - V8EXPORT static Local NewExternal(ExternalStringResource* resource); + static Local NewExternal(ExternalStringResource* resource); /** * Associate an external string resource with this string by transforming it @@ -1256,7 +1337,7 @@ class String : public Primitive { * The string is not modified if the operation fails. See NewExternal for * information on the lifetime of the resource. */ - V8EXPORT bool MakeExternal(ExternalStringResource* resource); + bool MakeExternal(ExternalStringResource* resource); /** * Creates a new external string using the ASCII data defined in the given @@ -1265,8 +1346,8 @@ class String : public Primitive { * this function should not otherwise delete or modify the resource. Neither * should the underlying buffer be deallocated or modified except through the * destructor of the external string resource. - */ V8EXPORT static Local NewExternal( - ExternalAsciiStringResource* resource); + */ + static Local NewExternal(ExternalAsciiStringResource* resource); /** * Associate an external string resource with this string by transforming it @@ -1277,20 +1358,18 @@ class String : public Primitive { * The string is not modified if the operation fails. See NewExternal for * information on the lifetime of the resource. */ - V8EXPORT bool MakeExternal(ExternalAsciiStringResource* resource); + bool MakeExternal(ExternalAsciiStringResource* resource); /** * Returns true if this string can be made external. */ - V8EXPORT bool CanMakeExternal(); + bool CanMakeExternal(); /** Creates an undetectable string from the supplied ASCII or UTF-8 data.*/ - V8EXPORT static Local NewUndetectable(const char* data, - int length = -1); + static Local NewUndetectable(const char* data, int length = -1); /** Creates an undetectable string from the supplied 16-bit character codes.*/ - V8EXPORT static Local NewUndetectable(const uint16_t* data, - int length = -1); + static Local NewUndetectable(const uint16_t* data, int length = -1); /** * Converts an object to a UTF-8-encoded character array. Useful if @@ -1361,63 +1440,63 @@ class String : public Primitive { }; private: - V8EXPORT void VerifyExternalStringResourceBase(ExternalStringResourceBase* v, - Encoding encoding) const; - V8EXPORT void VerifyExternalStringResource(ExternalStringResource* val) const; - V8EXPORT static void CheckCast(v8::Value* obj); + void VerifyExternalStringResourceBase(ExternalStringResourceBase* v, + Encoding encoding) const; + void VerifyExternalStringResource(ExternalStringResource* val) const; + static void CheckCast(v8::Value* obj); }; /** * A JavaScript number value (ECMA-262, 4.3.20) */ -class Number : public Primitive { +class V8EXPORT Number : public Primitive { public: - V8EXPORT double Value() const; - V8EXPORT static Local New(double value); - static inline Number* Cast(v8::Value* obj); + double Value() const; + static Local New(double value); + V8_INLINE(static Number* Cast(v8::Value* obj)); private: - V8EXPORT Number(); - V8EXPORT static void CheckCast(v8::Value* obj); + Number(); + static void CheckCast(v8::Value* obj); }; /** * A JavaScript value representing a signed integer. */ -class Integer : public Number { +class V8EXPORT Integer : public Number { public: - V8EXPORT static Local New(int32_t value); - V8EXPORT static Local NewFromUnsigned(uint32_t value); - V8EXPORT static Local New(int32_t value, Isolate*); - V8EXPORT static Local NewFromUnsigned(uint32_t value, Isolate*); - V8EXPORT int64_t Value() const; - static inline Integer* Cast(v8::Value* obj); + static Local New(int32_t value); + static Local NewFromUnsigned(uint32_t value); + static Local New(int32_t value, Isolate*); + static Local NewFromUnsigned(uint32_t value, Isolate*); + int64_t Value() const; + V8_INLINE(static Integer* Cast(v8::Value* obj)); private: - V8EXPORT Integer(); - V8EXPORT static void CheckCast(v8::Value* obj); + Integer(); + static void CheckCast(v8::Value* obj); }; /** * A JavaScript value representing a 32-bit signed integer. */ -class Int32 : public Integer { +class V8EXPORT Int32 : public Integer { public: - V8EXPORT int32_t Value() const; + int32_t Value() const; private: - V8EXPORT Int32(); + Int32(); }; /** * A JavaScript value representing a 32-bit unsigned integer. */ -class Uint32 : public Integer { +class V8EXPORT Uint32 : public Integer { public: - V8EXPORT uint32_t Value() const; + uint32_t Value() const; private: - V8EXPORT Uint32(); + Uint32(); }; @@ -1478,14 +1557,13 @@ enum AccessControl { /** * A JavaScript object (ECMA-262, 4.3.3) */ -class Object : public Value { +class V8EXPORT Object : public Value { public: - V8EXPORT bool Set(Handle key, - Handle value, - PropertyAttribute attribs = None); + bool Set(Handle key, + Handle value, + PropertyAttribute attribs = None); - V8EXPORT bool Set(uint32_t index, - Handle value); + bool Set(uint32_t index, Handle value); // Sets a local property on this object bypassing interceptors and // overriding accessors or read-only properties. @@ -1495,41 +1573,47 @@ class Object : public Value { // will only be returned if the interceptor doesn't return a value. // // Note also that this only works for named properties. - V8EXPORT bool ForceSet(Handle key, - Handle value, - PropertyAttribute attribs = None); + bool ForceSet(Handle key, + Handle value, + PropertyAttribute attribs = None); - V8EXPORT Local Get(Handle key); + Local Get(Handle key); - V8EXPORT Local Get(uint32_t index); + Local Get(uint32_t index); /** * Gets the property attributes of a property which can be None or * any combination of ReadOnly, DontEnum and DontDelete. Returns * None when the property doesn't exist. */ - V8EXPORT PropertyAttribute GetPropertyAttributes(Handle key); + PropertyAttribute GetPropertyAttributes(Handle key); // TODO(1245389): Replace the type-specific versions of these // functions with generic ones that accept a Handle key. - V8EXPORT bool Has(Handle key); + bool Has(Handle key); - V8EXPORT bool Delete(Handle key); + bool Delete(Handle key); // Delete a property on this object bypassing interceptors and // ignoring dont-delete attributes. - V8EXPORT bool ForceDelete(Handle key); + bool ForceDelete(Handle key); - V8EXPORT bool Has(uint32_t index); + bool Has(uint32_t index); - V8EXPORT bool Delete(uint32_t index); + bool Delete(uint32_t index); - V8EXPORT bool SetAccessor(Handle name, - AccessorGetter getter, - AccessorSetter setter = 0, - Handle data = Handle(), - AccessControl settings = DEFAULT, - PropertyAttribute attribute = None); + bool SetAccessor(Handle name, + AccessorGetter getter, + AccessorSetter setter = 0, + Handle data = Handle(), + AccessControl settings = DEFAULT, + PropertyAttribute attribute = None); + + // This function is not yet stable and should not be used at this time. + bool SetAccessor(Handle name, + Handle descriptor, + AccessControl settings = DEFAULT, + PropertyAttribute attribute = None); /** * Returns an array containing the names of the enumerable properties @@ -1537,99 +1621,107 @@ class Object : public Value { * array returned by this method contains the same values as would * be enumerated by a for-in statement over this object. */ - V8EXPORT Local GetPropertyNames(); + Local GetPropertyNames(); /** * This function has the same functionality as GetPropertyNames but * the returned array doesn't contain the names of properties from * prototype objects. */ - V8EXPORT Local GetOwnPropertyNames(); + Local GetOwnPropertyNames(); /** * Get the prototype object. This does not skip objects marked to * be skipped by __proto__ and it does not consult the security * handler. */ - V8EXPORT Local GetPrototype(); + Local GetPrototype(); /** * Set the prototype object. This does not skip objects marked to * be skipped by __proto__ and it does not consult the security * handler. */ - V8EXPORT bool SetPrototype(Handle prototype); + bool SetPrototype(Handle prototype); /** * Finds an instance of the given function template in the prototype * chain. */ - V8EXPORT Local FindInstanceInPrototypeChain( - Handle tmpl); + Local FindInstanceInPrototypeChain(Handle tmpl); /** * Call builtin Object.prototype.toString on this object. * This is different from Value::ToString() that may call * user-defined toString function. This one does not. */ - V8EXPORT Local ObjectProtoToString(); + Local ObjectProtoToString(); /** * Returns the function invoked as a constructor for this object. * May be the null value. */ - V8EXPORT Local GetConstructor(); + Local GetConstructor(); /** * Returns the name of the function invoked as a constructor for this object. */ - V8EXPORT Local GetConstructorName(); + Local GetConstructorName(); /** Gets the number of internal fields for this Object. */ - V8EXPORT int InternalFieldCount(); - /** Gets the value in an internal field. */ - inline Local GetInternalField(int index); + int InternalFieldCount(); + + /** Gets the value from an internal field. */ + V8_INLINE(Local GetInternalField(int index)); + /** Sets the value in an internal field. */ - V8EXPORT void SetInternalField(int index, Handle value); + void SetInternalField(int index, Handle value); - /** Gets a native pointer from an internal field. */ - inline void* GetPointerFromInternalField(int index); + /** + * Gets a 2-byte-aligned native pointer from an internal field. This field + * must have been set by SetAlignedPointerInInternalField, everything else + * leads to undefined behavior. + */ + V8_INLINE(void* GetAlignedPointerFromInternalField(int index)); - /** Sets a native pointer in an internal field. */ - V8EXPORT void SetPointerInInternalField(int index, void* value); + /** + * Sets a 2-byte-aligned native pointer in an internal field. To retrieve such + * a field, GetAlignedPointerFromInternalField must be used, everything else + * leads to undefined behavior. + */ + void SetAlignedPointerInInternalField(int index, void* value); // Testers for local properties. - V8EXPORT bool HasOwnProperty(Handle key); - V8EXPORT bool HasRealNamedProperty(Handle key); - V8EXPORT bool HasRealIndexedProperty(uint32_t index); - V8EXPORT bool HasRealNamedCallbackProperty(Handle key); + bool HasOwnProperty(Handle key); + bool HasRealNamedProperty(Handle key); + bool HasRealIndexedProperty(uint32_t index); + bool HasRealNamedCallbackProperty(Handle key); /** * If result.IsEmpty() no real property was located in the prototype chain. * This means interceptors in the prototype chain are not called. */ - V8EXPORT Local GetRealNamedPropertyInPrototypeChain( - Handle key); + Local GetRealNamedPropertyInPrototypeChain(Handle key); /** * If result.IsEmpty() no real property was located on the object or * in the prototype chain. * This means interceptors in the prototype chain are not called. */ - V8EXPORT Local GetRealNamedProperty(Handle key); + Local GetRealNamedProperty(Handle key); /** Tests for a named lookup interceptor.*/ - V8EXPORT bool HasNamedLookupInterceptor(); + bool HasNamedLookupInterceptor(); /** Tests for an index lookup interceptor.*/ - V8EXPORT bool HasIndexedLookupInterceptor(); + bool HasIndexedLookupInterceptor(); /** * Turns on access check on the object if the object is an instance of * a template that has access check callbacks. If an object has no * access check info, the object cannot be accessed by anyone. */ - V8EXPORT void TurnOnAccessCheck(); + void TurnOnAccessCheck(); /** * Returns the identity hash for this object. The current implementation @@ -1638,7 +1730,7 @@ class Object : public Value { * The return value will never be 0. Also, it is not guaranteed to be * unique. */ - V8EXPORT int GetIdentityHash(); + int GetIdentityHash(); /** * Access hidden properties on JavaScript objects. These properties are @@ -1646,9 +1738,9 @@ class Object : public Value { * C++ API. Hidden properties introduced by V8 internally (for example the * identity hash) are prefixed with "v8::". */ - V8EXPORT bool SetHiddenValue(Handle key, Handle value); - V8EXPORT Local GetHiddenValue(Handle key); - V8EXPORT bool DeleteHiddenValue(Handle key); + bool SetHiddenValue(Handle key, Handle value); + Local GetHiddenValue(Handle key); + bool DeleteHiddenValue(Handle key); /** * Returns true if this is an instance of an api function (one @@ -1657,18 +1749,18 @@ class Object : public Value { * conservative and may return true for objects that haven't actually * been modified. */ - V8EXPORT bool IsDirty(); + bool IsDirty(); /** * Clone this object with a fast but shallow copy. Values will point * to the same values as the original object. */ - V8EXPORT Local Clone(); + Local Clone(); /** * Returns the context in which the object was created. */ - V8EXPORT Local CreationContext(); + Local CreationContext(); /** * Set the backing store of the indexed properties to be managed by the @@ -1677,10 +1769,10 @@ class Object : public Value { * Note: The embedding program still owns the data and needs to ensure that * the backing store is preserved while V8 has a reference. */ - V8EXPORT void SetIndexedPropertiesToPixelData(uint8_t* data, int length); - V8EXPORT bool HasIndexedPropertiesInPixelData(); - V8EXPORT uint8_t* GetIndexedPropertiesPixelData(); - V8EXPORT int GetIndexedPropertiesPixelDataLength(); + void SetIndexedPropertiesToPixelData(uint8_t* data, int length); + bool HasIndexedPropertiesInPixelData(); + uint8_t* GetIndexedPropertiesPixelData(); + int GetIndexedPropertiesPixelDataLength(); /** * Set the backing store of the indexed properties to be managed by the @@ -1689,93 +1781,83 @@ class Object : public Value { * Note: The embedding program still owns the data and needs to ensure that * the backing store is preserved while V8 has a reference. */ - V8EXPORT void SetIndexedPropertiesToExternalArrayData( - void* data, - ExternalArrayType array_type, - int number_of_elements); - V8EXPORT bool HasIndexedPropertiesInExternalArrayData(); - V8EXPORT void* GetIndexedPropertiesExternalArrayData(); - V8EXPORT ExternalArrayType GetIndexedPropertiesExternalArrayDataType(); - V8EXPORT int GetIndexedPropertiesExternalArrayDataLength(); + void SetIndexedPropertiesToExternalArrayData(void* data, + ExternalArrayType array_type, + int number_of_elements); + bool HasIndexedPropertiesInExternalArrayData(); + void* GetIndexedPropertiesExternalArrayData(); + ExternalArrayType GetIndexedPropertiesExternalArrayDataType(); + int GetIndexedPropertiesExternalArrayDataLength(); /** * Checks whether a callback is set by the * ObjectTemplate::SetCallAsFunctionHandler method. * When an Object is callable this method returns true. */ - V8EXPORT bool IsCallable(); + bool IsCallable(); /** * Call an Object as a function if a callback is set by the * ObjectTemplate::SetCallAsFunctionHandler method. */ - V8EXPORT Local CallAsFunction(Handle recv, - int argc, - Handle argv[]); + Local CallAsFunction(Handle recv, + int argc, + Handle argv[]); /** * Call an Object as a constructor if a callback is set by the * ObjectTemplate::SetCallAsFunctionHandler method. * Note: This method behaves like the Function::NewInstance method. */ - V8EXPORT Local CallAsConstructor(int argc, - Handle argv[]); + Local CallAsConstructor(int argc, Handle argv[]); - V8EXPORT static Local New(); - static inline Object* Cast(Value* obj); + static Local New(); + V8_INLINE(static Object* Cast(Value* obj)); private: - V8EXPORT Object(); - V8EXPORT static void CheckCast(Value* obj); - V8EXPORT Local CheckedGetInternalField(int index); - V8EXPORT void* SlowGetPointerFromInternalField(int index); - - /** - * If quick access to the internal field is possible this method - * returns the value. Otherwise an empty handle is returned. - */ - inline Local UncheckedGetInternalField(int index); + Object(); + static void CheckCast(Value* obj); + Local SlowGetInternalField(int index); + void* SlowGetAlignedPointerFromInternalField(int index); }; /** * An instance of the built-in array constructor (ECMA-262, 15.4.2). */ -class Array : public Object { +class V8EXPORT Array : public Object { public: - V8EXPORT uint32_t Length() const; + uint32_t Length() const; /** * Clones an element at index |index|. Returns an empty * handle if cloning fails (for any reason). */ - V8EXPORT Local CloneElementAt(uint32_t index); + Local CloneElementAt(uint32_t index); /** * Creates a JavaScript array with the given length. If the length * is negative the returned array will have length 0. */ - V8EXPORT static Local New(int length = 0); + static Local New(int length = 0); - static inline Array* Cast(Value* obj); + V8_INLINE(static Array* Cast(Value* obj)); private: - V8EXPORT Array(); - V8EXPORT static void CheckCast(Value* obj); + Array(); + static void CheckCast(Value* obj); }; /** * A JavaScript function object (ECMA-262, 15.3). */ -class Function : public Object { +class V8EXPORT Function : public Object { public: - V8EXPORT Local NewInstance() const; - V8EXPORT Local NewInstance(int argc, Handle argv[]) const; - V8EXPORT Local Call(Handle recv, - int argc, - Handle argv[]); - V8EXPORT void SetName(Handle name); - V8EXPORT Handle GetName() const; + Local NewInstance() const; + Local NewInstance(int argc, Handle argv[]) const; + Local Call(Handle recv, int argc, Handle argv[]); + void SetName(Handle name); + Handle GetName() const; /** * Name inferred from variable or property assignment of this function. @@ -1783,43 +1865,43 @@ class Function : public Object { * in an OO style, where many functions are anonymous but are assigned * to object properties. */ - V8EXPORT Handle GetInferredName() const; + Handle GetInferredName() const; /** * Returns zero based line number of function body and * kLineOffsetNotFound if no information available. */ - V8EXPORT int GetScriptLineNumber() const; + int GetScriptLineNumber() const; /** * Returns zero based column number of function body and * kLineOffsetNotFound if no information available. */ - V8EXPORT int GetScriptColumnNumber() const; - V8EXPORT Handle GetScriptId() const; - V8EXPORT ScriptOrigin GetScriptOrigin() const; - static inline Function* Cast(Value* obj); - V8EXPORT static const int kLineOffsetNotFound; + int GetScriptColumnNumber() const; + Handle GetScriptId() const; + ScriptOrigin GetScriptOrigin() const; + V8_INLINE(static Function* Cast(Value* obj)); + static const int kLineOffsetNotFound; private: - V8EXPORT Function(); - V8EXPORT static void CheckCast(Value* obj); + Function(); + static void CheckCast(Value* obj); }; /** * An instance of the built-in Date constructor (ECMA-262, 15.9). */ -class Date : public Object { +class V8EXPORT Date : public Object { public: - V8EXPORT static Local New(double time); + static Local New(double time); /** * A specialization of Value::NumberValue that is more efficient * because we know the structure of this object. */ - V8EXPORT double NumberValue() const; + double NumberValue() const; - static inline Date* Cast(v8::Value* obj); + V8_INLINE(static Date* Cast(v8::Value* obj)); /** * Notification that the embedder has changed the time zone, @@ -1833,74 +1915,74 @@ class Date : public Object { * This API should not be called more than needed as it will * negatively impact the performance of date operations. */ - V8EXPORT static void DateTimeConfigurationChangeNotification(); + static void DateTimeConfigurationChangeNotification(); private: - V8EXPORT static void CheckCast(v8::Value* obj); + static void CheckCast(v8::Value* obj); }; /** * A Number object (ECMA-262, 4.3.21). */ -class NumberObject : public Object { +class V8EXPORT NumberObject : public Object { public: - V8EXPORT static Local New(double value); + static Local New(double value); /** * Returns the Number held by the object. */ - V8EXPORT double NumberValue() const; + double NumberValue() const; - static inline NumberObject* Cast(v8::Value* obj); + V8_INLINE(static NumberObject* Cast(v8::Value* obj)); private: - V8EXPORT static void CheckCast(v8::Value* obj); + static void CheckCast(v8::Value* obj); }; /** * A Boolean object (ECMA-262, 4.3.15). */ -class BooleanObject : public Object { +class V8EXPORT BooleanObject : public Object { public: - V8EXPORT static Local New(bool value); + static Local New(bool value); /** * Returns the Boolean held by the object. */ - V8EXPORT bool BooleanValue() const; + bool BooleanValue() const; - static inline BooleanObject* Cast(v8::Value* obj); + V8_INLINE(static BooleanObject* Cast(v8::Value* obj)); private: - V8EXPORT static void CheckCast(v8::Value* obj); + static void CheckCast(v8::Value* obj); }; /** * A String object (ECMA-262, 4.3.18). */ -class StringObject : public Object { +class V8EXPORT StringObject : public Object { public: - V8EXPORT static Local New(Handle value); + static Local New(Handle value); /** * Returns the String held by the object. */ - V8EXPORT Local StringValue() const; + Local StringValue() const; - static inline StringObject* Cast(v8::Value* obj); + V8_INLINE(static StringObject* Cast(v8::Value* obj)); private: - V8EXPORT static void CheckCast(v8::Value* obj); + static void CheckCast(v8::Value* obj); }; /** * An instance of the built-in RegExp constructor (ECMA-262, 15.10). */ -class RegExp : public Object { +class V8EXPORT RegExp : public Object { public: /** * Regular expression flag bits. They can be or'ed to enable a set @@ -1923,51 +2005,37 @@ class RegExp : public Object { * static_cast(kGlobal | kMultiline)) * is equivalent to evaluating "/foo/gm". */ - V8EXPORT static Local New(Handle pattern, - Flags flags); + static Local New(Handle pattern, Flags flags); /** * Returns the value of the source property: a string representing * the regular expression. */ - V8EXPORT Local GetSource() const; + Local GetSource() const; /** * Returns the flags bit field. */ - V8EXPORT Flags GetFlags() const; + Flags GetFlags() const; - static inline RegExp* Cast(v8::Value* obj); + V8_INLINE(static RegExp* Cast(v8::Value* obj)); private: - V8EXPORT static void CheckCast(v8::Value* obj); + static void CheckCast(v8::Value* obj); }; /** - * A JavaScript value that wraps a C++ void*. This type of value is - * mainly used to associate C++ data structures with JavaScript - * objects. - * - * The Wrap function V8 will return the most optimal Value object wrapping the - * C++ void*. The type of the value is not guaranteed to be an External object - * and no assumptions about its type should be made. To access the wrapped - * value Unwrap should be used, all other operations on that object will lead - * to unpredictable results. + * A JavaScript value that wraps a C++ void*. This type of value is mainly used + * to associate C++ data structures with JavaScript objects. */ -class External : public Value { +class V8EXPORT External : public Value { public: - V8EXPORT static Local Wrap(void* data); - static inline void* Unwrap(Handle obj); - - V8EXPORT static Local New(void* value); - static inline External* Cast(Value* obj); - V8EXPORT void* Value() const; + static Local New(void* value); + V8_INLINE(static External* Cast(Value* obj)); + void* Value() const; private: - V8EXPORT External(); - V8EXPORT static void CheckCast(v8::Value* obj); - static inline void* QuickUnwrap(Handle obj); - V8EXPORT static void* FullUnwrap(Handle obj); + static void CheckCast(v8::Value* obj); }; @@ -1982,7 +2050,7 @@ class V8EXPORT Template : public Data { /** Adds a property to each instance created by this template.*/ void Set(Handle name, Handle value, PropertyAttribute attributes = None); - inline void Set(const char* name, Handle value); + V8_INLINE(void Set(const char* name, Handle value)); private: Template(); @@ -1997,16 +2065,16 @@ class V8EXPORT Template : public Data { * including the receiver, the number and values of arguments, and * the holder of the function. */ -class Arguments { +class V8EXPORT Arguments { public: - inline int Length() const; - inline Local operator[](int i) const; - inline Local Callee() const; - inline Local This() const; - inline Local Holder() const; - inline bool IsConstructCall() const; - inline Local Data() const; - inline Isolate* GetIsolate() const; + V8_INLINE(int Length() const); + V8_INLINE(Local operator[](int i) const); + V8_INLINE(Local Callee() const); + V8_INLINE(Local This() const); + V8_INLINE(Local Holder() const); + V8_INLINE(bool IsConstructCall() const); + V8_INLINE(Local Data() const); + V8_INLINE(Isolate* GetIsolate() const); private: static const int kIsolateIndex = 0; @@ -2015,10 +2083,10 @@ class Arguments { static const int kHolderIndex = -3; friend class ImplementationUtilities; - inline Arguments(internal::Object** implicit_args, + V8_INLINE(Arguments(internal::Object** implicit_args, internal::Object** values, int length, - bool is_construct_call); + bool is_construct_call)); internal::Object** implicit_args_; internal::Object** values_; int length_; @@ -2032,12 +2100,12 @@ class Arguments { */ class V8EXPORT AccessorInfo { public: - inline AccessorInfo(internal::Object** args) + V8_INLINE(AccessorInfo(internal::Object** args)) : args_(args) { } - inline Isolate* GetIsolate() const; - inline Local Data() const; - inline Local This() const; - inline Local Holder() const; + V8_INLINE(Isolate* GetIsolate() const); + V8_INLINE(Local Data() const); + V8_INLINE(Local This() const); + V8_INLINE(Local Holder() const); private: internal::Object** args_; @@ -2255,7 +2323,8 @@ class V8EXPORT FunctionTemplate : public Template { static Local New( InvocationCallback callback = 0, Handle data = Handle(), - Handle signature = Handle()); + Handle signature = Handle(), + int length = 0); /** Returns the unique function instance in the current execution context.*/ Local GetFunction(); @@ -2267,6 +2336,9 @@ class V8EXPORT FunctionTemplate : public Template { void SetCallHandler(InvocationCallback callback, Handle data = Handle()); + /** Set the predefined length property for the FunctionTemplate. */ + void SetLength(int length); + /** Get the InstanceTemplate. */ Local InstanceTemplate(); @@ -2279,7 +2351,6 @@ class V8EXPORT FunctionTemplate : public Template { */ Local PrototypeTemplate(); - /** * Set the class name of the FunctionTemplate. This is used for * printing objects created with the function created from the @@ -2315,13 +2386,6 @@ class V8EXPORT FunctionTemplate : public Template { private: FunctionTemplate(); - void AddInstancePropertyAccessor(Handle name, - AccessorGetter getter, - AccessorSetter setter, - Handle data, - AccessControl settings, - PropertyAttribute attributes, - Handle signature); void SetNamedInstancePropertyHandler(NamedPropertyGetter getter, NamedPropertySetter setter, NamedPropertyQuery query, @@ -2394,6 +2458,14 @@ class V8EXPORT ObjectTemplate : public Template { Handle signature = Handle()); + // This function is not yet stable and should not be used at this time. + bool SetAccessor(Handle name, + Handle descriptor, + AccessControl settings = DEFAULT, + PropertyAttribute attribute = None, + Handle signature = + Handle()); + /** * Sets a named property handler on the object template. * @@ -2523,6 +2595,61 @@ class V8EXPORT AccessorSignature : public Data { }; +class V8EXPORT DeclaredAccessorDescriptor : public Data { + private: + DeclaredAccessorDescriptor(); +}; + + +class V8EXPORT ObjectOperationDescriptor : public Data { + public: + // This function is not yet stable and should not be used at this time. + static Local NewInternalFieldDereference( + Isolate* isolate, + int internal_field); + private: + ObjectOperationDescriptor(); +}; + + +enum DeclaredAccessorDescriptorDataType { + kDescriptorBoolType, + kDescriptorInt8Type, kDescriptorUint8Type, + kDescriptorInt16Type, kDescriptorUint16Type, + kDescriptorInt32Type, kDescriptorUint32Type, + kDescriptorFloatType, kDescriptorDoubleType +}; + + +class V8EXPORT RawOperationDescriptor : public Data { + public: + Local NewHandleDereference(Isolate* isolate); + Local NewRawDereference(Isolate* isolate); + Local NewRawShift(Isolate* isolate, + int16_t byte_offset); + Local NewPointerCompare(Isolate* isolate, + void* compare_value); + Local NewPrimitiveValue( + Isolate* isolate, + DeclaredAccessorDescriptorDataType data_type, + uint8_t bool_offset = 0); + Local NewBitmaskCompare8(Isolate* isolate, + uint8_t bitmask, + uint8_t compare_value); + Local NewBitmaskCompare16( + Isolate* isolate, + uint16_t bitmask, + uint16_t compare_value); + Local NewBitmaskCompare32( + Isolate* isolate, + uint32_t bitmask, + uint32_t compare_value); + + private: + RawOperationDescriptor(); +}; + + /** * A utility for determining the type of objects based on the template * they were constructed from. @@ -2602,7 +2729,7 @@ void V8EXPORT RegisterExtension(Extension* extension); */ class V8EXPORT DeclareExtension { public: - inline DeclareExtension(Extension* extension) { + V8_INLINE(DeclareExtension(Extension* extension)) { RegisterExtension(extension); } }; @@ -2616,10 +2743,10 @@ Handle V8EXPORT Null(); Handle V8EXPORT True(); Handle V8EXPORT False(); -inline Handle Undefined(Isolate* isolate); -inline Handle Null(Isolate* isolate); -inline Handle True(Isolate* isolate); -inline Handle False(Isolate* isolate); +V8_INLINE(Handle Undefined(Isolate* isolate)); +V8_INLINE(Handle Null(Isolate* isolate)); +V8_INLINE(Handle True(Isolate* isolate)); +V8_INLINE(Handle False(Isolate* isolate)); /** @@ -2773,23 +2900,19 @@ class V8EXPORT HeapStatistics { HeapStatistics(); size_t total_heap_size() { return total_heap_size_; } size_t total_heap_size_executable() { return total_heap_size_executable_; } + size_t total_physical_size() { return total_physical_size_; } size_t used_heap_size() { return used_heap_size_; } size_t heap_size_limit() { return heap_size_limit_; } private: - void set_total_heap_size(size_t size) { total_heap_size_ = size; } - void set_total_heap_size_executable(size_t size) { - total_heap_size_executable_ = size; - } - void set_used_heap_size(size_t size) { used_heap_size_ = size; } - void set_heap_size_limit(size_t size) { heap_size_limit_ = size; } - size_t total_heap_size_; size_t total_heap_size_executable_; + size_t total_physical_size_; size_t used_heap_size_; size_t heap_size_limit_; friend class V8; + friend class Isolate; }; @@ -2871,13 +2994,33 @@ class V8EXPORT Isolate { /** * Associate embedder-specific data with the isolate */ - inline void SetData(void* data); + V8_INLINE(void SetData(void* data)); /** * Retrieve embedder-specific data from the isolate. * Returns NULL if SetData has never been called. */ - inline void* GetData(); + V8_INLINE(void* GetData()); + + /** + * Get statistics about the heap memory usage. + */ + void GetHeapStatistics(HeapStatistics* heap_statistics); + + /** + * Adjusts the amount of registered external memory. Used to give V8 an + * indication of the amount of externally allocated memory that is kept alive + * by JavaScript objects. V8 uses this to decide when to perform global + * garbage collections. Registering externally allocated memory will trigger + * global garbage collections more often than it would otherwise in an attempt + * to garbage collect the JavaScript objects that keep the externally + * allocated memory alive. + * + * \param change_in_bytes the change in externally allocated memory that is + * kept alive by JavaScript objects. + * \returns the adjusted value. + */ + intptr_t AdjustAmountOfExternalAllocatedMemory(intptr_t change_in_bytes); private: Isolate(); @@ -2889,7 +3032,7 @@ class V8EXPORT Isolate { }; -class StartupData { +class V8EXPORT StartupData { public: enum CompressionAlgorithm { kUncompressed, @@ -2975,7 +3118,19 @@ struct JitCodeEvent { enum EventType { CODE_ADDED, CODE_MOVED, - CODE_REMOVED + CODE_REMOVED, + CODE_ADD_LINE_POS_INFO, + CODE_START_LINE_INFO_RECORDING, + CODE_END_LINE_INFO_RECORDING + }; + // Definition of the code position type. The "POSITION" type means the place + // in the source code which are of interest when making stack traces to + // pin-point the source location of a stack frame as close as possible. + // The "STATEMENT_POSITION" means the place at the beginning of each + // statement, and is used to indicate possible break locations. + enum PositionType { + POSITION, + STATEMENT_POSITION }; // Type of event. @@ -2984,6 +3139,13 @@ struct JitCodeEvent { void* code_start; // Size of the instructions. size_t code_len; + // Script info for CODE_ADDED event. + Handle + + + + + + + + + + + + +

+ Chrome V8 profiling log processor +

+

+Process V8's profiling information log (sampling profiler tick information) +in your browser. Particularly useful if you don't have the V8 shell (d8) +at hand on your system. You still have to run Chrome with the appropriate + + command line flags +to produce the profiling log. +

+

Usage:

+

+Click on the button and browse to the profiling log file (usually, v8.log). +Process will start automatically and the output will be visible in the below +text area. +

+

Limitations and disclaimer:

+

+This page offers a subset of the functionalities of the command-line tick +processor utility in the V8 repository. In particular, this page cannot +access the command-line utility that provides library symbol information, +hence the [C++] section of the output stays empty. Also consider that this +web-based tool is provided only for convenience and quick reference, you +should refer to the + + command-line +version for full output. +

+

+ +

+

+ +

+

+Copyright the V8 Authors - Last change to this page: 12/12/2012 +

+ + + + diff --git a/deps/v8/tools/tickprocessor-driver.js b/deps/v8/tools/tickprocessor-driver.js index 313c6d4c94..02cb81a55f 100644 --- a/deps/v8/tools/tickprocessor-driver.js +++ b/deps/v8/tools/tickprocessor-driver.js @@ -55,6 +55,8 @@ var tickProcessor = new TickProcessor( params.callGraphSize, params.ignoreUnknown, params.stateFilter, - snapshotLogProcessor); + snapshotLogProcessor, + params.distortion, + params.range); tickProcessor.processLogFile(params.logFileName); tickProcessor.printStatistics(); diff --git a/deps/v8/tools/tickprocessor.js b/deps/v8/tools/tickprocessor.js index 4c4886d878..c9ee1011f0 100644 --- a/deps/v8/tools/tickprocessor.js +++ b/deps/v8/tools/tickprocessor.js @@ -73,7 +73,7 @@ function parseState(s) { function SnapshotLogProcessor() { LogReader.call(this, { 'code-creation': { - parsers: [null, parseInt, parseInt, null, 'var-args'], + parsers: [null, parseInt, parseInt, parseInt, null, 'var-args'], processor: this.processCodeCreation }, 'code-move': { parsers: [parseInt, parseInt], processor: this.processCodeMove }, @@ -107,7 +107,7 @@ inherits(SnapshotLogProcessor, LogReader); SnapshotLogProcessor.prototype.processCodeCreation = function( - type, start, size, name, maybe_func) { + type, kind, start, size, name, maybe_func) { if (maybe_func.length) { var funcAddr = parseInt(maybe_func[0]); var state = parseState(maybe_func[1]); @@ -151,12 +151,14 @@ function TickProcessor( callGraphSize, ignoreUnknown, stateFilter, - snapshotLogProcessor) { + snapshotLogProcessor, + distortion, + range) { LogReader.call(this, { 'shared-library': { parsers: [null, parseInt, parseInt], processor: this.processSharedLibrary }, 'code-creation': { - parsers: [null, parseInt, parseInt, null, 'var-args'], + parsers: [null, parseInt, parseInt, parseInt, null, 'var-args'], processor: this.processCodeCreation }, 'code-move': { parsers: [parseInt, parseInt], processor: this.processCodeMove }, @@ -167,13 +169,17 @@ function TickProcessor( 'snapshot-pos': { parsers: [parseInt, parseInt], processor: this.processSnapshotPosition }, 'tick': { - parsers: [parseInt, parseInt, parseInt, + parsers: [parseInt, parseInt, parseInt, parseInt, parseInt, parseInt, 'var-args'], processor: this.processTick }, 'heap-sample-begin': { parsers: [null, null, parseInt], processor: this.processHeapSampleBegin }, 'heap-sample-end': { parsers: [null, null], processor: this.processHeapSampleEnd }, + 'timer-event-start' : { parsers: [null, null, null], + processor: this.advanceDistortion }, + 'timer-event-end' : { parsers: [null, null, null], + processor: this.advanceDistortion }, // Ignored events. 'profiler': null, 'function-creation': null, @@ -194,6 +200,17 @@ function TickProcessor( var ticks = this.ticks_ = { total: 0, unaccounted: 0, excluded: 0, gc: 0 }; + distortion = parseInt(distortion); + // Convert picoseconds to nanoseconds. + this.distortion_per_entry = isNaN(distortion) ? 0 : (distortion / 1000); + this.distortion = 0; + var rangelimits = range.split(","); + var range_start = parseInt(rangelimits[0]); + var range_end = parseInt(rangelimits[1]); + // Convert milliseconds to nanoseconds. + this.range_start = isNaN(range_start) ? -Infinity : (range_start * 1000); + this.range_end = isNaN(range_end) ? Infinity : (range_end * 1000) + V8Profile.prototype.handleUnknownCode = function( operation, addr, opt_stackPos) { var op = Profile.Operation; @@ -231,8 +248,9 @@ TickProcessor.VmStates = { JS: 0, GC: 1, COMPILER: 2, - OTHER: 3, - EXTERNAL: 4 + PARALLEL_COMPILER: 3, + OTHER: 4, + EXTERNAL: 5 }; @@ -308,7 +326,7 @@ TickProcessor.prototype.processSharedLibrary = function( TickProcessor.prototype.processCodeCreation = function( - type, start, size, name, maybe_func) { + type, kind, start, size, name, maybe_func) { name = this.deserializedEntriesNames_[start] || name; if (maybe_func.length) { var funcAddr = parseInt(maybe_func[0]); @@ -349,10 +367,16 @@ TickProcessor.prototype.includeTick = function(vmState) { TickProcessor.prototype.processTick = function(pc, sp, + ns_since_start, is_external_callback, tos_or_external_callback, vmState, stack) { + this.distortion += this.distortion_per_entry; + ns_since_start -= this.distortion; + if (ns_since_start < this.range_start || ns_since_start > this.range_end) { + return; + } this.ticks_.total++; if (vmState == TickProcessor.VmStates.GC) this.ticks_.gc++; if (!this.includeTick(vmState)) { @@ -379,6 +403,11 @@ TickProcessor.prototype.processTick = function(pc, }; +TickProcessor.prototype.advanceDistortion = function() { + this.distortion += this.distortion_per_entry; +} + + TickProcessor.prototype.processHeapSampleBegin = function(space, state, ticks) { if (space != 'Heap') return; this.currentProducerProfile_ = new CallTree(); @@ -793,7 +822,11 @@ function ArgumentsProcessor(args) { '--target': ['targetRootFS', '', 'Specify the target root directory for cross environment'], '--snapshot-log': ['snapshotLogFileName', 'snapshot.log', - 'Specify snapshot log file to use (e.g. --snapshot-log=snapshot.log)'] + 'Specify snapshot log file to use (e.g. --snapshot-log=snapshot.log)'], + '--range': ['range', 'auto,auto', + 'Specify the range limit as [start],[end]'], + '--distortion': ['distortion', 0, + 'Specify the logging overhead in picoseconds'] }; this.argsDispatch_['--js'] = this.argsDispatch_['-j']; this.argsDispatch_['--gc'] = this.argsDispatch_['-g']; @@ -812,7 +845,9 @@ ArgumentsProcessor.DEFAULTS = { ignoreUnknown: false, separateIc: false, targetRootFS: '', - nm: 'nm' + nm: 'nm', + range: 'auto,auto', + distortion: 0 };