From 1bd711c8a09e327946f2eca5030e9710dc0e1e6e Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 29 Jul 2013 21:21:03 +0200 Subject: [PATCH] v8: upgrade to v8 3.20.9 --- deps/v8/.gitignore | 4 + deps/v8/ChangeLog | 19 + deps/v8/DEPS | 2 +- deps/v8/Makefile | 2 +- deps/v8/include/v8.h | 10 +- deps/v8/src/api.cc | 21 +- deps/v8/src/arm/assembler-arm.cc | 21 +- deps/v8/src/arm/assembler-arm.h | 94 +- deps/v8/src/arm/code-stubs-arm.cc | 45 +- deps/v8/src/arm/deoptimizer-arm.cc | 46 +- deps/v8/src/arm/disasm-arm.cc | 8 + deps/v8/src/arm/full-codegen-arm.cc | 2 +- deps/v8/src/arm/ic-arm.cc | 2 +- deps/v8/src/arm/lithium-arm.cc | 90 +- deps/v8/src/arm/lithium-arm.h | 46 +- deps/v8/src/arm/lithium-codegen-arm.cc | 234 ++-- deps/v8/src/arm/lithium-codegen-arm.h | 7 +- deps/v8/src/arm/lithium-gap-resolver-arm.cc | 16 +- deps/v8/src/arm/macro-assembler-arm.cc | 117 +- deps/v8/src/arm/macro-assembler-arm.h | 30 +- deps/v8/src/arm/simulator-arm.cc | 9 + deps/v8/src/arm/stub-cache-arm.cc | 23 +- deps/v8/src/ast.cc | 13 +- deps/v8/src/bootstrapper.cc | 11 +- deps/v8/src/code-stubs-hydrogen.cc | 92 +- deps/v8/src/code-stubs.h | 10 +- deps/v8/src/codegen.cc | 1 + deps/v8/src/compiler.cc | 15 +- deps/v8/src/cpu-profiler.cc | 2 +- deps/v8/src/cpu-profiler.h | 18 +- deps/v8/src/d8.cc | 24 +- deps/v8/src/d8.h | 2 - deps/v8/src/debug-debugger.js | 14 - deps/v8/src/debug.cc | 4 + deps/v8/src/deoptimizer.cc | 193 ++-- deps/v8/src/deoptimizer.h | 14 +- deps/v8/src/extensions/i18n/i18n-utils.cc | 34 +- deps/v8/src/factory.cc | 1 + deps/v8/src/flag-definitions.h | 10 +- deps/v8/src/frames-inl.h | 6 +- deps/v8/src/frames.cc | 44 +- deps/v8/src/frames.h | 13 +- deps/v8/src/global-handles.cc | 1 + deps/v8/src/globals.h | 15 +- deps/v8/src/heap-inl.h | 13 - deps/v8/src/heap-snapshot-generator.cc | 4 +- deps/v8/src/heap.cc | 198 +--- deps/v8/src/heap.h | 64 +- deps/v8/src/hydrogen-bce.cc | 4 + deps/v8/src/hydrogen-bch.cc | 408 +++++++ deps/v8/src/{platform-tls.h => hydrogen-bch.h} | 41 +- deps/v8/src/hydrogen-canonicalize.cc | 17 +- deps/v8/src/hydrogen-deoptimizing-mark.cc | 2 +- deps/v8/src/hydrogen-environment-liveness.cc | 9 - deps/v8/src/hydrogen-gvn.cc | 2 +- deps/v8/src/hydrogen-instructions.cc | 904 ++++++++++++--- deps/v8/src/hydrogen-instructions.h | 707 ++++++++---- deps/v8/src/hydrogen-minus-zero.cc | 4 +- deps/v8/src/hydrogen-osr.cc | 2 +- deps/v8/src/hydrogen-representation-changes.cc | 33 +- deps/v8/src/hydrogen.cc | 494 +++++---- deps/v8/src/hydrogen.h | 138 ++- deps/v8/src/ia32/code-stubs-ia32.cc | 31 +- deps/v8/src/ia32/deoptimizer-ia32.cc | 46 +- deps/v8/src/ia32/full-codegen-ia32.cc | 2 +- deps/v8/src/ia32/lithium-codegen-ia32.cc | 203 ++-- deps/v8/src/ia32/lithium-codegen-ia32.h | 22 +- deps/v8/src/ia32/lithium-gap-resolver-ia32.cc | 16 +- deps/v8/src/ia32/lithium-ia32.cc | 76 +- deps/v8/src/ia32/lithium-ia32.h | 34 +- deps/v8/src/ia32/macro-assembler-ia32.cc | 4 +- deps/v8/src/ia32/stub-cache-ia32.cc | 16 +- deps/v8/src/ic.cc | 23 +- deps/v8/src/isolate.cc | 3 +- deps/v8/src/isolate.h | 23 +- deps/v8/src/lithium.cc | 2 +- deps/v8/src/liveedit.cc | 1 + deps/v8/src/log.cc | 58 +- deps/v8/src/mark-compact.cc | 127 ++- deps/v8/src/mark-compact.h | 2 + deps/v8/src/messages.js | 75 +- deps/v8/src/mips/code-stubs-mips.cc | 38 +- deps/v8/src/mips/deoptimizer-mips.cc | 51 +- deps/v8/src/mips/lithium-codegen-mips.cc | 151 ++- deps/v8/src/mips/lithium-codegen-mips.h | 10 +- deps/v8/src/mips/lithium-gap-resolver-mips.cc | 16 +- deps/v8/src/mips/lithium-mips.cc | 82 +- deps/v8/src/mips/lithium-mips.h | 41 +- deps/v8/src/mips/macro-assembler-mips.cc | 11 +- deps/v8/src/mips/stub-cache-mips.cc | 15 +- deps/v8/src/mirror-debugger.js | 2 +- deps/v8/src/objects-inl.h | 25 +- deps/v8/src/objects-printer.cc | 14 +- deps/v8/src/objects.cc | 141 +-- deps/v8/src/objects.h | 52 +- deps/v8/src/optimizing-compiler-thread.cc | 67 +- deps/v8/src/optimizing-compiler-thread.h | 10 +- deps/v8/src/platform-cygwin.cc | 176 --- deps/v8/src/platform-freebsd.cc | 153 --- deps/v8/src/platform-linux.cc | 176 --- deps/v8/src/platform-macos.cc | 239 ---- deps/v8/src/platform-openbsd.cc | 184 +-- deps/v8/src/platform-posix.cc | 338 +++++- deps/v8/src/platform-posix.h | 3 - deps/v8/src/platform-solaris.cc | 145 --- deps/v8/src/platform.h | 57 +- deps/v8/src/profile-generator.cc | 3 +- deps/v8/src/property-details.h | 2 +- deps/v8/src/property.cc | 10 +- deps/v8/src/property.h | 46 +- deps/v8/src/runtime.cc | 80 +- deps/v8/src/runtime.h | 9 +- deps/v8/src/sampler.cc | 11 +- deps/v8/src/spaces.h | 5 +- deps/v8/src/stub-cache.cc | 23 +- deps/v8/src/stub-cache.h | 8 +- deps/v8/src/token.h | 13 +- deps/v8/src/type-info.cc | 3 +- deps/v8/src/typedarray.js | 52 +- deps/v8/src/types.cc | 2 + deps/v8/src/v8-counters.h | 2 + deps/v8/src/version.cc | 2 +- deps/v8/src/vm-state-inl.h | 23 +- deps/v8/src/vm-state.h | 11 +- deps/v8/src/x64/assembler-x64-inl.h | 10 + deps/v8/src/x64/assembler-x64.cc | 8 +- deps/v8/src/x64/assembler-x64.h | 1 + deps/v8/src/x64/code-stubs-x64.cc | 30 +- deps/v8/src/x64/deoptimizer-x64.cc | 48 +- deps/v8/src/x64/lithium-codegen-x64.cc | 187 ++-- deps/v8/src/x64/lithium-codegen-x64.h | 5 +- deps/v8/src/x64/lithium-x64.cc | 96 +- deps/v8/src/x64/lithium-x64.h | 42 +- deps/v8/src/x64/macro-assembler-x64.cc | 7 +- deps/v8/src/x64/stub-cache-x64.cc | 16 +- deps/v8/test/cctest/cctest.status | 3 - deps/v8/test/cctest/test-api.cc | 5 +- deps/v8/test/cctest/test-assembler-arm.cc | 9 + deps/v8/test/cctest/test-cpu-profiler.cc | 228 ++++ deps/v8/test/cctest/test-deoptimization.cc | 22 +- deps/v8/test/cctest/test-disasm-arm.cc | 5 + deps/v8/test/cctest/test-heap.cc | 40 +- deps/v8/test/cctest/test-log.cc | 2 + deps/v8/test/cctest/test-mark-compact.cc | 6 +- deps/v8/test/mjsunit/allocation-folding.js | 41 +- deps/v8/test/mjsunit/harmony/collections.js | 17 + deps/v8/test/mjsunit/harmony/dataview-accessors.js | 38 + deps/v8/test/mjsunit/mjsunit.status | 22 +- .../mjsunit/omit-constant-mapcheck.js} | 72 +- .../mjsunit/regress/regress-247688.js} | 70 +- .../test/mjsunit/regress/regress-crbug-263276.js | 46 + .../regress-prepare-break-while-recompile.js | 57 + deps/v8/test/mjsunit/stack-traces-gc.js | 119 -- .../webkit/fast/js/JSON-parse-reviver-expected.txt | 131 +++ deps/v8/test/webkit/fast/js/JSON-parse-reviver.js | 205 ++++ .../fast/js/Object-defineProperty-expected.txt | 176 +++ .../test/webkit/fast/js/Object-defineProperty.js | 239 ++++ .../js/Object-getOwnPropertyNames-expected.txt | 113 ++ .../webkit/fast/js/Object-getOwnPropertyNames.js | 135 +++ deps/v8/test/webkit/fast/js/arguments-expected.txt | 207 ++++ deps/v8/test/webkit/fast/js/arguments.js | 689 ++++++++++++ .../webkit/fast/js/array-bad-time-expected.txt | 1034 +++++++++++++++++ deps/v8/test/webkit/fast/js/array-bad-time.js | 55 + .../webkit/fast/js/array-float-delete-expected.txt | 33 + deps/v8/test/webkit/fast/js/array-float-delete.js | 32 + .../js/array-functions-non-arrays-expected.txt | 122 ++ .../webkit/fast/js/array-functions-non-arrays.js | 204 ++++ .../js/array-prototype-properties-expected.txt | 54 + .../webkit/fast/js/array-prototype-properties.js | 52 + .../webkit/fast/js/array-slow-put-expected.txt | 133 +++ deps/v8/test/webkit/fast/js/array-slow-put.js | 42 + .../array-tostring-ignore-separator-expected.txt | 33 + .../fast/js/array-tostring-ignore-separator.js | 32 + .../webkit/fast/js/basic-strict-mode-expected.txt | 237 ++++ deps/v8/test/webkit/fast/js/basic-strict-mode.js | 231 ++++ .../webkit/fast/js/caller-property-expected.txt | 51 + deps/v8/test/webkit/fast/js/caller-property.js | 85 ++ .../webkit/fast/js/date-big-setmonth-expected.txt | 33 + deps/v8/test/webkit/fast/js/date-big-setmonth.js | 30 + .../fast/js/date-negative-setmonth-expected.txt | 33 + .../test/webkit/fast/js/date-negative-setmonth.js | 30 + .../js/date-preserve-milliseconds-expected.txt | 38 + .../webkit/fast/js/date-preserve-milliseconds.js | 44 + .../webkit/fast/js/date-toisostring-expected.txt | 43 + deps/v8/test/webkit/fast/js/date-toisostring.js | 47 + .../fast/js/end-in-string-escape-expected.txt | 33 + .../v8/test/webkit/fast/js/end-in-string-escape.js | 31 + .../fast/js/exception-properties-expected.txt | 36 + .../v8/test/webkit/fast/js/exception-properties.js | 46 + .../js/exception-registerfile-shrink-expected.txt | 32 + .../fast/js/exception-registerfile-shrink.js | 31 + .../fast/js/excessive-comma-usage-expected.txt | 35 + .../test/webkit/fast/js/excessive-comma-usage.js | 43 + .../webkit/fast/js/function-apply-expected.txt | 66 ++ deps/v8/test/webkit/fast/js/function-apply.js | 318 ++++++ .../js/function-constructor-error-expected.txt | 34 + .../webkit/fast/js/function-constructor-error.js | 29 + .../js/function-toString-parentheses-expected.txt | 525 +++++++++ .../fast/js/function-toString-parentheses.js | 234 ++++ ...ction-toString-semicolon-insertion-expected.txt | 40 + .../js/function-toString-semicolon-insertion.js | 33 + .../fast/js/modify-non-references-expected.txt | 39 + .../test/webkit/fast/js/modify-non-references.js | 35 + .../fast/js/native-error-prototype-expected.txt | 37 + .../test/webkit/fast/js/native-error-prototype.js | 39 + .../webkit/fast/js/number-toString-expected.txt | 84 ++ deps/v8/test/webkit/fast/js/number-toString.js | 93 ++ .../webkit/fast/js/number-tofixed-expected.txt | 84 ++ deps/v8/test/webkit/fast/js/number-tofixed.js | 102 ++ .../webkit/fast/js/number-toprecision-expected.txt | 61 + deps/v8/test/webkit/fast/js/number-toprecision.js | 65 ++ ...numeric-escapes-in-string-literals-expected.txt | 68 ++ .../fast/js/numeric-escapes-in-string-literals.js | 69 ++ .../webkit/fast/js/object-bad-time-expected.txt | 1034 +++++++++++++++++ deps/v8/test/webkit/fast/js/object-bad-time.js | 58 + .../webkit/fast/js/object-extra-comma-expected.txt | 37 + deps/v8/test/webkit/fast/js/object-extra-comma.js | 33 + .../js/object-prototype-constructor-expected.txt | 38 + .../webkit/fast/js/object-prototype-constructor.js | 42 + .../js/object-prototype-properties-expected.txt | 39 + .../webkit/fast/js/object-prototype-properties.js | 37 + .../object-prototype-toLocaleString-expected.txt | 36 + .../fast/js/object-prototype-toLocaleString.js | 38 + .../webkit/fast/js/object-slow-put-expected.txt | 133 +++ deps/v8/test/webkit/fast/js/object-slow-put.js | 45 + .../fast/js/parser-syntax-check-expected.txt | 611 ++++++++++ deps/v8/test/webkit/fast/js/parser-syntax-check.js | 403 +++++++ ...imitive-property-access-edge-cases-expected.txt | 81 ++ .../js/primitive-property-access-edge-cases.js | 238 ++++ .../webkit/fast/js/read-modify-eval-expected.txt | 49 + deps/v8/test/webkit/fast/js/read-modify-eval.js | 169 +++ .../v8/test/webkit/fast/js/regexp-bol-expected.txt | 53 + .../fast/js/regexp-bol-with-multiline-expected.txt | 37 + .../webkit/fast/js/regexp-bol-with-multiline.js | 33 + deps/v8/test/webkit/fast/js/regexp-bol.js | 49 + .../regexp-extended-characters-crash-expected.txt | 37 + .../fast/js/regexp-extended-characters-crash.js | 36 + .../webkit/fast/js/regexp-lastindex-expected.txt | 34 + deps/v8/test/webkit/fast/js/regexp-lastindex.js | 35 + .../webkit/fast/js/regexp-look-ahead-expected.txt | 34 + deps/v8/test/webkit/fast/js/regexp-look-ahead.js | 29 + .../fast/js/regexp-no-extensions-expected.txt | 69 ++ .../v8/test/webkit/fast/js/regexp-no-extensions.js | 69 ++ .../js/regexp-non-capturing-groups-expected.txt | 46 + .../webkit/fast/js/regexp-non-capturing-groups.js | 42 + .../js/regexp-non-greedy-parentheses-expected.txt | 40 + .../fast/js/regexp-non-greedy-parentheses.js | 35 + .../fast/js/regexp-range-out-of-order-expected.txt | 33 + .../webkit/fast/js/regexp-range-out-of-order.js | 30 + .../regexp-ranges-and-escaped-hyphens-expected.txt | 49 + .../fast/js/regexp-ranges-and-escaped-hyphens.js | 75 ++ .../fast/js/regexp-stack-overflow-expected.txt | 33 + .../test/webkit/fast/js/regexp-stack-overflow.js | 34 + .../fast/js/regexp-unicode-handling-expected.txt | 72 ++ .../test/webkit/fast/js/regexp-unicode-handling.js | 128 +++ .../fast/js/reserved-words-strict-expected.txt | 61 + .../test/webkit/fast/js/reserved-words-strict.js | 88 ++ .../js/stack-overflow-arrity-catch-expected.txt | 35 + .../webkit/fast/js/stack-overflow-arrity-catch.js | 81 ++ .../fast/js/string-capitalization-expected.txt | 53 + .../test/webkit/fast/js/string-capitalization.js | 95 ++ .../fast/js/string-split-conformance-expected.txt | 90 ++ .../webkit/fast/js/string-split-conformance.js | 96 ++ .../fast/js/string-split-double-empty-expected.txt | 34 + .../webkit/fast/js/string-split-double-empty.js | 29 + .../fast/js/string-split-ignore-case-expected.txt | 33 + .../webkit/fast/js/string-split-ignore-case.js | 28 + .../webkit/fast/js/toString-exception-expected.txt | 33 + deps/v8/test/webkit/fast/js/toString-exception.js | 43 + .../webkit/fast/js/toString-overrides-expected.txt | 39 + deps/v8/test/webkit/fast/js/toString-overrides.js | 65 ++ .../alternative-length-miscalculation-expected.txt | 34 + .../regex/alternative-length-miscalculation.js | 33 + .../test/webkit/fast/regex/assertion-expected.txt | 69 ++ deps/v8/test/webkit/fast/regex/assertion.js | 110 ++ .../webkit/fast/regex/constructor-expected.txt | 36 + deps/v8/test/webkit/fast/regex/constructor.js | 32 + .../v8/test/webkit/fast/regex/dotstar-expected.txt | 141 +++ deps/v8/test/webkit/fast/regex/dotstar.js | 160 +++ .../webkit/fast/regex/early-acid3-86-expected.txt | 35 + deps/v8/test/webkit/fast/regex/early-acid3-86.js | 33 + .../fast/regex/ecma-regex-examples-expected.txt | 44 + .../test/webkit/fast/regex/ecma-regex-examples.js | 62 ++ .../fast/regex/invalid-range-in-class-expected.txt | 43 + .../webkit/fast/regex/invalid-range-in-class.js | 50 + .../test/webkit/fast/regex/lastIndex-expected.txt | 53 + deps/v8/test/webkit/fast/regex/lastIndex.js | 71 ++ .../fast/regex/malformed-escapes-expected.txt | 65 ++ .../v8/test/webkit/fast/regex/malformed-escapes.js | 70 ++ .../regex/non-capturing-backtracking-expected.txt | 33 + .../fast/regex/non-capturing-backtracking.js | 29 + .../test/webkit/fast/regex/overflow-expected.txt | 36 + deps/v8/test/webkit/fast/regex/overflow.js | 36 + .../webkit/fast/regex/parentheses-expected.txt | 124 +++ deps/v8/test/webkit/fast/regex/parentheses.js | 277 +++++ .../webkit/fast/regex/pcre-test-4-expected.txt | 275 +++++ deps/v8/test/webkit/fast/regex/pcre-test-4.js | 1169 ++++++++++++++++++++ .../fast/regex/quantified-assertions-expected.txt | 49 + .../webkit/fast/regex/quantified-assertions.js | 50 + .../fast/regex/repeat-match-waldemar-expected.txt | 53 + .../webkit/fast/regex/repeat-match-waldemar.js | 54 + .../test/webkit/fast/regex/toString-expected.txt | 60 + deps/v8/test/webkit/fast/regex/toString.js | 87 ++ .../fast/regex/unicodeCaseInsensitive-expected.txt | 349 ++++++ .../webkit/fast/regex/unicodeCaseInsensitive.js | 101 ++ deps/v8/test/webkit/resources/standalone-pre.js | 13 +- deps/v8/tools/blink_tests/TestExpectations | 3 + deps/v8/tools/gyp/v8.gyp | 5 +- deps/v8/tools/run-deopt-fuzzer.py | 467 ++++++++ deps/v8/tools/run-tests.py | 3 +- 310 files changed, 21550 insertions(+), 3932 deletions(-) create mode 100644 deps/v8/src/hydrogen-bch.cc rename deps/v8/src/{platform-tls.h => hydrogen-bch.h} (70%) rename deps/v8/{src/platform-tls-win32.h => test/mjsunit/omit-constant-mapcheck.js} (59%) rename deps/v8/{src/platform-tls-mac.h => test/mjsunit/regress/regress-247688.js} (66%) create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-263276.js create mode 100644 deps/v8/test/mjsunit/regress/regress-prepare-break-while-recompile.js delete mode 100644 deps/v8/test/mjsunit/stack-traces-gc.js create mode 100644 deps/v8/test/webkit/fast/js/JSON-parse-reviver-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/JSON-parse-reviver.js create mode 100644 deps/v8/test/webkit/fast/js/Object-defineProperty-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Object-defineProperty.js create mode 100644 deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames.js create mode 100644 deps/v8/test/webkit/fast/js/arguments-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/arguments.js create mode 100644 deps/v8/test/webkit/fast/js/array-bad-time-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/array-bad-time.js create mode 100644 deps/v8/test/webkit/fast/js/array-float-delete-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/array-float-delete.js create mode 100644 deps/v8/test/webkit/fast/js/array-functions-non-arrays-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/array-functions-non-arrays.js create mode 100644 deps/v8/test/webkit/fast/js/array-prototype-properties-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/array-prototype-properties.js create mode 100644 deps/v8/test/webkit/fast/js/array-slow-put-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/array-slow-put.js create mode 100644 deps/v8/test/webkit/fast/js/array-tostring-ignore-separator-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/array-tostring-ignore-separator.js create mode 100644 deps/v8/test/webkit/fast/js/basic-strict-mode-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/basic-strict-mode.js create mode 100644 deps/v8/test/webkit/fast/js/caller-property-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/caller-property.js create mode 100644 deps/v8/test/webkit/fast/js/date-big-setmonth-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/date-big-setmonth.js create mode 100644 deps/v8/test/webkit/fast/js/date-negative-setmonth-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/date-negative-setmonth.js create mode 100644 deps/v8/test/webkit/fast/js/date-preserve-milliseconds-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/date-preserve-milliseconds.js create mode 100644 deps/v8/test/webkit/fast/js/date-toisostring-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/date-toisostring.js create mode 100644 deps/v8/test/webkit/fast/js/end-in-string-escape-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/end-in-string-escape.js create mode 100644 deps/v8/test/webkit/fast/js/exception-properties-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/exception-properties.js create mode 100644 deps/v8/test/webkit/fast/js/exception-registerfile-shrink-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/exception-registerfile-shrink.js create mode 100644 deps/v8/test/webkit/fast/js/excessive-comma-usage-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/excessive-comma-usage.js create mode 100644 deps/v8/test/webkit/fast/js/function-apply-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/function-apply.js create mode 100644 deps/v8/test/webkit/fast/js/function-constructor-error-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/function-constructor-error.js create mode 100644 deps/v8/test/webkit/fast/js/function-toString-parentheses-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/function-toString-parentheses.js create mode 100644 deps/v8/test/webkit/fast/js/function-toString-semicolon-insertion-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/function-toString-semicolon-insertion.js create mode 100644 deps/v8/test/webkit/fast/js/modify-non-references-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/modify-non-references.js create mode 100644 deps/v8/test/webkit/fast/js/native-error-prototype-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/native-error-prototype.js create mode 100644 deps/v8/test/webkit/fast/js/number-toString-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/number-toString.js create mode 100644 deps/v8/test/webkit/fast/js/number-tofixed-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/number-tofixed.js create mode 100644 deps/v8/test/webkit/fast/js/number-toprecision-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/number-toprecision.js create mode 100644 deps/v8/test/webkit/fast/js/numeric-escapes-in-string-literals-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/numeric-escapes-in-string-literals.js create mode 100644 deps/v8/test/webkit/fast/js/object-bad-time-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/object-bad-time.js create mode 100644 deps/v8/test/webkit/fast/js/object-extra-comma-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/object-extra-comma.js create mode 100644 deps/v8/test/webkit/fast/js/object-prototype-constructor-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/object-prototype-constructor.js create mode 100644 deps/v8/test/webkit/fast/js/object-prototype-properties-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/object-prototype-properties.js create mode 100644 deps/v8/test/webkit/fast/js/object-prototype-toLocaleString-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/object-prototype-toLocaleString.js create mode 100644 deps/v8/test/webkit/fast/js/object-slow-put-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/object-slow-put.js create mode 100644 deps/v8/test/webkit/fast/js/parser-syntax-check-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/parser-syntax-check.js create mode 100644 deps/v8/test/webkit/fast/js/primitive-property-access-edge-cases-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/primitive-property-access-edge-cases.js create mode 100644 deps/v8/test/webkit/fast/js/read-modify-eval-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/read-modify-eval.js create mode 100644 deps/v8/test/webkit/fast/js/regexp-bol-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/regexp-bol-with-multiline-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/regexp-bol-with-multiline.js create mode 100644 deps/v8/test/webkit/fast/js/regexp-bol.js create mode 100644 deps/v8/test/webkit/fast/js/regexp-extended-characters-crash-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/regexp-extended-characters-crash.js create mode 100644 deps/v8/test/webkit/fast/js/regexp-lastindex-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/regexp-lastindex.js create mode 100644 deps/v8/test/webkit/fast/js/regexp-look-ahead-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/regexp-look-ahead.js create mode 100644 deps/v8/test/webkit/fast/js/regexp-no-extensions-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/regexp-no-extensions.js create mode 100644 deps/v8/test/webkit/fast/js/regexp-non-capturing-groups-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/regexp-non-capturing-groups.js create mode 100644 deps/v8/test/webkit/fast/js/regexp-non-greedy-parentheses-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/regexp-non-greedy-parentheses.js create mode 100644 deps/v8/test/webkit/fast/js/regexp-range-out-of-order-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/regexp-range-out-of-order.js create mode 100644 deps/v8/test/webkit/fast/js/regexp-ranges-and-escaped-hyphens-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/regexp-ranges-and-escaped-hyphens.js create mode 100644 deps/v8/test/webkit/fast/js/regexp-stack-overflow-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/regexp-stack-overflow.js create mode 100644 deps/v8/test/webkit/fast/js/regexp-unicode-handling-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/regexp-unicode-handling.js create mode 100644 deps/v8/test/webkit/fast/js/reserved-words-strict-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/reserved-words-strict.js create mode 100644 deps/v8/test/webkit/fast/js/stack-overflow-arrity-catch-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/stack-overflow-arrity-catch.js create mode 100644 deps/v8/test/webkit/fast/js/string-capitalization-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/string-capitalization.js create mode 100644 deps/v8/test/webkit/fast/js/string-split-conformance-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/string-split-conformance.js create mode 100644 deps/v8/test/webkit/fast/js/string-split-double-empty-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/string-split-double-empty.js create mode 100644 deps/v8/test/webkit/fast/js/string-split-ignore-case-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/string-split-ignore-case.js create mode 100644 deps/v8/test/webkit/fast/js/toString-exception-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/toString-exception.js create mode 100644 deps/v8/test/webkit/fast/js/toString-overrides-expected.txt create mode 100644 deps/v8/test/webkit/fast/js/toString-overrides.js create mode 100644 deps/v8/test/webkit/fast/regex/alternative-length-miscalculation-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/alternative-length-miscalculation.js create mode 100644 deps/v8/test/webkit/fast/regex/assertion-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/assertion.js create mode 100644 deps/v8/test/webkit/fast/regex/constructor-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/constructor.js create mode 100644 deps/v8/test/webkit/fast/regex/dotstar-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/dotstar.js create mode 100644 deps/v8/test/webkit/fast/regex/early-acid3-86-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/early-acid3-86.js create mode 100644 deps/v8/test/webkit/fast/regex/ecma-regex-examples-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/ecma-regex-examples.js create mode 100644 deps/v8/test/webkit/fast/regex/invalid-range-in-class-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/invalid-range-in-class.js create mode 100644 deps/v8/test/webkit/fast/regex/lastIndex-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/lastIndex.js create mode 100644 deps/v8/test/webkit/fast/regex/malformed-escapes-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/malformed-escapes.js create mode 100644 deps/v8/test/webkit/fast/regex/non-capturing-backtracking-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/non-capturing-backtracking.js create mode 100644 deps/v8/test/webkit/fast/regex/overflow-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/overflow.js create mode 100644 deps/v8/test/webkit/fast/regex/parentheses-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/parentheses.js create mode 100644 deps/v8/test/webkit/fast/regex/pcre-test-4-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/pcre-test-4.js create mode 100644 deps/v8/test/webkit/fast/regex/quantified-assertions-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/quantified-assertions.js create mode 100644 deps/v8/test/webkit/fast/regex/repeat-match-waldemar-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/repeat-match-waldemar.js create mode 100644 deps/v8/test/webkit/fast/regex/toString-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/toString.js create mode 100644 deps/v8/test/webkit/fast/regex/unicodeCaseInsensitive-expected.txt create mode 100644 deps/v8/test/webkit/fast/regex/unicodeCaseInsensitive.js create mode 100755 deps/v8/tools/run-deopt-fuzzer.py diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index 656c4b3..a4c486f 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -9,11 +9,14 @@ *.pdb *.pyc *.scons* +*.sdf *.sln *.so *.suo *.user *.vcproj +*.vcxproj +*.vcxproj.filters *.xcodeproj #*# *~ @@ -26,6 +29,7 @@ shell shell_g /build/Debug /build/gyp +/build/ipch/ /build/Release /obj /out diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index e05d039..7d00fb7 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,22 @@ +2013-07-26: Version 3.20.9 + + Check that ExternalString objects get aligned resources. + + Fixed JSArray-specific length lookup in polymorphic array handling + (Chromium issues 263276, 263905). + + Performance and stability improvements on all platforms. + + +2013-07-24: Version 3.20.8 + + Deprecated v8::V8::Pause/ResumeProfiler. + + Fixed Chromium issues 247688, 258519 and 260203. + + Performance and stability improvements on all platforms. + + 2013-07-22: Version 3.20.7 Deprecated some debugger methods. diff --git a/deps/v8/DEPS b/deps/v8/DEPS index ccbaccb..da87853 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -8,7 +8,7 @@ deps = { "http://gyp.googlecode.com/svn/trunk@1656", "v8/third_party/icu": - "https://src.chromium.org/chrome/trunk/deps/third_party/icu46@210659", + "https://src.chromium.org/chrome/trunk/deps/third_party/icu46@213354", } deps_os = { diff --git a/deps/v8/Makefile b/deps/v8/Makefile index 1b0b7f4..a749fd0 100644 --- a/deps/v8/Makefile +++ b/deps/v8/Makefile @@ -408,4 +408,4 @@ dependencies: --revision 1656 svn checkout --force \ https://src.chromium.org/chrome/trunk/deps/third_party/icu46 \ - third_party/icu --revision 210659 + third_party/icu --revision 213354 diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 9ce0583..3607740 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -4545,18 +4545,18 @@ class V8EXPORT V8 { * See also the --prof and --prof_auto command line switches to * enable V8 profiling. */ - static void PauseProfiler(); + V8_DEPRECATED(static void PauseProfiler()); /** * Resumes recording of tick samples in the profiler. * See also PauseProfiler(). */ - static void ResumeProfiler(); + V8_DEPRECATED(static void ResumeProfiler()); /** * Return whether profiler is currently paused. */ - static bool IsProfilerPaused(); + V8_DEPRECATED(static bool IsProfilerPaused()); /** * Retrieve the V8 thread id of the calling thread. @@ -5399,7 +5399,7 @@ class Internals { static const int kNullValueRootIndex = 7; static const int kTrueValueRootIndex = 8; static const int kFalseValueRootIndex = 9; - static const int kEmptyStringRootIndex = 132; + static const int kEmptyStringRootIndex = 134; static const int kNodeClassIdOffset = 1 * kApiPointerSize; static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3; @@ -5412,7 +5412,7 @@ class Internals { static const int kJSObjectType = 0xb1; static const int kFirstNonstringType = 0x80; static const int kOddballType = 0x83; - static const int kForeignType = 0x88; + static const int kForeignType = 0x87; static const int kUndefinedOddballKind = 5; static const int kNullOddballKind = 3; diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index c93b23c..91174d6 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -770,7 +770,6 @@ void Context::Exit() { i::Context* last_context = isolate->handle_scope_implementer()->RestoreContext(); isolate->set_context(last_context); - isolate->set_context_exit_happened(true); } @@ -780,8 +779,8 @@ static void* DecodeSmiToAligned(i::Object* value, const char* location) { } -static i::Smi* EncodeAlignedAsSmi(void* value, const char* location) { - i::Smi* smi = reinterpret_cast(value); +static i::Smi* EncodeAlignedAsSmi(const void* value, const char* location) { + i::Smi* smi = const_cast(reinterpret_cast(value)); ApiCheck(smi->IsSmi(), location, "Pointer is not aligned"); return smi; } @@ -5938,6 +5937,10 @@ Local v8::String::NewExternal( LOG_API(isolate, "String::NewExternal"); ENTER_V8(isolate); CHECK(resource && resource->data()); + // Resource pointers need to look like Smis since ExternalString objects + // are sometimes put into old pointer space (see i::String::MakeExternal). + CHECK(EncodeAlignedAsSmi(resource, "v8::String::NewExternal()")); + CHECK(EncodeAlignedAsSmi(resource->data(), "v8::String::NewExternal()")); i::Handle result = NewExternalStringHandle(isolate, resource); isolate->heap()->external_string_table()->AddString(*result); return Utils::ToLocal(result); @@ -5959,6 +5962,10 @@ bool v8::String::MakeExternal(v8::String::ExternalStringResource* resource) { return false; } CHECK(resource && resource->data()); + // Resource pointers need to look like Smis since ExternalString objects + // are sometimes put into old pointer space (see i::String::MakeExternal). + CHECK(EncodeAlignedAsSmi(resource, "v8::String::MakeExternal()")); + CHECK(EncodeAlignedAsSmi(resource->data(), "v8::String::MakeExternal()")); bool result = obj->MakeExternal(resource); if (result && !obj->IsInternalizedString()) { isolate->heap()->external_string_table()->AddString(*obj); @@ -5974,6 +5981,10 @@ Local v8::String::NewExternal( LOG_API(isolate, "String::NewExternal"); ENTER_V8(isolate); CHECK(resource && resource->data()); + // Resource pointers need to look like Smis since ExternalString objects + // are sometimes put into old pointer space (see i::String::MakeExternal). + CHECK(EncodeAlignedAsSmi(resource, "v8::String::NewExternal()")); + CHECK(EncodeAlignedAsSmi(resource->data(), "v8::String::NewExternal()")); i::Handle result = NewExternalAsciiStringHandle(isolate, resource); isolate->heap()->external_string_table()->AddString(*result); return Utils::ToLocal(result); @@ -5996,6 +6007,10 @@ bool v8::String::MakeExternal( return false; } CHECK(resource && resource->data()); + // Resource pointers need to look like Smis since ExternalString objects + // are sometimes put into old pointer space (see i::String::MakeExternal). + CHECK(EncodeAlignedAsSmi(resource, "v8::String::MakeExternal()")); + CHECK(EncodeAlignedAsSmi(resource->data(), "v8::String::MakeExternal()")); bool result = obj->MakeExternal(resource); if (result && !obj->IsInternalizedString()) { isolate->heap()->external_string_table()->AddString(*obj); diff --git a/deps/v8/src/arm/assembler-arm.cc b/deps/v8/src/arm/assembler-arm.cc index d95946e..ba0dc4b 100644 --- a/deps/v8/src/arm/assembler-arm.cc +++ b/deps/v8/src/arm/assembler-arm.cc @@ -2373,15 +2373,16 @@ void Assembler::vmov(const DwVfpRegister dst, if (scratch.is(no_reg)) { if (dst.code() < 16) { + const LowDwVfpRegister loc = LowDwVfpRegister::from_code(dst.code()); // Move the low part of the double into the lower of the corresponsing S // registers of D register dst. mov(ip, Operand(lo)); - vmov(dst.low(), ip); + vmov(loc.low(), ip); // Move the high part of the double into the higher of the // corresponsing S registers of D register dst. mov(ip, Operand(hi)); - vmov(dst.high(), ip); + vmov(loc.high(), ip); } else { // D16-D31 does not have S registers, so move the low and high parts // directly to the D register using vmov.32. @@ -2446,6 +2447,22 @@ void Assembler::vmov(const DwVfpRegister dst, } +void Assembler::vmov(const Register dst, + const VmovIndex index, + const DwVfpRegister src, + const Condition cond) { + // Dd[index] = Rt + // Instruction details available in ARM DDI 0406C.b, A8.8.342. + // cond(31-28) | 1110(27-24) | U=0(23) | opc1=0index(22-21) | 1(20) | + // Vn(19-16) | Rt(15-12) | 1011(11-8) | N(7) | opc2=00(6-5) | 1(4) | 0000(3-0) + ASSERT(index.index == 0 || index.index == 1); + int vn, n; + src.split_code(&vn, &n); + emit(cond | 0xE*B24 | index.index*B21 | B20 | vn*B16 | dst.code()*B12 | + 0xB*B8 | n*B7 | B4); +} + + void Assembler::vmov(const DwVfpRegister dst, const Register src1, const Register src2, diff --git a/deps/v8/src/arm/assembler-arm.h b/deps/v8/src/arm/assembler-arm.h index 62dd94c..496eb3e 100644 --- a/deps/v8/src/arm/assembler-arm.h +++ b/deps/v8/src/arm/assembler-arm.h @@ -267,22 +267,6 @@ struct DwVfpRegister { return 0 <= code_ && code_ < kMaxNumRegisters; } bool is(DwVfpRegister reg) const { return code_ == reg.code_; } - SwVfpRegister low() const { - ASSERT(code_ < 16); - SwVfpRegister reg; - reg.code_ = code_ * 2; - - ASSERT(reg.is_valid()); - return reg; - } - SwVfpRegister high() const { - ASSERT(code_ < 16); - SwVfpRegister reg; - reg.code_ = (code_ * 2) + 1; - - ASSERT(reg.is_valid()); - return reg; - } int code() const { ASSERT(is_valid()); return code_; @@ -304,6 +288,47 @@ struct DwVfpRegister { typedef DwVfpRegister DoubleRegister; +// Double word VFP register d0-15. +struct LowDwVfpRegister { + public: + static const int kMaxNumLowRegisters = 16; + operator DwVfpRegister() const { + DwVfpRegister r = { code_ }; + return r; + } + static LowDwVfpRegister from_code(int code) { + LowDwVfpRegister r = { code }; + return r; + } + + bool is_valid() const { + return 0 <= code_ && code_ < kMaxNumLowRegisters; + } + bool is(DwVfpRegister reg) const { return code_ == reg.code_; } + bool is(LowDwVfpRegister reg) const { return code_ == reg.code_; } + int code() const { + ASSERT(is_valid()); + return code_; + } + SwVfpRegister low() const { + SwVfpRegister reg; + reg.code_ = code_ * 2; + + ASSERT(reg.is_valid()); + return reg; + } + SwVfpRegister high() const { + SwVfpRegister reg; + reg.code_ = (code_ * 2) + 1; + + ASSERT(reg.is_valid()); + return reg; + } + + int code_; +}; + + // Quad word NEON register. struct QwNeonRegister { static const int kMaxNumRegisters = 16; @@ -370,22 +395,22 @@ const SwVfpRegister s30 = { 30 }; const SwVfpRegister s31 = { 31 }; const DwVfpRegister no_dreg = { -1 }; -const DwVfpRegister d0 = { 0 }; -const DwVfpRegister d1 = { 1 }; -const DwVfpRegister d2 = { 2 }; -const DwVfpRegister d3 = { 3 }; -const DwVfpRegister d4 = { 4 }; -const DwVfpRegister d5 = { 5 }; -const DwVfpRegister d6 = { 6 }; -const DwVfpRegister d7 = { 7 }; -const DwVfpRegister d8 = { 8 }; -const DwVfpRegister d9 = { 9 }; -const DwVfpRegister d10 = { 10 }; -const DwVfpRegister d11 = { 11 }; -const DwVfpRegister d12 = { 12 }; -const DwVfpRegister d13 = { 13 }; -const DwVfpRegister d14 = { 14 }; -const DwVfpRegister d15 = { 15 }; +const LowDwVfpRegister d0 = { 0 }; +const LowDwVfpRegister d1 = { 1 }; +const LowDwVfpRegister d2 = { 2 }; +const LowDwVfpRegister d3 = { 3 }; +const LowDwVfpRegister d4 = { 4 }; +const LowDwVfpRegister d5 = { 5 }; +const LowDwVfpRegister d6 = { 6 }; +const LowDwVfpRegister d7 = { 7 }; +const LowDwVfpRegister d8 = { 8 }; +const LowDwVfpRegister d9 = { 9 }; +const LowDwVfpRegister d10 = { 10 }; +const LowDwVfpRegister d11 = { 11 }; +const LowDwVfpRegister d12 = { 12 }; +const LowDwVfpRegister d13 = { 13 }; +const LowDwVfpRegister d14 = { 14 }; +const LowDwVfpRegister d15 = { 15 }; const DwVfpRegister d16 = { 16 }; const DwVfpRegister d17 = { 17 }; const DwVfpRegister d18 = { 18 }; @@ -420,6 +445,7 @@ const QwNeonRegister q13 = { 13 }; const QwNeonRegister q14 = { 14 }; const QwNeonRegister q15 = { 15 }; + // Aliases for double registers. Defined using #define instead of // "static const DwVfpRegister&" because Clang complains otherwise when a // compilation unit that includes this header doesn't use the variables. @@ -1109,6 +1135,10 @@ class Assembler : public AssemblerBase { const VmovIndex index, const Register src, const Condition cond = al); + void vmov(const Register dst, + const VmovIndex index, + const DwVfpRegister src, + const Condition cond = al); void vmov(const DwVfpRegister dst, const Register src1, const Register src2, diff --git a/deps/v8/src/arm/code-stubs-arm.cc b/deps/v8/src/arm/code-stubs-arm.cc index 7773667..ba98b96 100644 --- a/deps/v8/src/arm/code-stubs-arm.cc +++ b/deps/v8/src/arm/code-stubs-arm.cc @@ -38,6 +38,16 @@ namespace v8 { namespace internal { +void ToNumberStub::InitializeInterfaceDescriptor( + Isolate* isolate, + CodeStubInterfaceDescriptor* descriptor) { + static Register registers[] = { r0 }; + descriptor->register_param_count_ = 1; + descriptor->register_params_ = registers; + descriptor->deoptimization_handler_ = NULL; +} + + void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( Isolate* isolate, CodeStubInterfaceDescriptor* descriptor) { @@ -286,17 +296,6 @@ static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm, Register rhs); -// Check if the operand is a heap number. -static void EmitCheckForHeapNumber(MacroAssembler* masm, Register operand, - Register scratch1, Register scratch2, - Label* not_a_heap_number) { - __ ldr(scratch1, FieldMemOperand(operand, HeapObject::kMapOffset)); - __ LoadRoot(scratch2, Heap::kHeapNumberMapRootIndex); - __ cmp(scratch1, scratch2); - __ b(ne, not_a_heap_number); -} - - void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { // Update the static counter each time a new code stub is generated. Isolate* isolate = masm->isolate(); @@ -321,22 +320,6 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { } -void ToNumberStub::Generate(MacroAssembler* masm) { - // The ToNumber stub takes one argument in eax. - Label check_heap_number, call_builtin; - __ JumpIfNotSmi(r0, &check_heap_number); - __ Ret(); - - __ bind(&check_heap_number); - EmitCheckForHeapNumber(masm, r0, r1, ip, &call_builtin); - __ Ret(); - - __ bind(&call_builtin); - __ push(r0); - __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION); -} - - void FastNewClosureStub::Generate(MacroAssembler* masm) { // Create a new closure from the given function info in new // space. Set the context to the current context in cp. @@ -1914,7 +1897,7 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { Register right = r0; Register scratch1 = r7; Register scratch2 = r9; - DwVfpRegister double_scratch = d0; + LowDwVfpRegister double_scratch = d0; Register heap_number_result = no_reg; Register heap_number_map = r6; @@ -1989,7 +1972,7 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { Label not_zero; ASSERT(kSmiTag == 0); __ b(ne, ¬_zero); - __ vmov(scratch2, d5.high()); + __ VmovHigh(scratch2, d5); __ tst(scratch2, Operand(HeapNumber::kSignMask)); __ b(ne, &transition); __ bind(¬_zero); @@ -3834,7 +3817,7 @@ void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) { Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX))); // Copy the JS object part. - __ CopyFields(r0, r4, d0, s0, JSObject::kHeaderSize / kPointerSize); + __ CopyFields(r0, r4, d0, JSObject::kHeaderSize / kPointerSize); // Get the length (smi tagged) and set that as an in-object property too. STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0); @@ -6821,7 +6804,7 @@ void StoreArrayLiteralElementStub::Generate(MacroAssembler* masm) { // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. __ bind(&double_elements); __ ldr(r5, FieldMemOperand(r1, JSObject::kElementsOffset)); - __ StoreNumberToDoubleElements(r0, r3, r5, r6, &slow_elements); + __ StoreNumberToDoubleElements(r0, r3, r5, r6, d0, &slow_elements); __ Ret(); } diff --git a/deps/v8/src/arm/deoptimizer-arm.cc b/deps/v8/src/arm/deoptimizer-arm.cc index 780bafb..5b42116 100644 --- a/deps/v8/src/arm/deoptimizer-arm.cc +++ b/deps/v8/src/arm/deoptimizer-arm.cc @@ -44,22 +44,8 @@ int Deoptimizer::patch_size() { } -void Deoptimizer::DeoptimizeFunctionWithPreparedFunctionList( - JSFunction* function) { - Isolate* isolate = function->GetIsolate(); - HandleScope scope(isolate); - DisallowHeapAllocation no_allocation; - - ASSERT(function->IsOptimized()); - ASSERT(function->FunctionsInFunctionListShareSameCode()); - - // Get the optimized code. - Code* code = function->code(); +void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) { Address code_start_address = code->instruction_start(); - - // The optimized code is going to be patched, so we cannot use it any more. - function->shared()->EvictFromOptimizedCodeMap(code, "deoptimized function"); - // Invalidate the relocation information, as it will become invalid by the // code patching below, and is not needed any more. code->InvalidateRelocation(); @@ -92,25 +78,6 @@ void Deoptimizer::DeoptimizeFunctionWithPreparedFunctionList( prev_call_address = call_address; #endif } - - // Add the deoptimizing code to the list. - DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code); - DeoptimizerData* data = isolate->deoptimizer_data(); - node->set_next(data->deoptimizing_code_list_); - data->deoptimizing_code_list_ = node; - - // We might be in the middle of incremental marking with compaction. - // Tell collector to treat this code object in a special way and - // ignore all slots that might have been recorded on it. - isolate->heap()->mark_compact_collector()->InvalidateCode(code); - - ReplaceCodeForRelatedFunctions(function, code); - - if (FLAG_trace_deopt) { - PrintF("[forced deoptimization: "); - function->PrintName(); - PrintF(" / %x]\n", reinterpret_cast(function)); - } } @@ -635,6 +602,17 @@ void Deoptimizer::TableEntryGenerator::GeneratePrologue() { __ bind(&done); } + +void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) { + SetFrameSlot(offset, value); +} + + +void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) { + SetFrameSlot(offset, value); +} + + #undef __ } } // namespace v8::internal diff --git a/deps/v8/src/arm/disasm-arm.cc b/deps/v8/src/arm/disasm-arm.cc index fd986fd..ecdf638 100644 --- a/deps/v8/src/arm/disasm-arm.cc +++ b/deps/v8/src/arm/disasm-arm.cc @@ -1345,6 +1345,14 @@ void Decoder::DecodeTypeVFP(Instruction* instr) { } else { Format(instr, "vmov'cond.32 'Dd[1], 'rt"); } + } else if ((instr->VLValue() == 0x1) && + (instr->VCValue() == 0x1) && + (instr->Bit(23) == 0x0)) { + if (instr->Bit(21) == 0x0) { + Format(instr, "vmov'cond.32 'rt, 'Dd[0]"); + } else { + Format(instr, "vmov'cond.32 'rt, 'Dd[1]"); + } } else if ((instr->VCValue() == 0x0) && (instr->VAValue() == 0x7) && (instr->Bits(19, 16) == 0x1)) { diff --git a/deps/v8/src/arm/full-codegen-arm.cc b/deps/v8/src/arm/full-codegen-arm.cc index 6a5845d..ea7b73f 100644 --- a/deps/v8/src/arm/full-codegen-arm.cc +++ b/deps/v8/src/arm/full-codegen-arm.cc @@ -1623,7 +1623,7 @@ void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { // r0: Newly allocated regexp. // r5: Materialized regexp. // r2: temp. - __ CopyFields(r0, r5, d0, s0, size / kPointerSize); + __ CopyFields(r0, r5, d0, size / kPointerSize); context()->Plug(r0); } diff --git a/deps/v8/src/arm/ic-arm.cc b/deps/v8/src/arm/ic-arm.cc index ee28d28..f43846c 100644 --- a/deps/v8/src/arm/ic-arm.cc +++ b/deps/v8/src/arm/ic-arm.cc @@ -1361,7 +1361,7 @@ static void KeyedStoreGenerateGenericHelper( __ b(ne, slow); } __ bind(&fast_double_without_map_check); - __ StoreNumberToDoubleElements(value, key, elements, r3, + __ StoreNumberToDoubleElements(value, key, elements, r3, d0, &transition_double_elements); if (increment_length == kIncrementLength) { // Add 1 to receiver->length. diff --git a/deps/v8/src/arm/lithium-arm.cc b/deps/v8/src/arm/lithium-arm.cc index b68d22f..0000146 100644 --- a/deps/v8/src/arm/lithium-arm.cc +++ b/deps/v8/src/arm/lithium-arm.cc @@ -701,11 +701,6 @@ LInstruction* LChunkBuilder::DoEnvironmentMarker(HEnvironmentMarker* instr) { } -LInstruction* LChunkBuilder::DoSoftDeoptimize(HSoftDeoptimize* instr) { - return AssignEnvironment(new(zone()) LDeoptimize); -} - - LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) { return AssignEnvironment(new(zone()) LDeoptimize); } @@ -783,8 +778,8 @@ LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, op == Token::SUB); HValue* left = instr->left(); HValue* right = instr->right(); - ASSERT(left->representation().IsSmiOrTagged()); - ASSERT(right->representation().IsSmiOrTagged()); + ASSERT(left->representation().IsTagged()); + ASSERT(right->representation().IsTagged()); LOperand* left_operand = UseFixed(left, r1); LOperand* right_operand = UseFixed(right, r0); LArithmeticT* result = @@ -1318,17 +1313,17 @@ LInstruction* LChunkBuilder::DoShl(HShl* instr) { LInstruction* LChunkBuilder::DoBitwise(HBitwise* instr) { - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); return DefineAsRegister(new(zone()) LBitI(left, right)); } else { - ASSERT(instr->representation().IsSmiOrTagged()); - ASSERT(instr->left()->representation().IsSmiOrTagged()); - ASSERT(instr->right()->representation().IsSmiOrTagged()); + ASSERT(instr->representation().IsTagged()); + ASSERT(instr->left()->representation().IsTagged()); + ASSERT(instr->right()->representation().IsTagged()); LOperand* left = UseFixed(instr->left(), r1); LOperand* right = UseFixed(instr->right(), r0); @@ -1350,7 +1345,9 @@ LInstruction* LChunkBuilder::DoBitNot(HBitNot* instr) { LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { if (instr->representation().IsDouble()) { return DoArithmeticD(Token::DIV, instr); - } else if (instr->representation().IsInteger32()) { + } else if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); if (instr->HasPowerOf2Divisor()) { ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero)); LOperand* value = UseRegisterAtStart(instr->left()); @@ -1441,9 +1438,9 @@ LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) { LInstruction* LChunkBuilder::DoMod(HMod* instr) { HValue* left = instr->left(); HValue* right = instr->right(); - if (instr->representation().IsInteger32()) { - ASSERT(left->representation().IsInteger32()); - ASSERT(right->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); if (instr->HasPowerOf2Divisor()) { ASSERT(!right->CanBeZero()); LModI* mod = new(zone()) LModI(UseRegisterAtStart(left), @@ -1483,7 +1480,7 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) { ? AssignEnvironment(result) : result; } - } else if (instr->representation().IsSmiOrTagged()) { + } else if (instr->representation().IsTagged()) { return DoArithmeticT(Token::MOD, instr); } else { ASSERT(instr->representation().IsDouble()); @@ -1499,9 +1496,9 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) { LInstruction* LChunkBuilder::DoMul(HMul* instr) { - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* left; LOperand* right = UseOrConstant(instr->BetterRightOperand()); LOperand* temp = NULL; @@ -1550,9 +1547,9 @@ LInstruction* LChunkBuilder::DoMul(HMul* instr) { LInstruction* LChunkBuilder::DoSub(HSub* instr) { - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); if (instr->left()->IsConstant()) { // If lhs is constant, do reverse subtraction instead. @@ -1580,9 +1577,9 @@ LInstruction* LChunkBuilder::DoSub(HSub* instr) { LInstruction* LChunkBuilder::DoRSub(HSub* instr) { - ASSERT(instr->representation().IsInteger32()); - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + ASSERT(instr->representation().IsSmiOrInteger32()); + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); // Note: The lhs of the subtraction becomes the rhs of the // reverse-subtraction. @@ -1618,9 +1615,9 @@ LInstruction* LChunkBuilder::DoMultiplySub(HValue* minuend, HMul* mul) { LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); LAddI* add = new(zone()) LAddI(left, right); @@ -1641,7 +1638,7 @@ LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { return DoArithmeticD(Token::ADD, instr); } else { - ASSERT(instr->representation().IsSmiOrTagged()); + ASSERT(instr->representation().IsTagged()); return DoArithmeticT(Token::ADD, instr); } } @@ -1650,9 +1647,9 @@ LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { LOperand* left = NULL; LOperand* right = NULL; - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); left = UseRegisterAtStart(instr->BetterLeftOperand()); right = UseOrConstantAtStart(instr->BetterRightOperand()); } else { @@ -1731,13 +1728,6 @@ LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( } -LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch( - HCompareConstantEqAndBranch* instr) { - LOperand* value = UseRegisterAtStart(instr->value()); - return new(zone()) LCmpConstantEqAndBranch(value); -} - - LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { ASSERT(instr->value()->representation().IsTagged()); LOperand* value = UseRegisterAtStart(instr->value()); @@ -2035,9 +2025,14 @@ LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { - LUnallocated* temp1 = TempRegister(); - LOperand* temp2 = TempRegister(); + LUnallocated* temp1 = NULL; + LOperand* temp2 = NULL; + if (!instr->CanOmitPrototypeChecks()) { + temp1 = TempRegister(); + temp2 = TempRegister(); + } LCheckPrototypeMaps* result = new(zone()) LCheckPrototypeMaps(temp1, temp2); + if (instr->CanOmitPrototypeChecks()) return result; return AssignEnvironment(result); } @@ -2049,8 +2044,10 @@ LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) { LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { - LOperand* value = UseRegisterAtStart(instr->value()); + LOperand* value = NULL; + if (!instr->CanOmitMapChecks()) value = UseRegisterAtStart(instr->value()); LInstruction* result = new(zone()) LCheckMaps(value); + if (instr->CanOmitMapChecks()) return result; return AssignEnvironment(result); } @@ -2060,7 +2057,7 @@ LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { Representation input_rep = value->representation(); LOperand* reg = UseRegister(value); if (input_rep.IsDouble()) { - return DefineAsRegister(new(zone()) LClampDToUint8(reg, FixedTemp(d11))); + return DefineAsRegister(new(zone()) LClampDToUint8(reg)); } else if (input_rep.IsInteger32()) { return DefineAsRegister(new(zone()) LClampIToUint8(reg)); } else { @@ -2206,8 +2203,7 @@ LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { - ASSERT(instr->key()->representation().IsInteger32() || - instr->key()->representation().IsSmi()); + ASSERT(instr->key()->representation().IsSmiOrInteger32()); ElementsKind elements_kind = instr->elements_kind(); LOperand* key = UseRegisterOrConstantAtStart(instr->key()); LLoadKeyed* result = NULL; diff --git a/deps/v8/src/arm/lithium-arm.h b/deps/v8/src/arm/lithium-arm.h index 5165f1b..6faa781 100644 --- a/deps/v8/src/arm/lithium-arm.h +++ b/deps/v8/src/arm/lithium-arm.h @@ -40,12 +40,6 @@ namespace internal { // Forward declarations. class LCodeGen; -#define LITHIUM_ALL_INSTRUCTION_LIST(V) \ - V(ControlInstruction) \ - V(Call) \ - LITHIUM_CONCRETE_INSTRUCTION_LIST(V) - - #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ V(AccessArgumentsAt) \ V(AddI) \ @@ -73,13 +67,13 @@ class LCodeGen; V(CheckInstanceType) \ V(CheckNonSmi) \ V(CheckMaps) \ + V(CheckMapValue) \ V(CheckPrototypeMaps) \ V(CheckSmi) \ V(ClampDToUint8) \ V(ClampIToUint8) \ V(ClampTToUint8) \ V(ClassOfTestAndBranch) \ - V(CmpConstantEqAndBranch) \ V(CompareNumericAndBranch) \ V(CmpObjectEqAndBranch) \ V(CmpMapAndBranch) \ @@ -89,14 +83,18 @@ class LCodeGen; V(ConstantS) \ V(ConstantT) \ V(Context) \ + V(DateField) \ V(DebugBreak) \ V(DeclareGlobals) \ V(Deoptimize) \ V(DivI) \ V(DoubleToI) \ V(DoubleToSmi) \ + V(Drop) \ V(DummyUse) \ V(ElementsKind) \ + V(ForInCacheArray) \ + V(ForInPrepareMap) \ V(FunctionLiteral) \ V(GetCachedArrayIndex) \ V(GlobalObject) \ @@ -104,13 +102,13 @@ class LCodeGen; V(Goto) \ V(HasCachedArrayIndexAndBranch) \ V(HasInstanceTypeAndBranch) \ + V(InnerAllocatedObject) \ V(InstanceOf) \ V(InstanceOfKnownGlobal) \ V(InstanceSize) \ V(InstructionGap) \ V(Integer32ToDouble) \ V(Integer32ToSmi) \ - V(Uint32ToDouble) \ V(InvokeFunction) \ V(IsConstructCallAndBranch) \ V(IsObjectAndBranch) \ @@ -123,6 +121,7 @@ class LCodeGen; V(LinkObjectInList) \ V(LoadContextSlot) \ V(LoadExternalArrayPointer) \ + V(LoadFieldByIndex) \ V(LoadFunctionPrototype) \ V(LoadGlobalCell) \ V(LoadGlobalGeneric) \ @@ -187,16 +186,10 @@ class LCodeGen; V(TrapAllocationMemento) \ V(Typeof) \ V(TypeofIsAndBranch) \ + V(Uint32ToDouble) \ V(UnknownOSRValue) \ V(ValueOf) \ - V(ForInPrepareMap) \ - V(ForInCacheArray) \ - V(CheckMapValue) \ - V(LoadFieldByIndex) \ - V(DateField) \ - V(WrapReceiver) \ - V(Drop) \ - V(InnerAllocatedObject) + V(WrapReceiver) #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ @@ -433,6 +426,7 @@ class LDummyUse: public LTemplateInstruction<1, 1, 0> { class LDeoptimize: public LTemplateInstruction<0, 0, 0> { public: DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") + DECLARE_HYDROGEN_ACCESSOR(Deoptimize) }; @@ -894,20 +888,6 @@ class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> { }; -class LCmpConstantEqAndBranch: public LControlInstruction<1, 0> { - public: - explicit LCmpConstantEqAndBranch(LOperand* left) { - inputs_[0] = left; - } - - LOperand* left() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(CmpConstantEqAndBranch, - "cmp-constant-eq-and-branch") - DECLARE_HYDROGEN_ACCESSOR(CompareConstantEqAndBranch) -}; - - class LIsObjectAndBranch: public LControlInstruction<1, 1> { public: LIsObjectAndBranch(LOperand* value, LOperand* temp) { @@ -2440,15 +2420,13 @@ class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> { }; -class LClampDToUint8: public LTemplateInstruction<1, 1, 1> { +class LClampDToUint8: public LTemplateInstruction<1, 1, 0> { public: - LClampDToUint8(LOperand* unclamped, LOperand* temp) { + explicit LClampDToUint8(LOperand* unclamped) { inputs_[0] = unclamped; - temps_[0] = temp; } LOperand* unclamped() { return inputs_[0]; } - LOperand* temp() { return temps_[0]; } DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8") }; diff --git a/deps/v8/src/arm/lithium-codegen-arm.cc b/deps/v8/src/arm/lithium-codegen-arm.cc index 9e0d59f..41636a8 100644 --- a/deps/v8/src/arm/lithium-codegen-arm.cc +++ b/deps/v8/src/arm/lithium-codegen-arm.cc @@ -277,6 +277,7 @@ bool LCodeGen::GenerateBody() { instr->CompileToNative(this); } EnsureSpaceForLazyDeopt(); + last_lazy_deopt_pc_ = masm()->pc_offset(); return !is_aborted(); } @@ -425,11 +426,7 @@ Register LCodeGen::EmitLoadRegister(LOperand* op, Register scratch) { Abort("EmitLoadRegister: Unsupported double immediate."); } else { ASSERT(r.IsTagged()); - if (literal->IsSmi()) { - __ mov(scratch, Operand(literal)); - } else { - __ LoadHeapObject(scratch, Handle::cast(literal)); - } + __ LoadObject(scratch, literal); } return scratch; } else if (op->IsStackSlot() || op->IsArgument()) { @@ -497,9 +494,18 @@ bool LCodeGen::IsSmi(LConstantOperand* op) const { } -int LCodeGen::ToInteger32(LConstantOperand* op) const { +int32_t LCodeGen::ToInteger32(LConstantOperand* op) const { + return ToRepresentation(op, Representation::Integer32()); +} + + +int32_t LCodeGen::ToRepresentation(LConstantOperand* op, + const Representation& r) const { HConstant* constant = chunk_->LookupConstant(op); - return constant->Integer32Value(); + int32_t value = constant->Integer32Value(); + if (r.IsInteger32()) return value; + ASSERT(r.IsSmiOrTagged()); + return reinterpret_cast(Smi::FromInt(value)); } @@ -521,7 +527,10 @@ Operand LCodeGen::ToOperand(LOperand* op) { LConstantOperand* const_op = LConstantOperand::cast(op); HConstant* constant = chunk()->LookupConstant(const_op); Representation r = chunk_->LookupLiteralRepresentation(const_op); - if (r.IsInteger32()) { + if (r.IsSmi()) { + ASSERT(constant->HasSmiValue()); + return Operand(Smi::FromInt(constant->Integer32Value())); + } else if (r.IsInteger32()) { ASSERT(constant->HasInteger32Value()); return Operand(constant->Integer32Value()); } else if (r.IsDouble()) { @@ -676,6 +685,7 @@ void LCodeGen::CallCodeGeneric(Handle code, LInstruction* instr, SafepointMode safepoint_mode, TargetAddressStorageMode storage_mode) { + EnsureSpaceForLazyDeopt(); ASSERT(instr != NULL); // Block literal pool emission to ensure nop indicating no inlined smi code // is in the correct position. @@ -808,12 +818,6 @@ void LCodeGen::DeoptimizeIf(Condition cc, } -void LCodeGen::SoftDeoptimize(LEnvironment* environment) { - ASSERT(!info()->IsStub()); - DeoptimizeIf(al, environment, Deoptimizer::SOFT); -} - - void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle code) { ZoneList > maps(1, zone()); int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); @@ -1186,7 +1190,7 @@ void LCodeGen::DoModI(LModI* instr) { DwVfpRegister dividend = ToDoubleRegister(instr->temp()); DwVfpRegister divisor = ToDoubleRegister(instr->temp2()); ASSERT(!divisor.is(dividend)); - DwVfpRegister quotient = double_scratch0(); + LowDwVfpRegister quotient = double_scratch0(); ASSERT(!quotient.is(dividend)); ASSERT(!quotient.is(divisor)); @@ -1202,11 +1206,10 @@ void LCodeGen::DoModI(LModI* instr) { // Load the arguments in VFP registers. The divisor value is preloaded // before. Be careful that 'right_reg' is only live on entry. // TODO(svenpanne) The last comments seems to be wrong nowadays. - __ vmov(dividend.low(), left_reg); - __ vmov(divisor.low(), right_reg); - - __ vcvt_f64_s32(dividend, dividend.low()); - __ vcvt_f64_s32(divisor, divisor.low()); + __ vmov(double_scratch0().low(), left_reg); + __ vcvt_f64_s32(dividend, double_scratch0().low()); + __ vmov(double_scratch0().low(), right_reg); + __ vcvt_f64_s32(divisor, double_scratch0().low()); // We do not care about the sign of the divisor. Note that we still handle // the kMinInt % -1 case correctly, though. @@ -1217,10 +1220,9 @@ void LCodeGen::DoModI(LModI* instr) { __ vcvt_f64_s32(quotient, quotient.low()); // Compute the remainder in result. - DwVfpRegister double_scratch = dividend; - __ vmul(double_scratch, divisor, quotient); - __ vcvt_s32_f64(double_scratch.low(), double_scratch); - __ vmov(scratch, double_scratch.low()); + __ vmul(double_scratch0(), divisor, quotient); + __ vcvt_s32_f64(double_scratch0().low(), double_scratch0()); + __ vmov(scratch, double_scratch0().low()); __ sub(result_reg, left_reg, scratch, SetCC); // If we care about -0, test if the dividend is <0 and the result is 0. @@ -1420,20 +1422,20 @@ void LCodeGen::DoDivI(LDivI* instr) { } else { const DoubleRegister vleft = ToDoubleRegister(instr->temp()); const DoubleRegister vright = double_scratch0(); - __ vmov(vleft.low(), left); - __ vmov(vright.low(), right); - __ vcvt_f64_s32(vleft, vleft.low()); - __ vcvt_f64_s32(vright, vright.low()); + __ vmov(double_scratch0().low(), left); + __ vcvt_f64_s32(vleft, double_scratch0().low()); + __ vmov(double_scratch0().low(), right); + __ vcvt_f64_s32(vright, double_scratch0().low()); __ vdiv(vleft, vleft, vright); // vleft now contains the result. - __ vcvt_s32_f64(vright.low(), vleft); - __ vmov(result, vright.low()); + __ vcvt_s32_f64(double_scratch0().low(), vleft); + __ vmov(result, double_scratch0().low()); if (!instr->hydrogen()->CheckFlag( HInstruction::kAllUsesTruncatingToInt32)) { // Deopt if exact conversion to integer was not possible. // Use vright as scratch register. - __ vcvt_f64_s32(vright, vright.low()); - __ VFPCompareAndSetFlags(vleft, vright); + __ vcvt_f64_s32(double_scratch0(), double_scratch0().low()); + __ VFPCompareAndSetFlags(vleft, double_scratch0()); DeoptimizeIf(ne, instr->environment()); } } @@ -1548,7 +1550,9 @@ void LCodeGen::DoMulI(LMulI* instr) { if (right_op->IsConstantOperand() && !can_overflow) { // Use optimized code for specific constants. - int32_t constant = ToInteger32(LConstantOperand::cast(right_op)); + int32_t constant = ToRepresentation( + LConstantOperand::cast(right_op), + instr->hydrogen()->right()->representation()); if (bailout_on_minus_zero && (constant < 0)) { // The case of a null constant will be handled separately. @@ -1612,11 +1616,21 @@ void LCodeGen::DoMulI(LMulI* instr) { if (can_overflow) { // scratch:result = left * right. - __ smull(result, scratch, left, right); + if (instr->hydrogen()->representation().IsSmi()) { + __ SmiUntag(result, left); + __ smull(result, scratch, result, right); + } else { + __ smull(result, scratch, left, right); + } __ cmp(scratch, Operand(result, ASR, 31)); DeoptimizeIf(ne, instr->environment()); } else { - __ mul(result, left, right); + if (instr->hydrogen()->representation().IsSmi()) { + __ SmiUntag(result, left); + __ mul(result, result, right); + } else { + __ mul(result, left, right); + } } if (bailout_on_minus_zero) { @@ -1804,12 +1818,7 @@ void LCodeGen::DoConstantD(LConstantD* instr) { void LCodeGen::DoConstantT(LConstantT* instr) { Handle value = instr->value(); AllowDeferredHandleDereference smi_check; - if (value->IsSmi()) { - __ mov(ToRegister(instr->result()), Operand(value)); - } else { - __ LoadHeapObject(ToRegister(instr->result()), - Handle::cast(value)); - } + __ LoadObject(ToRegister(instr->result()), value); } @@ -1971,7 +1980,7 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) { LOperand* left = instr->left(); LOperand* right = instr->right(); HMathMinMax::Operation operation = instr->hydrogen()->operation(); - if (instr->hydrogen()->representation().IsInteger32()) { + if (instr->hydrogen()->representation().IsSmiOrInteger32()) { Condition condition = (operation == HMathMinMax::kMathMin) ? le : ge; Register left_reg = ToRegister(left); Operand right_op = (right->IsRegister() || right->IsConstantOperand()) @@ -2370,14 +2379,6 @@ void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { } -void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { - Register left = ToRegister(instr->left()); - - __ cmp(left, Operand(instr->hydrogen()->right())); - EmitBranch(instr, eq); -} - - Condition LCodeGen::EmitIsObject(Register input, Register temp1, Label* is_not_object, @@ -3030,9 +3031,9 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); __ ldr(result, FieldMemOperand(result, offset + FixedArray::kHeaderSize)); } - } else if (lookup.IsConstantFunction()) { - Handle function(lookup.GetConstantFunctionFromMap(*type)); - __ LoadHeapObject(result, function); + } else if (lookup.IsConstant()) { + Handle constant(lookup.GetConstantFromMap(*type), isolate()); + __ LoadObject(result, constant); } else { // Negative lookup. // Check prototypes. @@ -3207,8 +3208,8 @@ void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) { : Operand(key, LSL, shift_size); __ add(scratch0(), external_pointer, operand); if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) { - __ vldr(kScratchDoubleReg.low(), scratch0(), additional_offset); - __ vcvt_f64_f32(result, kScratchDoubleReg.low()); + __ vldr(double_scratch0().low(), scratch0(), additional_offset); + __ vcvt_f64_f32(result, double_scratch0().low()); } else { // i.e. elements_kind == EXTERNAL_DOUBLE_ELEMENTS __ vldr(result, scratch0(), additional_offset); } @@ -3776,7 +3777,6 @@ void LCodeGen::DoMathFloor(LMathFloor* instr) { Register input_high = scratch0(); Label done, exact; - __ vmov(input_high, input.high()); __ TryInt32Floor(result, input, input_high, double_scratch0(), &done, &exact); DeoptimizeIf(al, instr->environment()); @@ -3809,7 +3809,7 @@ void LCodeGen::DoMathRound(LMathRound* instr) { // If the input is +0.5, the result is 1. __ b(hi, &convert); // Out of [-0.5, +0.5]. if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { - __ vmov(input_high, input.high()); + __ VmovHigh(input_high, input); __ cmp(input_high, Operand::Zero()); DeoptimizeIf(mi, instr->environment()); // [-0.5, -0]. } @@ -3822,7 +3822,6 @@ void LCodeGen::DoMathRound(LMathRound* instr) { __ bind(&convert); __ vadd(input_plus_dot_five, input, dot_five); - __ vmov(input_high, input_plus_dot_five.high()); // Reuse dot_five (double_scratch0) as we no longer need this value. __ TryInt32Floor(result, input_plus_dot_five, input_high, double_scratch0(), &done, &done); @@ -4264,6 +4263,18 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { } +void LCodeGen::ApplyCheckIf(Condition cc, LBoundsCheck* check) { + if (FLAG_debug_code && check->hydrogen()->skip_check()) { + Label done; + __ b(NegateCondition(cc), &done); + __ stop("eliminated bounds check failed"); + __ bind(&done); + } else { + DeoptimizeIf(cc, check->environment()); + } +} + + void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { if (instr->hydrogen()->skip_check()) return; @@ -4279,7 +4290,8 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { } else { __ cmp(ToRegister(instr->index()), ToRegister(instr->length())); } - DeoptimizeIf(hs, instr->environment()); + Condition condition = instr->hydrogen()->allow_equality() ? hi : hs; + ApplyCheckIf(condition, instr); } @@ -4745,8 +4757,7 @@ void LCodeGen::DoDeferredNumberTagI(LInstruction* instr, Label slow; Register src = ToRegister(value); Register dst = ToRegister(instr->result()); - DwVfpRegister dbl_scratch = double_scratch0(); - SwVfpRegister flt_scratch = dbl_scratch.low(); + LowDwVfpRegister dbl_scratch = double_scratch0(); // Preserve the value of all registers. PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); @@ -4760,11 +4771,11 @@ void LCodeGen::DoDeferredNumberTagI(LInstruction* instr, __ SmiUntag(src, dst); __ eor(src, src, Operand(0x80000000)); } - __ vmov(flt_scratch, src); - __ vcvt_f64_s32(dbl_scratch, flt_scratch); + __ vmov(dbl_scratch.low(), src); + __ vcvt_f64_s32(dbl_scratch, dbl_scratch.low()); } else { - __ vmov(flt_scratch, src); - __ vcvt_f64_u32(dbl_scratch, flt_scratch); + __ vmov(dbl_scratch.low(), src); + __ vcvt_f64_u32(dbl_scratch, dbl_scratch.low()); } if (FLAG_inline_new) { @@ -4825,7 +4836,7 @@ void LCodeGen::DoNumberTagD(LNumberTagD* instr) { DwVfpRegister input_reg = ToDoubleRegister(instr->value()); __ VFPCompareAndSetFlags(input_reg, input_reg); __ b(vc, &no_special_nan_handling); - __ vmov(scratch, input_reg.high()); + __ VmovHigh(scratch, input_reg); __ cmp(scratch, Operand(kHoleNanUpper32)); // If not the hole NaN, force the NaN to be canonical. __ VFPCanonicalizeNaN(input_reg, ne); @@ -4925,22 +4936,20 @@ void LCodeGen::EmitNumberUntagD(Register input_reg, DeoptimizeIf(ne, env); __ bind(&convert); - __ LoadRoot(ip, Heap::kNanValueRootIndex); - __ sub(ip, ip, Operand(kHeapObjectTag)); - __ vldr(result_reg, ip, HeapNumber::kValueOffset); + __ LoadRoot(scratch, Heap::kNanValueRootIndex); + __ vldr(result_reg, scratch, HeapNumber::kValueOffset - kHeapObjectTag); __ jmp(&done); __ bind(&heap_number); } // Heap number to double register conversion. - __ sub(ip, input_reg, Operand(kHeapObjectTag)); - __ vldr(result_reg, ip, HeapNumber::kValueOffset); + __ vldr(result_reg, input_reg, HeapNumber::kValueOffset - kHeapObjectTag); if (deoptimize_on_minus_zero) { - __ vmov(ip, result_reg.low()); - __ cmp(ip, Operand::Zero()); + __ VmovLow(scratch, result_reg); + __ cmp(scratch, Operand::Zero()); __ b(ne, &done); - __ vmov(ip, result_reg.high()); - __ cmp(ip, Operand(HeapNumber::kSignMask)); + __ VmovHigh(scratch, result_reg); + __ cmp(scratch, Operand(HeapNumber::kSignMask)); DeoptimizeIf(eq, env); } __ jmp(&done); @@ -4962,7 +4971,7 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { Register input_reg = ToRegister(instr->value()); Register scratch1 = scratch0(); Register scratch2 = ToRegister(instr->temp()); - DwVfpRegister double_scratch = double_scratch0(); + LowDwVfpRegister double_scratch = double_scratch0(); DwVfpRegister double_scratch2 = ToDoubleRegister(instr->temp3()); ASSERT(!scratch1.is(input_reg) && !scratch1.is(scratch2)); @@ -5010,14 +5019,14 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { DeoptimizeIf(ne, instr->environment()); __ sub(ip, input_reg, Operand(kHeapObjectTag)); - __ vldr(double_scratch, ip, HeapNumber::kValueOffset); - __ TryDoubleToInt32Exact(input_reg, double_scratch, double_scratch2); + __ vldr(double_scratch2, ip, HeapNumber::kValueOffset); + __ TryDoubleToInt32Exact(input_reg, double_scratch2, double_scratch); DeoptimizeIf(ne, instr->environment()); if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { __ cmp(input_reg, Operand::Zero()); __ b(ne, &done); - __ vmov(scratch1, double_scratch.high()); + __ VmovHigh(scratch1, double_scratch2); __ tst(scratch1, Operand(HeapNumber::kSignMask)); DeoptimizeIf(ne, instr->environment()); } @@ -5090,7 +5099,7 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) { Register scratch1 = scratch0(); Register scratch2 = ToRegister(instr->temp()); DwVfpRegister double_input = ToDoubleRegister(instr->value()); - DwVfpRegister double_scratch = double_scratch0(); + LowDwVfpRegister double_scratch = double_scratch0(); if (instr->truncating()) { Register scratch3 = ToRegister(instr->temp2()); @@ -5104,7 +5113,7 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) { Label done; __ cmp(result_reg, Operand::Zero()); __ b(ne, &done); - __ vmov(scratch1, double_input.high()); + __ VmovHigh(scratch1, double_input); __ tst(scratch1, Operand(HeapNumber::kSignMask)); DeoptimizeIf(ne, instr->environment()); __ bind(&done); @@ -5118,7 +5127,7 @@ void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) { Register scratch1 = scratch0(); Register scratch2 = ToRegister(instr->temp()); DwVfpRegister double_input = ToDoubleRegister(instr->value()); - DwVfpRegister double_scratch = double_scratch0(); + LowDwVfpRegister double_scratch = double_scratch0(); if (instr->truncating()) { Register scratch3 = ToRegister(instr->temp2()); @@ -5132,7 +5141,7 @@ void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) { Label done; __ cmp(result_reg, Operand::Zero()); __ b(ne, &done); - __ vmov(scratch1, double_input.high()); + __ VmovHigh(scratch1, double_input); __ tst(scratch1, Operand(HeapNumber::kSignMask)); DeoptimizeIf(ne, instr->environment()); __ bind(&done); @@ -5230,6 +5239,7 @@ void LCodeGen::DoCheckMapCommon(Register map_reg, void LCodeGen::DoCheckMaps(LCheckMaps* instr) { + if (instr->hydrogen()->CanOmitMapChecks()) return; Register map_reg = scratch0(); LOperand* input = instr->value(); ASSERT(input->IsRegister()); @@ -5252,8 +5262,7 @@ void LCodeGen::DoCheckMaps(LCheckMaps* instr) { void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { DwVfpRegister value_reg = ToDoubleRegister(instr->unclamped()); Register result_reg = ToRegister(instr->result()); - DwVfpRegister temp_reg = ToDoubleRegister(instr->temp()); - __ ClampDoubleToUint8(result_reg, value_reg, temp_reg); + __ ClampDoubleToUint8(result_reg, value_reg, double_scratch0()); } @@ -5288,9 +5297,8 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) { // Heap number __ bind(&heap_number); - __ vldr(double_scratch0(), FieldMemOperand(input_reg, - HeapNumber::kValueOffset)); - __ ClampDoubleToUint8(result_reg, double_scratch0(), temp_reg); + __ vldr(temp_reg, FieldMemOperand(input_reg, HeapNumber::kValueOffset)); + __ ClampDoubleToUint8(result_reg, temp_reg, double_scratch0()); __ jmp(&done); // smi @@ -5302,6 +5310,8 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) { void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { + if (instr->hydrogen()->CanOmitPrototypeChecks()) return; + Register prototype_reg = ToRegister(instr->temp()); Register map_reg = ToRegister(instr->temp2()); @@ -5310,12 +5320,10 @@ void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { ASSERT(prototypes->length() == maps->length()); - if (!instr->hydrogen()->CanOmitPrototypeChecks()) { - for (int i = 0; i < prototypes->length(); i++) { - __ LoadHeapObject(prototype_reg, prototypes->at(i)); - __ ldr(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); - DoCheckMapCommon(map_reg, maps->at(i), instr->environment()); - } + for (int i = 0; i < prototypes->length(); i++) { + __ LoadHeapObject(prototype_reg, prototypes->at(i)); + __ ldr(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); + DoCheckMapCommon(map_reg, maps->at(i), instr->environment()); } } @@ -5364,6 +5372,25 @@ void LCodeGen::DoAllocate(LAllocate* instr) { } __ bind(deferred->exit()); + + if (instr->hydrogen()->MustPrefillWithFiller()) { + if (instr->size()->IsConstantOperand()) { + int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); + __ mov(scratch, Operand(size)); + } else { + scratch = ToRegister(instr->size()); + } + __ sub(scratch, scratch, Operand(kPointerSize)); + __ sub(result, result, Operand(kHeapObjectTag)); + Label loop; + __ bind(&loop); + __ mov(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); + __ str(scratch2, MemOperand(result, scratch)); + __ sub(scratch, scratch, Operand(kPointerSize)); + __ cmp(scratch, Operand(0)); + __ b(ge, &loop); + __ add(result, result, Operand(kHeapObjectTag)); + } } @@ -5444,8 +5471,7 @@ void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { __ bind(&allocated); // Copy the content into the newly allocated memory. - __ CopyFields(r0, r1, double_scratch0(), double_scratch0().low(), - size / kPointerSize); + __ CopyFields(r0, r1, double_scratch0(), size / kPointerSize); } @@ -5610,12 +5636,12 @@ void LCodeGen::EnsureSpaceForLazyDeopt() { padding_size -= Assembler::kInstrSize; } } - last_lazy_deopt_pc_ = masm()->pc_offset(); } void LCodeGen::DoLazyBailout(LLazyBailout* instr) { EnsureSpaceForLazyDeopt(); + last_lazy_deopt_pc_ = masm()->pc_offset(); ASSERT(instr->HasEnvironment()); LEnvironment* env = instr->environment(); RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); @@ -5624,11 +5650,15 @@ void LCodeGen::DoLazyBailout(LLazyBailout* instr) { void LCodeGen::DoDeoptimize(LDeoptimize* instr) { - if (instr->hydrogen_value()->IsSoftDeoptimize()) { - SoftDeoptimize(instr->environment()); - } else { - DeoptimizeIf(al, instr->environment()); + Deoptimizer::BailoutType type = instr->hydrogen()->type(); + // TODO(danno): Stubs expect all deopts to be lazy for historical reasons (the + // needed return address), even though the implementation of LAZY and EAGER is + // now identical. When LAZY is eventually completely folded into EAGER, remove + // the special case below. + if (info()->IsStub() && type == Deoptimizer::EAGER) { + type = Deoptimizer::LAZY; } + DeoptimizeIf(al, instr->environment(), type); } @@ -5673,6 +5703,7 @@ void LCodeGen::DoStackCheck(LStackCheck* instr) { PredictableCodeSizeScope predictable(masm_, 2 * Assembler::kInstrSize); CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); EnsureSpaceForLazyDeopt(); + last_lazy_deopt_pc_ = masm()->pc_offset(); __ bind(&done); RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); @@ -5685,6 +5716,7 @@ void LCodeGen::DoStackCheck(LStackCheck* instr) { __ cmp(sp, Operand(ip)); __ b(lo, deferred_stack_check->entry()); EnsureSpaceForLazyDeopt(); + last_lazy_deopt_pc_ = masm()->pc_offset(); __ bind(instr->done_label()); deferred_stack_check->SetExit(instr->done_label()); RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); diff --git a/deps/v8/src/arm/lithium-codegen-arm.h b/deps/v8/src/arm/lithium-codegen-arm.h index b0390ee..21f7921 100644 --- a/deps/v8/src/arm/lithium-codegen-arm.h +++ b/deps/v8/src/arm/lithium-codegen-arm.h @@ -115,7 +115,8 @@ class LCodeGen BASE_EMBEDDED { DwVfpRegister EmitLoadDoubleRegister(LOperand* op, SwVfpRegister flt_scratch, DwVfpRegister dbl_scratch); - int ToInteger32(LConstantOperand* op) const; + int ToRepresentation(LConstantOperand* op, const Representation& r) const; + int32_t ToInteger32(LConstantOperand* op) const; Smi* ToSmi(LConstantOperand* op) const; double ToDouble(LConstantOperand* op) const; Operand ToOperand(LOperand* op); @@ -199,7 +200,7 @@ class LCodeGen BASE_EMBEDDED { HGraph* graph() const { return chunk()->graph(); } Register scratch0() { return r9; } - DwVfpRegister double_scratch0() { return kScratchDoubleReg; } + LowDwVfpRegister double_scratch0() { return kScratchDoubleReg; } int GetNextEmittedBlock() const; LInstruction* GetNextInstruction(); @@ -284,7 +285,7 @@ class LCodeGen BASE_EMBEDDED { LEnvironment* environment, Deoptimizer::BailoutType bailout_type); void DeoptimizeIf(Condition cc, LEnvironment* environment); - void SoftDeoptimize(LEnvironment* environment); + void ApplyCheckIf(Condition cc, LBoundsCheck* check); void AddToTranslation(Translation* translation, LOperand* op, diff --git a/deps/v8/src/arm/lithium-gap-resolver-arm.cc b/deps/v8/src/arm/lithium-gap-resolver-arm.cc index 902817e..7a3c968 100644 --- a/deps/v8/src/arm/lithium-gap-resolver-arm.cc +++ b/deps/v8/src/arm/lithium-gap-resolver-arm.cc @@ -247,10 +247,10 @@ void LGapResolver::EmitMove(int index) { LConstantOperand* constant_source = LConstantOperand::cast(source); if (destination->IsRegister()) { Register dst = cgen_->ToRegister(destination); - if (cgen_->IsSmi(constant_source)) { - __ mov(dst, Operand(cgen_->ToSmi(constant_source))); - } else if (cgen_->IsInteger32(constant_source)) { - __ mov(dst, Operand(cgen_->ToInteger32(constant_source))); + Representation r = cgen_->IsSmi(constant_source) + ? Representation::Smi() : Representation::Integer32(); + if (cgen_->IsInteger32(constant_source)) { + __ mov(dst, Operand(cgen_->ToRepresentation(constant_source, r))); } else { __ LoadObject(dst, cgen_->ToHandle(constant_source)); } @@ -261,11 +261,11 @@ void LGapResolver::EmitMove(int index) { } else { ASSERT(destination->IsStackSlot()); ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone. - if (cgen_->IsSmi(constant_source)) { - __ mov(kSavedValueRegister, Operand(cgen_->ToSmi(constant_source))); - } else if (cgen_->IsInteger32(constant_source)) { + Representation r = cgen_->IsSmi(constant_source) + ? Representation::Smi() : Representation::Integer32(); + if (cgen_->IsInteger32(constant_source)) { __ mov(kSavedValueRegister, - Operand(cgen_->ToInteger32(constant_source))); + Operand(cgen_->ToRepresentation(constant_source, r))); } else { __ LoadObject(kSavedValueRegister, cgen_->ToHandle(constant_source)); diff --git a/deps/v8/src/arm/macro-assembler-arm.cc b/deps/v8/src/arm/macro-assembler-arm.cc index 8416926..cd12461 100644 --- a/deps/v8/src/arm/macro-assembler-arm.cc +++ b/deps/v8/src/arm/macro-assembler-arm.cc @@ -792,6 +792,46 @@ void MacroAssembler::Vmov(const DwVfpRegister dst, } +void MacroAssembler::VmovHigh(Register dst, DwVfpRegister src) { + if (src.code() < 16) { + const LowDwVfpRegister loc = LowDwVfpRegister::from_code(src.code()); + vmov(dst, loc.high()); + } else { + vmov(dst, VmovIndexHi, src); + } +} + + +void MacroAssembler::VmovHigh(DwVfpRegister dst, Register src) { + if (dst.code() < 16) { + const LowDwVfpRegister loc = LowDwVfpRegister::from_code(dst.code()); + vmov(loc.high(), src); + } else { + vmov(dst, VmovIndexHi, src); + } +} + + +void MacroAssembler::VmovLow(Register dst, DwVfpRegister src) { + if (src.code() < 16) { + const LowDwVfpRegister loc = LowDwVfpRegister::from_code(src.code()); + vmov(dst, loc.low()); + } else { + vmov(dst, VmovIndexLo, src); + } +} + + +void MacroAssembler::VmovLow(DwVfpRegister dst, Register src) { + if (dst.code() < 16) { + const LowDwVfpRegister loc = LowDwVfpRegister::from_code(dst.code()); + vmov(loc.low(), src); + } else { + vmov(dst, VmovIndexLo, src); + } +} + + void MacroAssembler::ConvertNumberToInt32(Register object, Register dst, Register heap_number_map, @@ -799,7 +839,7 @@ void MacroAssembler::ConvertNumberToInt32(Register object, Register scratch2, Register scratch3, DwVfpRegister double_scratch1, - DwVfpRegister double_scratch2, + LowDwVfpRegister double_scratch2, Label* not_number) { Label done; UntagAndJumpIfSmi(dst, object, &done); @@ -813,7 +853,7 @@ void MacroAssembler::ConvertNumberToInt32(Register object, void MacroAssembler::LoadNumber(Register object, - DwVfpRegister dst, + LowDwVfpRegister dst, Register heap_number_map, Register scratch, Label* not_number) { @@ -838,7 +878,7 @@ void MacroAssembler::LoadNumberAsInt32Double(Register object, DwVfpRegister double_dst, Register heap_number_map, Register scratch, - DwVfpRegister double_scratch, + LowDwVfpRegister double_scratch, Label* not_int32) { ASSERT(!scratch.is(object)); ASSERT(!heap_number_map.is(object) && !heap_number_map.is(scratch)); @@ -870,7 +910,7 @@ void MacroAssembler::LoadNumberAsInt32(Register object, Register heap_number_map, Register scratch, DwVfpRegister double_scratch0, - DwVfpRegister double_scratch1, + LowDwVfpRegister double_scratch1, Label* not_int32) { ASSERT(!dst.is(object)); ASSERT(!scratch.is(object)); @@ -1625,6 +1665,7 @@ void MacroAssembler::Allocate(int object_size, Register scratch2, Label* gc_required, AllocationFlags flags) { + ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize); if (!FLAG_inline_new) { if (emit_debug_code()) { // Trash the registers to simulate an allocation failure. @@ -2065,12 +2106,14 @@ void MacroAssembler::CheckFastSmiElements(Register map, } -void MacroAssembler::StoreNumberToDoubleElements(Register value_reg, - Register key_reg, - Register elements_reg, - Register scratch1, - Label* fail, - int elements_offset) { +void MacroAssembler::StoreNumberToDoubleElements( + Register value_reg, + Register key_reg, + Register elements_reg, + Register scratch1, + LowDwVfpRegister double_scratch, + Label* fail, + int elements_offset) { Label smi_value, store; // Handle smi values specially. @@ -2083,23 +2126,24 @@ void MacroAssembler::StoreNumberToDoubleElements(Register value_reg, fail, DONT_DO_SMI_CHECK); - vldr(d0, FieldMemOperand(value_reg, HeapNumber::kValueOffset)); + vldr(double_scratch, FieldMemOperand(value_reg, HeapNumber::kValueOffset)); // Force a canonical NaN. if (emit_debug_code()) { vmrs(ip); tst(ip, Operand(kVFPDefaultNaNModeControlBit)); Assert(ne, "Default NaN mode not set"); } - VFPCanonicalizeNaN(d0); + VFPCanonicalizeNaN(double_scratch); b(&store); bind(&smi_value); - SmiToDouble(d0, value_reg); + SmiToDouble(double_scratch, value_reg); bind(&store); add(scratch1, elements_reg, Operand::DoubleOffsetFromSmiKey(key_reg)); - vstr(d0, FieldMemOperand(scratch1, - FixedDoubleArray::kHeaderSize - elements_offset)); + vstr(double_scratch, + FieldMemOperand(scratch1, + FixedDoubleArray::kHeaderSize - elements_offset)); } @@ -2405,8 +2449,7 @@ void MacroAssembler::IndexFromHash(Register hash, Register index) { } -void MacroAssembler::SmiToDouble(DwVfpRegister value, Register smi) { - ASSERT(value.code() < 16); +void MacroAssembler::SmiToDouble(LowDwVfpRegister value, Register smi) { if (CpuFeatures::IsSupported(VFP3)) { vmov(value.low(), smi); vcvt_f64_s32(value, 1); @@ -2419,7 +2462,7 @@ void MacroAssembler::SmiToDouble(DwVfpRegister value, Register smi) { void MacroAssembler::TestDoubleIsInt32(DwVfpRegister double_input, - DwVfpRegister double_scratch) { + LowDwVfpRegister double_scratch) { ASSERT(!double_input.is(double_scratch)); vcvt_s32_f64(double_scratch.low(), double_input); vcvt_f64_s32(double_scratch, double_scratch.low()); @@ -2429,7 +2472,7 @@ void MacroAssembler::TestDoubleIsInt32(DwVfpRegister double_input, void MacroAssembler::TryDoubleToInt32Exact(Register result, DwVfpRegister double_input, - DwVfpRegister double_scratch) { + LowDwVfpRegister double_scratch) { ASSERT(!double_input.is(double_scratch)); vcvt_s32_f64(double_scratch.low(), double_input); vmov(result, double_scratch.low()); @@ -2441,13 +2484,15 @@ void MacroAssembler::TryDoubleToInt32Exact(Register result, void MacroAssembler::TryInt32Floor(Register result, DwVfpRegister double_input, Register input_high, - DwVfpRegister double_scratch, + LowDwVfpRegister double_scratch, Label* done, Label* exact) { ASSERT(!result.is(input_high)); ASSERT(!double_input.is(double_scratch)); Label negative, exception; + VmovHigh(input_high, double_input); + // Test for NaN and infinities. Sbfx(result, input_high, HeapNumber::kExponentShift, HeapNumber::kExponentBits); @@ -2488,7 +2533,7 @@ void MacroAssembler::ECMAToInt32(Register result, Register scratch, Register scratch_high, Register scratch_low, - DwVfpRegister double_scratch) { + LowDwVfpRegister double_scratch) { ASSERT(!scratch_high.is(result)); ASSERT(!scratch_low.is(result)); ASSERT(!scratch_low.is(scratch_high)); @@ -3142,8 +3187,7 @@ void MacroAssembler::AllocateHeapNumberWithValue(Register result, // Copies a fixed number of fields of heap objects from src to dst. void MacroAssembler::CopyFields(Register dst, Register src, - DwVfpRegister double_scratch, - SwVfpRegister single_scratch, + LowDwVfpRegister double_scratch, int field_count) { int double_count = field_count / (DwVfpRegister::kSizeInBytes / kPointerSize); for (int i = 0; i < double_count; i++) { @@ -3156,9 +3200,9 @@ void MacroAssembler::CopyFields(Register dst, int remain = field_count % (DwVfpRegister::kSizeInBytes / kPointerSize); if (remain != 0) { - vldr(single_scratch, + vldr(double_scratch.low(), FieldMemOperand(src, (field_count - 1) * kPointerSize)); - vstr(single_scratch, + vstr(double_scratch.low(), FieldMemOperand(dst, (field_count - 1) * kPointerSize)); } } @@ -3260,9 +3304,10 @@ void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialAscii( Register scratch1, Register scratch2, Label* failure) { - int kFlatAsciiStringMask = + const int kFlatAsciiStringMask = kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask; - int kFlatAsciiStringTag = ASCII_STRING_TYPE; + const int kFlatAsciiStringTag = + kStringTag | kOneByteStringTag | kSeqStringTag; and_(scratch1, first, Operand(kFlatAsciiStringMask)); and_(scratch2, second, Operand(kFlatAsciiStringMask)); cmp(scratch1, Operand(kFlatAsciiStringTag)); @@ -3275,9 +3320,10 @@ void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialAscii( void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii(Register type, Register scratch, Label* failure) { - int kFlatAsciiStringMask = + const int kFlatAsciiStringMask = kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask; - int kFlatAsciiStringTag = ASCII_STRING_TYPE; + const int kFlatAsciiStringTag = + kStringTag | kOneByteStringTag | kSeqStringTag; and_(scratch, type, Operand(kFlatAsciiStringMask)); cmp(scratch, Operand(kFlatAsciiStringTag)); b(ne, failure); @@ -3657,13 +3703,12 @@ void MacroAssembler::ClampUint8(Register output_reg, Register input_reg) { void MacroAssembler::ClampDoubleToUint8(Register result_reg, DwVfpRegister input_reg, - DwVfpRegister temp_double_reg) { + LowDwVfpRegister double_scratch) { Label above_zero; Label done; Label in_bounds; - Vmov(temp_double_reg, 0.0); - VFPCompareAndSetFlags(input_reg, temp_double_reg); + VFPCompareAndSetFlags(input_reg, 0.0); b(gt, &above_zero); // Double value is less than zero, NaN or Inf, return 0. @@ -3672,8 +3717,8 @@ void MacroAssembler::ClampDoubleToUint8(Register result_reg, // Double value is >= 255, return 255. bind(&above_zero); - Vmov(temp_double_reg, 255.0, result_reg); - VFPCompareAndSetFlags(input_reg, temp_double_reg); + Vmov(double_scratch, 255.0, result_reg); + VFPCompareAndSetFlags(input_reg, double_scratch); b(le, &in_bounds); mov(result_reg, Operand(255)); b(al, &done); @@ -3685,8 +3730,8 @@ void MacroAssembler::ClampDoubleToUint8(Register result_reg, // Set rounding mode to round to the nearest integer by clearing bits[23:22]. bic(result_reg, ip, Operand(kVFPRoundingModeMask)); vmsr(result_reg); - vcvt_s32_f64(input_reg.low(), input_reg, kFPSCRRounding); - vmov(result_reg, input_reg.low()); + vcvt_s32_f64(double_scratch.low(), input_reg, kFPSCRRounding); + vmov(result_reg, double_scratch.low()); // Restore FPSCR. vmsr(ip); bind(&done); diff --git a/deps/v8/src/arm/macro-assembler-arm.h b/deps/v8/src/arm/macro-assembler-arm.h index 747dd3b..38308e5 100644 --- a/deps/v8/src/arm/macro-assembler-arm.h +++ b/deps/v8/src/arm/macro-assembler-arm.h @@ -484,6 +484,11 @@ class MacroAssembler: public Assembler { const double imm, const Register scratch = no_reg); + void VmovHigh(Register dst, DwVfpRegister src); + void VmovHigh(DwVfpRegister dst, Register src); + void VmovLow(Register dst, DwVfpRegister src); + void VmovLow(DwVfpRegister dst, Register src); + // Converts the smi or heap number in object to an int32 using the rules // for ToInt32 as described in ECMAScript 9.5.: the value is truncated // and brought into the range -2^31 .. +2^31 - 1. @@ -494,14 +499,14 @@ class MacroAssembler: public Assembler { Register scratch2, Register scratch3, DwVfpRegister double_scratch1, - DwVfpRegister double_scratch2, + LowDwVfpRegister double_scratch2, Label* not_int32); // Loads the number from object into dst register. // If |object| is neither smi nor heap number, |not_number| is jumped to // with |object| still intact. void LoadNumber(Register object, - DwVfpRegister dst, + LowDwVfpRegister dst, Register heap_number_map, Register scratch, Label* not_number); @@ -515,7 +520,7 @@ class MacroAssembler: public Assembler { DwVfpRegister double_dst, Register heap_number_map, Register scratch, - DwVfpRegister double_scratch, + LowDwVfpRegister double_scratch, Label* not_int32); // Loads the number from object into dst as a 32-bit integer. @@ -528,7 +533,7 @@ class MacroAssembler: public Assembler { Register heap_number_map, Register scratch, DwVfpRegister double_scratch0, - DwVfpRegister double_scratch1, + LowDwVfpRegister double_scratch1, Label* not_int32); @@ -796,8 +801,7 @@ class MacroAssembler: public Assembler { // Copies a fixed number of fields of heap objects from src to dst. void CopyFields(Register dst, Register src, - DwVfpRegister double_scratch, - SwVfpRegister single_scratch, + LowDwVfpRegister double_scratch, int field_count); // Copies a number of bytes from src to dst. All registers are clobbered. On @@ -874,6 +878,7 @@ class MacroAssembler: public Assembler { Register key_reg, Register elements_reg, Register scratch1, + LowDwVfpRegister double_scratch, Label* fail, int elements_offset = 0); @@ -957,26 +962,27 @@ class MacroAssembler: public Assembler { // Load the value of a smi object into a double register. // The register value must be between d0 and d15. - void SmiToDouble(DwVfpRegister value, Register smi); + void SmiToDouble(LowDwVfpRegister value, Register smi); // Check if a double can be exactly represented as a signed 32-bit integer. // Z flag set to one if true. void TestDoubleIsInt32(DwVfpRegister double_input, - DwVfpRegister double_scratch); + LowDwVfpRegister double_scratch); // Try to convert a double to a signed 32-bit integer. // Z flag set to one and result assigned if the conversion is exact. void TryDoubleToInt32Exact(Register result, DwVfpRegister double_input, - DwVfpRegister double_scratch); + LowDwVfpRegister double_scratch); // Floor a double and writes the value to the result register. // Go to exact if the conversion is exact (to be able to test -0), // fall through calling code if an overflow occurred, else go to done. + // In return, input_high is loaded with high bits of input. void TryInt32Floor(Register result, DwVfpRegister double_input, Register input_high, - DwVfpRegister double_scratch, + LowDwVfpRegister double_scratch, Label* done, Label* exact); @@ -989,7 +995,7 @@ class MacroAssembler: public Assembler { Register scratch, Register scratch_high, Register scratch_low, - DwVfpRegister double_scratch); + LowDwVfpRegister double_scratch); // Check whether d16-d31 are available on the CPU. The result is given by the // Z condition flag: Z==0 if d16-d31 available, Z==1 otherwise. @@ -1311,7 +1317,7 @@ class MacroAssembler: public Assembler { void ClampDoubleToUint8(Register result_reg, DwVfpRegister input_reg, - DwVfpRegister temp_double_reg); + LowDwVfpRegister double_scratch); void LoadInstanceDescriptors(Register map, Register descriptors); diff --git a/deps/v8/src/arm/simulator-arm.cc b/deps/v8/src/arm/simulator-arm.cc index c47f2ab..c9e3616 100644 --- a/deps/v8/src/arm/simulator-arm.cc +++ b/deps/v8/src/arm/simulator-arm.cc @@ -3111,6 +3111,15 @@ void Simulator::DecodeTypeVFP(Instruction* instr) { OS::MemCopy(&dd_value, data, 8); set_d_register_from_double(vd, dd_value); } else if ((instr->VLValue() == 0x1) && + (instr->VCValue() == 0x1) && + (instr->Bit(23) == 0x0)) { + // vmov (scalar to ARM core register) + int vn = instr->Bits(19, 16) | (instr->Bit(7) << 4); + double dn_value = get_double_from_d_register(vn); + int32_t data[2]; + OS::MemCopy(data, &dn_value, 8); + set_register(instr->RtValue(), data[instr->Bit(21)]); + } else if ((instr->VLValue() == 0x1) && (instr->VCValue() == 0x0) && (instr->VAValue() == 0x7) && (instr->Bits(19, 16) == 0x1)) { diff --git a/deps/v8/src/arm/stub-cache-arm.cc b/deps/v8/src/arm/stub-cache-arm.cc index d7b1b55..f7fa9ef 100644 --- a/deps/v8/src/arm/stub-cache-arm.cc +++ b/deps/v8/src/arm/stub-cache-arm.cc @@ -479,10 +479,9 @@ void BaseStoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, Representation representation = details.representation(); ASSERT(!representation.IsNone()); - if (details.type() == CONSTANT_FUNCTION) { - Handle constant( - HeapObject::cast(descriptors->GetValue(descriptor))); - __ LoadHeapObject(scratch1, constant); + if (details.type() == CONSTANT) { + Handle constant(descriptors->GetValue(descriptor), masm->isolate()); + __ LoadObject(scratch1, constant); __ cmp(value_reg, scratch1); __ b(ne, miss_label); } else if (FLAG_track_fields && representation.IsSmi()) { @@ -543,7 +542,7 @@ void BaseStoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); - if (details.type() == CONSTANT_FUNCTION) { + if (details.type() == CONSTANT) { ASSERT(value_reg.is(r0)); __ Ret(); return; @@ -1399,9 +1398,9 @@ void BaseLoadStubCompiler::GenerateLoadField(Register reg, } -void BaseLoadStubCompiler::GenerateLoadConstant(Handle value) { +void BaseLoadStubCompiler::GenerateLoadConstant(Handle value) { // Return the constant value. - __ LoadHeapObject(r0, value); + __ LoadObject(r0, value); __ Ret(); } @@ -1814,7 +1813,7 @@ Handle CallStubCompiler::CompileArrayPushCall( __ b(gt, &call_builtin); __ ldr(r4, MemOperand(sp, (argc - 1) * kPointerSize)); - __ StoreNumberToDoubleElements(r4, r0, elements, r5, + __ StoreNumberToDoubleElements(r4, r0, elements, r5, d0, &call_builtin, argc * kDoubleSize); // Save new length. @@ -2670,7 +2669,7 @@ Handle CallStubCompiler::CompileCallConstant( Handle code = CompileCustomCall(object, holder, Handle::null(), function, Handle::cast(name), - Code::CONSTANT_FUNCTION); + Code::CONSTANT); // A null handle means bail out to the regular compiler code below. if (!code.is_null()) return code; } @@ -3195,7 +3194,7 @@ static void GenerateSmiKeyCheck(MacroAssembler* masm, Register key, Register scratch0, DwVfpRegister double_scratch0, - DwVfpRegister double_scratch1, + LowDwVfpRegister double_scratch1, Label* fail) { Label key_ok; // Check for smi or a smi inside a heap number. We convert the heap @@ -3604,7 +3603,7 @@ void KeyedStoreStubCompiler::GenerateStoreFastDoubleElement( __ bind(&finish_store); __ StoreNumberToDoubleElements(value_reg, key_reg, elements_reg, - scratch1, &transition_elements_kind); + scratch1, d0, &transition_elements_kind); __ Ret(); // Handle store cache miss, replacing the ic with the generic stub. @@ -3652,7 +3651,7 @@ void KeyedStoreStubCompiler::GenerateStoreFastDoubleElement( __ mov(scratch1, elements_reg); __ StoreNumberToDoubleElements(value_reg, key_reg, scratch1, - scratch2, &transition_elements_kind); + scratch2, d0, &transition_elements_kind); __ mov(scratch1, Operand(kHoleNanLower32)); __ mov(scratch2, Operand(kHoleNanUpper32)); diff --git a/deps/v8/src/ast.cc b/deps/v8/src/ast.cc index f34c7bb..e0bca67 100644 --- a/deps/v8/src/ast.cc +++ b/deps/v8/src/ast.cc @@ -565,11 +565,16 @@ bool Call::ComputeTarget(Handle type, Handle name) { type->LookupDescriptor(NULL, *name, &lookup); if (lookup.IsFound()) { switch (lookup.type()) { - case CONSTANT_FUNCTION: + case CONSTANT: { // We surely know the target for a constant function. - target_ = - Handle(lookup.GetConstantFunctionFromMap(*type)); - return true; + Handle constant(lookup.GetConstantFromMap(*type), + type->GetIsolate()); + if (constant->IsJSFunction()) { + target_ = Handle::cast(constant); + return true; + } + // Fall through. + } case NORMAL: case FIELD: case CALLBACKS: diff --git a/deps/v8/src/bootstrapper.cc b/deps/v8/src/bootstrapper.cc index 281f8b9..dda5fe4 100644 --- a/deps/v8/src/bootstrapper.cc +++ b/deps/v8/src/bootstrapper.cc @@ -1095,12 +1095,12 @@ void Genesis::InitializeGlobal(Handle inner_global, JSObject::SetLocalPropertyIgnoreAttributes( result, factory->length_string(), factory->undefined_value(), DONT_ENUM, - Object::FORCE_TAGGED)); + Object::FORCE_TAGGED, JSReceiver::FORCE_FIELD)); CHECK_NOT_EMPTY_HANDLE(isolate, JSObject::SetLocalPropertyIgnoreAttributes( result, factory->callee_string(), factory->undefined_value(), DONT_ENUM, - Object::FORCE_TAGGED)); + Object::FORCE_TAGGED, JSReceiver::FORCE_FIELD)); #ifdef DEBUG LookupResult lookup(isolate); @@ -2475,14 +2475,13 @@ void Genesis::TransferNamedProperties(Handle from, to, key, value, details.attributes())); break; } - case CONSTANT_FUNCTION: { + case CONSTANT: { HandleScope inner(isolate()); Handle key = Handle(descs->GetKey(i)); - Handle fun = - Handle(descs->GetConstantFunction(i)); + Handle constant(descs->GetConstant(i), isolate()); CHECK_NOT_EMPTY_HANDLE(isolate(), JSObject::SetLocalPropertyIgnoreAttributes( - to, key, fun, details.attributes())); + to, key, constant, details.attributes())); break; } case CALLBACKS: { diff --git a/deps/v8/src/code-stubs-hydrogen.cc b/deps/v8/src/code-stubs-hydrogen.cc index 324dfa9..651ce0a 100644 --- a/deps/v8/src/code-stubs-hydrogen.cc +++ b/deps/v8/src/code-stubs-hydrogen.cc @@ -129,7 +129,7 @@ bool CodeStubGraphBuilderBase::BuildGraph() { // Update the static counter each time a new code stub is generated. isolate()->counters()->code_stubs()->Increment(); - if (FLAG_trace_hydrogen) { + if (FLAG_trace_hydrogen_stubs) { const char* name = CodeStub::MajorName(stub()->MajorKey(), false); PrintF("-----------------------------------------------------------\n"); PrintF("Compiling stub %s using hydrogen\n", name); @@ -178,7 +178,7 @@ bool CodeStubGraphBuilderBase::BuildGraph() { AddInstruction(context_); start_environment->BindContext(context_); - AddSimulate(BailoutId::StubEntry()); + Add(BailoutId::StubEntry()); NoObservableSideEffectsScope no_effects(this); @@ -307,6 +307,37 @@ static Handle DoGenerateCode(Stub* stub) { template <> +HValue* CodeStubGraphBuilder::BuildCodeStub() { + HValue* value = GetParameter(0); + + // Check if the parameter is already a SMI or heap number. + IfBuilder if_number(this); + if_number.If(value); + if_number.OrIf(value, isolate()->factory()->heap_number_map()); + if_number.Then(); + + // Return the number. + Push(value); + + if_number.Else(); + + // Convert the parameter to number using the builtin. + HValue* function = AddLoadJSBuiltin(Builtins::TO_NUMBER, context()); + Add(value); + Push(Add(context(), function, 1)); + + if_number.End(); + + return Pop(); +} + + +Handle ToNumberStub::GenerateCode() { + return DoGenerateCode(this); +} + + +template <> HValue* CodeStubGraphBuilder::BuildCodeStub() { Zone* zone = this->zone(); Factory* factory = isolate()->factory(); @@ -366,9 +397,10 @@ HValue* CodeStubGraphBuilder::BuildCodeStub() { length)); } - HValue* result = environment()->Pop(); checker.ElseDeopt(); - return result; + checker.End(); + + return environment()->Pop(); } @@ -416,8 +448,11 @@ HValue* CodeStubGraphBuilder::BuildCodeStub() { AddStore(object, access, AddLoad(boilerplate, access)); } + environment()->Push(object); checker.ElseDeopt(); - return object; + checker.End(); + + return environment()->Pop(); } @@ -486,11 +521,11 @@ Handle KeyedLoadFastElementStub::GenerateCode() { template<> HValue* CodeStubGraphBuilder::BuildCodeStub() { + Representation rep = casted_stub()->representation(); HObjectAccess access = casted_stub()->is_inobject() ? - HObjectAccess::ForJSObjectOffset(casted_stub()->offset()) : - HObjectAccess::ForBackingStoreOffset(casted_stub()->offset()); - return AddInstruction(BuildLoadNamedField(GetParameter(0), access, - casted_stub()->representation())); + HObjectAccess::ForJSObjectOffset(casted_stub()->offset(), rep) : + HObjectAccess::ForBackingStoreOffset(casted_stub()->offset(), rep); + return AddInstruction(BuildLoadNamedField(GetParameter(0), access)); } @@ -501,11 +536,11 @@ Handle LoadFieldStub::GenerateCode() { template<> HValue* CodeStubGraphBuilder::BuildCodeStub() { + Representation rep = casted_stub()->representation(); HObjectAccess access = casted_stub()->is_inobject() ? - HObjectAccess::ForJSObjectOffset(casted_stub()->offset()) : - HObjectAccess::ForBackingStoreOffset(casted_stub()->offset()); - return AddInstruction(BuildLoadNamedField(GetParameter(0), access, - casted_stub()->representation())); + HObjectAccess::ForJSObjectOffset(casted_stub()->offset(), rep) : + HObjectAccess::ForBackingStoreOffset(casted_stub()->offset(), rep); + return AddInstruction(BuildLoadNamedField(GetParameter(0), access)); } @@ -850,23 +885,26 @@ HValue* CodeStubGraphBuilder::BuildCodeInitializedStub() { HParameter* receiver = GetParameter(0); HParameter* value = GetParameter(2); - if (stub->is_constant()) { - // Assume every store to a constant value changes it. - current_block()->FinishExitWithDeoptimization(HDeoptimize::kUseAll); - set_current_block(NULL); - } else { - HValue* cell = Add(placeholder_cell, Representation::Tagged()); + // Check that the map of the global has not changed: use a placeholder map + // that will be replaced later with the global object's map. + Handle placeholder_map = isolate()->factory()->meta_map(); + AddInstruction(HCheckMaps::New( + receiver, placeholder_map, zone(), top_info())); - // Check that the map of the global has not changed: use a placeholder map - // that will be replaced later with the global object's map. - Handle placeholder_map = isolate()->factory()->meta_map(); - AddInstruction(HCheckMaps::New(receiver, placeholder_map, zone())); + HValue* cell = Add(placeholder_cell, Representation::Tagged()); + HObjectAccess access(HObjectAccess::ForCellPayload(isolate())); + HValue* cell_contents = Add(cell, access); + if (stub->is_constant()) { + IfBuilder builder(this); + builder.If(cell_contents, value); + builder.Then(); + builder.ElseDeopt(); + builder.End(); + } else { // Load the payload of the global parameter cell. A hole indicates that the // property has been deleted and that the store must be handled by the // runtime. - HObjectAccess access(HObjectAccess::ForCellPayload(isolate())); - HValue* cell_contents = Add(cell, access); IfBuilder builder(this); HValue* hole_value = Add(hole, Representation::Tagged()); builder.If(cell_contents, hole_value); @@ -876,6 +914,7 @@ HValue* CodeStubGraphBuilder::BuildCodeInitializedStub() { Add(cell, access, value); builder.End(); } + return value; } @@ -894,8 +933,7 @@ HValue* CodeStubGraphBuilder::BuildCodeStub() { if (FLAG_trace_elements_transitions) { // Tracing elements transitions is the job of the runtime. - current_block()->FinishExitWithDeoptimization(HDeoptimize::kUseAll); - set_current_block(NULL); + Add(Deoptimizer::EAGER); } else { info()->MarkAsSavesCallerDoubles(); diff --git a/deps/v8/src/code-stubs.h b/deps/v8/src/code-stubs.h index 3359354..bc581d8 100644 --- a/deps/v8/src/code-stubs.h +++ b/deps/v8/src/code-stubs.h @@ -474,15 +474,19 @@ class InterruptStub : public PlatformCodeStub { }; -class ToNumberStub: public PlatformCodeStub { +class ToNumberStub: public HydrogenCodeStub { public: ToNumberStub() { } - void Generate(MacroAssembler* masm); + virtual Handle GenerateCode(); + + virtual void InitializeInterfaceDescriptor( + Isolate* isolate, + CodeStubInterfaceDescriptor* descriptor); private: Major MajorKey() { return ToNumber; } - int MinorKey() { return 0; } + int NotMissMinorKey() { return 0; } }; diff --git a/deps/v8/src/codegen.cc b/deps/v8/src/codegen.cc index 8029d2f..2031b32 100644 --- a/deps/v8/src/codegen.cc +++ b/deps/v8/src/codegen.cc @@ -125,6 +125,7 @@ Handle CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm, void CodeGenerator::PrintCode(Handle code, CompilationInfo* info) { #ifdef ENABLE_DISASSEMBLER + AllowDeferredHandleDereference allow_deference_for_print_code; bool print_code = Isolate::Current()->bootstrapper()->IsActive() ? FLAG_print_builtin_code : (FLAG_print_code || diff --git a/deps/v8/src/compiler.cc b/deps/v8/src/compiler.cc index c299577..ebd1266 100644 --- a/deps/v8/src/compiler.cc +++ b/deps/v8/src/compiler.cc @@ -969,7 +969,9 @@ void Compiler::RecompileParallel(Handle closure) { if (!isolate->optimizing_compiler_thread()->IsQueueAvailable()) { if (FLAG_trace_parallel_recompilation) { - PrintF(" ** Compilation queue, will retry opting on next run.\n"); + PrintF(" ** Compilation queue full, will retry optimizing "); + closure->PrintName(); + PrintF(" on next run.\n"); } return; } @@ -1247,10 +1249,13 @@ CompilationPhase::~CompilationPhase() { bool CompilationPhase::ShouldProduceTraceOutput() const { - // Produce trace output if flag is set so that the first letter of the - // phase name matches the command line parameter FLAG_trace_phase. - return (FLAG_trace_hydrogen && - OS::StrChr(const_cast(FLAG_trace_phase), name_[0]) != NULL); + // Trace if the appropriate trace flag is set and the phase name's first + // character is in the FLAG_trace_phase command line parameter. + bool tracing_on = info()->IsStub() ? + FLAG_trace_hydrogen_stubs : + FLAG_trace_hydrogen; + return (tracing_on && + OS::StrChr(const_cast(FLAG_trace_phase), name_[0]) != NULL); } } } // namespace v8::internal diff --git a/deps/v8/src/cpu-profiler.cc b/deps/v8/src/cpu-profiler.cc index d3fadb5..0d226cf 100644 --- a/deps/v8/src/cpu-profiler.cc +++ b/deps/v8/src/cpu-profiler.cc @@ -264,7 +264,7 @@ void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, Code* code, SharedFunctionInfo* shared, CompilationInfo* info, - String* source, int line) { + Name* source, int line) { if (FilterOutCodeCreateEvent(tag)) return; CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION); CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; diff --git a/deps/v8/src/cpu-profiler.h b/deps/v8/src/cpu-profiler.h index 44e63fe..66e2b8b 100644 --- a/deps/v8/src/cpu-profiler.h +++ b/deps/v8/src/cpu-profiler.h @@ -173,14 +173,14 @@ class ProfilerEventsProcessor : public Thread { }; -#define PROFILE(IsolateGetter, Call) \ - do { \ - Isolate* cpu_profiler_isolate = (IsolateGetter); \ - LOG_CODE_EVENT(cpu_profiler_isolate, Call); \ - CpuProfiler* cpu_profiler = cpu_profiler_isolate->cpu_profiler(); \ - if (cpu_profiler->is_profiling()) { \ - cpu_profiler->Call; \ - } \ +#define PROFILE(IsolateGetter, Call) \ + do { \ + Isolate* cpu_profiler_isolate = (IsolateGetter); \ + v8::internal::Logger* logger = cpu_profiler_isolate->logger(); \ + CpuProfiler* cpu_profiler = cpu_profiler_isolate->cpu_profiler(); \ + if (logger->is_logging_code_events() || cpu_profiler->is_profiling()) { \ + logger->Call; \ + } \ } while (false) @@ -223,7 +223,7 @@ class CpuProfiler { Code* code, SharedFunctionInfo* shared, CompilationInfo* info, - String* source, int line); + Name* source, int line); void CodeCreateEvent(Logger::LogEventsAndTags tag, Code* code, int args_count); void CodeMovingGCEvent() {} diff --git a/deps/v8/src/d8.cc b/deps/v8/src/d8.cc index e576e9c..1efe2ae 100644 --- a/deps/v8/src/d8.cc +++ b/deps/v8/src/d8.cc @@ -457,16 +457,6 @@ void Shell::Write(const v8::FunctionCallbackInfo& args) { } -void Shell::EnableProfiler(const v8::FunctionCallbackInfo& args) { - V8::ResumeProfiler(); -} - - -void Shell::DisableProfiler(const v8::FunctionCallbackInfo& args) { - V8::PauseProfiler(); -} - - void Shell::Read(const v8::FunctionCallbackInfo& args) { String::Utf8Value file(args[0]); if (*file == NULL) { @@ -857,10 +847,6 @@ Handle Shell::CreateGlobalTemplate(Isolate* isolate) { global_template->Set(String::New("load"), FunctionTemplate::New(Load)); global_template->Set(String::New("quit"), FunctionTemplate::New(Quit)); global_template->Set(String::New("version"), FunctionTemplate::New(Version)); - global_template->Set(String::New("enableProfiler"), - FunctionTemplate::New(EnableProfiler)); - global_template->Set(String::New("disableProfiler"), - FunctionTemplate::New(DisableProfiler)); // Bind the Realm object. Handle realm_template = ObjectTemplate::New(); @@ -1561,11 +1547,12 @@ int Shell::RunMain(Isolate* isolate, int argc, char* argv[]) { #ifdef V8_SHARED -static void EnableHarmonyTypedArraysViaCommandLine() { - int fake_argc = 2; - char **fake_argv = new char*[2]; +static void SetStandaloneFlagsViaCommandLine() { + int fake_argc = 3; + char **fake_argv = new char*[3]; fake_argv[0] = NULL; fake_argv[1] = strdup("--harmony-typed-arrays"); + fake_argv[2] = strdup("--trace-hydrogen-file=hydrogen.cfg"); v8::V8::SetFlagsFromCommandLine(&fake_argc, fake_argv, false); free(fake_argv[1]); delete[] fake_argv; @@ -1586,8 +1573,9 @@ int Shell::Main(int argc, char* argv[]) { #ifndef V8_SHARED i::FLAG_harmony_array_buffer = true; i::FLAG_harmony_typed_arrays = true; + i::FLAG_trace_hydrogen_file = "hydrogen.cfg"; #else - EnableHarmonyTypedArraysViaCommandLine(); + SetStandaloneFlagsViaCommandLine(); #endif ShellArrayBufferAllocator array_buffer_allocator; v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); diff --git a/deps/v8/src/d8.h b/deps/v8/src/d8.h index 804cc46..4f04342 100644 --- a/deps/v8/src/d8.h +++ b/deps/v8/src/d8.h @@ -317,8 +317,6 @@ class Shell : public i::AllStatic { static void Write(const v8::FunctionCallbackInfo& args); static void Quit(const v8::FunctionCallbackInfo& args); static void Version(const v8::FunctionCallbackInfo& args); - static void EnableProfiler(const v8::FunctionCallbackInfo& args); - static void DisableProfiler(const v8::FunctionCallbackInfo& args); static void Read(const v8::FunctionCallbackInfo& args); static void ReadBuffer(const v8::FunctionCallbackInfo& args); static Handle ReadFromStdin(Isolate* isolate); diff --git a/deps/v8/src/debug-debugger.js b/deps/v8/src/debug-debugger.js index 88efbe2..a588b4c 100644 --- a/deps/v8/src/debug-debugger.js +++ b/deps/v8/src/debug-debugger.js @@ -1469,8 +1469,6 @@ DebugCommandProcessor.prototype.processDebugJSONRequest = function( this.suspendRequest_(request, response); } else if (request.command == 'version') { this.versionRequest_(request, response); - } else if (request.command == 'profile') { - this.profileRequest_(request, response); } else if (request.command == 'changelive') { this.changeLiveRequest_(request, response); } else if (request.command == 'restartframe') { @@ -2400,18 +2398,6 @@ DebugCommandProcessor.prototype.versionRequest_ = function(request, response) { }; -DebugCommandProcessor.prototype.profileRequest_ = function(request, response) { - if (request.arguments.command == 'resume') { - %ProfilerResume(); - } else if (request.arguments.command == 'pause') { - %ProfilerPause(); - } else { - return response.failed('Unknown command'); - } - response.body = {}; -}; - - DebugCommandProcessor.prototype.changeLiveRequest_ = function( request, response) { if (!request.arguments) { diff --git a/deps/v8/src/debug.cc b/deps/v8/src/debug.cc index 04f8a7a..8454438 100644 --- a/deps/v8/src/debug.cc +++ b/deps/v8/src/debug.cc @@ -2044,6 +2044,10 @@ void Debug::PrepareForBreakPoints() { // If preparing for the first break point make sure to deoptimize all // functions as debugging does not work with optimized code. if (!has_break_points_) { + if (FLAG_parallel_recompilation) { + isolate_->optimizing_compiler_thread()->Flush(); + } + Deoptimizer::DeoptimizeAll(isolate_); Handle lazy_compile = diff --git a/deps/v8/src/deoptimizer.cc b/deps/v8/src/deoptimizer.cc index fd7c282..53b9b76 100644 --- a/deps/v8/src/deoptimizer.cc +++ b/deps/v8/src/deoptimizer.cc @@ -331,34 +331,47 @@ void Deoptimizer::VisitAllOptimizedFunctions( // Removes the functions selected by the given filter from the optimized -// function list of the given context and partitions the removed functions -// into one or more lists such that all functions in a list share the same -// code. The head of each list is written in the deoptimizing_functions field -// of the corresponding code object. -// The found code objects are returned in the given zone list. -static void PartitionOptimizedFunctions(Context* context, - OptimizedFunctionFilter* filter, - ZoneList* partitions, - Zone* zone, - Object* undefined) { +// function list of the given context and adds their code to the list of +// code objects to be deoptimized. +static void SelectCodeToDeoptimize(Context* context, + OptimizedFunctionFilter* filter, + ZoneList* codes, + Zone* zone, + Object* undefined) { DisallowHeapAllocation no_allocation; Object* current = context->get(Context::OPTIMIZED_FUNCTIONS_LIST); Object* remainder_head = undefined; Object* remainder_tail = undefined; - ASSERT_EQ(0, partitions->length()); + + // TODO(titzer): rewrite to not modify unselected functions. while (current != undefined) { JSFunction* function = JSFunction::cast(current); current = function->next_function_link(); if (filter->TakeFunction(function)) { + // Extract this function from the context's list and remember the code. Code* code = function->code(); - if (code->deoptimizing_functions() == undefined) { - partitions->Add(code, zone); + ASSERT(code->kind() == Code::OPTIMIZED_FUNCTION); + if (code->marked_for_deoptimization()) { + ASSERT(codes->Contains(code)); } else { - ASSERT(partitions->Contains(code)); + code->set_marked_for_deoptimization(true); + codes->Add(code, zone); + } + SharedFunctionInfo* shared = function->shared(); + // Replace the function's code with the shared code. + function->set_code(shared->code()); + // Evict the code from the optimized code map. + shared->EvictFromOptimizedCodeMap(code, "deoptimized function"); + // Remove the function from the optimized functions list. + function->set_next_function_link(undefined); + + if (FLAG_trace_deopt) { + PrintF("[forced deoptimization: "); + function->PrintName(); + PrintF(" / %" V8PRIxPTR "]\n", reinterpret_cast(function)); } - function->set_next_function_link(code->deoptimizing_functions()); - code->set_deoptimizing_functions(function); } else { + // Don't select this function; link it back into the list. if (remainder_head == undefined) { remainder_head = function; } else { @@ -393,6 +406,14 @@ class DeoptimizeWithMatchingCodeFilter : public OptimizedFunctionFilter { }; +class DeoptimizeMarkedCodeFilter : public OptimizedFunctionFilter { + public: + virtual bool TakeFunction(JSFunction* function) { + return function->code()->marked_for_deoptimization(); + } +}; + + void Deoptimizer::DeoptimizeAll(Isolate* isolate) { DisallowHeapAllocation no_allocation; @@ -421,19 +442,11 @@ void Deoptimizer::DeoptimizeGlobalObject(JSObject* object) { void Deoptimizer::DeoptimizeFunction(JSFunction* function) { - if (!function->IsOptimized()) return; Code* code = function->code(); - Context* context = function->context()->native_context(); - Isolate* isolate = context->GetIsolate(); - Object* undefined = isolate->heap()->undefined_value(); - Zone zone(isolate); - ZoneList codes(1, &zone); + if (code->kind() != Code::OPTIMIZED_FUNCTION) return; DeoptimizeWithMatchingCodeFilter filter(code); - PartitionOptimizedFunctions(context, &filter, &codes, &zone, undefined); - ASSERT_EQ(1, codes.length()); - DeoptimizeFunctionWithPreparedFunctionList( - JSFunction::cast(codes.at(0)->deoptimizing_functions())); - codes.at(0)->set_deoptimizing_functions(undefined); + DeoptimizeAllFunctionsForContext( + function->context()->native_context(), &filter); } @@ -443,12 +456,10 @@ void Deoptimizer::DeoptimizeAllFunctionsForContext( Isolate* isolate = context->GetIsolate(); Object* undefined = isolate->heap()->undefined_value(); Zone zone(isolate); - ZoneList codes(1, &zone); - PartitionOptimizedFunctions(context, filter, &codes, &zone, undefined); - for (int i = 0; i < codes.length(); ++i) { - DeoptimizeFunctionWithPreparedFunctionList( - JSFunction::cast(codes.at(i)->deoptimizing_functions())); - codes.at(i)->set_deoptimizing_functions(undefined); + ZoneList codes(4, &zone); + SelectCodeToDeoptimize(context, filter, &codes, &zone, undefined); + for (int i = 0; i < codes.length(); i++) { + DeoptimizeCode(isolate, codes.at(i)); } } @@ -466,6 +477,55 @@ void Deoptimizer::DeoptimizeAllFunctionsWith(Isolate* isolate, } +void Deoptimizer::DeoptimizeCodeList(Isolate* isolate, ZoneList* codes) { + if (codes->length() == 0) return; // Nothing to do. + + // Mark the code; any functions refering to this code will be selected. + for (int i = 0; i < codes->length(); i++) { + ASSERT(!codes->at(i)->marked_for_deoptimization()); + codes->at(i)->set_marked_for_deoptimization(true); + } + + // For all contexts, remove optimized functions that refer to the selected + // code from the optimized function lists. + Object* undefined = isolate->heap()->undefined_value(); + Zone zone(isolate); + Object* list = isolate->heap()->native_contexts_list(); + DeoptimizeMarkedCodeFilter filter; + while (!list->IsUndefined()) { + Context* context = Context::cast(list); + // Note that selecting code unlinks the functions that refer to it. + SelectCodeToDeoptimize(context, &filter, codes, &zone, undefined); + list = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK); + } + + // Now deoptimize all the code. + for (int i = 0; i < codes->length(); i++) { + DeoptimizeCode(isolate, codes->at(i)); + } +} + + +void Deoptimizer::DeoptimizeCode(Isolate* isolate, Code* code) { + HandleScope scope(isolate); + DisallowHeapAllocation nha; + + // Do platform-specific patching of the optimized code. + PatchCodeForDeoptimization(isolate, code); + + // Add the deoptimizing code to the list. + DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code); + DeoptimizerData* data = isolate->deoptimizer_data(); + node->set_next(data->deoptimizing_code_list_); + data->deoptimizing_code_list_ = node; + + // We might be in the middle of incremental marking with compaction. + // Tell collector to treat this code object in a special way and + // ignore all slots that might have been recorded on it. + isolate->heap()->mark_compact_collector()->InvalidateCode(code); +} + + void Deoptimizer::HandleWeakDeoptimizedCode(v8::Isolate* isolate, v8::Persistent* obj, void* parameter) { @@ -900,15 +960,15 @@ void Deoptimizer::DoComputeJSFrame(TranslationIterator* iterator, // input frame. For all subsequent output frames, it can be read from the // previous one. This frame's pc can be computed from the non-optimized // function code and AST id of the bailout. - output_offset -= kPointerSize; - input_offset -= kPointerSize; + output_offset -= kPCOnStackSize; + input_offset -= kPCOnStackSize; intptr_t value; if (is_bottommost) { value = input_->GetFrameSlot(input_offset); } else { value = output_[frame_index - 1]->GetPc(); } - output_frame->SetFrameSlot(output_offset, value); + output_frame->SetCallerPc(output_offset, value); if (trace_) { PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" V8PRIxPTR " ; caller's pc\n", @@ -919,14 +979,14 @@ void Deoptimizer::DoComputeJSFrame(TranslationIterator* iterator, // as in the input frame. For all subsequent output frames, it can be // read from the previous one. Also compute and set this frame's frame // pointer. - output_offset -= kPointerSize; - input_offset -= kPointerSize; + output_offset -= kFPOnStackSize; + input_offset -= kFPOnStackSize; if (is_bottommost) { value = input_->GetFrameSlot(input_offset); } else { value = output_[frame_index - 1]->GetFp(); } - output_frame->SetFrameSlot(output_offset, value); + output_frame->SetCallerFp(output_offset, value); intptr_t fp_value = top_address + output_offset; ASSERT(!is_bottommost || (input_->GetRegister(fp_reg.code()) + has_alignment_padding_ * kPointerSize) == fp_value); @@ -1049,9 +1109,9 @@ void Deoptimizer::DoComputeArgumentsAdaptorFrame(TranslationIterator* iterator, } // Read caller's PC from the previous frame. - output_offset -= kPointerSize; + output_offset -= kPCOnStackSize; intptr_t callers_pc = output_[frame_index - 1]->GetPc(); - output_frame->SetFrameSlot(output_offset, callers_pc); + output_frame->SetCallerPc(output_offset, callers_pc); if (trace_) { PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" V8PRIxPTR " ; caller's pc\n", @@ -1059,9 +1119,9 @@ void Deoptimizer::DoComputeArgumentsAdaptorFrame(TranslationIterator* iterator, } // Read caller's FP from the previous frame, and set this frame's FP. - output_offset -= kPointerSize; + output_offset -= kFPOnStackSize; intptr_t value = output_[frame_index - 1]->GetFp(); - output_frame->SetFrameSlot(output_offset, value); + output_frame->SetCallerFp(output_offset, value); intptr_t fp_value = top_address + output_offset; output_frame->SetFp(fp_value); if (trace_) { @@ -1152,9 +1212,9 @@ void Deoptimizer::DoComputeConstructStubFrame(TranslationIterator* iterator, } // Read caller's PC from the previous frame. - output_offset -= kPointerSize; + output_offset -= kPCOnStackSize; intptr_t callers_pc = output_[frame_index - 1]->GetPc(); - output_frame->SetFrameSlot(output_offset, callers_pc); + output_frame->SetCallerPc(output_offset, callers_pc); if (trace_) { PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" V8PRIxPTR " ; caller's pc\n", @@ -1162,9 +1222,9 @@ void Deoptimizer::DoComputeConstructStubFrame(TranslationIterator* iterator, } // Read caller's FP from the previous frame, and set this frame's FP. - output_offset -= kPointerSize; + output_offset -= kFPOnStackSize; intptr_t value = output_[frame_index - 1]->GetFp(); - output_frame->SetFrameSlot(output_offset, value); + output_frame->SetCallerFp(output_offset, value); intptr_t fp_value = top_address + output_offset; output_frame->SetFp(fp_value); if (trace_) { @@ -1265,7 +1325,9 @@ void Deoptimizer::DoComputeAccessorStubFrame(TranslationIterator* iterator, // MacroAssembler::EnterFrame). For a setter stub frame we need one additional // entry for the implicit return value, see // StoreStubCompiler::CompileStoreViaSetter. - unsigned fixed_frame_entries = 1 + 4 + (is_setter_stub_frame ? 1 : 0); + unsigned fixed_frame_entries = (kPCOnStackSize / kPointerSize) + + (kFPOnStackSize / kPointerSize) + 3 + + (is_setter_stub_frame ? 1 : 0); unsigned fixed_frame_size = fixed_frame_entries * kPointerSize; unsigned output_frame_size = height_in_bytes + fixed_frame_size; @@ -1287,9 +1349,9 @@ void Deoptimizer::DoComputeAccessorStubFrame(TranslationIterator* iterator, unsigned output_offset = output_frame_size; // Read caller's PC from the previous frame. - output_offset -= kPointerSize; + output_offset -= kPCOnStackSize; intptr_t callers_pc = output_[frame_index - 1]->GetPc(); - output_frame->SetFrameSlot(output_offset, callers_pc); + output_frame->SetCallerPc(output_offset, callers_pc); if (trace_) { PrintF(" 0x%08" V8PRIxPTR ": [top + %u] <- 0x%08" V8PRIxPTR " ; caller's pc\n", @@ -1297,9 +1359,9 @@ void Deoptimizer::DoComputeAccessorStubFrame(TranslationIterator* iterator, } // Read caller's FP from the previous frame, and set this frame's FP. - output_offset -= kPointerSize; + output_offset -= kFPOnStackSize; intptr_t value = output_[frame_index - 1]->GetFp(); - output_frame->SetFrameSlot(output_offset, value); + output_frame->SetCallerFp(output_offset, value); intptr_t fp_value = top_address + output_offset; output_frame->SetFp(fp_value); if (trace_) { @@ -1435,10 +1497,10 @@ void Deoptimizer::DoComputeCompiledStubFrame(TranslationIterator* iterator, output_frame->SetTop(top_address); // Read caller's PC (JSFunction continuation) from the input frame. - unsigned input_frame_offset = input_frame_size - kPointerSize; - unsigned output_frame_offset = output_frame_size - kPointerSize; + unsigned input_frame_offset = input_frame_size - kPCOnStackSize; + unsigned output_frame_offset = output_frame_size - kFPOnStackSize; intptr_t value = input_->GetFrameSlot(input_frame_offset); - output_frame->SetFrameSlot(output_frame_offset, value); + output_frame->SetCallerPc(output_frame_offset, value); if (trace_) { PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" V8PRIxPTR " ; caller's pc\n", @@ -1446,10 +1508,10 @@ void Deoptimizer::DoComputeCompiledStubFrame(TranslationIterator* iterator, } // Read caller's FP from the input frame, and set this frame's FP. - input_frame_offset -= kPointerSize; + input_frame_offset -= kFPOnStackSize; value = input_->GetFrameSlot(input_frame_offset); - output_frame_offset -= kPointerSize; - output_frame->SetFrameSlot(output_frame_offset, value); + output_frame_offset -= kFPOnStackSize; + output_frame->SetCallerFp(output_frame_offset, value); intptr_t frame_ptr = input_->GetRegister(fp_reg.code()); output_frame->SetRegister(fp_reg.code(), frame_ptr); output_frame->SetFp(frame_ptr); @@ -2569,21 +2631,6 @@ void Deoptimizer::EnsureCodeForDeoptimizationEntry(Isolate* isolate, } -void Deoptimizer::ReplaceCodeForRelatedFunctions(JSFunction* function, - Code* code) { - SharedFunctionInfo* shared = function->shared(); - Object* undefined = function->GetHeap()->undefined_value(); - Object* current = function; - - while (current != undefined) { - JSFunction* func = JSFunction::cast(current); - current = func->next_function_link(); - func->set_code(shared->code()); - func->set_next_function_link(undefined); - } -} - - FrameDescription::FrameDescription(uint32_t frame_size, JSFunction* function) : frame_size_(frame_size), diff --git a/deps/v8/src/deoptimizer.h b/deps/v8/src/deoptimizer.h index d28be23..7ad1ab0 100644 --- a/deps/v8/src/deoptimizer.h +++ b/deps/v8/src/deoptimizer.h @@ -197,6 +197,8 @@ class Deoptimizer : public Malloced { static void DeoptimizeAllFunctionsWith(Isolate* isolate, OptimizedFunctionFilter* filter); + static void DeoptimizeCodeList(Isolate* isolate, ZoneList* codes); + static void DeoptimizeAllFunctionsForContext( Context* context, OptimizedFunctionFilter* filter); @@ -411,9 +413,11 @@ class Deoptimizer : public Malloced { v8::Persistent* obj, void* data); - // Deoptimize function assuming that function->next_function_link() points - // to a list that contains all functions that share the same optimized code. - static void DeoptimizeFunctionWithPreparedFunctionList(JSFunction* function); + // Deoptimize the given code and add to appropriate deoptimization lists. + static void DeoptimizeCode(Isolate* isolate, Code* code); + + // Patch the given code so that it will deoptimize itself. + static void PatchCodeForDeoptimization(Isolate* isolate, Code* code); // Fill the input from from a JavaScript frame. This is used when // the debugger needs to inspect an optimized frame. For normal @@ -510,6 +514,10 @@ class FrameDescription { *GetFrameSlotPointer(offset) = value; } + void SetCallerPc(unsigned offset, intptr_t value); + + void SetCallerFp(unsigned offset, intptr_t value); + intptr_t GetRegister(unsigned n) const { ASSERT(n < ARRAY_SIZE(registers_)); return registers_[n]; diff --git a/deps/v8/src/extensions/i18n/i18n-utils.cc b/deps/v8/src/extensions/i18n/i18n-utils.cc index b720329..eac1166 100644 --- a/deps/v8/src/extensions/i18n/i18n-utils.cc +++ b/deps/v8/src/extensions/i18n/i18n-utils.cc @@ -142,40 +142,34 @@ void Utils::AsciiToUChar(const char* source, // static -// Chrome Linux doesn't like static initializers in class, so we create -// template on demand. v8::Local Utils::GetTemplate(v8::Isolate* isolate) { - static v8::Persistent icu_template; - - if (icu_template.IsEmpty()) { + i::Isolate* internal = reinterpret_cast(isolate); + if (internal->heap()->i18n_template_one() == + internal->heap()->the_hole_value()) { v8::Local raw_template(v8::ObjectTemplate::New()); - - // Set aside internal field for ICU class. raw_template->SetInternalFieldCount(1); - - icu_template.Reset(isolate, raw_template); + internal->heap() + ->SetI18nTemplateOne(*v8::Utils::OpenHandle(*raw_template)); } - return v8::Local::New(isolate, icu_template); + return v8::Utils::ToLocal(i::Handle::cast( + internal->factory()->i18n_template_one())); } // static -// Chrome Linux doesn't like static initializers in class, so we create -// template on demand. This one has 2 internal fields. v8::Local Utils::GetTemplate2(v8::Isolate* isolate) { - static v8::Persistent icu_template_2; - - if (icu_template_2.IsEmpty()) { + i::Isolate* internal = reinterpret_cast(isolate); + if (internal->heap()->i18n_template_two() == + internal->heap()->the_hole_value()) { v8::Local raw_template(v8::ObjectTemplate::New()); - - // Set aside internal field for ICU class and additional data. raw_template->SetInternalFieldCount(2); - - icu_template_2.Reset(isolate, raw_template); + internal->heap() + ->SetI18nTemplateTwo(*v8::Utils::OpenHandle(*raw_template)); } - return v8::Local::New(isolate, icu_template_2); + return v8::Utils::ToLocal(i::Handle::cast( + internal->factory()->i18n_template_two())); } } // namespace v8_i18n diff --git a/deps/v8/src/factory.cc b/deps/v8/src/factory.cc index b135a9c..52a6588 100644 --- a/deps/v8/src/factory.cc +++ b/deps/v8/src/factory.cc @@ -1221,6 +1221,7 @@ Handle Factory::NewSharedFunctionInfo( shared->set_num_literals(literals_array_size); if (is_generator) { shared->set_instance_class_name(isolate()->heap()->Generator_string()); + shared->DisableOptimization("generator"); } return shared; } diff --git a/deps/v8/src/flag-definitions.h b/deps/v8/src/flag-definitions.h index 63cf663..8888aed 100644 --- a/deps/v8/src/flag-definitions.h +++ b/deps/v8/src/flag-definitions.h @@ -208,6 +208,7 @@ DEFINE_bool(track_computed_fields, true, "track computed boilerplate fields") DEFINE_implication(track_double_fields, track_fields) DEFINE_implication(track_heap_object_fields, track_fields) DEFINE_implication(track_computed_fields, track_fields) +DEFINE_bool(smi_binop, true, "support smi representation in binary operations") // Flags for data representation optimizations DEFINE_bool(unbox_double_arrays, true, "automatically unbox arrays of doubles") @@ -236,7 +237,9 @@ DEFINE_bool(collect_megamorphic_maps_from_stub_cache, "crankshaft harvests type feedback from stub cache") DEFINE_bool(hydrogen_stats, false, "print statistics for hydrogen") DEFINE_bool(trace_hydrogen, false, "trace generated hydrogen to file") -DEFINE_string(trace_phase, "Z", "trace generated IR for specified phases") +DEFINE_bool(trace_hydrogen_stubs, false, "trace generated hydrogen for stubs") +DEFINE_string(trace_hydrogen_file, NULL, "trace hydrogen to given file name") +DEFINE_string(trace_phase, "HLZ", "trace generated IR for specified phases") DEFINE_bool(trace_inlining, false, "trace inlining decisions") DEFINE_bool(trace_alloc, false, "trace register allocator") DEFINE_bool(trace_all_uses, false, "trace all use positions") @@ -265,6 +268,8 @@ DEFINE_bool(use_osr, true, "use on-stack replacement") DEFINE_bool(idefs, false, "use informative definitions") DEFINE_bool(array_bounds_checks_elimination, true, "perform array bounds checks elimination") +DEFINE_bool(array_bounds_checks_hoisting, false, + "perform array bounds checks hoisting") DEFINE_bool(array_index_dehoisting, true, "perform array index dehoisting") DEFINE_bool(analyze_environment_liveness, true, @@ -307,6 +312,9 @@ DEFINE_int(parallel_recompilation_delay, 0, DEFINE_bool(omit_prototype_checks_for_leaf_maps, true, "do not emit prototype checks if all prototypes have leaf maps, " "deoptimize the optimized code if the layout of the maps changes.") +DEFINE_bool(omit_map_checks_for_leaf_maps, true, + "do not emit check maps for constant values that have a leaf map, " + "deoptimize the optimized code if the layout of the maps changes.") // Experimental profiler changes. DEFINE_bool(experimental_profiler, true, "enable all profiler experiments") diff --git a/deps/v8/src/frames-inl.h b/deps/v8/src/frames-inl.h index d097ed1..2b15bff 100644 --- a/deps/v8/src/frames-inl.h +++ b/deps/v8/src/frames-inl.h @@ -334,10 +334,10 @@ inline JavaScriptFrame* JavaScriptFrameIterator::frame() const { } -inline JavaScriptFrame* SafeStackFrameIterator::frame() const { +inline StackFrame* SafeStackFrameIterator::frame() const { ASSERT(!done()); - ASSERT(frame_->is_java_script()); - return static_cast(frame_); + ASSERT(frame_->is_java_script() || frame_->is_exit()); + return frame_; } diff --git a/deps/v8/src/frames.cc b/deps/v8/src/frames.cc index 890e77a..61792a6 100644 --- a/deps/v8/src/frames.cc +++ b/deps/v8/src/frames.cc @@ -36,6 +36,7 @@ #include "safepoint-table.h" #include "scopeinfo.h" #include "string-stream.h" +#include "vm-state-inl.h" #include "allocation-inl.h" @@ -221,7 +222,8 @@ SafeStackFrameIterator::SafeStackFrameIterator( : StackFrameIteratorBase(isolate, false), low_bound_(sp), high_bound_(js_entry_sp), - top_frame_type_(StackFrame::NONE) { + top_frame_type_(StackFrame::NONE), + external_callback_scope_(isolate->external_callback_scope()) { StackFrame::State state; StackFrame::Type type; ThreadLocalTop* top = isolate->thread_local_top(); @@ -256,16 +258,28 @@ SafeStackFrameIterator::SafeStackFrameIterator( } if (SingletonFor(type) == NULL) return; frame_ = SingletonFor(type, &state); + if (frame_ == NULL) return; + + Advance(); - if (!done()) Advance(); + if (frame_ != NULL && !frame_->is_exit() && + external_callback_scope_ != NULL && + external_callback_scope_->scope_address() < frame_->fp()) { + // Skip top ExternalCallbackScope if we already advanced to a JS frame + // under it. Sampler will anyways take this top external callback. + external_callback_scope_ = external_callback_scope_->previous(); + } } bool SafeStackFrameIterator::IsValidTop(ThreadLocalTop* top) const { - Address fp = Isolate::c_entry_fp(top); - if (!IsValidExitFrame(fp)) return false; + Address c_entry_fp = Isolate::c_entry_fp(top); + if (!IsValidExitFrame(c_entry_fp)) return false; // There should be at least one JS_ENTRY stack handler. - return Isolate::handler(top) != NULL; + Address handler = Isolate::handler(top); + if (handler == NULL) return false; + // Check that there are no js frames on top of the native frames. + return c_entry_fp < handler; } @@ -340,6 +354,24 @@ void SafeStackFrameIterator::Advance() { AdvanceOneFrame(); if (done()) return; if (frame_->is_java_script()) return; + if (frame_->is_exit() && external_callback_scope_) { + // Some of the EXIT frames may have ExternalCallbackScope allocated on + // top of them. In that case the scope corresponds to the first EXIT + // frame beneath it. There may be other EXIT frames on top of the + // ExternalCallbackScope, just skip them as we cannot collect any useful + // information about them. + if (external_callback_scope_->scope_address() < frame_->fp()) { + Address* callback_address = + external_callback_scope_->callback_address(); + if (*callback_address != NULL) { + frame_->state_.pc_address = callback_address; + } + external_callback_scope_ = external_callback_scope_->previous(); + ASSERT(external_callback_scope_ == NULL || + external_callback_scope_->scope_address() > frame_->fp()); + return; + } + } } } @@ -540,7 +572,7 @@ void ExitFrame::FillState(Address fp, Address sp, State* state) { state->sp = sp; state->fp = fp; state->pc_address = ResolveReturnAddressLocation( - reinterpret_cast(sp - 1 * kPointerSize)); + reinterpret_cast(sp - 1 * kPCOnStackSize)); } diff --git a/deps/v8/src/frames.h b/deps/v8/src/frames.h index 7e667a6..634ff8a 100644 --- a/deps/v8/src/frames.h +++ b/deps/v8/src/frames.h @@ -47,6 +47,7 @@ int JSCallerSavedCode(int n); // Forward declarations. +class ExternalCallbackScope; class StackFrameIteratorBase; class ThreadLocalTop; class Isolate; @@ -92,7 +93,7 @@ class StackHandlerConstants : public AllStatic { static const int kContextOffset = 3 * kPointerSize; static const int kFPOffset = 4 * kPointerSize; - static const int kSize = kFPOffset + kPointerSize; + static const int kSize = kFPOffset + kFPOnStackSize; static const int kSlotCount = kSize >> kPointerSizeLog2; }; @@ -168,13 +169,14 @@ class StandardFrameConstants : public AllStatic { // context and function. // StandardFrame::IterateExpressions assumes that kContextOffset is the last // object pointer. - static const int kFixedFrameSize = 4 * kPointerSize; + static const int kFixedFrameSize = kPCOnStackSize + kFPOnStackSize + + 2 * kPointerSize; static const int kExpressionsOffset = -3 * kPointerSize; static const int kMarkerOffset = -2 * kPointerSize; static const int kContextOffset = -1 * kPointerSize; static const int kCallerFPOffset = 0 * kPointerSize; - static const int kCallerPCOffset = +1 * kPointerSize; - static const int kCallerSPOffset = +2 * kPointerSize; + static const int kCallerPCOffset = +1 * kFPOnStackSize; + static const int kCallerSPOffset = +2 * kPCOnStackSize; }; @@ -883,7 +885,7 @@ class SafeStackFrameIterator: public StackFrameIteratorBase { Address fp, Address sp, Address js_entry_sp); - inline JavaScriptFrame* frame() const; + inline StackFrame* frame() const; void Advance(); StackFrame::Type top_frame_type() const { return top_frame_type_; } @@ -902,6 +904,7 @@ class SafeStackFrameIterator: public StackFrameIteratorBase { const Address low_bound_; const Address high_bound_; StackFrame::Type top_frame_type_; + ExternalCallbackScope* external_callback_scope_; }; diff --git a/deps/v8/src/global-handles.cc b/deps/v8/src/global-handles.cc index 5c65635..88ebe31 100644 --- a/deps/v8/src/global-handles.cc +++ b/deps/v8/src/global-handles.cc @@ -262,6 +262,7 @@ class GlobalHandles::Node { ExternalTwoByteString::cast(object_)->resource() != NULL); // Leaving V8. VMState state(isolate); + HandleScope handle_scope(isolate); weak_reference_callback_(reinterpret_cast(isolate), reinterpret_cast*>(&object), par); diff --git a/deps/v8/src/globals.h b/deps/v8/src/globals.h index e695e94..26fd531 100644 --- a/deps/v8/src/globals.h +++ b/deps/v8/src/globals.h @@ -239,12 +239,15 @@ const int kMinInt = -kMaxInt - 1; const uint32_t kMaxUInt32 = 0xFFFFFFFFu; -const int kCharSize = sizeof(char); // NOLINT -const int kShortSize = sizeof(short); // NOLINT -const int kIntSize = sizeof(int); // NOLINT -const int kDoubleSize = sizeof(double); // NOLINT -const int kIntptrSize = sizeof(intptr_t); // NOLINT -const int kPointerSize = sizeof(void*); // NOLINT +const int kCharSize = sizeof(char); // NOLINT +const int kShortSize = sizeof(short); // NOLINT +const int kIntSize = sizeof(int); // NOLINT +const int kDoubleSize = sizeof(double); // NOLINT +const int kIntptrSize = sizeof(intptr_t); // NOLINT +const int kPointerSize = sizeof(void*); // NOLINT +const int kRegisterSize = kPointerSize; +const int kPCOnStackSize = kRegisterSize; +const int kFPOnStackSize = kRegisterSize; const int kDoubleSizeLog2 = 3; diff --git a/deps/v8/src/heap-inl.h b/deps/v8/src/heap-inl.h index 97c56df..3c1d4d2 100644 --- a/deps/v8/src/heap-inl.h +++ b/deps/v8/src/heap-inl.h @@ -712,19 +712,6 @@ void ExternalStringTable::ShrinkNewStrings(int position) { } -void ErrorObjectList::Add(JSObject* object) { - list_.Add(object); -} - - -void ErrorObjectList::Iterate(ObjectVisitor* v) { - if (!list_.is_empty()) { - Object** start = &list_[0]; - v->VisitPointers(start, start + list_.length()); - } -} - - void Heap::ClearInstanceofCache() { set_instanceof_cache_function(the_hole_value()); } diff --git a/deps/v8/src/heap-snapshot-generator.cc b/deps/v8/src/heap-snapshot-generator.cc index 3b1f235..9f9f84a 100644 --- a/deps/v8/src/heap-snapshot-generator.cc +++ b/deps/v8/src/heap-snapshot-generator.cc @@ -1339,10 +1339,10 @@ void V8HeapExplorer::ExtractPropertyReferences(JSObject* js_obj, int entry) { } break; } - case CONSTANT_FUNCTION: + case CONSTANT: SetPropertyReference( js_obj, entry, - descs->GetKey(i), descs->GetConstantFunction(i)); + descs->GetKey(i), descs->GetConstant(i)); break; case CALLBACKS: ExtractAccessorPairProperty( diff --git a/deps/v8/src/heap.cc b/deps/v8/src/heap.cc index dff217a..5cd8544 100644 --- a/deps/v8/src/heap.cc +++ b/deps/v8/src/heap.cc @@ -583,8 +583,6 @@ void Heap::GarbageCollectionEpilogue() { #ifdef ENABLE_DEBUGGER_SUPPORT isolate_->debug()->AfterGarbageCollection(); #endif // ENABLE_DEBUGGER_SUPPORT - - error_object_list_.DeferredFormatStackTrace(isolate()); } @@ -705,6 +703,16 @@ bool Heap::CollectGarbage(AllocationSpace space, } +int Heap::NotifyContextDisposed() { + if (FLAG_parallel_recompilation) { + // Flush the queued recompilation tasks. + isolate()->optimizing_compiler_thread()->Flush(); + } + flush_monomorphic_ics_ = true; + return ++contexts_disposed_; +} + + void Heap::PerformScavenge() { GCTracer tracer(this, NULL, NULL); if (incremental_marking()->IsStopped()) { @@ -922,6 +930,7 @@ bool Heap::PerformGarbageCollection(GarbageCollector collector, { GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); VMState state(isolate_); + HandleScope handle_scope(isolate_); CallGCPrologueCallbacks(gc_type, kNoGCCallbackFlags); } @@ -1027,6 +1036,7 @@ bool Heap::PerformGarbageCollection(GarbageCollector collector, { GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); VMState state(isolate_); + HandleScope handle_scope(isolate_); CallGCEpilogueCallbacks(gc_type); } @@ -1428,8 +1438,6 @@ void Heap::Scavenge() { UpdateNewSpaceReferencesInExternalStringTable( &UpdateNewSpaceReferenceInExternalStringTableEntry); - error_object_list_.UpdateReferencesInNewSpace(this); - promotion_queue_.Destroy(); if (!FLAG_watch_ic_patching) { @@ -3215,6 +3223,9 @@ bool Heap::CreateInitialObjects() { } set_observed_symbol(Symbol::cast(obj)); + set_i18n_template_one(the_hole_value()); + set_i18n_template_two(the_hole_value()); + // Handling of script id generation is in Factory::NewScript. set_last_script_id(Smi::FromInt(v8::Script::kNoScriptId)); @@ -5353,25 +5364,16 @@ MaybeObject* Heap::AllocateRawOneByteString(int length, if (length < 0 || length > SeqOneByteString::kMaxLength) { return Failure::OutOfMemoryException(0xb); } - int size = SeqOneByteString::SizeFor(length); ASSERT(size <= SeqOneByteString::kMaxSize); - AllocationSpace space = (pretenure == TENURED) ? OLD_DATA_SPACE : NEW_SPACE; AllocationSpace retry_space = OLD_DATA_SPACE; - if (space == NEW_SPACE) { - if (size > kMaxObjectSizeInNewSpace) { - // Allocate in large object space, retry space will be ignored. - space = LO_SPACE; - } else if (size > Page::kMaxNonCodeHeapObjectSize) { - // Allocate in new space, retry in large object space. - retry_space = LO_SPACE; - } - } else if (space == OLD_DATA_SPACE && - size > Page::kMaxNonCodeHeapObjectSize) { + if (size > Page::kMaxNonCodeHeapObjectSize) { + // Allocate in large object space, retry space will be ignored. space = LO_SPACE; } + Object* result; { MaybeObject* maybe_result = AllocateRaw(size, space, retry_space); if (!maybe_result->ToObject(&result)) return maybe_result; @@ -5397,18 +5399,11 @@ MaybeObject* Heap::AllocateRawTwoByteString(int length, AllocationSpace space = (pretenure == TENURED) ? OLD_DATA_SPACE : NEW_SPACE; AllocationSpace retry_space = OLD_DATA_SPACE; - if (space == NEW_SPACE) { - if (size > kMaxObjectSizeInNewSpace) { - // Allocate in large object space, retry space will be ignored. - space = LO_SPACE; - } else if (size > Page::kMaxNonCodeHeapObjectSize) { - // Allocate in new space, retry in large object space. - retry_space = LO_SPACE; - } - } else if (space == OLD_DATA_SPACE && - size > Page::kMaxNonCodeHeapObjectSize) { + if (size > Page::kMaxNonCodeHeapObjectSize) { + // Allocate in large object space, retry space will be ignored. space = LO_SPACE; } + Object* result; { MaybeObject* maybe_result = AllocateRaw(size, space, retry_space); if (!maybe_result->ToObject(&result)) return maybe_result; @@ -5482,7 +5477,7 @@ MaybeObject* Heap::AllocateRawFixedArray(int length) { if (always_allocate()) return AllocateFixedArray(length, TENURED); // Allocate the raw data for a fixed array. int size = FixedArray::SizeFor(length); - return size <= kMaxObjectSizeInNewSpace + return size <= Page::kMaxNonCodeHeapObjectSize ? new_space_.AllocateRaw(size) : lo_space_->AllocateRaw(size, NOT_EXECUTABLE); } @@ -5553,22 +5548,16 @@ MaybeObject* Heap::AllocateRawFixedArray(int length, PretenureFlag pretenure) { if (length < 0 || length > FixedArray::kMaxLength) { return Failure::OutOfMemoryException(0xe); } - + int size = FixedArray::SizeFor(length); AllocationSpace space = (pretenure == TENURED) ? OLD_POINTER_SPACE : NEW_SPACE; - int size = FixedArray::SizeFor(length); - if (space == NEW_SPACE && size > kMaxObjectSizeInNewSpace) { - // Too big for new space. - space = LO_SPACE; - } else if (space == OLD_POINTER_SPACE && - size > Page::kMaxNonCodeHeapObjectSize) { - // Too big for old pointer space. + AllocationSpace retry_space = OLD_POINTER_SPACE; + + if (size > Page::kMaxNonCodeHeapObjectSize) { + // Allocate in large object space, retry space will be ignored. space = LO_SPACE; } - AllocationSpace retry_space = - (size <= Page::kMaxNonCodeHeapObjectSize) ? OLD_POINTER_SPACE : LO_SPACE; - return AllocateRaw(size, space, retry_space); } @@ -5686,27 +5675,19 @@ MaybeObject* Heap::AllocateRawFixedDoubleArray(int length, if (length < 0 || length > FixedDoubleArray::kMaxLength) { return Failure::OutOfMemoryException(0xf); } - - AllocationSpace space = - (pretenure == TENURED) ? OLD_DATA_SPACE : NEW_SPACE; int size = FixedDoubleArray::SizeFor(length); + AllocationSpace space = (pretenure == TENURED) ? OLD_DATA_SPACE : NEW_SPACE; + AllocationSpace retry_space = OLD_DATA_SPACE; #ifndef V8_HOST_ARCH_64_BIT size += kPointerSize; #endif - if (space == NEW_SPACE && size > kMaxObjectSizeInNewSpace) { - // Too big for new space. - space = LO_SPACE; - } else if (space == OLD_DATA_SPACE && - size > Page::kMaxNonCodeHeapObjectSize) { - // Too big for old data space. + if (size > Page::kMaxNonCodeHeapObjectSize) { + // Allocate in large object space, retry space will be ignored. space = LO_SPACE; } - AllocationSpace retry_space = - (size <= Page::kMaxNonCodeHeapObjectSize) ? OLD_DATA_SPACE : LO_SPACE; - HeapObject* object; { MaybeObject* maybe_object = AllocateRaw(size, space, retry_space); if (!maybe_object->To(&object)) return maybe_object; @@ -6575,7 +6556,6 @@ void Heap::IterateWeakRoots(ObjectVisitor* v, VisitMode mode) { mode != VISIT_ALL_IN_SWEEP_NEWSPACE) { // Scavenge collections have special processing for this. external_string_table_.Iterate(v); - error_object_list_.Iterate(v); } v->Synchronize(VisitorSynchronization::kExternalStringsTable); } @@ -6975,8 +6955,6 @@ void Heap::TearDown() { external_string_table_.TearDown(); - error_object_list_.TearDown(); - new_space_.TearDown(); if (old_pointer_space_ != NULL) { @@ -7929,120 +7907,6 @@ void ExternalStringTable::TearDown() { } -// Update all references. -void ErrorObjectList::UpdateReferences() { - for (int i = 0; i < list_.length(); i++) { - HeapObject* object = HeapObject::cast(list_[i]); - MapWord first_word = object->map_word(); - if (first_word.IsForwardingAddress()) { - list_[i] = first_word.ToForwardingAddress(); - } - } -} - - -// Unforwarded objects in new space are dead and removed from the list. -void ErrorObjectList::UpdateReferencesInNewSpace(Heap* heap) { - if (list_.is_empty()) return; - if (!nested_) { - int write_index = 0; - for (int i = 0; i < list_.length(); i++) { - MapWord first_word = HeapObject::cast(list_[i])->map_word(); - if (first_word.IsForwardingAddress()) { - list_[write_index++] = first_word.ToForwardingAddress(); - } - } - list_.Rewind(write_index); - } else { - // If a GC is triggered during DeferredFormatStackTrace, we do not move - // objects in the list, just remove dead ones, as to not confuse the - // loop in DeferredFormatStackTrace. - for (int i = 0; i < list_.length(); i++) { - MapWord first_word = HeapObject::cast(list_[i])->map_word(); - list_[i] = first_word.IsForwardingAddress() - ? first_word.ToForwardingAddress() - : heap->the_hole_value(); - } - } -} - - -void ErrorObjectList::DeferredFormatStackTrace(Isolate* isolate) { - // If formatting the stack trace causes a GC, this method will be - // recursively called. In that case, skip the recursive call, since - // the loop modifies the list while iterating over it. - if (nested_ || list_.is_empty() || isolate->has_pending_exception()) return; - nested_ = true; - HandleScope scope(isolate); - Handle stack_key = isolate->factory()->stack_string(); - int write_index = 0; - int budget = kBudgetPerGC; - for (int i = 0; i < list_.length(); i++) { - Object* object = list_[i]; - JSFunction* getter_fun; - - { DisallowHeapAllocation no_gc; - // Skip possible holes in the list. - if (object->IsTheHole()) continue; - if (isolate->heap()->InNewSpace(object) || budget == 0) { - list_[write_index++] = object; - continue; - } - - // Check whether the stack property is backed by the original getter. - LookupResult lookup(isolate); - JSObject::cast(object)->LocalLookupRealNamedProperty(*stack_key, &lookup); - if (!lookup.IsFound() || lookup.type() != CALLBACKS) continue; - Object* callback = lookup.GetCallbackObject(); - if (!callback->IsAccessorPair()) continue; - Object* getter_obj = AccessorPair::cast(callback)->getter(); - if (!getter_obj->IsJSFunction()) continue; - getter_fun = JSFunction::cast(getter_obj); - String* key = isolate->heap()->hidden_stack_trace_string(); - Object* value = getter_fun->GetHiddenProperty(key); - if (key != value) continue; - } - - budget--; - HandleScope scope(isolate); - bool has_exception = false; -#ifdef DEBUG - Handle map(HeapObject::cast(object)->map(), isolate); -#endif - Handle object_handle(object, isolate); - Handle getter_handle(getter_fun, isolate); - Execution::Call(getter_handle, object_handle, 0, NULL, &has_exception); - ASSERT(*map == HeapObject::cast(*object_handle)->map()); - if (has_exception) { - // Hit an exception (most likely a stack overflow). - // Wrap up this pass and retry after another GC. - isolate->clear_pending_exception(); - // We use the handle since calling the getter might have caused a GC. - list_[write_index++] = *object_handle; - budget = 0; - } - } - list_.Rewind(write_index); - list_.Trim(); - nested_ = false; -} - - -void ErrorObjectList::RemoveUnmarked(Heap* heap) { - for (int i = 0; i < list_.length(); i++) { - HeapObject* object = HeapObject::cast(list_[i]); - if (!Marking::MarkBitFrom(object).Get()) { - list_[i] = heap->the_hole_value(); - } - } -} - - -void ErrorObjectList::TearDown() { - list_.Free(); -} - - void Heap::QueueMemoryChunkForFree(MemoryChunk* chunk) { chunk->set_next_chunk(chunks_queued_for_free_); chunks_queued_for_free_ = chunk; diff --git a/deps/v8/src/heap.h b/deps/v8/src/heap.h index 6b02363..5e8a2e5 100644 --- a/deps/v8/src/heap.h +++ b/deps/v8/src/heap.h @@ -188,7 +188,9 @@ namespace internal { V(Symbol, frozen_symbol, FrozenSymbol) \ V(SeededNumberDictionary, empty_slow_element_dictionary, \ EmptySlowElementDictionary) \ - V(Symbol, observed_symbol, ObservedSymbol) + V(Symbol, observed_symbol, ObservedSymbol) \ + V(HeapObject, i18n_template_one, I18nTemplateOne) \ + V(HeapObject, i18n_template_two, I18nTemplateTwo) #define ROOT_LIST(V) \ STRONG_ROOT_LIST(V) \ @@ -475,41 +477,6 @@ class ExternalStringTable { }; -// The stack property of an error object is implemented as a getter that -// formats the attached raw stack trace into a string. This raw stack trace -// keeps code and function objects alive until the getter is called the first -// time. To release those objects, we call the getter after each GC for -// newly tenured error objects that are kept in a list. -class ErrorObjectList { - public: - inline void Add(JSObject* object); - - inline void Iterate(ObjectVisitor* v); - - void TearDown(); - - void RemoveUnmarked(Heap* heap); - - void DeferredFormatStackTrace(Isolate* isolate); - - void UpdateReferences(); - - void UpdateReferencesInNewSpace(Heap* heap); - - private: - static const int kBudgetPerGC = 16; - - ErrorObjectList() : nested_(false) { } - - friend class Heap; - - List list_; - bool nested_; - - DISALLOW_COPY_AND_ASSIGN(ErrorObjectList); -}; - - enum ArrayStorageAllocationMode { DONT_INITIALIZE_ARRAY_ELEMENTS, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE @@ -1287,10 +1254,7 @@ class Heap { void EnsureHeapIsIterable(); // Notify the heap that a context has been disposed. - int NotifyContextDisposed() { - flush_monomorphic_ics_ = true; - return ++contexts_disposed_; - } + int NotifyContextDisposed(); // Utility to invoke the scavenger. This is needed in test code to // ensure correct callback for weak global handles. @@ -1333,6 +1297,12 @@ class Heap { ASSERT((callback == NULL) ^ (global_gc_epilogue_callback_ == NULL)); global_gc_epilogue_callback_ = callback; } + void SetI18nTemplateOne(ObjectTemplateInfo* tmpl) { + set_i18n_template_one(tmpl); + } + void SetI18nTemplateTwo(ObjectTemplateInfo* tmpl) { + set_i18n_template_two(tmpl); + } // Heap root getters. We have versions with and without type::cast() here. // You can't use type::cast during GC because the assert fails. @@ -1716,8 +1686,6 @@ class Heap { // we try to promote this object. inline bool ShouldBePromoted(Address old_address, int object_size); - int MaxObjectSizeInNewSpace() { return kMaxObjectSizeInNewSpace; } - void ClearJSFunctionResultCaches(); void ClearNormalizedMapCaches(); @@ -1798,10 +1766,6 @@ class Heap { return &external_string_table_; } - ErrorObjectList* error_object_list() { - return &error_object_list_; - } - // Returns the current sweep generation. int sweep_generation() { return sweep_generation_; @@ -1966,12 +1930,6 @@ class Heap { int scan_on_scavenge_pages_; -#if V8_TARGET_ARCH_X64 - static const int kMaxObjectSizeInNewSpace = 1024*KB; -#else - static const int kMaxObjectSizeInNewSpace = 512*KB; -#endif - NewSpace new_space_; OldSpace* old_pointer_space_; OldSpace* old_data_space_; @@ -2406,8 +2364,6 @@ class Heap { ExternalStringTable external_string_table_; - ErrorObjectList error_object_list_; - VisitorDispatchTable scavenging_visitors_table_; MemoryChunk* chunks_queued_for_free_; diff --git a/deps/v8/src/hydrogen-bce.cc b/deps/v8/src/hydrogen-bce.cc index e50cd7a..ff0b072 100644 --- a/deps/v8/src/hydrogen-bce.cc +++ b/deps/v8/src/hydrogen-bce.cc @@ -189,6 +189,8 @@ class BoundsCheckBbData: public ZoneObject { } if (!keep_new_check) { + new_check->block()->graph()->isolate()->counters()-> + bounds_checks_eliminated()->Increment(); new_check->DeleteAndReplaceWith(new_check->ActualValue()); } @@ -347,6 +349,8 @@ void HBoundsCheckEliminationPhase::EliminateRedundantBoundsChecks( NULL); *data_p = bb_data_list; } else if (data->OffsetIsCovered(offset)) { + bb->graph()->isolate()->counters()-> + bounds_checks_eliminated()->Increment(); check->DeleteAndReplaceWith(check->ActualValue()); } else if (data->BasicBlock() != bb || !data->CoverCheck(check, offset)) { diff --git a/deps/v8/src/hydrogen-bch.cc b/deps/v8/src/hydrogen-bch.cc new file mode 100644 index 0000000..8646747 --- /dev/null +++ b/deps/v8/src/hydrogen-bch.cc @@ -0,0 +1,408 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "hydrogen-bch.h" + +namespace v8 { +namespace internal { + +/* + * This class is a table with one element for eack basic block. + * + * It is used to check if, inside one loop, all execution paths contain + * a bounds check for a particular [index, length] combination. + * The reason is that if there is a path that stays in the loop without + * executing a check then the check cannot be hoisted out of the loop (it + * would likely fail and cause a deopt for no good reason). + * We also check is there are paths that exit the loop early, and if yes we + * perform the hoisting only if graph()->use_optimistic_licm() is true. + * The reason is that such paths are realtively common and harmless (like in + * a "search" method that scans an array until an element is found), but in + * some cases they could cause a deopt if we hoist the check so this is a + * situation we need to detect. + */ +class InductionVariableBlocksTable BASE_EMBEDDED { + public: + class Element { + public: + static const int kNoBlock = -1; + + HBasicBlock* block() { return block_; } + void set_block(HBasicBlock* block) { block_ = block; } + bool is_start() { return is_start_; } + bool is_proper_exit() { return is_proper_exit_; } + bool is_in_loop() { return is_in_loop_; } + bool has_check() { return has_check_; } + void set_has_check() { has_check_ = true; } + InductionVariableLimitUpdate* additional_limit() { + return &additional_limit_; + } + + /* + * Initializes the table element for a given loop (identified by its + * induction variable). + */ + void InitializeLoop(InductionVariableData* data) { + ASSERT(data->limit() != NULL); + HLoopInformation* loop = data->phi()->block()->current_loop(); + is_start_ = (block() == loop->loop_header()); + is_proper_exit_ = (block() == data->induction_exit_target()); + is_in_loop_ = loop->IsNestedInThisLoop(block()->current_loop()); + has_check_ = false; + } + + // Utility methods to iterate over dominated blocks. + void ResetCurrentDominatedBlock() { current_dominated_block_ = kNoBlock; } + HBasicBlock* CurrentDominatedBlock() { + ASSERT(current_dominated_block_ != kNoBlock); + return current_dominated_block_ < block()->dominated_blocks()->length() ? + block()->dominated_blocks()->at(current_dominated_block_) : NULL; + } + HBasicBlock* NextDominatedBlock() { + current_dominated_block_++; + return CurrentDominatedBlock(); + } + + Element() + : block_(NULL), is_start_(false), is_proper_exit_(false), + has_check_(false), additional_limit_(), + current_dominated_block_(kNoBlock) {} + + private: + HBasicBlock* block_; + bool is_start_; + bool is_proper_exit_; + bool is_in_loop_; + bool has_check_; + InductionVariableLimitUpdate additional_limit_; + int current_dominated_block_; + }; + + HGraph* graph() { return graph_; } + HBasicBlock* loop_header() { return loop_header_; } + Element* at(int index) { return &(elements_.at(index)); } + Element* at(HBasicBlock* block) { return at(block->block_id()); } + + void AddCheckAt(HBasicBlock* block) { + at(block->block_id())->set_has_check(); + } + + /* + * Initializes the table for a given loop (identified by its induction + * variable). + */ + void InitializeLoop(InductionVariableData* data) { + for (int i = 0; i < graph()->blocks()->length(); i++) { + at(i)->InitializeLoop(data); + } + loop_header_ = data->phi()->block()->current_loop()->loop_header(); + } + + + enum Hoistability { + HOISTABLE, + OPTIMISTICALLY_HOISTABLE, + NOT_HOISTABLE + }; + + /* + * This method checks if it is appropriate to hoist the bounds checks on an + * induction variable out of the loop. + * The problem is that in the loop code graph there could be execution paths + * where the check is not performed, but hoisting the check has the same + * semantics as performing it at every loop iteration, which could cause + * unnecessary check failures (which would mean unnecessary deoptimizations). + * The method returns OK if there are no paths that perform an iteration + * (loop back to the header) without meeting a check, or UNSAFE is set if + * early exit paths are found. + */ + Hoistability CheckHoistability() { + for (int i = 0; i < elements_.length(); i++) { + at(i)->ResetCurrentDominatedBlock(); + } + bool unsafe = false; + + HBasicBlock* current = loop_header(); + while (current != NULL) { + HBasicBlock* next; + + if (at(current)->has_check() || !at(current)->is_in_loop()) { + // We found a check or we reached a dominated block out of the loop, + // therefore this block is safe and we can backtrack. + next = NULL; + } else { + for (int i = 0; i < current->end()->SuccessorCount(); i ++) { + Element* successor = at(current->end()->SuccessorAt(i)); + + if (!successor->is_in_loop()) { + if (!successor->is_proper_exit()) { + // We found a path that exits the loop early, and is not the exit + // related to the induction limit, therefore hoisting checks is + // an optimistic assumption. + unsafe = true; + } + } + + if (successor->is_start()) { + // We found a path that does one loop iteration without meeting any + // check, therefore hoisting checks would be likely to cause + // unnecessary deopts. + return NOT_HOISTABLE; + } + } + + next = at(current)->NextDominatedBlock(); + } + + // If we have no next block we need to backtrack the tree traversal. + while (next == NULL) { + current = current->dominator(); + if (current != NULL) { + next = at(current)->NextDominatedBlock(); + } else { + // We reached the root: next stays NULL. + next = NULL; + break; + } + } + + current = next; + } + + return unsafe ? OPTIMISTICALLY_HOISTABLE : HOISTABLE; + } + + explicit InductionVariableBlocksTable(HGraph* graph) + : graph_(graph), loop_header_(NULL), + elements_(graph->blocks()->length(), graph->zone()) { + for (int i = 0; i < graph->blocks()->length(); i++) { + Element element; + element.set_block(graph->blocks()->at(i)); + elements_.Add(element, graph->zone()); + ASSERT(at(i)->block()->block_id() == i); + } + } + + // Tries to hoist a check out of its induction loop. + void ProcessRelatedChecks( + InductionVariableData::InductionVariableCheck* check, + InductionVariableData* data) { + HValue* length = check->check()->length(); + check->set_processed(); + HBasicBlock* header = + data->phi()->block()->current_loop()->loop_header(); + HBasicBlock* pre_header = header->predecessors()->at(0); + // Check that the limit is defined in the loop preheader. + if (!data->limit()->IsInteger32Constant()) { + HBasicBlock* limit_block = data->limit()->block(); + if (limit_block != pre_header && + !limit_block->Dominates(pre_header)) { + return; + } + } + // Check that the length and limit have compatible representations. + if (!(data->limit()->representation().Equals( + length->representation()) || + data->limit()->IsInteger32Constant())) { + return; + } + // Check that the length is defined in the loop preheader. + if (check->check()->length()->block() != pre_header && + !check->check()->length()->block()->Dominates(pre_header)) { + return; + } + + // Add checks to the table. + for (InductionVariableData::InductionVariableCheck* current_check = check; + current_check != NULL; + current_check = current_check->next()) { + if (current_check->check()->length() != length) continue; + + AddCheckAt(current_check->check()->block()); + current_check->set_processed(); + } + + // Check that we will not cause unwanted deoptimizations. + Hoistability hoistability = CheckHoistability(); + if (hoistability == NOT_HOISTABLE || + (hoistability == OPTIMISTICALLY_HOISTABLE && + !graph()->use_optimistic_licm())) { + return; + } + + // We will do the hoisting, but we must see if the limit is "limit" or if + // all checks are done on constants: if all check are done against the same + // constant limit we will use that instead of the induction limit. + bool has_upper_constant_limit = true; + InductionVariableData::InductionVariableCheck* current_check = check; + int32_t upper_constant_limit = + current_check != NULL && current_check->HasUpperLimit() ? + current_check->upper_limit() : 0; + while (current_check != NULL) { + if (check->HasUpperLimit()) { + if (check->upper_limit() != upper_constant_limit) { + has_upper_constant_limit = false; + } + } else { + has_upper_constant_limit = false; + } + + current_check->check()->block()->graph()->isolate()->counters()-> + bounds_checks_eliminated()->Increment(); + current_check->check()->set_skip_check(); + current_check = current_check->next(); + } + + // Choose the appropriate limit. + HValue* limit = data->limit(); + if (has_upper_constant_limit) { + HConstant* new_limit = new(pre_header->graph()->zone()) HConstant( + upper_constant_limit, length->representation()); + new_limit->InsertBefore(pre_header->end()); + limit = new_limit; + } + + // If necessary, redefine the limit in the preheader. + if (limit->IsInteger32Constant() && + limit->block() != pre_header && + !limit->block()->Dominates(pre_header)) { + HConstant* new_limit = new(pre_header->graph()->zone()) HConstant( + limit->GetInteger32Constant(), length->representation()); + new_limit->InsertBefore(pre_header->end()); + limit = new_limit; + } + + // Do the hoisting. + HBoundsCheck* hoisted_check = new(pre_header->zone()) HBoundsCheck( + limit, check->check()->length()); + hoisted_check->InsertBefore(pre_header->end()); + hoisted_check->set_allow_equality(true); + hoisted_check->block()->graph()->isolate()->counters()-> + bounds_checks_hoisted()->Increment(); + } + + void CollectInductionVariableData(HBasicBlock* bb) { + bool additional_limit = false; + + for (int i = 0; i < bb->phis()->length(); i++) { + HPhi* phi = bb->phis()->at(i); + phi->DetectInductionVariable(); + } + + additional_limit = InductionVariableData::ComputeInductionVariableLimit( + bb, at(bb)->additional_limit()); + + if (additional_limit) { + at(bb)->additional_limit()->updated_variable-> + UpdateAdditionalLimit(at(bb)->additional_limit()); + } + + for (HInstruction* i = bb->first(); i != NULL; i = i->next()) { + if (!i->IsBoundsCheck()) continue; + HBoundsCheck* check = HBoundsCheck::cast(i); + InductionVariableData::BitwiseDecompositionResult decomposition; + InductionVariableData::DecomposeBitwise(check->index(), &decomposition); + if (!decomposition.base->IsPhi()) continue; + HPhi* phi = HPhi::cast(decomposition.base); + + if (!phi->IsInductionVariable()) continue; + InductionVariableData* data = phi->induction_variable_data(); + + // For now ignore loops decrementing the index. + if (data->increment() <= 0) continue; + if (!data->LowerLimitIsNonNegativeConstant()) continue; + + // TODO(mmassi): skip OSR values for check->length(). + if (check->length() == data->limit() || + check->length() == data->additional_upper_limit()) { + check->block()->graph()->isolate()->counters()-> + bounds_checks_eliminated()->Increment(); + check->set_skip_check(); + continue; + } + + if (!phi->IsLimitedInductionVariable()) continue; + + int32_t limit = data->ComputeUpperLimit(decomposition.and_mask, + decomposition.or_mask); + phi->induction_variable_data()->AddCheck(check, limit); + } + + for (int i = 0; i < bb->dominated_blocks()->length(); i++) { + CollectInductionVariableData(bb->dominated_blocks()->at(i)); + } + + if (additional_limit) { + at(bb->block_id())->additional_limit()->updated_variable-> + UpdateAdditionalLimit(at(bb->block_id())->additional_limit()); + } + } + + void EliminateRedundantBoundsChecks(HBasicBlock* bb) { + for (int i = 0; i < bb->phis()->length(); i++) { + HPhi* phi = bb->phis()->at(i); + if (!phi->IsLimitedInductionVariable()) continue; + + InductionVariableData* induction_data = phi->induction_variable_data(); + InductionVariableData::ChecksRelatedToLength* current_length_group = + induction_data->checks(); + while (current_length_group != NULL) { + current_length_group->CloseCurrentBlock(); + InductionVariableData::InductionVariableCheck* current_base_check = + current_length_group->checks(); + InitializeLoop(induction_data); + + while (current_base_check != NULL) { + ProcessRelatedChecks(current_base_check, induction_data); + while (current_base_check != NULL && + current_base_check->processed()) { + current_base_check = current_base_check->next(); + } + } + + current_length_group = current_length_group->next(); + } + } + } + + private: + HGraph* graph_; + HBasicBlock* loop_header_; + ZoneList elements_; +}; + + +void HBoundsCheckHoistingPhase::HoistRedundantBoundsChecks() { + InductionVariableBlocksTable table(graph()); + table.CollectInductionVariableData(graph()->entry_block()); + for (int i = 0; i < graph()->blocks()->length(); i++) { + table.EliminateRedundantBoundsChecks(graph()->blocks()->at(i)); + } +} + +} } // namespace v8::internal + diff --git a/deps/v8/src/platform-tls.h b/deps/v8/src/hydrogen-bch.h similarity index 70% rename from deps/v8/src/platform-tls.h rename to deps/v8/src/hydrogen-bch.h index 3251663..a22dacd 100644 --- a/deps/v8/src/platform-tls.h +++ b/deps/v8/src/hydrogen-bch.h @@ -1,4 +1,4 @@ -// Copyright 2011 the V8 project authors. All rights reserved. +// Copyright 2013 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -25,26 +25,31 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Platform and architecture specific thread local store functions. +#ifndef V8_HYDROGEN_BCH_H_ +#define V8_HYDROGEN_BCH_H_ -#ifndef V8_PLATFORM_TLS_H_ -#define V8_PLATFORM_TLS_H_ +#include "hydrogen.h" -#ifndef V8_NO_FAST_TLS +namespace v8 { +namespace internal { -// When fast TLS is requested we include the appropriate -// implementation header. -// -// The implementation header defines V8_FAST_TLS_SUPPORTED if it -// provides fast TLS support for the current platform and architecture -// combination. -#if defined(_MSC_VER) && (defined(_WIN32) || defined(_WIN64)) -#include "platform-tls-win32.h" -#elif defined(__APPLE__) -#include "platform-tls-mac.h" -#endif +class HBoundsCheckHoistingPhase : public HPhase { + public: + explicit HBoundsCheckHoistingPhase(HGraph* graph) + : HPhase("H_Bounds checks hoisting", graph) { } + + void Run() { + HoistRedundantBoundsChecks(); + } + + private: + void HoistRedundantBoundsChecks(); + + DISALLOW_COPY_AND_ASSIGN(HBoundsCheckHoistingPhase); +}; + -#endif +} } // namespace v8::internal -#endif // V8_PLATFORM_TLS_H_ +#endif // V8_HYDROGEN_BCE_H_ diff --git a/deps/v8/src/hydrogen-canonicalize.cc b/deps/v8/src/hydrogen-canonicalize.cc index 40cbe4c..6432343 100644 --- a/deps/v8/src/hydrogen-canonicalize.cc +++ b/deps/v8/src/hydrogen-canonicalize.cc @@ -38,11 +38,18 @@ void HCanonicalizePhase::Run() { for (int i = 0; i < blocks->length(); ++i) { for (HInstructionIterator it(blocks->at(i)); !it.Done(); it.Advance()) { HInstruction* instr = it.Current(); - if (instr->IsArithmeticBinaryOperation() && - instr->representation().IsInteger32() && - instr->HasAtLeastOneUseWithFlagAndNoneWithout( - HInstruction::kTruncatingToInt32)) { - instr->SetFlag(HInstruction::kAllUsesTruncatingToInt32); + if (instr->IsArithmeticBinaryOperation()) { + if (instr->representation().IsInteger32()) { + if (instr->HasAtLeastOneUseWithFlagAndNoneWithout( + HInstruction::kTruncatingToInt32)) { + instr->SetFlag(HInstruction::kAllUsesTruncatingToInt32); + } + } else if (instr->representation().IsSmi()) { + if (instr->HasAtLeastOneUseWithFlagAndNoneWithout( + HInstruction::kTruncatingToSmi)) { + instr->SetFlag(HInstruction::kAllUsesTruncatingToSmi); + } + } } } } diff --git a/deps/v8/src/hydrogen-deoptimizing-mark.cc b/deps/v8/src/hydrogen-deoptimizing-mark.cc index 804d947..626848e 100644 --- a/deps/v8/src/hydrogen-deoptimizing-mark.cc +++ b/deps/v8/src/hydrogen-deoptimizing-mark.cc @@ -107,7 +107,7 @@ void HPropagateDeoptimizingMarkPhase::NullifyUnreachableInstructions() { instr->DeleteAndReplaceWith(last_dummy); continue; } - if (instr->IsSoftDeoptimize()) { + if (instr->IsDeoptimize()) { ASSERT(block->IsDeoptimizing()); nullify = true; } diff --git a/deps/v8/src/hydrogen-environment-liveness.cc b/deps/v8/src/hydrogen-environment-liveness.cc index 20e680c..9efa47b 100644 --- a/deps/v8/src/hydrogen-environment-liveness.cc +++ b/deps/v8/src/hydrogen-environment-liveness.cc @@ -172,15 +172,6 @@ void HEnvironmentLivenessAnalysisPhase::UpdateLivenessAtInstruction( last_simulate_ = NULL; break; } - case HValue::kDeoptimize: { - // Keep all environment slots alive. - HDeoptimize* deopt = HDeoptimize::cast(instr); - for (int i = deopt->first_local_index(); - i < deopt->first_expression_index(); ++i) { - live->Add(i); - } - break; - } case HValue::kSimulate: last_simulate_ = HSimulate::cast(instr); went_live_since_last_simulate_.Clear(); diff --git a/deps/v8/src/hydrogen-gvn.cc b/deps/v8/src/hydrogen-gvn.cc index 09bea5b..9a02a1d 100644 --- a/deps/v8/src/hydrogen-gvn.cc +++ b/deps/v8/src/hydrogen-gvn.cc @@ -401,7 +401,7 @@ void HGlobalValueNumberingPhase::ComputeBlockSideEffects() { for (HInstructionIterator it(block); !it.Done(); it.Advance()) { HInstruction* instr = it.Current(); side_effects.Add(instr->ChangesFlags()); - if (instr->IsSoftDeoptimize()) { + if (instr->IsDeoptimize()) { block_side_effects_[id].RemoveAll(); side_effects.RemoveAll(); break; diff --git a/deps/v8/src/hydrogen-instructions.cc b/deps/v8/src/hydrogen-instructions.cc index 880de29..5fe3af1 100644 --- a/deps/v8/src/hydrogen-instructions.cc +++ b/deps/v8/src/hydrogen-instructions.cc @@ -84,9 +84,9 @@ void HValue::InferRepresentation(HInferRepresentationPhase* h_infer) { UpdateRepresentation(new_rep, h_infer, "inputs"); new_rep = RepresentationFromUses(); UpdateRepresentation(new_rep, h_infer, "uses"); - new_rep = RepresentationFromUseRequirements(); - if (new_rep.fits_into(Representation::Integer32())) { - UpdateRepresentation(new_rep, h_infer, "use requirements"); + if (representation().IsSmi() && HasNonSmiUse()) { + UpdateRepresentation( + Representation::Integer32(), h_infer, "use requirements"); } } @@ -259,34 +259,56 @@ HValue* RangeEvaluationContext::ConvertGuarantee(HValue* guarantee) { } -static int32_t ConvertAndSetOverflow(int64_t result, bool* overflow) { - if (result > kMaxInt) { - *overflow = true; - return kMaxInt; - } - if (result < kMinInt) { - *overflow = true; - return kMinInt; +static int32_t ConvertAndSetOverflow(Representation r, + int64_t result, + bool* overflow) { + if (r.IsSmi()) { + if (result > Smi::kMaxValue) { + *overflow = true; + return Smi::kMaxValue; + } + if (result < Smi::kMinValue) { + *overflow = true; + return Smi::kMinValue; + } + } else { + if (result > kMaxInt) { + *overflow = true; + return kMaxInt; + } + if (result < kMinInt) { + *overflow = true; + return kMinInt; + } } return static_cast(result); } -static int32_t AddWithoutOverflow(int32_t a, int32_t b, bool* overflow) { +static int32_t AddWithoutOverflow(Representation r, + int32_t a, + int32_t b, + bool* overflow) { int64_t result = static_cast(a) + static_cast(b); - return ConvertAndSetOverflow(result, overflow); + return ConvertAndSetOverflow(r, result, overflow); } -static int32_t SubWithoutOverflow(int32_t a, int32_t b, bool* overflow) { +static int32_t SubWithoutOverflow(Representation r, + int32_t a, + int32_t b, + bool* overflow) { int64_t result = static_cast(a) - static_cast(b); - return ConvertAndSetOverflow(result, overflow); + return ConvertAndSetOverflow(r, result, overflow); } -static int32_t MulWithoutOverflow(int32_t a, int32_t b, bool* overflow) { +static int32_t MulWithoutOverflow(const Representation& r, + int32_t a, + int32_t b, + bool* overflow) { int64_t result = static_cast(a) * static_cast(b); - return ConvertAndSetOverflow(result, overflow); + return ConvertAndSetOverflow(r, result, overflow); } @@ -306,8 +328,9 @@ int32_t Range::Mask() const { void Range::AddConstant(int32_t value) { if (value == 0) return; bool may_overflow = false; // Overflow is ignored here. - lower_ = AddWithoutOverflow(lower_, value, &may_overflow); - upper_ = AddWithoutOverflow(upper_, value, &may_overflow); + Representation r = Representation::Integer32(); + lower_ = AddWithoutOverflow(r, lower_, value, &may_overflow); + upper_ = AddWithoutOverflow(r, upper_, value, &may_overflow); #ifdef DEBUG Verify(); #endif @@ -366,10 +389,10 @@ void Range::Shl(int32_t value) { } -bool Range::AddAndCheckOverflow(Range* other) { +bool Range::AddAndCheckOverflow(const Representation& r, Range* other) { bool may_overflow = false; - lower_ = AddWithoutOverflow(lower_, other->lower(), &may_overflow); - upper_ = AddWithoutOverflow(upper_, other->upper(), &may_overflow); + lower_ = AddWithoutOverflow(r, lower_, other->lower(), &may_overflow); + upper_ = AddWithoutOverflow(r, upper_, other->upper(), &may_overflow); KeepOrder(); #ifdef DEBUG Verify(); @@ -378,10 +401,10 @@ bool Range::AddAndCheckOverflow(Range* other) { } -bool Range::SubAndCheckOverflow(Range* other) { +bool Range::SubAndCheckOverflow(const Representation& r, Range* other) { bool may_overflow = false; - lower_ = SubWithoutOverflow(lower_, other->upper(), &may_overflow); - upper_ = SubWithoutOverflow(upper_, other->lower(), &may_overflow); + lower_ = SubWithoutOverflow(r, lower_, other->upper(), &may_overflow); + upper_ = SubWithoutOverflow(r, upper_, other->lower(), &may_overflow); KeepOrder(); #ifdef DEBUG Verify(); @@ -406,12 +429,12 @@ void Range::Verify() const { #endif -bool Range::MulAndCheckOverflow(Range* other) { +bool Range::MulAndCheckOverflow(const Representation& r, Range* other) { bool may_overflow = false; - int v1 = MulWithoutOverflow(lower_, other->lower(), &may_overflow); - int v2 = MulWithoutOverflow(lower_, other->upper(), &may_overflow); - int v3 = MulWithoutOverflow(upper_, other->lower(), &may_overflow); - int v4 = MulWithoutOverflow(upper_, other->upper(), &may_overflow); + int v1 = MulWithoutOverflow(r, lower_, other->lower(), &may_overflow); + int v2 = MulWithoutOverflow(r, lower_, other->upper(), &may_overflow); + int v3 = MulWithoutOverflow(r, upper_, other->lower(), &may_overflow); + int v4 = MulWithoutOverflow(r, upper_, other->upper(), &may_overflow); lower_ = Min(Min(v1, v2), Min(v3, v4)); upper_ = Max(Max(v1, v2), Max(v3, v4)); #ifdef DEBUG @@ -1034,6 +1057,7 @@ void HBoundsCheck::TryGuaranteeRangeChanging(RangeEvaluationContext* context) { offset_ = context->offset(); SetResponsibilityForRange(DIRECTION_UPPER); context->set_upper_bound_guarantee(this); + isolate()->counters()->bounds_checks_eliminated()->Increment(); } else if (context->upper_bound_guarantee() != NULL && context->upper_bound_guarantee() != this && context->upper_bound_guarantee()->block() != block() && @@ -1043,6 +1067,7 @@ void HBoundsCheck::TryGuaranteeRangeChanging(RangeEvaluationContext* context) { offset_ = context->offset(); SetResponsibilityForRange(DIRECTION_LOWER); context->set_lower_bound_guarantee(this); + isolate()->counters()->bounds_checks_eliminated()->Increment(); } } @@ -1103,7 +1128,7 @@ void HBoundsCheck::AddInformativeDefinitions() { // is a hack. Move it to some other HPhase. if (FLAG_array_bounds_checks_elimination) { if (index()->TryGuaranteeRange(length())) { - set_skip_check(true); + set_skip_check(); } if (DetectCompoundIndex()) { HBoundsCheckBaseIndexInformation* base_index_info = @@ -1429,7 +1454,7 @@ void HLoadFieldByIndex::PrintDataTo(StringStream* stream) { HValue* HBitwise::Canonicalize() { - if (!representation().IsInteger32()) return this; + if (!representation().IsSmiOrInteger32()) return this; // If x is an int32, then x & -1 == x, x | 0 == x and x ^ 0 == x. int32_t nop_constant = (op() == Token::BIT_AND) ? -1 : 0; if (left()->EqualsInteger32Constant(nop_constant) && @@ -1549,7 +1574,7 @@ HValue* HUnaryMathOperation::Canonicalize() { // If the input is integer32 then we replace the floor instruction // with its input. - if (val->representation().IsInteger32()) return val; + if (val->representation().IsSmiOrInteger32()) return val; if (val->IsDiv() && (val->UseCount() == 1)) { HDiv* hdiv = HDiv::cast(val); @@ -1559,8 +1584,8 @@ HValue* HUnaryMathOperation::Canonicalize() { HValue* new_left = SimplifiedDividendForMathFloorOfDiv(left); if (new_left == NULL && hdiv->observed_input_representation(1).IsSmiOrInteger32()) { - new_left = new(block()->zone()) - HChange(left, Representation::Integer32(), false, false); + new_left = new(block()->zone()) HChange( + left, Representation::Integer32(), false, false, false); HChange::cast(new_left)->InsertBefore(this); } HValue* new_right = @@ -1570,8 +1595,8 @@ HValue* HUnaryMathOperation::Canonicalize() { CpuFeatures::IsSupported(SUDIV) && #endif hdiv->observed_input_representation(2).IsSmiOrInteger32()) { - new_right = new(block()->zone()) - HChange(right, Representation::Integer32(), false, false); + new_right = new(block()->zone()) HChange( + right, Representation::Integer32(), false, false, false); HChange::cast(new_right)->InsertBefore(this); } @@ -1680,7 +1705,7 @@ void HCheckMaps::PrintDataTo(StringStream* stream) { for (int i = 1; i < map_set()->length(); ++i) { stream->Add(",%p", *map_set()->at(i)); } - stream->Add("]"); + stream->Add("]%s", CanOmitMapChecks() ? "(omitted)" : ""); } @@ -1741,7 +1766,7 @@ void HInstanceOf::PrintDataTo(StringStream* stream) { Range* HValue::InferRange(Zone* zone) { Range* result; - if (type().IsSmi()) { + if (representation().IsSmi() || type().IsSmi()) { result = new(zone) Range(Smi::kMinValue, Smi::kMaxValue); result->set_can_be_minus_zero(false); } else { @@ -1756,10 +1781,11 @@ Range* HValue::InferRange(Zone* zone) { Range* HChange::InferRange(Zone* zone) { Range* input_range = value()->range(); - if (from().IsInteger32() && - to().IsSmiOrTagged() && - !value()->CheckFlag(HInstruction::kUint32) && - input_range != NULL && input_range->IsInSmiRange()) { + if (from().IsInteger32() && !value()->CheckFlag(HInstruction::kUint32) && + (to().IsSmi() || + (to().IsTagged() && + input_range != NULL && + input_range->IsInSmiRange()))) { set_type(HType::Smi()); ClearGVNFlag(kChangesNewSpacePromotion); } @@ -1767,7 +1793,9 @@ Range* HChange::InferRange(Zone* zone) { ? input_range->Copy(zone) : HValue::InferRange(zone); result->set_can_be_minus_zero(!to().IsSmiOrInteger32() || - !CheckFlag(kAllUsesTruncatingToInt32)); + !(CheckFlag(kAllUsesTruncatingToInt32) || + CheckFlag(kAllUsesTruncatingToSmi))); + if (to().IsSmi()) result->ClampToSmi(); return result; } @@ -1804,15 +1832,18 @@ Range* HPhi::InferRange(Zone* zone) { Range* HAdd::InferRange(Zone* zone) { - if (representation().IsInteger32()) { + Representation r = representation(); + if (r.IsSmiOrInteger32()) { Range* a = left()->range(); Range* b = right()->range(); Range* res = a->Copy(zone); - if (!res->AddAndCheckOverflow(b) || - CheckFlag(kAllUsesTruncatingToInt32)) { + if (!res->AddAndCheckOverflow(r, b) || + (r.IsInteger32() && CheckFlag(kAllUsesTruncatingToInt32)) || + (r.IsSmi() && CheckFlag(kAllUsesTruncatingToSmi))) { ClearFlag(kCanOverflow); } - res->set_can_be_minus_zero(!CheckFlag(kAllUsesTruncatingToInt32) && + res->set_can_be_minus_zero(!CheckFlag(kAllUsesTruncatingToSmi) && + !CheckFlag(kAllUsesTruncatingToInt32) && a->CanBeMinusZero() && b->CanBeMinusZero()); return res; } else { @@ -1822,15 +1853,18 @@ Range* HAdd::InferRange(Zone* zone) { Range* HSub::InferRange(Zone* zone) { - if (representation().IsInteger32()) { + Representation r = representation(); + if (r.IsSmiOrInteger32()) { Range* a = left()->range(); Range* b = right()->range(); Range* res = a->Copy(zone); - if (!res->SubAndCheckOverflow(b) || - CheckFlag(kAllUsesTruncatingToInt32)) { + if (!res->SubAndCheckOverflow(r, b) || + (r.IsInteger32() && CheckFlag(kAllUsesTruncatingToInt32)) || + (r.IsSmi() && CheckFlag(kAllUsesTruncatingToSmi))) { ClearFlag(kCanOverflow); } - res->set_can_be_minus_zero(!CheckFlag(kAllUsesTruncatingToInt32) && + res->set_can_be_minus_zero(!CheckFlag(kAllUsesTruncatingToSmi) && + !CheckFlag(kAllUsesTruncatingToInt32) && a->CanBeMinusZero() && b->CanBeZero()); return res; } else { @@ -1840,17 +1874,19 @@ Range* HSub::InferRange(Zone* zone) { Range* HMul::InferRange(Zone* zone) { - if (representation().IsInteger32()) { + Representation r = representation(); + if (r.IsSmiOrInteger32()) { Range* a = left()->range(); Range* b = right()->range(); Range* res = a->Copy(zone); - if (!res->MulAndCheckOverflow(b)) { + if (!res->MulAndCheckOverflow(r, b)) { // Clearing the kCanOverflow flag when kAllUsesAreTruncatingToInt32 // would be wrong, because truncated integer multiplication is too // precise and therefore not the same as converting to Double and back. ClearFlag(kCanOverflow); } - res->set_can_be_minus_zero(!CheckFlag(kAllUsesTruncatingToInt32) && + res->set_can_be_minus_zero(!CheckFlag(kAllUsesTruncatingToSmi) && + !CheckFlag(kAllUsesTruncatingToInt32) && ((a->CanBeZero() && b->CanBeNegative()) || (a->CanBeNegative() && b->CanBeZero()))); return res; @@ -1968,8 +2004,452 @@ bool HPhi::IsRelationTrueInternal(NumericRelation relation, } +InductionVariableData* InductionVariableData::ExaminePhi(HPhi* phi) { + if (phi->block()->loop_information() == NULL) return NULL; + if (phi->OperandCount() != 2) return NULL; + int32_t candidate_increment; + + candidate_increment = ComputeIncrement(phi, phi->OperandAt(0)); + if (candidate_increment != 0) { + return new(phi->block()->graph()->zone()) + InductionVariableData(phi, phi->OperandAt(1), candidate_increment); + } + + candidate_increment = ComputeIncrement(phi, phi->OperandAt(1)); + if (candidate_increment != 0) { + return new(phi->block()->graph()->zone()) + InductionVariableData(phi, phi->OperandAt(0), candidate_increment); + } + + return NULL; +} + + +/* + * This function tries to match the following patterns (and all the relevant + * variants related to |, & and + being commutative): + * base | constant_or_mask + * base & constant_and_mask + * (base + constant_offset) & constant_and_mask + * (base - constant_offset) & constant_and_mask + */ +void InductionVariableData::DecomposeBitwise( + HValue* value, + BitwiseDecompositionResult* result) { + HValue* base = IgnoreOsrValue(value); + result->base = value; + + if (!base->representation().IsInteger32()) return; + + if (base->IsBitwise()) { + bool allow_offset = false; + int32_t mask = 0; + + HBitwise* bitwise = HBitwise::cast(base); + if (bitwise->right()->IsInteger32Constant()) { + mask = bitwise->right()->GetInteger32Constant(); + base = bitwise->left(); + } else if (bitwise->left()->IsInteger32Constant()) { + mask = bitwise->left()->GetInteger32Constant(); + base = bitwise->right(); + } else { + return; + } + if (bitwise->op() == Token::BIT_AND) { + result->and_mask = mask; + allow_offset = true; + } else if (bitwise->op() == Token::BIT_OR) { + result->or_mask = mask; + } else { + return; + } + + result->context = bitwise->context(); + + if (allow_offset) { + if (base->IsAdd()) { + HAdd* add = HAdd::cast(base); + if (add->right()->IsInteger32Constant()) { + base = add->left(); + } else if (add->left()->IsInteger32Constant()) { + base = add->right(); + } + } else if (base->IsSub()) { + HSub* sub = HSub::cast(base); + if (sub->right()->IsInteger32Constant()) { + base = sub->left(); + } + } + } + + result->base = base; + } +} + + +void InductionVariableData::AddCheck(HBoundsCheck* check, + int32_t upper_limit) { + ASSERT(limit_validity() != NULL); + if (limit_validity() != check->block() && + !limit_validity()->Dominates(check->block())) return; + if (!phi()->block()->current_loop()->IsNestedInThisLoop( + check->block()->current_loop())) return; + + ChecksRelatedToLength* length_checks = checks(); + while (length_checks != NULL) { + if (length_checks->length() == check->length()) break; + length_checks = length_checks->next(); + } + if (length_checks == NULL) { + length_checks = new(check->block()->zone()) + ChecksRelatedToLength(check->length(), checks()); + checks_ = length_checks; + } + + length_checks->AddCheck(check, upper_limit); +} + + +void InductionVariableData::ChecksRelatedToLength::CloseCurrentBlock() { + if (checks() != NULL) { + InductionVariableCheck* c = checks(); + HBasicBlock* current_block = c->check()->block(); + while (c != NULL && c->check()->block() == current_block) { + c->set_upper_limit(current_upper_limit_); + c = c->next(); + } + } +} + + +void InductionVariableData::ChecksRelatedToLength::UseNewIndexInCurrentBlock( + Token::Value token, + int32_t mask, + HValue* index_base, + HValue* context) { + ASSERT(first_check_in_block() != NULL); + HValue* previous_index = first_check_in_block()->index(); + ASSERT(context != NULL); + + set_added_constant(new(index_base->block()->graph()->zone()) HConstant( + mask, index_base->representation())); + if (added_index() != NULL) { + added_constant()->InsertBefore(added_index()); + } else { + added_constant()->InsertBefore(first_check_in_block()); + } + + if (added_index() == NULL) { + first_check_in_block()->ReplaceAllUsesWith(first_check_in_block()->index()); + HInstruction* new_index = HBitwise::New( + index_base->block()->graph()->zone(), + token, context, index_base, added_constant()); + ASSERT(new_index->IsBitwise()); + new_index->ClearAllSideEffects(); + new_index->AssumeRepresentation(Representation::Integer32()); + set_added_index(HBitwise::cast(new_index)); + added_index()->InsertBefore(first_check_in_block()); + } + ASSERT(added_index()->op() == token); + + added_index()->SetOperandAt(1, index_base); + added_index()->SetOperandAt(2, added_constant()); + first_check_in_block()->SetOperandAt(0, added_index()); + if (previous_index->UseCount() == 0) { + previous_index->DeleteAndReplaceWith(NULL); + } +} + +void InductionVariableData::ChecksRelatedToLength::AddCheck( + HBoundsCheck* check, + int32_t upper_limit) { + BitwiseDecompositionResult decomposition; + InductionVariableData::DecomposeBitwise(check->index(), &decomposition); + + if (first_check_in_block() == NULL || + first_check_in_block()->block() != check->block()) { + CloseCurrentBlock(); + + first_check_in_block_ = check; + set_added_index(NULL); + set_added_constant(NULL); + current_and_mask_in_block_ = decomposition.and_mask; + current_or_mask_in_block_ = decomposition.or_mask; + current_upper_limit_ = upper_limit; + + InductionVariableCheck* new_check = new(check->block()->graph()->zone()) + InductionVariableCheck(check, checks_, upper_limit); + checks_ = new_check; + return; + } + + if (upper_limit > current_upper_limit()) { + current_upper_limit_ = upper_limit; + } + + if (decomposition.and_mask != 0 && + current_or_mask_in_block() == 0) { + if (current_and_mask_in_block() == 0 || + decomposition.and_mask > current_and_mask_in_block()) { + UseNewIndexInCurrentBlock(Token::BIT_AND, + decomposition.and_mask, + decomposition.base, + decomposition.context); + current_and_mask_in_block_ = decomposition.and_mask; + } + check->set_skip_check(); + } + if (current_and_mask_in_block() == 0) { + if (decomposition.or_mask > current_or_mask_in_block()) { + UseNewIndexInCurrentBlock(Token::BIT_OR, + decomposition.or_mask, + decomposition.base, + decomposition.context); + current_or_mask_in_block_ = decomposition.or_mask; + } + check->set_skip_check(); + } + + if (!check->skip_check()) { + InductionVariableCheck* new_check = new(check->block()->graph()->zone()) + InductionVariableCheck(check, checks_, upper_limit); + checks_ = new_check; + } +} + + +/* + * This method detects if phi is an induction variable, with phi_operand as + * its "incremented" value (the other operand would be the "base" value). + * + * It cheks is phi_operand has the form "phi + constant". + * If yes, the constant is the increment that the induction variable gets at + * every loop iteration. + * Otherwise it returns 0. + */ +int32_t InductionVariableData::ComputeIncrement(HPhi* phi, + HValue* phi_operand) { + if (!phi_operand->representation().IsInteger32()) return 0; + + if (phi_operand->IsAdd()) { + HAdd* operation = HAdd::cast(phi_operand); + if (operation->left() == phi && + operation->right()->IsInteger32Constant()) { + return operation->right()->GetInteger32Constant(); + } else if (operation->right() == phi && + operation->left()->IsInteger32Constant()) { + return operation->left()->GetInteger32Constant(); + } + } else if (phi_operand->IsSub()) { + HSub* operation = HSub::cast(phi_operand); + if (operation->left() == phi && + operation->right()->IsInteger32Constant()) { + return -operation->right()->GetInteger32Constant(); + } + } + + return 0; +} + + +/* + * Swaps the information in "update" with the one contained in "this". + * The swapping is important because this method is used while doing a + * dominator tree traversal, and "update" will retain the old data that + * will be restored while backtracking. + */ +void InductionVariableData::UpdateAdditionalLimit( + InductionVariableLimitUpdate* update) { + ASSERT(update->updated_variable == this); + if (update->limit_is_upper) { + swap(&additional_upper_limit_, &update->limit); + swap(&additional_upper_limit_is_included_, &update->limit_is_included); + } else { + swap(&additional_lower_limit_, &update->limit); + swap(&additional_lower_limit_is_included_, &update->limit_is_included); + } +} + + +int32_t InductionVariableData::ComputeUpperLimit(int32_t and_mask, + int32_t or_mask) { + // Should be Smi::kMaxValue but it must fit 32 bits; lower is safe anyway. + const int32_t MAX_LIMIT = 1 << 30; + + int32_t result = MAX_LIMIT; + + if (limit() != NULL && + limit()->IsInteger32Constant()) { + int32_t limit_value = limit()->GetInteger32Constant(); + if (!limit_included()) { + limit_value--; + } + if (limit_value < result) result = limit_value; + } + + if (additional_upper_limit() != NULL && + additional_upper_limit()->IsInteger32Constant()) { + int32_t limit_value = additional_upper_limit()->GetInteger32Constant(); + if (!additional_upper_limit_is_included()) { + limit_value--; + } + if (limit_value < result) result = limit_value; + } + + if (and_mask > 0 && and_mask < MAX_LIMIT) { + if (and_mask < result) result = and_mask; + return result; + } + + // Add the effect of the or_mask. + result |= or_mask; + + return result >= MAX_LIMIT ? kNoLimit : result; +} + + +HValue* InductionVariableData::IgnoreOsrValue(HValue* v) { + if (!v->IsPhi()) return v; + HPhi* phi = HPhi::cast(v); + if (phi->OperandCount() != 2) return v; + if (phi->OperandAt(0)->block()->is_osr_entry()) { + return phi->OperandAt(1); + } else if (phi->OperandAt(1)->block()->is_osr_entry()) { + return phi->OperandAt(0); + } else { + return v; + } +} + + +InductionVariableData* InductionVariableData::GetInductionVariableData( + HValue* v) { + v = IgnoreOsrValue(v); + if (v->IsPhi()) { + return HPhi::cast(v)->induction_variable_data(); + } + return NULL; +} + + +/* + * Check if a conditional branch to "current_branch" with token "token" is + * the branch that keeps the induction loop running (and, conversely, will + * terminate it if the "other_branch" is taken). + * + * Three conditions must be met: + * - "current_branch" must be in the induction loop. + * - "other_branch" must be out of the induction loop. + * - "token" and the induction increment must be "compatible": the token should + * be a condition that keeps the execution inside the loop until the limit is + * reached. + */ +bool InductionVariableData::CheckIfBranchIsLoopGuard( + Token::Value token, + HBasicBlock* current_branch, + HBasicBlock* other_branch) { + if (!phi()->block()->current_loop()->IsNestedInThisLoop( + current_branch->current_loop())) { + return false; + } + + if (phi()->block()->current_loop()->IsNestedInThisLoop( + other_branch->current_loop())) { + return false; + } + + if (increment() > 0 && (token == Token::LT || token == Token::LTE)) { + return true; + } + if (increment() < 0 && (token == Token::GT || token == Token::GTE)) { + return true; + } + if (Token::IsInequalityOp(token) && (increment() == 1 || increment() == -1)) { + return true; + } + + return false; +} + + +void InductionVariableData::ComputeLimitFromPredecessorBlock( + HBasicBlock* block, + LimitFromPredecessorBlock* result) { + if (block->predecessors()->length() != 1) return; + HBasicBlock* predecessor = block->predecessors()->at(0); + HInstruction* end = predecessor->last(); + + if (!end->IsCompareNumericAndBranch()) return; + HCompareNumericAndBranch* branch = HCompareNumericAndBranch::cast(end); + + Token::Value token = branch->token(); + if (!Token::IsArithmeticCompareOp(token)) return; + + HBasicBlock* other_target; + if (block == branch->SuccessorAt(0)) { + other_target = branch->SuccessorAt(1); + } else { + other_target = branch->SuccessorAt(0); + token = Token::NegateCompareOp(token); + ASSERT(block == branch->SuccessorAt(1)); + } + + InductionVariableData* data; + + data = GetInductionVariableData(branch->left()); + HValue* limit = branch->right(); + if (data == NULL) { + data = GetInductionVariableData(branch->right()); + token = Token::ReverseCompareOp(token); + limit = branch->left(); + } + + if (data != NULL) { + result->variable = data; + result->token = token; + result->limit = limit; + result->other_target = other_target; + } +} + + +/* + * Compute the limit that is imposed on an induction variable when entering + * "block" (if any). + * If the limit is the "proper" induction limit (the one that makes the loop + * terminate when the induction variable reaches it) it is stored directly in + * the induction variable data. + * Otherwise the limit is written in "additional_limit" and the method + * returns true. + */ +bool InductionVariableData::ComputeInductionVariableLimit( + HBasicBlock* block, + InductionVariableLimitUpdate* additional_limit) { + LimitFromPredecessorBlock limit; + ComputeLimitFromPredecessorBlock(block, &limit); + if (!limit.LimitIsValid()) return false; + + if (limit.variable->CheckIfBranchIsLoopGuard(limit.token, + block, + limit.other_target)) { + limit.variable->limit_ = limit.limit; + limit.variable->limit_included_ = limit.LimitIsIncluded(); + limit.variable->limit_validity_ = block; + limit.variable->induction_exit_block_ = block->predecessors()->at(0); + limit.variable->induction_exit_target_ = limit.other_target; + return false; + } else { + additional_limit->updated_variable = limit.variable; + additional_limit->limit = limit.limit; + additional_limit->limit_is_upper = limit.LimitIsUpper(); + additional_limit->limit_is_included = limit.LimitIsIncluded(); + return true; + } +} + + Range* HMathMinMax::InferRange(Zone* zone) { - if (representation().IsInteger32()) { + if (representation().IsSmiOrInteger32()) { Range* a = left()->range(); Range* b = right()->range(); Range* res = a->Copy(zone); @@ -2054,6 +2534,7 @@ void HPhi::InitRealUses(int phi_id) { // Compute a conservative approximation of truncating uses before inferring // representations. The proper, exact computation will be done later, when // inserting representation changes. + SetFlag(kTruncatingToSmi); SetFlag(kTruncatingToInt32); for (HUseIterator it(uses()); !it.Done(); it.Advance()) { HValue* value = it.value(); @@ -2064,8 +2545,13 @@ void HPhi::InitRealUses(int phi_id) { PrintF("#%d Phi is used by real #%d %s as %s\n", id(), value->id(), value->Mnemonic(), rep.Mnemonic()); } - if (!value->IsSimulate() && !value->CheckFlag(kTruncatingToInt32)) { - ClearFlag(kTruncatingToInt32); + if (!value->IsSimulate()) { + if (!value->CheckFlag(kTruncatingToSmi)) { + ClearFlag(kTruncatingToSmi); + } + if (!value->CheckFlag(kTruncatingToInt32)) { + ClearFlag(kTruncatingToInt32); + } } } } @@ -2136,16 +2622,6 @@ void HSimulate::PrintDataTo(StringStream* stream) { } -void HDeoptimize::PrintDataTo(StringStream* stream) { - if (OperandCount() == 0) return; - OperandAt(0)->PrintNameTo(stream); - for (int i = 1; i < OperandCount(); ++i) { - stream->Add(" "); - OperandAt(i)->PrintNameTo(stream); - } -} - - void HEnterInlined::RegisterReturnTarget(HBasicBlock* return_target, Zone* zone) { ASSERT(return_target->IsInlineReturnTarget()); @@ -2262,7 +2738,7 @@ HConstant::HConstant(double double_value, void HConstant::Initialize(Representation r) { if (r.IsNone()) { - if (has_smi_value_) { + if (has_smi_value_ && kSmiValueSize == 31) { r = Representation::Smi(); } else if (has_int32_value_) { r = Representation::Integer32(); @@ -2310,20 +2786,38 @@ HConstant* HConstant::CopyToRepresentation(Representation r, Zone* zone) const { } -HConstant* HConstant::CopyToTruncatedInt32(Zone* zone) const { +Maybe HConstant::CopyToTruncatedInt32(Zone* zone) { + HConstant* res = NULL; if (has_int32_value_) { - return new(zone) HConstant(int32_value_, - Representation::Integer32(), - is_not_in_new_space_, - handle_); + res = new(zone) HConstant(int32_value_, + Representation::Integer32(), + is_not_in_new_space_, + handle_); + } else if (has_double_value_) { + res = new(zone) HConstant(DoubleToInt32(double_value_), + Representation::Integer32(), + is_not_in_new_space_, + handle_); + } else { + ASSERT(!HasNumberValue()); + Maybe number = CopyToTruncatedNumber(zone); + if (number.has_value) return number.value->CopyToTruncatedInt32(zone); } - if (has_double_value_) { - return new(zone) HConstant(DoubleToInt32(double_value_), - Representation::Integer32(), - is_not_in_new_space_, - handle_); + return Maybe(res != NULL, res); +} + + +Maybe HConstant::CopyToTruncatedNumber(Zone* zone) { + HConstant* res = NULL; + if (handle()->IsBoolean()) { + res = handle()->BooleanValue() ? + new(zone) HConstant(1) : new(zone) HConstant(0); + } else if (handle()->IsUndefined()) { + res = new(zone) HConstant(OS::nan_value()); + } else if (handle()->IsNull()) { + res = new(zone) HConstant(0); } - return NULL; + return Maybe(res != NULL, res); } @@ -2351,25 +2845,18 @@ void HBinaryOperation::InferRepresentation(HInferRepresentationPhase* h_infer) { ASSERT(CheckFlag(kFlexibleRepresentation)); Representation new_rep = RepresentationFromInputs(); UpdateRepresentation(new_rep, h_infer, "inputs"); - // When the operation has information about its own output type, don't look - // at uses. - if (!observed_output_representation_.IsNone()) return; - new_rep = RepresentationFromUses(); - UpdateRepresentation(new_rep, h_infer, "uses"); - new_rep = RepresentationFromUseRequirements(); - if (new_rep.fits_into(Representation::Integer32())) { - UpdateRepresentation(new_rep, h_infer, "use requirements"); + if (observed_output_representation_.IsNone()) { + new_rep = RepresentationFromUses(); + UpdateRepresentation(new_rep, h_infer, "uses"); + } else { + new_rep = RepresentationFromOutput(); + UpdateRepresentation(new_rep, h_infer, "output"); } -} - -bool HBinaryOperation::IgnoreObservedOutputRepresentation( - Representation current_rep) { - return observed_output_representation_.IsDouble() && - current_rep.IsInteger32() && - // Mul in Integer32 mode would be too precise. - !this->IsMul() && - CheckUsesForFlag(kTruncatingToInt32); + if (representation().IsSmi() && HasNonSmiUse()) { + UpdateRepresentation( + Representation::Integer32(), h_infer, "use requirements"); + } } @@ -2378,28 +2865,38 @@ Representation HBinaryOperation::RepresentationFromInputs() { // the currently assumed output representation. Representation rep = representation(); for (int i = 1; i <= 2; ++i) { - Representation input_rep = observed_input_representation(i); - if (input_rep.is_more_general_than(rep)) rep = input_rep; + rep = rep.generalize(observed_input_representation(i)); } // If any of the actual input representation is more general than what we // have so far but not Tagged, use that representation instead. Representation left_rep = left()->representation(); Representation right_rep = right()->representation(); + if (!left_rep.IsTagged()) rep = rep.generalize(left_rep); + if (!right_rep.IsTagged()) rep = rep.generalize(right_rep); - if (left_rep.is_more_general_than(rep) && !left_rep.IsTagged()) { - rep = left_rep; - } - if (right_rep.is_more_general_than(rep) && !right_rep.IsTagged()) { - rep = right_rep; - } + return rep; +} + + +bool HBinaryOperation::IgnoreObservedOutputRepresentation( + Representation current_rep) { + return ((current_rep.IsInteger32() && CheckUsesForFlag(kTruncatingToInt32)) || + (current_rep.IsSmi() && CheckUsesForFlag(kTruncatingToSmi))) && + // Mul in Integer32 mode would be too precise. + !this->IsMul(); +} + + +Representation HBinaryOperation::RepresentationFromOutput() { + Representation rep = representation(); // Consider observed output representation, but ignore it if it's Double, // this instruction is not a division, and all its uses are truncating // to Integer32. if (observed_output_representation_.is_more_general_than(rep) && !IgnoreObservedOutputRepresentation(rep)) { - rep = observed_output_representation_; + return observed_output_representation_; } - return rep; + return Representation::None(); } @@ -2715,7 +3212,7 @@ HLoadNamedFieldPolymorphic::HLoadNamedFieldPolymorphic(HValue* context, types_.Add(types->at(i), zone); break; } - case CONSTANT_FUNCTION: + case CONSTANT: types_.Add(types->at(i), zone); break; case CALLBACKS: @@ -2757,6 +3254,55 @@ HLoadNamedFieldPolymorphic::HLoadNamedFieldPolymorphic(HValue* context, } +HCheckMaps* HCheckMaps::New(HValue* value, + Handle map, + Zone* zone, + CompilationInfo* info, + HValue* typecheck) { + HCheckMaps* check_map = new(zone) HCheckMaps(value, zone, typecheck); + check_map->map_set_.Add(map, zone); + if (map->CanOmitMapChecks() && + value->IsConstant() && + HConstant::cast(value)->InstanceOf(map)) { + check_map->omit(info); + } + return check_map; +} + + +HCheckMaps* HCheckMaps::NewWithTransitions(HValue* value, + Handle map, + Zone* zone, + CompilationInfo* info) { + HCheckMaps* check_map = new(zone) HCheckMaps(value, zone, value); + check_map->map_set_.Add(map, zone); + + // Since transitioned elements maps of the initial map don't fail the map + // check, the CheckMaps instruction doesn't need to depend on ElementsKinds. + check_map->ClearGVNFlag(kDependsOnElementsKind); + + ElementsKind kind = map->elements_kind(); + bool packed = IsFastPackedElementsKind(kind); + while (CanTransitionToMoreGeneralFastElementsKind(kind, packed)) { + kind = GetNextMoreGeneralFastElementsKind(kind, packed); + Map* transitioned_map = + map->LookupElementsTransitionMap(kind); + if (transitioned_map) { + check_map->map_set_.Add(Handle(transitioned_map), zone); + } + }; + + if (map->CanOmitMapChecks() && + value->IsConstant() && + HConstant::cast(value)->InstanceOf(map)) { + check_map->omit(info); + } + + check_map->map_set_.Sort(); + return check_map; +} + + void HCheckMaps::FinalizeUniqueValueId() { if (!map_unique_ids_.is_empty()) return; Zone* zone = block()->zone(); @@ -3187,11 +3733,6 @@ HType HStringCharFromCode::CalculateInferredType() { } -HType HAllocate::CalculateInferredType() { - return type_; -} - - void HAllocate::HandleSideEffectDominator(GVNFlag side_effect, HValue* dominator) { ASSERT(side_effect == kChangesNewSpacePromotion); @@ -3210,12 +3751,9 @@ void HAllocate::HandleSideEffectDominator(GVNFlag side_effect, HValue* dominator_size = dominator_allocate_instr->size(); HValue* current_size = size(); // We can just fold allocations that are guaranteed in new space. - // TODO(hpayer): Support double aligned allocations. // TODO(hpayer): Add support for non-constant allocation in dominator. - if (!GuaranteedInNewSpace() || MustAllocateDoubleAligned() || - !current_size->IsInteger32Constant() || + if (!GuaranteedInNewSpace() || !current_size->IsInteger32Constant() || !dominator_allocate_instr->GuaranteedInNewSpace() || - dominator_allocate_instr->MustAllocateDoubleAligned() || !dominator_size->IsInteger32Constant()) { if (FLAG_trace_allocation_folding) { PrintF("#%d (%s) cannot fold into #%d (%s)\n", @@ -3229,43 +3767,37 @@ void HAllocate::HandleSideEffectDominator(GVNFlag side_effect, HConstant::cast(dominator_size)->GetInteger32Constant(); int32_t current_size_constant = HConstant::cast(current_size)->GetInteger32Constant(); + int32_t new_dominator_size = dominator_size_constant + current_size_constant; + + if (MustAllocateDoubleAligned()) { + if (!dominator_allocate_instr->MustAllocateDoubleAligned()) { + dominator_allocate_instr->SetFlags(HAllocate::ALLOCATE_DOUBLE_ALIGNED); + } + if ((dominator_size_constant & kDoubleAlignmentMask) != 0) { + dominator_size_constant += kDoubleSize / 2; + new_dominator_size += kDoubleSize / 2; + } + } + + if (new_dominator_size > Page::kMaxNonCodeHeapObjectSize) { + if (FLAG_trace_allocation_folding) { + PrintF("#%d (%s) cannot fold into #%d (%s) due to size: %d\n", + id(), Mnemonic(), dominator->id(), dominator->Mnemonic(), + new_dominator_size); + } + return; + } HBasicBlock* block = dominator->block(); Zone* zone = block->zone(); - HInstruction* new_dominator_size = new(zone) HConstant( - dominator_size_constant + current_size_constant); - new_dominator_size->InsertBefore(dominator_allocate_instr); - dominator_allocate_instr->UpdateSize(new_dominator_size); + HInstruction* new_dominator_size_constant = new(zone) HConstant( + new_dominator_size); + new_dominator_size_constant->InsertBefore(dominator_allocate_instr); + dominator_allocate_instr->UpdateSize(new_dominator_size_constant); #ifdef VERIFY_HEAP - HInstruction* free_space_instr = - new(zone) HInnerAllocatedObject(dominator_allocate_instr, - dominator_size_constant, - type()); - free_space_instr->InsertAfter(dominator_allocate_instr); - HConstant* filler_map = new(zone) HConstant( - isolate()->factory()->free_space_map(), - UniqueValueId(isolate()->heap()->free_space_map()), - Representation::Tagged(), - HType::Tagged(), - false, - true, - false, - false); - filler_map->InsertAfter(free_space_instr); - - HInstruction* store_map = new(zone) HStoreNamedField( - free_space_instr, HObjectAccess::ForMap(), filler_map); - store_map->SetFlag(HValue::kHasNoObservableSideEffects); - store_map->InsertAfter(filler_map); - - HInstruction* free_space_size = new(zone) HConstant(current_size_constant); - free_space_size->InsertAfter(store_map); - HObjectAccess access = - HObjectAccess::ForJSObjectOffset(FreeSpace::kSizeOffset); - HInstruction* store_size = new(zone) HStoreNamedField( - free_space_instr, access, free_space_size); - store_size->SetFlag(HValue::kHasNoObservableSideEffects); - store_size->InsertAfter(free_space_size); + if (FLAG_verify_heap) { + dominator_allocate_instr->SetFlags(HAllocate::PREFILL_WITH_FILLER); + } #endif // After that replace the dominated allocate instruction. @@ -3301,29 +3833,28 @@ HType HFunctionLiteral::CalculateInferredType() { HValue* HUnaryMathOperation::EnsureAndPropagateNotMinusZero( BitVector* visited) { visited->Add(id()); - if (representation().IsInteger32() && - !value()->representation().IsInteger32()) { + if (representation().IsSmiOrInteger32() && + !value()->representation().Equals(representation())) { if (value()->range() == NULL || value()->range()->CanBeMinusZero()) { SetFlag(kBailoutOnMinusZero); } } - if (RequiredInputRepresentation(0).IsInteger32() && - representation().IsInteger32()) { + if (RequiredInputRepresentation(0).IsSmiOrInteger32() && + representation().Equals(RequiredInputRepresentation(0))) { return value(); } return NULL; } - HValue* HChange::EnsureAndPropagateNotMinusZero(BitVector* visited) { visited->Add(id()); - if (from().IsInteger32()) return NULL; + if (from().IsSmiOrInteger32()) return NULL; if (CanTruncateToInt32()) return NULL; if (value()->range() == NULL || value()->range()->CanBeMinusZero()) { SetFlag(kBailoutOnMinusZero); } - ASSERT(!from().IsInteger32() || !to().IsInteger32()); + ASSERT(!from().IsSmiOrInteger32() || !to().IsSmiOrInteger32()); return NULL; } @@ -3410,7 +3941,7 @@ bool HStoreKeyed::NeedsCanonicalization() { } if (value()->IsChange()) { - if (HChange::cast(value())->from().IsInteger32()) { + if (HChange::cast(value())->from().IsSmiOrInteger32()) { return false; } if (HChange::cast(value())->value()->type().IsSmi()) { @@ -3421,8 +3952,8 @@ bool HStoreKeyed::NeedsCanonicalization() { } -#define H_CONSTANT_INT32(val) \ -new(zone) HConstant(static_cast(val), Representation::Integer32()) +#define H_CONSTANT_INT(val) \ +new(zone) HConstant(static_cast(val)) #define H_CONSTANT_DOUBLE(val) \ new(zone) HConstant(static_cast(val), Representation::Double()) @@ -3435,7 +3966,7 @@ HInstruction* HInstr::New( \ if ((c_left->HasNumberValue() && c_right->HasNumberValue())) { \ double double_res = c_left->DoubleValue() op c_right->DoubleValue(); \ if (TypeInfo::IsInt32Double(double_res)) { \ - return H_CONSTANT_INT32(double_res); \ + return H_CONSTANT_INT(double_res); \ } \ return H_CONSTANT_DOUBLE(double_res); \ } \ @@ -3634,7 +4165,7 @@ HInstruction* HMod::New(Zone* zone, if ((res == 0) && (dividend < 0)) { return H_CONSTANT_DOUBLE(-0.0); } - return H_CONSTANT_INT32(res); + return H_CONSTANT_INT(res); } } } @@ -3652,7 +4183,7 @@ HInstruction* HDiv::New( if (c_right->DoubleValue() != 0) { double double_res = c_left->DoubleValue() / c_right->DoubleValue(); if (TypeInfo::IsInt32Double(double_res)) { - return H_CONSTANT_INT32(double_res); + return H_CONSTANT_INT(double_res); } return H_CONSTANT_DOUBLE(double_res); } else { @@ -3689,7 +4220,7 @@ HInstruction* HBitwise::New( result = 0; // Please the compiler. UNREACHABLE(); } - return H_CONSTANT_INT32(result); + return H_CONSTANT_INT(result); } } return new(zone) HBitwise(op, context, left, right); @@ -3703,7 +4234,7 @@ HInstruction* HInstr::New( \ HConstant* c_left = HConstant::cast(left); \ HConstant* c_right = HConstant::cast(right); \ if ((c_left->HasNumberValue() && c_right->HasNumberValue())) { \ - return H_CONSTANT_INT32(result); \ + return H_CONSTANT_INT(result); \ } \ } \ return new(zone) HInstr(context, left, right); \ @@ -3729,14 +4260,14 @@ HInstruction* HShr::New( if ((right_val == 0) && (left_val < 0)) { return H_CONSTANT_DOUBLE(static_cast(left_val)); } - return H_CONSTANT_INT32(static_cast(left_val) >> right_val); + return H_CONSTANT_INT(static_cast(left_val) >> right_val); } } return new(zone) HShr(context, left, right); } -#undef H_CONSTANT_INT32 +#undef H_CONSTANT_INT #undef H_CONSTANT_DOUBLE @@ -3761,8 +4292,7 @@ void HPhi::SimplifyConstantInputs() { continue; } else if (operand->HasDoubleValue()) { HConstant* integer_input = - new(graph->zone()) HConstant(DoubleToInt32(operand->DoubleValue()), - Representation::Integer32()); + new(graph->zone()) HConstant(DoubleToInt32(operand->DoubleValue())); integer_input->InsertAfter(operand); SetOperandAt(i, integer_input); } else if (operand == graph->GetConstantTrue()) { @@ -3777,7 +4307,7 @@ void HPhi::SimplifyConstantInputs() { HValue* use = it.value(); if (use->IsBinaryOperation()) { HBinaryOperation::cast(use)->set_observed_input_representation( - it.index(), Representation::Integer32()); + it.index(), Representation::Smi()); } } } @@ -3826,6 +4356,17 @@ Representation HValue::RepresentationFromUseRequirements() { } +bool HValue::HasNonSmiUse() { + for (HUseIterator it(uses()); !it.Done(); it.Advance()) { + // We check for observed_input_representation elsewhere. + Representation use_rep = + it.value()->RequiredInputRepresentation(it.index()); + if (!use_rep.IsNone() && !use_rep.IsSmi()) return true; + } + return false; +} + + // Node-specific verification code is only included in debug mode. #ifdef DEBUG @@ -3869,7 +4410,8 @@ HObjectAccess HObjectAccess::ForFixedArrayHeader(int offset) { } -HObjectAccess HObjectAccess::ForJSObjectOffset(int offset) { +HObjectAccess HObjectAccess::ForJSObjectOffset(int offset, + Representation representation) { ASSERT(offset >= 0); Portion portion = kInobject; @@ -3878,7 +4420,7 @@ HObjectAccess HObjectAccess::ForJSObjectOffset(int offset) { } else if (offset == JSObject::kMapOffset) { portion = kMaps; } - return HObjectAccess(portion, offset, Handle::null()); + return HObjectAccess(portion, offset, representation); } @@ -3893,13 +4435,14 @@ HObjectAccess HObjectAccess::ForJSArrayOffset(int offset) { } else if (offset == JSObject::kMapOffset) { portion = kMaps; } - return HObjectAccess(portion, offset, Handle::null()); + return HObjectAccess(portion, offset); } -HObjectAccess HObjectAccess::ForBackingStoreOffset(int offset) { +HObjectAccess HObjectAccess::ForBackingStoreOffset(int offset, + Representation representation) { ASSERT(offset >= 0); - return HObjectAccess(kBackingStore, offset, Handle::null()); + return HObjectAccess(kBackingStore, offset, representation); } @@ -3907,30 +4450,35 @@ HObjectAccess HObjectAccess::ForField(Handle map, LookupResult *lookup, Handle name) { ASSERT(lookup->IsField() || lookup->IsTransitionToField(*map)); int index; + Representation representation; if (lookup->IsField()) { index = lookup->GetLocalFieldIndexFromMap(*map); + representation = lookup->representation(); } else { Map* transition = lookup->GetTransitionMapFromMap(*map); int descriptor = transition->LastAdded(); index = transition->instance_descriptors()->GetFieldIndex(descriptor) - map->inobject_properties(); + PropertyDetails details = + transition->instance_descriptors()->GetDetails(descriptor); + representation = details.representation(); } if (index < 0) { // Negative property indices are in-object properties, indexed // from the end of the fixed part of the object. int offset = (index * kPointerSize) + map->instance_size(); - return HObjectAccess(kInobject, offset); + return HObjectAccess(kInobject, offset, representation); } else { // Non-negative property indices are in the properties array. int offset = (index * kPointerSize) + FixedArray::kHeaderSize; - return HObjectAccess(kBackingStore, offset, name); + return HObjectAccess(kBackingStore, offset, representation, name); } } HObjectAccess HObjectAccess::ForCellPayload(Isolate* isolate) { return HObjectAccess( - kInobject, Cell::kValueOffset, + kInobject, Cell::kValueOffset, Representation::Tagged(), Handle(isolate->heap()->cell_value_string())); } diff --git a/deps/v8/src/hydrogen-instructions.h b/deps/v8/src/hydrogen-instructions.h index 5fba5f2..40bbc90 100644 --- a/deps/v8/src/hydrogen-instructions.h +++ b/deps/v8/src/hydrogen-instructions.h @@ -33,6 +33,7 @@ #include "allocation.h" #include "code-stubs.h" #include "data-flow.h" +#include "deoptimizer.h" #include "small-pointer-list.h" #include "string-stream.h" #include "v8conversions.h" @@ -91,17 +92,18 @@ class LChunkBuilder; V(CheckHeapObject) \ V(CheckInstanceType) \ V(CheckMaps) \ - V(CheckSmi) \ + V(CheckMapValue) \ V(CheckPrototypeMaps) \ + V(CheckSmi) \ V(ClampToUint8) \ V(ClassOfTestAndBranch) \ V(CompareNumericAndBranch) \ V(CompareGeneric) \ V(CompareObjectEqAndBranch) \ V(CompareMap) \ - V(CompareConstantEqAndBranch) \ V(Constant) \ V(Context) \ + V(DateField) \ V(DebugBreak) \ V(DeclareGlobals) \ V(Deoptimize) \ @@ -111,6 +113,8 @@ class LChunkBuilder; V(EnterInlined) \ V(EnvironmentMarker) \ V(ForceRepresentation) \ + V(ForInCacheArray) \ + V(ForInPrepareMap) \ V(FunctionLiteral) \ V(GetCachedArrayIndex) \ V(GlobalObject) \ @@ -134,6 +138,7 @@ class LChunkBuilder; V(LinkObjectInList) \ V(LoadContextSlot) \ V(LoadExternalArrayPointer) \ + V(LoadFieldByIndex) \ V(LoadFunctionPrototype) \ V(LoadGlobalCell) \ V(LoadGlobalGeneric) \ @@ -162,7 +167,6 @@ class LChunkBuilder; V(Shl) \ V(Shr) \ V(Simulate) \ - V(SoftDeoptimize) \ V(StackCheck) \ V(StoreContextSlot) \ V(StoreGlobalCell) \ @@ -188,11 +192,6 @@ class LChunkBuilder; V(UnknownOSRValue) \ V(UseConst) \ V(ValueOf) \ - V(ForInPrepareMap) \ - V(ForInCacheArray) \ - V(CheckMapValue) \ - V(LoadFieldByIndex) \ - V(DateField) \ V(WrapReceiver) #define GVN_TRACKED_FLAG_LIST(V) \ @@ -200,19 +199,20 @@ class LChunkBuilder; V(NewSpacePromotion) #define GVN_UNTRACKED_FLAG_LIST(V) \ - V(Calls) \ - V(InobjectFields) \ + V(ArrayElements) \ + V(ArrayLengths) \ V(BackingStoreFields) \ + V(Calls) \ + V(ContextSlots) \ + V(DoubleArrayElements) \ V(DoubleFields) \ V(ElementsKind) \ V(ElementsPointer) \ - V(ArrayElements) \ - V(DoubleArrayElements) \ - V(SpecializedArrayElements) \ V(GlobalVars) \ - V(ArrayLengths) \ - V(ContextSlots) \ - V(OsrEntries) + V(InobjectFields) \ + V(OsrEntries) \ + V(SpecializedArrayElements) + #define DECLARE_ABSTRACT_INSTRUCTION(type) \ virtual bool Is##type() const { return true; } \ @@ -294,9 +294,9 @@ class Range: public ZoneObject { void AddConstant(int32_t value); void Sar(int32_t value); void Shl(int32_t value); - bool AddAndCheckOverflow(Range* other); - bool SubAndCheckOverflow(Range* other); - bool MulAndCheckOverflow(Range* other); + bool AddAndCheckOverflow(const Representation& r, Range* other); + bool SubAndCheckOverflow(const Representation& r, Range* other); + bool MulAndCheckOverflow(const Representation& r, Range* other); private: int32_t lower_; @@ -407,6 +407,11 @@ class HType { return ((type_ & kString) == kString); } + bool IsNonString() const { + return IsTaggedPrimitive() || IsSmi() || IsHeapNumber() || + IsBoolean() || IsJSArray(); + } + bool IsBoolean() const { ASSERT(type_ != kUninitialized); return ((type_ & kBoolean) == kBoolean); @@ -800,6 +805,8 @@ class HValue: public ZoneObject { kIsArguments, kTruncatingToInt32, kAllUsesTruncatingToInt32, + kTruncatingToSmi, + kAllUsesTruncatingToSmi, // Set after an instruction is killed. kIsDead, // Instructions that are allowed to produce full range unsigned integer @@ -886,6 +893,7 @@ class HValue: public ZoneObject { HUseIterator uses() const { return HUseIterator(use_list_); } virtual bool EmitAtUses() { return false; } + Representation representation() const { return representation_; } void ChangeRepresentation(Representation r) { ASSERT(CheckFlag(kFlexibleRepresentation)); @@ -1161,6 +1169,7 @@ class HValue: public ZoneObject { } Representation RepresentationFromUses(); Representation RepresentationFromUseRequirements(); + bool HasNonSmiUse(); virtual void UpdateRepresentation(Representation new_rep, HInferRepresentationPhase* h_infer, const char* reason); @@ -1493,16 +1502,20 @@ class HNumericConstraint : public HTemplateInstruction<2> { }; -// We insert soft-deoptimize when we hit code with unknown typefeedback, -// so that we get a chance of re-optimizing with useful typefeedback. -// HSoftDeoptimize does not end a basic block as opposed to HDeoptimize. -class HSoftDeoptimize: public HTemplateInstruction<0> { +class HDeoptimize: public HTemplateInstruction<0> { public: + explicit HDeoptimize(Deoptimizer::BailoutType type) : type_(type) {} + virtual Representation RequiredInputRepresentation(int index) { return Representation::None(); } - DECLARE_CONCRETE_INSTRUCTION(SoftDeoptimize) + Deoptimizer::BailoutType type() { return type_; } + + DECLARE_CONCRETE_INSTRUCTION(Deoptimize) + + private: + Deoptimizer::BailoutType type_; }; @@ -1517,59 +1530,6 @@ class HDebugBreak: public HTemplateInstruction<0> { }; -class HDeoptimize: public HControlInstruction { - public: - HDeoptimize(int environment_length, - int first_local_index, - int first_expression_index, - Zone* zone) - : values_(environment_length, zone), - first_local_index_(first_local_index), - first_expression_index_(first_expression_index) { } - - virtual Representation RequiredInputRepresentation(int index) { - return Representation::None(); - } - - virtual int OperandCount() { return values_.length(); } - virtual HValue* OperandAt(int index) const { return values_[index]; } - virtual void PrintDataTo(StringStream* stream); - - virtual int SuccessorCount() { return 0; } - virtual HBasicBlock* SuccessorAt(int i) { - UNREACHABLE(); - return NULL; - } - virtual void SetSuccessorAt(int i, HBasicBlock* block) { - UNREACHABLE(); - } - - void AddEnvironmentValue(HValue* value, Zone* zone) { - values_.Add(NULL, zone); - SetOperandAt(values_.length() - 1, value); - } - int first_local_index() { return first_local_index_; } - int first_expression_index() { return first_expression_index_; } - - DECLARE_CONCRETE_INSTRUCTION(Deoptimize) - - enum UseEnvironment { - kNoUses, - kUseAll - }; - - protected: - virtual void InternalSetOperandAt(int index, HValue* value) { - values_[index] = value; - } - - private: - ZoneList values_; - int first_local_index_; - int first_expression_index_; -}; - - class HGoto: public HTemplateControlInstruction<1, 0> { public: explicit HGoto(HBasicBlock* target) { @@ -1758,7 +1718,8 @@ class HChange: public HUnaryOperation { public: HChange(HValue* value, Representation to, - bool is_truncating, + bool is_truncating_to_smi, + bool is_truncating_to_int32, bool allow_undefined_as_nan) : HUnaryOperation(value) { ASSERT(!value->representation().IsNone()); @@ -1767,7 +1728,8 @@ class HChange: public HUnaryOperation { set_representation(to); SetFlag(kUseGVN); if (allow_undefined_as_nan) SetFlag(kAllowUndefinedAsNaN); - if (is_truncating) SetFlag(kTruncatingToInt32); + if (is_truncating_to_smi) SetFlag(kTruncatingToSmi); + if (is_truncating_to_int32) SetFlag(kTruncatingToInt32); if (value->representation().IsSmi() || value->type().IsSmi()) { set_type(HType::Smi()); } else { @@ -2668,6 +2630,7 @@ class HUnaryMathOperation: public HTemplateInstruction<2> { switch (op) { case kMathFloor: case kMathRound: + // TODO(verwaest): Set representation to flexible int starting as smi. set_representation(Representation::Integer32()); break; case kMathAbs: @@ -2732,12 +2695,7 @@ class HLoadExternalArrayPointer: public HUnaryOperation { class HCheckMaps: public HTemplateInstruction<2> { public: static HCheckMaps* New(HValue* value, Handle map, Zone* zone, - HValue *typecheck = NULL) { - HCheckMaps* check_map = new(zone) HCheckMaps(value, zone, typecheck); - check_map->map_set_.Add(map, zone); - return check_map; - } - + CompilationInfo* info, HValue *typecheck = NULL); static HCheckMaps* New(HValue* value, SmallMapList* maps, Zone* zone, HValue *typecheck = NULL) { HCheckMaps* check_map = new(zone) HCheckMaps(value, zone, typecheck); @@ -2749,27 +2707,9 @@ class HCheckMaps: public HTemplateInstruction<2> { } static HCheckMaps* NewWithTransitions(HValue* value, Handle map, - Zone* zone) { - HCheckMaps* check_map = new(zone) HCheckMaps(value, zone, value); - check_map->map_set_.Add(map, zone); - - // Since transitioned elements maps of the initial map don't fail the map - // check, the CheckMaps instruction doesn't need to depend on ElementsKinds. - check_map->ClearGVNFlag(kDependsOnElementsKind); - - ElementsKind kind = map->elements_kind(); - bool packed = IsFastPackedElementsKind(kind); - while (CanTransitionToMoreGeneralFastElementsKind(kind, packed)) { - kind = GetNextMoreGeneralFastElementsKind(kind, packed); - Map* transitioned_map = - map->LookupElementsTransitionMap(kind); - if (transitioned_map) { - check_map->map_set_.Add(Handle(transitioned_map), zone); - } - }; - check_map->map_set_.Sort(); - return check_map; - } + Zone* zone, CompilationInfo* info); + + bool CanOmitMapChecks() { return omit_; } virtual bool HasEscapingOperandAt(int index) { return false; } virtual Representation RequiredInputRepresentation(int index) { @@ -2806,7 +2746,7 @@ class HCheckMaps: public HTemplateInstruction<2> { private: // Clients should use one of the static New* methods above. HCheckMaps(HValue* value, Zone *zone, HValue* typecheck) - : map_unique_ids_(0, zone) { + : omit_(false), map_unique_ids_(0, zone) { SetOperandAt(0, value); // Use the object value for the dependency if NULL is passed. // TODO(titzer): do GVN flags already express this dependency? @@ -2818,6 +2758,16 @@ class HCheckMaps: public HTemplateInstruction<2> { SetGVNFlag(kDependsOnElementsKind); } + void omit(CompilationInfo* info) { + omit_ = true; + for (int i = 0; i < map_set_.length(); i++) { + Handle map = map_set_.at(i); + map->AddDependentCompilationInfo(DependentCode::kPrototypeCheckGroup, + info); + } + } + + bool omit_; SmallMapList map_set_; ZoneList map_unique_ids_; }; @@ -3074,12 +3024,234 @@ class HCheckPrototypeMaps: public HTemplateInstruction<0> { }; +class InductionVariableData; + + +struct InductionVariableLimitUpdate { + InductionVariableData* updated_variable; + HValue* limit; + bool limit_is_upper; + bool limit_is_included; + + InductionVariableLimitUpdate() + : updated_variable(NULL), limit(NULL), + limit_is_upper(false), limit_is_included(false) {} +}; + + +class HBoundsCheck; +class HPhi; +class HConstant; +class HBitwise; + + +class InductionVariableData : public ZoneObject { + public: + class InductionVariableCheck : public ZoneObject { + public: + HBoundsCheck* check() { return check_; } + InductionVariableCheck* next() { return next_; } + bool HasUpperLimit() { return upper_limit_ >= 0; } + int32_t upper_limit() { + ASSERT(HasUpperLimit()); + return upper_limit_; + } + void set_upper_limit(int32_t upper_limit) { + upper_limit_ = upper_limit; + } + + bool processed() { return processed_; } + void set_processed() { processed_ = true; } + + InductionVariableCheck(HBoundsCheck* check, + InductionVariableCheck* next, + int32_t upper_limit = kNoLimit) + : check_(check), next_(next), upper_limit_(upper_limit), + processed_(false) {} + + private: + HBoundsCheck* check_; + InductionVariableCheck* next_; + int32_t upper_limit_; + bool processed_; + }; + + class ChecksRelatedToLength : public ZoneObject { + public: + HValue* length() { return length_; } + ChecksRelatedToLength* next() { return next_; } + InductionVariableCheck* checks() { return checks_; } + + void AddCheck(HBoundsCheck* check, int32_t upper_limit = kNoLimit); + void CloseCurrentBlock(); + + ChecksRelatedToLength(HValue* length, ChecksRelatedToLength* next) + : length_(length), next_(next), checks_(NULL), + first_check_in_block_(NULL), + added_index_(NULL), + added_constant_(NULL), + current_and_mask_in_block_(0), + current_or_mask_in_block_(0) {} + + private: + void UseNewIndexInCurrentBlock(Token::Value token, + int32_t mask, + HValue* index_base, + HValue* context); + + HBoundsCheck* first_check_in_block() { return first_check_in_block_; } + HBitwise* added_index() { return added_index_; } + void set_added_index(HBitwise* index) { added_index_ = index; } + HConstant* added_constant() { return added_constant_; } + void set_added_constant(HConstant* constant) { added_constant_ = constant; } + int32_t current_and_mask_in_block() { return current_and_mask_in_block_; } + int32_t current_or_mask_in_block() { return current_or_mask_in_block_; } + int32_t current_upper_limit() { return current_upper_limit_; } + + HValue* length_; + ChecksRelatedToLength* next_; + InductionVariableCheck* checks_; + + HBoundsCheck* first_check_in_block_; + HBitwise* added_index_; + HConstant* added_constant_; + int32_t current_and_mask_in_block_; + int32_t current_or_mask_in_block_; + int32_t current_upper_limit_; + }; + + struct LimitFromPredecessorBlock { + InductionVariableData* variable; + Token::Value token; + HValue* limit; + HBasicBlock* other_target; + + bool LimitIsValid() { return token != Token::ILLEGAL; } + + bool LimitIsIncluded() { + return Token::IsEqualityOp(token) || + token == Token::GTE || token == Token::LTE; + } + bool LimitIsUpper() { + return token == Token::LTE || token == Token::LT || token == Token::NE; + } + + LimitFromPredecessorBlock() + : variable(NULL), + token(Token::ILLEGAL), + limit(NULL), + other_target(NULL) {} + }; + + static const int32_t kNoLimit = -1; + + static InductionVariableData* ExaminePhi(HPhi* phi); + static void ComputeLimitFromPredecessorBlock( + HBasicBlock* block, + LimitFromPredecessorBlock* result); + static bool ComputeInductionVariableLimit( + HBasicBlock* block, + InductionVariableLimitUpdate* additional_limit); + + struct BitwiseDecompositionResult { + HValue* base; + int32_t and_mask; + int32_t or_mask; + HValue* context; + + BitwiseDecompositionResult() + : base(NULL), and_mask(0), or_mask(0), context(NULL) {} + }; + static void DecomposeBitwise(HValue* value, + BitwiseDecompositionResult* result); + + void AddCheck(HBoundsCheck* check, int32_t upper_limit = kNoLimit); + + bool CheckIfBranchIsLoopGuard(Token::Value token, + HBasicBlock* current_branch, + HBasicBlock* other_branch); + + void UpdateAdditionalLimit(InductionVariableLimitUpdate* update); + + HPhi* phi() { return phi_; } + HValue* base() { return base_; } + int32_t increment() { return increment_; } + HValue* limit() { return limit_; } + bool limit_included() { return limit_included_; } + HBasicBlock* limit_validity() { return limit_validity_; } + HBasicBlock* induction_exit_block() { return induction_exit_block_; } + HBasicBlock* induction_exit_target() { return induction_exit_target_; } + ChecksRelatedToLength* checks() { return checks_; } + HValue* additional_upper_limit() { return additional_upper_limit_; } + bool additional_upper_limit_is_included() { + return additional_upper_limit_is_included_; + } + HValue* additional_lower_limit() { return additional_lower_limit_; } + bool additional_lower_limit_is_included() { + return additional_lower_limit_is_included_; + } + + bool LowerLimitIsNonNegativeConstant() { + if (base()->IsInteger32Constant() && base()->GetInteger32Constant() >= 0) { + return true; + } + if (additional_lower_limit() != NULL && + additional_lower_limit()->IsInteger32Constant() && + additional_lower_limit()->GetInteger32Constant() >= 0) { + // Ignoring the corner case of !additional_lower_limit_is_included() + // is safe, handling it adds unneeded complexity. + return true; + } + return false; + } + + int32_t ComputeUpperLimit(int32_t and_mask, int32_t or_mask); + + private: + template void swap(T* a, T* b) { + T c(*a); + *a = *b; + *b = c; + } + + InductionVariableData(HPhi* phi, HValue* base, int32_t increment) + : phi_(phi), base_(IgnoreOsrValue(base)), increment_(increment), + limit_(NULL), limit_included_(false), limit_validity_(NULL), + induction_exit_block_(NULL), induction_exit_target_(NULL), + checks_(NULL), + additional_upper_limit_(NULL), + additional_upper_limit_is_included_(false), + additional_lower_limit_(NULL), + additional_lower_limit_is_included_(false) {} + + static int32_t ComputeIncrement(HPhi* phi, HValue* phi_operand); + + static HValue* IgnoreOsrValue(HValue* v); + static InductionVariableData* GetInductionVariableData(HValue* v); + + HPhi* phi_; + HValue* base_; + int32_t increment_; + HValue* limit_; + bool limit_included_; + HBasicBlock* limit_validity_; + HBasicBlock* induction_exit_block_; + HBasicBlock* induction_exit_target_; + ChecksRelatedToLength* checks_; + HValue* additional_upper_limit_; + bool additional_upper_limit_is_included_; + HValue* additional_lower_limit_; + bool additional_lower_limit_is_included_; +}; + + class HPhi: public HValue { public: HPhi(int merged_index, Zone* zone) : inputs_(2, zone), merged_index_(merged_index), - phi_id_(-1) { + phi_id_(-1), + induction_variable_data_(NULL) { for (int i = 0; i < Representation::kNumRepresentations; i++) { non_phi_uses_[i] = 0; indirect_uses_[i] = 0; @@ -3110,6 +3282,21 @@ class HPhi: public HValue { int merged_index() const { return merged_index_; } + InductionVariableData* induction_variable_data() { + return induction_variable_data_; + } + bool IsInductionVariable() { + return induction_variable_data_ != NULL; + } + bool IsLimitedInductionVariable() { + return IsInductionVariable() && + induction_variable_data_->limit() != NULL; + } + void DetectInductionVariable() { + ASSERT(induction_variable_data_ == NULL); + induction_variable_data_ = InductionVariableData::ExaminePhi(this); + } + virtual void AddInformativeDefinitions(); virtual void PrintTo(StringStream* stream); @@ -3177,6 +3364,7 @@ class HPhi: public HValue { int non_phi_uses_[Representation::kNumRepresentations]; int indirect_uses_[Representation::kNumRepresentations]; int phi_id_; + InductionVariableData* induction_variable_data_; }; @@ -3296,6 +3484,11 @@ class HConstant: public HTemplateInstruction<0> { return handle_; } + bool InstanceOf(Handle map) { + return handle_->IsJSObject() && + Handle::cast(handle_)->map() == *map; + } + bool IsSpecialDouble() const { return has_double_value_ && (BitCast(double_value_) == BitCast(-0.0) || @@ -3339,7 +3532,7 @@ class HConstant: public HTemplateInstruction<0> { } virtual Representation KnownOptimalRepresentation() { - if (HasSmiValue()) return Representation::Smi(); + if (HasSmiValue() && kSmiValueSize == 31) return Representation::Smi(); if (HasInteger32Value()) return Representation::Integer32(); if (HasNumberValue()) return Representation::Double(); return Representation::Tagged(); @@ -3350,7 +3543,8 @@ class HConstant: public HTemplateInstruction<0> { virtual HType CalculateInferredType(); bool IsInteger() { return handle()->IsSmi(); } HConstant* CopyToRepresentation(Representation r, Zone* zone) const; - HConstant* CopyToTruncatedInt32(Zone* zone) const; + Maybe CopyToTruncatedInt32(Zone* zone); + Maybe CopyToTruncatedNumber(Zone* zone); bool HasInteger32Value() const { return has_int32_value_; } int32_t Integer32Value() const { ASSERT(HasInteger32Value()); @@ -3500,7 +3694,7 @@ class HBinaryOperation: public HTemplateInstruction<3> { // Otherwise, if there is only one use of the right operand, it would be // better off on the left for platforms that only have 2-arg arithmetic // ops (e.g ia32, x64) that clobber the left operand. - return (right()->UseCount() == 1); + return right()->UseCount() == 1; } HValue* BetterLeftOperand() { @@ -3525,24 +3719,28 @@ class HBinaryOperation: public HTemplateInstruction<3> { return observed_input_representation_[index - 1]; } - virtual void InferRepresentation(HInferRepresentationPhase* h_infer); - virtual Representation RepresentationFromInputs(); - virtual void AssumeRepresentation(Representation r); - virtual void UpdateRepresentation(Representation new_rep, HInferRepresentationPhase* h_infer, const char* reason) { - // By default, binary operations don't handle Smis. - if (new_rep.IsSmi()) { - new_rep = Representation::Integer32(); - } - HValue::UpdateRepresentation(new_rep, h_infer, reason); + Representation rep = !FLAG_smi_binop && new_rep.IsSmi() + ? Representation::Integer32() : new_rep; + HValue::UpdateRepresentation(rep, h_infer, reason); } + virtual void InferRepresentation(HInferRepresentationPhase* h_infer); + virtual Representation RepresentationFromInputs(); + Representation RepresentationFromOutput(); + virtual void AssumeRepresentation(Representation r); + virtual bool IsCommutative() const { return false; } virtual void PrintDataTo(StringStream* stream); + virtual Representation RequiredInputRepresentation(int index) { + if (index == 0) return Representation::Tagged(); + return representation(); + } + DECLARE_ABSTRACT_INSTRUCTION(BinaryOperation) private: @@ -3695,15 +3893,16 @@ class HBoundsCheck: public HTemplateInstruction<2> { HBoundsCheck(HValue* index, HValue* length) : skip_check_(false), base_(NULL), offset_(0), scale_(0), - responsibility_direction_(DIRECTION_NONE) { + responsibility_direction_(DIRECTION_NONE), + allow_equality_(false) { SetOperandAt(0, index); SetOperandAt(1, length); SetFlag(kFlexibleRepresentation); SetFlag(kUseGVN); } - bool skip_check() { return skip_check_; } - void set_skip_check(bool skip_check) { skip_check_ = skip_check; } + bool skip_check() const { return skip_check_; } + void set_skip_check() { skip_check_ = true; } HValue* base() { return base_; } int offset() { return offset_; } int scale() { return scale_; } @@ -3735,6 +3934,9 @@ class HBoundsCheck: public HTemplateInstruction<2> { virtual Representation RequiredInputRepresentation(int arg_index) { return representation(); } + virtual bool IsDeletable() const { + return skip_check() && !FLAG_debug_code; + } virtual bool IsRelationTrueInternal(NumericRelation relation, HValue* related_value, @@ -3746,6 +3948,8 @@ class HBoundsCheck: public HTemplateInstruction<2> { HValue* index() { return OperandAt(0); } HValue* length() { return OperandAt(1); } + bool allow_equality() { return allow_equality_; } + void set_allow_equality(bool v) { allow_equality_ = v; } virtual int RedefinedOperandIndex() { return 0; } virtual bool IsPurelyInformativeDefinition() { return skip_check(); } @@ -3768,6 +3972,7 @@ class HBoundsCheck: public HTemplateInstruction<2> { int offset_; int scale_; RangeGuaranteeDirection responsibility_direction_; + bool allow_equality_; }; @@ -3821,15 +4026,9 @@ class HBitwiseBinaryOperation: public HBinaryOperation { SetAllSideEffects(); } - virtual Representation RequiredInputRepresentation(int index) { - return index == 0 - ? Representation::Tagged() - : representation(); - } - virtual void RepresentationChanged(Representation to) { if (!to.IsTagged()) { - ASSERT(to.IsInteger32()); + ASSERT(to.IsSmiOrInteger32()); ClearAllSideEffects(); SetFlag(kUseGVN); } else { @@ -3842,10 +4041,14 @@ class HBitwiseBinaryOperation: public HBinaryOperation { HInferRepresentationPhase* h_infer, const char* reason) { // We only generate either int32 or generic tagged bitwise operations. - if (new_rep.IsSmi() || new_rep.IsDouble()) { - new_rep = Representation::Integer32(); - } - HValue::UpdateRepresentation(new_rep, h_infer, reason); + if (new_rep.IsDouble()) new_rep = Representation::Integer32(); + HBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); + } + + virtual Representation observed_input_representation(int index) { + Representation r = HBinaryOperation::observed_input_representation(index); + if (r.IsDouble()) return Representation::Integer32(); + return r; } virtual void initialize_output_representation(Representation observed) { @@ -3911,11 +4114,6 @@ class HArithmeticBinaryOperation: public HBinaryOperation { } virtual HType CalculateInferredType(); - virtual Representation RequiredInputRepresentation(int index) { - return index == 0 - ? Representation::Tagged() - : representation(); - } DECLARE_ABSTRACT_INSTRUCTION(ArithmeticBinaryOperation) @@ -4018,29 +4216,6 @@ class HCompareObjectEqAndBranch: public HTemplateControlInstruction<2, 2> { }; -class HCompareConstantEqAndBranch: public HUnaryControlInstruction { - public: - HCompareConstantEqAndBranch(HValue* left, int right, Token::Value op) - : HUnaryControlInstruction(left, NULL, NULL), op_(op), right_(right) { - ASSERT(op == Token::EQ_STRICT); - } - - Token::Value op() const { return op_; } - HValue* left() { return value(); } - int right() const { return right_; } - - virtual Representation RequiredInputRepresentation(int index) { - return Representation::Integer32(); - } - - DECLARE_CONCRETE_INSTRUCTION(CompareConstantEqAndBranch); - - private: - const Token::Value op_; - const int right_; -}; - - class HIsObjectAndBranch: public HUnaryControlInstruction { public: explicit HIsObjectAndBranch(HValue* value) @@ -4475,6 +4650,13 @@ class HMul: public HArithmeticBinaryOperation { return !representation().IsTagged(); } + virtual void UpdateRepresentation(Representation new_rep, + HInferRepresentationPhase* h_infer, + const char* reason) { + if (new_rep.IsSmi()) new_rep = Representation::Integer32(); + HArithmeticBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); + } + DECLARE_CONCRETE_INSTRUCTION(Mul) protected: @@ -4514,6 +4696,13 @@ class HMod: public HArithmeticBinaryOperation { virtual HValue* Canonicalize(); + virtual void UpdateRepresentation(Representation new_rep, + HInferRepresentationPhase* h_infer, + const char* reason) { + if (new_rep.IsSmi()) new_rep = Representation::Integer32(); + HArithmeticBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); + } + DECLARE_CONCRETE_INSTRUCTION(Mod) protected: @@ -4556,6 +4745,13 @@ class HDiv: public HArithmeticBinaryOperation { virtual HValue* Canonicalize(); + virtual void UpdateRepresentation(Representation new_rep, + HInferRepresentationPhase* h_infer, + const char* reason) { + if (new_rep.IsSmi()) new_rep = Representation::Integer32(); + HArithmeticBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); + } + DECLARE_CONCRETE_INSTRUCTION(Div) protected: @@ -4596,11 +4792,12 @@ class HMathMinMax: public HArithmeticBinaryOperation { virtual Representation RepresentationFromInputs() { Representation left_rep = left()->representation(); Representation right_rep = right()->representation(); - if ((left_rep.IsNone() || left_rep.IsInteger32()) && - (right_rep.IsNone() || right_rep.IsInteger32())) { - return Representation::Integer32(); - } - return Representation::Double(); + // TODO(verwaest): Initialize to Smi once lithium-codegen has been fixed. + Representation result = Representation::Integer32(); + result = result.generalize(left_rep); + result = result.generalize(right_rep); + if (result.IsTagged()) return Representation::Double(); + return result; } virtual bool IsCommutative() const { return true; } @@ -4655,6 +4852,27 @@ class HBitwise: public HBitwiseBinaryOperation { HBitwise(Token::Value op, HValue* context, HValue* left, HValue* right) : HBitwiseBinaryOperation(context, left, right), op_(op) { ASSERT(op == Token::BIT_AND || op == Token::BIT_OR || op == Token::BIT_XOR); + // BIT_AND with a smi-range positive value will always unset the + // entire sign-extension of the smi-sign. + if (op == Token::BIT_AND && + ((left->IsConstant() && + left->representation().IsSmi() && + HConstant::cast(left)->Integer32Value() >= 0) || + (right->IsConstant() && + right->representation().IsSmi() && + HConstant::cast(right)->Integer32Value() >= 0))) { + SetFlag(kTruncatingToSmi); + // BIT_OR with a smi-range negative value will always set the entire + // sign-extension of the smi-sign. + } else if (op == Token::BIT_OR && + ((left->IsConstant() && + left->representation().IsSmi() && + HConstant::cast(left)->Integer32Value() < 0) || + (right->IsConstant() && + right->representation().IsSmi() && + HConstant::cast(right)->Integer32Value() < 0))) { + SetFlag(kTruncatingToSmi); + } } Token::Value op_; @@ -4670,6 +4888,13 @@ class HShl: public HBitwiseBinaryOperation { virtual Range* InferRange(Zone* zone); + virtual void UpdateRepresentation(Representation new_rep, + HInferRepresentationPhase* h_infer, + const char* reason) { + if (new_rep.IsSmi()) new_rep = Representation::Integer32(); + HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); + } + DECLARE_CONCRETE_INSTRUCTION(Shl) protected: @@ -4702,6 +4927,13 @@ class HShr: public HBitwiseBinaryOperation { virtual Range* InferRange(Zone* zone); + virtual void UpdateRepresentation(Representation new_rep, + HInferRepresentationPhase* h_infer, + const char* reason) { + if (new_rep.IsSmi()) new_rep = Representation::Integer32(); + HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); + } + DECLARE_CONCRETE_INSTRUCTION(Shr) protected: @@ -4734,6 +4966,13 @@ class HSar: public HBitwiseBinaryOperation { virtual Range* InferRange(Zone* zone); + virtual void UpdateRepresentation(Representation new_rep, + HInferRepresentationPhase* h_infer, + const char* reason) { + if (new_rep.IsSmi()) new_rep = Representation::Integer32(); + HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); + } + DECLARE_CONCRETE_INSTRUCTION(Sar) protected: @@ -4752,6 +4991,13 @@ class HRor: public HBitwiseBinaryOperation { ChangeRepresentation(Representation::Integer32()); } + virtual void UpdateRepresentation(Representation new_rep, + HInferRepresentationPhase* h_infer, + const char* reason) { + if (new_rep.IsSmi()) new_rep = Representation::Integer32(); + HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); + } + DECLARE_CONCRETE_INSTRUCTION(Ror) protected: @@ -4964,14 +5210,15 @@ class HAllocate: public HTemplateInstruction<2> { CAN_ALLOCATE_IN_NEW_SPACE = 1 << 0, CAN_ALLOCATE_IN_OLD_DATA_SPACE = 1 << 1, CAN_ALLOCATE_IN_OLD_POINTER_SPACE = 1 << 2, - ALLOCATE_DOUBLE_ALIGNED = 1 << 3 + ALLOCATE_DOUBLE_ALIGNED = 1 << 3, + PREFILL_WITH_FILLER = 1 << 4 }; HAllocate(HValue* context, HValue* size, HType type, Flags flags) - : type_(type), - flags_(flags) { + : flags_(flags) { SetOperandAt(0, context); SetOperandAt(1, size); + set_type(type); set_representation(Representation::Tagged()); SetFlag(kTrackSideEffectDominators); SetGVNFlag(kChangesNewSpacePromotion); @@ -4996,7 +5243,6 @@ class HAllocate: public HTemplateInstruction<2> { HValue* context() { return OperandAt(0); } HValue* size() { return OperandAt(1); } - HType type() { return type_; } virtual Representation RequiredInputRepresentation(int index) { if (index == 0) { @@ -5014,8 +5260,6 @@ class HAllocate: public HTemplateInstruction<2> { known_initial_map_ = known_initial_map; } - virtual HType CalculateInferredType(); - bool CanAllocateInNewSpace() const { return (flags_ & CAN_ALLOCATE_IN_NEW_SPACE) != 0; } @@ -5041,6 +5285,14 @@ class HAllocate: public HTemplateInstruction<2> { return (flags_ & ALLOCATE_DOUBLE_ALIGNED) != 0; } + bool MustPrefillWithFiller() const { + return (flags_ & PREFILL_WITH_FILLER) != 0; + } + + void SetFlags(Flags flags) { + flags_ = static_cast(flags_ | flags); + } + void UpdateSize(HValue* size) { SetOperandAt(1, size); } @@ -5053,7 +5305,6 @@ class HAllocate: public HTemplateInstruction<2> { DECLARE_CONCRETE_INSTRUCTION(Allocate) private: - HType type_; Flags flags_; Handle known_initial_map_; }; @@ -5062,10 +5313,10 @@ class HAllocate: public HTemplateInstruction<2> { class HInnerAllocatedObject: public HTemplateInstruction<1> { public: HInnerAllocatedObject(HValue* value, int offset, HType type = HType::Tagged()) - : offset_(offset), - type_(type) { + : offset_(offset) { ASSERT(value->IsAllocate()); SetOperandAt(0, value); + set_type(type); set_representation(Representation::Tagged()); } @@ -5076,15 +5327,12 @@ class HInnerAllocatedObject: public HTemplateInstruction<1> { return Representation::Tagged(); } - virtual HType CalculateInferredType() { return type_; } - virtual void PrintDataTo(StringStream* stream); DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject) private: int offset_; - HType type_; }; @@ -5313,20 +5561,32 @@ class HObjectAccess { return OffsetField::decode(value_); } + inline Representation representation() const { + return Representation::FromKind(RepresentationField::decode(value_)); + } + inline Handle name() const { return name_; } + inline HObjectAccess WithRepresentation(Representation representation) { + return HObjectAccess(portion(), offset(), representation, name()); + } + static HObjectAccess ForHeapNumberValue() { - return HObjectAccess(kDouble, HeapNumber::kValueOffset); + return HObjectAccess( + kDouble, HeapNumber::kValueOffset, Representation::Double()); } static HObjectAccess ForElementsPointer() { return HObjectAccess(kElementsPointer, JSObject::kElementsOffset); } - static HObjectAccess ForArrayLength() { - return HObjectAccess(kArrayLengths, JSArray::kLengthOffset); + static HObjectAccess ForArrayLength(ElementsKind elements_kind) { + return HObjectAccess( + kArrayLengths, JSArray::kLengthOffset, + IsFastElementsKind(elements_kind) && FLAG_track_fields ? + Representation::Smi() : Representation::Tagged()); } static HObjectAccess ForAllocationSiteTransitionInfo() { @@ -5338,7 +5598,10 @@ class HObjectAccess { } static HObjectAccess ForFixedArrayLength() { - return HObjectAccess(kArrayLengths, FixedArray::kLengthOffset); + return HObjectAccess( + kArrayLengths, FixedArray::kLengthOffset, + FLAG_track_fields ? + Representation::Smi() : Representation::Tagged()); } static HObjectAccess ForPropertiesPointer() { @@ -5369,13 +5632,15 @@ class HObjectAccess { static HObjectAccess ForFixedArrayHeader(int offset); // Create an access to an in-object property in a JSObject. - static HObjectAccess ForJSObjectOffset(int offset); + static HObjectAccess ForJSObjectOffset(int offset, + Representation representation = Representation::Tagged()); // Create an access to an in-object property in a JSArray. static HObjectAccess ForJSArrayOffset(int offset); // Create an access to the backing store of an object. - static HObjectAccess ForBackingStoreOffset(int offset); + static HObjectAccess ForBackingStoreOffset(int offset, + Representation representation = Representation::Tagged()); // Create an access to a resolved field (in-object or backing store). static HObjectAccess ForField(Handle map, @@ -5405,17 +5670,23 @@ class HObjectAccess { }; HObjectAccess(Portion portion, int offset, - Handle name = Handle::null()) - : value_(PortionField::encode(portion) | OffsetField::encode(offset)), + Representation representation = Representation::Tagged(), + Handle name = Handle::null()) + : value_(PortionField::encode(portion) | + RepresentationField::encode(representation.kind()) | + OffsetField::encode(offset)), name_(name) { - ASSERT(this->offset() == offset); // offset should decode correctly - ASSERT(this->portion() == portion); // portion should decode correctly + // assert that the fields decode correctly + ASSERT(this->offset() == offset); + ASSERT(this->portion() == portion); + ASSERT(RepresentationField::decode(value_) == representation.kind()); } class PortionField : public BitField {}; - class OffsetField : public BitField {}; + class RepresentationField : public BitField {}; + class OffsetField : public BitField {}; - uint32_t value_; // encodes both portion and offset + uint32_t value_; // encodes portion, representation, and offset Handle name_; friend class HLoadNamedField; @@ -5463,22 +5734,20 @@ class HLoadNamedField: public HTemplateInstruction<2> { public: HLoadNamedField(HValue* object, HObjectAccess access, - HValue* typecheck = NULL, - Representation field_representation - = Representation::Tagged()) - : access_(access), - field_representation_(field_representation) { + HValue* typecheck = NULL) + : access_(access) { ASSERT(object != NULL); SetOperandAt(0, object); SetOperandAt(1, typecheck != NULL ? typecheck : object); - if (FLAG_track_fields && field_representation.IsSmi()) { + Representation representation = access.representation(); + if (representation.IsSmi()) { set_type(HType::Smi()); - set_representation(field_representation); - } else if (FLAG_track_double_fields && field_representation.IsDouble()) { - set_representation(field_representation); + set_representation(representation); + } else if (representation.IsDouble()) { + set_representation(representation); } else if (FLAG_track_heap_object_fields && - field_representation.IsHeapObject()) { + representation.IsHeapObject()) { set_type(HType::NonPrimitive()); set_representation(Representation::Tagged()); } else { @@ -5495,7 +5764,9 @@ class HLoadNamedField: public HTemplateInstruction<2> { bool HasTypeCheck() const { return OperandAt(0) != OperandAt(1); } HObjectAccess access() const { return access_; } - Representation field_representation() const { return representation_; } + Representation field_representation() const { + return access_.representation(); + } virtual bool HasEscapingOperandAt(int index) { return false; } virtual Representation RequiredInputRepresentation(int index) { @@ -5515,7 +5786,6 @@ class HLoadNamedField: public HTemplateInstruction<2> { virtual bool IsDeletable() const { return true; } HObjectAccess access_; - Representation field_representation_; }; @@ -5616,8 +5886,8 @@ class ArrayInstructionInterface { virtual ~ArrayInstructionInterface() { }; static Representation KeyedAccessIndexRequirement(Representation r) { - return r.IsInteger32() ? Representation::Integer32() - : Representation::Smi(); + return r.IsInteger32() || kSmiValueSize != 31 + ? Representation::Integer32() : Representation::Smi(); } }; @@ -5815,11 +6085,8 @@ class HStoreNamedField: public HTemplateInstruction<2> { public: HStoreNamedField(HValue* obj, HObjectAccess access, - HValue* val, - Representation field_representation - = Representation::Tagged()) + HValue* val) : access_(access), - field_representation_(field_representation), transition_(), transition_unique_id_(), new_space_dominator_(NULL), @@ -5833,12 +6100,10 @@ class HStoreNamedField: public HTemplateInstruction<2> { virtual bool HasEscapingOperandAt(int index) { return index == 1; } virtual Representation RequiredInputRepresentation(int index) { - if (FLAG_track_double_fields && - index == 1 && field_representation_.IsDouble()) { - return field_representation_; - } else if (FLAG_track_fields && - index == 1 && field_representation_.IsSmi()) { - return field_representation_; + if (index == 1 && field_representation().IsDouble()) { + return field_representation(); + } else if (index == 1 && field_representation().IsSmi()) { + return field_representation(); } return Representation::Tagged(); } @@ -5870,13 +6135,12 @@ class HStoreNamedField: public HTemplateInstruction<2> { HValue* new_space_dominator() const { return new_space_dominator_; } bool NeedsWriteBarrier() { - ASSERT(!(FLAG_track_double_fields && field_representation_.IsDouble()) || + ASSERT(!(FLAG_track_double_fields && field_representation().IsDouble()) || transition_.is_null()); if (IsSkipWriteBarrier()) return false; - return (!FLAG_track_fields || !field_representation_.IsSmi()) && - // If there is a transition, a new storage object needs to be allocated. - !(FLAG_track_double_fields && field_representation_.IsDouble()) && - StoringValueNeedsWriteBarrier(value()) && + if (field_representation().IsDouble()) return false; + if (field_representation().IsSmi()) return false; + return StoringValueNeedsWriteBarrier(value()) && ReceiverObjectNeedsWriteBarrier(object(), new_space_dominator()); } @@ -5890,12 +6154,11 @@ class HStoreNamedField: public HTemplateInstruction<2> { } Representation field_representation() const { - return field_representation_; + return access_.representation(); } private: HObjectAccess access_; - Representation field_representation_; Handle transition_; UniqueValueId transition_unique_id_; HValue* new_space_dominator_; diff --git a/deps/v8/src/hydrogen-minus-zero.cc b/deps/v8/src/hydrogen-minus-zero.cc index e962895..28ae6eb 100644 --- a/deps/v8/src/hydrogen-minus-zero.cc +++ b/deps/v8/src/hydrogen-minus-zero.cc @@ -41,10 +41,10 @@ void HComputeMinusZeroChecksPhase::Run() { // int32-to-tagged and int32-to-double. Representation from = change->value()->representation(); ASSERT(from.Equals(change->from())); - if (from.IsInteger32()) { + if (from.IsSmiOrInteger32()) { ASSERT(change->to().IsTagged() || change->to().IsDouble() || - change->to().IsSmi()); + change->to().IsSmiOrInteger32()); ASSERT(visited_.IsEmpty()); PropagateMinusZeroChecks(change->value()); visited_.Clear(); diff --git a/deps/v8/src/hydrogen-osr.cc b/deps/v8/src/hydrogen-osr.cc index a2fa0bf..6c3d6ae 100644 --- a/deps/v8/src/hydrogen-osr.cc +++ b/deps/v8/src/hydrogen-osr.cc @@ -94,7 +94,7 @@ HBasicBlock* HOsrBuilder::BuildPossibleOsrLoopEntry( } } - builder_->AddSimulate(osr_entry_id); + builder_->Add(osr_entry_id); builder_->Add(osr_entry_id); HContext* context = builder_->Add(); environment->BindContext(context); diff --git a/deps/v8/src/hydrogen-representation-changes.cc b/deps/v8/src/hydrogen-representation-changes.cc index e8f0140..63b7b4d 100644 --- a/deps/v8/src/hydrogen-representation-changes.cc +++ b/deps/v8/src/hydrogen-representation-changes.cc @@ -45,20 +45,25 @@ void HRepresentationChangesPhase::InsertRepresentationChangeForUse( // information we treat constants like normal instructions and insert the // change instructions for them. HInstruction* new_value = NULL; - bool is_truncating = use_value->CheckFlag(HValue::kTruncatingToInt32); + bool is_truncating_to_smi = use_value->CheckFlag(HValue::kTruncatingToSmi); + bool is_truncating_to_int = use_value->CheckFlag(HValue::kTruncatingToInt32); bool allow_undefined_as_nan = use_value->CheckFlag(HValue::kAllowUndefinedAsNaN); if (value->IsConstant()) { HConstant* constant = HConstant::cast(value); // Try to create a new copy of the constant with the new representation. - new_value = (is_truncating && to.IsInteger32()) - ? constant->CopyToTruncatedInt32(graph()->zone()) - : constant->CopyToRepresentation(to, graph()->zone()); + if (is_truncating_to_int && to.IsInteger32()) { + Maybe res = constant->CopyToTruncatedInt32(graph()->zone()); + if (res.has_value) new_value = res.value; + } else { + new_value = constant->CopyToRepresentation(to, graph()->zone()); + } } if (new_value == NULL) { new_value = new(graph()->zone()) HChange(value, to, - is_truncating, + is_truncating_to_smi, + is_truncating_to_int, allow_undefined_as_nan); } @@ -105,6 +110,8 @@ void HRepresentationChangesPhase::Run() { HPhi* phi = phi_list->at(i); if (phi->representation().IsInteger32()) { phi->SetFlag(HValue::kTruncatingToInt32); + } else if (phi->representation().IsSmi()) { + phi->SetFlag(HValue::kTruncatingToSmi); } } @@ -116,13 +123,18 @@ void HRepresentationChangesPhase::Run() { HValue* use = it.value(); Representation input_representation = use->RequiredInputRepresentation(it.index()); - if (!input_representation.IsInteger32() || - !use->CheckFlag(HValue::kTruncatingToInt32)) { + if ((phi->representation().IsInteger32() && + !(input_representation.IsInteger32() && + use->CheckFlag(HValue::kTruncatingToInt32))) || + (phi->representation().IsSmi() && + !(input_representation.IsSmi() || + use->CheckFlag(HValue::kTruncatingToSmi)))) { if (FLAG_trace_representation) { PrintF("#%d Phi is not truncating because of #%d %s\n", phi->id(), it.value()->id(), it.value()->Mnemonic()); } phi->ClearFlag(HValue::kTruncatingToInt32); + phi->ClearFlag(HValue::kTruncatingToSmi); worklist.Add(phi, zone()); break; } @@ -134,13 +146,16 @@ void HRepresentationChangesPhase::Run() { for (int i = 0; i < current->OperandCount(); ++i) { HValue* input = current->OperandAt(i); if (input->IsPhi() && - input->representation().IsInteger32() && - input->CheckFlag(HValue::kTruncatingToInt32)) { + ((input->representation().IsInteger32() && + input->CheckFlag(HValue::kTruncatingToInt32)) || + (input->representation().IsSmi() && + input->CheckFlag(HValue::kTruncatingToSmi)))) { if (FLAG_trace_representation) { PrintF("#%d Phi is not truncating because of #%d %s\n", input->id(), current->id(), current->Mnemonic()); } input->ClearFlag(HValue::kTruncatingToInt32); + input->ClearFlag(HValue::kTruncatingToSmi); worklist.Add(HPhi::cast(input), zone()); } } diff --git a/deps/v8/src/hydrogen.cc b/deps/v8/src/hydrogen.cc index 57220e0..e346880 100644 --- a/deps/v8/src/hydrogen.cc +++ b/deps/v8/src/hydrogen.cc @@ -34,6 +34,7 @@ #include "full-codegen.h" #include "hashmap.h" #include "hydrogen-bce.h" +#include "hydrogen-bch.h" #include "hydrogen-canonicalize.h" #include "hydrogen-dce.h" #include "hydrogen-dehoist.h" @@ -146,26 +147,6 @@ void HBasicBlock::AddInstruction(HInstruction* instr) { } -HDeoptimize* HBasicBlock::CreateDeoptimize( - HDeoptimize::UseEnvironment has_uses) { - ASSERT(HasEnvironment()); - if (has_uses == HDeoptimize::kNoUses) - return new(zone()) HDeoptimize(0, 0, 0, zone()); - - HEnvironment* environment = last_environment(); - int first_local_index = environment->first_local_index(); - int first_expression_index = environment->first_expression_index(); - HDeoptimize* instr = new(zone()) HDeoptimize( - environment->length(), first_local_index, first_expression_index, zone()); - for (int i = 0; i < environment->length(); i++) { - HValue* val = environment->values()->at(i); - instr->AddEnvironmentValue(val, zone()); - } - - return instr; -} - - HSimulate* HBasicBlock::CreateSimulate(BailoutId ast_id, RemovableSimulate removable) { ASSERT(HasEnvironment()); @@ -700,13 +681,16 @@ HGraphBuilder::IfBuilder::IfBuilder(HGraphBuilder* builder, int position) : builder_(builder), position_(position), finished_(false), + deopt_then_(false), + deopt_else_(false), did_then_(false), did_else_(false), did_and_(false), did_or_(false), captured_(false), needs_compare_(true), - split_edge_merge_block_(NULL) { + split_edge_merge_block_(NULL), + merge_block_(NULL) { HEnvironment* env = builder->environment(); first_true_block_ = builder->CreateBasicBlock(env->Copy()); last_true_block_ = NULL; @@ -720,6 +704,8 @@ HGraphBuilder::IfBuilder::IfBuilder( : builder_(builder), position_(RelocInfo::kNoPosition), finished_(false), + deopt_then_(false), + deopt_else_(false), did_then_(false), did_else_(false), did_and_(false), @@ -836,14 +822,13 @@ void HGraphBuilder::IfBuilder::Else() { void HGraphBuilder::IfBuilder::Deopt() { - HBasicBlock* block = builder_->current_block(); - block->FinishExitWithDeoptimization(HDeoptimize::kUseAll); - builder_->set_current_block(NULL); + ASSERT(did_then_); if (did_else_) { - first_false_block_ = NULL; + deopt_else_ = true; } else { - first_true_block_ = NULL; + deopt_then_ = true; } + builder_->Add(Deoptimizer::EAGER); } @@ -868,20 +853,30 @@ void HGraphBuilder::IfBuilder::End() { last_true_block_ = builder_->current_block(); } if (first_true_block_ == NULL) { - // Deopt on true. Nothing to do, just continue the false block. + // Return on true. Nothing to do, just continue the false block. } else if (first_false_block_ == NULL) { // Deopt on false. Nothing to do except switching to the true block. builder_->set_current_block(last_true_block_); } else { - HEnvironment* merge_env = last_true_block_->last_environment()->Copy(); - merge_block_ = builder_->CreateBasicBlock(merge_env); + merge_block_ = builder_->graph()->CreateBasicBlock(); ASSERT(!finished_); if (!did_else_) Else(); ASSERT(!last_true_block_->IsFinished()); HBasicBlock* last_false_block = builder_->current_block(); ASSERT(!last_false_block->IsFinished()); - last_true_block_->GotoNoSimulate(merge_block_); - last_false_block->GotoNoSimulate(merge_block_); + if (deopt_then_) { + last_false_block->GotoNoSimulate(merge_block_); + builder_->PadEnvironmentForContinuation(last_true_block_, + merge_block_); + last_true_block_->GotoNoSimulate(merge_block_); + } else { + last_true_block_->GotoNoSimulate(merge_block_); + if (deopt_else_) { + builder_->PadEnvironmentForContinuation(last_false_block, + merge_block_); + } + last_false_block->GotoNoSimulate(merge_block_); + } builder_->set_current_block(merge_block_); } } @@ -991,36 +986,6 @@ HInstruction* HGraphBuilder::AddInstruction(HInstruction* instr) { } -void HGraphBuilder::AddSimulate(BailoutId id, - RemovableSimulate removable) { - ASSERT(current_block() != NULL); - ASSERT(no_side_effects_scope_count_ == 0); - current_block()->AddSimulate(id, removable); -} - - -HReturn* HGraphBuilder::AddReturn(HValue* value) { - HValue* context = environment()->LookupContext(); - int num_parameters = graph()->info()->num_parameters(); - HValue* params = Add(num_parameters); - HReturn* return_instruction = new(graph()->zone()) - HReturn(value, context, params); - current_block()->FinishExit(return_instruction); - return return_instruction; -} - - -void HGraphBuilder::AddSoftDeoptimize(SoftDeoptimizeMode mode) { - isolate()->counters()->soft_deopts_requested()->Increment(); - if (FLAG_always_opt && mode == CAN_OMIT_SOFT_DEOPT) return; - if (current_block()->IsDeoptimizing()) return; - Add(); - isolate()->counters()->soft_deopts_inserted()->Increment(); - current_block()->MarkAsDeoptimizing(); - graph()->set_has_soft_deoptimize(true); -} - - HBasicBlock* HGraphBuilder::CreateBasicBlock(HEnvironment* env) { HBasicBlock* b = graph()->CreateBasicBlock(); b->SetInitialEnvironment(env); @@ -1043,14 +1008,52 @@ HValue* HGraphBuilder::BuildCheckHeapObject(HValue* obj) { } -HValue* HGraphBuilder::BuildCheckMap(HValue* obj, - Handle map) { - HCheckMaps* check = HCheckMaps::New(obj, map, zone()); +void HGraphBuilder::FinishExitWithHardDeoptimization( + HBasicBlock* continuation) { + PadEnvironmentForContinuation(current_block(), continuation); + Add(Deoptimizer::EAGER); + if (no_side_effects_scope_count_ > 0) { + current_block()->GotoNoSimulate(continuation); + } else { + current_block()->Goto(continuation); + } +} + + +void HGraphBuilder::PadEnvironmentForContinuation( + HBasicBlock* from, + HBasicBlock* continuation) { + if (continuation->last_environment() != NULL) { + // When merging from a deopt block to a continuation, resolve differences in + // environment by pushing undefined and popping extra values so that the + // environments match during the join. + int continuation_env_length = continuation->last_environment()->length(); + while (continuation_env_length != from->last_environment()->length()) { + if (continuation_env_length > from->last_environment()->length()) { + from->last_environment()->Push(graph()->GetConstantUndefined()); + } else { + from->last_environment()->Pop(); + } + } + } else { + ASSERT(continuation->predecessors()->length() == 0); + } +} + + +HValue* HGraphBuilder::BuildCheckMap(HValue* obj, Handle map) { + HCheckMaps* check = HCheckMaps::New(obj, map, zone(), top_info()); AddInstruction(check); return check; } +HValue* HGraphBuilder::BuildWrapReceiver(HValue* object, HValue* function) { + if (object->type().IsJSObject()) return object; + return Add(object, function); +} + + HValue* HGraphBuilder::BuildCheckForCapacityGrow(HValue* object, HValue* elements, ElementsKind kind, @@ -1092,10 +1095,7 @@ HValue* HGraphBuilder::BuildCheckForCapacityGrow(HValue* object, HAdd::New(zone, context, key, graph_->GetConstant1())); new_length->ClearFlag(HValue::kCanOverflow); - Representation representation = IsFastElementsKind(kind) - ? Representation::Smi() : Representation::Tagged(); - AddStore(object, HObjectAccess::ForArrayLength(), new_length, - representation); + AddStore(object, HObjectAccess::ForArrayLength(kind), new_length); } length_checker.Else(); @@ -1163,10 +1163,8 @@ void HGraphBuilder::BuildTransitionElementsKind(HValue* object, HInstruction* elements_length = AddLoadFixedArrayLength(elements); HInstruction* array_length = is_jsarray - ? AddLoad(object, HObjectAccess::ForArrayLength(), - NULL, Representation::Smi()) + ? AddLoad(object, HObjectAccess::ForArrayLength(from_kind), NULL) : elements_length; - array_length->set_type(HType::Smi()); BuildGrowElementsCapacity(object, elements, from_kind, to_kind, array_length, elements_length); @@ -1208,14 +1206,14 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess( if (is_store && (fast_elements || fast_smi_only_elements) && store_mode != STORE_NO_TRANSITION_HANDLE_COW) { HCheckMaps* check_cow_map = HCheckMaps::New( - elements, isolate()->factory()->fixed_array_map(), zone); + elements, isolate()->factory()->fixed_array_map(), zone, top_info()); check_cow_map->ClearGVNFlag(kDependsOnElementsKind); AddInstruction(check_cow_map); } HInstruction* length = NULL; if (is_js_array) { - length = AddLoad(object, HObjectAccess::ForArrayLength(), mapcheck, - Representation::Smi()); + length = AddLoad(object, HObjectAccess::ForArrayLength(elements_kind), + mapcheck); } else { length = AddLoadFixedArrayLength(elements); } @@ -1276,7 +1274,8 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess( length); } else { HCheckMaps* check_cow_map = HCheckMaps::New( - elements, isolate()->factory()->fixed_array_map(), zone); + elements, isolate()->factory()->fixed_array_map(), + zone, top_info()); check_cow_map->ClearGVNFlag(kDependsOnElementsKind); AddInstruction(check_cow_map); } @@ -1330,10 +1329,7 @@ void HGraphBuilder::BuildInitializeElementsHeader(HValue* elements, : factory->fixed_array_map(); AddStoreMapConstant(elements, map); - Representation representation = IsFastElementsKind(kind) - ? Representation::Smi() : Representation::Tagged(); - AddStore(elements, HObjectAccess::ForFixedArrayLength(), capacity, - representation); + AddStore(elements, HObjectAccess::ForFixedArrayLength(), capacity); } @@ -1350,6 +1346,7 @@ HValue* HGraphBuilder::BuildAllocateElementsAndInitializeElementsHeader( HInnerAllocatedObject* HGraphBuilder::BuildJSArrayHeader(HValue* array, HValue* array_map, AllocationSiteMode mode, + ElementsKind elements_kind, HValue* allocation_site_payload, HValue* length_field) { @@ -1360,7 +1357,7 @@ HInnerAllocatedObject* HGraphBuilder::BuildJSArrayHeader(HValue* array, HObjectAccess access = HObjectAccess::ForPropertiesPointer(); AddStore(array, access, empty_fixed_array); - AddStore(array, HObjectAccess::ForArrayLength(), length_field); + AddStore(array, HObjectAccess::ForArrayLength(elements_kind), length_field); if (mode == TRACK_ALLOCATION_SITE) { BuildCreateAllocationMemento(array, @@ -1467,10 +1464,7 @@ HLoadNamedField* HGraphBuilder::AddLoadElements(HValue* object, HLoadNamedField* HGraphBuilder::AddLoadFixedArrayLength(HValue* object) { - HLoadNamedField* instr = AddLoad(object, HObjectAccess::ForFixedArrayLength(), - NULL, Representation::Smi()); - instr->set_type(HType::Smi()); - return instr; + return AddLoad(object, HObjectAccess::ForFixedArrayLength()); } @@ -1719,7 +1713,7 @@ HInstruction* HGraphBuilder::BuildUnaryMathOp( input, graph()->GetConstantMinus1()); Representation rep = Representation::FromType(type); if (type->Is(Type::None())) { - AddSoftDeoptimize(); + Add(Deoptimizer::SOFT); } if (instr->IsBinaryOperation()) { HBinaryOperation* binop = HBinaryOperation::cast(instr); @@ -1730,7 +1724,7 @@ HInstruction* HGraphBuilder::BuildUnaryMathOp( } case Token::BIT_NOT: if (type->Is(Type::None())) { - AddSoftDeoptimize(); + Add(Deoptimizer::SOFT); } return new(zone()) HBitNot(input); } @@ -1841,11 +1835,8 @@ HValue* HGraphBuilder::JSArrayBuilder::EmitMapCode(HValue* context) { // No need for a context lookup if the kind_ matches the initial // map, because we can just load the map in that case. HObjectAccess access = HObjectAccess::ForPrototypeOrInitialMap(); - HInstruction* load = - builder()->BuildLoadNamedField(constructor_function_, - access, - Representation::Tagged()); - return builder()->AddInstruction(load); + return builder()->AddInstruction( + builder()->BuildLoadNamedField(constructor_function_, access)); } HInstruction* native_context = builder()->BuildGetNativeContext(context); @@ -1866,9 +1857,7 @@ HValue* HGraphBuilder::JSArrayBuilder::EmitInternalMapCode() { // Find the map near the constructor function HObjectAccess access = HObjectAccess::ForPrototypeOrInitialMap(); return builder()->AddInstruction( - builder()->BuildLoadNamedField(constructor_function_, - access, - Representation::Tagged())); + builder()->BuildLoadNamedField(constructor_function_, access)); } @@ -1882,11 +1871,8 @@ HValue* HGraphBuilder::JSArrayBuilder::EstablishAllocationSize( base_size += AllocationMemento::kSize; } - if (IsFastDoubleElementsKind(kind_)) { - base_size += FixedDoubleArray::kHeaderSize; - } else { - base_size += FixedArray::kHeaderSize; - } + STATIC_ASSERT(FixedDoubleArray::kHeaderSize == FixedArray::kHeaderSize); + base_size += FixedArray::kHeaderSize; HInstruction* elements_size_value = builder()->Add(elements_size()); @@ -1956,6 +1942,7 @@ HValue* HGraphBuilder::JSArrayBuilder::AllocateArray(HValue* size_in_bytes, elements_location_ = builder()->BuildJSArrayHeader(new_object, map, mode_, + kind_, allocation_site_payload_, length_field); @@ -1973,17 +1960,15 @@ HValue* HGraphBuilder::JSArrayBuilder::AllocateArray(HValue* size_in_bytes, HStoreNamedField* HGraphBuilder::AddStore(HValue *object, HObjectAccess access, - HValue *val, - Representation representation) { - return Add(object, access, val, representation); + HValue *val) { + return Add(object, access, val); } HLoadNamedField* HGraphBuilder::AddLoad(HValue *object, HObjectAccess access, - HValue *typecheck, - Representation representation) { - return Add(object, access, typecheck, representation); + HValue *typecheck) { + return Add(object, access, typecheck); } @@ -2638,7 +2623,7 @@ void EffectContext::ReturnInstruction(HInstruction* instr, BailoutId ast_id) { ASSERT(!instr->IsControlInstruction()); owner()->AddInstruction(instr); if (instr->HasObservableSideEffects()) { - owner()->AddSimulate(ast_id, REMOVABLE_SIMULATE); + owner()->Add(ast_id, REMOVABLE_SIMULATE); } } @@ -2680,7 +2665,7 @@ void ValueContext::ReturnInstruction(HInstruction* instr, BailoutId ast_id) { owner()->AddInstruction(instr); owner()->Push(instr); if (instr->HasObservableSideEffects()) { - owner()->AddSimulate(ast_id, REMOVABLE_SIMULATE); + owner()->Add(ast_id, REMOVABLE_SIMULATE); } } @@ -2736,7 +2721,7 @@ void TestContext::ReturnInstruction(HInstruction* instr, BailoutId ast_id) { // this one isn't actually needed (and wouldn't work if it were targeted). if (instr->HasObservableSideEffects()) { builder->Push(instr); - builder->AddSimulate(ast_id, REMOVABLE_SIMULATE); + builder->Add(ast_id, REMOVABLE_SIMULATE); builder->Pop(); } BuildBranch(instr); @@ -2924,7 +2909,7 @@ bool HOptimizedGraphBuilder::BuildGraph() { VisitVariableDeclaration(scope->function()); } VisitDeclarations(scope->declarations()); - AddSimulate(BailoutId::Declarations()); + Add(BailoutId::Declarations()); HValue* context = environment()->LookupContext(); Add(context, HStackCheck::kFunctionEntry); @@ -2933,7 +2918,7 @@ bool HOptimizedGraphBuilder::BuildGraph() { if (HasStackOverflow()) return false; if (current_block() != NULL) { - AddReturn(graph()->GetConstantUndefined()); + Add(graph()->GetConstantUndefined()); set_current_block(NULL); } @@ -3031,6 +3016,9 @@ bool HGraph::Optimize(SmartArrayPointer* bailout_reason) { if (FLAG_array_bounds_checks_elimination && !FLAG_idefs) { Run(); } + if (FLAG_array_bounds_checks_hoisting && !FLAG_idefs) { + Run(); + } if (FLAG_array_index_dehoisting) Run(); if (FLAG_dead_code_elimination) Run(); @@ -3112,7 +3100,7 @@ void HGraph::RestoreActualValues() { } -void HOptimizedGraphBuilder::PushAndAdd(HInstruction* instr) { +void HGraphBuilder::PushAndAdd(HInstruction* instr) { Push(instr); AddInstruction(instr); } @@ -3223,10 +3211,10 @@ void HOptimizedGraphBuilder::VisitIfStatement(IfStatement* stmt) { ASSERT(current_block() != NULL); ASSERT(current_block()->HasPredecessor()); if (stmt->condition()->ToBooleanIsTrue()) { - AddSimulate(stmt->ThenId()); + Add(stmt->ThenId()); Visit(stmt->then_statement()); } else if (stmt->condition()->ToBooleanIsFalse()) { - AddSimulate(stmt->ElseId()); + Add(stmt->ElseId()); Visit(stmt->else_statement()); } else { HBasicBlock* cond_true = graph()->CreateBasicBlock(); @@ -3333,7 +3321,7 @@ void HOptimizedGraphBuilder::VisitReturnStatement(ReturnStatement* stmt) { // Not an inlined return, so an actual one. CHECK_ALIVE(VisitForValue(stmt->expression())); HValue* result = environment()->Pop(); - AddReturn(result); + Add(result); } else if (state->inlining_kind() == CONSTRUCT_CALL_RETURN) { // Return from an inlined construct call. In a test context the return value // will always evaluate to true, in a value context the return value needs @@ -3425,7 +3413,7 @@ void HOptimizedGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) { HValue* context = environment()->LookupContext(); CHECK_ALIVE(VisitForValue(stmt->tag())); - AddSimulate(stmt->EntryId()); + Add(stmt->EntryId()); HValue* tag_value = Pop(); HBasicBlock* first_test_block = current_block(); @@ -3465,7 +3453,7 @@ void HOptimizedGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) { if (stmt->switch_type() == SwitchStatement::SMI_SWITCH) { if (!clause->compare_type()->Is(Type::Smi())) { - AddSoftDeoptimize(); + Add(Deoptimizer::SOFT); } HCompareNumericAndBranch* compare_ = @@ -3515,7 +3503,7 @@ void HOptimizedGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) { normal_block = last_block; last_block = NULL; // Cleared to indicate we've handled it. } - } else if (!curr_test_block->end()->IsDeoptimize()) { + } else { normal_block = curr_test_block->end()->FirstSuccessor(); curr_test_block = curr_test_block->end()->SecondSuccessor(); } @@ -3569,7 +3557,7 @@ void HOptimizedGraphBuilder::VisitLoopBody(IterationStatement* stmt, HBasicBlock* loop_entry, BreakAndContinueInfo* break_info) { BreakAndContinueScope push(break_info, this); - AddSimulate(stmt->StackCheckId()); + Add(stmt->StackCheckId()); HValue* context = environment()->LookupContext(); HStackCheck* stack_check = Add( context, HStackCheck::kBackwardsBranch); @@ -3730,7 +3718,7 @@ void HOptimizedGraphBuilder::VisitForInStatement(ForInStatement* stmt) { HInstruction* map = Add( environment()->LookupContext(), enumerable); - AddSimulate(stmt->PrepareId()); + Add(stmt->PrepareId()); HInstruction* array = Add( enumerable, map, DescriptorArray::kEnumCacheBridgeCacheIndex); @@ -3799,7 +3787,6 @@ void HOptimizedGraphBuilder::VisitForInStatement(ForInStatement* stmt) { environment()->LookupContext(), current_index, graph()->GetConstant1()); - new_index->AssumeRepresentation(Representation::Integer32()); PushAndAdd(new_index); body_exit = current_block(); } @@ -4327,7 +4314,7 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { } AddInstruction(store); if (store->HasObservableSideEffects()) { - AddSimulate(key->id(), REMOVABLE_SIMULATE); + Add(key->id(), REMOVABLE_SIMULATE); } } else { CHECK_ALIVE(VisitForEffect(value)); @@ -4450,7 +4437,7 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { // De-opt if elements kind changed from boilerplate_elements_kind. Handle map = Handle(original_boilerplate_object->map(), isolate()); - AddInstruction(HCheckMaps::New(literal, map, zone())); + AddInstruction(HCheckMaps::New(literal, map, zone(), top_info())); } // The array is expected in the bailout environment during computation @@ -4492,7 +4479,7 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { break; } - AddSimulate(expr->GetIdForElement(i)); + Add(expr->GetIdForElement(i)); } Drop(1); // array literal index @@ -4525,30 +4512,17 @@ static bool ComputeLoadStoreField(Handle type, } -static Representation ComputeLoadStoreRepresentation(Handle type, - LookupResult* lookup) { - if (lookup->IsField()) { - return lookup->representation(); - } else { - Map* transition = lookup->GetTransitionMapFromMap(*type); - int descriptor = transition->LastAdded(); - PropertyDetails details = - transition->instance_descriptors()->GetDetails(descriptor); - return details.representation(); - } -} - - void HOptimizedGraphBuilder::AddCheckMap(HValue* object, Handle map) { BuildCheckHeapObject(object); - AddInstruction(HCheckMaps::New(object, map, zone())); + AddInstruction(HCheckMaps::New(object, map, zone(), top_info())); } void HOptimizedGraphBuilder::AddCheckMapsWithTransitions(HValue* object, Handle map) { BuildCheckHeapObject(object); - AddInstruction(HCheckMaps::NewWithTransitions(object, map, zone())); + AddInstruction(HCheckMaps::NewWithTransitions( + object, map, zone(), top_info())); } @@ -4589,33 +4563,33 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField( } HObjectAccess field_access = HObjectAccess::ForField(map, lookup, name); - Representation representation = ComputeLoadStoreRepresentation(map, lookup); bool transition_to_field = lookup->IsTransitionToField(*map); HStoreNamedField *instr; - if (FLAG_track_double_fields && representation.IsDouble()) { + if (FLAG_track_double_fields && field_access.representation().IsDouble()) { + HObjectAccess heap_number_access = + field_access.WithRepresentation(Representation::Tagged()); if (transition_to_field) { // The store requires a mutable HeapNumber to be allocated. NoObservableSideEffectsScope no_side_effects(this); HInstruction* heap_number_size = Add(HeapNumber::kSize); - HInstruction* double_box = Add( + HInstruction* heap_number = Add( environment()->LookupContext(), heap_number_size, HType::HeapNumber(), HAllocate::CAN_ALLOCATE_IN_NEW_SPACE); - AddStoreMapConstant(double_box, isolate()->factory()->heap_number_map()); - AddStore(double_box, HObjectAccess::ForHeapNumberValue(), - value, Representation::Double()); - instr = new(zone()) HStoreNamedField(object, field_access, double_box); + AddStoreMapConstant(heap_number, isolate()->factory()->heap_number_map()); + AddStore(heap_number, HObjectAccess::ForHeapNumberValue(), value); + instr = new(zone()) HStoreNamedField( + object, heap_number_access, heap_number); } else { // Already holds a HeapNumber; load the box and write its value field. - HInstruction* double_box = AddLoad(object, field_access); - double_box->set_type(HType::HeapNumber()); - instr = new(zone()) HStoreNamedField(double_box, - HObjectAccess::ForHeapNumberValue(), value, Representation::Double()); + HInstruction* heap_number = AddLoad(object, heap_number_access); + heap_number->set_type(HType::HeapNumber()); + instr = new(zone()) HStoreNamedField(heap_number, + HObjectAccess::ForHeapNumberValue(), value); } } else { - // This is a non-double store. - instr = new(zone()) HStoreNamedField( - object, field_access, value, representation); + // This is a normal store. + instr = new(zone()) HStoreNamedField(object, field_access, value); } if (transition_to_field) { @@ -4682,20 +4656,18 @@ HInstruction* HOptimizedGraphBuilder::TryLoadPolymorphicAsMonomorphic( LookupResult lookup(isolate()); int count; - Representation representation = Representation::None(); HObjectAccess access = HObjectAccess::ForMap(); // initial value unused. for (count = 0; count < types->length(); ++count) { Handle map = types->at(count); if (!ComputeLoadStoreField(map, name, &lookup, false)) break; HObjectAccess new_access = HObjectAccess::ForField(map, &lookup, name); - Representation new_representation = - ComputeLoadStoreRepresentation(map, &lookup); if (count == 0) { // First time through the loop; set access and representation. access = new_access; - } else if (!representation.IsCompatibleForLoad(new_representation)) { + } else if (!access.representation().IsCompatibleForLoad( + new_access.representation())) { // Representations did not match. break; } else if (access.offset() != new_access.offset()) { @@ -4705,14 +4677,15 @@ HInstruction* HOptimizedGraphBuilder::TryLoadPolymorphicAsMonomorphic( // In-objectness did not match. break; } - representation = representation.generalize(new_representation); + access = access.WithRepresentation( + access.representation().generalize(new_access.representation())); } if (count == types->length()) { // Everything matched; can use monomorphic load. BuildCheckHeapObject(object); AddInstruction(HCheckMaps::New(object, types, zone())); - return BuildLoadNamedField(object, access, representation); + return BuildLoadNamedField(object, access); } if (count != 0) return NULL; @@ -4734,14 +4707,14 @@ HInstruction* HOptimizedGraphBuilder::TryLoadPolymorphicAsMonomorphic( BuildCheckHeapObject(object); AddInstruction(HCheckMaps::New(object, types, zone())); + Handle holder(lookup.holder()); Handle holder_map(holder->map()); AddInstruction(new(zone()) HCheckPrototypeMaps( Handle::cast(prototype), holder, zone(), top_info())); HValue* holder_value = AddInstruction(new(zone()) HConstant(holder)); return BuildLoadNamedField(holder_value, - HObjectAccess::ForField(holder_map, &lookup, name), - ComputeLoadStoreRepresentation(map, &lookup)); + HObjectAccess::ForField(holder_map, &lookup, name)); } @@ -4790,8 +4763,7 @@ bool HOptimizedGraphBuilder::TryStorePolymorphicAsMonomorphic( ASSERT(!map->is_observed()); HObjectAccess new_access = HObjectAccess::ForField(map, &lookup, name); - Representation new_representation = - ComputeLoadStoreRepresentation(map, &lookup); + Representation new_representation = new_access.representation(); if (count == 0) { // First time through the loop; set access and representation. @@ -4822,7 +4794,7 @@ bool HOptimizedGraphBuilder::TryStorePolymorphicAsMonomorphic( if (!ast_context()->IsEffect()) Push(result_value); store->set_position(position); AddInstruction(store); - AddSimulate(assignment_id); + Add(assignment_id); if (!ast_context()->IsEffect()) Drop(1); ast_context()->ReturnValue(result_value); return true; @@ -4881,7 +4853,7 @@ void HOptimizedGraphBuilder::HandlePolymorphicStoreNamedField( // know about and do not want to handle ones we've never seen. Otherwise // use a generic IC. if (count == types->length() && FLAG_deoptimize_uncommon_cases) { - current_block()->FinishExitWithDeoptimization(HDeoptimize::kNoUses); + FinishExitWithHardDeoptimization(join); } else { HInstruction* instr = BuildStoreNamedGeneric(object, name, store_value); instr->set_position(position); @@ -4898,10 +4870,10 @@ void HOptimizedGraphBuilder::HandlePolymorphicStoreNamedField( // unoptimized code). if (instr->HasObservableSideEffects()) { if (ast_context()->IsEffect()) { - AddSimulate(assignment_id, REMOVABLE_SIMULATE); + Add(assignment_id, REMOVABLE_SIMULATE); } else { Push(result_value); - AddSimulate(assignment_id, REMOVABLE_SIMULATE); + Add(assignment_id, REMOVABLE_SIMULATE); Drop(1); } } @@ -4929,7 +4901,7 @@ void HOptimizedGraphBuilder::HandlePropertyAssignment(Assignment* expr) { HValue* value = environment()->ExpressionStackAt(0); HValue* object = environment()->ExpressionStackAt(1); - if (expr->IsUninitialized()) AddSoftDeoptimize(); + if (expr->IsUninitialized()) Add(Deoptimizer::SOFT); return BuildStoreNamed(expr, expr->id(), expr->position(), expr->AssignmentId(), prop, object, value, value); } else { @@ -4946,7 +4918,7 @@ void HOptimizedGraphBuilder::HandlePropertyAssignment(Assignment* expr) { &has_side_effects); Drop(3); Push(value); - AddSimulate(expr->AssignmentId(), REMOVABLE_SIMULATE); + Add(expr->AssignmentId(), REMOVABLE_SIMULATE); return ast_context()->ReturnValue(Pop()); } } @@ -4975,14 +4947,14 @@ void HOptimizedGraphBuilder::HandleGlobalVariableAssignment( } builder.Then(); builder.Else(); - AddSoftDeoptimize(MUST_EMIT_SOFT_DEOPT); + Add(Deoptimizer::EAGER); builder.End(); } HInstruction* instr = Add(value, cell, lookup.GetPropertyDetails()); instr->set_position(position); if (instr->HasObservableSideEffects()) { - AddSimulate(ast_id, REMOVABLE_SIMULATE); + Add(ast_id, REMOVABLE_SIMULATE); } } else { HValue* context = environment()->LookupContext(); @@ -4992,7 +4964,7 @@ void HOptimizedGraphBuilder::HandleGlobalVariableAssignment( value, function_strict_mode_flag()); instr->set_position(position); ASSERT(instr->HasObservableSideEffects()); - AddSimulate(ast_id, REMOVABLE_SIMULATE); + Add(ast_id, REMOVABLE_SIMULATE); } } @@ -5054,7 +5026,7 @@ void HOptimizedGraphBuilder::BuildStoreNamed(Expression* expr, instr->set_position(position); AddInstruction(instr); if (instr->HasObservableSideEffects()) { - AddSimulate(id, REMOVABLE_SIMULATE); + Add(id, REMOVABLE_SIMULATE); } if (!ast_context()->IsEffect()) Drop(1); return ast_context()->ReturnValue(result_value); @@ -5132,7 +5104,7 @@ void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) { HStoreContextSlot* instr = Add(context, var->index(), mode, Top()); if (instr->HasObservableSideEffects()) { - AddSimulate(expr->AssignmentId(), REMOVABLE_SIMULATE); + Add(expr->AssignmentId(), REMOVABLE_SIMULATE); } break; } @@ -5173,7 +5145,7 @@ void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) { if (load == NULL) load = BuildLoadNamedGeneric(object, name, prop); PushAndAdd(load); if (load->HasObservableSideEffects()) { - AddSimulate(prop->LoadId(), REMOVABLE_SIMULATE); + Add(prop->LoadId(), REMOVABLE_SIMULATE); } CHECK_ALIVE(VisitForValue(expr->value())); @@ -5183,7 +5155,7 @@ void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) { HInstruction* instr = BuildBinaryOperation(operation, left, right); PushAndAdd(instr); if (instr->HasObservableSideEffects()) { - AddSimulate(operation->id(), REMOVABLE_SIMULATE); + Add(operation->id(), REMOVABLE_SIMULATE); } return BuildStoreNamed(prop, expr->id(), expr->position(), @@ -5201,7 +5173,7 @@ void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) { false, // is_store &has_side_effects); Push(load); - if (has_side_effects) AddSimulate(prop->LoadId(), REMOVABLE_SIMULATE); + if (has_side_effects) Add(prop->LoadId(), REMOVABLE_SIMULATE); CHECK_ALIVE(VisitForValue(expr->value())); HValue* right = Pop(); @@ -5210,7 +5182,7 @@ void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) { HInstruction* instr = BuildBinaryOperation(operation, left, right); PushAndAdd(instr); if (instr->HasObservableSideEffects()) { - AddSimulate(operation->id(), REMOVABLE_SIMULATE); + Add(operation->id(), REMOVABLE_SIMULATE); } HandleKeyedElementAccess(obj, key, instr, expr, expr->AssignmentId(), @@ -5222,7 +5194,7 @@ void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) { Drop(3); Push(instr); ASSERT(has_side_effects); // Stores always have side effects. - AddSimulate(expr->AssignmentId(), REMOVABLE_SIMULATE); + Add(expr->AssignmentId(), REMOVABLE_SIMULATE); return ast_context()->ReturnValue(Pop()); } @@ -5344,7 +5316,7 @@ void HOptimizedGraphBuilder::VisitAssignment(Assignment* expr) { HStoreContextSlot* instr = Add(context, var->index(), mode, Top()); if (instr->HasObservableSideEffects()) { - AddSimulate(expr->AssignmentId(), REMOVABLE_SIMULATE); + Add(expr->AssignmentId(), REMOVABLE_SIMULATE); } return ast_context()->ReturnValue(Pop()); } @@ -5378,30 +5350,24 @@ void HOptimizedGraphBuilder::VisitThrow(Throw* expr) { HValue* value = environment()->Pop(); HThrow* instr = Add(context, value); instr->set_position(expr->position()); - AddSimulate(expr->id()); + Add(expr->id()); current_block()->FinishExit(new(zone()) HAbnormalExit); set_current_block(NULL); } -HLoadNamedField* HGraphBuilder::BuildLoadNamedField( - HValue* object, - HObjectAccess access, - Representation representation) { - bool load_double = false; - if (representation.IsDouble()) { - representation = Representation::Tagged(); - load_double = FLAG_track_double_fields; - } - HLoadNamedField* field = - new(zone()) HLoadNamedField(object, access, NULL, representation); - if (load_double) { - AddInstruction(field); - field->set_type(HType::HeapNumber()); - return new(zone()) HLoadNamedField(field, - HObjectAccess::ForHeapNumberValue(), NULL, Representation::Double()); +HLoadNamedField* HGraphBuilder::BuildLoadNamedField(HValue* object, + HObjectAccess access) { + if (FLAG_track_double_fields && access.representation().IsDouble()) { + // load the heap number + HLoadNamedField* heap_number = + AddLoad(object, access.WithRepresentation(Representation::Tagged())); + heap_number->set_type(HType::HeapNumber()); + // load the double value from it + return new(zone()) HLoadNamedField(heap_number, + HObjectAccess::ForHeapNumberValue(), NULL); } - return field; + return new(zone()) HLoadNamedField(object, access, NULL); } @@ -5410,7 +5376,7 @@ HInstruction* HOptimizedGraphBuilder::BuildLoadNamedGeneric( Handle name, Property* expr) { if (expr->IsUninitialized()) { - AddSoftDeoptimize(); + Add(Deoptimizer::SOFT); } HValue* context = environment()->LookupContext(); return new(zone()) HLoadNamedGeneric(context, object, name); @@ -5441,7 +5407,7 @@ HInstruction* HOptimizedGraphBuilder::BuildLoadNamedMonomorphic( if (map->instance_type() == JS_ARRAY_TYPE) { AddCheckMapsWithTransitions(object, map); return new(zone()) HLoadNamedField(object, - HObjectAccess::ForArrayLength()); + HObjectAccess::ForArrayLength(map->elements_kind())); } } @@ -5450,15 +5416,14 @@ HInstruction* HOptimizedGraphBuilder::BuildLoadNamedMonomorphic( if (lookup.IsField()) { AddCheckMap(object, map); return BuildLoadNamedField(object, - HObjectAccess::ForField(map, &lookup, name), - ComputeLoadStoreRepresentation(map, &lookup)); + HObjectAccess::ForField(map, &lookup, name)); } // Handle a load of a constant known function. - if (lookup.IsConstantFunction()) { + if (lookup.IsConstant()) { AddCheckMap(object, map); - Handle function(lookup.GetConstantFunctionFromMap(*map)); - return new(zone()) HConstant(function); + Handle constant(lookup.GetConstantFromMap(*map), isolate()); + return new(zone()) HConstant(constant); } // Handle a load from a known field somewhere in the prototype chain. @@ -5471,19 +5436,18 @@ HInstruction* HOptimizedGraphBuilder::BuildLoadNamedMonomorphic( Add(prototype, holder, zone(), top_info()); HValue* holder_value = Add(holder); return BuildLoadNamedField(holder_value, - HObjectAccess::ForField(holder_map, &lookup, name), - ComputeLoadStoreRepresentation(map, &lookup)); + HObjectAccess::ForField(holder_map, &lookup, name)); } // Handle a load of a constant function somewhere in the prototype chain. - if (lookup.IsConstantFunction()) { + if (lookup.IsConstant()) { Handle prototype(JSObject::cast(map->prototype())); Handle holder(lookup.holder()); Handle holder_map(holder->map()); AddCheckMap(object, map); Add(prototype, holder, zone(), top_info()); - Handle function(lookup.GetConstantFunctionFromMap(*holder_map)); - return new(zone()) HConstant(function); + Handle constant(lookup.GetConstantFromMap(*holder_map), isolate()); + return new(zone()) HConstant(constant); } // No luck, do a generic load. @@ -5506,7 +5470,8 @@ HInstruction* HOptimizedGraphBuilder::BuildMonomorphicElementAccess( Handle map, bool is_store, KeyedAccessStoreMode store_mode) { - HCheckMaps* mapcheck = HCheckMaps::New(object, map, zone(), dependency); + HCheckMaps* mapcheck = HCheckMaps::New( + object, map, zone(), top_info(), dependency); AddInstruction(mapcheck); if (dependency) { mapcheck->ClearGVNFlag(kDependsOnElementsKind); @@ -5690,12 +5655,11 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess( if (is_store && !IsFastDoubleElementsKind(elements_kind)) { AddInstruction(HCheckMaps::New( elements, isolate()->factory()->fixed_array_map(), - zone(), mapcompare)); + zone(), top_info(), mapcompare)); } - if (map->IsJSArray()) { - HInstruction* length = AddLoad(object, HObjectAccess::ForArrayLength(), - mapcompare, Representation::Smi()); - length->set_type(HType::Smi()); + if (map->instance_type() == JS_ARRAY_TYPE) { + HInstruction* length = AddLoad( + object, HObjectAccess::ForArrayLength(elements_kind), mapcompare); checked_key = Add(key, length); } else { HInstruction* length = AddLoadFixedArrayLength(elements); @@ -5732,7 +5696,8 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess( } // Deopt if none of the cases matched. - current_block()->FinishExitWithDeoptimization(HDeoptimize::kNoUses); + NoObservableSideEffectsScope scope(this); + FinishExitWithHardDeoptimization(join); set_current_block(join); return is_store ? NULL : Pop(); } @@ -5768,12 +5733,12 @@ HValue* HOptimizedGraphBuilder::HandleKeyedElementAccess( } else { if (is_store) { if (expr->IsAssignment() && expr->AsAssignment()->IsUninitialized()) { - AddSoftDeoptimize(); + Add(Deoptimizer::SOFT); } instr = BuildStoreKeyedGeneric(obj, key, val); } else { if (expr->AsProperty()->IsUninitialized()) { - AddSoftDeoptimize(); + Add(Deoptimizer::SOFT); } instr = BuildLoadKeyedGeneric(obj, key); } @@ -5952,10 +5917,10 @@ void HOptimizedGraphBuilder::VisitProperty(Property* expr) { &has_side_effects); if (has_side_effects) { if (ast_context()->IsEffect()) { - AddSimulate(expr->id(), REMOVABLE_SIMULATE); + Add(expr->id(), REMOVABLE_SIMULATE); } else { Push(load); - AddSimulate(expr->id(), REMOVABLE_SIMULATE); + Add(expr->id(), REMOVABLE_SIMULATE); Drop(1); } } @@ -6057,7 +6022,7 @@ bool HOptimizedGraphBuilder::TryCallPolymorphicAsMonomorphic( PreProcessCall(call); AddInstruction(call); if (!ast_context()->IsEffect()) Push(call); - AddSimulate(expr->id(), REMOVABLE_SIMULATE); + Add(expr->id(), REMOVABLE_SIMULATE); if (!ast_context()->IsEffect()) ast_context()->ReturnValue(Pop()); } @@ -6189,7 +6154,11 @@ void HOptimizedGraphBuilder::HandlePolymorphicCallNamed( // know about and do not want to handle ones we've never seen. Otherwise // use a generic IC. if (ordered_functions == types->length() && FLAG_deoptimize_uncommon_cases) { - current_block()->FinishExitWithDeoptimization(HDeoptimize::kNoUses); + // Because the deopt may be the only path in the polymorphic call, make sure + // that the environment stack matches the depth on deopt that it otherwise + // would have had after a successful call. + Drop(argument_count - (ast_context()->IsEffect() ? 0 : 1)); + FinishExitWithHardDeoptimization(join); } else { HValue* context = environment()->LookupContext(); HCallNamed* call = new(zone()) HCallNamed(context, name, argument_count); @@ -6447,7 +6416,7 @@ bool HOptimizedGraphBuilder::TryInline(CallKind call_kind, inner_env->BindContext(context); #endif - AddSimulate(return_id); + Add(return_id); current_block()->UpdateEnvironment(inner_env); HArgumentsObject* arguments_object = NULL; @@ -6881,7 +6850,7 @@ bool HOptimizedGraphBuilder::TryCallApply(Call* expr) { if (function_state()->outer() == NULL) { HInstruction* elements = Add(false); HInstruction* length = Add(elements); - HValue* wrapped_receiver = Add(receiver, function); + HValue* wrapped_receiver = BuildWrapReceiver(receiver, function); HInstruction* result = new(zone()) HApplyArguments(function, wrapped_receiver, @@ -6898,7 +6867,7 @@ bool HOptimizedGraphBuilder::TryCallApply(Call* expr) { HArgumentsObject* args = function_state()->entry()->arguments_object(); const ZoneList* arguments_values = args->arguments_values(); int arguments_count = arguments_values->length(); - PushAndAdd(new(zone()) HWrapReceiver(receiver, function)); + Push(BuildWrapReceiver(receiver, function)); for (int i = 1; i < arguments_count; i++) { Push(arguments_values->at(i)); } @@ -7460,8 +7429,8 @@ void HOptimizedGraphBuilder::VisitTypeof(UnaryOperation* expr) { void HOptimizedGraphBuilder::VisitSub(UnaryOperation* expr) { CHECK_ALIVE(VisitForValue(expr->expression())); - HValue* value = Pop(); Handle operand_type = expr->expression()->bounds().lower; + HValue* value = TruncateToNumber(Pop(), &operand_type); HInstruction* instr = BuildUnaryMathOp(value, operand_type, Token::SUB); return ast_context()->ReturnInstruction(instr, expr->id()); } @@ -7469,8 +7438,8 @@ void HOptimizedGraphBuilder::VisitSub(UnaryOperation* expr) { void HOptimizedGraphBuilder::VisitBitNot(UnaryOperation* expr) { CHECK_ALIVE(VisitForValue(expr->expression())); - HValue* value = Pop(); Handle operand_type = expr->expression()->bounds().lower; + HValue* value = TruncateToNumber(Pop(), &operand_type); HInstruction* instr = BuildUnaryMathOp(value, operand_type, Token::BIT_NOT); return ast_context()->ReturnInstruction(instr, expr->id()); } @@ -7625,7 +7594,7 @@ void HOptimizedGraphBuilder::VisitCountOperation(CountOperation* expr) { HStoreContextSlot* instr = Add(context, var->index(), mode, after); if (instr->HasObservableSideEffects()) { - AddSimulate(expr->AssignmentId(), REMOVABLE_SIMULATE); + Add(expr->AssignmentId(), REMOVABLE_SIMULATE); } break; } @@ -7668,7 +7637,7 @@ void HOptimizedGraphBuilder::VisitCountOperation(CountOperation* expr) { if (load == NULL) load = BuildLoadNamedGeneric(object, name, prop); PushAndAdd(load); if (load->HasObservableSideEffects()) { - AddSimulate(prop->LoadId(), REMOVABLE_SIMULATE); + Add(prop->LoadId(), REMOVABLE_SIMULATE); } after = BuildIncrement(returns_original_input, expr); @@ -7691,7 +7660,7 @@ void HOptimizedGraphBuilder::VisitCountOperation(CountOperation* expr) { false, // is_store &has_side_effects); Push(load); - if (has_side_effects) AddSimulate(prop->LoadId(), REMOVABLE_SIMULATE); + if (has_side_effects) Add(prop->LoadId(), REMOVABLE_SIMULATE); after = BuildIncrement(returns_original_input, expr); input = environment()->ExpressionStackAt(0); @@ -7708,7 +7677,7 @@ void HOptimizedGraphBuilder::VisitCountOperation(CountOperation* expr) { environment()->SetExpressionStackAt(0, after); if (returns_original_input) environment()->SetExpressionStackAt(1, input); ASSERT(has_side_effects); // Stores always have side effects. - AddSimulate(expr->AssignmentId(), REMOVABLE_SIMULATE); + Add(expr->AssignmentId(), REMOVABLE_SIMULATE); } } @@ -7800,6 +7769,40 @@ bool CanBeZero(HValue* right) { } +HValue* HGraphBuilder::TruncateToNumber(HValue* value, Handle* expected) { + if (value->IsConstant()) { + HConstant* constant = HConstant::cast(value); + Maybe number = constant->CopyToTruncatedNumber(zone()); + if (number.has_value) { + *expected = handle(Type::Number(), isolate()); + return AddInstruction(number.value); + } + return value; + } + + Handle expected_type = *expected; + Representation rep = Representation::FromType(expected_type); + if (!rep.IsTagged()) return value; + + // If our type feedback suggests that we can non-observably truncate to number + // we introduce the appropriate check here. This avoids 'value' having a + // tagged representation later on. + if (expected_type->Is(Type::Oddball())) { + // TODO(olivf) The BinaryOpStub only records undefined. It might pay off to + // also record booleans and convert them to 0/1 here. + IfBuilder if_nan(this); + if_nan.If(value, + graph()->GetConstantUndefined()); + if_nan.Then(); + if_nan.ElseDeopt(); + if_nan.End(); + return Add(OS::nan_value(), Representation::Double()); + } + + return value; +} + + HInstruction* HOptimizedGraphBuilder::BuildBinaryOperation( BinaryOperation* expr, HValue* left, @@ -7813,13 +7816,21 @@ HInstruction* HOptimizedGraphBuilder::BuildBinaryOperation( Representation right_rep = Representation::FromType(right_type); Representation result_rep = Representation::FromType(result_type); + if (expr->op() != Token::ADD || + (left->type().IsNonString() && right->type().IsNonString())) { + // For addition we can only truncate the arguments to number if we can + // prove that we will not end up in string concatenation mode. + left = TruncateToNumber(left, &left_type); + right = TruncateToNumber(right, &right_type); + } + if (left_type->Is(Type::None())) { - AddSoftDeoptimize(); + Add(Deoptimizer::SOFT); // TODO(rossberg): we should be able to get rid of non-continuous defaults. left_type = handle(Type::Any(), isolate()); } if (right_type->Is(Type::None())) { - AddSoftDeoptimize(); + Add(Deoptimizer::SOFT); right_type = handle(Type::Any(), isolate()); } HInstruction* instr = NULL; @@ -8169,7 +8180,7 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) { // Cases handled below depend on collected type feedback. They should // soft deoptimize when there is no type feedback. if (combined_type->Is(Type::None())) { - AddSoftDeoptimize(); + Add(Deoptimizer::SOFT); combined_type = left_type = right_type = handle(Type::Any(), isolate()); } @@ -8445,11 +8456,8 @@ HValue* HOptimizedGraphBuilder::BuildEmitObjectHeader( HInstruction* length = Add(length_field); ASSERT(boilerplate_array->length()->IsSmi()); - Representation representation = - IsFastElementsKind(boilerplate_array->GetElementsKind()) - ? Representation::Smi() : Representation::Tagged(); - AddStore(object_header, HObjectAccess::ForArrayLength(), - length, representation); + AddStore(object_header, HObjectAccess::ForArrayLength( + boilerplate_array->GetElementsKind()), length); } return result; @@ -8515,7 +8523,7 @@ void HOptimizedGraphBuilder::BuildEmitInObjectProperties( AddStoreMapConstant(double_box, isolate()->factory()->heap_number_map()); AddStore(double_box, HObjectAccess::ForHeapNumberValue(), - value_instruction, Representation::Double()); + value_instruction); value_instruction = double_box; } @@ -8672,7 +8680,7 @@ void HOptimizedGraphBuilder::VisitVariableDeclaration( HStoreContextSlot* store = Add( context, variable->index(), HStoreContextSlot::kNoCheck, value); if (store->HasObservableSideEffects()) { - AddSimulate(proxy->id(), REMOVABLE_SIMULATE); + Add(proxy->id(), REMOVABLE_SIMULATE); } } break; @@ -8710,7 +8718,7 @@ void HOptimizedGraphBuilder::VisitFunctionDeclaration( HStoreContextSlot* store = Add( context, variable->index(), HStoreContextSlot::kNoCheck, value); if (store->HasObservableSideEffects()) { - AddSimulate(proxy->id(), REMOVABLE_SIMULATE); + Add(proxy->id(), REMOVABLE_SIMULATE); } break; } diff --git a/deps/v8/src/hydrogen.h b/deps/v8/src/hydrogen.h index 797b444..895b984 100644 --- a/deps/v8/src/hydrogen.h +++ b/deps/v8/src/hydrogen.h @@ -69,6 +69,11 @@ class HBasicBlock: public ZoneObject { void set_last(HInstruction* instr) { last_ = instr; } HControlInstruction* end() const { return end_; } HLoopInformation* loop_information() const { return loop_information_; } + HLoopInformation* current_loop() const { + return IsLoopHeader() ? loop_information() + : (parent_loop_header() != NULL + ? parent_loop_header()->loop_information() : NULL); + } const ZoneList* predecessors() const { return &predecessors_; } bool HasPredecessor() const { return predecessors_.length() > 0; } const ZoneList* dominated_blocks() const { @@ -137,17 +142,15 @@ class HBasicBlock: public ZoneObject { } int PredecessorIndexOf(HBasicBlock* predecessor) const; - void AddSimulate(BailoutId ast_id, - RemovableSimulate removable = FIXED_SIMULATE) { - AddInstruction(CreateSimulate(ast_id, removable)); + HSimulate* AddSimulate(BailoutId ast_id, + RemovableSimulate removable = FIXED_SIMULATE) { + HSimulate* instr = CreateSimulate(ast_id, removable); + AddInstruction(instr); + return instr; } void AssignCommonDominator(HBasicBlock* other); void AssignLoopSuccessorDominators(); - void FinishExitWithDeoptimization(HDeoptimize::UseEnvironment has_uses) { - FinishExit(CreateDeoptimize(has_uses)); - } - // Add the inlined function exit sequence, adding an HLeaveInlined // instruction and updating the bailout environment. void AddLeaveInlined(HValue* return_value, FunctionState* state); @@ -182,11 +185,12 @@ class HBasicBlock: public ZoneObject { #endif private: + friend class HGraphBuilder; + void RegisterPredecessor(HBasicBlock* pred); void AddDominatedBlock(HBasicBlock* block); HSimulate* CreateSimulate(BailoutId ast_id, RemovableSimulate removable); - HDeoptimize* CreateDeoptimize(HDeoptimize::UseEnvironment has_uses); int block_id_; HGraph* graph_; @@ -272,6 +276,20 @@ class HLoopInformation: public ZoneObject { stack_check_ = stack_check; } + bool IsNestedInThisLoop(HLoopInformation* other) { + while (other != NULL) { + if (other == this) { + return true; + } + other = other->parent_loop(); + } + return false; + } + HLoopInformation* parent_loop() { + HBasicBlock* parent_header = loop_header()->parent_loop_header(); + return parent_header != NULL ? parent_header->loop_information() : NULL; + } + private: void AddBlock(HBasicBlock* block); @@ -283,6 +301,7 @@ class HLoopInformation: public ZoneObject { class BoundsCheckTable; +class InductionVariableBlocksTable; class HGraph: public ZoneObject { public: explicit HGraph(CompilationInfo* info); @@ -449,6 +468,7 @@ class HGraph: public ZoneObject { void CheckForBackEdge(HBasicBlock* block, HBasicBlock* successor); void SetupInformativeDefinitionsInBlock(HBasicBlock* block); void SetupInformativeDefinitionsRecursively(HBasicBlock* block); + void EliminateRedundantBoundsChecksUsingInductionVariables(); Isolate* isolate_; int next_block_id_; @@ -1023,11 +1043,6 @@ class HGraphBuilder { new(zone()) I(p1, p2, p3, p4, p5, p6, p7, p8))); } - void AddSimulate(BailoutId id, - RemovableSimulate removable = FIXED_SIMULATE); - - HReturn* AddReturn(HValue* value); - void IncrementInNoSideEffectsScope() { no_side_effects_scope_count_++; } @@ -1044,6 +1059,7 @@ class HGraphBuilder { HValue* BuildCheckHeapObject(HValue* object); HValue* BuildCheckMap(HValue* obj, Handle map); + HValue* BuildWrapReceiver(HValue* object, HValue* function); // Building common constructs HValue* BuildCheckForCapacityGrow(HValue* object, @@ -1078,8 +1094,7 @@ class HGraphBuilder { HLoadNamedField* AddLoad( HValue *object, HObjectAccess access, - HValue *typecheck = NULL, - Representation representation = Representation::Tagged()); + HValue *typecheck = NULL); HLoadNamedField* BuildLoadNamedField( HValue* object, @@ -1104,26 +1119,19 @@ class HGraphBuilder { LoadKeyedHoleMode load_mode, KeyedAccessStoreMode store_mode); - HStoreNamedField* AddStore( - HValue *object, - HObjectAccess access, - HValue *val, - Representation representation = Representation::Tagged()); - + HLoadNamedField* BuildLoadNamedField(HValue* object, HObjectAccess access); + HStoreNamedField* AddStore(HValue *object, HObjectAccess access, HValue *val); HStoreNamedField* AddStoreMapConstant(HValue *object, Handle); - HLoadNamedField* AddLoadElements(HValue *object, HValue *typecheck = NULL); - HLoadNamedField* AddLoadFixedArrayLength(HValue *object); HValue* AddLoadJSBuiltin(Builtins::JavaScript builtin, HValue* context); - enum SoftDeoptimizeMode { - MUST_EMIT_SOFT_DEOPT, - CAN_OMIT_SOFT_DEOPT - }; + HValue* TruncateToNumber(HValue* value, Handle* expected); + + void PushAndAdd(HInstruction* instr); - void AddSoftDeoptimize(SoftDeoptimizeMode mode = CAN_OMIT_SOFT_DEOPT); + void FinishExitWithHardDeoptimization(HBasicBlock* continuation); class IfBuilder { public: @@ -1228,7 +1236,6 @@ class HGraphBuilder { void ElseDeopt() { Else(); Deopt(); - End(); } void Return(HValue* value); @@ -1241,6 +1248,8 @@ class HGraphBuilder { HGraphBuilder* builder_; int position_; bool finished_ : 1; + bool deopt_then_ : 1; + bool deopt_else_ : 1; bool did_then_ : 1; bool did_else_ : 1; bool did_and_ : 1; @@ -1373,6 +1382,7 @@ class HGraphBuilder { HInnerAllocatedObject* BuildJSArrayHeader(HValue* array, HValue* array_map, AllocationSiteMode mode, + ElementsKind elements_kind, HValue* allocation_site_payload, HValue* length_field); @@ -1422,12 +1432,68 @@ class HGraphBuilder { private: HGraphBuilder(); + + void PadEnvironmentForContinuation(HBasicBlock* from, + HBasicBlock* continuation); + CompilationInfo* info_; HGraph* graph_; HBasicBlock* current_block_; int no_side_effects_scope_count_; }; + +template<> +inline HDeoptimize* HGraphBuilder::Add(Deoptimizer::BailoutType type) { + if (type == Deoptimizer::SOFT) { + isolate()->counters()->soft_deopts_requested()->Increment(); + if (FLAG_always_opt) return NULL; + } + if (current_block()->IsDeoptimizing()) return NULL; + HDeoptimize* instr = new(zone()) HDeoptimize(type); + AddInstruction(instr); + if (type == Deoptimizer::SOFT) { + isolate()->counters()->soft_deopts_inserted()->Increment(); + graph()->set_has_soft_deoptimize(true); + } + current_block()->MarkAsDeoptimizing(); + return instr; +} + + +template<> +inline HSimulate* HGraphBuilder::Add(BailoutId id, + RemovableSimulate removable) { + HSimulate* instr = current_block()->CreateSimulate(id, removable); + AddInstruction(instr); + return instr; +} + + +template<> +inline HSimulate* HGraphBuilder::Add(BailoutId id) { + return Add(id, FIXED_SIMULATE); +} + + +template<> +inline HReturn* HGraphBuilder::Add(HValue* value) { + HValue* context = environment()->LookupContext(); + int num_parameters = graph()->info()->num_parameters(); + HValue* params = Add(num_parameters); + HReturn* return_instruction = new(graph()->zone()) + HReturn(value, context, params); + current_block()->FinishExit(return_instruction); + return return_instruction; +} + + +template<> +inline HReturn* HGraphBuilder::Add(HConstant* p1) { + return Add(static_cast(p1)); +} + + class HOptimizedGraphBuilder: public HGraphBuilder, public AstVisitor { public: // A class encapsulating (lazily-allocated) break and continue blocks for @@ -1666,8 +1732,6 @@ class HOptimizedGraphBuilder: public HGraphBuilder, public AstVisitor { // Visit a list of expressions from left to right, each in a value context. void VisitExpressions(ZoneList* exprs); - void PushAndAdd(HInstruction* instr); - // Remove the arguments from the bailout environment and emit instructions // to push them as outgoing parameters. template HInstruction* PreProcessCall(Instruction* call); @@ -2021,10 +2085,14 @@ class HTracer: public Malloced { public: explicit HTracer(int isolate_id) : trace_(&string_allocator_), indent_(0) { - OS::SNPrintF(filename_, - "hydrogen-%d-%d.cfg", - OS::GetCurrentProcessId(), - isolate_id); + if (FLAG_trace_hydrogen_file == NULL) { + OS::SNPrintF(filename_, + "hydrogen-%d-%d.cfg", + OS::GetCurrentProcessId(), + isolate_id); + } else { + OS::StrNCpy(filename_, FLAG_trace_hydrogen_file, filename_.length()); + } WriteChars(filename_.start(), "", 0, false); } diff --git a/deps/v8/src/ia32/code-stubs-ia32.cc b/deps/v8/src/ia32/code-stubs-ia32.cc index 548cbaa..5789f49 100644 --- a/deps/v8/src/ia32/code-stubs-ia32.cc +++ b/deps/v8/src/ia32/code-stubs-ia32.cc @@ -43,6 +43,16 @@ namespace v8 { namespace internal { +void ToNumberStub::InitializeInterfaceDescriptor( + Isolate* isolate, + CodeStubInterfaceDescriptor* descriptor) { + static Register registers[] = { eax }; + descriptor->register_param_count_ = 1; + descriptor->register_params_ = registers; + descriptor->deoptimization_handler_ = NULL; +} + + void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( Isolate* isolate, CodeStubInterfaceDescriptor* descriptor) { @@ -300,27 +310,6 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { } -void ToNumberStub::Generate(MacroAssembler* masm) { - // The ToNumber stub takes one argument in eax. - Label check_heap_number, call_builtin; - __ JumpIfNotSmi(eax, &check_heap_number, Label::kNear); - __ ret(0); - - __ bind(&check_heap_number); - __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); - Factory* factory = masm->isolate()->factory(); - __ cmp(ebx, Immediate(factory->heap_number_map())); - __ j(not_equal, &call_builtin, Label::kNear); - __ ret(0); - - __ bind(&call_builtin); - __ pop(ecx); // Pop return address. - __ push(eax); - __ push(ecx); // Push return address. - __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION); -} - - void FastNewClosureStub::Generate(MacroAssembler* masm) { // Create a new closure from the given function info in new // space. Set the context to the current context in esi. diff --git a/deps/v8/src/ia32/deoptimizer-ia32.cc b/deps/v8/src/ia32/deoptimizer-ia32.cc index 505cd4f..4896806 100644 --- a/deps/v8/src/ia32/deoptimizer-ia32.cc +++ b/deps/v8/src/ia32/deoptimizer-ia32.cc @@ -114,22 +114,8 @@ void Deoptimizer::EnsureRelocSpaceForLazyDeoptimization(Handle code) { } -void Deoptimizer::DeoptimizeFunctionWithPreparedFunctionList( - JSFunction* function) { - Isolate* isolate = function->GetIsolate(); - HandleScope scope(isolate); - DisallowHeapAllocation nha; - - ASSERT(function->IsOptimized()); - ASSERT(function->FunctionsInFunctionListShareSameCode()); - - // Get the optimized code. - Code* code = function->code(); +void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) { Address code_start_address = code->instruction_start(); - - // The optimized code is going to be patched, so we cannot use it any more. - function->shared()->EvictFromOptimizedCodeMap(code, "deoptimized function"); - // We will overwrite the code's relocation info in-place. Relocation info // is written backward. The relocation info is the payload of a byte // array. Later on we will slide this to the start of the byte array and @@ -188,25 +174,6 @@ void Deoptimizer::DeoptimizeFunctionWithPreparedFunctionList( ASSERT(junk_address <= reloc_end_address); isolate->heap()->CreateFillerObjectAt(junk_address, reloc_end_address - junk_address); - - // Add the deoptimizing code to the list. - DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code); - DeoptimizerData* data = isolate->deoptimizer_data(); - node->set_next(data->deoptimizing_code_list_); - data->deoptimizing_code_list_ = node; - - // We might be in the middle of incremental marking with compaction. - // Tell collector to treat this code object in a special way and - // ignore all slots that might have been recorded on it. - isolate->heap()->mark_compact_collector()->InvalidateCode(code); - - ReplaceCodeForRelatedFunctions(function, code); - - if (FLAG_trace_deopt) { - PrintF("[forced deoptimization: "); - function->PrintName(); - PrintF(" / %x]\n", reinterpret_cast(function)); - } } @@ -741,6 +708,17 @@ void Deoptimizer::TableEntryGenerator::GeneratePrologue() { __ bind(&done); } + +void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) { + SetFrameSlot(offset, value); +} + + +void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) { + SetFrameSlot(offset, value); +} + + #undef __ diff --git a/deps/v8/src/ia32/full-codegen-ia32.cc b/deps/v8/src/ia32/full-codegen-ia32.cc index 66a7c1c..8f11acc 100644 --- a/deps/v8/src/ia32/full-codegen-ia32.cc +++ b/deps/v8/src/ia32/full-codegen-ia32.cc @@ -4045,7 +4045,7 @@ void FullCodeGenerator::EmitFastAsciiArrayJoin(CallRuntime* expr) { __ movzx_b(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset)); __ and_(scratch, Immediate( kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask)); - __ cmp(scratch, ASCII_STRING_TYPE); + __ cmp(scratch, kStringTag | kOneByteStringTag | kSeqStringTag); __ j(not_equal, &bailout); // Add (separator length times array_length) - separator length diff --git a/deps/v8/src/ia32/lithium-codegen-ia32.cc b/deps/v8/src/ia32/lithium-codegen-ia32.cc index 2c234d8..d022a82 100644 --- a/deps/v8/src/ia32/lithium-codegen-ia32.cc +++ b/deps/v8/src/ia32/lithium-codegen-ia32.cc @@ -656,9 +656,18 @@ XMMRegister LCodeGen::ToDoubleRegister(LOperand* op) const { } -int LCodeGen::ToInteger32(LConstantOperand* op) const { +int32_t LCodeGen::ToInteger32(LConstantOperand* op) const { + return ToRepresentation(op, Representation::Integer32()); +} + + +int32_t LCodeGen::ToRepresentation(LConstantOperand* op, + const Representation& r) const { HConstant* constant = chunk_->LookupConstant(op); - return constant->Integer32Value(); + int32_t value = constant->Integer32Value(); + if (r.IsInteger32()) return value; + ASSERT(r.IsSmiOrTagged()); + return reinterpret_cast(Smi::FromInt(value)); } @@ -1003,12 +1012,6 @@ void LCodeGen::DeoptimizeIf(Condition cc, } -void LCodeGen::SoftDeoptimize(LEnvironment* environment) { - ASSERT(!info()->IsStub()); - DeoptimizeIf(no_condition, environment, Deoptimizer::SOFT); -} - - void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle code) { ZoneList > maps(1, zone()); int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); @@ -1625,6 +1628,9 @@ void LCodeGen::DoMulI(LMulI* instr) { __ imul(left, left, constant); } } else { + if (instr->hydrogen()->representation().IsSmi()) { + __ SmiUntag(left); + } __ imul(left, ToOperand(right)); } @@ -1661,7 +1667,8 @@ void LCodeGen::DoBitI(LBitI* instr) { ASSERT(left->IsRegister()); if (right->IsConstantOperand()) { - int right_operand = ToInteger32(LConstantOperand::cast(right)); + int right_operand = ToRepresentation(LConstantOperand::cast(right), + instr->hydrogen()->representation()); switch (instr->op()) { case Token::BIT_AND: __ and_(ToRegister(left), right_operand); @@ -1772,7 +1779,8 @@ void LCodeGen::DoSubI(LSubI* instr) { ASSERT(left->Equals(instr->result())); if (right->IsConstantOperand()) { - __ sub(ToOperand(left), ToInteger32Immediate(right)); + __ sub(ToOperand(left), + ToImmediate(right, instr->hydrogen()->representation())); } else { __ sub(ToRegister(left), ToOperand(right)); } @@ -1842,11 +1850,7 @@ void LCodeGen::DoConstantT(LConstantT* instr) { Register reg = ToRegister(instr->result()); Handle handle = instr->value(); AllowDeferredHandleDereference smi_check; - if (handle->IsHeapObject()) { - __ LoadHeapObject(reg, Handle::cast(handle)); - } else { - __ Set(reg, Immediate(handle)); - } + __ LoadObject(reg, handle); } @@ -1985,7 +1989,8 @@ void LCodeGen::DoAddI(LAddI* instr) { if (LAddI::UseLea(instr->hydrogen()) && !left->Equals(instr->result())) { if (right->IsConstantOperand()) { - int32_t offset = ToInteger32(LConstantOperand::cast(right)); + int32_t offset = ToRepresentation(LConstantOperand::cast(right), + instr->hydrogen()->representation()); __ lea(ToRegister(instr->result()), MemOperand(ToRegister(left), offset)); } else { Operand address(ToRegister(left), ToRegister(right), times_1, 0); @@ -1993,7 +1998,8 @@ void LCodeGen::DoAddI(LAddI* instr) { } } else { if (right->IsConstantOperand()) { - __ add(ToOperand(left), ToInteger32Immediate(right)); + __ add(ToOperand(left), + ToImmediate(right, instr->hydrogen()->representation())); } else { __ add(ToRegister(left), ToOperand(right)); } @@ -2010,17 +2016,18 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) { LOperand* right = instr->right(); ASSERT(left->Equals(instr->result())); HMathMinMax::Operation operation = instr->hydrogen()->operation(); - if (instr->hydrogen()->representation().IsInteger32()) { + if (instr->hydrogen()->representation().IsSmiOrInteger32()) { Label return_left; Condition condition = (operation == HMathMinMax::kMathMin) ? less_equal : greater_equal; if (right->IsConstantOperand()) { Operand left_op = ToOperand(left); - Immediate right_imm = ToInteger32Immediate(right); - __ cmp(left_op, right_imm); + Immediate immediate = ToImmediate(LConstantOperand::cast(instr->right()), + instr->hydrogen()->representation()); + __ cmp(left_op, immediate); __ j(condition, &return_left, Label::kNear); - __ mov(left_op, right_imm); + __ mov(left_op, immediate); } else { Register left_reg = ToRegister(left); Operand right_op = ToOperand(right); @@ -2388,19 +2395,11 @@ void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) { __ j(parity_even, instr->FalseLabel(chunk_)); } else { if (right->IsConstantOperand()) { - int32_t const_value = ToInteger32(LConstantOperand::cast(right)); - if (instr->hydrogen_value()->representation().IsSmi()) { - __ cmp(ToOperand(left), Immediate(Smi::FromInt(const_value))); - } else { - __ cmp(ToOperand(left), Immediate(const_value)); - } + __ cmp(ToOperand(left), + ToImmediate(right, instr->hydrogen()->representation())); } else if (left->IsConstantOperand()) { - int32_t const_value = ToInteger32(LConstantOperand::cast(left)); - if (instr->hydrogen_value()->representation().IsSmi()) { - __ cmp(ToOperand(right), Immediate(Smi::FromInt(const_value))); - } else { - __ cmp(ToOperand(right), Immediate(const_value)); - } + __ cmp(ToOperand(right), + ToImmediate(left, instr->hydrogen()->representation())); // We transposed the operands. Reverse the condition. cc = ReverseCondition(cc); } else { @@ -2426,14 +2425,6 @@ void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { } -void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { - Register left = ToRegister(instr->left()); - - __ cmp(left, instr->hydrogen()->right()); - EmitBranch(instr, equal); -} - - Condition LCodeGen::EmitIsObject(Register input, Register temp1, Label* is_not_object, @@ -3074,11 +3065,11 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { } -void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, - Register object, - Handle type, - Handle name, - LEnvironment* env) { +void LCodeGen::EmitLoadFieldOrConstant(Register result, + Register object, + Handle type, + Handle name, + LEnvironment* env) { LookupResult lookup(isolate()); type->LookupDescriptor(NULL, *name, &lookup); ASSERT(lookup.IsFound() || lookup.IsCacheable()); @@ -3094,9 +3085,9 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); __ mov(result, FieldOperand(result, offset + FixedArray::kHeaderSize)); } - } else if (lookup.IsConstantFunction()) { - Handle function(lookup.GetConstantFunctionFromMap(*type)); - __ LoadHeapObject(result, function); + } else if (lookup.IsConstant()) { + Handle constant(lookup.GetConstantFromMap(*type), isolate()); + __ LoadObject(result, constant); } else { // Negative lookup. // Check prototypes. @@ -3145,7 +3136,7 @@ static bool CompactEmit(SmallMapList* list, if (map->HasElementsTransition()) return false; LookupResult lookup(isolate); map->LookupDescriptor(NULL, *name, &lookup); - return lookup.IsField() || lookup.IsConstantFunction(); + return lookup.IsField() || lookup.IsConstant(); } @@ -3177,16 +3168,14 @@ void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { if (last && !need_generic) { DeoptimizeIf(not_equal, instr->environment()); __ bind(&check_passed); - EmitLoadFieldOrConstantFunction( - result, object, map, name, instr->environment()); + EmitLoadFieldOrConstant(result, object, map, name, instr->environment()); } else { Label next; bool compact = all_are_compact ? true : CompactEmit(instr->hydrogen()->types(), name, i, isolate()); __ j(not_equal, &next, compact ? Label::kNear : Label::kFar); __ bind(&check_passed); - EmitLoadFieldOrConstantFunction( - result, object, map, name, instr->environment()); + EmitLoadFieldOrConstant(result, object, map, name, instr->environment()); __ jmp(&done, all_are_compact ? Label::kNear : Label::kFar); __ bind(&next); } @@ -3736,38 +3725,30 @@ void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) { factory()->heap_number_map()); DeoptimizeIf(not_equal, instr->environment()); - Label done; + Label slow, allocated, done; Register tmp = input_reg.is(eax) ? ecx : eax; Register tmp2 = tmp.is(ecx) ? edx : input_reg.is(ecx) ? edx : ecx; // Preserve the value of all registers. PushSafepointRegistersScope scope(this); - Label negative; __ mov(tmp, FieldOperand(input_reg, HeapNumber::kExponentOffset)); // Check the sign of the argument. If the argument is positive, just // return it. We do not need to patch the stack since |input| and // |result| are the same register and |input| will be restored // unchanged by popping safepoint registers. __ test(tmp, Immediate(HeapNumber::kSignMask)); - __ j(not_zero, &negative); - __ jmp(&done); + __ j(zero, &done); - __ bind(&negative); - - Label allocated, slow; __ AllocateHeapNumber(tmp, tmp2, no_reg, &slow); - __ jmp(&allocated); + __ jmp(&allocated, Label::kNear); // Slow case: Call the runtime system to do the number allocation. __ bind(&slow); - CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr, instr->context()); - // Set the pointer to the new heap number in tmp. if (!tmp.is(eax)) __ mov(tmp, eax); - // Restore input_reg after call to runtime. __ LoadFromSafepointRegisterSlot(input_reg, input_reg); @@ -3787,9 +3768,8 @@ void LCodeGen::EmitIntegerMathAbs(LMathAbs* instr) { Register input_reg = ToRegister(instr->value()); __ test(input_reg, Operand(input_reg)); Label is_positive; - __ j(not_sign, &is_positive); - __ neg(input_reg); - __ test(input_reg, Operand(input_reg)); + __ j(not_sign, &is_positive, Label::kNear); + __ neg(input_reg); // Sets flags. DeoptimizeIf(negative, instr->environment()); __ bind(&is_positive); } @@ -4454,22 +4434,34 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { } +void LCodeGen::ApplyCheckIf(Condition cc, LBoundsCheck* check) { + if (FLAG_debug_code && check->hydrogen()->skip_check()) { + Label done; + __ j(NegateCondition(cc), &done, Label::kNear); + __ int3(); + __ bind(&done); + } else { + DeoptimizeIf(cc, check->environment()); + } +} + + void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { - if (instr->hydrogen()->skip_check()) return; + if (instr->hydrogen()->skip_check() && !FLAG_debug_code) return; if (instr->index()->IsConstantOperand()) { - int constant_index = - ToInteger32(LConstantOperand::cast(instr->index())); - if (instr->hydrogen()->length()->representation().IsSmi()) { - __ cmp(ToOperand(instr->length()), - Immediate(Smi::FromInt(constant_index))); - } else { - __ cmp(ToOperand(instr->length()), Immediate(constant_index)); - } - DeoptimizeIf(below_equal, instr->environment()); + Immediate immediate = + ToImmediate(LConstantOperand::cast(instr->index()), + instr->hydrogen()->length()->representation()); + __ cmp(ToOperand(instr->length()), immediate); + Condition condition = + instr->hydrogen()->allow_equality() ? below : below_equal; + ApplyCheckIf(condition, instr); } else { __ cmp(ToRegister(instr->index()), ToOperand(instr->length())); - DeoptimizeIf(above_equal, instr->environment()); + Condition condition = + instr->hydrogen()->allow_equality() ? above : above_equal; + ApplyCheckIf(condition, instr); } } @@ -4629,10 +4621,11 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { __ mov(operand, ToRegister(instr->value())); } else { LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); - if (IsInteger32(operand_value)) { - Smi* smi_value = Smi::FromInt(ToInteger32(operand_value)); - __ mov(operand, Immediate(smi_value)); + if (IsSmi(operand_value)) { + Immediate immediate = ToImmediate(operand_value, Representation::Smi()); + __ mov(operand, immediate); } else { + ASSERT(!IsInteger32(operand_value)); Handle handle_value = ToHandle(operand_value); __ mov(operand, handle_value); } @@ -4795,8 +4788,9 @@ void LCodeGen::DoDeferredStringCharCodeAt(LStringCharCodeAt* instr) { // DoStringCharCodeAt above. STATIC_ASSERT(String::kMaxLength <= Smi::kMaxValue); if (instr->index()->IsConstantOperand()) { - int const_index = ToInteger32(LConstantOperand::cast(instr->index())); - __ push(Immediate(Smi::FromInt(const_index))); + Immediate immediate = ToImmediate(LConstantOperand::cast(instr->index()), + Representation::Smi()); + __ push(immediate); } else { Register index = ToRegister(instr->index()); __ SmiTag(index); @@ -5802,6 +5796,7 @@ void LCodeGen::DoCheckMapCommon(Register reg, void LCodeGen::DoCheckMaps(LCheckMaps* instr) { + if (instr->hydrogen()->CanOmitMapChecks()) return; LOperand* input = instr->value(); ASSERT(input->IsRegister()); Register reg = ToRegister(input); @@ -5992,6 +5987,7 @@ void LCodeGen::DoClampTToUint8NoSSE2(LClampTToUint8NoSSE2* instr) { void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { + if (instr->hydrogen()->CanOmitPrototypeChecks()) return; Register reg = ToRegister(instr->temp()); ZoneList >* prototypes = instr->prototypes(); @@ -5999,11 +5995,9 @@ void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { ASSERT(prototypes->length() == maps->length()); - if (!instr->hydrogen()->CanOmitPrototypeChecks()) { - for (int i = 0; i < prototypes->length(); i++) { - __ LoadHeapObject(reg, prototypes->at(i)); - DoCheckMapCommon(reg, maps->at(i), instr); - } + for (int i = 0; i < prototypes->length(); i++) { + __ LoadHeapObject(reg, prototypes->at(i)); + DoCheckMapCommon(reg, maps->at(i), instr); } } @@ -6046,6 +6040,23 @@ void LCodeGen::DoAllocate(LAllocate* instr) { } __ bind(deferred->exit()); + + if (instr->hydrogen()->MustPrefillWithFiller()) { + if (instr->size()->IsConstantOperand()) { + int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); + __ mov(temp, (size / kPointerSize) - 1); + } else { + temp = ToRegister(instr->size()); + __ shr(temp, kPointerSizeLog2); + __ dec(temp); + } + Label loop; + __ bind(&loop); + __ mov(FieldOperand(result, temp, times_pointer_size, 0), + isolate()->factory()->one_pointer_filler_map()); + __ dec(temp); + __ j(not_zero, &loop); + } } @@ -6306,11 +6317,15 @@ void LCodeGen::DoLazyBailout(LLazyBailout* instr) { void LCodeGen::DoDeoptimize(LDeoptimize* instr) { - if (instr->hydrogen_value()->IsSoftDeoptimize()) { - SoftDeoptimize(instr->environment()); - } else { - DeoptimizeIf(no_condition, instr->environment()); - } + Deoptimizer::BailoutType type = instr->hydrogen()->type(); + // TODO(danno): Stubs expect all deopts to be lazy for historical reasons (the + // needed return address), even though the implementation of LAZY and EAGER is + // now identical. When LAZY is eventually completely folded into EAGER, remove + // the special case below. + if (info()->IsStub() && type == Deoptimizer::EAGER) { + type = Deoptimizer::LAZY; + } + DeoptimizeIf(no_condition, instr->environment(), type); } diff --git a/deps/v8/src/ia32/lithium-codegen-ia32.h b/deps/v8/src/ia32/lithium-codegen-ia32.h index eb75225..6574532 100644 --- a/deps/v8/src/ia32/lithium-codegen-ia32.h +++ b/deps/v8/src/ia32/lithium-codegen-ia32.h @@ -109,11 +109,8 @@ class LCodeGen BASE_EMBEDDED { bool IsInteger32(LConstantOperand* op) const; bool IsSmi(LConstantOperand* op) const; - Immediate ToInteger32Immediate(LOperand* op) const { - return Immediate(ToInteger32(LConstantOperand::cast(op))); - } - Immediate ToSmiImmediate(LOperand* op) const { - return Immediate(Smi::FromInt(ToInteger32(LConstantOperand::cast(op)))); + Immediate ToImmediate(LOperand* op, const Representation& r) const { + return Immediate(ToRepresentation(LConstantOperand::cast(op), r)); } double ToDouble(LConstantOperand* op) const; @@ -283,7 +280,7 @@ class LCodeGen BASE_EMBEDDED { LEnvironment* environment, Deoptimizer::BailoutType bailout_type); void DeoptimizeIf(Condition cc, LEnvironment* environment); - void SoftDeoptimize(LEnvironment* environment); + void ApplyCheckIf(Condition cc, LBoundsCheck* check); void AddToTranslation(Translation* translation, LOperand* op, @@ -298,7 +295,8 @@ class LCodeGen BASE_EMBEDDED { Register ToRegister(int index) const; XMMRegister ToDoubleRegister(int index) const; X87Register ToX87Register(int index) const; - int ToInteger32(LConstantOperand* op) const; + int ToRepresentation(LConstantOperand* op, const Representation& r) const; + int32_t ToInteger32(LConstantOperand* op) const; Operand BuildFastArrayOperand(LOperand* elements_pointer, LOperand* key, @@ -371,11 +369,11 @@ class LCodeGen BASE_EMBEDDED { // Caller should branch on equal condition. void EmitIsConstructCall(Register temp); - void EmitLoadFieldOrConstantFunction(Register result, - Register object, - Handle type, - Handle name, - LEnvironment* env); + void EmitLoadFieldOrConstant(Register result, + Register object, + Handle type, + Handle name, + LEnvironment* env); // Emits optimized code to deep-copy the contents of statically known // object graphs (e.g. object literal boilerplate). diff --git a/deps/v8/src/ia32/lithium-gap-resolver-ia32.cc b/deps/v8/src/ia32/lithium-gap-resolver-ia32.cc index e884a9d..b5bc18b 100644 --- a/deps/v8/src/ia32/lithium-gap-resolver-ia32.cc +++ b/deps/v8/src/ia32/lithium-gap-resolver-ia32.cc @@ -306,10 +306,10 @@ void LGapResolver::EmitMove(int index) { LConstantOperand* constant_source = LConstantOperand::cast(source); if (destination->IsRegister()) { Register dst = cgen_->ToRegister(destination); - if (cgen_->IsSmi(constant_source)) { - __ Set(dst, cgen_->ToSmiImmediate(constant_source)); - } else if (cgen_->IsInteger32(constant_source)) { - __ Set(dst, cgen_->ToInteger32Immediate(constant_source)); + Representation r = cgen_->IsSmi(constant_source) + ? Representation::Smi() : Representation::Integer32(); + if (cgen_->IsInteger32(constant_source)) { + __ Set(dst, cgen_->ToImmediate(constant_source, r)); } else { __ LoadObject(dst, cgen_->ToHandle(constant_source)); } @@ -339,10 +339,10 @@ void LGapResolver::EmitMove(int index) { } else { ASSERT(destination->IsStackSlot()); Operand dst = cgen_->ToOperand(destination); - if (cgen_->IsSmi(constant_source)) { - __ Set(dst, cgen_->ToSmiImmediate(constant_source)); - } else if (cgen_->IsInteger32(constant_source)) { - __ Set(dst, cgen_->ToInteger32Immediate(constant_source)); + Representation r = cgen_->IsSmi(constant_source) + ? Representation::Smi() : Representation::Integer32(); + if (cgen_->IsInteger32(constant_source)) { + __ Set(dst, cgen_->ToImmediate(constant_source, r)); } else { Register tmp = EnsureTempRegister(); __ LoadObject(tmp, cgen_->ToHandle(constant_source)); diff --git a/deps/v8/src/ia32/lithium-ia32.cc b/deps/v8/src/ia32/lithium-ia32.cc index aebe26b..f03cd72 100644 --- a/deps/v8/src/ia32/lithium-ia32.cc +++ b/deps/v8/src/ia32/lithium-ia32.cc @@ -754,11 +754,6 @@ LInstruction* LChunkBuilder::DoEnvironmentMarker(HEnvironmentMarker* instr) { } -LInstruction* LChunkBuilder::DoSoftDeoptimize(HSoftDeoptimize* instr) { - return AssignEnvironment(new(zone()) LDeoptimize); -} - - LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) { return AssignEnvironment(new(zone()) LDeoptimize); } @@ -837,8 +832,8 @@ LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, op == Token::SUB); HValue* left = instr->left(); HValue* right = instr->right(); - ASSERT(left->representation().IsSmiOrTagged()); - ASSERT(right->representation().IsSmiOrTagged()); + ASSERT(left->representation().IsTagged()); + ASSERT(right->representation().IsTagged()); LOperand* context = UseFixed(instr->context(), esi); LOperand* left_operand = UseFixed(left, edx); LOperand* right_operand = UseFixed(right, eax); @@ -1404,9 +1399,10 @@ LInstruction* LChunkBuilder::DoShl(HShl* instr) { LInstruction* LChunkBuilder::DoBitwise(HBitwise* instr) { - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().IsSmiOrInteger32()); + ASSERT(instr->right()->representation().Equals( + instr->left()->representation())); LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); @@ -1439,7 +1435,9 @@ LInstruction* LChunkBuilder::DoBitNot(HBitNot* instr) { LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { if (instr->representation().IsDouble()) { return DoArithmeticD(Token::DIV, instr); - } else if (instr->representation().IsInteger32()) { + } else if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); if (instr->HasPowerOf2Divisor()) { ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero)); LOperand* value = UseRegisterAtStart(instr->left()); @@ -1455,7 +1453,7 @@ LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { LDivI* result = new(zone()) LDivI(dividend, divisor, temp); return AssignEnvironment(DefineFixed(result, eax)); } else { - ASSERT(instr->representation().IsSmiOrTagged()); + ASSERT(instr->representation().IsTagged()); return DoArithmeticT(Token::DIV, instr); } } @@ -1521,9 +1519,10 @@ LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) { LInstruction* LChunkBuilder::DoMod(HMod* instr) { HValue* left = instr->left(); HValue* right = instr->right(); - if (instr->representation().IsInteger32()) { - ASSERT(left->representation().IsInteger32()); - ASSERT(right->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(left->representation().IsSmiOrInteger32()); + ASSERT(right->representation().Equals(left->representation())); + if (instr->HasPowerOf2Divisor()) { ASSERT(!right->CanBeZero()); LModI* mod = new(zone()) LModI(UseRegisterAtStart(left), @@ -1572,9 +1571,9 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) { LInstruction* LChunkBuilder::DoMul(HMul* instr) { - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); LOperand* right = UseOrConstant(instr->BetterRightOperand()); LOperand* temp = NULL; @@ -1590,16 +1589,17 @@ LInstruction* LChunkBuilder::DoMul(HMul* instr) { } else if (instr->representation().IsDouble()) { return DoArithmeticD(Token::MUL, instr); } else { - ASSERT(instr->representation().IsSmiOrTagged()); + ASSERT(instr->representation().IsTagged()); return DoArithmeticT(Token::MUL, instr); } } LInstruction* LChunkBuilder::DoSub(HSub* instr) { - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().IsSmiOrInteger32()); + ASSERT(instr->right()->representation().Equals( + instr->left()->representation())); LOperand* left = UseRegisterAtStart(instr->left()); LOperand* right = UseOrConstantAtStart(instr->right()); LSubI* sub = new(zone()) LSubI(left, right); @@ -1618,14 +1618,15 @@ LInstruction* LChunkBuilder::DoSub(HSub* instr) { LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { - if (instr->representation().IsInteger32()) { + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().IsSmiOrInteger32()); + ASSERT(instr->right()->representation().Equals( + instr->left()->representation())); // Check to see if it would be advantageous to use an lea instruction rather // than an add. This is the case when no overflow check is needed and there // are multiple uses of the add's inputs, so using a 3-register add will // preserve all input values for later uses. bool use_lea = LAddI::UseLea(instr); - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); HValue* right_candidate = instr->BetterRightOperand(); LOperand* right = use_lea @@ -1652,9 +1653,10 @@ LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { LOperand* left = NULL; LOperand* right = NULL; - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().IsSmiOrInteger32()); + ASSERT(instr->right()->representation().Equals( + instr->left()->representation())); left = UseRegisterAtStart(instr->BetterLeftOperand()); right = UseOrConstantAtStart(instr->BetterRightOperand()); } else { @@ -1741,13 +1743,6 @@ LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( } -LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch( - HCompareConstantEqAndBranch* instr) { - return new(zone()) LCmpConstantEqAndBranch( - UseRegisterAtStart(instr->value())); -} - - LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { ASSERT(instr->value()->representation().IsSmiOrTagged()); LOperand* temp = TempRegister(); @@ -2063,8 +2058,10 @@ LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { - LUnallocated* temp = TempRegister(); + LUnallocated* temp = NULL; + if (!instr->CanOmitPrototypeChecks()) temp = TempRegister(); LCheckPrototypeMaps* result = new(zone()) LCheckPrototypeMaps(temp); + if (instr->CanOmitPrototypeChecks()) return result; return AssignEnvironment(result); } @@ -2081,8 +2078,10 @@ LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) { LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { - LOperand* value = UseRegisterAtStart(instr->value()); + LOperand* value = NULL; + if (!instr->CanOmitMapChecks()) value = UseRegisterAtStart(instr->value()); LCheckMaps* result = new(zone()) LCheckMaps(value); + if (instr->CanOmitMapChecks()) return result; return AssignEnvironment(result); } @@ -2261,8 +2260,7 @@ LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { - ASSERT(instr->key()->representation().IsInteger32() || - instr->key()->representation().IsSmi()); + ASSERT(instr->key()->representation().IsSmiOrInteger32()); ElementsKind elements_kind = instr->elements_kind(); bool clobbers_key = ExternalArrayOpRequiresTemp( instr->key()->representation(), elements_kind); diff --git a/deps/v8/src/ia32/lithium-ia32.h b/deps/v8/src/ia32/lithium-ia32.h index a938ee5..85c0468 100644 --- a/deps/v8/src/ia32/lithium-ia32.h +++ b/deps/v8/src/ia32/lithium-ia32.h @@ -66,6 +66,7 @@ class LCodeGen; V(CheckFunction) \ V(CheckInstanceType) \ V(CheckMaps) \ + V(CheckMapValue) \ V(CheckNonSmi) \ V(CheckPrototypeMaps) \ V(CheckSmi) \ @@ -78,20 +79,23 @@ class LCodeGen; V(CmpObjectEqAndBranch) \ V(CmpMapAndBranch) \ V(CmpT) \ - V(CmpConstantEqAndBranch) \ V(ConstantD) \ V(ConstantI) \ V(ConstantS) \ V(ConstantT) \ V(Context) \ + V(DateField) \ V(DebugBreak) \ V(DeclareGlobals) \ V(Deoptimize) \ V(DivI) \ V(DoubleToI) \ V(DoubleToSmi) \ + V(Drop) \ V(DummyUse) \ V(ElementsKind) \ + V(ForInCacheArray) \ + V(ForInPrepareMap) \ V(FunctionLiteral) \ V(GetCachedArrayIndex) \ V(GlobalObject) \ @@ -99,13 +103,13 @@ class LCodeGen; V(Goto) \ V(HasCachedArrayIndexAndBranch) \ V(HasInstanceTypeAndBranch) \ + V(InnerAllocatedObject) \ V(InstanceOf) \ V(InstanceOfKnownGlobal) \ V(InstanceSize) \ V(InstructionGap) \ V(Integer32ToDouble) \ V(Integer32ToSmi) \ - V(Uint32ToDouble) \ V(InvokeFunction) \ V(IsConstructCallAndBranch) \ V(IsObjectAndBranch) \ @@ -118,6 +122,7 @@ class LCodeGen; V(LinkObjectInList) \ V(LoadContextSlot) \ V(LoadExternalArrayPointer) \ + V(LoadFieldByIndex) \ V(LoadFunctionPrototype) \ V(LoadGlobalCell) \ V(LoadGlobalGeneric) \ @@ -180,16 +185,10 @@ class LCodeGen; V(TrapAllocationMemento) \ V(Typeof) \ V(TypeofIsAndBranch) \ + V(Uint32ToDouble) \ V(UnknownOSRValue) \ V(ValueOf) \ - V(ForInPrepareMap) \ - V(ForInCacheArray) \ - V(CheckMapValue) \ - V(LoadFieldByIndex) \ - V(DateField) \ - V(WrapReceiver) \ - V(Drop) \ - V(InnerAllocatedObject) + V(WrapReceiver) #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ @@ -424,6 +423,7 @@ class LDummyUse: public LTemplateInstruction<1, 1, 0> { class LDeoptimize: public LTemplateInstruction<0, 0, 0> { public: DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") + DECLARE_HYDROGEN_ACCESSOR(Deoptimize) }; @@ -857,20 +857,6 @@ class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> { }; -class LCmpConstantEqAndBranch: public LControlInstruction<1, 0> { - public: - explicit LCmpConstantEqAndBranch(LOperand* left) { - inputs_[0] = left; - } - - LOperand* left() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(CmpConstantEqAndBranch, - "cmp-constant-eq-and-branch") - DECLARE_HYDROGEN_ACCESSOR(CompareConstantEqAndBranch) -}; - - class LIsObjectAndBranch: public LControlInstruction<1, 1> { public: LIsObjectAndBranch(LOperand* value, LOperand* temp) { diff --git a/deps/v8/src/ia32/macro-assembler-ia32.cc b/deps/v8/src/ia32/macro-assembler-ia32.cc index ef90c10..2ab5a25 100644 --- a/deps/v8/src/ia32/macro-assembler-ia32.cc +++ b/deps/v8/src/ia32/macro-assembler-ia32.cc @@ -1248,6 +1248,7 @@ void MacroAssembler::Allocate(int object_size, Label* gc_required, AllocationFlags flags) { ASSERT((flags & (RESULT_CONTAINS_TOP | SIZE_IN_WORDS)) == 0); + ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize); if (!FLAG_inline_new) { if (emit_debug_code()) { // Trash the registers to simulate an allocation failure. @@ -2798,7 +2799,8 @@ void MacroAssembler::JumpIfNotBothSequentialAsciiStrings(Register object1, // Check that both are flat ASCII strings. const int kFlatAsciiStringMask = kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; - const int kFlatAsciiStringTag = ASCII_STRING_TYPE; + const int kFlatAsciiStringTag = + kStringTag | kOneByteStringTag | kSeqStringTag; // Interleave bits from both instance types and compare them in one check. ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3)); and_(scratch1, kFlatAsciiStringMask); diff --git a/deps/v8/src/ia32/stub-cache-ia32.cc b/deps/v8/src/ia32/stub-cache-ia32.cc index 2b391e0..123506f 100644 --- a/deps/v8/src/ia32/stub-cache-ia32.cc +++ b/deps/v8/src/ia32/stub-cache-ia32.cc @@ -816,11 +816,9 @@ void BaseStoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, Representation representation = details.representation(); ASSERT(!representation.IsNone()); - if (details.type() == CONSTANT_FUNCTION) { - Handle constant( - HeapObject::cast(descriptors->GetValue(descriptor))); - __ LoadHeapObject(scratch1, constant); - __ cmp(value_reg, scratch1); + if (details.type() == CONSTANT) { + Handle constant(descriptors->GetValue(descriptor), masm->isolate()); + __ CmpObject(value_reg, constant); __ j(not_equal, miss_label); } else if (FLAG_track_fields && representation.IsSmi()) { __ JumpIfNotSmi(value_reg, miss_label); @@ -897,7 +895,7 @@ void BaseStoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); - if (details.type() == CONSTANT_FUNCTION) { + if (details.type() == CONSTANT) { ASSERT(value_reg.is(eax)); __ ret(0); return; @@ -1428,9 +1426,9 @@ void BaseLoadStubCompiler::GenerateLoadCallback( } -void BaseLoadStubCompiler::GenerateLoadConstant(Handle value) { +void BaseLoadStubCompiler::GenerateLoadConstant(Handle value) { // Return the constant value. - __ LoadHeapObject(eax, value); + __ LoadObject(eax, value); __ ret(0); } @@ -2727,7 +2725,7 @@ Handle CallStubCompiler::CompileCallConstant( Handle code = CompileCustomCall(object, holder, Handle::null(), function, Handle::cast(name), - Code::CONSTANT_FUNCTION); + Code::CONSTANT); // A null handle means bail out to the regular compiler code below. if (!code.is_null()) return code; } diff --git a/deps/v8/src/ic.cc b/deps/v8/src/ic.cc index f0f5c30..269754b 100644 --- a/deps/v8/src/ic.cc +++ b/deps/v8/src/ic.cc @@ -634,7 +634,7 @@ bool CallICBase::TryUpdateExtraICState(LookupResult* lookup, Handle object, Code::ExtraICState* extra_ic_state) { ASSERT(kind_ == Code::CALL_IC); - if (lookup->type() != CONSTANT_FUNCTION) return false; + if (!lookup->IsConstantFunction()) return false; JSFunction* function = lookup->GetConstantFunction(); if (!function->shared()->HasBuiltinFunctionId()) return false; @@ -687,7 +687,8 @@ Handle CallICBase::ComputeMonomorphicStub(LookupResult* lookup, return isolate()->stub_cache()->ComputeCallField( argc, kind_, extra_state, name, object, holder, index); } - case CONSTANT_FUNCTION: { + case CONSTANT: { + if (!lookup->IsConstantFunction()) return Handle::null(); // Get the constant function and compute the code stub for this // call; used for rewriting to monomorphic state and making sure // that the code stub is in the stub cache. @@ -1312,8 +1313,11 @@ Handle LoadIC::ComputeLoadHandler(LookupResult* lookup, return isolate()->stub_cache()->ComputeLoadField( name, receiver, holder, lookup->GetFieldIndex(), lookup->representation()); - case CONSTANT_FUNCTION: { - Handle constant(lookup->GetConstantFunction()); + case CONSTANT: { + Handle constant(lookup->GetConstant(), isolate()); + // TODO(2803): Don't compute a stub for cons strings because they cannot + // be embedded into code. + if (constant->IsConsString()) return Handle::null(); return isolate()->stub_cache()->ComputeLoadConstant( name, receiver, holder, constant); } @@ -1522,8 +1526,11 @@ Handle KeyedLoadIC::ComputeLoadHandler(LookupResult* lookup, return isolate()->stub_cache()->ComputeKeyedLoadField( name, receiver, holder, lookup->GetFieldIndex(), lookup->representation()); - case CONSTANT_FUNCTION: { - Handle constant(lookup->GetConstantFunction(), isolate()); + case CONSTANT: { + Handle constant(lookup->GetConstant(), isolate()); + // TODO(2803): Don't compute a stub for cons strings because they cannot + // be embedded into code. + if (constant->IsConsString()) return Handle::null(); return isolate()->stub_cache()->ComputeKeyedLoadConstant( name, receiver, holder, constant); } @@ -1798,7 +1805,7 @@ Handle StoreIC::ComputeStoreMonomorphic(LookupResult* lookup, ASSERT(!receiver->GetNamedInterceptor()->setter()->IsUndefined()); return isolate()->stub_cache()->ComputeStoreInterceptor( name, receiver, strict_mode); - case CONSTANT_FUNCTION: + case CONSTANT: break; case TRANSITION: { // Explicitly pass in the receiver map since LookupForWrite may have @@ -2184,7 +2191,7 @@ Handle KeyedStoreIC::ComputeStoreMonomorphic(LookupResult* lookup, // fall through. } case NORMAL: - case CONSTANT_FUNCTION: + case CONSTANT: case CALLBACKS: case INTERCEPTOR: // Always rewrite to the generic case so that we do not diff --git a/deps/v8/src/isolate.cc b/deps/v8/src/isolate.cc index 4adcd69..ccd6f28 100644 --- a/deps/v8/src/isolate.cc +++ b/deps/v8/src/isolate.cc @@ -95,7 +95,7 @@ void ThreadLocalTop::InitializeInternal() { simulator_ = NULL; #endif js_entry_sp_ = NULL; - external_callback_ = NULL; + external_callback_scope_ = NULL; current_vm_state_ = EXTERNAL; try_catch_handler_address_ = NULL; context_ = NULL; @@ -1777,7 +1777,6 @@ Isolate::Isolate() regexp_stack_(NULL), date_cache_(NULL), code_stub_interface_descriptors_(NULL), - context_exit_happened_(false), initialized_from_snapshot_(false), cpu_profiler_(NULL), heap_profiler_(NULL), diff --git a/deps/v8/src/isolate.h b/deps/v8/src/isolate.h index 6e5d5c6..0652770 100644 --- a/deps/v8/src/isolate.h +++ b/deps/v8/src/isolate.h @@ -65,6 +65,7 @@ class CpuProfiler; class DeoptimizerData; class Deserializer; class EmptyStatement; +class ExternalCallbackScope; class ExternalReferenceTable; class Factory; class FunctionInfoListener; @@ -279,7 +280,8 @@ class ThreadLocalTop BASE_EMBEDDED { #endif // USE_SIMULATOR Address js_entry_sp_; // the stack pointer of the bottom JS entry frame - Address external_callback_; // the external callback we're currently in + // the external callback we're currently in + ExternalCallbackScope* external_callback_scope_; StateTag current_vm_state_; // Generated code scratch locations. @@ -1032,11 +1034,11 @@ class Isolate { static const int kJSRegexpStaticOffsetsVectorSize = 128; - Address external_callback() { - return thread_local_top_.external_callback_; + ExternalCallbackScope* external_callback_scope() { + return thread_local_top_.external_callback_scope_; } - void set_external_callback(Address callback) { - thread_local_top_.external_callback_ = callback; + void set_external_callback_scope(ExternalCallbackScope* scope) { + thread_local_top_.external_callback_scope_ = scope; } StateTag current_vm_state() { @@ -1057,13 +1059,6 @@ class Isolate { thread_local_top_.top_lookup_result_ = top; } - bool context_exit_happened() { - return context_exit_happened_; - } - void set_context_exit_happened(bool context_exit_happened) { - context_exit_happened_ = context_exit_happened; - } - bool initialized_from_snapshot() { return initialized_from_snapshot_; } double time_millis_since_init() { @@ -1311,10 +1306,6 @@ class Isolate { unibrow::Mapping interp_canonicalize_mapping_; CodeStubInterfaceDescriptor* code_stub_interface_descriptors_; - // The garbage collector should be a little more aggressive when it knows - // that a context was recently exited. - bool context_exit_happened_; - // True if this isolate was initialized from a snapshot. bool initialized_from_snapshot_; diff --git a/deps/v8/src/lithium.cc b/deps/v8/src/lithium.cc index 3df8d6c..e9c3531 100644 --- a/deps/v8/src/lithium.cc +++ b/deps/v8/src/lithium.cc @@ -270,7 +270,7 @@ int StackSlotOffset(int index) { return -(index + 3) * kPointerSize; } else { // Incoming parameter. Skip the return address. - return -(index - 1) * kPointerSize; + return -(index + 1) * kPointerSize + kFPOnStackSize + kPCOnStackSize; } } diff --git a/deps/v8/src/liveedit.cc b/deps/v8/src/liveedit.cc index bab2e10..b998a26 100644 --- a/deps/v8/src/liveedit.cc +++ b/deps/v8/src/liveedit.cc @@ -1290,6 +1290,7 @@ MaybeObject* LiveEdit::ReplaceFunctionCode( if (code_scope_info->IsFixedArray()) { shared_info->set_scope_info(ScopeInfo::cast(*code_scope_info)); } + shared_info->DisableOptimization("LiveEdit"); } if (shared_info->debug_info()->IsDebugInfo()) { diff --git a/deps/v8/src/log.cc b/deps/v8/src/log.cc index d26279b..520723e 100644 --- a/deps/v8/src/log.cc +++ b/deps/v8/src/log.cc @@ -54,6 +54,14 @@ static const char* const kLogEventsNames[Logger::NUMBER_OF_LOG_EVENTS] = { #undef DECLARE_EVENT +#define PROFILER_LOG(Call) \ + do { \ + CpuProfiler* cpu_profiler = isolate_->cpu_profiler(); \ + if (cpu_profiler->is_profiling()) { \ + cpu_profiler->Call; \ + } \ + } while (false); + // ComputeMarker must only be used when SharedFunctionInfo is known. static const char* ComputeMarker(Code* code) { switch (code->kind()) { @@ -543,7 +551,7 @@ class JitLogger : public CodeEventLogger { public: explicit JitLogger(JitCodeEventHandler code_event_handler); - void CodeMovedEvent(Address from, Address to); + void CodeMoveEvent(Address from, Address to); void CodeDeleteEvent(Address from); void AddCodeLinePosInfoEvent( void* jit_handler_data, @@ -588,7 +596,7 @@ void JitLogger::LogRecordedBuffer(Code* code, } -void JitLogger::CodeMovedEvent(Address from, Address to) { +void JitLogger::CodeMoveEvent(Address from, Address to) { Code* from_code = Code::cast(HeapObject::FromAddress(from)); JitCodeEvent event; @@ -1209,7 +1217,7 @@ void Logger::DeleteEventStatic(const char* name, void* object) { void Logger::CallbackEventInternal(const char* prefix, Name* name, Address entry_point) { - if (!log_->IsEnabled() || !FLAG_log_code) return; + if (!FLAG_log_code || !log_->IsEnabled()) return; Log::MessageBuilder msg(log_); msg.Append("%s,%s,-2,", kLogEventsNames[CODE_CREATION_EVENT], @@ -1235,19 +1243,19 @@ void Logger::CallbackEventInternal(const char* prefix, Name* name, void Logger::CallbackEvent(Name* name, Address entry_point) { - if (!log_->IsEnabled() || !FLAG_log_code) return; + PROFILER_LOG(CallbackEvent(name, entry_point)); CallbackEventInternal("", name, entry_point); } void Logger::GetterCallbackEvent(Name* name, Address entry_point) { - if (!log_->IsEnabled() || !FLAG_log_code) return; + PROFILER_LOG(GetterCallbackEvent(name, entry_point)); CallbackEventInternal("get ", name, entry_point); } void Logger::SetterCallbackEvent(Name* name, Address entry_point) { - if (!log_->IsEnabled() || !FLAG_log_code) return; + PROFILER_LOG(SetterCallbackEvent(name, entry_point)); CallbackEventInternal("set ", name, entry_point); } @@ -1268,8 +1276,9 @@ static void AppendCodeCreateHeader(Log::MessageBuilder* msg, void Logger::CodeCreateEvent(LogEventsAndTags tag, Code* code, const char* comment) { - if (!is_logging_code_events()) return; + PROFILER_LOG(CodeCreateEvent(tag, code, comment)); + if (!is_logging_code_events()) return; JIT_LOG(CodeCreateEvent(tag, code, comment)); LL_LOG(CodeCreateEvent(tag, code, comment)); CODE_ADDRESS_MAP_LOG(CodeCreateEvent(tag, code, comment)); @@ -1286,8 +1295,9 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag, void Logger::CodeCreateEvent(LogEventsAndTags tag, Code* code, Name* name) { - if (!is_logging_code_events()) return; + PROFILER_LOG(CodeCreateEvent(tag, code, name)); + if (!is_logging_code_events()) return; JIT_LOG(CodeCreateEvent(tag, code, name)); LL_LOG(CodeCreateEvent(tag, code, name)); CODE_ADDRESS_MAP_LOG(CodeCreateEvent(tag, code, name)); @@ -1312,8 +1322,9 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag, SharedFunctionInfo* shared, CompilationInfo* info, Name* name) { - if (!is_logging_code_events()) return; + PROFILER_LOG(CodeCreateEvent(tag, code, shared, info, name)); + if (!is_logging_code_events()) return; JIT_LOG(CodeCreateEvent(tag, code, shared, info, name)); LL_LOG(CodeCreateEvent(tag, code, shared, info, name)); CODE_ADDRESS_MAP_LOG(CodeCreateEvent(tag, code, shared, info, name)); @@ -1348,8 +1359,9 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag, SharedFunctionInfo* shared, CompilationInfo* info, Name* source, int line) { - if (!is_logging_code_events()) return; + PROFILER_LOG(CodeCreateEvent(tag, code, shared, info, source, line)); + if (!is_logging_code_events()) return; JIT_LOG(CodeCreateEvent(tag, code, shared, info, source, line)); LL_LOG(CodeCreateEvent(tag, code, shared, info, source, line)); CODE_ADDRESS_MAP_LOG(CodeCreateEvent(tag, code, shared, info, source, line)); @@ -1378,8 +1390,9 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag, void Logger::CodeCreateEvent(LogEventsAndTags tag, Code* code, int args_count) { - if (!is_logging_code_events()) return; + PROFILER_LOG(CodeCreateEvent(tag, code, args_count)); + if (!is_logging_code_events()) return; JIT_LOG(CodeCreateEvent(tag, code, args_count)); LL_LOG(CodeCreateEvent(tag, code, args_count)); CODE_ADDRESS_MAP_LOG(CodeCreateEvent(tag, code, args_count)); @@ -1394,6 +1407,9 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag, void Logger::CodeMovingGCEvent() { + PROFILER_LOG(CodeMovingGCEvent()); + + if (!is_logging_code_events()) return; if (!log_->IsEnabled() || !FLAG_ll_prof) return; LL_LOG(CodeMovingGCEvent()); OS::SignalCodeMovingGC(); @@ -1401,8 +1417,9 @@ void Logger::CodeMovingGCEvent() { void Logger::RegExpCodeCreateEvent(Code* code, String* source) { - if (!is_logging_code_events()) return; + PROFILER_LOG(RegExpCodeCreateEvent(code, source)); + if (!is_logging_code_events()) return; JIT_LOG(RegExpCodeCreateEvent(code, source)); LL_LOG(RegExpCodeCreateEvent(code, source)); CODE_ADDRESS_MAP_LOG(RegExpCodeCreateEvent(code, source)); @@ -1419,8 +1436,10 @@ void Logger::RegExpCodeCreateEvent(Code* code, String* source) { void Logger::CodeMoveEvent(Address from, Address to) { - JIT_LOG(CodeMovedEvent(from, to)); - if (!log_->IsEnabled()) return; + PROFILER_LOG(CodeMoveEvent(from, to)); + + if (!is_logging_code_events()) return; + JIT_LOG(CodeMoveEvent(from, to)); LL_LOG(CodeMoveEvent(from, to)); CODE_ADDRESS_MAP_LOG(CodeMoveEvent(from, to)); MoveEventInternal(CODE_MOVE_EVENT, from, to); @@ -1428,12 +1447,14 @@ void Logger::CodeMoveEvent(Address from, Address to) { void Logger::CodeDeleteEvent(Address from) { + PROFILER_LOG(CodeDeleteEvent(from)); + + if (!is_logging_code_events()) return; JIT_LOG(CodeDeleteEvent(from)); - if (!log_->IsEnabled()) return; LL_LOG(CodeDeleteEvent(from)); CODE_ADDRESS_MAP_LOG(CodeDeleteEvent(from)); - if (!log_->IsEnabled() || !FLAG_log_code) return; + if (!FLAG_log_code || !log_->IsEnabled()) return; Log::MessageBuilder msg(log_); msg.Append("%s,", kLogEventsNames[CODE_DELETE_EVENT]); msg.AppendAddress(from); @@ -1498,6 +1519,9 @@ void Logger::SnapshotPositionEvent(Address addr, int pos) { void Logger::SharedFunctionInfoMoveEvent(Address from, Address to) { + PROFILER_LOG(SharedFunctionInfoMoveEvent(from, to)); + + if (!is_logging_code_events()) return; MoveEventInternal(SHARED_FUNC_MOVE_EVENT, from, to); } @@ -1505,7 +1529,7 @@ void Logger::SharedFunctionInfoMoveEvent(Address from, Address to) { void Logger::MoveEventInternal(LogEventsAndTags event, Address from, Address to) { - if (!log_->IsEnabled() || !FLAG_log_code) return; + if (!FLAG_log_code || !log_->IsEnabled()) return; Log::MessageBuilder msg(log_); msg.Append("%s,", kLogEventsNames[event]); msg.AppendAddress(from); diff --git a/deps/v8/src/mark-compact.cc b/deps/v8/src/mark-compact.cc index 95f673c..59492e1 100644 --- a/deps/v8/src/mark-compact.cc +++ b/deps/v8/src/mark-compact.cc @@ -73,8 +73,8 @@ MarkCompactCollector::MarkCompactCollector() : // NOLINT migration_slots_buffer_(NULL), heap_(NULL), code_flusher_(NULL), - encountered_weak_collections_(NULL) { } - + encountered_weak_collections_(NULL), + code_to_deoptimize_(NULL) { } #ifdef VERIFY_HEAP class VerifyMarkingVisitor: public ObjectVisitor { @@ -492,7 +492,7 @@ void MarkCompactCollector::VerifyWeakEmbeddedMapsInOptimizedCode() { obj = code_iterator.Next()) { Code* code = Code::cast(obj); if (code->kind() != Code::OPTIMIZED_FUNCTION) continue; - if (code->marked_for_deoptimization()) continue; + if (WillBeDeoptimized(code)) continue; code->VerifyEmbeddedMapsDependency(); } } @@ -945,14 +945,6 @@ void MarkCompactCollector::Prepare(GCTracer* tracer) { } -class DeoptimizeMarkedCodeFilter : public OptimizedFunctionFilter { - public: - virtual bool TakeFunction(JSFunction* function) { - return function->code()->marked_for_deoptimization(); - } -}; - - void MarkCompactCollector::Finish() { #ifdef DEBUG ASSERT(state_ == SWEEP_SPACES || state_ == RELOCATE_OBJECTS); @@ -964,8 +956,23 @@ void MarkCompactCollector::Finish() { // objects (empty string, illegal builtin). isolate()->stub_cache()->Clear(); - DeoptimizeMarkedCodeFilter filter; - Deoptimizer::DeoptimizeAllFunctionsWith(isolate(), &filter); + if (code_to_deoptimize_ != Smi::FromInt(0)) { + // Convert the linked list of Code objects into a ZoneList. + Zone zone(isolate()); + ZoneList codes(4, &zone); + + Object *list = code_to_deoptimize_; + while (list->IsCode()) { + Code *code = Code::cast(list); + list = code->code_to_deoptimize_link(); + codes.Add(code, &zone); + // Destroy the link and don't ever try to deoptimize this code again. + code->set_code_to_deoptimize_link(Smi::FromInt(0)); + } + code_to_deoptimize_ = Smi::FromInt(0); + + Deoptimizer::DeoptimizeCodeList(isolate(), &codes); + } } @@ -2396,7 +2403,6 @@ void MarkCompactCollector::AfterMarking() { string_table->ElementsRemoved(v.PointersRemoved()); heap()->external_string_table_.Iterate(&v); heap()->external_string_table_.CleanUp(); - heap()->error_object_list_.RemoveUnmarked(heap()); // Process the weak references. MarkCompactWeakObjectRetainer mark_compact_object_retainer; @@ -2611,8 +2617,17 @@ void MarkCompactCollector::ClearAndDeoptimizeDependentCode(Map* map) { // and ClearAndDeoptimizeDependentCode shouldn't be called. ASSERT(entries->is_code_at(i)); Code* code = entries->code_at(i); - if (IsMarked(code) && !code->marked_for_deoptimization()) { - code->set_marked_for_deoptimization(true); + + if (IsMarked(code) && !WillBeDeoptimized(code)) { + // Insert the code into the code_to_deoptimize linked list. + Object* next = code_to_deoptimize_; + if (next != Smi::FromInt(0)) { + // Record the slot so that it is updated. + Object** slot = code->code_to_deoptimize_link_slot(); + RecordSlot(slot, slot, next); + } + code->set_code_to_deoptimize_link(next); + code_to_deoptimize_ = code; } entries->clear_at(i); } @@ -2633,7 +2648,7 @@ void MarkCompactCollector::ClearNonLiveDependentCode(DependentCode* entries) { Object* obj = entries->object_at(i); ASSERT(obj->IsCode() || IsMarked(obj)); if (IsMarked(obj) && - (!obj->IsCode() || !Code::cast(obj)->marked_for_deoptimization())) { + (!obj->IsCode() || !WillBeDeoptimized(Code::cast(obj)))) { if (new_number_of_entries + group_number_of_entries != i) { entries->set_object_at( new_number_of_entries + group_number_of_entries, obj); @@ -2723,7 +2738,13 @@ void MarkCompactCollector::MigrateObject(Address dst, int size, AllocationSpace dest) { HEAP_PROFILE(heap(), ObjectMoveEvent(src, dst)); - if (dest == OLD_POINTER_SPACE || dest == LO_SPACE) { + // TODO(hpayer): Replace that check with an assert. + CHECK(dest != LO_SPACE && size <= Page::kMaxNonCodeHeapObjectSize); + if (dest == OLD_POINTER_SPACE) { + // TODO(hpayer): Replace this check with an assert. + HeapObject* heap_object = HeapObject::FromAddress(src); + CHECK(heap_object->IsExternalString() || + heap_->TargetSpace(heap_object) == heap_->old_pointer_space()); Address src_slot = src; Address dst_slot = dst; ASSERT(IsAligned(size, kPointerSize)); @@ -2769,6 +2790,13 @@ void MarkCompactCollector::MigrateObject(Address dst, Code::cast(HeapObject::FromAddress(dst))->Relocate(dst - src); } else { ASSERT(dest == OLD_DATA_SPACE || dest == NEW_SPACE); + // Objects in old data space can just be moved by compaction to a different + // page in old data space. + // TODO(hpayer): Replace the following check with an assert. + CHECK(!heap_->old_data_space()->Contains(src) || + (heap_->old_data_space()->Contains(dst) && + heap_->TargetSpace(HeapObject::FromAddress(src)) == + heap_->old_data_space())); heap()->MoveBlock(dst, src, size); } Memory::Address_at(src) = dst; @@ -2895,37 +2923,24 @@ static String* UpdateReferenceInExternalStringTableEntry(Heap* heap, bool MarkCompactCollector::TryPromoteObject(HeapObject* object, int object_size) { - Object* result; + // TODO(hpayer): Replace that check with an assert. + CHECK(object_size <= Page::kMaxNonCodeHeapObjectSize); - if (object_size > Page::kMaxNonCodeHeapObjectSize) { - MaybeObject* maybe_result = - heap()->lo_space()->AllocateRaw(object_size, NOT_EXECUTABLE); - if (maybe_result->ToObject(&result)) { - HeapObject* target = HeapObject::cast(result); - MigrateObject(target->address(), - object->address(), - object_size, - LO_SPACE); - heap()->mark_compact_collector()->tracer()-> - increment_promoted_objects_size(object_size); - return true; - } - } else { - OldSpace* target_space = heap()->TargetSpace(object); - - ASSERT(target_space == heap()->old_pointer_space() || - target_space == heap()->old_data_space()); - MaybeObject* maybe_result = target_space->AllocateRaw(object_size); - if (maybe_result->ToObject(&result)) { - HeapObject* target = HeapObject::cast(result); - MigrateObject(target->address(), - object->address(), - object_size, - target_space->identity()); - heap()->mark_compact_collector()->tracer()-> - increment_promoted_objects_size(object_size); - return true; - } + OldSpace* target_space = heap()->TargetSpace(object); + + ASSERT(target_space == heap()->old_pointer_space() || + target_space == heap()->old_data_space()); + Object* result; + MaybeObject* maybe_result = target_space->AllocateRaw(object_size); + if (maybe_result->ToObject(&result)) { + HeapObject* target = HeapObject::cast(result); + MigrateObject(target->address(), + object->address(), + object_size, + target_space->identity()); + heap()->mark_compact_collector()->tracer()-> + increment_promoted_objects_size(object_size); + return true; } return false; @@ -3271,6 +3286,16 @@ void MarkCompactCollector::InvalidateCode(Code* code) { } +// Return true if the given code is deoptimized or will be deoptimized. +bool MarkCompactCollector::WillBeDeoptimized(Code* code) { + // We assume the code_to_deoptimize_link is initialized to undefined. + // If it is 0, or refers to another Code object, then this code + // is already linked, or was already linked into the list. + return code->code_to_deoptimize_link() != heap()->undefined_value() + || code->marked_for_deoptimization(); +} + + bool MarkCompactCollector::MarkInvalidatedCode() { bool code_marked = false; @@ -3454,8 +3479,9 @@ void MarkCompactCollector::EvacuateNewSpaceAndCandidates() { } } - // Update pointer from the native contexts list. + // Update the heads of the native contexts list the code to deoptimize list. updating_visitor.VisitPointer(heap_->native_contexts_list_address()); + updating_visitor.VisitPointer(&code_to_deoptimize_); heap_->string_table()->Iterate(&updating_visitor); @@ -3463,9 +3489,6 @@ void MarkCompactCollector::EvacuateNewSpaceAndCandidates() { heap_->UpdateReferencesInExternalStringTable( &UpdateReferenceInExternalStringTableEntry); - // Update pointers in the new error object list. - heap_->error_object_list()->UpdateReferences(); - if (!FLAG_watch_ic_patching) { // Update JSFunction pointers from the runtime profiler. heap()->isolate()->runtime_profiler()->UpdateSamplesAfterCompact( diff --git a/deps/v8/src/mark-compact.h b/deps/v8/src/mark-compact.h index 4063bde..3c4dfb6 100644 --- a/deps/v8/src/mark-compact.h +++ b/deps/v8/src/mark-compact.h @@ -743,6 +743,7 @@ class MarkCompactCollector { ~MarkCompactCollector(); bool MarkInvalidatedCode(); + bool WillBeDeoptimized(Code* code); void RemoveDeadInvalidatedCode(); void ProcessInvalidatedCode(ObjectVisitor* visitor); @@ -946,6 +947,7 @@ class MarkCompactCollector { MarkingDeque marking_deque_; CodeFlusher* code_flusher_; Object* encountered_weak_collections_; + Object* code_to_deoptimize_; List evacuation_candidates_; List invalidated_code_; diff --git a/deps/v8/src/messages.js b/deps/v8/src/messages.js index 761b311..8b647dd 100644 --- a/deps/v8/src/messages.js +++ b/deps/v8/src/messages.js @@ -1145,24 +1145,29 @@ function captureStackTrace(obj, cons_opt) { } var error_string = FormatErrorString(obj); - // Note that 'obj' and 'this' maybe different when called on objects that - // have the error object on its prototype chain. The getter replaces itself - // with a data property as soon as the stack trace has been formatted. - // The getter must not change the object layout as it may be called after GC. + // The holder of this getter ('obj') may not be the receiver ('this'). + // When this getter is called the first time, we use the context values to + // format a stack trace string and turn this accessor pair into a data + // property (on the holder). var getter = function() { - if (IS_STRING(stack)) return stack; // Stack is still a raw array awaiting to be formatted. - stack = FormatStackTrace(error_string, GetStackFrames(stack)); - // Release context value. - error_string = void 0; - return stack; + var result = FormatStackTrace(error_string, GetStackFrames(stack)); + // Turn this accessor into a data property. + %DefineOrRedefineDataProperty(obj, 'stack', result, NONE); + // Release context values. + stack = error_string = void 0; + return result; }; - %MarkOneShotGetter(getter); - // The 'stack' property of the receiver is set as data property. If - // the receiver is the same as holder, this accessor pair is replaced. + // Set the 'stack' property on the receiver. If the receiver is the same as + // holder of this setter, the accessor pair is turned into a data property. var setter = function(v) { + // Set data property on the receiver (not necessarily holder). %DefineOrRedefineDataProperty(this, 'stack', v, NONE); + if (this === obj) { + // Release context values if holder is the same as the receiver. + stack = error_string = void 0; + } }; %DefineOrRedefineAccessorProperty(obj, 'stack', getter, setter, DONT_ENUM); @@ -1300,38 +1305,36 @@ InstallFunctions($Error.prototype, DONT_ENUM, ['toString', ErrorToString]); function SetUpStackOverflowBoilerplate() { var boilerplate = MakeRangeError('stack_overflow', []); - // The raw stack trace is stored as hidden property of the copy of this - // boilerplate error object. Note that the receiver 'this' may not be that - // error object copy, but can be found on the prototype chain of 'this'. - // When the stack trace is formatted, this accessor property is replaced by - // a data property. var error_string = boilerplate.name + ": " + boilerplate.message; - // The getter must not change the object layout as it may be called after GC. - function getter() { + // The raw stack trace is stored as a hidden property on the holder of this + // getter, which may not be the same as the receiver. Find the holder to + // retrieve the raw stack trace and then turn this accessor pair into a + // data property. + var getter = function() { var holder = this; while (!IS_ERROR(holder)) { holder = %GetPrototype(holder); - if (holder == null) return MakeSyntaxError('illegal_access', []); + if (IS_NULL(holder)) return MakeSyntaxError('illegal_access', []); } - var stack = %GetOverflowedStackTrace(holder); - if (IS_STRING(stack)) return stack; - if (IS_ARRAY(stack)) { - var result = FormatStackTrace(error_string, GetStackFrames(stack)); - %SetOverflowedStackTrace(holder, result); - return result; - } - return void 0; - } - %MarkOneShotGetter(getter); + var stack = %GetAndClearOverflowedStackTrace(holder); + // We may not have captured any stack trace. + if (IS_UNDEFINED(stack)) return stack; + + var result = FormatStackTrace(error_string, GetStackFrames(stack)); + // Replace this accessor with a data property. + %DefineOrRedefineDataProperty(holder, 'stack', result, NONE); + return result; + }; - // The 'stack' property of the receiver is set as data property. If - // the receiver is the same as holder, this accessor pair is replaced. - function setter(v) { + // Set the 'stack' property on the receiver. If the receiver is the same as + // holder of this setter, the accessor pair is turned into a data property. + var setter = function(v) { %DefineOrRedefineDataProperty(this, 'stack', v, NONE); - // Release the stack trace that is stored as hidden property, if exists. - %SetOverflowedStackTrace(this, void 0); - } + // Tentatively clear the hidden property. If the receiver is the same as + // holder, we release the raw stack trace this way. + %GetAndClearOverflowedStackTrace(this); + }; %DefineOrRedefineAccessorProperty( boilerplate, 'stack', getter, setter, DONT_ENUM); diff --git a/deps/v8/src/mips/code-stubs-mips.cc b/deps/v8/src/mips/code-stubs-mips.cc index f984b3a..0e1b224 100644 --- a/deps/v8/src/mips/code-stubs-mips.cc +++ b/deps/v8/src/mips/code-stubs-mips.cc @@ -39,6 +39,16 @@ namespace v8 { namespace internal { +void ToNumberStub::InitializeInterfaceDescriptor( + Isolate* isolate, + CodeStubInterfaceDescriptor* descriptor) { + static Register registers[] = { a0 }; + descriptor->register_param_count_ = 1; + descriptor->register_params_ = registers; + descriptor->deoptimization_handler_ = NULL; +} + + void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( Isolate* isolate, CodeStubInterfaceDescriptor* descriptor) { @@ -287,16 +297,6 @@ static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm, Register rhs); -// Check if the operand is a heap number. -static void EmitCheckForHeapNumber(MacroAssembler* masm, Register operand, - Register scratch1, Register scratch2, - Label* not_a_heap_number) { - __ lw(scratch1, FieldMemOperand(operand, HeapObject::kMapOffset)); - __ LoadRoot(scratch2, Heap::kHeapNumberMapRootIndex); - __ Branch(not_a_heap_number, ne, scratch1, Operand(scratch2)); -} - - void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { // Update the static counter each time a new code stub is generated. Isolate* isolate = masm->isolate(); @@ -321,24 +321,6 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { } -void ToNumberStub::Generate(MacroAssembler* masm) { - // The ToNumber stub takes one argument in a0. - Label check_heap_number, call_builtin; - __ JumpIfNotSmi(a0, &check_heap_number); - __ Ret(USE_DELAY_SLOT); - __ mov(v0, a0); - - __ bind(&check_heap_number); - EmitCheckForHeapNumber(masm, a0, a1, t0, &call_builtin); - __ Ret(USE_DELAY_SLOT); - __ mov(v0, a0); - - __ bind(&call_builtin); - __ push(a0); - __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION); -} - - void FastNewClosureStub::Generate(MacroAssembler* masm) { // Create a new closure from the given function info in new // space. Set the context to the current context in cp. diff --git a/deps/v8/src/mips/deoptimizer-mips.cc b/deps/v8/src/mips/deoptimizer-mips.cc index 840462e..57d3880 100644 --- a/deps/v8/src/mips/deoptimizer-mips.cc +++ b/deps/v8/src/mips/deoptimizer-mips.cc @@ -43,22 +43,8 @@ int Deoptimizer::patch_size() { } -void Deoptimizer::DeoptimizeFunctionWithPreparedFunctionList( - JSFunction* function) { - Isolate* isolate = function->GetIsolate(); - HandleScope scope(isolate); - DisallowHeapAllocation nha; - - ASSERT(function->IsOptimized()); - ASSERT(function->FunctionsInFunctionListShareSameCode()); - - // Get the optimized code. - Code* code = function->code(); +void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) { Address code_start_address = code->instruction_start(); - - // The optimized code is going to be patched, so we cannot use it any more. - function->shared()->EvictFromOptimizedCodeMap(code, "deoptimized function"); - // Invalidate the relocation information, as it will become invalid by the // code patching below, and is not needed any more. code->InvalidateRelocation(); @@ -89,30 +75,6 @@ void Deoptimizer::DeoptimizeFunctionWithPreparedFunctionList( prev_call_address = call_address; #endif } - - // Add the deoptimizing code to the list. - DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code); - DeoptimizerData* data = isolate->deoptimizer_data(); - node->set_next(data->deoptimizing_code_list_); - data->deoptimizing_code_list_ = node; - - // We might be in the middle of incremental marking with compaction. - // Tell collector to treat this code object in a special way and - // ignore all slots that might have been recorded on it. - isolate->heap()->mark_compact_collector()->InvalidateCode(code); - - ReplaceCodeForRelatedFunctions(function, code); - - if (FLAG_trace_deopt) { - PrintF("[forced deoptimization: "); - function->PrintName(); - PrintF(" / %x]\n", reinterpret_cast(function)); -#ifdef DEBUG - if (FLAG_print_code) { - code->PrintLn(); - } -#endif - } } @@ -648,6 +610,17 @@ void Deoptimizer::TableEntryGenerator::GeneratePrologue() { count() * table_entry_size_); } + +void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) { + SetFrameSlot(offset, value); +} + + +void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) { + SetFrameSlot(offset, value); +} + + #undef __ diff --git a/deps/v8/src/mips/lithium-codegen-mips.cc b/deps/v8/src/mips/lithium-codegen-mips.cc index 65b4a57..5cf1d59 100644 --- a/deps/v8/src/mips/lithium-codegen-mips.cc +++ b/deps/v8/src/mips/lithium-codegen-mips.cc @@ -271,6 +271,7 @@ bool LCodeGen::GenerateBody() { instr->CompileToNative(this); } EnsureSpaceForLazyDeopt(); + last_lazy_deopt_pc_ = masm()->pc_offset(); return !is_aborted(); } @@ -410,11 +411,7 @@ Register LCodeGen::EmitLoadRegister(LOperand* op, Register scratch) { Abort("EmitLoadRegister: Unsupported double immediate."); } else { ASSERT(r.IsTagged()); - if (literal->IsSmi()) { - __ li(scratch, Operand(literal)); - } else { - __ LoadHeapObject(scratch, Handle::cast(literal)); - } + __ LoadObject(scratch, literal); } return scratch; } else if (op->IsStackSlot() || op->IsArgument()) { @@ -480,9 +477,18 @@ bool LCodeGen::IsSmi(LConstantOperand* op) const { } -int LCodeGen::ToInteger32(LConstantOperand* op) const { +int32_t LCodeGen::ToInteger32(LConstantOperand* op) const { + return ToRepresentation(op, Representation::Integer32()); +} + + +int32_t LCodeGen::ToRepresentation(LConstantOperand* op, + const Representation& r) const { HConstant* constant = chunk_->LookupConstant(op); - return constant->Integer32Value(); + int32_t value = constant->Integer32Value(); + if (r.IsInteger32()) return value; + ASSERT(r.IsSmiOrTagged()); + return reinterpret_cast(Smi::FromInt(value)); } @@ -504,7 +510,10 @@ Operand LCodeGen::ToOperand(LOperand* op) { LConstantOperand* const_op = LConstantOperand::cast(op); HConstant* constant = chunk()->LookupConstant(const_op); Representation r = chunk_->LookupLiteralRepresentation(const_op); - if (r.IsInteger32()) { + if (r.IsSmi()) { + ASSERT(constant->HasSmiValue()); + return Operand(Smi::FromInt(constant->Integer32Value())); + } else if (r.IsInteger32()) { ASSERT(constant->HasInteger32Value()); return Operand(constant->Integer32Value()); } else if (r.IsDouble()) { @@ -789,14 +798,6 @@ void LCodeGen::DeoptimizeIf(Condition cc, } -void LCodeGen::SoftDeoptimize(LEnvironment* environment, - Register src1, - const Operand& src2) { - ASSERT(!info()->IsStub()); - DeoptimizeIf(al, environment, Deoptimizer::SOFT, src1, src2); -} - - void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle code) { ZoneList > maps(1, zone()); int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); @@ -1378,7 +1379,9 @@ void LCodeGen::DoMulI(LMulI* instr) { if (right_op->IsConstantOperand() && !can_overflow) { // Use optimized code for specific constants. - int32_t constant = ToInteger32(LConstantOperand::cast(right_op)); + int32_t constant = ToRepresentation( + LConstantOperand::cast(right_op), + instr->hydrogen()->right()->representation()); if (bailout_on_minus_zero && (constant < 0)) { // The case of a null constant will be handled separately. @@ -1445,13 +1448,25 @@ void LCodeGen::DoMulI(LMulI* instr) { if (can_overflow) { // hi:lo = left * right. - __ mult(left, right); - __ mfhi(scratch); - __ mflo(result); + if (instr->hydrogen()->representation().IsSmi()) { + __ SmiUntag(result, left); + __ mult(result, right); + __ mfhi(scratch); + __ mflo(result); + } else { + __ mult(left, right); + __ mfhi(scratch); + __ mflo(result); + } __ sra(at, result, 31); DeoptimizeIf(ne, instr->environment(), scratch, Operand(at)); } else { - __ Mul(result, left, right); + if (instr->hydrogen()->representation().IsSmi()) { + __ SmiUntag(result, left); + __ Mul(result, result, right); + } else { + __ Mul(result, left, right); + } } if (bailout_on_minus_zero) { @@ -1635,12 +1650,7 @@ void LCodeGen::DoConstantD(LConstantD* instr) { void LCodeGen::DoConstantT(LConstantT* instr) { Handle value = instr->value(); AllowDeferredHandleDereference smi_check; - if (value->IsSmi()) { - __ li(ToRegister(instr->result()), Operand(value)); - } else { - __ LoadHeapObject(ToRegister(instr->result()), - Handle::cast(value)); - } + __ LoadObject(ToRegister(instr->result()), value); } @@ -1819,7 +1829,7 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) { LOperand* right = instr->right(); HMathMinMax::Operation operation = instr->hydrogen()->operation(); Condition condition = (operation == HMathMinMax::kMathMin) ? le : ge; - if (instr->hydrogen()->representation().IsInteger32()) { + if (instr->hydrogen()->representation().IsSmiOrInteger32()) { Register left_reg = ToRegister(left); Operand right_op = (right->IsRegister() || right->IsConstantOperand()) ? ToOperand(right) @@ -2239,13 +2249,6 @@ void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { } -void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { - Register left = ToRegister(instr->left()); - - EmitBranch(instr, eq, left, Operand(instr->hydrogen()->right())); -} - - Condition LCodeGen::EmitIsObject(Register input, Register temp1, Register temp2, @@ -2900,9 +2903,9 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); __ lw(result, FieldMemOperand(result, offset + FixedArray::kHeaderSize)); } - } else if (lookup.IsConstantFunction()) { - Handle function(lookup.GetConstantFunctionFromMap(*type)); - __ LoadHeapObject(result, function); + } else if (lookup.IsConstant()) { + Handle constant(lookup.GetConstantFromMap(*type), isolate()); + __ LoadObject(result, constant); } else { // Negative lookup. // Check prototypes. @@ -4186,9 +4189,25 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { } +void LCodeGen::ApplyCheckIf(Condition cc, + LBoundsCheck* check, + Register src1, + const Operand& src2) { + if (FLAG_debug_code && check->hydrogen()->skip_check()) { + Label done; + __ Branch(&done, NegateCondition(cc), src1, src2); + __ stop("eliminated bounds check failed"); + __ bind(&done); + } else { + DeoptimizeIf(cc, check->environment(), src1, src2); + } +} + + void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { if (instr->hydrogen()->skip_check()) return; + Condition condition = instr->hydrogen()->allow_equality() ? hi : hs; if (instr->index()->IsConstantOperand()) { int constant_index = ToInteger32(LConstantOperand::cast(instr->index())); @@ -4197,13 +4216,13 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { } else { __ li(at, Operand(constant_index)); } - DeoptimizeIf(hs, - instr->environment(), + ApplyCheckIf(condition, + instr, at, Operand(ToRegister(instr->length()))); } else { - DeoptimizeIf(hs, - instr->environment(), + ApplyCheckIf(condition, + instr, ToRegister(instr->index()), Operand(ToRegister(instr->length()))); } @@ -5194,6 +5213,7 @@ void LCodeGen::DoCheckMapCommon(Register map_reg, void LCodeGen::DoCheckMaps(LCheckMaps* instr) { + if (instr->hydrogen()->CanOmitMapChecks()) return; Register map_reg = scratch0(); LOperand* input = instr->value(); ASSERT(input->IsRegister()); @@ -5262,6 +5282,8 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) { void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { + if (instr->hydrogen()->CanOmitPrototypeChecks()) return; + Register prototype_reg = ToRegister(instr->temp()); Register map_reg = ToRegister(instr->temp2()); @@ -5270,12 +5292,10 @@ void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { ASSERT(prototypes->length() == maps->length()); - if (!instr->hydrogen()->CanOmitPrototypeChecks()) { - for (int i = 0; i < prototypes->length(); i++) { - __ LoadHeapObject(prototype_reg, prototypes->at(i)); - __ lw(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); - DoCheckMapCommon(map_reg, maps->at(i), instr->environment()); - } + for (int i = 0; i < prototypes->length(); i++) { + __ LoadHeapObject(prototype_reg, prototypes->at(i)); + __ lw(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); + DoCheckMapCommon(map_reg, maps->at(i), instr->environment()); } } @@ -5323,6 +5343,25 @@ void LCodeGen::DoAllocate(LAllocate* instr) { } __ bind(deferred->exit()); + + if (instr->hydrogen()->MustPrefillWithFiller()) { + if (instr->size()->IsConstantOperand()) { + int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); + __ li(scratch, Operand(size)); + } else { + scratch = ToRegister(instr->size()); + } + __ Subu(scratch, scratch, Operand(kPointerSize)); + __ Subu(result, result, Operand(kHeapObjectTag)); + Label loop; + __ bind(&loop); + __ li(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); + __ Addu(at, result, Operand(scratch)); + __ sw(scratch2, MemOperand(at)); + __ Subu(scratch, scratch, Operand(kPointerSize)); + __ Branch(&loop, ge, scratch, Operand(zero_reg)); + __ Addu(result, result, Operand(kHeapObjectTag)); + } } @@ -5615,12 +5654,12 @@ void LCodeGen::EnsureSpaceForLazyDeopt() { padding_size -= Assembler::kInstrSize; } } - last_lazy_deopt_pc_ = masm()->pc_offset(); } void LCodeGen::DoLazyBailout(LLazyBailout* instr) { EnsureSpaceForLazyDeopt(); + last_lazy_deopt_pc_ = masm()->pc_offset(); ASSERT(instr->HasEnvironment()); LEnvironment* env = instr->environment(); RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); @@ -5629,11 +5668,15 @@ void LCodeGen::DoLazyBailout(LLazyBailout* instr) { void LCodeGen::DoDeoptimize(LDeoptimize* instr) { - if (instr->hydrogen_value()->IsSoftDeoptimize()) { - SoftDeoptimize(instr->environment(), zero_reg, Operand(zero_reg)); - } else { - DeoptimizeIf(al, instr->environment(), zero_reg, Operand(zero_reg)); + Deoptimizer::BailoutType type = instr->hydrogen()->type(); + // TODO(danno): Stubs expect all deopts to be lazy for historical reasons (the + // needed return address), even though the implementation of LAZY and EAGER is + // now identical. When LAZY is eventually completely folded into EAGER, remove + // the special case below. + if (info()->IsStub() && type == Deoptimizer::EAGER) { + type = Deoptimizer::LAZY; } + DeoptimizeIf(al, instr->environment(), type, zero_reg, Operand(zero_reg)); } @@ -5676,6 +5719,7 @@ void LCodeGen::DoStackCheck(LStackCheck* instr) { StackCheckStub stub; CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); EnsureSpaceForLazyDeopt(); + last_lazy_deopt_pc_ = masm()->pc_offset(); __ bind(&done); RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); @@ -5687,6 +5731,7 @@ void LCodeGen::DoStackCheck(LStackCheck* instr) { __ LoadRoot(at, Heap::kStackLimitRootIndex); __ Branch(deferred_stack_check->entry(), lo, sp, Operand(at)); EnsureSpaceForLazyDeopt(); + last_lazy_deopt_pc_ = masm()->pc_offset(); __ bind(instr->done_label()); deferred_stack_check->SetExit(instr->done_label()); RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); diff --git a/deps/v8/src/mips/lithium-codegen-mips.h b/deps/v8/src/mips/lithium-codegen-mips.h index 1cba8cf..a485b67 100644 --- a/deps/v8/src/mips/lithium-codegen-mips.h +++ b/deps/v8/src/mips/lithium-codegen-mips.h @@ -114,7 +114,8 @@ class LCodeGen BASE_EMBEDDED { DoubleRegister EmitLoadDoubleRegister(LOperand* op, FloatRegister flt_scratch, DoubleRegister dbl_scratch); - int ToInteger32(LConstantOperand* op) const; + int ToRepresentation(LConstantOperand* op, const Representation& r) const; + int32_t ToInteger32(LConstantOperand* op) const; Smi* ToSmi(LConstantOperand* op) const; double ToDouble(LConstantOperand* op) const; Operand ToOperand(LOperand* op); @@ -284,9 +285,10 @@ class LCodeGen BASE_EMBEDDED { LEnvironment* environment, Register src1 = zero_reg, const Operand& src2 = Operand(zero_reg)); - void SoftDeoptimize(LEnvironment* environment, - Register src1 = zero_reg, - const Operand& src2 = Operand(zero_reg)); + void ApplyCheckIf(Condition cc, + LBoundsCheck* check, + Register src1 = zero_reg, + const Operand& src2 = Operand(zero_reg)); void AddToTranslation(Translation* translation, LOperand* op, diff --git a/deps/v8/src/mips/lithium-gap-resolver-mips.cc b/deps/v8/src/mips/lithium-gap-resolver-mips.cc index 9705e1f..771b228 100644 --- a/deps/v8/src/mips/lithium-gap-resolver-mips.cc +++ b/deps/v8/src/mips/lithium-gap-resolver-mips.cc @@ -251,10 +251,10 @@ void LGapResolver::EmitMove(int index) { LConstantOperand* constant_source = LConstantOperand::cast(source); if (destination->IsRegister()) { Register dst = cgen_->ToRegister(destination); - if (cgen_->IsSmi(constant_source)) { - __ li(dst, Operand(cgen_->ToSmi(constant_source))); - } else if (cgen_->IsInteger32(constant_source)) { - __ li(dst, Operand(cgen_->ToInteger32(constant_source))); + Representation r = cgen_->IsSmi(constant_source) + ? Representation::Smi() : Representation::Integer32(); + if (cgen_->IsInteger32(constant_source)) { + __ li(dst, Operand(cgen_->ToRepresentation(constant_source, r))); } else { __ LoadObject(dst, cgen_->ToHandle(constant_source)); } @@ -265,11 +265,11 @@ void LGapResolver::EmitMove(int index) { } else { ASSERT(destination->IsStackSlot()); ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone. - if (cgen_->IsSmi(constant_source)) { - __ li(kLithiumScratchReg, Operand(cgen_->ToSmi(constant_source))); - } else if (cgen_->IsInteger32(constant_source)) { + Representation r = cgen_->IsSmi(constant_source) + ? Representation::Smi() : Representation::Integer32(); + if (cgen_->IsInteger32(constant_source)) { __ li(kLithiumScratchReg, - Operand(cgen_->ToInteger32(constant_source))); + Operand(cgen_->ToRepresentation(constant_source, r))); } else { __ LoadObject(kLithiumScratchReg, cgen_->ToHandle(constant_source)); diff --git a/deps/v8/src/mips/lithium-mips.cc b/deps/v8/src/mips/lithium-mips.cc index c64533c..b03cea4 100644 --- a/deps/v8/src/mips/lithium-mips.cc +++ b/deps/v8/src/mips/lithium-mips.cc @@ -706,11 +706,6 @@ LInstruction* LChunkBuilder::DoEnvironmentMarker(HEnvironmentMarker* instr) { } -LInstruction* LChunkBuilder::DoSoftDeoptimize(HSoftDeoptimize* instr) { - return AssignEnvironment(new(zone()) LDeoptimize); -} - - LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) { return AssignEnvironment(new(zone()) LDeoptimize); } @@ -788,8 +783,8 @@ LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, op == Token::SUB); HValue* left = instr->left(); HValue* right = instr->right(); - ASSERT(left->representation().IsSmiOrTagged()); - ASSERT(right->representation().IsSmiOrTagged()); + ASSERT(left->representation().IsTagged()); + ASSERT(right->representation().IsTagged()); LOperand* left_operand = UseFixed(left, a1); LOperand* right_operand = UseFixed(right, a0); LArithmeticT* result = @@ -1320,17 +1315,17 @@ LInstruction* LChunkBuilder::DoShl(HShl* instr) { LInstruction* LChunkBuilder::DoBitwise(HBitwise* instr) { - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); return DefineAsRegister(new(zone()) LBitI(left, right)); } else { - ASSERT(instr->representation().IsSmiOrTagged()); - ASSERT(instr->left()->representation().IsSmiOrTagged()); - ASSERT(instr->right()->representation().IsSmiOrTagged()); + ASSERT(instr->representation().IsTagged()); + ASSERT(instr->left()->representation().IsTagged()); + ASSERT(instr->right()->representation().IsTagged()); LOperand* left = UseFixed(instr->left(), a1); LOperand* right = UseFixed(instr->right(), a0); @@ -1352,7 +1347,9 @@ LInstruction* LChunkBuilder::DoBitNot(HBitNot* instr) { LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { if (instr->representation().IsDouble()) { return DoArithmeticD(Token::DIV, instr); - } else if (instr->representation().IsInteger32()) { + } else if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* dividend = UseRegister(instr->left()); LOperand* divisor = UseRegister(instr->right()); LDivI* div = new(zone()) LDivI(dividend, divisor); @@ -1419,9 +1416,9 @@ LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) { LInstruction* LChunkBuilder::DoMod(HMod* instr) { HValue* left = instr->left(); HValue* right = instr->right(); - if (instr->representation().IsInteger32()) { - ASSERT(left->representation().IsInteger32()); - ASSERT(right->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); if (instr->HasPowerOf2Divisor()) { ASSERT(!right->CanBeZero()); LModI* mod = new(zone()) LModI(UseRegisterAtStart(left), @@ -1449,7 +1446,7 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) { ? AssignEnvironment(result) : result; } - } else if (instr->representation().IsSmiOrTagged()) { + } else if (instr->representation().IsTagged()) { return DoArithmeticT(Token::MOD, instr); } else { ASSERT(instr->representation().IsDouble()); @@ -1465,9 +1462,9 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) { LInstruction* LChunkBuilder::DoMul(HMul* instr) { - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* left; LOperand* right = UseOrConstant(instr->BetterRightOperand()); LOperand* temp = NULL; @@ -1510,9 +1507,9 @@ LInstruction* LChunkBuilder::DoMul(HMul* instr) { LInstruction* LChunkBuilder::DoSub(HSub* instr) { - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* left = UseRegisterAtStart(instr->left()); LOperand* right = UseOrConstantAtStart(instr->right()); LSubI* sub = new(zone()) LSubI(left, right); @@ -1539,9 +1536,9 @@ LInstruction* LChunkBuilder::DoMultiplyAdd(HMul* mul, HValue* addend) { LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); LAddI* add = new(zone()) LAddI(left, right); @@ -1562,7 +1559,7 @@ LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { } return DoArithmeticD(Token::ADD, instr); } else { - ASSERT(instr->representation().IsSmiOrTagged()); + ASSERT(instr->representation().IsTagged()); return DoArithmeticT(Token::ADD, instr); } } @@ -1571,9 +1568,9 @@ LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { LOperand* left = NULL; LOperand* right = NULL; - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); left = UseRegisterAtStart(instr->BetterLeftOperand()); right = UseOrConstantAtStart(instr->BetterRightOperand()); } else { @@ -1652,13 +1649,6 @@ LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( } -LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch( - HCompareConstantEqAndBranch* instr) { - return new(zone()) LCmpConstantEqAndBranch( - UseRegisterAtStart(instr->value())); -} - - LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { ASSERT(instr->value()->representation().IsTagged()); LOperand* temp = TempRegister(); @@ -1956,9 +1946,14 @@ LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { - LUnallocated* temp1 = TempRegister(); - LOperand* temp2 = TempRegister(); + LUnallocated* temp1 = NULL; + LOperand* temp2 = NULL; + if (!instr->CanOmitPrototypeChecks()) { + temp1 = TempRegister(); + temp2 = TempRegister(); + } LCheckPrototypeMaps* result = new(zone()) LCheckPrototypeMaps(temp1, temp2); + if (instr->CanOmitPrototypeChecks()) return result; return AssignEnvironment(result); } @@ -1970,8 +1965,10 @@ LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) { LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { - LOperand* value = UseRegisterAtStart(instr->value()); + LOperand* value = NULL; + if (!instr->CanOmitMapChecks()) value = UseRegisterAtStart(instr->value()); LInstruction* result = new(zone()) LCheckMaps(value); + if (instr->CanOmitMapChecks()) return result; return AssignEnvironment(result); } @@ -2128,8 +2125,7 @@ LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { - ASSERT(instr->key()->representation().IsInteger32() || - instr->key()->representation().IsSmi()); + ASSERT(instr->key()->representation().IsSmiOrInteger32()); ElementsKind elements_kind = instr->elements_kind(); LOperand* key = UseRegisterOrConstantAtStart(instr->key()); LLoadKeyed* result = NULL; diff --git a/deps/v8/src/mips/lithium-mips.h b/deps/v8/src/mips/lithium-mips.h index 83a37c6..2b55906 100644 --- a/deps/v8/src/mips/lithium-mips.h +++ b/deps/v8/src/mips/lithium-mips.h @@ -40,12 +40,6 @@ namespace internal { // Forward declarations. class LCodeGen; -#define LITHIUM_ALL_INSTRUCTION_LIST(V) \ - V(ControlInstruction) \ - V(Call) \ - LITHIUM_CONCRETE_INSTRUCTION_LIST(V) - - #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ V(AccessArgumentsAt) \ V(AddI) \ @@ -72,6 +66,7 @@ class LCodeGen; V(CheckFunction) \ V(CheckInstanceType) \ V(CheckMaps) \ + V(CheckMapValue) \ V(CheckNonSmi) \ V(CheckPrototypeMaps) \ V(CheckSmi) \ @@ -79,7 +74,6 @@ class LCodeGen; V(ClampIToUint8) \ V(ClampTToUint8) \ V(ClassOfTestAndBranch) \ - V(CmpConstantEqAndBranch) \ V(CompareNumericAndBranch) \ V(CmpObjectEqAndBranch) \ V(CmpMapAndBranch) \ @@ -89,14 +83,18 @@ class LCodeGen; V(ConstantS) \ V(ConstantT) \ V(Context) \ + V(DateField) \ V(DebugBreak) \ V(DeclareGlobals) \ V(Deoptimize) \ V(DivI) \ V(DoubleToI) \ V(DoubleToSmi) \ + V(Drop) \ V(DummyUse) \ V(ElementsKind) \ + V(ForInCacheArray) \ + V(ForInPrepareMap) \ V(FunctionLiteral) \ V(GetCachedArrayIndex) \ V(GlobalObject) \ @@ -104,13 +102,13 @@ class LCodeGen; V(Goto) \ V(HasCachedArrayIndexAndBranch) \ V(HasInstanceTypeAndBranch) \ + V(InnerAllocatedObject) \ V(InstanceOf) \ V(InstanceOfKnownGlobal) \ V(InstanceSize) \ V(InstructionGap) \ V(Integer32ToDouble) \ V(Integer32ToSmi) \ - V(Uint32ToDouble) \ V(InvokeFunction) \ V(IsConstructCallAndBranch) \ V(IsObjectAndBranch) \ @@ -123,6 +121,7 @@ class LCodeGen; V(LinkObjectInList) \ V(LoadContextSlot) \ V(LoadExternalArrayPointer) \ + V(LoadFieldByIndex) \ V(LoadFunctionPrototype) \ V(LoadGlobalCell) \ V(LoadGlobalGeneric) \ @@ -185,17 +184,10 @@ class LCodeGen; V(TrapAllocationMemento) \ V(Typeof) \ V(TypeofIsAndBranch) \ + V(Uint32ToDouble) \ V(UnknownOSRValue) \ V(ValueOf) \ - V(ForInPrepareMap) \ - V(ForInCacheArray) \ - V(CheckMapValue) \ - V(LoadFieldByIndex) \ - V(DateField) \ - V(WrapReceiver) \ - V(Drop) \ - V(InnerAllocatedObject) - + V(WrapReceiver) #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ virtual Opcode opcode() const { return LInstruction::k##type; } \ @@ -431,6 +423,7 @@ class LDummyUse: public LTemplateInstruction<1, 1, 0> { class LDeoptimize: public LTemplateInstruction<0, 0, 0> { public: DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") + DECLARE_HYDROGEN_ACCESSOR(Deoptimize) }; @@ -888,20 +881,6 @@ class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> { }; -class LCmpConstantEqAndBranch: public LControlInstruction<1, 0> { - public: - explicit LCmpConstantEqAndBranch(LOperand* left) { - inputs_[0] = left; - } - - LOperand* left() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(CmpConstantEqAndBranch, - "cmp-constant-eq-and-branch") - DECLARE_HYDROGEN_ACCESSOR(CompareConstantEqAndBranch) -}; - - class LIsObjectAndBranch: public LControlInstruction<1, 1> { public: LIsObjectAndBranch(LOperand* value, LOperand* temp) { diff --git a/deps/v8/src/mips/macro-assembler-mips.cc b/deps/v8/src/mips/macro-assembler-mips.cc index 8a44185..ea08a55 100644 --- a/deps/v8/src/mips/macro-assembler-mips.cc +++ b/deps/v8/src/mips/macro-assembler-mips.cc @@ -2882,6 +2882,7 @@ void MacroAssembler::Allocate(int object_size, Register scratch2, Label* gc_required, AllocationFlags flags) { + ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize); if (!FLAG_inline_new) { if (emit_debug_code()) { // Trash the registers to simulate an allocation failure. @@ -4968,9 +4969,10 @@ void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialAscii( Register scratch1, Register scratch2, Label* failure) { - int kFlatAsciiStringMask = + const int kFlatAsciiStringMask = kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask; - int kFlatAsciiStringTag = ASCII_STRING_TYPE; + const int kFlatAsciiStringTag = + kStringTag | kOneByteStringTag | kSeqStringTag; ASSERT(kFlatAsciiStringTag <= 0xffff); // Ensure this fits 16-bit immed. andi(scratch1, first, kFlatAsciiStringMask); Branch(failure, ne, scratch1, Operand(kFlatAsciiStringTag)); @@ -4982,9 +4984,10 @@ void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialAscii( void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii(Register type, Register scratch, Label* failure) { - int kFlatAsciiStringMask = + const int kFlatAsciiStringMask = kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask; - int kFlatAsciiStringTag = ASCII_STRING_TYPE; + const int kFlatAsciiStringTag = + kStringTag | kOneByteStringTag | kSeqStringTag; And(scratch, type, Operand(kFlatAsciiStringMask)); Branch(failure, ne, scratch, Operand(kFlatAsciiStringTag)); } diff --git a/deps/v8/src/mips/stub-cache-mips.cc b/deps/v8/src/mips/stub-cache-mips.cc index 89d8e68..c4b1ee5 100644 --- a/deps/v8/src/mips/stub-cache-mips.cc +++ b/deps/v8/src/mips/stub-cache-mips.cc @@ -470,10 +470,9 @@ void BaseStoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, Representation representation = details.representation(); ASSERT(!representation.IsNone()); - if (details.type() == CONSTANT_FUNCTION) { - Handle constant( - HeapObject::cast(descriptors->GetValue(descriptor))); - __ LoadHeapObject(scratch1, constant); + if (details.type() == CONSTANT) { + Handle constant(descriptors->GetValue(descriptor), masm->isolate()); + __ LoadObject(scratch1, constant); __ Branch(miss_label, ne, value_reg, Operand(scratch1)); } else if (FLAG_track_fields && representation.IsSmi()) { __ JumpIfNotSmi(value_reg, miss_label); @@ -532,7 +531,7 @@ void BaseStoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); - if (details.type() == CONSTANT_FUNCTION) { + if (details.type() == CONSTANT) { ASSERT(value_reg.is(a0)); __ Ret(USE_DELAY_SLOT); __ mov(v0, a0); @@ -1404,9 +1403,9 @@ void BaseLoadStubCompiler::GenerateLoadField(Register reg, } -void BaseLoadStubCompiler::GenerateLoadConstant(Handle value) { +void BaseLoadStubCompiler::GenerateLoadConstant(Handle value) { // Return the constant value. - __ LoadHeapObject(v0, value); + __ LoadObject(v0, value); __ Ret(); } @@ -2709,7 +2708,7 @@ Handle CallStubCompiler::CompileCallConstant( Handle code = CompileCustomCall(object, holder, Handle::null(), function, Handle::cast(name), - Code::CONSTANT_FUNCTION); + Code::CONSTANT); // A null handle means bail out to the regular compiler code below. if (!code.is_null()) return code; } diff --git a/deps/v8/src/mirror-debugger.js b/deps/v8/src/mirror-debugger.js index 28ef24d..3b360bb 100644 --- a/deps/v8/src/mirror-debugger.js +++ b/deps/v8/src/mirror-debugger.js @@ -173,7 +173,7 @@ PropertyKind.Indexed = 2; var PropertyType = {}; PropertyType.Normal = 0; PropertyType.Field = 1; -PropertyType.ConstantFunction = 2; +PropertyType.Constant = 2; PropertyType.Callbacks = 3; PropertyType.Handler = 4; PropertyType.Interceptor = 5; diff --git a/deps/v8/src/objects-inl.h b/deps/v8/src/objects-inl.h index c12a12a..3189d84 100644 --- a/deps/v8/src/objects-inl.h +++ b/deps/v8/src/objects-inl.h @@ -2352,8 +2352,8 @@ int DescriptorArray::GetFieldIndex(int descriptor_number) { } -JSFunction* DescriptorArray::GetConstantFunction(int descriptor_number) { - return JSFunction::cast(GetValue(descriptor_number)); +Object* DescriptorArray::GetConstant(int descriptor_number) { + return GetValue(descriptor_number); } @@ -3648,7 +3648,7 @@ bool Map::CanBeDeprecated() { details.representation().IsHeapObject()) { return true; } - if (FLAG_track_fields && details.type() == CONSTANT_FUNCTION) { + if (FLAG_track_fields && details.type() == CONSTANT) { return true; } } @@ -3669,6 +3669,12 @@ bool Map::CanOmitPrototypeChecks() { } +bool Map::CanOmitMapChecks() { + return !HasTransitionArray() && !is_dictionary_map() && + FLAG_omit_map_checks_for_leaf_maps; +} + + int DependentCode::number_of_entries(DependencyGroup group) { if (length() == 0) return 0; return Smi::cast(get(group))->value(); @@ -5233,15 +5239,22 @@ void Code::set_stub_info(int value) { } -void Code::set_deoptimizing_functions(Object* value) { +Object* Code::code_to_deoptimize_link() { + // Optimized code should not have type feedback. + ASSERT(kind() == OPTIMIZED_FUNCTION); + return READ_FIELD(this, kTypeFeedbackInfoOffset); +} + + +void Code::set_code_to_deoptimize_link(Object* value) { ASSERT(kind() == OPTIMIZED_FUNCTION); WRITE_FIELD(this, kTypeFeedbackInfoOffset, value); } -Object* Code::deoptimizing_functions() { +Object** Code::code_to_deoptimize_link_slot() { ASSERT(kind() == OPTIMIZED_FUNCTION); - return Object::cast(READ_FIELD(this, kTypeFeedbackInfoOffset)); + return HeapObject::RawField(this, kTypeFeedbackInfoOffset); } diff --git a/deps/v8/src/objects-printer.cc b/deps/v8/src/objects-printer.cc index 91b1c2e..2327cba 100644 --- a/deps/v8/src/objects-printer.cc +++ b/deps/v8/src/objects-printer.cc @@ -294,9 +294,9 @@ void JSObject::PrintProperties(FILE* out) { PrintF(out, " (field at offset %d)\n", index); break; } - case CONSTANT_FUNCTION: - descs->GetConstantFunction(i)->ShortPrint(out); - PrintF(out, " (constant function)\n"); + case CONSTANT: + descs->GetConstant(i)->ShortPrint(out); + PrintF(out, " (constant)\n"); break; case CALLBACKS: descs->GetCallbacksObject(i)->ShortPrint(out); @@ -450,8 +450,8 @@ void JSObject::PrintTransitions(FILE* out) { PrintF(out, " (transition to field)\n"); break; } - case CONSTANT_FUNCTION: - PrintF(out, " (transition to constant function)\n"); + case CONSTANT: + PrintF(out, " (transition to constant)\n"); break; case CALLBACKS: PrintF(out, " (transition to callback)\n"); @@ -1262,8 +1262,8 @@ void TransitionArray::PrintTransitions(FILE* out) { PrintF(out, " (transition to field)\n"); break; } - case CONSTANT_FUNCTION: - PrintF(out, " (transition to constant function)\n"); + case CONSTANT: + PrintF(out, " (transition to constant)\n"); break; case CALLBACKS: PrintF(out, " (transition to callback)\n"); diff --git a/deps/v8/src/objects.cc b/deps/v8/src/objects.cc index 1967b13..d2ffb9c 100644 --- a/deps/v8/src/objects.cc +++ b/deps/v8/src/objects.cc @@ -518,7 +518,7 @@ MaybeObject* JSObject::GetPropertyWithFailedAccessCheck( } case NORMAL: case FIELD: - case CONSTANT_FUNCTION: { + case CONSTANT: { // Search ALL_CAN_READ accessors in prototype chain. LookupResult r(GetIsolate()); result->holder()->LookupRealNamedPropertyInPrototypes(name, &r); @@ -579,7 +579,7 @@ PropertyAttributes JSObject::GetPropertyAttributeWithFailedAccessCheck( case NORMAL: case FIELD: - case CONSTANT_FUNCTION: { + case CONSTANT: { if (!continue_search) break; // Search ALL_CAN_READ accessors in prototype chain. LookupResult r(GetIsolate()); @@ -874,8 +874,8 @@ MaybeObject* Object::GetProperty(Object* receiver, ASSERT(!value->IsTheHole() || result->IsReadOnly()); return value->IsTheHole() ? heap->undefined_value() : value; } - case CONSTANT_FUNCTION: - return result->GetConstantFunction(); + case CONSTANT: + return result->GetConstant(); case CALLBACKS: return result->holder()->GetPropertyWithCallback( receiver, result->GetCallbackObject(), name); @@ -1927,12 +1927,12 @@ MaybeObject* JSObject::AddFastProperty(Name* name, } -MaybeObject* JSObject::AddConstantFunctionProperty( +MaybeObject* JSObject::AddConstantProperty( Name* name, - JSFunction* function, + Object* constant, PropertyAttributes attributes) { - // Allocate new instance descriptors with (name, function) added - ConstantFunctionDescriptor d(name, function, attributes); + // Allocate new instance descriptors with (name, constant) added + ConstantDescriptor d(name, constant, attributes); TransitionFlag flag = // Do not add transitions to global objects. @@ -1948,7 +1948,7 @@ MaybeObject* JSObject::AddConstantFunctionProperty( if (!maybe_new_map->To(&new_map)) return maybe_new_map; set_map(new_map); - return function; + return constant; } @@ -2000,7 +2000,8 @@ MaybeObject* JSObject::AddProperty(Name* name, StrictModeFlag strict_mode, JSReceiver::StoreFromKeyed store_mode, ExtensibilityCheck extensibility_check, - ValueType value_type) { + ValueType value_type, + StoreMode mode) { ASSERT(!IsJSGlobalProxy()); Map* map_of_this = map(); Heap* heap = GetHeap(); @@ -2022,10 +2023,12 @@ MaybeObject* JSObject::AddProperty(Name* name, // Ensure the descriptor array does not get too big. if (map_of_this->NumberOfOwnDescriptors() < DescriptorArray::kMaxNumberOfDescriptors) { + // TODO(verwaest): Support other constants. + // if (mode == ALLOW_AS_CONSTANT && + // !value->IsTheHole() && + // !value->IsConsString()) { if (value->IsJSFunction()) { - result = AddConstantFunctionProperty(name, - JSFunction::cast(value), - attributes); + result = AddConstantProperty(name, value, attributes); } else { result = AddFastProperty( name, value, attributes, store_mode, value_type); @@ -2095,7 +2098,8 @@ MaybeObject* JSObject::SetPropertyPostInterceptor( Object* value, PropertyAttributes attributes, StrictModeFlag strict_mode, - ExtensibilityCheck extensibility_check) { + ExtensibilityCheck extensibility_check, + StoreMode mode) { // Check local property, ignore interceptor. LookupResult result(GetIsolate()); LocalLookupRealNamedProperty(name, &result); @@ -2112,7 +2116,8 @@ MaybeObject* JSObject::SetPropertyPostInterceptor( if (done) return result_object; // Add a new real property. return AddProperty(name, value, attributes, strict_mode, - MAY_BE_STORE_FROM_KEYED, extensibility_check); + MAY_BE_STORE_FROM_KEYED, extensibility_check, + OPTIMAL_REPRESENTATION, mode); } @@ -2377,9 +2382,9 @@ MaybeObject* JSObject::MigrateToMap(Map* new_map) { PropertyDetails details = new_descriptors->GetDetails(i); if (details.type() != FIELD) continue; PropertyDetails old_details = old_descriptors->GetDetails(i); - ASSERT(old_details.type() == CONSTANT_FUNCTION || + ASSERT(old_details.type() == CONSTANT || old_details.type() == FIELD); - Object* value = old_details.type() == CONSTANT_FUNCTION + Object* value = old_details.type() == CONSTANT ? old_descriptors->GetValue(i) : RawFastPropertyAt(old_descriptors->GetFieldIndex(i)); if (FLAG_track_double_fields && @@ -2994,7 +2999,7 @@ MaybeObject* JSObject::SetPropertyViaPrototypes( switch (result.type()) { case NORMAL: case FIELD: - case CONSTANT_FUNCTION: + case CONSTANT: *done = result.IsReadOnly(); break; case INTERCEPTOR: { @@ -3867,13 +3872,13 @@ MaybeObject* JSObject::SetPropertyForResult(LookupResult* lookup, result = *value; break; } - case CONSTANT_FUNCTION: - // Only replace the function if necessary. - if (*value == lookup->GetConstantFunction()) return *value; + case CONSTANT: + // Only replace the constant if necessary. + if (*value == lookup->GetConstant()) return *value; // Preserve the attributes of this existing property. attributes = lookup->GetAttributes(); - result = - lookup->holder()->ConvertDescriptorToField(*name, *value, attributes); + result = lookup->holder()->ConvertDescriptorToField( + *name, *value, attributes); break; case CALLBACKS: { Object* callback_object = lookup->GetCallbackObject(); @@ -3919,14 +3924,14 @@ MaybeObject* JSObject::SetPropertyForResult(LookupResult* lookup, result = lookup->holder()->ConvertDescriptorToField( *name, *value, attributes); } else { - ASSERT(details.type() == CONSTANT_FUNCTION); + ASSERT(details.type() == CONSTANT); - Object* constant_function = descriptors->GetValue(descriptor); - if (constant_function == *value) { + Object* constant = descriptors->GetValue(descriptor); + if (constant == *value) { // If the same constant function is being added we can simply // transition to the target map. lookup->holder()->set_map(transition_map); - result = constant_function; + result = constant; } else { // Otherwise, replace with a map transition to a new map with a FIELD, // even if the value is a constant function. @@ -3977,11 +3982,12 @@ Handle JSObject::SetLocalPropertyIgnoreAttributes( Handle key, Handle value, PropertyAttributes attributes, - ValueType value_type) { + ValueType value_type, + StoreMode mode) { CALL_HEAP_FUNCTION( object->GetIsolate(), object->SetLocalPropertyIgnoreAttributes( - *key, *value, attributes, value_type), + *key, *value, attributes, value_type, mode), Object); } @@ -3990,7 +3996,8 @@ MaybeObject* JSObject::SetLocalPropertyIgnoreAttributes( Name* name_raw, Object* value_raw, PropertyAttributes attributes, - ValueType value_type) { + ValueType value_type, + StoreMode mode) { // Make sure that the top context does not change when doing callbacks or // interceptor calls. AssertNoContextChange ncc; @@ -4017,7 +4024,8 @@ MaybeObject* JSObject::SetLocalPropertyIgnoreAttributes( name_raw, value_raw, attributes, - value_type); + value_type, + mode); } // Check for accessor in prototype chain removed here in clone. @@ -4025,7 +4033,7 @@ MaybeObject* JSObject::SetLocalPropertyIgnoreAttributes( // Neither properties nor transitions found. return AddProperty( name_raw, value_raw, attributes, kNonStrictMode, - MAY_BE_STORE_FROM_KEYED, PERFORM_EXTENSIBILITY_CHECK, value_type); + MAY_BE_STORE_FROM_KEYED, PERFORM_EXTENSIBILITY_CHECK, value_type, mode); } // From this point on everything needs to be handlified. @@ -4075,9 +4083,9 @@ MaybeObject* JSObject::SetLocalPropertyIgnoreAttributes( result = *value; break; } - case CONSTANT_FUNCTION: + case CONSTANT: // Only replace the function if necessary. - if (*value != lookup.GetConstantFunction()) { + if (*value != lookup.GetConstant()) { // Preserve the attributes of this existing property. attributes = lookup.GetAttributes(); result = self->ConvertDescriptorToField(*name, *value, attributes); @@ -4122,7 +4130,7 @@ MaybeObject* JSObject::SetLocalPropertyIgnoreAttributes( } else if (details.type() == CALLBACKS) { result = self->ConvertDescriptorToField(*name, *value, attributes); } else { - ASSERT(details.type() == CONSTANT_FUNCTION); + ASSERT(details.type() == CONSTANT); // Replace transition to CONSTANT FUNCTION with a map transition to a // new map with a FIELD, even if the value is a function. @@ -4264,7 +4272,7 @@ PropertyAttributes JSReceiver::GetPropertyAttributeForResult( switch (lookup->type()) { case NORMAL: // fall through case FIELD: - case CONSTANT_FUNCTION: + case CONSTANT: case CALLBACKS: return lookup->GetAttributes(); case HANDLER: { @@ -4504,10 +4512,10 @@ MaybeObject* JSObject::NormalizeProperties(PropertyNormalizationMode mode, for (int i = 0; i < real_size; i++) { PropertyDetails details = descs->GetDetails(i); switch (details.type()) { - case CONSTANT_FUNCTION: { + case CONSTANT: { PropertyDetails d = PropertyDetails( details.attributes(), NORMAL, i + 1); - Object* value = descs->GetConstantFunction(i); + Object* value = descs->GetConstant(i); MaybeObject* maybe_dictionary = dictionary->Add(descs->GetKey(i), value, d); if (!maybe_dictionary->To(&dictionary)) return maybe_dictionary; @@ -4949,7 +4957,8 @@ MaybeObject* JSObject::GetHiddenPropertiesHashTable( hashtable, DONT_ENUM, kNonStrictMode, - OMIT_EXTENSIBILITY_CHECK); + OMIT_EXTENSIBILITY_CHECK, + FORCE_FIELD); if (store_result->IsFailure()) return store_result; return hashtable; } @@ -4981,7 +4990,8 @@ MaybeObject* JSObject::SetHiddenPropertiesHashTable(Object* value) { value, DONT_ENUM, kNonStrictMode, - OMIT_EXTENSIBILITY_CHECK); + OMIT_EXTENSIBILITY_CHECK, + FORCE_FIELD); if (store_result->IsFailure()) return store_result; return this; } @@ -6457,8 +6467,8 @@ Object* JSObject::SlowReverseLookup(Object* value) { } else if (property == value) { return descs->GetKey(i); } - } else if (descs->GetType(i) == CONSTANT_FUNCTION) { - if (descs->GetConstantFunction(i) == value) { + } else if (descs->GetType(i) == CONSTANT) { + if (descs->GetConstant(i) == value) { return descs->GetKey(i); } } @@ -7800,8 +7810,8 @@ MaybeObject* DescriptorArray::Merge(int verbatim, PropertyDetails other_details = other->GetDetails(descriptor); if (details.type() == FIELD || other_details.type() == FIELD || - (details.type() == CONSTANT_FUNCTION && - other_details.type() == CONSTANT_FUNCTION && + (details.type() == CONSTANT && + other_details.type() == CONSTANT && GetValue(descriptor) != other->GetValue(descriptor))) { Representation representation = details.representation().generalize(other_details.representation()); @@ -7850,8 +7860,8 @@ bool DescriptorArray::IsMoreGeneralThan(int verbatim, if (!other_details.representation().fits_into(details.representation())) { return false; } - if (details.type() == CONSTANT_FUNCTION) { - if (other_details.type() != CONSTANT_FUNCTION) return false; + if (details.type() == CONSTANT) { + if (other_details.type() != CONSTANT) return false; if (GetValue(descriptor) != other->GetValue(descriptor)) return false; } } @@ -9224,6 +9234,7 @@ void JSFunction::MarkForLazyRecompilation() { ASSERT(!IsOptimized()); ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); + ASSERT(!shared()->is_generator()); set_code_no_write_barrier( GetIsolate()->builtins()->builtin(Builtins::kLazyRecompile)); // No write barrier required, since the builtin is part of the root set. @@ -9234,10 +9245,8 @@ void JSFunction::MarkForParallelRecompilation() { ASSERT(is_compiled() || GetIsolate()->DebuggerHasBreakPoints()); ASSERT(!IsOptimized()); ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); - if (!FLAG_parallel_recompilation) { - JSFunction::MarkForLazyRecompilation(); - return; - } + ASSERT(!shared()->is_generator()); + ASSERT(FLAG_parallel_recompilation); if (FLAG_trace_parallel_recompilation) { PrintF(" ** Marking "); PrintName(); @@ -10688,7 +10697,7 @@ const char* Code::StubType2String(StubType type) { switch (type) { case NORMAL: return "NORMAL"; case FIELD: return "FIELD"; - case CONSTANT_FUNCTION: return "CONSTANT_FUNCTION"; + case CONSTANT: return "CONSTANT"; case CALLBACKS: return "CALLBACKS"; case INTERCEPTOR: return "INTERCEPTOR"; case MAP_TRANSITION: return "MAP_TRANSITION"; @@ -11348,14 +11357,6 @@ bool DependentCode::Contains(DependencyGroup group, Code* code) { } -class DeoptimizeDependentCodeFilter : public OptimizedFunctionFilter { - public: - virtual bool TakeFunction(JSFunction* function) { - return function->code()->marked_for_deoptimization(); - } -}; - - void DependentCode::DeoptimizeDependentCodeGroup( Isolate* isolate, DependentCode::DependencyGroup group) { @@ -11365,10 +11366,14 @@ void DependentCode::DeoptimizeDependentCodeGroup( int end = starts.at(group + 1); int code_entries = starts.number_of_entries(); if (start == end) return; + + // Collect all the code to deoptimize. + Zone zone(isolate); + ZoneList codes(end - start, &zone); for (int i = start; i < end; i++) { if (is_code_at(i)) { Code* code = code_at(i); - code->set_marked_for_deoptimization(true); + if (!code->marked_for_deoptimization()) codes.Add(code, &zone); } else { CompilationInfo* info = compilation_info_at(i); info->AbortDueToDependencyChange(); @@ -11384,8 +11389,7 @@ void DependentCode::DeoptimizeDependentCodeGroup( clear_at(i); } set_number_of_entries(group, 0); - DeoptimizeDependentCodeFilter filter; - Deoptimizer::DeoptimizeAllFunctionsWith(isolate, &filter); + Deoptimizer::DeoptimizeCodeList(isolate, &codes); } @@ -15269,9 +15273,7 @@ MaybeObject* NameDictionary::TransformPropertiesToFastFor( PropertyType type = details.type(); if (value->IsJSFunction()) { - ConstantFunctionDescriptor d(key, - JSFunction::cast(value), - details.attributes()); + ConstantDescriptor d(key, value, details.attributes()); descriptors->Set(enumeration_index - 1, &d, witness); } else if (type == NORMAL) { if (current_offset < inobject_props) { @@ -15918,10 +15920,11 @@ Type* PropertyCell::UpdateType(Handle cell, Handle value) { Isolate* isolate = cell->GetIsolate(); Handle old_type(cell->type(), isolate); - Handle new_type((value->IsSmi() || value->IsJSFunction() || - value->IsUndefined()) - ? Type::Constant(value, isolate) - : Type::Any(), isolate); + // TODO(2803): Do not track ConsString as constant because they cannot be + // embedded into code. + Handle new_type(value->IsConsString() || value->IsTheHole() + ? Type::Any() + : Type::Constant(value, isolate), isolate); if (new_type->Is(old_type)) { return *old_type; diff --git a/deps/v8/src/objects.h b/deps/v8/src/objects.h index f197b23..36611ee 100644 --- a/deps/v8/src/objects.h +++ b/deps/v8/src/objects.h @@ -357,7 +357,6 @@ const int kStubMinorKeyBits = kBitsPerInt - kSmiTagSize - kStubMajorKeyBits; V(ODDBALL_TYPE) \ V(CELL_TYPE) \ V(PROPERTY_CELL_TYPE) \ - V(BOX_TYPE) \ \ V(HEAP_NUMBER_TYPE) \ V(FOREIGN_TYPE) \ @@ -395,6 +394,7 @@ const int kStubMinorKeyBits = kBitsPerInt - kSmiTagSize - kStubMajorKeyBits; V(POLYMORPHIC_CODE_CACHE_TYPE) \ V(TYPE_FEEDBACK_INFO_TYPE) \ V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ + V(BOX_TYPE) \ \ V(FIXED_ARRAY_TYPE) \ V(FIXED_DOUBLE_ARRAY_TYPE) \ @@ -699,7 +699,6 @@ enum InstanceType { ODDBALL_TYPE, CELL_TYPE, PROPERTY_CELL_TYPE, - BOX_TYPE, // "Data", objects that cannot contain non-map-word pointers to heap // objects. @@ -738,6 +737,7 @@ enum InstanceType { POLYMORPHIC_CODE_CACHE_TYPE, TYPE_FEEDBACK_INFO_TYPE, ALIASED_ARGUMENTS_ENTRY_TYPE, + BOX_TYPE, // The following two instance types are only used when ENABLE_DEBUGGER_SUPPORT // is defined. However as include/v8.h contain some of the instance type // constants always having them avoids them getting different numbers @@ -1644,6 +1644,12 @@ class JSReceiver: public HeapObject { CERTAINLY_NOT_STORE_FROM_KEYED }; + // Indicates whether a value can be loaded as a constant. + enum StoreMode { + ALLOW_AS_CONSTANT, + FORCE_FIELD + }; + // Internal properties (e.g. the hidden properties dictionary) might // be added even though the receiver is non-extensible. enum ExtensibilityCheck { @@ -1871,14 +1877,16 @@ class JSObject: public JSReceiver { Object* value, PropertyAttributes attributes, StrictModeFlag strict_mode, - ExtensibilityCheck extensibility_check); + ExtensibilityCheck extensibility_check, + StoreMode mode = ALLOW_AS_CONSTANT); static Handle SetLocalPropertyIgnoreAttributes( Handle object, Handle key, Handle value, PropertyAttributes attributes, - ValueType value_type = OPTIMAL_REPRESENTATION); + ValueType value_type = OPTIMAL_REPRESENTATION, + StoreMode mode = ALLOW_AS_CONSTANT); static inline Handle ExpectedTransitionKey(Handle map); static inline Handle ExpectedTransitionTarget(Handle map); @@ -1906,7 +1914,8 @@ class JSObject: public JSReceiver { Name* key, Object* value, PropertyAttributes attributes, - ValueType value_type = OPTIMAL_REPRESENTATION); + ValueType value_type = OPTIMAL_REPRESENTATION, + StoreMode mode = ALLOW_AS_CONSTANT); // Retrieve a value in a normalized object given a lookup result. // Handles the special representation of JS global objects. @@ -2205,9 +2214,9 @@ class JSObject: public JSReceiver { // normal property is added instead, with a map transition. // This avoids the creation of many maps with the same constant // function, all orphaned. - MUST_USE_RESULT MaybeObject* AddConstantFunctionProperty( + MUST_USE_RESULT MaybeObject* AddConstantProperty( Name* name, - JSFunction* function, + Object* constant, PropertyAttributes attributes); MUST_USE_RESULT MaybeObject* ReplaceSlowProperty( @@ -2272,7 +2281,8 @@ class JSObject: public JSReceiver { StrictModeFlag strict_mode, StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED, ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK, - ValueType value_type = OPTIMAL_REPRESENTATION); + ValueType value_type = OPTIMAL_REPRESENTATION, + StoreMode mode = ALLOW_AS_CONSTANT); // Convert the object to use the canonical dictionary // representation. If the object is expected to have additional properties @@ -2863,7 +2873,7 @@ class DescriptorArray: public FixedArray { inline PropertyDetails GetDetails(int descriptor_number); inline PropertyType GetType(int descriptor_number); inline int GetFieldIndex(int descriptor_number); - inline JSFunction* GetConstantFunction(int descriptor_number); + inline Object* GetConstant(int descriptor_number); inline Object* GetCallbacksObject(int descriptor_number); inline AccessorDescriptor* GetCallbacks(int descriptor_number); @@ -4518,7 +4528,7 @@ class Code: public HeapObject { enum StubType { NORMAL, FIELD, - CONSTANT_FUNCTION, + CONSTANT, CALLBACKS, INTERCEPTOR, MAP_TRANSITION, @@ -4561,7 +4571,7 @@ class Code: public HeapObject { // [type_feedback_info]: Struct containing type feedback information for // unoptimized code. Optimized code can temporarily store the head of - // the list of the dependent optimized functions during deoptimization. + // the list of code to be deoptimized during mark-compact GC. // STUBs can use this slot to store arbitrary information as a Smi. // Will contain either a TypeFeedbackInfo object, or JSFunction object, // or undefined, or a Smi. @@ -4569,8 +4579,11 @@ class Code: public HeapObject { inline void InitializeTypeFeedbackInfoNoWriteBarrier(Object* value); inline int stub_info(); inline void set_stub_info(int info); - inline Object* deoptimizing_functions(); - inline void set_deoptimizing_functions(Object* value); + + // Used during GC to code a list of code objects to deoptimize. + inline Object* code_to_deoptimize_link(); + inline void set_code_to_deoptimize_link(Object* value); + inline Object** code_to_deoptimize_link_slot(); // [gc_metadata]: Field used to hold GC related metadata. The contents of this // field does not have to be traced during garbage collection since @@ -5626,6 +5639,7 @@ class Map: public HeapObject { inline void NotifyLeafMapLayoutChange(); inline bool CanOmitPrototypeChecks(); + inline bool CanOmitMapChecks(); void AddDependentCompilationInfo(DependentCode::DependencyGroup group, CompilationInfo* info); @@ -6761,18 +6775,6 @@ class JSFunction: public JSObject { // Retrieve the native context from a function's literal array. static Context* NativeContextFromLiterals(FixedArray* literals); -#ifdef DEBUG - bool FunctionsInFunctionListShareSameCode() { - Object* current = this; - while (!current->IsUndefined()) { - JSFunction* function = JSFunction::cast(current); - current = function->next_function_link(); - if (function->code() != this->code()) return false; - } - return true; - } -#endif - bool PassesHydrogenFilter(); // Layout descriptors. The last property (from kNonWeakFieldsEndOffset to diff --git a/deps/v8/src/optimizing-compiler-thread.cc b/deps/v8/src/optimizing-compiler-thread.cc index 21ef237..11d60c3 100644 --- a/deps/v8/src/optimizing-compiler-thread.cc +++ b/deps/v8/src/optimizing-compiler-thread.cc @@ -60,12 +60,23 @@ void OptimizingCompilerThread::Run() { OS::Sleep(FLAG_parallel_recompilation_delay); } - if (Acquire_Load(&stop_thread_)) { - stop_semaphore_->Signal(); - if (FLAG_trace_parallel_recompilation) { - time_spent_total_ = OS::Ticks() - epoch; - } - return; + switch (static_cast(Acquire_Load(&stop_thread_))) { + case CONTINUE: + break; + case STOP: + if (FLAG_trace_parallel_recompilation) { + time_spent_total_ = OS::Ticks() - epoch; + } + stop_semaphore_->Signal(); + return; + case FLUSH: + // Reset input queue semaphore. + delete input_queue_semaphore_; + input_queue_semaphore_ = OS::CreateSemaphore(0); + // Signal for main thread to start flushing. + stop_semaphore_->Signal(); + // Return to start of consumer loop. + continue; } int64_t compiling_start = 0; @@ -102,9 +113,41 @@ void OptimizingCompilerThread::CompileNext() { } +void OptimizingCompilerThread::FlushQueue( + UnboundQueue* queue, + bool restore_function_code) { + ASSERT(!IsOptimizerThread()); + OptimizingCompiler* optimizing_compiler; + // The optimizing compiler is allocated in the CompilationInfo's zone. + while (queue->Dequeue(&optimizing_compiler)) { + CompilationInfo* info = optimizing_compiler->info(); + if (restore_function_code) { + Handle function = info->closure(); + function->ReplaceCode(function->shared()->code()); + } + delete info; + } +} + + +void OptimizingCompilerThread::Flush() { + ASSERT(!IsOptimizerThread()); + Release_Store(&stop_thread_, static_cast(FLUSH)); + input_queue_semaphore_->Signal(); + + FlushQueue(&input_queue_, true); + NoBarrier_Store(&queue_length_, static_cast(0)); + + stop_semaphore_->Wait(); + Release_Store(&stop_thread_, static_cast(CONTINUE)); + + FlushQueue(&output_queue_, true); +} + + void OptimizingCompilerThread::Stop() { ASSERT(!IsOptimizerThread()); - Release_Store(&stop_thread_, static_cast(true)); + Release_Store(&stop_thread_, static_cast(STOP)); input_queue_semaphore_->Signal(); stop_semaphore_->Wait(); @@ -114,14 +157,8 @@ void OptimizingCompilerThread::Stop() { while (NoBarrier_Load(&queue_length_) > 0) CompileNext(); InstallOptimizedFunctions(); } else { - OptimizingCompiler* optimizing_compiler; - // The optimizing compiler is allocated in the CompilationInfo's zone. - while (input_queue_.Dequeue(&optimizing_compiler)) { - delete optimizing_compiler->info(); - } - while (output_queue_.Dequeue(&optimizing_compiler)) { - delete optimizing_compiler->info(); - } + FlushQueue(&input_queue_, false); + FlushQueue(&output_queue_, false); } if (FLAG_trace_parallel_recompilation) { diff --git a/deps/v8/src/optimizing-compiler-thread.h b/deps/v8/src/optimizing-compiler-thread.h index 275ceb4..5a87a97 100644 --- a/deps/v8/src/optimizing-compiler-thread.h +++ b/deps/v8/src/optimizing-compiler-thread.h @@ -54,13 +54,13 @@ class OptimizingCompilerThread : public Thread { install_mutex_(OS::CreateMutex()), time_spent_compiling_(0), time_spent_total_(0) { - NoBarrier_Store(&stop_thread_, static_cast(false)); + NoBarrier_Store(&stop_thread_, static_cast(CONTINUE)); NoBarrier_Store(&queue_length_, static_cast(0)); } void Run(); void Stop(); - void CompileNext(); + void Flush(); void QueueForOptimization(OptimizingCompiler* optimizing_compiler); void InstallOptimizedFunctions(); @@ -92,6 +92,12 @@ class OptimizingCompilerThread : public Thread { } private: + enum StopFlag { CONTINUE, STOP, FLUSH }; + + void FlushQueue(UnboundQueue* queue, + bool restore_function_code); + void CompileNext(); + #ifdef DEBUG int thread_id_; Mutex* thread_id_mutex_; diff --git a/deps/v8/src/platform-cygwin.cc b/deps/v8/src/platform-cygwin.cc index 51321c7..4c7b017 100644 --- a/deps/v8/src/platform-cygwin.cc +++ b/deps/v8/src/platform-cygwin.cc @@ -51,35 +51,10 @@ namespace v8 { namespace internal { -// 0 is never a valid thread id -static const pthread_t kNoThread = (pthread_t) 0; - - -double ceiling(double x) { - return ceil(x); -} - static Mutex* limit_mutex = NULL; -void OS::PostSetUp() { - POSIXPostSetUp(); -} - - -uint64_t OS::CpuFeaturesImpliedByPlatform() { - return 0; // Nothing special about Cygwin. -} - - -int OS::ActivationFrameAlignment() { - // With gcc 4.4 the tree vectorization optimizer can generate code - // that requires 16 byte alignment such as movdqa on x86. - return 16; -} - - const char* OS::LocalTimezone(double time) { if (std::isnan(time)) return ""; time_t tv = static_cast(floor(time/msPerSecond)); @@ -126,11 +101,6 @@ bool OS::IsOutsideAllocatedSpace(void* address) { } -size_t OS::AllocateAlignment() { - return sysconf(_SC_PAGESIZE); -} - - void* OS::Allocate(const size_t requested, size_t* allocated, bool is_executable) { @@ -147,48 +117,6 @@ void* OS::Allocate(const size_t requested, } -void OS::Free(void* address, const size_t size) { - // TODO(1240712): munmap has a return value which is ignored here. - int result = munmap(address, size); - USE(result); - ASSERT(result == 0); -} - - -void OS::ProtectCode(void* address, const size_t size) { - DWORD old_protect; - VirtualProtect(address, size, PAGE_EXECUTE_READ, &old_protect); -} - - -void OS::Guard(void* address, const size_t size) { - DWORD oldprotect; - VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect); -} - - -void OS::Sleep(int milliseconds) { - unsigned int ms = static_cast(milliseconds); - usleep(1000 * ms); -} - - -int OS::NumberOfCores() { - return sysconf(_SC_NPROCESSORS_ONLN); -} - - -void OS::Abort() { - // Redirect to std abort to signal abnormal program termination. - abort(); -} - - -void OS::DebugBreak() { - asm("int $3"); -} - - void OS::DumpBacktrace() { // Currently unsupported. } @@ -470,110 +398,6 @@ bool VirtualMemory::HasLazyCommits() { } -class Thread::PlatformData : public Malloced { - public: - PlatformData() : thread_(kNoThread) {} - pthread_t thread_; // Thread handle for pthread. -}; - - -Thread::Thread(const Options& options) - : data_(new PlatformData()), - stack_size_(options.stack_size()), - start_semaphore_(NULL) { - set_name(options.name()); -} - - -Thread::~Thread() { - delete data_; -} - - -static void* ThreadEntry(void* arg) { - Thread* thread = reinterpret_cast(arg); - // This is also initialized by the first argument to pthread_create() but we - // don't know which thread will run first (the original thread or the new - // one) so we initialize it here too. - thread->data()->thread_ = pthread_self(); - ASSERT(thread->data()->thread_ != kNoThread); - thread->NotifyStartedAndRun(); - return NULL; -} - - -void Thread::set_name(const char* name) { - strncpy(name_, name, sizeof(name_)); - name_[sizeof(name_) - 1] = '\0'; -} - - -void Thread::Start() { - pthread_attr_t* attr_ptr = NULL; - pthread_attr_t attr; - if (stack_size_ > 0) { - pthread_attr_init(&attr); - pthread_attr_setstacksize(&attr, static_cast(stack_size_)); - attr_ptr = &attr; - } - pthread_create(&data_->thread_, attr_ptr, ThreadEntry, this); - ASSERT(data_->thread_ != kNoThread); -} - - -void Thread::Join() { - pthread_join(data_->thread_, NULL); -} - - -static inline Thread::LocalStorageKey PthreadKeyToLocalKey( - pthread_key_t pthread_key) { - // We need to cast pthread_key_t to Thread::LocalStorageKey in two steps - // because pthread_key_t is a pointer type on Cygwin. This will probably not - // work on 64-bit platforms, but Cygwin doesn't support 64-bit anyway. - STATIC_ASSERT(sizeof(Thread::LocalStorageKey) == sizeof(pthread_key_t)); - intptr_t ptr_key = reinterpret_cast(pthread_key); - return static_cast(ptr_key); -} - - -static inline pthread_key_t LocalKeyToPthreadKey( - Thread::LocalStorageKey local_key) { - STATIC_ASSERT(sizeof(Thread::LocalStorageKey) == sizeof(pthread_key_t)); - intptr_t ptr_key = static_cast(local_key); - return reinterpret_cast(ptr_key); -} - - -Thread::LocalStorageKey Thread::CreateThreadLocalKey() { - pthread_key_t key; - int result = pthread_key_create(&key, NULL); - USE(result); - ASSERT(result == 0); - return PthreadKeyToLocalKey(key); -} - - -void Thread::DeleteThreadLocalKey(LocalStorageKey key) { - pthread_key_t pthread_key = LocalKeyToPthreadKey(key); - int result = pthread_key_delete(pthread_key); - USE(result); - ASSERT(result == 0); -} - - -void* Thread::GetThreadLocal(LocalStorageKey key) { - pthread_key_t pthread_key = LocalKeyToPthreadKey(key); - return pthread_getspecific(pthread_key); -} - - -void Thread::SetThreadLocal(LocalStorageKey key, void* value) { - pthread_key_t pthread_key = LocalKeyToPthreadKey(key); - pthread_setspecific(pthread_key, value); -} - - class CygwinSemaphore : public Semaphore { public: explicit CygwinSemaphore(int count) { sem_init(&sem_, 0, count); } diff --git a/deps/v8/src/platform-freebsd.cc b/deps/v8/src/platform-freebsd.cc index c771cd3..e0917fa 100644 --- a/deps/v8/src/platform-freebsd.cc +++ b/deps/v8/src/platform-freebsd.cc @@ -62,40 +62,10 @@ namespace v8 { namespace internal { -// 0 is never a valid thread id on FreeBSD since tids and pids share a -// name space and pid 0 is used to kill the group (see man 2 kill). -static const pthread_t kNoThread = (pthread_t) 0; - - -double ceiling(double x) { - // Correct as on OS X - if (-1.0 < x && x < 0.0) { - return -0.0; - } else { - return ceil(x); - } -} - static Mutex* limit_mutex = NULL; -void OS::PostSetUp() { - POSIXPostSetUp(); -} - - -uint64_t OS::CpuFeaturesImpliedByPlatform() { - return 0; // FreeBSD runs on anything. -} - - -int OS::ActivationFrameAlignment() { - // 16 byte alignment on FreeBSD - return 16; -} - - const char* OS::LocalTimezone(double time) { if (std::isnan(time)) return ""; time_t tv = static_cast(floor(time/msPerSecond)); @@ -139,11 +109,6 @@ bool OS::IsOutsideAllocatedSpace(void* address) { } -size_t OS::AllocateAlignment() { - return getpagesize(); -} - - void* OS::Allocate(const size_t requested, size_t* allocated, bool executable) { @@ -161,40 +126,6 @@ void* OS::Allocate(const size_t requested, } -void OS::Free(void* buf, const size_t length) { - // TODO(1240712): munmap has a return value which is ignored here. - int result = munmap(buf, length); - USE(result); - ASSERT(result == 0); -} - - -void OS::Sleep(int milliseconds) { - unsigned int ms = static_cast(milliseconds); - usleep(1000 * ms); -} - - -int OS::NumberOfCores() { - return sysconf(_SC_NPROCESSORS_ONLN); -} - - -void OS::Abort() { - // Redirect to std abort to signal abnormal program termination. - abort(); -} - - -void OS::DebugBreak() { -#if (defined(__arm__) || defined(__thumb__)) - asm("bkpt 0"); -#else - asm("int $3"); -#endif -} - - void OS::DumpBacktrace() { POSIXBacktraceHelper::DumpBacktrace(); } @@ -441,90 +372,6 @@ bool VirtualMemory::HasLazyCommits() { } -class Thread::PlatformData : public Malloced { - public: - pthread_t thread_; // Thread handle for pthread. -}; - - -Thread::Thread(const Options& options) - : data_(new PlatformData), - stack_size_(options.stack_size()), - start_semaphore_(NULL) { - set_name(options.name()); -} - - -Thread::~Thread() { - delete data_; -} - - -static void* ThreadEntry(void* arg) { - Thread* thread = reinterpret_cast(arg); - // This is also initialized by the first argument to pthread_create() but we - // don't know which thread will run first (the original thread or the new - // one) so we initialize it here too. - thread->data()->thread_ = pthread_self(); - ASSERT(thread->data()->thread_ != kNoThread); - thread->NotifyStartedAndRun(); - return NULL; -} - - -void Thread::set_name(const char* name) { - strncpy(name_, name, sizeof(name_)); - name_[sizeof(name_) - 1] = '\0'; -} - - -void Thread::Start() { - pthread_attr_t* attr_ptr = NULL; - pthread_attr_t attr; - if (stack_size_ > 0) { - pthread_attr_init(&attr); - pthread_attr_setstacksize(&attr, static_cast(stack_size_)); - attr_ptr = &attr; - } - pthread_create(&data_->thread_, attr_ptr, ThreadEntry, this); - ASSERT(data_->thread_ != kNoThread); -} - - -void Thread::Join() { - pthread_join(data_->thread_, NULL); -} - - -Thread::LocalStorageKey Thread::CreateThreadLocalKey() { - pthread_key_t key; - int result = pthread_key_create(&key, NULL); - USE(result); - ASSERT(result == 0); - return static_cast(key); -} - - -void Thread::DeleteThreadLocalKey(LocalStorageKey key) { - pthread_key_t pthread_key = static_cast(key); - int result = pthread_key_delete(pthread_key); - USE(result); - ASSERT(result == 0); -} - - -void* Thread::GetThreadLocal(LocalStorageKey key) { - pthread_key_t pthread_key = static_cast(key); - return pthread_getspecific(pthread_key); -} - - -void Thread::SetThreadLocal(LocalStorageKey key, void* value) { - pthread_key_t pthread_key = static_cast(key); - pthread_setspecific(pthread_key, value); -} - - class FreeBSDSemaphore : public Semaphore { public: explicit FreeBSDSemaphore(int count) { sem_init(&sem_, 0, count); } diff --git a/deps/v8/src/platform-linux.cc b/deps/v8/src/platform-linux.cc index 613d243..5c252bb 100644 --- a/deps/v8/src/platform-linux.cc +++ b/deps/v8/src/platform-linux.cc @@ -75,29 +75,10 @@ namespace v8 { namespace internal { -// 0 is never a valid thread id on Linux since tids and pids share a -// name space and pid 0 is reserved (see man 2 kill). -static const pthread_t kNoThread = (pthread_t) 0; - - -double ceiling(double x) { - return ceil(x); -} - static Mutex* limit_mutex = NULL; -void OS::PostSetUp() { - POSIXPostSetUp(); -} - - -uint64_t OS::CpuFeaturesImpliedByPlatform() { - return 0; // Linux runs on anything. -} - - #ifdef __arm__ static bool CPUInfoContainsString(const char * search_string) { const char* file_name = "/proc/cpuinfo"; @@ -327,20 +308,6 @@ bool OS::MipsCpuHasFeature(CpuFeature feature) { #endif // def __mips__ -int OS::ActivationFrameAlignment() { -#if V8_TARGET_ARCH_ARM - // On EABI ARM targets this is required for fp correctness in the - // runtime system. - return 8; -#elif V8_TARGET_ARCH_MIPS - return 8; -#endif - // With gcc 4.4 the tree vectorization optimizer can generate code - // that requires 16 byte alignment such as movdqa on x86. - return 16; -} - - const char* OS::LocalTimezone(double time) { if (std::isnan(time)) return ""; time_t tv = static_cast(floor(time/msPerSecond)); @@ -384,11 +351,6 @@ bool OS::IsOutsideAllocatedSpace(void* address) { } -size_t OS::AllocateAlignment() { - return sysconf(_SC_PAGESIZE); -} - - void* OS::Allocate(const size_t requested, size_t* allocated, bool is_executable) { @@ -407,49 +369,6 @@ void* OS::Allocate(const size_t requested, } -void OS::Free(void* address, const size_t size) { - // TODO(1240712): munmap has a return value which is ignored here. - int result = munmap(address, size); - USE(result); - ASSERT(result == 0); -} - - -void OS::Sleep(int milliseconds) { - unsigned int ms = static_cast(milliseconds); - usleep(1000 * ms); -} - - -int OS::NumberOfCores() { - return sysconf(_SC_NPROCESSORS_ONLN); -} - - -void OS::Abort() { - // Redirect to std abort to signal abnormal program termination. - if (FLAG_break_on_abort) { - DebugBreak(); - } - abort(); -} - - -void OS::DebugBreak() { -// TODO(lrn): Introduce processor define for runtime system (!= V8_ARCH_x, -// which is the architecture of generated code). -#if (defined(__arm__) || defined(__thumb__)) - asm("bkpt 0"); -#elif defined(__mips__) - asm("break"); -#elif defined(__native_client__) - asm("hlt"); -#else - asm("int $3"); -#endif -} - - void OS::DumpBacktrace() { // backtrace is a glibc extension. #if defined(__GLIBC__) && !defined(__UCLIBC__) @@ -764,101 +683,6 @@ bool VirtualMemory::HasLazyCommits() { } -class Thread::PlatformData : public Malloced { - public: - PlatformData() : thread_(kNoThread) {} - - pthread_t thread_; // Thread handle for pthread. -}; - -Thread::Thread(const Options& options) - : data_(new PlatformData()), - stack_size_(options.stack_size()), - start_semaphore_(NULL) { - set_name(options.name()); -} - - -Thread::~Thread() { - delete data_; -} - - -static void* ThreadEntry(void* arg) { - Thread* thread = reinterpret_cast(arg); - // This is also initialized by the first argument to pthread_create() but we - // don't know which thread will run first (the original thread or the new - // one) so we initialize it here too. -#ifdef PR_SET_NAME - prctl(PR_SET_NAME, - reinterpret_cast(thread->name()), // NOLINT - 0, 0, 0); -#endif - thread->data()->thread_ = pthread_self(); - ASSERT(thread->data()->thread_ != kNoThread); - thread->NotifyStartedAndRun(); - return NULL; -} - - -void Thread::set_name(const char* name) { - strncpy(name_, name, sizeof(name_)); - name_[sizeof(name_) - 1] = '\0'; -} - - -void Thread::Start() { - pthread_attr_t* attr_ptr = NULL; -#if defined(__native_client__) - // use default stack size. -#else - pthread_attr_t attr; - if (stack_size_ > 0) { - pthread_attr_init(&attr); - pthread_attr_setstacksize(&attr, static_cast(stack_size_)); - attr_ptr = &attr; - } -#endif - int result = pthread_create(&data_->thread_, attr_ptr, ThreadEntry, this); - CHECK_EQ(0, result); - ASSERT(data_->thread_ != kNoThread); -} - - -void Thread::Join() { - pthread_join(data_->thread_, NULL); -} - - -Thread::LocalStorageKey Thread::CreateThreadLocalKey() { - pthread_key_t key; - int result = pthread_key_create(&key, NULL); - USE(result); - ASSERT(result == 0); - return static_cast(key); -} - - -void Thread::DeleteThreadLocalKey(LocalStorageKey key) { - pthread_key_t pthread_key = static_cast(key); - int result = pthread_key_delete(pthread_key); - USE(result); - ASSERT(result == 0); -} - - -void* Thread::GetThreadLocal(LocalStorageKey key) { - pthread_key_t pthread_key = static_cast(key); - return pthread_getspecific(pthread_key); -} - - -void Thread::SetThreadLocal(LocalStorageKey key, void* value) { - pthread_key_t pthread_key = static_cast(key); - pthread_setspecific(pthread_key, value); -} - - class LinuxSemaphore : public Semaphore { public: explicit LinuxSemaphore(int count) { sem_init(&sem_, 0, count); } diff --git a/deps/v8/src/platform-macos.cc b/deps/v8/src/platform-macos.cc index 097691b..6135cd1 100644 --- a/deps/v8/src/platform-macos.cc +++ b/deps/v8/src/platform-macos.cc @@ -78,29 +78,10 @@ extern "C" { namespace v8 { namespace internal { -// 0 is never a valid thread id on MacOSX since a pthread_t is -// a pointer. -static const pthread_t kNoThread = (pthread_t) 0; - - -double ceiling(double x) { - // Correct Mac OS X Leopard 'ceil' behavior. - if (-1.0 < x && x < 0.0) { - return -0.0; - } else { - return ceil(x); - } -} - static Mutex* limit_mutex = NULL; -void OS::PostSetUp() { - POSIXPostSetUp(); -} - - // We keep the lowest and highest addresses mapped as a quick way of // determining that pointers are outside the heap (used mostly in assertions // and verification). The estimate is conservative, i.e., not all addresses in @@ -126,11 +107,6 @@ bool OS::IsOutsideAllocatedSpace(void* address) { } -size_t OS::AllocateAlignment() { - return getpagesize(); -} - - // Constants used for mmap. // kMmapFd is used to pass vm_alloc flags to tag the region with the user // defined tag 255 This helps identify V8-allocated regions in memory analysis @@ -160,35 +136,6 @@ void* OS::Allocate(const size_t requested, } -void OS::Free(void* address, const size_t size) { - // TODO(1240712): munmap has a return value which is ignored here. - int result = munmap(address, size); - USE(result); - ASSERT(result == 0); -} - - -void OS::Sleep(int milliseconds) { - usleep(1000 * milliseconds); -} - - -int OS::NumberOfCores() { - return sysconf(_SC_NPROCESSORS_ONLN); -} - - -void OS::Abort() { - // Redirect to std abort to signal abnormal program termination - abort(); -} - - -void OS::DebugBreak() { - asm("int $3"); -} - - void OS::DumpBacktrace() { // If weak link to execinfo lib has failed, ie because we are on 10.4, abort. if (backtrace == NULL) return; @@ -284,21 +231,6 @@ void OS::SignalCodeMovingGC() { } -uint64_t OS::CpuFeaturesImpliedByPlatform() { - // MacOSX requires all these to install so we can assume they are present. - // These constants are defined by the CPUid instructions. - const uint64_t one = 1; - return (one << SSE2) | (one << CMOV) | (one << RDTSC) | (one << CPUID); -} - - -int OS::ActivationFrameAlignment() { - // OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI - // Function Call Guide". - return 16; -} - - const char* OS::LocalTimezone(double time) { if (std::isnan(time)) return ""; time_t tv = static_cast(floor(time/msPerSecond)); @@ -460,177 +392,6 @@ bool VirtualMemory::HasLazyCommits() { } -class Thread::PlatformData : public Malloced { - public: - PlatformData() : thread_(kNoThread) {} - pthread_t thread_; // Thread handle for pthread. -}; - - -Thread::Thread(const Options& options) - : data_(new PlatformData), - stack_size_(options.stack_size()), - start_semaphore_(NULL) { - set_name(options.name()); -} - - -Thread::~Thread() { - delete data_; -} - - -static void SetThreadName(const char* name) { - // pthread_setname_np is only available in 10.6 or later, so test - // for it at runtime. - int (*dynamic_pthread_setname_np)(const char*); - *reinterpret_cast(&dynamic_pthread_setname_np) = - dlsym(RTLD_DEFAULT, "pthread_setname_np"); - if (!dynamic_pthread_setname_np) - return; - - // Mac OS X does not expose the length limit of the name, so hardcode it. - static const int kMaxNameLength = 63; - USE(kMaxNameLength); - ASSERT(Thread::kMaxThreadNameLength <= kMaxNameLength); - dynamic_pthread_setname_np(name); -} - - -static void* ThreadEntry(void* arg) { - Thread* thread = reinterpret_cast(arg); - // This is also initialized by the first argument to pthread_create() but we - // don't know which thread will run first (the original thread or the new - // one) so we initialize it here too. - thread->data()->thread_ = pthread_self(); - SetThreadName(thread->name()); - ASSERT(thread->data()->thread_ != kNoThread); - thread->NotifyStartedAndRun(); - return NULL; -} - - -void Thread::set_name(const char* name) { - strncpy(name_, name, sizeof(name_)); - name_[sizeof(name_) - 1] = '\0'; -} - - -void Thread::Start() { - pthread_attr_t* attr_ptr = NULL; - pthread_attr_t attr; - if (stack_size_ > 0) { - pthread_attr_init(&attr); - pthread_attr_setstacksize(&attr, static_cast(stack_size_)); - attr_ptr = &attr; - } - pthread_create(&data_->thread_, attr_ptr, ThreadEntry, this); - ASSERT(data_->thread_ != kNoThread); -} - - -void Thread::Join() { - pthread_join(data_->thread_, NULL); -} - - -#ifdef V8_FAST_TLS_SUPPORTED - -static Atomic32 tls_base_offset_initialized = 0; -intptr_t kMacTlsBaseOffset = 0; - -// It's safe to do the initialization more that once, but it has to be -// done at least once. -static void InitializeTlsBaseOffset() { - const size_t kBufferSize = 128; - char buffer[kBufferSize]; - size_t buffer_size = kBufferSize; - int ctl_name[] = { CTL_KERN , KERN_OSRELEASE }; - if (sysctl(ctl_name, 2, buffer, &buffer_size, NULL, 0) != 0) { - V8_Fatal(__FILE__, __LINE__, "V8 failed to get kernel version"); - } - // The buffer now contains a string of the form XX.YY.ZZ, where - // XX is the major kernel version component. - // Make sure the buffer is 0-terminated. - buffer[kBufferSize - 1] = '\0'; - char* period_pos = strchr(buffer, '.'); - *period_pos = '\0'; - int kernel_version_major = - static_cast(strtol(buffer, NULL, 10)); // NOLINT - // The constants below are taken from pthreads.s from the XNU kernel - // sources archive at www.opensource.apple.com. - if (kernel_version_major < 11) { - // 8.x.x (Tiger), 9.x.x (Leopard), 10.x.x (Snow Leopard) have the - // same offsets. -#if V8_HOST_ARCH_IA32 - kMacTlsBaseOffset = 0x48; -#else - kMacTlsBaseOffset = 0x60; -#endif - } else { - // 11.x.x (Lion) changed the offset. - kMacTlsBaseOffset = 0; - } - - Release_Store(&tls_base_offset_initialized, 1); -} - - -static void CheckFastTls(Thread::LocalStorageKey key) { - void* expected = reinterpret_cast(0x1234CAFE); - Thread::SetThreadLocal(key, expected); - void* actual = Thread::GetExistingThreadLocal(key); - if (expected != actual) { - V8_Fatal(__FILE__, __LINE__, - "V8 failed to initialize fast TLS on current kernel"); - } - Thread::SetThreadLocal(key, NULL); -} - -#endif // V8_FAST_TLS_SUPPORTED - - -Thread::LocalStorageKey Thread::CreateThreadLocalKey() { -#ifdef V8_FAST_TLS_SUPPORTED - bool check_fast_tls = false; - if (tls_base_offset_initialized == 0) { - check_fast_tls = true; - InitializeTlsBaseOffset(); - } -#endif - pthread_key_t key; - int result = pthread_key_create(&key, NULL); - USE(result); - ASSERT(result == 0); - LocalStorageKey typed_key = static_cast(key); -#ifdef V8_FAST_TLS_SUPPORTED - // If we just initialized fast TLS support, make sure it works. - if (check_fast_tls) CheckFastTls(typed_key); -#endif - return typed_key; -} - - -void Thread::DeleteThreadLocalKey(LocalStorageKey key) { - pthread_key_t pthread_key = static_cast(key); - int result = pthread_key_delete(pthread_key); - USE(result); - ASSERT(result == 0); -} - - -void* Thread::GetThreadLocal(LocalStorageKey key) { - pthread_key_t pthread_key = static_cast(key); - return pthread_getspecific(pthread_key); -} - - -void Thread::SetThreadLocal(LocalStorageKey key, void* value) { - pthread_key_t pthread_key = static_cast(key); - pthread_setspecific(pthread_key, value); -} - - class MacOSSemaphore : public Semaphore { public: explicit MacOSSemaphore(int count) { diff --git a/deps/v8/src/platform-openbsd.cc b/deps/v8/src/platform-openbsd.cc index a40df48..e591601 100644 --- a/deps/v8/src/platform-openbsd.cc +++ b/deps/v8/src/platform-openbsd.cc @@ -60,63 +60,10 @@ namespace v8 { namespace internal { -// 0 is never a valid thread id on Linux and OpenBSD since tids and pids share a -// name space and pid 0 is reserved (see man 2 kill). -static const pthread_t kNoThread = (pthread_t) 0; - - -double ceiling(double x) { - return ceil(x); -} - static Mutex* limit_mutex = NULL; -static void* GetRandomMmapAddr() { - Isolate* isolate = Isolate::UncheckedCurrent(); - // Note that the current isolate isn't set up in a call path via - // CpuFeatures::Probe. We don't care about randomization in this case because - // the code page is immediately freed. - if (isolate != NULL) { -#if V8_TARGET_ARCH_X64 - uint64_t rnd1 = V8::RandomPrivate(isolate); - uint64_t rnd2 = V8::RandomPrivate(isolate); - uint64_t raw_addr = (rnd1 << 32) ^ rnd2; - // Currently available CPUs have 48 bits of virtual addressing. Truncate - // the hint address to 46 bits to give the kernel a fighting chance of - // fulfilling our placement request. - raw_addr &= V8_UINT64_C(0x3ffffffff000); -#else - uint32_t raw_addr = V8::RandomPrivate(isolate); - // The range 0x20000000 - 0x60000000 is relatively unpopulated across a - // variety of ASLR modes (PAE kernel, NX compat mode, etc). - raw_addr &= 0x3ffff000; - raw_addr += 0x20000000; -#endif - return reinterpret_cast(raw_addr); - } - return NULL; -} - - -void OS::PostSetUp() { - POSIXPostSetUp(); -} - - -uint64_t OS::CpuFeaturesImpliedByPlatform() { - return 0; -} - - -int OS::ActivationFrameAlignment() { - // With gcc 4.4 the tree vectorization optimizer can generate code - // that requires 16 byte alignment such as movdqa on x86. - return 16; -} - - const char* OS::LocalTimezone(double time) { if (std::isnan(time)) return ""; time_t tv = static_cast(floor(time/msPerSecond)); @@ -160,17 +107,12 @@ bool OS::IsOutsideAllocatedSpace(void* address) { } -size_t OS::AllocateAlignment() { - return sysconf(_SC_PAGESIZE); -} - - void* OS::Allocate(const size_t requested, size_t* allocated, bool is_executable) { const size_t msize = RoundUp(requested, AllocateAlignment()); int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0); - void* addr = GetRandomMmapAddr(); + void* addr = OS::GetRandomMmapAddr(); void* mbase = mmap(addr, msize, prot, MAP_PRIVATE | MAP_ANON, -1, 0); if (mbase == MAP_FAILED) { LOG(i::Isolate::Current(), @@ -183,36 +125,6 @@ void* OS::Allocate(const size_t requested, } -void OS::Free(void* address, const size_t size) { - // TODO(1240712): munmap has a return value which is ignored here. - int result = munmap(address, size); - USE(result); - ASSERT(result == 0); -} - - -void OS::Sleep(int milliseconds) { - unsigned int ms = static_cast(milliseconds); - usleep(1000 * ms); -} - - -int OS::NumberOfCores() { - return sysconf(_SC_NPROCESSORS_ONLN); -} - - -void OS::Abort() { - // Redirect to std abort to signal abnormal program termination. - abort(); -} - - -void OS::DebugBreak() { - asm("int $3"); -} - - void OS::DumpBacktrace() { // Currently unsupported. } @@ -395,7 +307,7 @@ VirtualMemory::VirtualMemory(size_t size, size_t alignment) ASSERT(IsAligned(alignment, static_cast(OS::AllocateAlignment()))); size_t request_size = RoundUp(size + alignment, static_cast(OS::AllocateAlignment())); - void* reservation = mmap(GetRandomMmapAddr(), + void* reservation = mmap(OS::GetRandomMmapAddr(), request_size, PROT_NONE, MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, @@ -467,7 +379,7 @@ bool VirtualMemory::Guard(void* address) { void* VirtualMemory::ReserveRegion(size_t size) { - void* result = mmap(GetRandomMmapAddr(), + void* result = mmap(OS::GetRandomMmapAddr(), size, PROT_NONE, MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, @@ -517,96 +429,6 @@ bool VirtualMemory::HasLazyCommits() { } -class Thread::PlatformData : public Malloced { - public: - PlatformData() : thread_(kNoThread) {} - - pthread_t thread_; // Thread handle for pthread. -}; - -Thread::Thread(const Options& options) - : data_(new PlatformData()), - stack_size_(options.stack_size()), - start_semaphore_(NULL) { - set_name(options.name()); -} - - -Thread::~Thread() { - delete data_; -} - - -static void* ThreadEntry(void* arg) { - Thread* thread = reinterpret_cast(arg); - // This is also initialized by the first argument to pthread_create() but we - // don't know which thread will run first (the original thread or the new - // one) so we initialize it here too. -#ifdef PR_SET_NAME - prctl(PR_SET_NAME, - reinterpret_cast(thread->name()), // NOLINT - 0, 0, 0); -#endif - thread->data()->thread_ = pthread_self(); - ASSERT(thread->data()->thread_ != kNoThread); - thread->NotifyStartedAndRun(); - return NULL; -} - - -void Thread::set_name(const char* name) { - strncpy(name_, name, sizeof(name_)); - name_[sizeof(name_) - 1] = '\0'; -} - - -void Thread::Start() { - pthread_attr_t* attr_ptr = NULL; - pthread_attr_t attr; - if (stack_size_ > 0) { - pthread_attr_init(&attr); - pthread_attr_setstacksize(&attr, static_cast(stack_size_)); - attr_ptr = &attr; - } - pthread_create(&data_->thread_, attr_ptr, ThreadEntry, this); - ASSERT(data_->thread_ != kNoThread); -} - - -void Thread::Join() { - pthread_join(data_->thread_, NULL); -} - - -Thread::LocalStorageKey Thread::CreateThreadLocalKey() { - pthread_key_t key; - int result = pthread_key_create(&key, NULL); - USE(result); - ASSERT(result == 0); - return static_cast(key); -} - - -void Thread::DeleteThreadLocalKey(LocalStorageKey key) { - pthread_key_t pthread_key = static_cast(key); - int result = pthread_key_delete(pthread_key); - USE(result); - ASSERT(result == 0); -} - - -void* Thread::GetThreadLocal(LocalStorageKey key) { - pthread_key_t pthread_key = static_cast(key); - return pthread_getspecific(pthread_key); -} - - -void Thread::SetThreadLocal(LocalStorageKey key, void* value) { - pthread_key_t pthread_key = static_cast(key); - pthread_setspecific(pthread_key, value); -} - - class OpenBSDSemaphore : public Semaphore { public: explicit OpenBSDSemaphore(int count) { sem_init(&sem_, 0, count); } diff --git a/deps/v8/src/platform-posix.cc b/deps/v8/src/platform-posix.cc index 3aa8587..13b819b 100644 --- a/deps/v8/src/platform-posix.cc +++ b/deps/v8/src/platform-posix.cc @@ -31,7 +31,11 @@ #include "platform-posix.h" +#include #include +#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) +#include // for pthread_set_name_np +#endif #include // for sched_yield #include #include @@ -43,6 +47,13 @@ #include #include #include +#if defined(__linux__) +#include // for prctl +#endif +#if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || \ + defined(__NetBSD__) || defined(__OpenBSD__) +#include // for sysctl +#endif #include #include @@ -63,6 +74,21 @@ namespace v8 { namespace internal { +// 0 is never a valid thread id. +static const pthread_t kNoThread = (pthread_t) 0; + + +uint64_t OS::CpuFeaturesImpliedByPlatform() { +#if defined(__APPLE__) + // Mac OS X requires all these to install so we can assume they are present. + // These constants are defined by the CPUid instructions. + const uint64_t one = 1; + return (one << SSE2) | (one << CMOV) | (one << RDTSC) | (one << CPUID); +#else + return 0; // Nothing special about the other systems. +#endif +} + // Maximum size of the virtual memory. 0 means there is no artificial // limit. @@ -75,16 +101,44 @@ intptr_t OS::MaxVirtualMemory() { } +int OS::ActivationFrameAlignment() { +#if V8_TARGET_ARCH_ARM + // On EABI ARM targets this is required for fp correctness in the + // runtime system. + return 8; +#elif V8_TARGET_ARCH_MIPS + return 8; +#else + // Otherwise we just assume 16 byte alignment, i.e.: + // - With gcc 4.4 the tree vectorization optimizer can generate code + // that requires 16 byte alignment such as movdqa on x86. + // - Mac OS X and Solaris (64-bit) activation frames must be 16 byte-aligned; + // see "Mac OS X ABI Function Call Guide" + return 16; +#endif +} + + intptr_t OS::CommitPageSize() { static intptr_t page_size = getpagesize(); return page_size; } -#ifndef __CYGWIN__ +void OS::Free(void* address, const size_t size) { + // TODO(1240712): munmap has a return value which is ignored here. + int result = munmap(address, size); + USE(result); + ASSERT(result == 0); +} + + // Get rid of writable permission on code allocations. void OS::ProtectCode(void* address, const size_t size) { -#if defined(__native_client__) +#if defined(__CYGWIN__) + DWORD old_protect; + VirtualProtect(address, size, PAGE_EXECUTE_READ, &old_protect); +#elif defined(__native_client__) // The Native Client port of V8 uses an interpreter, so // code pages don't need PROT_EXEC. mprotect(address, size, PROT_READ); @@ -96,9 +150,13 @@ void OS::ProtectCode(void* address, const size_t size) { // Create guard pages. void OS::Guard(void* address, const size_t size) { +#if defined(__CYGWIN__) + DWORD oldprotect; + VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect); +#else mprotect(address, size, PROT_NONE); +#endif } -#endif // __CYGWIN__ void* OS::GetRandomMmapAddr() { @@ -150,9 +208,59 @@ void* OS::GetRandomMmapAddr() { } +size_t OS::AllocateAlignment() { + return getpagesize(); +} + + +void OS::Sleep(int milliseconds) { + useconds_t ms = static_cast(milliseconds); + usleep(1000 * ms); +} + + +int OS::NumberOfCores() { + return sysconf(_SC_NPROCESSORS_ONLN); +} + + +void OS::Abort() { + // Redirect to std abort to signal abnormal program termination. + if (FLAG_break_on_abort) { + DebugBreak(); + } + abort(); +} + + +void OS::DebugBreak() { +#if V8_HOST_ARCH_ARM + asm("bkpt 0"); +#elif V8_HOST_ARCH_MIPS + asm("break"); +#elif V8_HOST_ARCH_IA32 +#if defined(__native_client__) + asm("hlt"); +#else + asm("int $3"); +#endif // __native_client__ +#elif V8_HOST_ARCH_X64 + asm("int $3"); +#else +#error Unsupported host architecture. +#endif +} + + // ---------------------------------------------------------------------------- // Math functions +double ceiling(double x) { + // Correct buggy 'ceil' on some systems (i.e. FreeBSD, OS X 10.5) + return (-1.0 < x && x < 0.0) ? -0.0 : ceil(x); +} + + double modulo(double x, double y) { return fmod(x, y); } @@ -174,7 +282,7 @@ UNARY_MATH_FUNCTION(log, CreateTranscendentalFunction(TranscendentalCache::LOG)) UNARY_MATH_FUNCTION(exp, CreateExpFunction()) UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction()) -#undef MATH_FUNCTION +#undef UNARY_MATH_FUNCTION void lazily_initialize_fast_exp() { @@ -386,7 +494,7 @@ OS::MemCopyUint16Uint8Function CreateMemCopyUint16Uint8Function( #endif -void POSIXPostSetUp() { +void OS::PostSetUp() { #if V8_TARGET_ARCH_IA32 OS::MemMoveFunction generated_memmove = CreateMemMoveFunction(); if (generated_memmove != NULL) { @@ -425,8 +533,226 @@ void OS::StrNCpy(Vector dest, const char* src, size_t n) { // POSIX thread support. // +class Thread::PlatformData : public Malloced { + public: + PlatformData() : thread_(kNoThread) {} + pthread_t thread_; // Thread handle for pthread. +}; + +Thread::Thread(const Options& options) + : data_(new PlatformData), + stack_size_(options.stack_size()), + start_semaphore_(NULL) { + set_name(options.name()); +} + + +Thread::~Thread() { + delete data_; +} + + +static void SetThreadName(const char* name) { +#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) + pthread_set_name_np(pthread_self(), name); +#elif defined(__NetBSD__) + STATIC_ASSERT(Thread::kMaxThreadNameLength <= PTHREAD_MAX_NAMELEN_NP); + pthread_setname_np(pthread_self(), "%s", name); +#elif defined(__APPLE__) + // pthread_setname_np is only available in 10.6 or later, so test + // for it at runtime. + int (*dynamic_pthread_setname_np)(const char*); + *reinterpret_cast(&dynamic_pthread_setname_np) = + dlsym(RTLD_DEFAULT, "pthread_setname_np"); + if (dynamic_pthread_setname_np == NULL) + return; + + // Mac OS X does not expose the length limit of the name, so hardcode it. + static const int kMaxNameLength = 63; + STATIC_ASSERT(Thread::kMaxThreadNameLength <= kMaxNameLength); + dynamic_pthread_setname_np(name); +#elif defined(PR_SET_NAME) + prctl(PR_SET_NAME, + reinterpret_cast(name), // NOLINT + 0, 0, 0); +#endif +} + + +static void* ThreadEntry(void* arg) { + Thread* thread = reinterpret_cast(arg); + // This is also initialized by the first argument to pthread_create() but we + // don't know which thread will run first (the original thread or the new + // one) so we initialize it here too. + thread->data()->thread_ = pthread_self(); + SetThreadName(thread->name()); + ASSERT(thread->data()->thread_ != kNoThread); + thread->NotifyStartedAndRun(); + return NULL; +} + + +void Thread::set_name(const char* name) { + strncpy(name_, name, sizeof(name_)); + name_[sizeof(name_) - 1] = '\0'; +} + + +void Thread::Start() { + int result; + pthread_attr_t attr; + memset(&attr, 0, sizeof(attr)); + result = pthread_attr_init(&attr); + ASSERT_EQ(0, result); + // Native client uses default stack size. +#if !defined(__native_client__) + if (stack_size_ > 0) { + result = pthread_attr_setstacksize(&attr, static_cast(stack_size_)); + ASSERT_EQ(0, result); + } +#endif + result = pthread_create(&data_->thread_, &attr, ThreadEntry, this); + ASSERT_EQ(0, result); + result = pthread_attr_destroy(&attr); + ASSERT_EQ(0, result); + ASSERT(data_->thread_ != kNoThread); + USE(result); +} + + +void Thread::Join() { + pthread_join(data_->thread_, NULL); +} + + void Thread::YieldCPU() { - sched_yield(); + int result = sched_yield(); + ASSERT_EQ(0, result); + USE(result); +} + + +static Thread::LocalStorageKey PthreadKeyToLocalKey(pthread_key_t pthread_key) { +#if defined(__CYGWIN__) + // We need to cast pthread_key_t to Thread::LocalStorageKey in two steps + // because pthread_key_t is a pointer type on Cygwin. This will probably not + // work on 64-bit platforms, but Cygwin doesn't support 64-bit anyway. + STATIC_ASSERT(sizeof(Thread::LocalStorageKey) == sizeof(pthread_key_t)); + intptr_t ptr_key = reinterpret_cast(pthread_key); + return static_cast(ptr_key); +#else + return static_cast(pthread_key); +#endif +} + + +static pthread_key_t LocalKeyToPthreadKey(Thread::LocalStorageKey local_key) { +#if defined(__CYGWIN__) + STATIC_ASSERT(sizeof(Thread::LocalStorageKey) == sizeof(pthread_key_t)); + intptr_t ptr_key = static_cast(local_key); + return reinterpret_cast(ptr_key); +#else + return static_cast(local_key); +#endif +} + + +#ifdef V8_FAST_TLS_SUPPORTED + +static Atomic32 tls_base_offset_initialized = 0; +intptr_t kMacTlsBaseOffset = 0; + +// It's safe to do the initialization more that once, but it has to be +// done at least once. +static void InitializeTlsBaseOffset() { + const size_t kBufferSize = 128; + char buffer[kBufferSize]; + size_t buffer_size = kBufferSize; + int ctl_name[] = { CTL_KERN , KERN_OSRELEASE }; + if (sysctl(ctl_name, 2, buffer, &buffer_size, NULL, 0) != 0) { + V8_Fatal(__FILE__, __LINE__, "V8 failed to get kernel version"); + } + // The buffer now contains a string of the form XX.YY.ZZ, where + // XX is the major kernel version component. + // Make sure the buffer is 0-terminated. + buffer[kBufferSize - 1] = '\0'; + char* period_pos = strchr(buffer, '.'); + *period_pos = '\0'; + int kernel_version_major = + static_cast(strtol(buffer, NULL, 10)); // NOLINT + // The constants below are taken from pthreads.s from the XNU kernel + // sources archive at www.opensource.apple.com. + if (kernel_version_major < 11) { + // 8.x.x (Tiger), 9.x.x (Leopard), 10.x.x (Snow Leopard) have the + // same offsets. +#if V8_HOST_ARCH_IA32 + kMacTlsBaseOffset = 0x48; +#else + kMacTlsBaseOffset = 0x60; +#endif + } else { + // 11.x.x (Lion) changed the offset. + kMacTlsBaseOffset = 0; + } + + Release_Store(&tls_base_offset_initialized, 1); +} + + +static void CheckFastTls(Thread::LocalStorageKey key) { + void* expected = reinterpret_cast(0x1234CAFE); + Thread::SetThreadLocal(key, expected); + void* actual = Thread::GetExistingThreadLocal(key); + if (expected != actual) { + V8_Fatal(__FILE__, __LINE__, + "V8 failed to initialize fast TLS on current kernel"); + } + Thread::SetThreadLocal(key, NULL); +} + +#endif // V8_FAST_TLS_SUPPORTED + + +Thread::LocalStorageKey Thread::CreateThreadLocalKey() { +#ifdef V8_FAST_TLS_SUPPORTED + bool check_fast_tls = false; + if (tls_base_offset_initialized == 0) { + check_fast_tls = true; + InitializeTlsBaseOffset(); + } +#endif + pthread_key_t key; + int result = pthread_key_create(&key, NULL); + ASSERT_EQ(0, result); + USE(result); + LocalStorageKey local_key = PthreadKeyToLocalKey(key); +#ifdef V8_FAST_TLS_SUPPORTED + // If we just initialized fast TLS support, make sure it works. + if (check_fast_tls) CheckFastTls(local_key); +#endif + return local_key; +} + + +void Thread::DeleteThreadLocalKey(LocalStorageKey key) { + pthread_key_t pthread_key = LocalKeyToPthreadKey(key); + int result = pthread_key_delete(pthread_key); + ASSERT_EQ(0, result); + USE(result); +} + + +void* Thread::GetThreadLocal(LocalStorageKey key) { + pthread_key_t pthread_key = LocalKeyToPthreadKey(key); + return pthread_getspecific(pthread_key); +} + + +void Thread::SetThreadLocal(LocalStorageKey key, void* value) { + pthread_key_t pthread_key = LocalKeyToPthreadKey(key); + int result = pthread_setspecific(pthread_key, value); + ASSERT_EQ(0, result); + USE(result); } diff --git a/deps/v8/src/platform-posix.h b/deps/v8/src/platform-posix.h index bcc2b7e..6b73387 100644 --- a/deps/v8/src/platform-posix.h +++ b/deps/v8/src/platform-posix.h @@ -38,9 +38,6 @@ namespace v8 { namespace internal { -// Used by platform implementation files during OS::PostSetUp(). -void POSIXPostSetUp(); - // Used by platform implementation files during OS::DumpBacktrace() // and OS::StackWalk(). template(floor(time/msPerSecond)); @@ -150,11 +124,6 @@ bool OS::IsOutsideAllocatedSpace(void* address) { } -size_t OS::AllocateAlignment() { - return static_cast(getpagesize()); -} - - void* OS::Allocate(const size_t requested, size_t* allocated, bool is_executable) { @@ -172,36 +141,6 @@ void* OS::Allocate(const size_t requested, } -void OS::Free(void* address, const size_t size) { - // TODO(1240712): munmap has a return value which is ignored here. - int result = munmap(address, size); - USE(result); - ASSERT(result == 0); -} - - -void OS::Sleep(int milliseconds) { - useconds_t ms = static_cast(milliseconds); - usleep(1000 * ms); -} - - -int OS::NumberOfCores() { - return sysconf(_SC_NPROCESSORS_ONLN); -} - - -void OS::Abort() { - // Redirect to std abort to signal abnormal program termination. - abort(); -} - - -void OS::DebugBreak() { - asm("int $3"); -} - - void OS::DumpBacktrace() { // Currently unsupported. } @@ -454,90 +393,6 @@ bool VirtualMemory::HasLazyCommits() { } -class Thread::PlatformData : public Malloced { - public: - PlatformData() : thread_(kNoThread) { } - - pthread_t thread_; // Thread handle for pthread. -}; - - -Thread::Thread(const Options& options) - : data_(new PlatformData()), - stack_size_(options.stack_size()), - start_semaphore_(NULL) { - set_name(options.name()); -} - - -Thread::~Thread() { - delete data_; -} - - -static void* ThreadEntry(void* arg) { - Thread* thread = reinterpret_cast(arg); - // This is also initialized by the first argument to pthread_create() but we - // don't know which thread will run first (the original thread or the new - // one) so we initialize it here too. - thread->data()->thread_ = pthread_self(); - ASSERT(thread->data()->thread_ != kNoThread); - thread->NotifyStartedAndRun(); - return NULL; -} - - -void Thread::set_name(const char* name) { - strncpy(name_, name, sizeof(name_)); - name_[sizeof(name_) - 1] = '\0'; -} - - -void Thread::Start() { - pthread_attr_t attr; - if (stack_size_ > 0) { - pthread_attr_init(&attr); - pthread_attr_setstacksize(&attr, static_cast(stack_size_)); - } - pthread_create(&data_->thread_, NULL, ThreadEntry, this); - ASSERT(data_->thread_ != kNoThread); -} - - -void Thread::Join() { - pthread_join(data_->thread_, NULL); -} - - -Thread::LocalStorageKey Thread::CreateThreadLocalKey() { - pthread_key_t key; - int result = pthread_key_create(&key, NULL); - USE(result); - ASSERT(result == 0); - return static_cast(key); -} - - -void Thread::DeleteThreadLocalKey(LocalStorageKey key) { - pthread_key_t pthread_key = static_cast(key); - int result = pthread_key_delete(pthread_key); - USE(result); - ASSERT(result == 0); -} - - -void* Thread::GetThreadLocal(LocalStorageKey key) { - pthread_key_t pthread_key = static_cast(key); - return pthread_getspecific(pthread_key); -} - - -void Thread::SetThreadLocal(LocalStorageKey key, void* value) { - pthread_key_t pthread_key = static_cast(key); - pthread_setspecific(pthread_key, value); -} - - class SolarisSemaphore : public Semaphore { public: explicit SolarisSemaphore(int count) { sem_init(&sem_, 0, count); } diff --git a/deps/v8/src/platform.h b/deps/v8/src/platform.h index 211be39..8b27c19 100644 --- a/deps/v8/src/platform.h +++ b/deps/v8/src/platform.h @@ -69,6 +69,7 @@ int signbit(double x); // Microsoft Visual C++ specific stuff. #ifdef _MSC_VER +#include "win32-headers.h" #include "win32-math.h" int strncasecmp(const char* s1, const char* s2, int n); @@ -90,7 +91,6 @@ inline int lrint(double flt) { return intgr; } - #endif // _MSC_VER #ifndef __CYGWIN__ @@ -101,7 +101,6 @@ int random(); #endif // WIN32 #include "lazy-instance.h" -#include "platform-tls.h" #include "utils.h" #include "v8globals.h" @@ -129,6 +128,60 @@ void lazily_initialize_fast_exp(); class Socket; // ---------------------------------------------------------------------------- +// Fast TLS support + +#ifndef V8_NO_FAST_TLS + +#if defined(_MSC_VER) && V8_HOST_ARCH_IA32 + +#define V8_FAST_TLS_SUPPORTED 1 + +INLINE(intptr_t InternalGetExistingThreadLocal(intptr_t index)); + +inline intptr_t InternalGetExistingThreadLocal(intptr_t index) { + const intptr_t kTibInlineTlsOffset = 0xE10; + const intptr_t kTibExtraTlsOffset = 0xF94; + const intptr_t kMaxInlineSlots = 64; + const intptr_t kMaxSlots = kMaxInlineSlots + 1024; + ASSERT(0 <= index && index < kMaxSlots); + if (index < kMaxInlineSlots) { + return static_cast(__readfsdword(kTibInlineTlsOffset + + kPointerSize * index)); + } + intptr_t extra = static_cast(__readfsdword(kTibExtraTlsOffset)); + ASSERT(extra != 0); + return *reinterpret_cast(extra + + kPointerSize * (index - kMaxInlineSlots)); +} + +#elif defined(__APPLE__) && (V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64) + +#define V8_FAST_TLS_SUPPORTED 1 + +extern intptr_t kMacTlsBaseOffset; + +INLINE(intptr_t InternalGetExistingThreadLocal(intptr_t index)); + +inline intptr_t InternalGetExistingThreadLocal(intptr_t index) { + intptr_t result; +#if V8_HOST_ARCH_IA32 + asm("movl %%gs:(%1,%2,4), %0;" + :"=r"(result) // Output must be a writable register. + :"r"(kMacTlsBaseOffset), "r"(index)); +#else + asm("movq %%gs:(%1,%2,8), %0;" + :"=r"(result) + :"r"(kMacTlsBaseOffset), "r"(index)); +#endif + return result; +} + +#endif + +#endif // V8_NO_FAST_TLS + + +// ---------------------------------------------------------------------------- // OS // // This class has static methods for the different platform specific diff --git a/deps/v8/src/profile-generator.cc b/deps/v8/src/profile-generator.cc index cc86724..8428303 100644 --- a/deps/v8/src/profile-generator.cc +++ b/deps/v8/src/profile-generator.cc @@ -655,7 +655,8 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) { CodeEntry** entry = entries.start(); memset(entry, 0, entries.length() * sizeof(*entry)); if (sample.pc != NULL) { - if (sample.has_external_callback) { + if (sample.has_external_callback && sample.state == EXTERNAL && + sample.top_frame_type == StackFrame::EXIT) { // Don't use PC when in external callback code, as it can point // inside callback's code, and we will erroneously report // that a callback calls itself. diff --git a/deps/v8/src/property-details.h b/deps/v8/src/property-details.h index ac36563..6b62ddb 100644 --- a/deps/v8/src/property-details.h +++ b/deps/v8/src/property-details.h @@ -67,7 +67,7 @@ enum PropertyType { NORMAL = 0, // Only in fast mode. FIELD = 1, - CONSTANT_FUNCTION = 2, + CONSTANT = 2, CALLBACKS = 3, // Only in lookup results, not in descriptors. HANDLER = 4, diff --git a/deps/v8/src/property.cc b/deps/v8/src/property.cc index 80a06cb..83a6a36 100644 --- a/deps/v8/src/property.cc +++ b/deps/v8/src/property.cc @@ -55,10 +55,10 @@ void LookupResult::Print(FILE* out) { PrintF(out, " -type = normal\n"); PrintF(out, " -entry = %d", GetDictionaryEntry()); break; - case CONSTANT_FUNCTION: - PrintF(out, " -type = constant function\n"); - PrintF(out, " -function:\n"); - GetConstantFunction()->Print(out); + case CONSTANT: + PrintF(out, " -type = constant\n"); + PrintF(out, " -value:\n"); + GetConstant()->Print(out); PrintF(out, "\n"); break; case FIELD: @@ -85,7 +85,7 @@ void LookupResult::Print(FILE* out) { GetTransitionMap()->Print(out); PrintF(out, "\n"); return; - case CONSTANT_FUNCTION: + case CONSTANT: PrintF(out, " -type = constant property transition\n"); PrintF(out, " -map:\n"); GetTransitionMap()->Print(out); diff --git a/deps/v8/src/property.h b/deps/v8/src/property.h index 5213ee6..d109de9 100644 --- a/deps/v8/src/property.h +++ b/deps/v8/src/property.h @@ -106,13 +106,13 @@ class FieldDescriptor: public Descriptor { }; -class ConstantFunctionDescriptor: public Descriptor { +class ConstantDescriptor: public Descriptor { public: - ConstantFunctionDescriptor(Name* key, - JSFunction* function, - PropertyAttributes attributes) - : Descriptor(key, function, attributes, CONSTANT_FUNCTION, - Representation::HeapObject()) {} + ConstantDescriptor(Name* key, + Object* value, + PropertyAttributes attributes) + : Descriptor(key, value, attributes, CONSTANT, + value->OptimalRepresentation()) {} }; @@ -303,9 +303,13 @@ class LookupResult BASE_EMBEDDED { return details_.type() == NORMAL; } + bool IsConstant() { + ASSERT(!(details_.type() == CONSTANT && !IsFound())); + return details_.type() == CONSTANT; + } + bool IsConstantFunction() { - ASSERT(!(details_.type() == CONSTANT_FUNCTION && !IsFound())); - return details_.type() == CONSTANT_FUNCTION; + return IsConstant() && GetValue()->IsJSFunction(); } bool IsDontDelete() { return details_.IsDontDelete(); } @@ -324,7 +328,7 @@ class LookupResult BASE_EMBEDDED { switch (type()) { case FIELD: case NORMAL: - case CONSTANT_FUNCTION: + case CONSTANT: return true; case CALLBACKS: { Object* callback = GetCallbackObject(); @@ -355,8 +359,8 @@ class LookupResult BASE_EMBEDDED { } return value; } - case CONSTANT_FUNCTION: - return GetConstantFunction(); + case CONSTANT: + return GetConstant(); case CALLBACKS: case HANDLER: case INTERCEPTOR: @@ -392,9 +396,8 @@ class LookupResult BASE_EMBEDDED { return IsTransition() && GetTransitionDetails(map).type() == FIELD; } - bool IsTransitionToConstantFunction(Map* map) { - return IsTransition() && - GetTransitionDetails(map).type() == CONSTANT_FUNCTION; + bool IsTransitionToConstant(Map* map) { + return IsTransition() && GetTransitionDetails(map).type() == CONSTANT; } Map* GetTransitionMap() { @@ -434,13 +437,22 @@ class LookupResult BASE_EMBEDDED { } JSFunction* GetConstantFunction() { - ASSERT(type() == CONSTANT_FUNCTION); + ASSERT(type() == CONSTANT); return JSFunction::cast(GetValue()); } + Object* GetConstantFromMap(Map* map) { + ASSERT(type() == CONSTANT); + return GetValueFromMap(map); + } + JSFunction* GetConstantFunctionFromMap(Map* map) { - ASSERT(type() == CONSTANT_FUNCTION); - return JSFunction::cast(GetValueFromMap(map)); + return JSFunction::cast(GetConstantFromMap(map)); + } + + Object* GetConstant() { + ASSERT(type() == CONSTANT); + return GetValue(); } Object* GetCallbackObject() { diff --git a/deps/v8/src/runtime.cc b/deps/v8/src/runtime.cc index c36d453..40fae3a 100644 --- a/deps/v8/src/runtime.cc +++ b/deps/v8/src/runtime.cc @@ -265,6 +265,9 @@ static Handle CreateObjectLiteralBoilerplate( } Handle result; uint32_t element_index = 0; + JSReceiver::StoreMode mode = value->IsJSObject() + ? JSReceiver::FORCE_FIELD + : JSReceiver::ALLOW_AS_CONSTANT; if (key->IsInternalizedString()) { if (Handle::cast(key)->AsArrayIndex(&element_index)) { // Array index as string (uint32). @@ -274,7 +277,8 @@ static Handle CreateObjectLiteralBoilerplate( Handle name(String::cast(*key)); ASSERT(!name->AsArrayIndex(&element_index)); result = JSObject::SetLocalPropertyIgnoreAttributes( - boilerplate, name, value, NONE); + boilerplate, name, value, NONE, + Object::OPTIMAL_REPRESENTATION, mode); } } else if (key->ToArrayIndex(&element_index)) { // Array index (uint32). @@ -290,7 +294,8 @@ static Handle CreateObjectLiteralBoilerplate( Handle name = isolate->factory()->NewStringFromAscii(CStrVector(str)); result = JSObject::SetLocalPropertyIgnoreAttributes( - boilerplate, name, value, NONE); + boilerplate, name, value, NONE, + Object::OPTIMAL_REPRESENTATION, mode); } // If setting the property on the boilerplate throws an // exception, the exception is converted to an empty handle in @@ -2203,8 +2208,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_InitializeConstGlobal) { } } else { // Ignore re-initialization of constants that have already been - // assigned a function value. - ASSERT(lookup.IsReadOnly() && lookup.IsConstantFunction()); + // assigned a constant value. + ASSERT(lookup.IsReadOnly() && lookup.IsConstant()); } // Use the set value as the result of the operation. @@ -2943,6 +2948,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ResumeJSGeneratorObject) { JavaScriptFrame* frame = stack_iterator.frame(); ASSERT_EQ(frame->function(), generator_object->function()); + ASSERT(frame->function()->is_compiled()); STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting <= 0); STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed <= 0); @@ -4969,8 +4975,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetDataProperty) { return lookup.holder()->FastPropertyAt( lookup.representation(), lookup.GetFieldIndex().field_index()); - case CONSTANT_FUNCTION: - return lookup.GetConstantFunction(); + case CONSTANT: + return lookup.GetConstant(); case CALLBACKS: case HANDLER: case INTERCEPTOR: @@ -8460,8 +8466,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) { } CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); if (FLAG_parallel_recompilation && sync_with_compiler_thread) { - while (function->IsMarkedForParallelRecompilation() || - function->IsInRecompileQueue() || + while (function->IsInRecompileQueue() || function->IsMarkedForInstallingRecompiledCode()) { isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); OS::Sleep(50); @@ -10554,8 +10559,8 @@ static MaybeObject* DebugLookupResultValue(Heap* heap, } return value; } - case CONSTANT_FUNCTION: - return result->GetConstantFunction(); + case CONSTANT: + return result->GetConstant(); case CALLBACKS: { Object* structure = result->GetCallbackObject(); if (structure->IsForeign() || structure->IsAccessorInfo()) { @@ -13345,20 +13350,6 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetHeapUsage) { #endif // ENABLE_DEBUGGER_SUPPORT -RUNTIME_FUNCTION(MaybeObject*, Runtime_ProfilerResume) { - SealHandleScope shs(isolate); - v8::V8::ResumeProfiler(); - return isolate->heap()->undefined_value(); -} - - -RUNTIME_FUNCTION(MaybeObject*, Runtime_ProfilerPause) { - SealHandleScope shs(isolate); - v8::V8::PauseProfiler(); - return isolate->heap()->undefined_value(); -} - - // Finds the script object from the script data. NOTE: This operation uses // heap traversal to find the function generated for the source position // for the requested break point. For lazily compiled functions several heap @@ -13429,50 +13420,21 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CollectStackTrace) { } -// Mark a function to recognize when called after GC to format the stack trace. -RUNTIME_FUNCTION(MaybeObject*, Runtime_MarkOneShotGetter) { - HandleScope scope(isolate); - ASSERT_EQ(args.length(), 1); - CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); - Handle key = isolate->factory()->hidden_stack_trace_string(); - JSObject::SetHiddenProperty(fun, key, key); - return *fun; -} - - -// Retrieve the stack trace. This could be the raw stack trace collected -// on stack overflow or the already formatted stack trace string. -RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOverflowedStackTrace) { +// Retrieve the stack trace. This is the raw stack trace that yet has to +// be formatted. Since we only need this once, clear it afterwards. +RUNTIME_FUNCTION(MaybeObject*, Runtime_GetAndClearOverflowedStackTrace) { HandleScope scope(isolate); ASSERT_EQ(args.length(), 1); CONVERT_ARG_CHECKED(JSObject, error_object, 0); String* key = isolate->heap()->hidden_stack_trace_string(); Object* result = error_object->GetHiddenProperty(key); - if (result->IsTheHole()) result = isolate->heap()->undefined_value(); - RUNTIME_ASSERT(result->IsJSArray() || - result->IsString() || - result->IsUndefined()); + if (result->IsTheHole()) return isolate->heap()->undefined_value(); + RUNTIME_ASSERT(result->IsJSArray() || result->IsUndefined()); + error_object->DeleteHiddenProperty(key); return result; } -// Set or clear the stack trace attached to an stack overflow error object. -RUNTIME_FUNCTION(MaybeObject*, Runtime_SetOverflowedStackTrace) { - HandleScope scope(isolate); - ASSERT_EQ(args.length(), 2); - CONVERT_ARG_HANDLE_CHECKED(JSObject, error_object, 0); - CONVERT_ARG_HANDLE_CHECKED(HeapObject, value, 1); - Handle key = isolate->factory()->hidden_stack_trace_string(); - if (value->IsUndefined()) { - error_object->DeleteHiddenProperty(*key); - } else { - RUNTIME_ASSERT(value->IsString()); - JSObject::SetHiddenProperty(error_object, key, value); - } - return *error_object; -} - - // Returns V8 version as a string. RUNTIME_FUNCTION(MaybeObject*, Runtime_GetV8Version) { SealHandleScope shs(isolate); diff --git a/deps/v8/src/runtime.h b/deps/v8/src/runtime.h index a8c10d9..400145f 100644 --- a/deps/v8/src/runtime.h +++ b/deps/v8/src/runtime.h @@ -244,9 +244,7 @@ namespace internal { F(FunctionIsBuiltin, 1, 1) \ F(GetScript, 1, 1) \ F(CollectStackTrace, 3, 1) \ - F(MarkOneShotGetter, 1, 1) \ - F(GetOverflowedStackTrace, 1, 1) \ - F(SetOverflowedStackTrace, 2, 1) \ + F(GetAndClearOverflowedStackTrace, 1, 1) \ F(GetV8Version, 0, 1) \ \ F(ClassOf, 1, 1) \ @@ -467,10 +465,7 @@ namespace internal { F(TransitionElementsKind, 2, 1) \ F(TransitionElementsSmiToDouble, 1, 1) \ F(TransitionElementsDoubleToObject, 1, 1) \ - F(HaveSameMap, 2, 1) \ - /* profiler */ \ - F(ProfilerResume, 0, 1) \ - F(ProfilerPause, 0, 1) + F(HaveSameMap, 2, 1) #ifdef ENABLE_DEBUGGER_SUPPORT diff --git a/deps/v8/src/sampler.cc b/deps/v8/src/sampler.cc index 222b318..d72ed1a 100644 --- a/deps/v8/src/sampler.cc +++ b/deps/v8/src/sampler.cc @@ -69,6 +69,7 @@ #include "platform.h" #include "simulator.h" #include "v8threads.h" +#include "vm-state-inl.h" #if defined(__ANDROID__) && !defined(__BIONIC_HAVE_UCONTEXT_T) @@ -621,9 +622,13 @@ DISABLE_ASAN void TickSample::Init(Isolate* isolate, return; } - const Address callback = isolate->external_callback(); - if (callback != NULL) { - external_callback = callback; + ExternalCallbackScope* scope = isolate->external_callback_scope(); + Address handler = Isolate::handler(isolate->thread_local_top()); + // If there is a handler on top of the external callback scope then + // we have already entrered JavaScript again and the external callback + // is not the top function. + if (scope && scope->scope_address() < handler) { + external_callback = scope->callback(); has_external_callback = true; } else { // Sample potential return address value for frameless invocation of diff --git a/deps/v8/src/spaces.h b/deps/v8/src/spaces.h index dda5591..b47452e 100644 --- a/deps/v8/src/spaces.h +++ b/deps/v8/src/spaces.h @@ -781,7 +781,10 @@ class Page : public MemoryChunk { // Object area size in bytes. static const int kNonCodeObjectAreaSize = kPageSize - kObjectStartOffset; - // Maximum object size that fits in a page. + // Maximum object size that fits in a page. Objects larger than that size + // are allocated in large object space and are never moved in memory. This + // also applies to new space allocation, since objects are never migrated + // from new space to large object space. static const int kMaxNonCodeHeapObjectSize = kNonCodeObjectAreaSize; // Page size mask. diff --git a/deps/v8/src/stub-cache.cc b/deps/v8/src/stub-cache.cc index 436cd46..73c7a0a 100644 --- a/deps/v8/src/stub-cache.cc +++ b/deps/v8/src/stub-cache.cc @@ -335,10 +335,10 @@ Handle StubCache::ComputeLoadViaGetter(Handle name, Handle StubCache::ComputeLoadConstant(Handle name, Handle receiver, Handle holder, - Handle value) { + Handle value) { Handle stub_holder = StubHolder(receiver, holder); Handle handler = FindLoadHandler( - name, receiver, stub_holder, Code::LOAD_IC, Code::CONSTANT_FUNCTION); + name, receiver, stub_holder, Code::LOAD_IC, Code::CONSTANT); if (!handler.is_null()) return handler; LoadStubCompiler compiler(isolate_); @@ -417,11 +417,11 @@ Handle StubCache::ComputeKeyedLoadField(Handle name, Handle StubCache::ComputeKeyedLoadConstant(Handle name, Handle receiver, Handle holder, - Handle value) { + Handle value) { Handle stub_holder = StubHolder(receiver, holder); Handle handler = FindLoadHandler( name, receiver, stub_holder, Code::KEYED_LOAD_IC, - Code::CONSTANT_FUNCTION); + Code::CONSTANT); if (!handler.is_null()) return handler; KeyedLoadStubCompiler compiler(isolate_); @@ -563,16 +563,15 @@ Handle StubCache::ComputeStoreGlobal(Handle name, Code::STORE_IC, Code::NORMAL, stub.GetExtraICState()); if (!code.is_null()) return code; - if (is_constant) return stub.GetCode(isolate_); - // Replace the placeholder cell and global object map with the actual global // cell and receiver map. - Handle cell_map(isolate_->heap()->global_property_cell_map()); Handle meta_map(isolate_->heap()->meta_map()); Handle receiver_map(receiver->map(), isolate_); code = stub.GetCodeCopyFromTemplate(isolate_); code->ReplaceNthObject(1, *meta_map, *receiver_map); + Handle cell_map(isolate_->heap()->global_property_cell_map()); code->ReplaceNthObject(1, *cell_map, *cell); + JSObject::UpdateMapCodeCache(receiver, name, code); return code; @@ -699,7 +698,7 @@ Handle StubCache::ComputeCallConstant(int argc, } Code::Flags flags = Code::ComputeMonomorphicFlags( - kind, extra_state, Code::CONSTANT_FUNCTION, argc, cache_holder); + kind, extra_state, Code::CONSTANT, argc, cache_holder); Handle probe(stub_holder->map()->FindInCodeCache(*name, flags), isolate_); if (probe->IsCode()) return Handle::cast(probe); @@ -1620,14 +1619,14 @@ Handle BaseLoadStubCompiler::CompileLoadConstant( Handle object, Handle holder, Handle name, - Handle value) { + Handle value) { Label success; HandlerFrontend(object, receiver(), holder, name, &success); __ bind(&success); GenerateLoadConstant(value); // Return the generated code. - return GetCode(kind(), Code::CONSTANT_FUNCTION, name); + return GetCode(kind(), Code::CONSTANT, name); } @@ -2131,14 +2130,14 @@ Handle CallStubCompiler::GetCode(Handle function) { if (function->shared()->name()->IsString()) { function_name = Handle(String::cast(function->shared()->name())); } - return GetCode(Code::CONSTANT_FUNCTION, function_name); + return GetCode(Code::CONSTANT, function_name); } CallOptimization::CallOptimization(LookupResult* lookup) { if (lookup->IsFound() && lookup->IsCacheable() && - lookup->type() == CONSTANT_FUNCTION) { + lookup->IsConstantFunction()) { // We only optimize constant function calls. Initialize(Handle(lookup->GetConstantFunction())); } else { diff --git a/deps/v8/src/stub-cache.h b/deps/v8/src/stub-cache.h index 73a1a8a..bd0678e 100644 --- a/deps/v8/src/stub-cache.h +++ b/deps/v8/src/stub-cache.h @@ -144,7 +144,7 @@ class StubCache { Handle ComputeLoadConstant(Handle name, Handle object, Handle holder, - Handle value); + Handle value); Handle ComputeLoadInterceptor(Handle name, Handle object, @@ -176,7 +176,7 @@ class StubCache { Handle ComputeKeyedLoadConstant(Handle name, Handle object, Handle holder, - Handle value); + Handle value); Handle ComputeKeyedLoadInterceptor(Handle name, Handle object, @@ -708,7 +708,7 @@ class BaseLoadStubCompiler: public BaseLoadStoreStubCompiler { Handle CompileLoadConstant(Handle object, Handle holder, Handle name, - Handle value); + Handle value); Handle CompileLoadInterceptor(Handle object, Handle holder, @@ -741,7 +741,7 @@ class BaseLoadStubCompiler: public BaseLoadStoreStubCompiler { Handle holder, PropertyIndex field, Representation representation); - void GenerateLoadConstant(Handle value); + void GenerateLoadConstant(Handle value); void GenerateLoadCallback(Register reg, Handle callback); void GenerateLoadInterceptor(Register holder_reg, diff --git a/deps/v8/src/token.h b/deps/v8/src/token.h index 04d7f76..992adaa 100644 --- a/deps/v8/src/token.h +++ b/deps/v8/src/token.h @@ -225,8 +225,17 @@ class Token { return op == EQ || op == EQ_STRICT; } + static bool IsInequalityOp(Value op) { + return op == NE || op == NE_STRICT; + } + + static bool IsArithmeticCompareOp(Value op) { + return IsOrderedRelationalCompareOp(op) || + IsEqualityOp(op) || IsInequalityOp(op); + } + static Value NegateCompareOp(Value op) { - ASSERT(IsCompareOp(op)); + ASSERT(IsArithmeticCompareOp(op)); switch (op) { case EQ: return NE; case NE: return EQ; @@ -243,7 +252,7 @@ class Token { } static Value ReverseCompareOp(Value op) { - ASSERT(IsCompareOp(op)); + ASSERT(IsArithmeticCompareOp(op)); switch (op) { case EQ: return EQ; case NE: return NE; diff --git a/deps/v8/src/type-info.cc b/deps/v8/src/type-info.cc index b905a74..769df07 100644 --- a/deps/v8/src/type-info.cc +++ b/deps/v8/src/type-info.cc @@ -709,8 +709,7 @@ void TypeFeedbackOracle::SetInfo(TypeFeedbackId ast_id, Object* target) { Representation Representation::FromType(TypeInfo info) { if (info.IsUninitialized()) return Representation::None(); - // TODO(verwaest): Return Smi rather than Integer32. - if (info.IsSmi()) return Representation::Integer32(); + if (info.IsSmi()) return Representation::Smi(); if (info.IsInteger32()) return Representation::Integer32(); if (info.IsDouble()) return Representation::Double(); if (info.IsNumber()) return Representation::Double(); diff --git a/deps/v8/src/typedarray.js b/deps/v8/src/typedarray.js index 601012d..d5357b4 100644 --- a/deps/v8/src/typedarray.js +++ b/deps/v8/src/typedarray.js @@ -237,7 +237,7 @@ function DataViewConstructor(buffer, byteOffset, byteLength) { // length = 3 function DataViewGetBuffer() { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.buffer', this]); } return %DataViewGetBuffer(this); @@ -245,7 +245,7 @@ function DataViewGetBuffer() { function DataViewGetByteOffset() { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.byteOffset', this]); } return %DataViewGetByteOffset(this); @@ -253,7 +253,7 @@ function DataViewGetByteOffset() { function DataViewGetByteLength() { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.byteLength', this]); } return %DataViewGetByteLength(this); @@ -265,7 +265,7 @@ function ToPositiveDataViewOffset(offset) { function DataViewGetInt8(offset, little_endian) { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.getInt8', this]); } if (%_ArgumentsLength() < 1) { @@ -278,10 +278,10 @@ function DataViewGetInt8(offset, little_endian) { function DataViewSetInt8(offset, value, little_endian) { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.setInt8', this]); } - if (%_ArgumentsLength() < 1) { + if (%_ArgumentsLength() < 2) { throw MakeTypeError('invalid_argument'); } %DataViewSetInt8(this, @@ -292,7 +292,7 @@ function DataViewSetInt8(offset, value, little_endian) { function DataViewGetUint8(offset, little_endian) { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.getUint8', this]); } if (%_ArgumentsLength() < 1) { @@ -305,10 +305,10 @@ function DataViewGetUint8(offset, little_endian) { function DataViewSetUint8(offset, value, little_endian) { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.setUint8', this]); } - if (%_ArgumentsLength() < 1) { + if (%_ArgumentsLength() < 2) { throw MakeTypeError('invalid_argument'); } %DataViewSetUint8(this, @@ -319,7 +319,7 @@ function DataViewSetUint8(offset, value, little_endian) { function DataViewGetInt16(offset, little_endian) { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.getInt16', this]); } if (%_ArgumentsLength() < 1) { @@ -332,10 +332,10 @@ function DataViewGetInt16(offset, little_endian) { function DataViewSetInt16(offset, value, little_endian) { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.setInt16', this]); } - if (%_ArgumentsLength() < 1) { + if (%_ArgumentsLength() < 2) { throw MakeTypeError('invalid_argument'); } %DataViewSetInt16(this, @@ -346,7 +346,7 @@ function DataViewSetInt16(offset, value, little_endian) { function DataViewGetUint16(offset, little_endian) { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.getUint16', this]); } if (%_ArgumentsLength() < 1) { @@ -359,10 +359,10 @@ function DataViewGetUint16(offset, little_endian) { function DataViewSetUint16(offset, value, little_endian) { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.setUint16', this]); } - if (%_ArgumentsLength() < 1) { + if (%_ArgumentsLength() < 2) { throw MakeTypeError('invalid_argument'); } %DataViewSetUint16(this, @@ -373,7 +373,7 @@ function DataViewSetUint16(offset, value, little_endian) { function DataViewGetInt32(offset, little_endian) { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.getInt32', this]); } if (%_ArgumentsLength() < 1) { @@ -386,7 +386,7 @@ function DataViewGetInt32(offset, little_endian) { function DataViewSetInt32(offset, value, little_endian) { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.setInt32', this]); } if (%_ArgumentsLength() < 2) { @@ -400,7 +400,7 @@ function DataViewSetInt32(offset, value, little_endian) { function DataViewGetUint32(offset, little_endian) { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.getUint32', this]); } if (%_ArgumentsLength() < 1) { @@ -413,10 +413,10 @@ function DataViewGetUint32(offset, little_endian) { function DataViewSetUint32(offset, value, little_endian) { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.setUint32', this]); } - if (%_ArgumentsLength() < 1) { + if (%_ArgumentsLength() < 2) { throw MakeTypeError('invalid_argument'); } %DataViewSetUint32(this, @@ -427,7 +427,7 @@ function DataViewSetUint32(offset, value, little_endian) { function DataViewGetFloat32(offset, little_endian) { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.getFloat32', this]); } if (%_ArgumentsLength() < 1) { @@ -440,10 +440,10 @@ function DataViewGetFloat32(offset, little_endian) { function DataViewSetFloat32(offset, value, little_endian) { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.setFloat32', this]); } - if (%_ArgumentsLength() < 1) { + if (%_ArgumentsLength() < 2) { throw MakeTypeError('invalid_argument'); } %DataViewSetFloat32(this, @@ -454,7 +454,7 @@ function DataViewSetFloat32(offset, value, little_endian) { function DataViewGetFloat64(offset, little_endian) { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.getFloat64', this]); } if (%_ArgumentsLength() < 1) { @@ -467,10 +467,10 @@ function DataViewGetFloat64(offset, little_endian) { function DataViewSetFloat64(offset, value, little_endian) { if (!IS_DATAVIEW(this)) { - throw MakeTypeError('incompatible_method_reciever', + throw MakeTypeError('incompatible_method_receiver', ['DataView.setFloat64', this]); } - if (%_ArgumentsLength() < 1) { + if (%_ArgumentsLength() < 2) { throw MakeTypeError('invalid_argument'); } %DataViewSetFloat64(this, diff --git a/deps/v8/src/types.cc b/deps/v8/src/types.cc index 8bf9129..70ddccd 100644 --- a/deps/v8/src/types.cc +++ b/deps/v8/src/types.cc @@ -206,6 +206,7 @@ int Type::LubBitset() { case DECLARED_ACCESSOR_INFO_TYPE: case EXECUTABLE_ACCESSOR_INFO_TYPE: case ACCESSOR_PAIR_TYPE: + case FIXED_ARRAY_TYPE: return kInternal; default: UNREACHABLE(); @@ -482,6 +483,7 @@ Type* Type::Optional(Handle type) { Representation Representation::FromType(Handle type) { if (type->Is(Type::None())) return Representation::None(); + if (type->Is(Type::Smi())) return Representation::Smi(); if (type->Is(Type::Signed32())) return Representation::Integer32(); if (type->Is(Type::Number())) return Representation::Double(); return Representation::Tagged(); diff --git a/deps/v8/src/v8-counters.h b/deps/v8/src/v8-counters.h index dfe1e20..ff2247c 100644 --- a/deps/v8/src/v8-counters.h +++ b/deps/v8/src/v8-counters.h @@ -238,6 +238,8 @@ namespace internal { SC(transcendental_cache_miss, V8.TranscendentalCacheMiss) \ SC(stack_interrupts, V8.StackInterrupts) \ SC(runtime_profiler_ticks, V8.RuntimeProfilerTicks) \ + SC(bounds_checks_eliminated, V8.BoundsChecksEliminated) \ + SC(bounds_checks_hoisted, V8.BoundsChecksHoisted) \ SC(soft_deopts_requested, V8.SoftDeoptsRequested) \ SC(soft_deopts_inserted, V8.SoftDeoptsInserted) \ SC(soft_deopts_executed, V8.SoftDeoptsExecuted) \ diff --git a/deps/v8/src/version.cc b/deps/v8/src/version.cc index 1f1ff7a..bae1a70 100644 --- a/deps/v8/src/version.cc +++ b/deps/v8/src/version.cc @@ -34,7 +34,7 @@ // system so their names cannot be changed without changing the scripts. #define MAJOR_VERSION 3 #define MINOR_VERSION 20 -#define BUILD_NUMBER 7 +#define BUILD_NUMBER 9 #define PATCH_LEVEL 0 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/src/vm-state-inl.h b/deps/v8/src/vm-state-inl.h index 862c17e..658773e 100644 --- a/deps/v8/src/vm-state-inl.h +++ b/deps/v8/src/vm-state-inl.h @@ -29,7 +29,8 @@ #define V8_VM_STATE_INL_H_ #include "vm-state.h" -#include "runtime-profiler.h" +#include "log.h" +#include "simulator.h" namespace v8 { namespace internal { @@ -80,12 +81,26 @@ VMState::~VMState() { ExternalCallbackScope::ExternalCallbackScope(Isolate* isolate, Address callback) - : isolate_(isolate), previous_callback_(isolate->external_callback()) { - isolate_->set_external_callback(callback); + : isolate_(isolate), + callback_(callback), + previous_scope_(isolate->external_callback_scope()) { +#ifdef USE_SIMULATOR + int32_t sp = Simulator::current(isolate)->get_register(Simulator::sp); + scope_address_ = reinterpret_cast
(static_cast(sp)); +#endif + isolate_->set_external_callback_scope(this); } ExternalCallbackScope::~ExternalCallbackScope() { - isolate_->set_external_callback(previous_callback_); + isolate_->set_external_callback_scope(previous_scope_); +} + +Address ExternalCallbackScope::scope_address() { +#ifdef USE_SIMULATOR + return scope_address_; +#else + return reinterpret_cast
(this); +#endif } diff --git a/deps/v8/src/vm-state.h b/deps/v8/src/vm-state.h index 765b570..f592bb9 100644 --- a/deps/v8/src/vm-state.h +++ b/deps/v8/src/vm-state.h @@ -50,9 +50,18 @@ class ExternalCallbackScope BASE_EMBEDDED { public: inline ExternalCallbackScope(Isolate* isolate, Address callback); inline ~ExternalCallbackScope(); + Address callback() { return callback_; } + Address* callback_address() { return &callback_; } + ExternalCallbackScope* previous() { return previous_scope_; } + inline Address scope_address(); + private: Isolate* isolate_; - Address previous_callback_; + Address callback_; + ExternalCallbackScope* previous_scope_; +#ifdef USE_SIMULATOR + Address scope_address_; +#endif }; } } // namespace v8::internal diff --git a/deps/v8/src/x64/assembler-x64-inl.h b/deps/v8/src/x64/assembler-x64-inl.h index b9af527..ae9aeee 100644 --- a/deps/v8/src/x64/assembler-x64-inl.h +++ b/deps/v8/src/x64/assembler-x64-inl.h @@ -51,6 +51,16 @@ void Assembler::emitl(uint32_t x) { } +void Assembler::emitp(void* x, RelocInfo::Mode rmode) { + uintptr_t value = reinterpret_cast(x); + Memory::uintptr_at(pc_) = value; + if (!RelocInfo::IsNone(rmode)) { + RecordRelocInfo(rmode, value); + } + pc_ += sizeof(uintptr_t); +} + + void Assembler::emitq(uint64_t x, RelocInfo::Mode rmode) { Memory::uint64_at(pc_) = x; if (!RelocInfo::IsNone(rmode)) { diff --git a/deps/v8/src/x64/assembler-x64.cc b/deps/v8/src/x64/assembler-x64.cc index aaab839..f5939c3 100644 --- a/deps/v8/src/x64/assembler-x64.cc +++ b/deps/v8/src/x64/assembler-x64.cc @@ -1377,7 +1377,7 @@ void Assembler::load_rax(void* value, RelocInfo::Mode mode) { EnsureSpace ensure_space(this); emit(0x48); // REX.W emit(0xA1); - emitq(reinterpret_cast(value), mode); + emitp(value, mode); } @@ -1529,7 +1529,7 @@ void Assembler::movq(Register dst, void* value, RelocInfo::Mode rmode) { EnsureSpace ensure_space(this); emit_rex_64(dst); emit(0xB8 | dst.low_bits()); - emitq(reinterpret_cast(value), rmode); + emitp(value, rmode); } @@ -1606,7 +1606,7 @@ void Assembler::movq(Register dst, Handle value, RelocInfo::Mode mode) { ASSERT(!HEAP->InNewSpace(*value)); emit_rex_64(dst); emit(0xB8 | dst.low_bits()); - emitq(reinterpret_cast(value.location()), mode); + emitp(value.location(), mode); } } @@ -1998,7 +1998,7 @@ void Assembler::store_rax(void* dst, RelocInfo::Mode mode) { EnsureSpace ensure_space(this); emit(0x48); // REX.W emit(0xA3); - emitq(reinterpret_cast(dst), mode); + emitp(dst, mode); } diff --git a/deps/v8/src/x64/assembler-x64.h b/deps/v8/src/x64/assembler-x64.h index aec50c9..07afc12 100644 --- a/deps/v8/src/x64/assembler-x64.h +++ b/deps/v8/src/x64/assembler-x64.h @@ -1444,6 +1444,7 @@ class Assembler : public AssemblerBase { void emit(byte x) { *pc_++ = x; } inline void emitl(uint32_t x); + inline void emitp(void* x, RelocInfo::Mode rmode); inline void emitq(uint64_t x, RelocInfo::Mode rmode); inline void emitw(uint16_t x); inline void emit_code_target(Handle target, diff --git a/deps/v8/src/x64/code-stubs-x64.cc b/deps/v8/src/x64/code-stubs-x64.cc index e090437..551a716 100644 --- a/deps/v8/src/x64/code-stubs-x64.cc +++ b/deps/v8/src/x64/code-stubs-x64.cc @@ -39,6 +39,16 @@ namespace v8 { namespace internal { +void ToNumberStub::InitializeInterfaceDescriptor( + Isolate* isolate, + CodeStubInterfaceDescriptor* descriptor) { + static Register registers[] = { rax }; + descriptor->register_param_count_ = 1; + descriptor->register_params_ = registers; + descriptor->deoptimization_handler_ = NULL; +} + + void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( Isolate* isolate, CodeStubInterfaceDescriptor* descriptor) { @@ -296,26 +306,6 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { } -void ToNumberStub::Generate(MacroAssembler* masm) { - // The ToNumber stub takes one argument in rax. - Label check_heap_number, call_builtin; - __ JumpIfNotSmi(rax, &check_heap_number, Label::kNear); - __ Ret(); - - __ bind(&check_heap_number); - __ CompareRoot(FieldOperand(rax, HeapObject::kMapOffset), - Heap::kHeapNumberMapRootIndex); - __ j(not_equal, &call_builtin, Label::kNear); - __ Ret(); - - __ bind(&call_builtin); - __ pop(rcx); // Pop return address. - __ push(rax); - __ push(rcx); // Push return address. - __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION); -} - - void FastNewClosureStub::Generate(MacroAssembler* masm) { // Create a new closure from the given function info in new // space. Set the context to the current context in rsi. diff --git a/deps/v8/src/x64/deoptimizer-x64.cc b/deps/v8/src/x64/deoptimizer-x64.cc index d7a73d7..b45e966 100644 --- a/deps/v8/src/x64/deoptimizer-x64.cc +++ b/deps/v8/src/x64/deoptimizer-x64.cc @@ -46,21 +46,7 @@ int Deoptimizer::patch_size() { } -void Deoptimizer::DeoptimizeFunctionWithPreparedFunctionList( - JSFunction* function) { - Isolate* isolate = function->GetIsolate(); - HandleScope scope(isolate); - DisallowHeapAllocation nha; - - ASSERT(function->IsOptimized()); - ASSERT(function->FunctionsInFunctionListShareSameCode()); - - // Get the optimized code. - Code* code = function->code(); - - // The optimized code is going to be patched, so we cannot use it any more. - function->shared()->EvictFromOptimizedCodeMap(code, "deoptimized function"); - +void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) { // Invalidate the relocation information, as it will become invalid by the // code patching below, and is not needed any more. code->InvalidateRelocation(); @@ -71,7 +57,7 @@ void Deoptimizer::DeoptimizeFunctionWithPreparedFunctionList( // before the safepoint table (space was allocated there when the Code // object was created, if necessary). - Address instruction_start = function->code()->instruction_start(); + Address instruction_start = code->instruction_start(); #ifdef DEBUG Address prev_call_address = NULL; #endif @@ -93,25 +79,6 @@ void Deoptimizer::DeoptimizeFunctionWithPreparedFunctionList( prev_call_address = call_address; #endif } - - // Add the deoptimizing code to the list. - DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code); - DeoptimizerData* data = isolate->deoptimizer_data(); - node->set_next(data->deoptimizing_code_list_); - data->deoptimizing_code_list_ = node; - - // We might be in the middle of incremental marking with compaction. - // Tell collector to treat this code object in a special way and - // ignore all slots that might have been recorded on it. - isolate->heap()->mark_compact_collector()->InvalidateCode(code); - - ReplaceCodeForRelatedFunctions(function, code); - - if (FLAG_trace_deopt) { - PrintF("[forced deoptimization: "); - function->PrintName(); - PrintF(" / %" V8PRIxPTR "]\n", reinterpret_cast(function)); - } } @@ -610,6 +577,17 @@ void Deoptimizer::TableEntryGenerator::GeneratePrologue() { __ bind(&done); } + +void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) { + SetFrameSlot(offset, value); +} + + +void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) { + SetFrameSlot(offset, value); +} + + #undef __ diff --git a/deps/v8/src/x64/lithium-codegen-x64.cc b/deps/v8/src/x64/lithium-codegen-x64.cc index c9b808c..364c3a1 100644 --- a/deps/v8/src/x64/lithium-codegen-x64.cc +++ b/deps/v8/src/x64/lithium-codegen-x64.cc @@ -410,7 +410,7 @@ bool LCodeGen::IsTaggedConstant(LConstantOperand* op) const { } -int LCodeGen::ToInteger32(LConstantOperand* op) const { +int32_t LCodeGen::ToInteger32(LConstantOperand* op) const { HConstant* constant = chunk_->LookupConstant(op); return constant->Integer32Value(); } @@ -697,12 +697,6 @@ void LCodeGen::DeoptimizeIf(Condition cc, } -void LCodeGen::SoftDeoptimize(LEnvironment* environment) { - ASSERT(!info()->IsStub()); - DeoptimizeIf(no_condition, environment, Deoptimizer::SOFT); -} - - void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle code) { ZoneList > maps(1, zone()); int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); @@ -1305,9 +1299,19 @@ void LCodeGen::DoMulI(LMulI* instr) { __ imull(left, left, Immediate(right_value)); } } else if (right->IsStackSlot()) { - __ imull(left, ToOperand(right)); + if (instr->hydrogen_value()->representation().IsSmi()) { + __ SmiToInteger32(left, left); + __ imul(left, ToOperand(right)); + } else { + __ imull(left, ToOperand(right)); + } } else { - __ imull(left, ToRegister(right)); + if (instr->hydrogen_value()->representation().IsSmi()) { + __ SmiToInteger32(left, left); + __ imul(left, ToRegister(right)); + } else { + __ imull(left, ToRegister(right)); + } } if (can_overflow) { @@ -1364,13 +1368,13 @@ void LCodeGen::DoBitI(LBitI* instr) { } else if (right->IsStackSlot()) { switch (instr->op()) { case Token::BIT_AND: - __ andl(ToRegister(left), ToOperand(right)); + __ and_(ToRegister(left), ToOperand(right)); break; case Token::BIT_OR: - __ orl(ToRegister(left), ToOperand(right)); + __ or_(ToRegister(left), ToOperand(right)); break; case Token::BIT_XOR: - __ xorl(ToRegister(left), ToOperand(right)); + __ xor_(ToRegister(left), ToOperand(right)); break; default: UNREACHABLE(); @@ -1380,13 +1384,13 @@ void LCodeGen::DoBitI(LBitI* instr) { ASSERT(right->IsRegister()); switch (instr->op()) { case Token::BIT_AND: - __ andl(ToRegister(left), ToRegister(right)); + __ and_(ToRegister(left), ToRegister(right)); break; case Token::BIT_OR: - __ orl(ToRegister(left), ToRegister(right)); + __ or_(ToRegister(left), ToRegister(right)); break; case Token::BIT_XOR: - __ xorl(ToRegister(left), ToRegister(right)); + __ xor_(ToRegister(left), ToRegister(right)); break; default: UNREACHABLE(); @@ -1469,9 +1473,17 @@ void LCodeGen::DoSubI(LSubI* instr) { __ subl(ToRegister(left), Immediate(ToInteger32(LConstantOperand::cast(right)))); } else if (right->IsRegister()) { - __ subl(ToRegister(left), ToRegister(right)); + if (instr->hydrogen_value()->representation().IsSmi()) { + __ subq(ToRegister(left), ToRegister(right)); + } else { + __ subl(ToRegister(left), ToRegister(right)); + } } else { - __ subl(ToRegister(left), ToOperand(right)); + if (instr->hydrogen_value()->representation().IsSmi()) { + __ subq(ToRegister(left), ToOperand(right)); + } else { + __ subl(ToRegister(left), ToOperand(right)); + } } if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { @@ -1510,12 +1522,7 @@ void LCodeGen::DoConstantD(LConstantD* instr) { void LCodeGen::DoConstantT(LConstantT* instr) { Handle value = instr->value(); AllowDeferredHandleDereference smi_check; - if (value->IsSmi()) { - __ Move(ToRegister(instr->result()), value); - } else { - __ LoadHeapObject(ToRegister(instr->result()), - Handle::cast(value)); - } + __ LoadObject(ToRegister(instr->result()), value); } @@ -1657,16 +1664,28 @@ void LCodeGen::DoAddI(LAddI* instr) { MemOperand(ToRegister(left), offset)); } else { Operand address(ToRegister(left), ToRegister(right), times_1, 0); - __ leal(ToRegister(instr->result()), address); + if (instr->hydrogen()->representation().IsSmi()) { + __ lea(ToRegister(instr->result()), address); + } else { + __ leal(ToRegister(instr->result()), address); + } } } else { if (right->IsConstantOperand()) { __ addl(ToRegister(left), Immediate(ToInteger32(LConstantOperand::cast(right)))); } else if (right->IsRegister()) { - __ addl(ToRegister(left), ToRegister(right)); + if (instr->hydrogen_value()->representation().IsSmi()) { + __ addq(ToRegister(left), ToRegister(right)); + } else { + __ addl(ToRegister(left), ToRegister(right)); + } } else { - __ addl(ToRegister(left), ToOperand(right)); + if (instr->hydrogen_value()->representation().IsSmi()) { + __ addq(ToRegister(left), ToOperand(right)); + } else { + __ addl(ToRegister(left), ToOperand(right)); + } } if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { DeoptimizeIf(overflow, instr->environment()); @@ -2087,14 +2106,6 @@ void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { } -void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { - Register left = ToRegister(instr->left()); - - __ cmpq(left, Immediate(instr->hydrogen()->right())); - EmitBranch(instr, equal); -} - - Condition LCodeGen::EmitIsObject(Register input, Label* is_not_object, Label* is_object) { @@ -2703,9 +2714,9 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset)); __ movq(result, FieldOperand(result, offset + FixedArray::kHeaderSize)); } - } else if (lookup.IsConstantFunction()) { - Handle function(lookup.GetConstantFunctionFromMap(*type)); - __ LoadHeapObject(result, function); + } else if (lookup.IsConstant()) { + Handle constant(lookup.GetConstantFromMap(*type), isolate()); + __ LoadObject(result, constant); } else { // Negative lookup. // Check prototypes. @@ -2736,7 +2747,7 @@ static bool CompactEmit(SmallMapList* list, if (map->HasElementsTransition()) return false; LookupResult lookup(isolate); map->LookupDescriptor(NULL, *name, &lookup); - return lookup.IsField() || lookup.IsConstantFunction(); + return lookup.IsField() || lookup.IsConstant(); } @@ -2886,9 +2897,7 @@ void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) { // gets replaced during bound check elimination with the index argument // to the bounds check, which can be tagged, so that case must be // handled here, too. - if (instr->hydrogen()->key()->representation().IsSmi()) { - __ SmiToInteger64(key_reg, key_reg); - } else if (instr->hydrogen()->IsDehoisted()) { + if (instr->hydrogen()->IsDehoisted()) { // Sign extend key because it could be a 32 bit negative value // and the dehoisted address computation happens in 64 bits __ movsxlq(key_reg, key_reg); @@ -2959,9 +2968,7 @@ void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) { // representation for the key to be an integer, the input gets replaced // during bound check elimination with the index argument to the bounds // check, which can be tagged, so that case must be handled here, too. - if (instr->hydrogen()->key()->representation().IsSmi()) { - __ SmiToInteger64(key_reg, key_reg); - } else if (instr->hydrogen()->IsDehoisted()) { + if (instr->hydrogen()->IsDehoisted()) { // Sign extend key because it could be a 32 bit negative value // and the dehoisted address computation happens in 64 bits __ movsxlq(key_reg, key_reg); @@ -3001,9 +3008,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) { // gets replaced during bound check elimination with the index // argument to the bounds check, which can be tagged, so that // case must be handled here, too. - if (instr->hydrogen()->key()->representation().IsSmi()) { - __ SmiToInteger64(key_reg, key_reg); - } else if (instr->hydrogen()->IsDehoisted()) { + if (instr->hydrogen()->IsDehoisted()) { // Sign extend key because it could be a 32 bit negative value // and the dehoisted address computation happens in 64 bits __ movsxlq(key_reg, key_reg); @@ -3343,38 +3348,29 @@ void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) { Heap::kHeapNumberMapRootIndex); DeoptimizeIf(not_equal, instr->environment()); - Label done; + Label slow, allocated, done; Register tmp = input_reg.is(rax) ? rcx : rax; Register tmp2 = tmp.is(rcx) ? rdx : input_reg.is(rcx) ? rdx : rcx; // Preserve the value of all registers. PushSafepointRegistersScope scope(this); - Label negative; __ movl(tmp, FieldOperand(input_reg, HeapNumber::kExponentOffset)); // Check the sign of the argument. If the argument is positive, just // return it. We do not need to patch the stack since |input| and // |result| are the same register and |input| will be restored // unchanged by popping safepoint registers. __ testl(tmp, Immediate(HeapNumber::kSignMask)); - __ j(not_zero, &negative); - __ jmp(&done); - - __ bind(&negative); + __ j(zero, &done); - Label allocated, slow; __ AllocateHeapNumber(tmp, tmp2, &slow); - __ jmp(&allocated); + __ jmp(&allocated, Label::kNear); // Slow case: Call the runtime system to do the number allocation. __ bind(&slow); - CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr); // Set the pointer to the new heap number in tmp. - if (!tmp.is(rax)) { - __ movq(tmp, rax); - } - + if (!tmp.is(rax)) __ movq(tmp, rax); // Restore input_reg after call to runtime. __ LoadFromSafepointRegisterSlot(input_reg, input_reg); @@ -3393,7 +3389,7 @@ void LCodeGen::EmitIntegerMathAbs(LMathAbs* instr) { Register input_reg = ToRegister(instr->value()); __ testl(input_reg, input_reg); Label is_positive; - __ j(not_sign, &is_positive); + __ j(not_sign, &is_positive, Label::kNear); __ negl(input_reg); // Sets flags. DeoptimizeIf(negative, instr->environment()); __ bind(&is_positive); @@ -4023,6 +4019,18 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { } +void LCodeGen::ApplyCheckIf(Condition cc, LBoundsCheck* check) { + if (FLAG_debug_code && check->hydrogen()->skip_check()) { + Label done; + __ j(NegateCondition(cc), &done, Label::kNear); + __ int3(); + __ bind(&done); + } else { + DeoptimizeIf(cc, check->environment()); + } +} + + void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { if (instr->hydrogen()->skip_check()) return; @@ -4060,7 +4068,9 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { __ cmpq(length, ToRegister(instr->index())); } } - DeoptimizeIf(below_equal, instr->environment()); + Condition condition = + instr->hydrogen()->allow_equality() ? below : below_equal; + ApplyCheckIf(condition, instr); } @@ -4074,9 +4084,7 @@ void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { // gets replaced during bound check elimination with the index // argument to the bounds check, which can be tagged, so that case // must be handled here, too. - if (instr->hydrogen()->key()->representation().IsSmi()) { - __ SmiToInteger64(key_reg, key_reg); - } else if (instr->hydrogen()->IsDehoisted()) { + if (instr->hydrogen()->IsDehoisted()) { // Sign extend key because it could be a 32 bit negative value // and the dehoisted address computation happens in 64 bits __ movsxlq(key_reg, key_reg); @@ -4138,9 +4146,7 @@ void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) { // input gets replaced during bound check elimination with the index // argument to the bounds check, which can be tagged, so that case // must be handled here, too. - if (instr->hydrogen()->key()->representation().IsSmi()) { - __ SmiToInteger64(key_reg, key_reg); - } else if (instr->hydrogen()->IsDehoisted()) { + if (instr->hydrogen()->IsDehoisted()) { // Sign extend key because it could be a 32 bit negative value // and the dehoisted address computation happens in 64 bits __ movsxlq(key_reg, key_reg); @@ -4181,9 +4187,7 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { // input gets replaced during bound check elimination with the index // argument to the bounds check, which can be tagged, so that case // must be handled here, too. - if (instr->hydrogen()->key()->representation().IsSmi()) { - __ SmiToInteger64(key_reg, key_reg); - } else if (instr->hydrogen()->IsDehoisted()) { + if (instr->hydrogen()->IsDehoisted()) { // Sign extend key because it could be a 32 bit negative value // and the dehoisted address computation happens in 64 bits __ movsxlq(key_reg, key_reg); @@ -4954,6 +4958,7 @@ void LCodeGen::DoCheckMapCommon(Register reg, void LCodeGen::DoCheckMaps(LCheckMaps* instr) { + if (instr->hydrogen()->CanOmitMapChecks()) return; LOperand* input = instr->value(); ASSERT(input->IsRegister()); Register reg = ToRegister(input); @@ -5021,6 +5026,7 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) { void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { + if (instr->hydrogen()->CanOmitPrototypeChecks()) return; Register reg = ToRegister(instr->temp()); ZoneList >* prototypes = instr->prototypes(); @@ -5028,11 +5034,9 @@ void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { ASSERT(prototypes->length() == maps->length()); - if (!instr->hydrogen()->CanOmitPrototypeChecks()) { - for (int i = 0; i < prototypes->length(); i++) { - __ LoadHeapObject(reg, prototypes->at(i)); - DoCheckMapCommon(reg, maps->at(i), instr); - } + for (int i = 0; i < prototypes->length(); i++) { + __ LoadHeapObject(reg, prototypes->at(i)); + DoCheckMapCommon(reg, maps->at(i), instr); } } @@ -5075,6 +5079,23 @@ void LCodeGen::DoAllocate(LAllocate* instr) { } __ bind(deferred->exit()); + + if (instr->hydrogen()->MustPrefillWithFiller()) { + if (instr->size()->IsConstantOperand()) { + int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); + __ movl(temp, Immediate((size / kPointerSize) - 1)); + } else { + temp = ToRegister(instr->size()); + __ sar(temp, Immediate(kPointerSizeLog2)); + __ decl(temp); + } + Label loop; + __ bind(&loop); + __ Move(FieldOperand(result, temp, times_pointer_size, 0), + isolate()->factory()->one_pointer_filler_map()); + __ decl(temp); + __ j(not_zero, &loop); + } } @@ -5347,11 +5368,15 @@ void LCodeGen::DoLazyBailout(LLazyBailout* instr) { void LCodeGen::DoDeoptimize(LDeoptimize* instr) { - if (instr->hydrogen_value()->IsSoftDeoptimize()) { - SoftDeoptimize(instr->environment()); - } else { - DeoptimizeIf(no_condition, instr->environment()); - } + Deoptimizer::BailoutType type = instr->hydrogen()->type(); + // TODO(danno): Stubs expect all deopts to be lazy for historical reasons (the + // needed return address), even though the implementation of LAZY and EAGER is + // now identical. When LAZY is eventually completely folded into EAGER, remove + // the special case below. + if (info()->IsStub() && type == Deoptimizer::EAGER) { + type = Deoptimizer::LAZY; + } + DeoptimizeIf(no_condition, instr->environment(), type); } diff --git a/deps/v8/src/x64/lithium-codegen-x64.h b/deps/v8/src/x64/lithium-codegen-x64.h index 0a43096..5ad1c40 100644 --- a/deps/v8/src/x64/lithium-codegen-x64.h +++ b/deps/v8/src/x64/lithium-codegen-x64.h @@ -102,7 +102,8 @@ class LCodeGen BASE_EMBEDDED { XMMRegister ToDoubleRegister(LOperand* op) const; bool IsInteger32Constant(LConstantOperand* op) const; bool IsSmiConstant(LConstantOperand* op) const; - int ToInteger32(LConstantOperand* op) const; + int ToRepresentation(LConstantOperand* op, const Representation& r) const; + int32_t ToInteger32(LConstantOperand* op) const; Smi* ToSmi(LConstantOperand* op) const; double ToDouble(LConstantOperand* op) const; bool IsTaggedConstant(LConstantOperand* op) const; @@ -245,7 +246,7 @@ class LCodeGen BASE_EMBEDDED { LEnvironment* environment, Deoptimizer::BailoutType bailout_type); void DeoptimizeIf(Condition cc, LEnvironment* environment); - void SoftDeoptimize(LEnvironment* environment); + void ApplyCheckIf(Condition cc, LBoundsCheck* check); void AddToTranslation(Translation* translation, LOperand* op, bool is_tagged, diff --git a/deps/v8/src/x64/lithium-x64.cc b/deps/v8/src/x64/lithium-x64.cc index 2cec68b..d6f05c0 100644 --- a/deps/v8/src/x64/lithium-x64.cc +++ b/deps/v8/src/x64/lithium-x64.cc @@ -710,11 +710,6 @@ LInstruction* LChunkBuilder::DoEnvironmentMarker(HEnvironmentMarker* instr) { } -LInstruction* LChunkBuilder::DoSoftDeoptimize(HSoftDeoptimize* instr) { - return AssignEnvironment(new(zone()) LDeoptimize); -} - - LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) { return AssignEnvironment(new(zone()) LDeoptimize); } @@ -792,8 +787,8 @@ LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, op == Token::SUB); HValue* left = instr->left(); HValue* right = instr->right(); - ASSERT(left->representation().IsSmiOrTagged()); - ASSERT(right->representation().IsSmiOrTagged()); + ASSERT(left->representation().IsTagged()); + ASSERT(right->representation().IsTagged()); LOperand* left_operand = UseFixed(left, rdx); LOperand* right_operand = UseFixed(right, rax); LArithmeticT* result = @@ -1324,17 +1319,17 @@ LInstruction* LChunkBuilder::DoShl(HShl* instr) { LInstruction* LChunkBuilder::DoBitwise(HBitwise* instr) { - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); return DefineSameAsFirst(new(zone()) LBitI(left, right)); } else { - ASSERT(instr->representation().IsSmiOrTagged()); - ASSERT(instr->left()->representation().IsSmiOrTagged()); - ASSERT(instr->right()->representation().IsSmiOrTagged()); + ASSERT(instr->representation().IsTagged()); + ASSERT(instr->left()->representation().IsTagged()); + ASSERT(instr->right()->representation().IsTagged()); LOperand* left = UseFixed(instr->left(), rdx); LOperand* right = UseFixed(instr->right(), rax); @@ -1357,7 +1352,9 @@ LInstruction* LChunkBuilder::DoBitNot(HBitNot* instr) { LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { if (instr->representation().IsDouble()) { return DoArithmeticD(Token::DIV, instr); - } else if (instr->representation().IsInteger32()) { + } else if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); if (instr->HasPowerOf2Divisor()) { ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero)); LOperand* value = UseRegisterAtStart(instr->left()); @@ -1373,7 +1370,7 @@ LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { LDivI* result = new(zone()) LDivI(dividend, divisor, temp); return AssignEnvironment(DefineFixed(result, rax)); } else { - ASSERT(instr->representation().IsSmiOrTagged()); + ASSERT(instr->representation().IsTagged()); return DoArithmeticT(Token::DIV, instr); } } @@ -1437,9 +1434,9 @@ LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) { LInstruction* LChunkBuilder::DoMod(HMod* instr) { HValue* left = instr->left(); HValue* right = instr->right(); - if (instr->representation().IsInteger32()) { - ASSERT(left->representation().IsInteger32()); - ASSERT(right->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(left->representation().Equals(instr->representation())); + ASSERT(right->representation().Equals(instr->representation())); if (instr->HasPowerOf2Divisor()) { ASSERT(!right->CanBeZero()); LModI* mod = new(zone()) LModI(UseRegisterAtStart(left), @@ -1472,7 +1469,7 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) { ? AssignEnvironment(result) : result; } - } else if (instr->representation().IsSmiOrTagged()) { + } else if (instr->representation().IsTagged()) { return DoArithmeticT(Token::MOD, instr); } else { ASSERT(instr->representation().IsDouble()); @@ -1488,9 +1485,9 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) { LInstruction* LChunkBuilder::DoMul(HMul* instr) { - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); LOperand* right = UseOrConstant(instr->BetterRightOperand()); LMulI* mul = new(zone()) LMulI(left, right); @@ -1502,16 +1499,16 @@ LInstruction* LChunkBuilder::DoMul(HMul* instr) { } else if (instr->representation().IsDouble()) { return DoArithmeticD(Token::MUL, instr); } else { - ASSERT(instr->representation().IsSmiOrTagged()); + ASSERT(instr->representation().IsTagged()); return DoArithmeticT(Token::MUL, instr); } } LInstruction* LChunkBuilder::DoSub(HSub* instr) { - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* left = UseRegisterAtStart(instr->left()); LOperand* right = UseOrConstantAtStart(instr->right()); LSubI* sub = new(zone()) LSubI(left, right); @@ -1523,21 +1520,21 @@ LInstruction* LChunkBuilder::DoSub(HSub* instr) { } else if (instr->representation().IsDouble()) { return DoArithmeticD(Token::SUB, instr); } else { - ASSERT(instr->representation().IsSmiOrTagged()); + ASSERT(instr->representation().IsTagged()); return DoArithmeticT(Token::SUB, instr); } } LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { - if (instr->representation().IsInteger32()) { + if (instr->representation().IsSmiOrInteger32()) { // Check to see if it would be advantageous to use an lea instruction rather // than an add. This is the case when no overflow check is needed and there // are multiple uses of the add's inputs, so using a 3-register add will // preserve all input values for later uses. bool use_lea = LAddI::UseLea(instr); - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); HValue* right_candidate = instr->BetterRightOperand(); LOperand* right = use_lea @@ -1555,7 +1552,7 @@ LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { } else if (instr->representation().IsDouble()) { return DoArithmeticD(Token::ADD, instr); } else { - ASSERT(instr->representation().IsSmiOrTagged()); + ASSERT(instr->representation().IsTagged()); return DoArithmeticT(Token::ADD, instr); } return NULL; @@ -1652,13 +1649,6 @@ LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( } -LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch( - HCompareConstantEqAndBranch* instr) { - LOperand* value = UseRegisterAtStart(instr->value()); - return new(zone()) LCmpConstantEqAndBranch(value); -} - - LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { ASSERT(instr->value()->representation().IsTagged()); return new(zone()) LIsObjectAndBranch(UseRegisterAtStart(instr->value())); @@ -1949,8 +1939,10 @@ LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { - LUnallocated* temp = TempRegister(); + LUnallocated* temp = NULL; + if (!instr->CanOmitPrototypeChecks()) temp = TempRegister(); LCheckPrototypeMaps* result = new(zone()) LCheckPrototypeMaps(temp); + if (instr->CanOmitPrototypeChecks()) return result; return AssignEnvironment(result); } @@ -1962,8 +1954,10 @@ LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) { LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { - LOperand* value = UseRegisterAtStart(instr->value()); + LOperand* value = NULL; + if (!instr->CanOmitMapChecks()) value = UseRegisterAtStart(instr->value()); LCheckMaps* result = new(zone()) LCheckMaps(value); + if (instr->CanOmitMapChecks()) return result; return AssignEnvironment(result); } @@ -2124,13 +2118,9 @@ LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { - ASSERT(instr->key()->representation().IsInteger32() || - instr->key()->representation().IsSmi()); + ASSERT(instr->key()->representation().IsInteger32()); ElementsKind elements_kind = instr->elements_kind(); - bool clobbers_key = instr->key()->representation().IsSmi(); - LOperand* key = clobbers_key - ? UseTempRegister(instr->key()) - : UseRegisterOrConstantAtStart(instr->key()); + LOperand* key = UseRegisterOrConstantAtStart(instr->key()); LLoadKeyed* result = NULL; if (!instr->is_external()) { @@ -2168,7 +2158,6 @@ LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { ElementsKind elements_kind = instr->elements_kind(); - bool clobbers_key = instr->key()->representation().IsSmi(); if (!instr->is_external()) { ASSERT(instr->elements()->representation().IsTagged()); @@ -2180,8 +2169,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { if (instr->value()->representation().IsDouble()) { object = UseRegisterAtStart(instr->elements()); val = UseTempRegister(instr->value()); - key = clobbers_key ? UseTempRegister(instr->key()) - : UseRegisterOrConstantAtStart(instr->key()); + key = UseRegisterOrConstantAtStart(instr->key()); } else { ASSERT(instr->value()->representation().IsSmiOrTagged()); object = UseTempRegister(instr->elements()); @@ -2190,12 +2178,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { key = UseTempRegister(instr->key()); } else { val = UseRegisterOrConstantAtStart(instr->value()); - - if (clobbers_key) { - key = UseTempRegister(instr->key()); - } else { - key = UseRegisterOrConstantAtStart(instr->key()); - } + key = UseRegisterOrConstantAtStart(instr->key()); } } @@ -2215,8 +2198,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { elements_kind == EXTERNAL_FLOAT_ELEMENTS; LOperand* val = val_is_temp_register ? UseTempRegister(instr->value()) : UseRegister(instr->value()); - LOperand* key = clobbers_key ? UseTempRegister(instr->key()) - : UseRegisterOrConstantAtStart(instr->key()); + LOperand* key = UseRegisterOrConstantAtStart(instr->key()); LOperand* external_pointer = UseRegister(instr->elements()); return new(zone()) LStoreKeyed(external_pointer, key, val); } diff --git a/deps/v8/src/x64/lithium-x64.h b/deps/v8/src/x64/lithium-x64.h index 32ee0b9..50e32d8 100644 --- a/deps/v8/src/x64/lithium-x64.h +++ b/deps/v8/src/x64/lithium-x64.h @@ -40,12 +40,6 @@ namespace internal { // Forward declarations. class LCodeGen; -#define LITHIUM_ALL_INSTRUCTION_LIST(V) \ - V(ControlInstruction) \ - V(Call) \ - LITHIUM_CONCRETE_INSTRUCTION_LIST(V) - - #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ V(AccessArgumentsAt) \ V(AddI) \ @@ -72,6 +66,7 @@ class LCodeGen; V(CheckFunction) \ V(CheckInstanceType) \ V(CheckMaps) \ + V(CheckMapValue) \ V(CheckNonSmi) \ V(CheckPrototypeMaps) \ V(CheckSmi) \ @@ -79,7 +74,6 @@ class LCodeGen; V(ClampIToUint8) \ V(ClampTToUint8) \ V(ClassOfTestAndBranch) \ - V(CmpConstantEqAndBranch) \ V(CompareNumericAndBranch) \ V(CmpObjectEqAndBranch) \ V(CmpMapAndBranch) \ @@ -89,15 +83,18 @@ class LCodeGen; V(ConstantS) \ V(ConstantT) \ V(Context) \ + V(DateField) \ V(DebugBreak) \ V(DeclareGlobals) \ V(Deoptimize) \ V(DivI) \ V(DoubleToI) \ V(DoubleToSmi) \ + V(Drop) \ V(DummyUse) \ V(ElementsKind) \ - V(MapEnumLength) \ + V(ForInCacheArray) \ + V(ForInPrepareMap) \ V(FunctionLiteral) \ V(GetCachedArrayIndex) \ V(GlobalObject) \ @@ -105,13 +102,13 @@ class LCodeGen; V(Goto) \ V(HasCachedArrayIndexAndBranch) \ V(HasInstanceTypeAndBranch) \ + V(InnerAllocatedObject) \ V(InstanceOf) \ V(InstanceOfKnownGlobal) \ V(InstanceSize) \ V(InstructionGap) \ V(Integer32ToDouble) \ V(Integer32ToSmi) \ - V(Uint32ToDouble) \ V(InvokeFunction) \ V(IsConstructCallAndBranch) \ V(IsObjectAndBranch) \ @@ -124,6 +121,7 @@ class LCodeGen; V(LinkObjectInList) \ V(LoadContextSlot) \ V(LoadExternalArrayPointer) \ + V(LoadFieldByIndex) \ V(LoadFunctionPrototype) \ V(LoadGlobalCell) \ V(LoadGlobalGeneric) \ @@ -132,6 +130,7 @@ class LCodeGen; V(LoadNamedField) \ V(LoadNamedFieldPolymorphic) \ V(LoadNamedGeneric) \ + V(MapEnumLength) \ V(MathAbs) \ V(MathCos) \ V(MathExp) \ @@ -184,16 +183,10 @@ class LCodeGen; V(TrapAllocationMemento) \ V(Typeof) \ V(TypeofIsAndBranch) \ + V(Uint32ToDouble) \ V(UnknownOSRValue) \ V(ValueOf) \ - V(ForInPrepareMap) \ - V(ForInCacheArray) \ - V(CheckMapValue) \ - V(LoadFieldByIndex) \ - V(DateField) \ - V(WrapReceiver) \ - V(Drop) \ - V(InnerAllocatedObject) + V(WrapReceiver) #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ @@ -433,6 +426,7 @@ class LDummyUse: public LTemplateInstruction<1, 1, 0> { class LDeoptimize: public LTemplateInstruction<0, 0, 0> { public: DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") + DECLARE_HYDROGEN_ACCESSOR(Deoptimize) }; @@ -837,20 +831,6 @@ class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> { }; -class LCmpConstantEqAndBranch: public LControlInstruction<1, 0> { - public: - explicit LCmpConstantEqAndBranch(LOperand* left) { - inputs_[0] = left; - } - - LOperand* left() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(CmpConstantEqAndBranch, - "cmp-constant-eq-and-branch") - DECLARE_HYDROGEN_ACCESSOR(CompareConstantEqAndBranch) -}; - - class LIsObjectAndBranch: public LControlInstruction<1, 0> { public: explicit LIsObjectAndBranch(LOperand* value) { diff --git a/deps/v8/src/x64/macro-assembler-x64.cc b/deps/v8/src/x64/macro-assembler-x64.cc index b3e1590..13d7dda 100644 --- a/deps/v8/src/x64/macro-assembler-x64.cc +++ b/deps/v8/src/x64/macro-assembler-x64.cc @@ -2253,7 +2253,8 @@ void MacroAssembler::JumpIfNotBothSequentialAsciiStrings( ASSERT(kNotStringTag != 0); const int kFlatAsciiStringMask = kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; - const int kFlatAsciiStringTag = ASCII_STRING_TYPE; + const int kFlatAsciiStringTag = + kStringTag | kOneByteStringTag | kSeqStringTag; andl(scratch1, Immediate(kFlatAsciiStringMask)); andl(scratch2, Immediate(kFlatAsciiStringMask)); @@ -2299,7 +2300,8 @@ void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialAscii( ASSERT(kNotStringTag != 0); const int kFlatAsciiStringMask = kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; - const int kFlatAsciiStringTag = ASCII_STRING_TYPE; + const int kFlatAsciiStringTag = + kStringTag | kOneByteStringTag | kSeqStringTag; andl(scratch1, Immediate(kFlatAsciiStringMask)); andl(scratch2, Immediate(kFlatAsciiStringMask)); @@ -3836,6 +3838,7 @@ void MacroAssembler::Allocate(int object_size, Label* gc_required, AllocationFlags flags) { ASSERT((flags & (RESULT_CONTAINS_TOP | SIZE_IN_WORDS)) == 0); + ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize); if (!FLAG_inline_new) { if (emit_debug_code()) { // Trash the registers to simulate an allocation failure. diff --git a/deps/v8/src/x64/stub-cache-x64.cc b/deps/v8/src/x64/stub-cache-x64.cc index a903ea1..542018f 100644 --- a/deps/v8/src/x64/stub-cache-x64.cc +++ b/deps/v8/src/x64/stub-cache-x64.cc @@ -794,11 +794,9 @@ void BaseStoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, Representation representation = details.representation(); ASSERT(!representation.IsNone()); - if (details.type() == CONSTANT_FUNCTION) { - Handle constant( - HeapObject::cast(descriptors->GetValue(descriptor))); - __ LoadHeapObject(scratch1, constant); - __ cmpq(value_reg, scratch1); + if (details.type() == CONSTANT) { + Handle constant(descriptors->GetValue(descriptor), masm->isolate()); + __ CmpObject(value_reg, constant); __ j(not_equal, miss_label); } else if (FLAG_track_fields && representation.IsSmi()) { __ JumpIfNotSmi(value_reg, miss_label); @@ -857,7 +855,7 @@ void BaseStoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); - if (details.type() == CONSTANT_FUNCTION) { + if (details.type() == CONSTANT) { ASSERT(value_reg.is(rax)); __ ret(0); return; @@ -1357,9 +1355,9 @@ void BaseLoadStubCompiler::GenerateLoadCallback( } -void BaseLoadStubCompiler::GenerateLoadConstant(Handle value) { +void BaseLoadStubCompiler::GenerateLoadConstant(Handle value) { // Return the constant value. - __ LoadHeapObject(rax, value); + __ LoadObject(rax, value); __ ret(0); } @@ -2500,7 +2498,7 @@ Handle CallStubCompiler::CompileCallConstant( Handle code = CompileCustomCall(object, holder, Handle::null(), function, Handle::cast(name), - Code::CONSTANT_FUNCTION); + Code::CONSTANT); // A null handle means bail out to the regular compiler code below. if (!code.is_null()) return code; } diff --git a/deps/v8/test/cctest/cctest.status b/deps/v8/test/cctest/cctest.status index 9e8f608..0d3ff15 100644 --- a/deps/v8/test/cctest/cctest.status +++ b/deps/v8/test/cctest/cctest.status @@ -49,9 +49,6 @@ test-log/EquivalenceOfLoggingAndTraversal: PASS || FAIL test-weakmaps/Shrinking: FAIL test-weaksets/WeakSet_Shrinking: FAIL -# Deferred stack trace formatting is temporarily disabled. -test-heap/ReleaseStackTraceData: PASS || FAIL - # Boot up memory use is bloated in debug mode. test-mark-compact/BootUpMemoryUse: PASS, PASS || FAIL if $mode == debug diff --git a/deps/v8/test/cctest/test-api.cc b/deps/v8/test/cctest/test-api.cc index fa671dc..3895e52 100644 --- a/deps/v8/test/cctest/test-api.cc +++ b/deps/v8/test/cctest/test-api.cc @@ -49,6 +49,7 @@ #include "snapshot.h" #include "unicode-inl.h" #include "utils.h" +#include "vm-state.h" static const bool kLogThreading = false; @@ -848,8 +849,8 @@ static void CheckReturnValue(const T& t, i::Address callback) { // VMState is set to EXTERNAL. if (isolate->cpu_profiler()->is_profiling()) { CHECK_EQ(i::EXTERNAL, isolate->current_vm_state()); - CHECK(isolate->external_callback()); - CHECK_EQ(callback, isolate->external_callback()); + CHECK(isolate->external_callback_scope()); + CHECK_EQ(callback, isolate->external_callback_scope()->callback()); } } diff --git a/deps/v8/test/cctest/test-assembler-arm.cc b/deps/v8/test/cctest/test-assembler-arm.cc index c79e740..cb677b3 100644 --- a/deps/v8/test/cctest/test-assembler-arm.cc +++ b/deps/v8/test/cctest/test-assembler-arm.cc @@ -1049,6 +1049,8 @@ TEST(13) { double i; double j; double k; + uint32_t low; + uint32_t high; } T; T t; @@ -1113,6 +1115,11 @@ TEST(13) { __ vmov(d22, VmovIndexHi, r2); __ add(r4, r0, Operand(OFFSET_OF(T, i))); __ vstm(ia_w, r4, d20, d22); + // Move d22 into low and high. + __ vmov(r4, VmovIndexLo, d22); + __ str(r4, MemOperand(r0, OFFSET_OF(T, low))); + __ vmov(r4, VmovIndexHi, d22); + __ str(r4, MemOperand(r0, OFFSET_OF(T, high))); __ ldm(ia_w, sp, r4.bit() | pc.bit()); @@ -1144,6 +1151,8 @@ TEST(13) { CHECK_EQ(14.7610017472335499, t.i); CHECK_EQ(16.0, t.j); CHECK_EQ(73.8818412254460241, t.k); + CHECK_EQ(372106121, t.low); + CHECK_EQ(1079146608, t.high); } } diff --git a/deps/v8/test/cctest/test-cpu-profiler.cc b/deps/v8/test/cctest/test-cpu-profiler.cc index eb72550..fe5e278 100644 --- a/deps/v8/test/cctest/test-cpu-profiler.cc +++ b/deps/v8/test/cctest/test-cpu-profiler.cc @@ -1081,3 +1081,231 @@ TEST(FunctionApplySample) { v8::CpuProfiler* cpu_profiler = env->GetIsolate()->GetCpuProfiler(); cpu_profiler->DeleteAllCpuProfiles(); } + + +static const char* js_native_js_test_source = "function foo(iterations) {\n" +" var r = 0;\n" +" for (var i = 0; i < iterations; i++) { r += i; }\n" +" return r;\n" +"}\n" +"function bar(iterations) {\n" +" try { foo(iterations); } catch(e) {}\n" +"}\n" +"function start(duration) {\n" +" var start = Date.now();\n" +" while (Date.now() - start < duration) {\n" +" try {\n" +" CallJsFunction(bar, 10 * 1000);\n" +" } catch(e) {}\n" +" }\n" +"}"; + +static void CallJsFunction(const v8::FunctionCallbackInfo& info) { + v8::Handle function = info[0].As(); + v8::Handle argv[] = { info[1] }; + function->Call(info.This(), ARRAY_SIZE(argv), argv); +} + + +// [Top down]: +// 58 0 (root) #0 1 +// 2 2 (program) #0 2 +// 56 1 start #16 3 +// 55 0 CallJsFunction #0 4 +// 55 1 bar #16 5 +// 54 54 foo #16 6 +TEST(JsNativeJsSample) { + LocalContext env; + v8::HandleScope scope(env->GetIsolate()); + + v8::Local func_template = v8::FunctionTemplate::New( + CallJsFunction); + v8::Local func = func_template->GetFunction(); + func->SetName(v8::String::New("CallJsFunction")); + env->Global()->Set(v8::String::New("CallJsFunction"), func); + + v8::Script::Compile(v8::String::New(js_native_js_test_source))->Run(); + v8::Local function = v8::Local::Cast( + env->Global()->Get(v8::String::New("start"))); + + int32_t duration_ms = 20; + v8::Handle args[] = { v8::Integer::New(duration_ms) }; + const v8::CpuProfile* profile = + RunProfiler(env, function, args, ARRAY_SIZE(args), 50); + + const v8::CpuProfileNode* root = profile->GetTopDownRoot(); + { + ScopedVector > names(3); + names[0] = v8::String::New(ProfileGenerator::kGarbageCollectorEntryName); + names[1] = v8::String::New(ProfileGenerator::kProgramEntryName); + names[2] = v8::String::New("start"); + CheckChildrenNames(root, names); + } + + const v8::CpuProfileNode* startNode = GetChild(root, "start"); + CHECK_EQ(1, startNode->GetChildrenCount()); + const v8::CpuProfileNode* nativeFunctionNode = + GetChild(startNode, "CallJsFunction"); + + CHECK_EQ(1, nativeFunctionNode->GetChildrenCount()); + const v8::CpuProfileNode* barNode = GetChild(nativeFunctionNode, "bar"); + + CHECK_EQ(1, barNode->GetChildrenCount()); + GetChild(barNode, "foo"); + + v8::CpuProfiler* cpu_profiler = env->GetIsolate()->GetCpuProfiler(); + cpu_profiler->DeleteAllCpuProfiles(); +} + + +static const char* js_native_js_runtime_js_test_source = +"function foo(iterations) {\n" +" var r = 0;\n" +" for (var i = 0; i < iterations; i++) { r += i; }\n" +" return r;\n" +"}\n" +"var bound = foo.bind(this);\n" +"function bar(iterations) {\n" +" try { bound(iterations); } catch(e) {}\n" +"}\n" +"function start(duration) {\n" +" var start = Date.now();\n" +" while (Date.now() - start < duration) {\n" +" try {\n" +" CallJsFunction(bar, 10 * 1000);\n" +" } catch(e) {}\n" +" }\n" +"}"; + + +// [Top down]: +// 57 0 (root) #0 1 +// 55 1 start #16 3 +// 54 0 CallJsFunction #0 4 +// 54 3 bar #16 5 +// 51 51 foo #16 6 +// 2 2 (program) #0 2 +TEST(JsNativeJsRuntimeJsSample) { + LocalContext env; + v8::HandleScope scope(env->GetIsolate()); + + v8::Local func_template = v8::FunctionTemplate::New( + CallJsFunction); + v8::Local func = func_template->GetFunction(); + func->SetName(v8::String::New("CallJsFunction")); + env->Global()->Set(v8::String::New("CallJsFunction"), func); + + v8::Script::Compile(v8::String::New(js_native_js_runtime_js_test_source))-> + Run(); + v8::Local function = v8::Local::Cast( + env->Global()->Get(v8::String::New("start"))); + + int32_t duration_ms = 20; + v8::Handle args[] = { v8::Integer::New(duration_ms) }; + const v8::CpuProfile* profile = + RunProfiler(env, function, args, ARRAY_SIZE(args), 50); + + const v8::CpuProfileNode* root = profile->GetTopDownRoot(); + ScopedVector > names(3); + names[0] = v8::String::New(ProfileGenerator::kGarbageCollectorEntryName); + names[1] = v8::String::New(ProfileGenerator::kProgramEntryName); + names[2] = v8::String::New("start"); + CheckChildrenNames(root, names); + + const v8::CpuProfileNode* startNode = GetChild(root, "start"); + CHECK_EQ(1, startNode->GetChildrenCount()); + const v8::CpuProfileNode* nativeFunctionNode = + GetChild(startNode, "CallJsFunction"); + + CHECK_EQ(1, nativeFunctionNode->GetChildrenCount()); + const v8::CpuProfileNode* barNode = GetChild(nativeFunctionNode, "bar"); + + CHECK_EQ(1, barNode->GetChildrenCount()); + GetChild(barNode, "foo"); + + v8::CpuProfiler* cpu_profiler = env->GetIsolate()->GetCpuProfiler(); + cpu_profiler->DeleteAllCpuProfiles(); +} + + +static void CallJsFunction2(const v8::FunctionCallbackInfo& info) { + CallJsFunction(info); +} + + +static const char* js_native1_js_native2_js_test_source = +"function foo(iterations) {\n" +" var r = 0;\n" +" for (var i = 0; i < iterations; i++) { r += i; }\n" +" return r;\n" +"}\n" +"function bar(iterations) {\n" +" CallJsFunction2(foo, iterations);\n" +"}\n" +"function start(duration) {\n" +" var start = Date.now();\n" +" while (Date.now() - start < duration) {\n" +" try {\n" +" CallJsFunction1(bar, 10 * 1000);\n" +" } catch(e) {}\n" +" }\n" +"}"; + + +// [Top down]: +// 57 0 (root) #0 1 +// 55 1 start #16 3 +// 54 0 CallJsFunction1 #0 4 +// 54 0 bar #16 5 +// 54 0 CallJsFunction2 #0 6 +// 54 54 foo #16 7 +// 2 2 (program) #0 2 +TEST(JsNative1JsNative2JsSample) { + LocalContext env; + v8::HandleScope scope(env->GetIsolate()); + + v8::Local func_template = v8::FunctionTemplate::New( + CallJsFunction); + v8::Local func1 = func_template->GetFunction(); + func1->SetName(v8::String::New("CallJsFunction1")); + env->Global()->Set(v8::String::New("CallJsFunction1"), func1); + + v8::Local func2 = v8::FunctionTemplate::New( + CallJsFunction2)->GetFunction(); + func2->SetName(v8::String::New("CallJsFunction2")); + env->Global()->Set(v8::String::New("CallJsFunction2"), func2); + + v8::Script::Compile(v8::String::New(js_native1_js_native2_js_test_source))-> + Run(); + v8::Local function = v8::Local::Cast( + env->Global()->Get(v8::String::New("start"))); + + int32_t duration_ms = 20; + v8::Handle args[] = { v8::Integer::New(duration_ms) }; + const v8::CpuProfile* profile = + RunProfiler(env, function, args, ARRAY_SIZE(args), 50); + + const v8::CpuProfileNode* root = profile->GetTopDownRoot(); + ScopedVector > names(3); + names[0] = v8::String::New(ProfileGenerator::kGarbageCollectorEntryName); + names[1] = v8::String::New(ProfileGenerator::kProgramEntryName); + names[2] = v8::String::New("start"); + CheckChildrenNames(root, names); + + const v8::CpuProfileNode* startNode = GetChild(root, "start"); + CHECK_EQ(1, startNode->GetChildrenCount()); + const v8::CpuProfileNode* nativeNode1 = + GetChild(startNode, "CallJsFunction1"); + + CHECK_EQ(1, nativeNode1->GetChildrenCount()); + const v8::CpuProfileNode* barNode = GetChild(nativeNode1, "bar"); + + CHECK_EQ(1, barNode->GetChildrenCount()); + const v8::CpuProfileNode* nativeNode2 = GetChild(barNode, "CallJsFunction2"); + + CHECK_EQ(1, nativeNode2->GetChildrenCount()); + GetChild(nativeNode2, "foo"); + + v8::CpuProfiler* cpu_profiler = env->GetIsolate()->GetCpuProfiler(); + cpu_profiler->DeleteAllCpuProfiles(); +} diff --git a/deps/v8/test/cctest/test-deoptimization.cc b/deps/v8/test/cctest/test-deoptimization.cc index dfc2754..c164193 100644 --- a/deps/v8/test/cctest/test-deoptimization.cc +++ b/deps/v8/test/cctest/test-deoptimization.cc @@ -77,23 +77,27 @@ class AlwaysOptimizeAllowNativesSyntaxNoInlining { // Utility class to set --allow-natives-syntax and --nouse-inlining when // constructed and return to their default state when destroyed. -class AllowNativesSyntaxNoInlining { +class AllowNativesSyntaxNoInliningNoParallel { public: - AllowNativesSyntaxNoInlining() + AllowNativesSyntaxNoInliningNoParallel() : allow_natives_syntax_(i::FLAG_allow_natives_syntax), - use_inlining_(i::FLAG_use_inlining) { + use_inlining_(i::FLAG_use_inlining), + parallel_recompilation_(i::FLAG_parallel_recompilation) { i::FLAG_allow_natives_syntax = true; i::FLAG_use_inlining = false; + i::FLAG_parallel_recompilation = false; } - ~AllowNativesSyntaxNoInlining() { + ~AllowNativesSyntaxNoInliningNoParallel() { i::FLAG_allow_natives_syntax = allow_natives_syntax_; i::FLAG_use_inlining = use_inlining_; + i::FLAG_parallel_recompilation = parallel_recompilation_; } private: bool allow_natives_syntax_; bool use_inlining_; + bool parallel_recompilation_; }; @@ -343,7 +347,7 @@ TEST(DeoptimizeBinaryOperationADDString) { const char* f_source = "function f(x, y) { return x + y; };"; { - AllowNativesSyntaxNoInlining options; + AllowNativesSyntaxNoInliningNoParallel options; // Compile function f and collect to type feedback to insert binary op stub // call in the optimized code. i::FLAG_prepare_always_opt = true; @@ -401,7 +405,7 @@ static void TestDeoptimizeBinaryOpHelper(LocalContext* env, binary_op); char* f_source = f_source_buffer.start(); - AllowNativesSyntaxNoInlining options; + AllowNativesSyntaxNoInliningNoParallel options; // Compile function f and collect to type feedback to insert binary op stub // call in the optimized code. i::FLAG_prepare_always_opt = true; @@ -493,7 +497,7 @@ TEST(DeoptimizeCompare) { const char* f_source = "function f(x, y) { return x < y; };"; { - AllowNativesSyntaxNoInlining options; + AllowNativesSyntaxNoInliningNoParallel options; // Compile function f and collect to type feedback to insert compare ic // call in the optimized code. i::FLAG_prepare_always_opt = true; @@ -540,7 +544,7 @@ TEST(DeoptimizeLoadICStoreIC) { const char* g2_source = "function g2(x, y) { x[y] = 1; };"; { - AllowNativesSyntaxNoInlining options; + AllowNativesSyntaxNoInliningNoParallel options; // Compile functions and collect to type feedback to insert ic // calls in the optimized code. i::FLAG_prepare_always_opt = true; @@ -620,7 +624,7 @@ TEST(DeoptimizeLoadICStoreICNested) { const char* g2_source = "function g2(x, y) { x[y] = 1; };"; { - AllowNativesSyntaxNoInlining options; + AllowNativesSyntaxNoInliningNoParallel options; // Compile functions and collect to type feedback to insert ic // calls in the optimized code. i::FLAG_prepare_always_opt = true; diff --git a/deps/v8/test/cctest/test-disasm-arm.cc b/deps/v8/test/cctest/test-disasm-arm.cc index 9d6623e..2a53d43 100644 --- a/deps/v8/test/cctest/test-disasm-arm.cc +++ b/deps/v8/test/cctest/test-disasm-arm.cc @@ -500,6 +500,11 @@ TEST(Vfp) { COMPARE(vmov(d0, VmovIndexHi, r0), "ee200b10 vmov.32 d0[1], r0"); + COMPARE(vmov(r2, VmovIndexLo, d15), + "ee1f2b10 vmov.32 r2, d15[0]"); + COMPARE(vmov(r3, VmovIndexHi, d14), + "ee3e3b10 vmov.32 r3, d14[1]"); + COMPARE(vldr(s0, r0, 0), "ed900a00 vldr s0, [r0 + 4*0]"); COMPARE(vldr(s1, r1, 4), diff --git a/deps/v8/test/cctest/test-heap.cc b/deps/v8/test/cctest/test-heap.cc index d2b9156..4d312f6 100644 --- a/deps/v8/test/cctest/test-heap.cc +++ b/deps/v8/test/cctest/test-heap.cc @@ -984,7 +984,7 @@ TEST(Regression39128) { // just enough room to allocate JSObject and thus fill the newspace. int allocation_amount = Min(FixedArray::kMaxSize, - HEAP->MaxObjectSizeInNewSpace()); + Page::kMaxNonCodeHeapObjectSize); int allocation_len = LenFromSize(allocation_amount); NewSpace* new_space = HEAP->new_space(); Address* top_addr = new_space->allocation_top_address(); @@ -2820,20 +2820,27 @@ class SourceResource: public v8::String::ExternalAsciiStringResource { }; -void ReleaseStackTraceDataTest(const char* source) { +void ReleaseStackTraceDataTest(const char* source, const char* accessor) { // Test that the data retained by the Error.stack accessor is released // after the first time the accessor is fired. We use external string // to check whether the data is being released since the external string // resource's callback is fired when the external string is GC'ed. + FLAG_use_ic = false; // ICs retain objects. + FLAG_parallel_recompilation = false; CcTest::InitializeVM(); v8::HandleScope scope(CcTest::isolate()); SourceResource* resource = new SourceResource(i::StrDup(source)); { v8::HandleScope scope(CcTest::isolate()); v8::Handle source_string = v8::String::NewExternal(resource); + HEAP->CollectAllAvailableGarbage(); v8::Script::Compile(source_string)->Run(); CHECK(!resource->IsDisposed()); } + // HEAP->CollectAllAvailableGarbage(); + CHECK(!resource->IsDisposed()); + + CompileRun(accessor); HEAP->CollectAllAvailableGarbage(); // External source has been released. @@ -2855,8 +2862,33 @@ TEST(ReleaseStackTraceData) { "} catch (e) { " " error = e; " "} "; - ReleaseStackTraceDataTest(source1); - ReleaseStackTraceDataTest(source2); + static const char* source3 = "var error = null; " + /* Normal Error */ "try { " + /* as prototype */ " throw new Error(); " + "} catch (e) { " + " error = {}; " + " error.__proto__ = e; " + "} "; + static const char* source4 = "var error = null; " + /* Stack overflow */ "try { " + /* as prototype */ " (function f() { f(); })(); " + "} catch (e) { " + " error = {}; " + " error.__proto__ = e; " + "} "; + static const char* getter = "error.stack"; + static const char* setter = "error.stack = 0"; + + ReleaseStackTraceDataTest(source1, setter); + ReleaseStackTraceDataTest(source2, setter); + // We do not test source3 and source4 with setter, since the setter is + // supposed to (untypically) write to the receiver, not the holder. This is + // to emulate the behavior of a data property. + + ReleaseStackTraceDataTest(source1, getter); + ReleaseStackTraceDataTest(source2, getter); + ReleaseStackTraceDataTest(source3, getter); + ReleaseStackTraceDataTest(source4, getter); } diff --git a/deps/v8/test/cctest/test-log.cc b/deps/v8/test/cctest/test-log.cc index 81cb001..bf1151e 100644 --- a/deps/v8/test/cctest/test-log.cc +++ b/deps/v8/test/cctest/test-log.cc @@ -27,6 +27,7 @@ // // Tests of logging functions from log.h +#define V8_DISABLE_DEPRECATIONS 1 #ifdef __linux__ #include #include @@ -43,6 +44,7 @@ #include "v8utils.h" #include "cctest.h" #include "vm-state-inl.h" +#undef V8_DISABLE_DEPRECATIONS using v8::internal::Address; using v8::internal::EmbeddedVector; diff --git a/deps/v8/test/cctest/test-mark-compact.cc b/deps/v8/test/cctest/test-mark-compact.cc index 626df16..0d8c00d 100644 --- a/deps/v8/test/cctest/test-mark-compact.cc +++ b/deps/v8/test/cctest/test-mark-compact.cc @@ -119,10 +119,8 @@ TEST(NoPromotion) { HEAP->CollectGarbage(OLD_POINTER_SPACE); // Allocate a big Fixed array in the new space. - int max_size = - Min(Page::kMaxNonCodeHeapObjectSize, HEAP->MaxObjectSizeInNewSpace()); - - int length = (max_size - FixedArray::kHeaderSize) / (2*kPointerSize); + int length = (Page::kMaxNonCodeHeapObjectSize - + FixedArray::kHeaderSize) / (2 * kPointerSize); Object* obj = i::Isolate::Current()->heap()->AllocateFixedArray(length)-> ToObjectChecked(); diff --git a/deps/v8/test/mjsunit/allocation-folding.js b/deps/v8/test/mjsunit/allocation-folding.js index a730bf1..fe5fa6d 100644 --- a/deps/v8/test/mjsunit/allocation-folding.js +++ b/deps/v8/test/mjsunit/allocation-folding.js @@ -25,7 +25,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --nouse-osr +// Flags: --allow-natives-syntax --nouse-osr --expose-gc + +// Test loop barrier when folding allocations. + function f() { var elem1 = [1,2,3]; for (var i=0; i < 100000; i++) { @@ -39,8 +42,38 @@ f(); f(); f(); %OptimizeFunctionOnNextCall(f); var result = f(); -for (var i=0; i < 100000; i++) { - var bar = [1]; -} +gc(); assertEquals(result[2], 3); + +// Test allocation folding of doubles. + +function doubles() { + var elem1 = [1.1, 1.2]; + var elem2 = [2.1, 2.2]; + return elem2; +} + +doubles(); doubles(); doubles(); +%OptimizeFunctionOnNextCall(doubles); +var result = doubles(); + +gc(); + +assertEquals(result[1], 2.2); + +// Test allocation folding of doubles into non-doubles. + +function doubles_int() { + var elem1 = [2, 3]; + var elem2 = [2.1, 3.1]; + return elem2; +} + +doubles_int(); doubles_int(); doubles_int(); +%OptimizeFunctionOnNextCall(doubles_int); +var result = doubles_int(); + +gc(); + +assertEquals(result[1], 3.1); diff --git a/deps/v8/test/mjsunit/harmony/collections.js b/deps/v8/test/mjsunit/harmony/collections.js index 67f91a8..3e87e6b 100644 --- a/deps/v8/test/mjsunit/harmony/collections.js +++ b/deps/v8/test/mjsunit/harmony/collections.js @@ -288,6 +288,22 @@ assertEquals("WeakMap", WeakMap.name); assertEquals("WeakSet", WeakSet.name); +// Test prototype property of Set, Map, WeakMap and WeakSet. +function TestPrototype(C) { + assertTrue(C.prototype instanceof Object); + assertEquals({ + value: {}, + writable: true, // TODO(2793): This should be non-writable. + enumerable: false, + configurable: false + }, Object.getOwnPropertyDescriptor(C, "prototype")); +} +TestPrototype(Set); +TestPrototype(Map); +TestPrototype(WeakMap); +TestPrototype(WeakSet); + + // Test constructor property of the Set, Map, WeakMap and WeakSet prototype. function TestConstructor(C) { assertFalse(C === Object.prototype.constructor); @@ -301,6 +317,7 @@ TestConstructor(WeakMap); TestConstructor(WeakSet); +// Test the Set, Map, WeakMap and WeakSet global properties themselves. function TestDescriptor(global, C) { assertEquals({ value: C, diff --git a/deps/v8/test/mjsunit/harmony/dataview-accessors.js b/deps/v8/test/mjsunit/harmony/dataview-accessors.js index c57841c..7b03da7 100644 --- a/deps/v8/test/mjsunit/harmony/dataview-accessors.js +++ b/deps/v8/test/mjsunit/harmony/dataview-accessors.js @@ -389,6 +389,11 @@ function TestGeneralAccessors() { f.call(a, 0, 0); // should not throw assertThrows(function() { f.call({}, 0, 0); }, TypeError); assertThrows(function() { f.call(a); }, TypeError); + if (name.indexOf("set") == 0) { + assertThrows(function() { f.call(a, 1); }, TypeError); + } else { + f.call(a, 1); // should not throw + } } CheckAccessor("getUint8"); CheckAccessor("setUint8"); @@ -409,3 +414,36 @@ function TestGeneralAccessors() { } TestGeneralAccessors(); + +function TestInsufficientArguments() { + var a = new DataView(new ArrayBuffer(256)); + + assertThrows(function() { a.getUint8(); }, TypeError); + assertThrows(function() { a.getInt8(); }, TypeError); + assertThrows(function() { a.getUint16(); }, TypeError); + assertThrows(function() { a.getInt16(); }, TypeError); + assertThrows(function() { a.getUint32(); }, TypeError); + assertThrows(function() { a.getInt32(); }, TypeError); + assertThrows(function() { a.getFloat32(); }, TypeError); + assertThrows(function() { a.getFloat64(); }, TypeError); + + assertThrows(function() { a.setUint8(); }, TypeError); + assertThrows(function() { a.setInt8(); }, TypeError); + assertThrows(function() { a.setUint16(); }, TypeError); + assertThrows(function() { a.setInt16(); }, TypeError); + assertThrows(function() { a.setUint32(); }, TypeError); + assertThrows(function() { a.setInt32(); }, TypeError); + assertThrows(function() { a.setFloat32(); }, TypeError); + assertThrows(function() { a.setFloat64(); }, TypeError); + + assertThrows(function() { a.setUint8(1) }, TypeError); + assertThrows(function() { a.setInt8(1) }, TypeError); + assertThrows(function() { a.setUint16(1) }, TypeError); + assertThrows(function() { a.setInt16(1) }, TypeError); + assertThrows(function() { a.setUint32(1) }, TypeError); + assertThrows(function() { a.setInt32(1) }, TypeError); + assertThrows(function() { a.setFloat32(1) }, TypeError); + assertThrows(function() { a.setFloat64(1) }, TypeError); +} + +TestInsufficientArguments(); diff --git a/deps/v8/test/mjsunit/mjsunit.status b/deps/v8/test/mjsunit/mjsunit.status index 50a4c70..37e6e0f 100644 --- a/deps/v8/test/mjsunit/mjsunit.status +++ b/deps/v8/test/mjsunit/mjsunit.status @@ -43,9 +43,6 @@ regress/regress-524: SKIP # This test non-deterministically runs out of memory on Windows ia32. regress/regress-crbug-160010: SKIP -# Deferred stack trace formatting is temporarily disabled. -stack-traces-gc: PASS || FAIL - ############################################################################## # Too slow in debug mode with --stress-opt mode. compiler/regress-stacktrace-methods: PASS, SKIP if $mode == debug @@ -242,3 +239,22 @@ regress/regress-165637: SKIP # Skip long running test that times out in debug mode and goes OOM on NaCl. regress/regress-crbug-160010: SKIP + +############################################################################## +[ $deopt_fuzzer == True ] + +# Skip tests that are not suitable for deoptimization fuzzing. +assert-opt-and-deopt: SKIP +never-optimize: SKIP +regress/regress-2185-2: SKIP +harmony/object-observe: SKIP +readonly: SKIP +array-feedback: SKIP + +# Deopt every n garbage collections collides with the deopt every n times flag. +regress/regress-2653: SKIP + +# Issue 2795: +array-store-and-grow: SKIP if $mode == debug + + diff --git a/deps/v8/src/platform-tls-win32.h b/deps/v8/test/mjsunit/omit-constant-mapcheck.js similarity index 59% rename from deps/v8/src/platform-tls-win32.h rename to deps/v8/test/mjsunit/omit-constant-mapcheck.js index 4056e8c..ae6308f 100644 --- a/deps/v8/src/platform-tls-win32.h +++ b/deps/v8/test/mjsunit/omit-constant-mapcheck.js @@ -1,4 +1,4 @@ -// Copyright 2011 the V8 project authors. All rights reserved. +// Copyright 2013 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -25,38 +25,46 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef V8_PLATFORM_TLS_WIN32_H_ -#define V8_PLATFORM_TLS_WIN32_H_ - -#include "checks.h" -#include "globals.h" -#include "win32-headers.h" - -namespace v8 { -namespace internal { - -#if defined(_WIN32) && !defined(_WIN64) - -#define V8_FAST_TLS_SUPPORTED 1 - -inline intptr_t InternalGetExistingThreadLocal(intptr_t index) { - const intptr_t kTibInlineTlsOffset = 0xE10; - const intptr_t kTibExtraTlsOffset = 0xF94; - const intptr_t kMaxInlineSlots = 64; - const intptr_t kMaxSlots = kMaxInlineSlots + 1024; - ASSERT(0 <= index && index < kMaxSlots); - if (index < kMaxInlineSlots) { - return static_cast(__readfsdword(kTibInlineTlsOffset + - kPointerSize * index)); - } - intptr_t extra = static_cast(__readfsdword(kTibExtraTlsOffset)); - ASSERT(extra != 0); - return *reinterpret_cast(extra + - kPointerSize * (index - kMaxInlineSlots)); +// Flags: --allow-natives-syntax + +var g1 = { a:1 } + +function load() { + return g1.a; +} + +assertEquals(1, load()); +assertEquals(1, load()); +%OptimizeFunctionOnNextCall(load); +assertEquals(1, load()); +delete g1.a; +assertEquals(undefined, load()); + +var g2 = { a:2 } + +function load2() { + return g2.a; } -#endif +assertEquals(2, load2()); +assertEquals(2, load2()); +%OptimizeFunctionOnNextCall(load2); +assertEquals(2, load2()); +g2.b = 10; +g2.a = 5; +assertEquals(5, load2()); -} } // namespace v8::internal +var g3 = { a:2, b:9, c:1 } + +function store(v) { + g3.a = v; + return g3.a; +} -#endif // V8_PLATFORM_TLS_WIN32_H_ +assertEquals(5, store(5)); +assertEquals(8, store(8)); +%OptimizeFunctionOnNextCall(store); +assertEquals(10, store(10)); +delete g3.c; +store(7); +assertEquals({a:7, b:9}, g3); diff --git a/deps/v8/src/platform-tls-mac.h b/deps/v8/test/mjsunit/regress/regress-247688.js similarity index 66% rename from deps/v8/src/platform-tls-mac.h rename to deps/v8/test/mjsunit/regress/regress-247688.js index d1c5907..80e2884 100644 --- a/deps/v8/src/platform-tls-mac.h +++ b/deps/v8/test/mjsunit/regress/regress-247688.js @@ -1,4 +1,4 @@ -// Copyright 2011 the V8 project authors. All rights reserved. +// Copyright 2013 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -25,38 +25,56 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef V8_PLATFORM_TLS_MAC_H_ -#define V8_PLATFORM_TLS_MAC_H_ +// Flags: --allow-natives-syntax -#include "globals.h" +var a = {}; +a.x = 1 +a.y = 1.5 -namespace v8 { -namespace internal { +var b = {} +b.x = 1.5; +b.y = 1; -#if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64 +var c = {} +c.x = 1.5; -#define V8_FAST_TLS_SUPPORTED 1 +var d = {} +d.x = 1.5; -extern intptr_t kMacTlsBaseOffset; +var e = {} +e.x = 1.5; -INLINE(intptr_t InternalGetExistingThreadLocal(intptr_t index)); +var f = {} +f.x = 1.5; -inline intptr_t InternalGetExistingThreadLocal(intptr_t index) { - intptr_t result; -#if V8_HOST_ARCH_IA32 - asm("movl %%gs:(%1,%2,4), %0;" - :"=r"(result) // Output must be a writable register. - :"r"(kMacTlsBaseOffset), "r"(index)); -#else - asm("movq %%gs:(%1,%2,8), %0;" - :"=r"(result) - :"r"(kMacTlsBaseOffset), "r"(index)); -#endif - return result; -} +var g = {} +g.x = 1.5; + +var h = {} +h.x = 1.5; -#endif +var i = {} +i.x = 1.5; -} } // namespace v8::internal +var o = {} +var p = {y : 10, z : 1} +o.__proto__ = p; +delete p.z + +function foo(v, w) { + // Make load via IC in optimized code. Its target will get overwritten by + // lazy deopt patch for the stack check. + v.y; + // Make store with transition to make this code dependent on the map. + w.y = 1; + return b.y; +} -#endif // V8_PLATFORM_TLS_MAC_H_ +foo(o, c); +foo(o, d); +foo(o, e); +%OptimizeFunctionOnNextCall(foo); +foo(b, f); +foo(b, g); +foo(b, h); +foo(a, i); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-263276.js b/deps/v8/test/mjsunit/regress/regress-crbug-263276.js new file mode 100644 index 0000000..05aa94c --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-263276.js @@ -0,0 +1,46 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Flags: --allow-natives-syntax + +var array1 = []; +array1.foo = true; + +var array2 = []; +array2.bar = true; + +function bad(array) { + array[array.length] = 1; +} + +bad(array1); +bad(array1); +bad(array2); // Length is now 1. +bad(array2); // Length is now 2. +%OptimizeFunctionOnNextCall(bad); +bad(array2); // Length is now 3. +assertEquals(3, array2.length); diff --git a/deps/v8/test/mjsunit/regress/regress-prepare-break-while-recompile.js b/deps/v8/test/mjsunit/regress/regress-prepare-break-while-recompile.js new file mode 100644 index 0000000..0283c38 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-prepare-break-while-recompile.js @@ -0,0 +1,57 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Flags: --expose-debug-as debug --allow-natives-syntax +// Flags: --parallel-recompilation-delay=300 + +Debug = debug.Debug + +function foo() { + var x = 1; + return x; +} + +function bar() { + var x = 2; + return x; +} + +foo(); +// Mark and trigger parallel optimization. +%OptimizeFunctionOnNextCall(foo, "parallel"); +foo(); + +// Set break points on an unrelated function. This clears both optimized +// and (shared) unoptimized code on foo, and sets both to lazy-compile builtin. +// Clear the break point immediately after to deactivate the debugger. +Debug.setBreakPoint(bar, 0, 0); +Debug.clearAllBreakPoints(); + +// Install optimized code when parallel optimization finishes. +// This needs to be able to deal with shared code being a builtin. +assertUnoptimized(foo, "sync"); + diff --git a/deps/v8/test/mjsunit/stack-traces-gc.js b/deps/v8/test/mjsunit/stack-traces-gc.js deleted file mode 100644 index dd878f2..0000000 --- a/deps/v8/test/mjsunit/stack-traces-gc.js +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2012 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Flags: --expose-gc --allow-natives-syntax - -var fired = []; -for (var i = 0; i < 100; i++) fired[i] = false; - -function getter_function(i) { - return %MarkOneShotGetter( function() { fired[i] = true; } ); -} - -// Error objects that die young. -for (var i = 0; i < 100; i++) { - var error = new Error(); - // Replace the getter to observe whether it has been fired, - // and disguise it as original getter. - var getter = getter_function(i); - error.__defineGetter__("stack", getter); - - error = undefined; -} - -gc(); -for (var i = 0; i < 100; i++) { - assertFalse(fired[i]); -} - -// Error objects that are kept alive. -var array = []; -for (var i = 0; i < 100; i++) { - var error = new Error(); - var getter = getter_function(i); - // Replace the getter to observe whether it has been fired, - // and disguise it as original getter. - error.__defineGetter__("stack", getter); - - array.push(error); - error = undefined; -} - -gc(); -// We don't expect all stack traces to be formatted after only one GC. -assertTrue(fired[0]); - -for (var i = 0; i < 10; i++) gc(); -for (var i = 0; i < 100; i++) assertTrue(fired[i]); - -// Error objects with custom stack getter. -var custom_error = new Error(); -var custom_getter_fired = false; -custom_error.__defineGetter__("stack", - function() { custom_getter_fired = true; }); -gc(); -assertFalse(custom_getter_fired); - -// Check that formatting caused by GC is not somehow observable. -var error; - -var obj = { foo: function foo() { throw new Error(); } }; - -try { - obj.foo(); -} catch (e) { - delete obj.foo; - Object.defineProperty(obj, 'foo', { - get: function() { assertUnreachable(); } - }); - error = e; -} - -gc(); - -Object.defineProperty(Array.prototype, '0', { - get: function() { assertUnreachable(); } -}); - -try { - throw new Error(); -} catch (e) { - error = e; -} - -gc(); - -String.prototype.indexOf = function() { assertUnreachable(); }; -String.prototype.lastIndexOf = function() { assertUnreachable(); }; -var obj = { method: function() { throw Error(); } }; -try { - obj.method(); -} catch (e) { - error = e; -} - -gc(); diff --git a/deps/v8/test/webkit/fast/js/JSON-parse-reviver-expected.txt b/deps/v8/test/webkit/fast/js/JSON-parse-reviver-expected.txt new file mode 100644 index 0000000..c68efa4 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/JSON-parse-reviver-expected.txt @@ -0,0 +1,131 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test behaviour of JSON reviver function. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + + +Ensure the holder for our array is indeed an array +PASS Array.isArray(currentHolder) is true +PASS currentHolder.length is 5 + +Ensure that the holder already has all the properties present at the start of filtering +PASS currentHolder[0] is "a value" +PASS currentHolder[1] is "another value" +PASS currentHolder[2] is "and another value" +PASS currentHolder[3] is "to delete" +PASS currentHolder[4] is "extra value" + +Ensure the holder for our array is indeed an array +PASS Array.isArray(currentHolder) is true +PASS currentHolder.length is 5 + +Ensure that we always get the same holder +PASS currentHolder is lastHolder + +Ensure that returning undefined has removed the property 0 from the holder during filtering. +FAIL currentHolder.hasOwnProperty(0) should be false. Was true. + +Ensure the holder for our array is indeed an array +PASS Array.isArray(currentHolder) is true +PASS currentHolder.length is 5 + +Ensure that we always get the same holder +PASS currentHolder is lastHolder + +Ensure that changing the value of a property is reflected while filtering. +PASS currentHolder[2] is "a replaced value" + +Ensure that the changed value is reflected in the arguments passed to the reviver +PASS value is currentHolder[2] + +Ensure the holder for our array is indeed an array +PASS Array.isArray(currentHolder) is true +PASS currentHolder.length is 5 + +Ensure that we always get the same holder +PASS currentHolder is lastHolder + +Ensure that we visited a value that we have deleted, and that deletion is reflected while filtering. +PASS currentHolder.hasOwnProperty(3) is false + +Ensure that when visiting a deleted property value is undefined +PASS value is undefined. + +Ensure the holder for our array is indeed an array +PASS Array.isArray(currentHolder) is true +FAIL currentHolder.length should be 3. Was 4. + +Ensure that we always get the same holder +PASS currentHolder is lastHolder +FAIL Did not call reviver for deleted property + +Ensure that we created the root holder as specified in ES5 +PASS '' in lastHolder is true +PASS result is lastHolder[''] + +Ensure that a deleted value is revived if the reviver function returns a value +FAIL result.hasOwnProperty(3) should be true. Was false. + +Test behaviour of revivor used in conjunction with an object +PASS currentHolder != globalObject is true + +Ensure that the holder already has all the properties present at the start of filtering +PASS currentHolder['a property'] is "a value" +PASS currentHolder['another property'] is "another value" +PASS currentHolder['and another property'] is "and another value" +PASS currentHolder['to delete'] is "will be deleted" +PASS currentHolder != globalObject is true + +Ensure that we get the same holder object for each property +PASS currentHolder is lastHolder + +Ensure that returning undefined has correctly removed the property 'a property' from the holder object +PASS currentHolder.hasOwnProperty('a property') is false +PASS currentHolder != globalObject is true + +Ensure that we get the same holder object for each property +PASS currentHolder is lastHolder +Ensure that changing the value of a property is reflected while filtering. +PASS currentHolder['and another property'] is "a replaced value" + +Ensure that the changed value is reflected in the arguments passed to the reviver +PASS value is "a replaced value" + +Ensure that we created the root holder as specified in ES5 +PASS lastHolder.hasOwnProperty('') is true +PASS result.hasOwnProperty('a property') is false +FAIL result.hasOwnProperty('to delete') should be true. Was false. +PASS result is lastHolder[''] + +Test behaviour of revivor that introduces a cycle +PASS JSON.parse("[0,1]", reviveAddsCycle) threw exception RangeError: Maximum call stack size exceeded. + +Test behaviour of revivor that introduces a new array classed object (the result of a regex) +PASS JSON.stringify(JSON.parse("[0,1]", reviveIntroducesNewArrayLikeObject)) is '[0,["a","a"]]' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/JSON-parse-reviver.js b/deps/v8/test/webkit/fast/js/JSON-parse-reviver.js new file mode 100644 index 0000000..b02a2fc --- /dev/null +++ b/deps/v8/test/webkit/fast/js/JSON-parse-reviver.js @@ -0,0 +1,205 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description("Test behaviour of JSON reviver function.") +if (!Array.isArray) + Array.isArray = function(o) { return o.constructor === Array; } + +function arrayReviver(i,v) { + if (i != "") { + currentHolder = this; + debug(""); + debug("Ensure the holder for our array is indeed an array"); + shouldBeTrue("Array.isArray(currentHolder)"); + shouldBe("currentHolder.length", "" + expectedLength); + if (i > 0) { + debug(""); + debug("Ensure that we always get the same holder"); + shouldBe("currentHolder", "lastHolder"); + } + switch (Number(i)) { + case 0: + v = undefined; + debug(""); + debug("Ensure that the holder already has all the properties present at the start of filtering"); + shouldBe("currentHolder[0]", '"a value"'); + shouldBe("currentHolder[1]", '"another value"'); + shouldBe("currentHolder[2]", '"and another value"'); + shouldBe("currentHolder[3]", '"to delete"'); + shouldBe("currentHolder[4]", '"extra value"'); + break; + + case 1: + debug(""); + debug("Ensure that returning undefined has removed the property 0 from the holder during filtering."); + shouldBeFalse("currentHolder.hasOwnProperty(0)"); + currentHolder[2] = "a replaced value"; + break; + + case 2: + debug(""); + debug("Ensure that changing the value of a property is reflected while filtering.") + shouldBe("currentHolder[2]", '"a replaced value"'); + value = v; + debug(""); + debug("Ensure that the changed value is reflected in the arguments passed to the reviver"); + shouldBe("value", "currentHolder[2]"); + delete this[3]; + break; + + case 3: + debug(""); + debug("Ensure that we visited a value that we have deleted, and that deletion is reflected while filtering."); + shouldBeFalse("currentHolder.hasOwnProperty(3)"); + value = v; + debug(""); + debug("Ensure that when visiting a deleted property value is undefined"); + shouldBeUndefined("value"); + v = "undelete the property"; + expectedLength = this.length = 3; + break; + + case 4: + if (this.length != 3) { + testFailed("Did not call reviver for deleted property"); + expectedLength = this.length = 3; + break; + } + + case 5: + testPassed("Ensured that property was visited despite Array length being reduced."); + value = v; + shouldBeUndefined("value"); + this[10] = "fail"; + break; + + default: + testFailed("Visited unexpected property " + i + " with value " + v); + } + } + lastHolder = this; + return v; +} +expectedLength = 5; +var result = JSON.parse('["a value", "another value", "and another value", "to delete", "extra value"]', arrayReviver); +debug(""); +debug("Ensure that we created the root holder as specified in ES5"); +shouldBeTrue("'' in lastHolder"); +shouldBe("result", "lastHolder['']"); +debug(""); +debug("Ensure that a deleted value is revived if the reviver function returns a value"); +shouldBeTrue("result.hasOwnProperty(3)"); + +function objectReviver(i,v) { + if (i != "") { + currentHolder = this; + shouldBeTrue("currentHolder != globalObject"); + if (seen) { + debug(""); + debug("Ensure that we get the same holder object for each property"); + shouldBe("currentHolder", "lastHolder"); + } + seen = true; + switch (i) { + case "a property": + v = undefined; + debug(""); + debug("Ensure that the holder already has all the properties present at the start of filtering"); + shouldBe("currentHolder['a property']", '"a value"'); + shouldBe("currentHolder['another property']", '"another value"'); + shouldBe("currentHolder['and another property']", '"and another value"'); + shouldBe("currentHolder['to delete']", '"will be deleted"'); + break; + + case "another property": + debug(""); + debug("Ensure that returning undefined has correctly removed the property 'a property' from the holder object"); + shouldBeFalse("currentHolder.hasOwnProperty('a property')"); + currentHolder['and another property'] = "a replaced value"; + break; + + case "and another property": + debug("Ensure that changing the value of a property is reflected while filtering."); + shouldBe("currentHolder['and another property']", '"a replaced value"'); + value = v; + debug(""); + debug("Ensure that the changed value is reflected in the arguments passed to the reviver"); + shouldBe("value", '"a replaced value"'); + delete this["to delete"]; + break; + + case "to delete": + debug(""); + debug("Ensure that we visited a value that we have deleted, and that deletion is reflected while filtering."); + shouldBeFalse("currentHolder.hasOwnProperty('to delete')"); + value = v; + debug(""); + debug("Ensure that when visiting a deleted property value is undefined"); + shouldBeUndefined("value"); + v = "undelete the property"; + this["new property"] = "fail"; + break; + default: + testFailed("Visited unexpected property " + i + " with value " + v); + } + } + lastHolder = this; + return v; +} + +debug(""); +debug("Test behaviour of revivor used in conjunction with an object"); +var seen = false; +var globalObject = this; +var result = JSON.parse('{"a property" : "a value", "another property" : "another value", "and another property" : "and another value", "to delete" : "will be deleted"}', objectReviver); +debug(""); +debug("Ensure that we created the root holder as specified in ES5"); +shouldBeTrue("lastHolder.hasOwnProperty('')"); +shouldBeFalse("result.hasOwnProperty('a property')"); +shouldBeTrue("result.hasOwnProperty('to delete')"); +shouldBe("result", "lastHolder['']"); + +debug(""); +debug("Test behaviour of revivor that introduces a cycle"); +function reviveAddsCycle(i, v) { + if (i == 0) + this[1] = this; + return v; +} + +shouldThrow('JSON.parse("[0,1]", reviveAddsCycle)'); + +debug(""); +debug("Test behaviour of revivor that introduces a new array classed object (the result of a regex)"); +var createdBadness = false; +function reviveIntroducesNewArrayLikeObject(i, v) { + if (i == 0 && !createdBadness) { + this[1] = /(a)+/.exec("a"); + createdBadness = true; + } + return v; +} + +shouldBe('JSON.stringify(JSON.parse("[0,1]", reviveIntroducesNewArrayLikeObject))', '\'[0,["a","a"]]\''); + + diff --git a/deps/v8/test/webkit/fast/js/Object-defineProperty-expected.txt b/deps/v8/test/webkit/fast/js/Object-defineProperty-expected.txt new file mode 100644 index 0000000..7a303f2 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/Object-defineProperty-expected.txt @@ -0,0 +1,176 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test to ensure correct behaviour of Object.defineProperty + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {value:1}), 'foo')) is JSON.stringify({value: 1, writable: false, enumerable: false, configurable: false}) +PASS JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {}), 'foo')) is JSON.stringify({writable: false, enumerable: false, configurable: false}) +PASS JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {get:undefined}), 'foo')) is JSON.stringify({enumerable: false, configurable: false}) +PASS JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {value:1, writable: false}), 'foo')) is JSON.stringify({value: 1, writable: false, enumerable: false, configurable: false}) +PASS JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {value:1, writable: true}), 'foo')) is JSON.stringify({value: 1, writable: true, enumerable: false, configurable: false}) +PASS JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {value:1, enumerable: false}), 'foo')) is JSON.stringify({value: 1, writable: false, enumerable: false, configurable: false}) +PASS JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {value:1, enumerable: true}), 'foo')) is JSON.stringify({value: 1, writable: false, enumerable: true, configurable: false}) +PASS JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {value:1, configurable: false}), 'foo')) is JSON.stringify({value: 1, writable: false, enumerable: false, configurable: false}) +PASS JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {value:1, configurable: true}), 'foo')) is JSON.stringify({value: 1, writable: false, enumerable: false, configurable: true}) +PASS JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty([1,2,3], 'foo', {value:1, configurable: true}), 'foo')) is JSON.stringify({value: 1, writable: false, enumerable: false, configurable: true}) +PASS Object.getOwnPropertyDescriptor(Object.defineProperty([1,2,3], '1', {value:'foo', configurable: true}), '1').value is 'foo' +PASS a=[1,2,3], Object.defineProperty(a, '1', {value:'foo', configurable: true}), a[1] is 'foo' +PASS Object.getOwnPropertyDescriptor(Object.defineProperty([1,2,3], '1', {get:getter, configurable: true}), '1').get is getter +PASS Object.defineProperty([1,2,3], '1', {get:getter, configurable: true})[1] threw exception called getter. +PASS Object.defineProperty() threw exception TypeError: Object.defineProperty called on non-object. +PASS Object.defineProperty(null) threw exception TypeError: Object.defineProperty called on non-object. +PASS Object.defineProperty('foo') threw exception TypeError: Object.defineProperty called on non-object. +PASS Object.defineProperty({}) threw exception TypeError: Property description must be an object: undefined. +PASS Object.defineProperty({}, 'foo') threw exception TypeError: Property description must be an object: undefined. +PASS Object.defineProperty({}, 'foo', {get:undefined, value:true}).foo threw exception TypeError: Invalid property. A property cannot both have accessors and be writable or have a value, #. +PASS Object.defineProperty({get foo() { return true; } }, 'foo', {configurable:false}).foo is true +PASS Object.defineProperty(createUnconfigurableProperty({}, 'foo'), 'foo', {configurable: true}) threw exception TypeError: Cannot redefine property: foo. +PASS Object.defineProperty(createUnconfigurableProperty({}, 'foo'), 'foo', {writable: true}) threw exception TypeError: Cannot redefine property: foo. +PASS Object.defineProperty(createUnconfigurableProperty({}, 'foo'), 'foo', {enumerable: true}) threw exception TypeError: Cannot redefine property: foo. +PASS Object.defineProperty(createUnconfigurableProperty({}, 'foo', false, true), 'foo', {enumerable: false}), 'foo' threw exception TypeError: Cannot redefine property: foo. +PASS JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty(createUnconfigurableProperty({}, 'foo', true), 'foo', {writable: false}), 'foo')) is JSON.stringify({value: 1, writable: false, enumerable: false, configurable: false}) +PASS Object.defineProperty({}, 'foo', {value:1, get: function(){}}) threw exception TypeError: Invalid property. A property cannot both have accessors and be writable or have a value, #. +PASS Object.defineProperty({}, 'foo', {value:1, set: function(){}}) threw exception TypeError: Invalid property. A property cannot both have accessors and be writable or have a value, #. +PASS Object.defineProperty({}, 'foo', {writable:true, get: function(){}}) threw exception TypeError: Invalid property. A property cannot both have accessors and be writable or have a value, #. +PASS Object.defineProperty({}, 'foo', {writable:true, set: function(){}}) threw exception TypeError: Invalid property. A property cannot both have accessors and be writable or have a value, #. +PASS Object.defineProperty({}, 'foo', {get: null}) threw exception TypeError: Getter must be a function: null. +PASS Object.defineProperty({}, 'foo', {set: null}) threw exception TypeError: Setter must be a function: null. +PASS Object.defineProperty({}, 'foo', {set: setter}).foo='test' threw exception called setter. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {set: setter}), 'foo', {set: setter1}) threw exception TypeError: Cannot redefine property: foo. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {set: setter}), 'foo', {get: getter1}) threw exception TypeError: Cannot redefine property: foo. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {set: setter}), 'foo', {value: 1}) threw exception TypeError: Cannot redefine property: foo. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {set: setter, configurable: true}), 'foo', {set: setter1}).foo='test' threw exception called setter1. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {set: setter, configurable: true}), 'foo', {get: getter1}).foo threw exception called getter1. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {set: setter, configurable: true}), 'foo', {value: true}).foo is true +PASS 'foo' in Object.defineProperty(Object.defineProperty({}, 'foo', {set: setter, configurable: true}), 'foo', {writable: true}) is true +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {set: setter, configurable: true}), 'foo', {writable: true}).foo is undefined. +PASS Object.defineProperty({}, 'foo', {get: getter}).foo threw exception called getter. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {get: getter}), 'foo', {get: getter1}) threw exception TypeError: Cannot redefine property: foo. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {get: getter}), 'foo', {set: setter1}) threw exception TypeError: Cannot redefine property: foo. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {get: getter, configurable: true}), 'foo', {get: getter1}).foo threw exception called getter1. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {get: getter, configurable: true}), 'foo', {set: setter1}).foo='test' threw exception called setter1. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {get: getter, configurable: true}), 'foo', {value: true}).foo is true +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {get: getter, configurable: true}), 'foo', {writable: true}).foo is undefined. +PASS 'foo' in Object.defineProperty(Object.defineProperty({}, 'foo', {get: getter, configurable: true}), 'foo', {writable: true}) is true +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1}), 'foo', {set: setter1}) threw exception TypeError: Cannot redefine property: foo. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1, configurable: true}), 'foo', {set: setter1}).foo='test' threw exception called setter1. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1}), 'foo', {get: getter1}) threw exception TypeError: Cannot redefine property: foo. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1}), 'foo', {set: setter1}) threw exception TypeError: Cannot redefine property: foo. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1, configurable: true}), 'foo', {get: getter1}).foo threw exception called getter1. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1, configurable: true}), 'foo', {set: setter1}).foo='test' threw exception called setter1. +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1, configurable: true, writable: false}), 'foo', {value: 2, configurable: true, writable: true}).foo is 2 +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1, configurable: true, writable: false}), 'foo', {value: 2, configurable: true, writable: false}).foo is 2 +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1, configurable: false, writable: false}), 'foo', {value: 1, configurable: false, writable: false}).foo is 1 +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: true, enumerable: true}), 'foo', {get: function() { return 2; }, configurable: true, enumerable: false}).foo is 2 +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: true, enumerable: false}), 'foo', {get: function() { return 2; }, configurable: true, enumerable: false}).foo is 2 +PASS var result = false; var o = Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: true, enumerable: true}), 'foo', {get: function() { return 2; }, configurable: true, enumerable: false}); for (x in o) result = true; result is false +PASS var result = false; var o = Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: true, enumerable: false}), 'foo', {get: function() { return 2; }, configurable: true, enumerable: true}); for (x in o) result = true; result is true +PASS var o = Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: true}); delete o.foo; o.foo is undefined. +PASS var o = Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: false}); delete o.foo; o.foo is 1 +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: true}), 'foo', {value:2}).foo is 2 +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: false}), 'foo', {value:2}).foo threw exception TypeError: Cannot redefine property: foo. +PASS var o = Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: true}), 'foo', {value:2}); o.foo = 3; o.foo is 2 +PASS Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1}), 'foo', {value:2, configurable: true}) threw exception TypeError: Cannot redefine property: foo. +PASS Object.defineProperty(Object.defineProperty([], 'foo', {value: 1}), 'foo', {value:2, configurable: true}) threw exception TypeError: Cannot redefine property: foo. +PASS var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}); o.foo is 42 +PASS var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}); o.foo = 42; o.result; is 42 +PASS var o = Object.defineProperty({}, 'foo', {get:undefined, set:function(x){this.result = x;}}); o.foo is undefined +PASS var o = Object.defineProperty({}, 'foo', {get:undefined, set:function(x){this.result = x;}}); o.foo = 42; o.result; is 42 +PASS var o = Object.defineProperty({}, 'foo', {set:function(x){this.result = x;}}); o.foo is undefined +PASS var o = Object.defineProperty({}, 'foo', {set:function(x){this.result = x;}}); o.foo = 42; o.result; is 42 +PASS var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}, set:undefined}); o.foo is 42 +PASS var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}, set:undefined}); o.foo = 42; o.result; is undefined +PASS var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}}); o.foo is 42 +PASS var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}}); o.foo = 42; o.result; is undefined +PASS var o = Object.defineProperty({}, 'foo', {get:undefined, set:undefined}); o.foo is undefined +PASS var o = Object.defineProperty({}, 'foo', {get:undefined, set:undefined}); o.foo = 42; o.result; is undefined +PASS var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {get:function(){return 13;}}); o.foo is 13 +PASS var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {get:function(){return 13;}}); o.foo = 42; o.result; is 42 +PASS var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {get:undefined}); o.foo is undefined +PASS var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {get:undefined}); o.foo = 42; o.result; is 42 +PASS var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {set:function(){this.result = 13;}}); o.foo is 42 +PASS var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {set:function(){this.result = 13;}}); o.foo = 42; o.result; is 13 +PASS var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {set:undefined}); o.foo is 42 +PASS var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {set:undefined}); o.foo = 42; o.result; is undefined +PASS 'use strict'; var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}); o.foo is 42 +PASS 'use strict'; var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}); o.foo = 42; o.result; is 42 +PASS 'use strict'; var o = Object.defineProperty({}, 'foo', {get:undefined, set:function(x){this.result = x;}}); o.foo is undefined +PASS 'use strict'; var o = Object.defineProperty({}, 'foo', {get:undefined, set:function(x){this.result = x;}}); o.foo = 42; o.result; is 42 +PASS 'use strict'; var o = Object.defineProperty({}, 'foo', {set:function(x){this.result = x;}}); o.foo is undefined +PASS 'use strict'; var o = Object.defineProperty({}, 'foo', {set:function(x){this.result = x;}}); o.foo = 42; o.result; is 42 +PASS 'use strict'; var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}, set:undefined}); o.foo is 42 +PASS 'use strict'; var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}, set:undefined}); o.foo = 42; o.result; threw exception TypeError: Cannot set property foo of # which has only a getter. +PASS 'use strict'; var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}}); o.foo is 42 +PASS 'use strict'; var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}}); o.foo = 42; o.result; threw exception TypeError: Cannot set property foo of # which has only a getter. +PASS 'use strict'; var o = Object.defineProperty({}, 'foo', {get:undefined, set:undefined}); o.foo is undefined +PASS 'use strict'; var o = Object.defineProperty({}, 'foo', {get:undefined, set:undefined}); o.foo = 42; o.result; threw exception TypeError: Cannot set property foo of # which has only a getter. +PASS 'use strict'; var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {get:function(){return 13;}}); o.foo is 13 +PASS 'use strict'; var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {get:function(){return 13;}}); o.foo = 42; o.result; is 42 +PASS 'use strict'; var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {get:undefined}); o.foo is undefined +PASS 'use strict'; var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {get:undefined}); o.foo = 42; o.result; is 42 +PASS 'use strict'; var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {set:function(){this.result = 13;}}); o.foo is 42 +PASS 'use strict'; var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {set:function(){this.result = 13;}}); o.foo = 42; o.result; is 13 +PASS 'use strict'; var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {set:undefined}); o.foo is 42 +PASS 'use strict'; var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {set:undefined}); o.foo = 42; o.result; threw exception TypeError: Cannot set property foo of # which has only a getter. +PASS 0 in Object.prototype is true +PASS '0' in Object.prototype is true +PASS var o = {}; o.readOnly = false; o.readOnly is true +PASS 'use strict'; var o = {}; o.readOnly = false; o.readOnly threw exception TypeError: Cannot assign to read only property 'readOnly' of #. +PASS Object.getOwnPropertyDescriptor(Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return false; }, configurable: true}), 'foo', {value:false}), 'foo').writable is false +PASS Object.getOwnPropertyDescriptor(Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return false; }, configurable: true}), 'foo', {value:false, writable: false}), 'foo').writable is false +PASS Object.getOwnPropertyDescriptor(Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return false; }, configurable: true}), 'foo', {value:false, writable: true}), 'foo').writable is true +FAIL var a = Object.defineProperty([], 'length', {writable: false}); a[0] = 42; 0 in a; should be false. Was true. +FAIL 'use strict'; var a = Object.defineProperty([], 'length', {writable: false}); a[0] = 42; 0 in a; should throw an exception. Was true. +PASS var a = Object.defineProperty([42], '0', {writable: false}); a[0] = false; a[0]; is 42 +PASS 'use strict'; var a = Object.defineProperty([42], '0', {writable: false}); a[0] = false; a[0]; threw exception TypeError: Cannot assign to read only property '0' of [object Array]. +PASS var a = Object.defineProperty([], '0', {set: undefined}); a[0] = 42; a[0]; is undefined. +PASS 'use strict'; var a = Object.defineProperty([], '0', {set: undefined}); a[0] = 42; a[0]; threw exception TypeError: Cannot set property 0 of [object Array] which has only a getter. +PASS anObj.slot1 is "foo" +PASS anObj.slot2 is "bar" +PASS anObj.propertyIsEnumerable('slot1') is true +PASS anObj.propertyIsEnumerable('slot2') is false +PASS anObj.slot4 is "goo" +PASS anObj.slot5 is 123 +PASS anObj._Slot5 is 123 +PASS Object.getOwnPropertyDescriptor(anObj, 'slot5') is undefined. +PASS anObj.slot5 is 456 +PASS anObj._Slot5 is 123 +PASS Object.getOwnPropertyDescriptor(anObj, 'slot5').value is 456 +PASS anObj.slot1 is "foo" +PASS anObj.slot2 is "bar" +PASS anObj.propertyIsEnumerable('slot1') is true +PASS anObj.propertyIsEnumerable('slot2') is false +PASS anObj.slot4 is "goo" +PASS anObj.slot5 is 123 +PASS anObj._Slot5 is 123 +PASS Object.getOwnPropertyDescriptor(anObj, 'slot5') is undefined. +PASS anObj.slot5 is 456 +PASS anObj._Slot5 is 123 +PASS Object.getOwnPropertyDescriptor(anObj, 'slot5').value is 456 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/Object-defineProperty.js b/deps/v8/test/webkit/fast/js/Object-defineProperty.js new file mode 100644 index 0000000..c0b186e --- /dev/null +++ b/deps/v8/test/webkit/fast/js/Object-defineProperty.js @@ -0,0 +1,239 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description("Test to ensure correct behaviour of Object.defineProperty"); + +shouldBe("JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {value:1}), 'foo'))", + "JSON.stringify({value: 1, writable: false, enumerable: false, configurable: false})"); +shouldBe("JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {}), 'foo'))", + "JSON.stringify({writable: false, enumerable: false, configurable: false})"); +shouldBe("JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {get:undefined}), 'foo'))", + "JSON.stringify({enumerable: false, configurable: false})"); +shouldBe("JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {value:1, writable: false}), 'foo'))", + "JSON.stringify({value: 1, writable: false, enumerable: false, configurable: false})"); +shouldBe("JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {value:1, writable: true}), 'foo'))", + "JSON.stringify({value: 1, writable: true, enumerable: false, configurable: false})"); +shouldBe("JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {value:1, enumerable: false}), 'foo'))", + "JSON.stringify({value: 1, writable: false, enumerable: false, configurable: false})"); +shouldBe("JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {value:1, enumerable: true}), 'foo'))", + "JSON.stringify({value: 1, writable: false, enumerable: true, configurable: false})"); +shouldBe("JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {value:1, configurable: false}), 'foo'))", + "JSON.stringify({value: 1, writable: false, enumerable: false, configurable: false})"); +shouldBe("JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty({}, 'foo', {value:1, configurable: true}), 'foo'))", + "JSON.stringify({value: 1, writable: false, enumerable: false, configurable: true})"); +shouldBe("JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty([1,2,3], 'foo', {value:1, configurable: true}), 'foo'))", + "JSON.stringify({value: 1, writable: false, enumerable: false, configurable: true})"); +shouldBe("Object.getOwnPropertyDescriptor(Object.defineProperty([1,2,3], '1', {value:'foo', configurable: true}), '1').value", "'foo'"); +shouldBe("a=[1,2,3], Object.defineProperty(a, '1', {value:'foo', configurable: true}), a[1]", "'foo'"); +shouldBe("Object.getOwnPropertyDescriptor(Object.defineProperty([1,2,3], '1', {get:getter, configurable: true}), '1').get", "getter"); +shouldThrow("Object.defineProperty([1,2,3], '1', {get:getter, configurable: true})[1]", "'called getter'"); + +shouldThrow("Object.defineProperty()"); +shouldThrow("Object.defineProperty(null)"); +shouldThrow("Object.defineProperty('foo')"); +shouldThrow("Object.defineProperty({})"); +shouldThrow("Object.defineProperty({}, 'foo')"); +shouldThrow("Object.defineProperty({}, 'foo', {get:undefined, value:true}).foo"); +shouldBeTrue("Object.defineProperty({get foo() { return true; } }, 'foo', {configurable:false}).foo"); + +function createUnconfigurableProperty(o, prop, writable, enumerable) { + writable = writable || false; + enumerable = enumerable || false; + return Object.defineProperty(o, prop, {value:1, configurable:false, writable: writable, enumerable: enumerable}); +} +shouldThrow("Object.defineProperty(createUnconfigurableProperty({}, 'foo'), 'foo', {configurable: true})"); +shouldThrow("Object.defineProperty(createUnconfigurableProperty({}, 'foo'), 'foo', {writable: true})"); +shouldThrow("Object.defineProperty(createUnconfigurableProperty({}, 'foo'), 'foo', {enumerable: true})"); +shouldThrow("Object.defineProperty(createUnconfigurableProperty({}, 'foo', false, true), 'foo', {enumerable: false}), 'foo'"); + +shouldBe("JSON.stringify(Object.getOwnPropertyDescriptor(Object.defineProperty(createUnconfigurableProperty({}, 'foo', true), 'foo', {writable: false}), 'foo'))", + "JSON.stringify({value: 1, writable: false, enumerable: false, configurable: false})"); + +shouldThrow("Object.defineProperty({}, 'foo', {value:1, get: function(){}})"); +shouldThrow("Object.defineProperty({}, 'foo', {value:1, set: function(){}})"); +shouldThrow("Object.defineProperty({}, 'foo', {writable:true, get: function(){}})"); +shouldThrow("Object.defineProperty({}, 'foo', {writable:true, set: function(){}})"); +shouldThrow("Object.defineProperty({}, 'foo', {get: null})"); +shouldThrow("Object.defineProperty({}, 'foo', {set: null})"); +function getter(){ throw "called getter"; } +function getter1(){ throw "called getter1"; } +function setter(){ throw "called setter"; } +function setter1(){ throw "called setter1"; } +shouldThrow("Object.defineProperty({}, 'foo', {set: setter}).foo='test'", "'called setter'"); +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {set: setter}), 'foo', {set: setter1})"); +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {set: setter}), 'foo', {get: getter1})"); +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {set: setter}), 'foo', {value: 1})"); +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {set: setter, configurable: true}), 'foo', {set: setter1}).foo='test'", "'called setter1'"); +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {set: setter, configurable: true}), 'foo', {get: getter1}).foo", "'called getter1'"); +shouldBeTrue("Object.defineProperty(Object.defineProperty({}, 'foo', {set: setter, configurable: true}), 'foo', {value: true}).foo"); +shouldBeTrue("'foo' in Object.defineProperty(Object.defineProperty({}, 'foo', {set: setter, configurable: true}), 'foo', {writable: true})"); +shouldBeUndefined("Object.defineProperty(Object.defineProperty({}, 'foo', {set: setter, configurable: true}), 'foo', {writable: true}).foo"); +shouldThrow("Object.defineProperty({}, 'foo', {get: getter}).foo", "'called getter'"); +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {get: getter}), 'foo', {get: getter1})"); +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {get: getter}), 'foo', {set: setter1})"); +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {get: getter, configurable: true}), 'foo', {get: getter1}).foo", "'called getter1'"); +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {get: getter, configurable: true}), 'foo', {set: setter1}).foo='test'", "'called setter1'"); +shouldBeTrue("Object.defineProperty(Object.defineProperty({}, 'foo', {get: getter, configurable: true}), 'foo', {value: true}).foo"); +shouldBeUndefined("Object.defineProperty(Object.defineProperty({}, 'foo', {get: getter, configurable: true}), 'foo', {writable: true}).foo"); +shouldBeTrue("'foo' in Object.defineProperty(Object.defineProperty({}, 'foo', {get: getter, configurable: true}), 'foo', {writable: true})"); + +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1}), 'foo', {set: setter1})"); +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1, configurable: true}), 'foo', {set: setter1}).foo='test'", "'called setter1'"); +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1}), 'foo', {get: getter1})"); +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1}), 'foo', {set: setter1})"); +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1, configurable: true}), 'foo', {get: getter1}).foo", "'called getter1'"); +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1, configurable: true}), 'foo', {set: setter1}).foo='test'", "'called setter1'"); + +// Should be able to redefine an non-writable property, if it is configurable. +shouldBe("Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1, configurable: true, writable: false}), 'foo', {value: 2, configurable: true, writable: true}).foo", "2"); +shouldBe("Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1, configurable: true, writable: false}), 'foo', {value: 2, configurable: true, writable: false}).foo", "2"); + +// Should be able to redefine an non-writable, non-configurable property, with the same value and attributes. +shouldBe("Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1, configurable: false, writable: false}), 'foo', {value: 1, configurable: false, writable: false}).foo", "1"); + +// Should be able to redefine a configurable accessor, with the same or with different attributes. +// Check the accessor function changed. +shouldBe("Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: true, enumerable: true}), 'foo', {get: function() { return 2; }, configurable: true, enumerable: false}).foo", "2"); +shouldBe("Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: true, enumerable: false}), 'foo', {get: function() { return 2; }, configurable: true, enumerable: false}).foo", "2"); +// Check the attributes changed. +shouldBeFalse("var result = false; var o = Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: true, enumerable: true}), 'foo', {get: function() { return 2; }, configurable: true, enumerable: false}); for (x in o) result = true; result"); +shouldBeTrue("var result = false; var o = Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: true, enumerable: false}), 'foo', {get: function() { return 2; }, configurable: true, enumerable: true}); for (x in o) result = true; result"); + +// Should be able to define an non-configurable accessor. +shouldBeUndefined("var o = Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: true}); delete o.foo; o.foo"); +shouldBe("var o = Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: false}); delete o.foo; o.foo", '1'); +shouldBe("Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: true}), 'foo', {value:2}).foo", "2"); +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: false}), 'foo', {value:2}).foo"); + +// Defining a data descriptor over an accessor should result in a read only property. +shouldBe("var o = Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return 1; }, configurable: true}), 'foo', {value:2}); o.foo = 3; o.foo", "2"); + +// Trying to redefine a non-configurable property as configurable should throw. +shouldThrow("Object.defineProperty(Object.defineProperty({}, 'foo', {value: 1}), 'foo', {value:2, configurable: true})"); +shouldThrow("Object.defineProperty(Object.defineProperty([], 'foo', {value: 1}), 'foo', {value:2, configurable: true})"); + +// Test an object with a getter setter. +// Either accessor may be omitted or replaced with undefined, or both may be replaced with undefined. +shouldBe("var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}); o.foo", '42') +shouldBe("var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}); o.foo = 42; o.result;", '42'); +shouldBe("var o = Object.defineProperty({}, 'foo', {get:undefined, set:function(x){this.result = x;}}); o.foo", 'undefined') +shouldBe("var o = Object.defineProperty({}, 'foo', {get:undefined, set:function(x){this.result = x;}}); o.foo = 42; o.result;", '42'); +shouldBe("var o = Object.defineProperty({}, 'foo', {set:function(x){this.result = x;}}); o.foo", 'undefined') +shouldBe("var o = Object.defineProperty({}, 'foo', {set:function(x){this.result = x;}}); o.foo = 42; o.result;", '42'); +shouldBe("var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}, set:undefined}); o.foo", '42') +shouldBe("var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}, set:undefined}); o.foo = 42; o.result;", 'undefined'); +shouldBe("var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}}); o.foo", '42') +shouldBe("var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}}); o.foo = 42; o.result;", 'undefined'); +shouldBe("var o = Object.defineProperty({}, 'foo', {get:undefined, set:undefined}); o.foo", 'undefined') +shouldBe("var o = Object.defineProperty({}, 'foo', {get:undefined, set:undefined}); o.foo = 42; o.result;", 'undefined'); +// Test replacing or removing either the getter or setter individually. +shouldBe("var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {get:function(){return 13;}}); o.foo", '13') +shouldBe("var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {get:function(){return 13;}}); o.foo = 42; o.result;", '42') +shouldBe("var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {get:undefined}); o.foo", 'undefined') +shouldBe("var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {get:undefined}); o.foo = 42; o.result;", '42') +shouldBe("var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {set:function(){this.result = 13;}}); o.foo", '42') +shouldBe("var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {set:function(){this.result = 13;}}); o.foo = 42; o.result;", '13') +shouldBe("var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {set:undefined}); o.foo", '42') +shouldBe("var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {set:undefined}); o.foo = 42; o.result;", 'undefined') + +// Repeat of the above, in strict mode. +// Either accessor may be omitted or replaced with undefined, or both may be replaced with undefined. +shouldBe("'use strict'; var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}); o.foo", '42') +shouldBe("'use strict'; var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}); o.foo = 42; o.result;", '42'); +shouldBe("'use strict'; var o = Object.defineProperty({}, 'foo', {get:undefined, set:function(x){this.result = x;}}); o.foo", 'undefined') +shouldBe("'use strict'; var o = Object.defineProperty({}, 'foo', {get:undefined, set:function(x){this.result = x;}}); o.foo = 42; o.result;", '42'); +shouldBe("'use strict'; var o = Object.defineProperty({}, 'foo', {set:function(x){this.result = x;}}); o.foo", 'undefined') +shouldBe("'use strict'; var o = Object.defineProperty({}, 'foo', {set:function(x){this.result = x;}}); o.foo = 42; o.result;", '42'); +shouldBe("'use strict'; var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}, set:undefined}); o.foo", '42') +shouldThrow("'use strict'; var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}, set:undefined}); o.foo = 42; o.result;"); +shouldBe("'use strict'; var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}}); o.foo", '42') +shouldThrow("'use strict'; var o = Object.defineProperty({}, 'foo', {get:function(){return 42;}}); o.foo = 42; o.result;"); +shouldBe("'use strict'; var o = Object.defineProperty({}, 'foo', {get:undefined, set:undefined}); o.foo", 'undefined') +shouldThrow("'use strict'; var o = Object.defineProperty({}, 'foo', {get:undefined, set:undefined}); o.foo = 42; o.result;"); +// Test replacing or removing either the getter or setter individually. +shouldBe("'use strict'; var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {get:function(){return 13;}}); o.foo", '13') +shouldBe("'use strict'; var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {get:function(){return 13;}}); o.foo = 42; o.result;", '42') +shouldBe("'use strict'; var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {get:undefined}); o.foo", 'undefined') +shouldBe("'use strict'; var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {get:undefined}); o.foo = 42; o.result;", '42') +shouldBe("'use strict'; var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {set:function(){this.result = 13;}}); o.foo", '42') +shouldBe("'use strict'; var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {set:function(){this.result = 13;}}); o.foo = 42; o.result;", '13') +shouldBe("'use strict'; var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {set:undefined}); o.foo", '42') +shouldThrow("'use strict'; var o = Object.defineProperty(Object.defineProperty({foo:1}, 'foo', {get:function(){return 42;}, set:function(x){this.result = x;}}), 'foo', {set:undefined}); o.foo = 42; o.result;") + +Object.defineProperty(Object.prototype, 0, {get:function(){ return false; }, configurable:true}) +shouldBeTrue("0 in Object.prototype"); +shouldBeTrue("'0' in Object.prototype"); +delete Object.prototype[0]; + +Object.defineProperty(Object.prototype, 'readOnly', {value:true, configurable:true, writable:false}) +shouldBeTrue("var o = {}; o.readOnly = false; o.readOnly"); +shouldThrow("'use strict'; var o = {}; o.readOnly = false; o.readOnly"); +delete Object.prototype.readOnly; + +// Check the writable attribute is set correctly when redefining an accessor as a data descriptor. +shouldBeFalse("Object.getOwnPropertyDescriptor(Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return false; }, configurable: true}), 'foo', {value:false}), 'foo').writable"); +shouldBeFalse("Object.getOwnPropertyDescriptor(Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return false; }, configurable: true}), 'foo', {value:false, writable: false}), 'foo').writable"); +shouldBeTrue("Object.getOwnPropertyDescriptor(Object.defineProperty(Object.defineProperty({}, 'foo', {get: function() { return false; }, configurable: true}), 'foo', {value:false, writable: true}), 'foo').writable"); + +// If array length is read-only, [[Put]] should fail. +shouldBeFalse("var a = Object.defineProperty([], 'length', {writable: false}); a[0] = 42; 0 in a;"); +shouldThrow("'use strict'; var a = Object.defineProperty([], 'length', {writable: false}); a[0] = 42; 0 in a;"); + +// If array property is read-only, [[Put]] should fail. +shouldBe("var a = Object.defineProperty([42], '0', {writable: false}); a[0] = false; a[0];", '42'); +shouldThrow("'use strict'; var a = Object.defineProperty([42], '0', {writable: false}); a[0] = false; a[0];"); + +// If array property is an undefined setter, [[Put]] should fail. +shouldBeUndefined("var a = Object.defineProperty([], '0', {set: undefined}); a[0] = 42; a[0];"); +shouldThrow("'use strict'; var a = Object.defineProperty([], '0', {set: undefined}); a[0] = 42; a[0];"); + +function testObject() +{ + // Test case from https://bugs.webkit.org/show_bug.cgi?id=38636 + Object.defineProperty(anObj, 'slot1', {value: 'foo', enumerable: true}); + Object.defineProperty(anObj, 'slot2', {value: 'bar', writable: true}); + Object.defineProperty(anObj, 'slot3', {value: 'baz', enumerable: false}); + Object.defineProperty(anObj, 'slot4', {value: 'goo', configurable: false}); + shouldBe("anObj.slot1", '"foo"'); + shouldBe("anObj.slot2", '"bar"'); + anObj.slot2 = 'bad value'; + shouldBeTrue("anObj.propertyIsEnumerable('slot1')"); + shouldBeFalse("anObj.propertyIsEnumerable('slot2')"); + delete anObj.slot4; + shouldBe("anObj.slot4", '"goo"'); + + // Test case from https://bugs.webkit.org/show_bug.cgi?id=48911 + Object.defineProperty(Object.getPrototypeOf(anObj), 'slot5', {get: function() { return this._Slot5; }, set: function(v) { this._Slot5 = v; }, configurable: false}); + anObj.slot5 = 123; + shouldBe("anObj.slot5", '123'); + shouldBe("anObj._Slot5", '123'); + shouldBeUndefined("Object.getOwnPropertyDescriptor(anObj, 'slot5')"); + Object.defineProperty(anObj, 'slot5', { value: 456 }); + shouldBe("anObj.slot5", '456'); + shouldBe("anObj._Slot5", '123'); + shouldBe("Object.getOwnPropertyDescriptor(anObj, 'slot5').value", '456'); +} +var anObj = {}; +testObject(); +var anObj = this; +testObject(); diff --git a/deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames-expected.txt b/deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames-expected.txt new file mode 100644 index 0000000..70827fc --- /dev/null +++ b/deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames-expected.txt @@ -0,0 +1,113 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test to ensure correct behaviour of Object.getOwnPropertyNames + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS getSortedOwnPropertyNames({}) is [] +PASS getSortedOwnPropertyNames({a:null}) is ['a'] +PASS getSortedOwnPropertyNames({a:null, b:null}) is ['a', 'b'] +PASS getSortedOwnPropertyNames({b:null, a:null}) is ['a', 'b'] +PASS getSortedOwnPropertyNames({__proto__:{a:null}}) is [] +PASS getSortedOwnPropertyNames({__proto__:[1,2,3]}) is [] +PASS getSortedOwnPropertyNames(Object.create({}, { 'a': { 'value': 1, 'enumerable': false } })) is ['a'] +PASS getSortedOwnPropertyNames(Object.create([1,2,3], { 'a': { 'value': 1, 'enumerable': false } })) is ['a'] +PASS getSortedOwnPropertyNames(new Function()) is ['arguments', 'caller', 'length', 'name', 'prototype'] +PASS getSortedOwnPropertyNames((function(){var x=new Function();x.__proto__=[1,2,3];return x;})()) is ['arguments', 'caller', 'length', 'name', 'prototype'] +PASS getSortedOwnPropertyNames(new String('')) is ['length'] +PASS getSortedOwnPropertyNames(new String('a')) is ['0', 'length'] +PASS getSortedOwnPropertyNames(new String('abc')) is ['0', '1', '2', 'length'] +PASS getSortedOwnPropertyNames((function(){var x=new String('');x.__proto__=[1,2,3];return x;})()) is ['length'] +PASS getSortedOwnPropertyNames([]) is ['length'] +PASS getSortedOwnPropertyNames([null]) is ['0', 'length'] +PASS getSortedOwnPropertyNames([null,null]) is ['0','1', 'length'] +PASS getSortedOwnPropertyNames([null,null,,,,null]) is ['0','1','5', 'length'] +PASS getSortedOwnPropertyNames((function(){var x=[];x.__proto__=[1,2,3];return x;})()) is ['length'] +PASS getSortedOwnPropertyNames(new Date()) is [] +PASS getSortedOwnPropertyNames((function(){var x=new Date();x.__proto__=[1,2,3];return x;})()) is [] +PASS getSortedOwnPropertyNames(new RegExp('foo')) is ['global', 'ignoreCase', 'lastIndex', 'multiline', 'source'] +PASS getSortedOwnPropertyNames((function(){var x=new RegExp();x.__proto__=[1,2,3];return x;})()) is ['global', 'ignoreCase', 'lastIndex', 'multiline', 'source'] +PASS getSortedOwnPropertyNames(argumentsObject()) is ['callee', 'length'] +PASS getSortedOwnPropertyNames(argumentsObject(1)) is ['0', 'callee', 'length'] +PASS getSortedOwnPropertyNames(argumentsObject(1,2,3)) is ['0', '1', '2', 'callee', 'length'] +PASS getSortedOwnPropertyNames((function(){arguments.__proto__=[1,2,3];return arguments;})()) is ['callee', 'length'] +FAIL getSortedOwnPropertyNames(parseInt) should be length,name. Was arguments,caller,length,name. +FAIL getSortedOwnPropertyNames(parseFloat) should be length,name. Was arguments,caller,length,name. +FAIL getSortedOwnPropertyNames(isNaN) should be length,name. Was arguments,caller,length,name. +FAIL getSortedOwnPropertyNames(isFinite) should be length,name. Was arguments,caller,length,name. +FAIL getSortedOwnPropertyNames(escape) should be length,name. Was arguments,caller,length,name. +FAIL getSortedOwnPropertyNames(unescape) should be length,name. Was arguments,caller,length,name. +FAIL getSortedOwnPropertyNames(decodeURI) should be length,name. Was arguments,caller,length,name. +FAIL getSortedOwnPropertyNames(decodeURIComponent) should be length,name. Was arguments,caller,length,name. +FAIL getSortedOwnPropertyNames(encodeURI) should be length,name. Was arguments,caller,length,name. +FAIL getSortedOwnPropertyNames(encodeURIComponent) should be length,name. Was arguments,caller,length,name. +FAIL getSortedOwnPropertyNames(Object) should be create,defineProperties,defineProperty,freeze,getOwnPropertyDescriptor,getOwnPropertyNames,getPrototypeOf,isExtensible,isFrozen,isSealed,keys,length,name,preventExtensions,prototype,seal. Was arguments,caller,create,defineProperties,defineProperty,freeze,getOwnPropertyDescriptor,getOwnPropertyNames,getPrototypeOf,is,isExtensible,isFrozen,isSealed,keys,length,name,preventExtensions,prototype,seal. +PASS getSortedOwnPropertyNames(Object.prototype) is ['__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', '__proto__', 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'] +FAIL getSortedOwnPropertyNames(Function) should be length,name,prototype. Was arguments,caller,length,name,prototype. +FAIL getSortedOwnPropertyNames(Function.prototype) should be apply,bind,call,constructor,length,name,toString. Was apply,arguments,bind,call,caller,constructor,length,name,toString. +FAIL getSortedOwnPropertyNames(Array) should be isArray,length,name,prototype. Was arguments,caller,isArray,length,name,prototype. +PASS getSortedOwnPropertyNames(Array.prototype) is ['concat', 'constructor', 'every', 'filter', 'forEach', 'indexOf', 'join', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift'] +FAIL getSortedOwnPropertyNames(String) should be fromCharCode,length,name,prototype. Was arguments,caller,fromCharCode,length,name,prototype. +PASS getSortedOwnPropertyNames(String.prototype) is ['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'concat', 'constructor', 'fixed', 'fontcolor', 'fontsize', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'replace', 'search', 'slice', 'small', 'split', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', 'valueOf'] +FAIL getSortedOwnPropertyNames(Boolean) should be length,name,prototype. Was arguments,caller,length,name,prototype. +PASS getSortedOwnPropertyNames(Boolean.prototype) is ['constructor', 'toString', 'valueOf'] +FAIL getSortedOwnPropertyNames(Number) should be MAX_VALUE,MIN_VALUE,NEGATIVE_INFINITY,NaN,POSITIVE_INFINITY,length,name,prototype. Was MAX_VALUE,MIN_VALUE,NEGATIVE_INFINITY,NaN,POSITIVE_INFINITY,arguments,caller,isFinite,isNaN,length,name,prototype. +PASS getSortedOwnPropertyNames(Number.prototype) is ['constructor', 'toExponential', 'toFixed', 'toLocaleString', 'toPrecision', 'toString', 'valueOf'] +FAIL getSortedOwnPropertyNames(Date) should be UTC,length,name,now,parse,prototype. Was UTC,arguments,caller,length,name,now,parse,prototype. +PASS getSortedOwnPropertyNames(Date.prototype) is ['constructor', 'getDate', 'getDay', 'getFullYear', 'getHours', 'getMilliseconds', 'getMinutes', 'getMonth', 'getSeconds', 'getTime', 'getTimezoneOffset', 'getUTCDate', 'getUTCDay', 'getUTCFullYear', 'getUTCHours', 'getUTCMilliseconds', 'getUTCMinutes', 'getUTCMonth', 'getUTCSeconds', 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds', 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear', 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', 'setYear', 'toDateString', 'toGMTString', 'toISOString', 'toJSON', 'toLocaleDateString', 'toLocaleString', 'toLocaleTimeString', 'toString', 'toTimeString', 'toUTCString', 'valueOf'] +FAIL getSortedOwnPropertyNames(RegExp) should be $&,$',$*,$+,$1,$2,$3,$4,$5,$6,$7,$8,$9,$_,$`,input,lastMatch,lastParen,leftContext,length,multiline,name,prototype,rightContext. Was $&,$',$*,$+,$1,$2,$3,$4,$5,$6,$7,$8,$9,$_,$`,$input,arguments,caller,input,lastMatch,lastParen,leftContext,length,multiline,name,prototype,rightContext. +PASS getSortedOwnPropertyNames(RegExp.prototype) is ['compile', 'constructor', 'exec', 'global', 'ignoreCase', 'lastIndex', 'multiline', 'source', 'test', 'toString'] +FAIL getSortedOwnPropertyNames(Error) should be length,name,prototype. Was arguments,caller,captureStackTrace,length,name,prototype,stackTraceLimit. +PASS getSortedOwnPropertyNames(Error.prototype) is ['constructor', 'message', 'name', 'toString'] +FAIL getSortedOwnPropertyNames(Math) should be E,LN10,LN2,LOG10E,LOG2E,PI,SQRT1_2,SQRT2,abs,acos,asin,atan,atan2,ceil,cos,exp,floor,log,max,min,pow,random,round,sin,sqrt,tan. Was E,LN10,LN2,LOG10E,LOG2E,PI,SQRT1_2,SQRT2,abs,acos,asin,atan,atan2,ceil,cos,exp,floor,imul,log,max,min,pow,random,round,sin,sqrt,tan. +PASS getSortedOwnPropertyNames(JSON) is ['parse', 'stringify'] +PASS globalPropertyNames.indexOf('NaN') != -1 is true +PASS globalPropertyNames.indexOf('Infinity') != -1 is true +PASS globalPropertyNames.indexOf('undefined') != -1 is true +PASS globalPropertyNames.indexOf('parseInt') != -1 is true +PASS globalPropertyNames.indexOf('parseFloat') != -1 is true +PASS globalPropertyNames.indexOf('isNaN') != -1 is true +PASS globalPropertyNames.indexOf('isFinite') != -1 is true +PASS globalPropertyNames.indexOf('escape') != -1 is true +PASS globalPropertyNames.indexOf('unescape') != -1 is true +PASS globalPropertyNames.indexOf('decodeURI') != -1 is true +PASS globalPropertyNames.indexOf('decodeURIComponent') != -1 is true +PASS globalPropertyNames.indexOf('encodeURI') != -1 is true +PASS globalPropertyNames.indexOf('encodeURIComponent') != -1 is true +PASS globalPropertyNames.indexOf('Object') != -1 is true +PASS globalPropertyNames.indexOf('Function') != -1 is true +PASS globalPropertyNames.indexOf('Array') != -1 is true +PASS globalPropertyNames.indexOf('String') != -1 is true +PASS globalPropertyNames.indexOf('Boolean') != -1 is true +PASS globalPropertyNames.indexOf('Number') != -1 is true +PASS globalPropertyNames.indexOf('Date') != -1 is true +PASS globalPropertyNames.indexOf('RegExp') != -1 is true +PASS globalPropertyNames.indexOf('Error') != -1 is true +PASS globalPropertyNames.indexOf('Math') != -1 is true +PASS globalPropertyNames.indexOf('JSON') != -1 is true +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames.js b/deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames.js new file mode 100644 index 0000000..4f3334a --- /dev/null +++ b/deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames.js @@ -0,0 +1,135 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description("Test to ensure correct behaviour of Object.getOwnPropertyNames"); + +function argumentsObject() { return arguments; }; + +var expectedPropertyNamesSet = { + "{}": "[]", + "{a:null}": "['a']", + "{a:null, b:null}": "['a', 'b']", + "{b:null, a:null}": "['a', 'b']", + "{__proto__:{a:null}}": "[]", + "{__proto__:[1,2,3]}": "[]", + "Object.create({}, { 'a': { 'value': 1, 'enumerable': false } })": "['a']", + "Object.create([1,2,3], { 'a': { 'value': 1, 'enumerable': false } })": "['a']", +// Function objects + "new Function()": "['arguments', 'caller', 'length', 'name', 'prototype']", + "(function(){var x=new Function();x.__proto__=[1,2,3];return x;})()": "['arguments', 'caller', 'length', 'name', 'prototype']", +// String objects + "new String('')": "['length']", + "new String('a')": "['0', 'length']", + "new String('abc')": "['0', '1', '2', 'length']", + "(function(){var x=new String('');x.__proto__=[1,2,3];return x;})()": "['length']", +// Array objects + "[]": "['length']", + "[null]": "['0', 'length']", + "[null,null]": "['0','1', 'length']", + "[null,null,,,,null]": "['0','1','5', 'length']", + "(function(){var x=[];x.__proto__=[1,2,3];return x;})()": "['length']", +// Date objects + "new Date()": "[]", + "(function(){var x=new Date();x.__proto__=[1,2,3];return x;})()": "[]", +// RegExp objects + "new RegExp('foo')": "['global', 'ignoreCase', 'lastIndex', 'multiline', 'source']", + "(function(){var x=new RegExp();x.__proto__=[1,2,3];return x;})()": "['global', 'ignoreCase', 'lastIndex', 'multiline', 'source']", +// Arguments objects + "argumentsObject()": "['callee', 'length']", + "argumentsObject(1)": "['0', 'callee', 'length']", + "argumentsObject(1,2,3)": "['0', '1', '2', 'callee', 'length']", + "(function(){arguments.__proto__=[1,2,3];return arguments;})()": "['callee', 'length']", +// Built-in ECMA functions + "parseInt": "['length', 'name']", + "parseFloat": "['length', 'name']", + "isNaN": "['length', 'name']", + "isFinite": "['length', 'name']", + "escape": "['length', 'name']", + "unescape": "['length', 'name']", + "decodeURI": "['length', 'name']", + "decodeURIComponent": "['length', 'name']", + "encodeURI": "['length', 'name']", + "encodeURIComponent": "['length', 'name']", +// Built-in ECMA objects + "Object": "['create', 'defineProperties', 'defineProperty', 'freeze', 'getOwnPropertyDescriptor', 'getOwnPropertyNames', 'getPrototypeOf', 'isExtensible', 'isFrozen', 'isSealed', 'keys', 'length', 'name', 'preventExtensions', 'prototype', 'seal']", + "Object.prototype": "['__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', '__proto__', 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf']", + "Function": "['length', 'name', 'prototype']", + "Function.prototype": "['apply', 'bind', 'call', 'constructor', 'length', 'name', 'toString']", + "Array": "['isArray', 'length', 'name', 'prototype']", + "Array.prototype": "['concat', 'constructor', 'every', 'filter', 'forEach', 'indexOf', 'join', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift']", + "String": "['fromCharCode', 'length', 'name', 'prototype']", + "String.prototype": "['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'concat', 'constructor', 'fixed', 'fontcolor', 'fontsize', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'replace', 'search', 'slice', 'small', 'split', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', 'valueOf']", + "Boolean": "['length', 'name', 'prototype']", + "Boolean.prototype": "['constructor', 'toString', 'valueOf']", + "Number": "['MAX_VALUE', 'MIN_VALUE', 'NEGATIVE_INFINITY', 'NaN', 'POSITIVE_INFINITY', 'length', 'name', 'prototype']", + "Number.prototype": "['constructor', 'toExponential', 'toFixed', 'toLocaleString', 'toPrecision', 'toString', 'valueOf']", + "Date": "['UTC', 'length', 'name', 'now', 'parse', 'prototype']", + "Date.prototype": "['constructor', 'getDate', 'getDay', 'getFullYear', 'getHours', 'getMilliseconds', 'getMinutes', 'getMonth', 'getSeconds', 'getTime', 'getTimezoneOffset', 'getUTCDate', 'getUTCDay', 'getUTCFullYear', 'getUTCHours', 'getUTCMilliseconds', 'getUTCMinutes', 'getUTCMonth', 'getUTCSeconds', 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds', 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear', 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', 'setYear', 'toDateString', 'toGMTString', 'toISOString', 'toJSON', 'toLocaleDateString', 'toLocaleString', 'toLocaleTimeString', 'toString', 'toTimeString', 'toUTCString', 'valueOf']", + "RegExp": "['$&', \"$'\", '$*', '$+', '$1', '$2', '$3', '$4', '$5', '$6', '$7', '$8', '$9', '$_', '$`', 'input', 'lastMatch', 'lastParen', 'leftContext', 'length', 'multiline', 'name', 'prototype', 'rightContext']", + "RegExp.prototype": "['compile', 'constructor', 'exec', 'global', 'ignoreCase', 'lastIndex', 'multiline', 'source', 'test', 'toString']", + "Error": "['length', 'name', 'prototype']", + "Error.prototype": "['constructor', 'message', 'name', 'toString']", + "Math": "['E', 'LN10', 'LN2', 'LOG10E', 'LOG2E', 'PI', 'SQRT1_2', 'SQRT2', 'abs', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'exp', 'floor', 'log', 'max', 'min', 'pow', 'random', 'round', 'sin', 'sqrt', 'tan']", + "JSON": "['parse', 'stringify']" +}; + +function getSortedOwnPropertyNames(obj) +{ + return Object.getOwnPropertyNames(obj).sort(); +} + +for (var expr in expectedPropertyNamesSet) + shouldBe("getSortedOwnPropertyNames(" + expr + ")", expectedPropertyNamesSet[expr]); + +// Global Object +// Only check for ECMA properties here +var globalPropertyNames = Object.getOwnPropertyNames(this); +var expectedGlobalPropertyNames = [ + "NaN", + "Infinity", + "undefined", + "parseInt", + "parseFloat", + "isNaN", + "isFinite", + "escape", + "unescape", + "decodeURI", + "decodeURIComponent", + "encodeURI", + "encodeURIComponent", + "Object", + "Function", + "Array", + "String", + "Boolean", + "Number", + "Date", + "RegExp", + "Error", + "Math", + "JSON" +]; + +for (var i = 0; i < expectedGlobalPropertyNames.length; ++i) + shouldBeTrue("globalPropertyNames.indexOf('" + expectedGlobalPropertyNames[i] + "') != -1"); diff --git a/deps/v8/test/webkit/fast/js/arguments-expected.txt b/deps/v8/test/webkit/fast/js/arguments-expected.txt new file mode 100644 index 0000000..ce1b383 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/arguments-expected.txt @@ -0,0 +1,207 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test thoroughly checks the behaviour of the 'arguments' object. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS access_1(1, 2, 3) is 1 +PASS access_2(1, 2, 3) is 2 +PASS access_3(1, 2, 3) is 3 +PASS access_4(1, 2, 3) is undefined +PASS access_5(1, 2, 3) is undefined +PASS access_1(1) is 1 +PASS access_2(1) is undefined +PASS access_3(1) is undefined +PASS access_4(1) is undefined +PASS access_5(1) is undefined +PASS access_1(1, 2, 3, 4, 5) is 1 +PASS access_2(1, 2, 3, 4, 5) is 2 +PASS access_3(1, 2, 3, 4, 5) is 3 +PASS access_4(1, 2, 3, 4, 5) is 4 +PASS access_5(1, 2, 3, 4, 5) is 5 +PASS argumentLengthIs5() is 5 +PASS argumentLengthIs5(1,2,3,4,5) is 5 +PASS argumentLengthIs5(1,2,3,4,5,6,7,8,9,10) is 5 +PASS duplicateArgumentAndReturnLast_call(1) is 1 +PASS duplicateArgumentAndReturnFirst_call(1) is 1 +PASS duplicateArgumentAndReturnLast_apply(1) is 1 +PASS duplicateArgumentAndReturnFirst_apply(1) is 1 +PASS tear_off_equal_access_1(1, 2, 3) is 1 +PASS tear_off_equal_access_2(1, 2, 3) is 2 +PASS tear_off_equal_access_3(1, 2, 3) is 3 +PASS tear_off_equal_access_4(1, 2, 3) is undefined +PASS tear_off_equal_access_5(1, 2, 3) is undefined +PASS tear_off_too_few_access_1(1) is 1 +PASS tear_off_too_few_access_2(1) is undefined +PASS tear_off_too_few_access_3(1) is undefined +PASS tear_off_too_few_access_4(1) is undefined +PASS tear_off_too_few_access_5(1) is undefined +PASS tear_off_too_many_access_1(1, 2, 3, 4, 5) is 1 +PASS tear_off_too_many_access_2(1, 2, 3, 4, 5) is 2 +PASS tear_off_too_many_access_3(1, 2, 3, 4, 5) is 3 +PASS tear_off_too_many_access_4(1, 2, 3, 4, 5) is 4 +PASS tear_off_too_many_access_5(1, 2, 3, 4, 5) is 5 +PASS live_1(0, 2, 3) is 1 +PASS live_2(1, 0, 3) is 2 +PASS live_3(1, 2, 0) is 3 +PASS live_1(0) is 1 +PASS live_2(1) is undefined +PASS live_3(1) is undefined +PASS live_1(0, 2, 3, 4, 5) is 1 +PASS live_2(1, 0, 3, 4, 5) is 2 +PASS live_3(1, 2, 0, 4, 5) is 3 +PASS extra_args_modify_4(1, 2, 3, 0, 5) is 4 +PASS extra_args_modify_5(1, 2, 3, 4, 0) is 5 +PASS tear_off_live_1(0, 2, 3)() is 1 +PASS tear_off_live_2(1, 0, 3)() is 2 +PASS tear_off_live_3(1, 2, 0)() is 3 +PASS tear_off_live_1(0)() is 1 +PASS tear_off_live_2(1)() is undefined +PASS tear_off_live_3(1)() is undefined +PASS tear_off_live_1(0, 2, 3, 4, 5)() is 1 +PASS tear_off_live_2(1, 0, 3, 4, 5)() is 2 +PASS tear_off_live_3(1, 2, 0, 4, 5)() is 3 +PASS tear_off_extra_args_modify_4(1, 2, 3, 0, 5)() is 4 +PASS tear_off_extra_args_modify_5(1, 2, 3, 4, 0)() is 5 +PASS delete_1(1, 2, 3) is undefined +PASS delete_2(1, 2, 3) is undefined +PASS delete_3(1, 2, 3) is undefined +PASS delete_4(1, 2, 3) is undefined +PASS delete_5(1, 2, 3) is undefined +PASS delete_1(1) is undefined +PASS delete_2(1) is undefined +PASS delete_3(1) is undefined +PASS delete_4(1) is undefined +PASS delete_5(1) is undefined +PASS delete_1(1, 2, 3, 4, 5) is undefined +PASS delete_2(1, 2, 3, 4, 5) is undefined +PASS delete_3(1, 2, 3, 4, 5) is undefined +PASS delete_4(1, 2, 3, 4, 5) is undefined +PASS delete_5(1, 2, 3, 4, 5) is undefined +PASS tear_off_delete_1(1, 2, 3)() is undefined +PASS tear_off_delete_2(1, 2, 3)() is undefined +PASS tear_off_delete_3(1, 2, 3)() is undefined +PASS tear_off_delete_4(1, 2, 3)() is undefined +PASS tear_off_delete_5(1, 2, 3)() is undefined +PASS tear_off_delete_1(1)() is undefined +PASS tear_off_delete_2(1)() is undefined +PASS tear_off_delete_3(1)() is undefined +PASS tear_off_delete_4(1)() is undefined +PASS tear_off_delete_5(1)() is undefined +PASS tear_off_delete_1(1, 2, 3, 4, 5)() is undefined +PASS tear_off_delete_2(1, 2, 3, 4, 5)() is undefined +PASS tear_off_delete_3(1, 2, 3, 4, 5)() is undefined +PASS tear_off_delete_4(1, 2, 3, 4, 5)() is undefined +PASS tear_off_delete_5(1, 2, 3, 4, 5)() is undefined +PASS delete_not_live_1(1, 2, 3) is 1 +PASS delete_not_live_2(1, 2, 3) is 2 +PASS delete_not_live_3(1, 2, 3) is 3 +PASS delete_not_live_1(1) is 1 +PASS delete_not_live_2(1) is undefined +PASS delete_not_live_3(1) is undefined +PASS delete_not_live_1(1, 2, 3, 4, 5) is 1 +PASS delete_not_live_2(1, 2, 3, 4, 5) is 2 +PASS delete_not_live_3(1, 2, 3, 4, 5) is 3 +PASS tear_off_delete_not_live_1(1, 2, 3)() is 1 +PASS tear_off_delete_not_live_2(1, 2, 3)() is 2 +PASS tear_off_delete_not_live_3(1, 2, 3)() is 3 +PASS tear_off_delete_not_live_1(1)() is 1 +PASS tear_off_delete_not_live_2(1)() is undefined +PASS tear_off_delete_not_live_3(1)() is undefined +PASS tear_off_delete_not_live_1(1, 2, 3, 4, 5)() is 1 +PASS tear_off_delete_not_live_2(1, 2, 3, 4, 5)() is 2 +PASS tear_off_delete_not_live_3(1, 2, 3, 4, 5)() is 3 +PASS access_after_delete_named_2(1, 2, 3) is 2 +PASS access_after_delete_named_3(1, 2, 3) is 3 +PASS access_after_delete_named_4(1, 2, 3) is undefined +PASS access_after_delete_named_2(1) is undefined +PASS access_after_delete_named_3(1) is undefined +PASS access_after_delete_named_4(1) is undefined +PASS access_after_delete_named_2(1, 2, 3, 4) is 2 +PASS access_after_delete_named_3(1, 2, 3, 4) is 3 +PASS access_after_delete_named_4(1, 2, 3, 4) is 4 +PASS access_after_delete_extra_1(1, 2, 3) is 1 +PASS access_after_delete_extra_2(1, 2, 3) is 2 +PASS access_after_delete_extra_3(1, 2, 3) is 3 +PASS access_after_delete_extra_5(1, 2, 3) is undefined +PASS access_after_delete_extra_1(1) is 1 +PASS access_after_delete_extra_2(1) is undefined +PASS access_after_delete_extra_3(1) is undefined +PASS access_after_delete_extra_5(1) is undefined +PASS access_after_delete_extra_1(1, 2, 3, 4, 5) is 1 +PASS access_after_delete_extra_2(1, 2, 3, 4, 5) is 2 +PASS access_after_delete_extra_3(1, 2, 3, 4, 5) is 3 +PASS access_after_delete_extra_5(1, 2, 3, 4, 5) is 5 +PASS argumentsParam(true) is true +PASS argumentsFunctionConstructorParam(true) is true +PASS argumentsVarUndefined() is '[object Arguments]' +FAIL argumentsConstUndefined() should be [object Arguments]. Threw exception TypeError: Variable 'arguments' has already been declared +PASS argumentCalleeInException() is argumentCalleeInException +PASS shadowedArgumentsApply([true]) is true +PASS shadowedArgumentsLength([]) is 0 +PASS shadowedArgumentsLength() threw exception TypeError: Cannot read property 'length' of undefined. +PASS shadowedArgumentsCallee([]) is undefined. +PASS shadowedArgumentsIndex([true]) is true +PASS descriptor.value is "one" +PASS descriptor.writable is true +PASS descriptor.enumerable is true +PASS descriptor.configurable is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS true is true +PASS false is false +PASS true is true +PASS false is false +PASS false is false +PASS undefined is undefined. +PASS true is true +PASS false is false +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/arguments.js b/deps/v8/test/webkit/fast/js/arguments.js new file mode 100644 index 0000000..f5b3abf --- /dev/null +++ b/deps/v8/test/webkit/fast/js/arguments.js @@ -0,0 +1,689 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"This test thoroughly checks the behaviour of the 'arguments' object." +); + +function access_1(a, b, c) +{ + return arguments[0]; +} + +function access_2(a, b, c) +{ + return arguments[1]; +} + +function access_3(a, b, c) +{ + return arguments[2]; +} + +function access_4(a, b, c) +{ + return arguments[3]; +} + +function access_5(a, b, c) +{ + return arguments[4]; +} + +function argumentLengthIs5() { + arguments.length = 5; + return arguments.length; +} + +function duplicateArgumentAndReturnLast_call(a) { + Array.prototype.push.call(arguments, a); + return arguments[1]; +} + +function duplicateArgumentAndReturnFirst_call(a) { + Array.prototype.push.call(arguments, a); + return arguments[0]; +} + +function duplicateArgumentAndReturnLast_apply(a) { + Array.prototype.push.apply(arguments, arguments); + return arguments[1]; +} + +function duplicateArgumentAndReturnFirst_apply(a) { + Array.prototype.push.apply(arguments, arguments); + return arguments[0]; +} + +shouldBe("access_1(1, 2, 3)", "1"); +shouldBe("access_2(1, 2, 3)", "2"); +shouldBe("access_3(1, 2, 3)", "3"); +shouldBe("access_4(1, 2, 3)", "undefined"); +shouldBe("access_5(1, 2, 3)", "undefined"); + +shouldBe("access_1(1)", "1"); +shouldBe("access_2(1)", "undefined"); +shouldBe("access_3(1)", "undefined"); +shouldBe("access_4(1)", "undefined"); +shouldBe("access_5(1)", "undefined"); + +shouldBe("access_1(1, 2, 3, 4, 5)", "1"); +shouldBe("access_2(1, 2, 3, 4, 5)", "2"); +shouldBe("access_3(1, 2, 3, 4, 5)", "3"); +shouldBe("access_4(1, 2, 3, 4, 5)", "4"); +shouldBe("access_5(1, 2, 3, 4, 5)", "5"); + +shouldBe("argumentLengthIs5()", "5"); +shouldBe("argumentLengthIs5(1,2,3,4,5)", "5"); +shouldBe("argumentLengthIs5(1,2,3,4,5,6,7,8,9,10)", "5"); +shouldBe("duplicateArgumentAndReturnLast_call(1)", "1"); +shouldBe("duplicateArgumentAndReturnFirst_call(1)", "1"); +shouldBe("duplicateArgumentAndReturnLast_apply(1)", "1"); +shouldBe("duplicateArgumentAndReturnFirst_apply(1)", "1"); + +function f(a, b, c) +{ + return arguments; +} + +function tear_off_equal_access_1(a, b, c) +{ + return f(a, b, c)[0]; +} + +function tear_off_equal_access_2(a, b, c) +{ + return f(a, b, c)[1]; +} + +function tear_off_equal_access_3(a, b, c) +{ + return f(a, b, c)[2]; +} + +function tear_off_equal_access_4(a, b, c) +{ + return f(a, b, c)[3]; +} + +function tear_off_equal_access_5(a, b, c) +{ + return f(a, b, c)[4]; +} + +shouldBe("tear_off_equal_access_1(1, 2, 3)", "1"); +shouldBe("tear_off_equal_access_2(1, 2, 3)", "2"); +shouldBe("tear_off_equal_access_3(1, 2, 3)", "3"); +shouldBe("tear_off_equal_access_4(1, 2, 3)", "undefined"); +shouldBe("tear_off_equal_access_5(1, 2, 3)", "undefined"); + +function tear_off_too_few_access_1(a) +{ + return f(a)[0]; +} + +function tear_off_too_few_access_2(a) +{ + return f(a)[1]; +} + +function tear_off_too_few_access_3(a) +{ + return f(a)[2]; +} + +function tear_off_too_few_access_4(a) +{ + return f(a)[3]; +} + +function tear_off_too_few_access_5(a) +{ + return f(a)[4]; +} + +shouldBe("tear_off_too_few_access_1(1)", "1"); +shouldBe("tear_off_too_few_access_2(1)", "undefined"); +shouldBe("tear_off_too_few_access_3(1)", "undefined"); +shouldBe("tear_off_too_few_access_4(1)", "undefined"); +shouldBe("tear_off_too_few_access_5(1)", "undefined"); + +function tear_off_too_many_access_1(a, b, c, d, e) +{ + return f(a, b, c, d, e)[0]; +} + +function tear_off_too_many_access_2(a, b, c, d, e) +{ + return f(a, b, c, d, e)[1]; +} + +function tear_off_too_many_access_3(a, b, c, d, e) +{ + return f(a, b, c, d, e)[2]; +} + +function tear_off_too_many_access_4(a, b, c, d, e) +{ + return f(a, b, c, d, e)[3]; +} + +function tear_off_too_many_access_5(a, b, c, d, e) +{ + return f(a, b, c, d, e)[4]; +} + +shouldBe("tear_off_too_many_access_1(1, 2, 3, 4, 5)", "1"); +shouldBe("tear_off_too_many_access_2(1, 2, 3, 4, 5)", "2"); +shouldBe("tear_off_too_many_access_3(1, 2, 3, 4, 5)", "3"); +shouldBe("tear_off_too_many_access_4(1, 2, 3, 4, 5)", "4"); +shouldBe("tear_off_too_many_access_5(1, 2, 3, 4, 5)", "5"); + +function live_1(a, b, c) +{ + arguments[0] = 1; + return a; +} + +function live_2(a, b, c) +{ + arguments[1] = 2; + return b; +} + +function live_3(a, b, c) +{ + arguments[2] = 3; + return c; +} + +shouldBe("live_1(0, 2, 3)", "1"); +shouldBe("live_2(1, 0, 3)", "2"); +shouldBe("live_3(1, 2, 0)", "3"); + +// Arguments that were not provided are not live +shouldBe("live_1(0)", "1"); +shouldBe("live_2(1)", "undefined"); +shouldBe("live_3(1)", "undefined"); + +shouldBe("live_1(0, 2, 3, 4, 5)", "1"); +shouldBe("live_2(1, 0, 3, 4, 5)", "2"); +shouldBe("live_3(1, 2, 0, 4, 5)", "3"); + +function extra_args_modify_4(a, b, c) +{ + arguments[3] = 4; + return arguments[3]; +} + +function extra_args_modify_5(a, b, c) +{ + arguments[4] = 5; + return arguments[4]; +} + +shouldBe("extra_args_modify_4(1, 2, 3, 0, 5)", "4"); +shouldBe("extra_args_modify_5(1, 2, 3, 4, 0)", "5"); + +function tear_off_live_1(a, b, c) +{ + var args = arguments; + return function() + { + args[0] = 1; + return a; + }; +} + +function tear_off_live_2(a, b, c) +{ + var args = arguments; + return function() + { + args[1] = 2; + return b; + }; +} + +function tear_off_live_3(a, b, c) +{ + var args = arguments; + return function() + { + args[2] = 3; + return c; + }; +} + +shouldBe("tear_off_live_1(0, 2, 3)()", "1"); +shouldBe("tear_off_live_2(1, 0, 3)()", "2"); +shouldBe("tear_off_live_3(1, 2, 0)()", "3"); + +// Arguments that were not provided are not live +shouldBe("tear_off_live_1(0)()", "1"); +shouldBe("tear_off_live_2(1)()", "undefined"); +shouldBe("tear_off_live_3(1)()", "undefined"); + +shouldBe("tear_off_live_1(0, 2, 3, 4, 5)()", "1"); +shouldBe("tear_off_live_2(1, 0, 3, 4, 5)()", "2"); +shouldBe("tear_off_live_3(1, 2, 0, 4, 5)()", "3"); + +function tear_off_extra_args_modify_4(a, b, c) +{ + return function() + { + arguments[3] = 4; + return arguments[3]; + } +} + +function tear_off_extra_args_modify_5(a, b, c) +{ + return function() + { + arguments[4] = 5; + return arguments[4]; + } +} + +shouldBe("tear_off_extra_args_modify_4(1, 2, 3, 0, 5)()", "4"); +shouldBe("tear_off_extra_args_modify_5(1, 2, 3, 4, 0)()", "5"); + +function delete_1(a, b, c) +{ + delete arguments[0]; + return arguments[0]; +} + +function delete_2(a, b, c) +{ + delete arguments[1]; + return arguments[1]; +} + +function delete_3(a, b, c) +{ + delete arguments[2]; + return arguments[2]; +} + +function delete_4(a, b, c) +{ + delete arguments[3]; + return arguments[3]; +} + +function delete_5(a, b, c) +{ + delete arguments[4]; + return arguments[4]; +} + +shouldBe("delete_1(1, 2, 3)", "undefined"); +shouldBe("delete_2(1, 2, 3)", "undefined"); +shouldBe("delete_3(1, 2, 3)", "undefined"); +shouldBe("delete_4(1, 2, 3)", "undefined"); +shouldBe("delete_5(1, 2, 3)", "undefined"); + +shouldBe("delete_1(1)", "undefined"); +shouldBe("delete_2(1)", "undefined"); +shouldBe("delete_3(1)", "undefined"); +shouldBe("delete_4(1)", "undefined"); +shouldBe("delete_5(1)", "undefined"); + +shouldBe("delete_1(1, 2, 3, 4, 5)", "undefined"); +shouldBe("delete_2(1, 2, 3, 4, 5)", "undefined"); +shouldBe("delete_3(1, 2, 3, 4, 5)", "undefined"); +shouldBe("delete_4(1, 2, 3, 4, 5)", "undefined"); +shouldBe("delete_5(1, 2, 3, 4, 5)", "undefined"); + +function tear_off_delete_1(a, b, c) +{ + return function() + { + delete arguments[0]; + return arguments[0]; + }; +} + +function tear_off_delete_2(a, b, c) +{ + return function() + { + delete arguments[1]; + return arguments[1]; + }; +} + +function tear_off_delete_3(a, b, c) +{ + return function() + { + delete arguments[2]; + return arguments[2]; + }; +} + +function tear_off_delete_4(a, b, c) +{ + return function() + { + delete arguments[3]; + return arguments[3]; + }; +} + +function tear_off_delete_5(a, b, c) +{ + return function() + { + delete arguments[4]; + return arguments[4]; + }; +} + +shouldBe("tear_off_delete_1(1, 2, 3)()", "undefined"); +shouldBe("tear_off_delete_2(1, 2, 3)()", "undefined"); +shouldBe("tear_off_delete_3(1, 2, 3)()", "undefined"); +shouldBe("tear_off_delete_4(1, 2, 3)()", "undefined"); +shouldBe("tear_off_delete_5(1, 2, 3)()", "undefined"); + +shouldBe("tear_off_delete_1(1)()", "undefined"); +shouldBe("tear_off_delete_2(1)()", "undefined"); +shouldBe("tear_off_delete_3(1)()", "undefined"); +shouldBe("tear_off_delete_4(1)()", "undefined"); +shouldBe("tear_off_delete_5(1)()", "undefined"); + +shouldBe("tear_off_delete_1(1, 2, 3, 4, 5)()", "undefined"); +shouldBe("tear_off_delete_2(1, 2, 3, 4, 5)()", "undefined"); +shouldBe("tear_off_delete_3(1, 2, 3, 4, 5)()", "undefined"); +shouldBe("tear_off_delete_4(1, 2, 3, 4, 5)()", "undefined"); +shouldBe("tear_off_delete_5(1, 2, 3, 4, 5)()", "undefined"); + +function delete_not_live_1(a, b, c) +{ + delete arguments[0]; + return a; +} + +function delete_not_live_2(a, b, c) +{ + delete arguments[1]; + return b; +} + +function delete_not_live_3(a, b, c) +{ + delete arguments[2]; + return c; +} + +shouldBe("delete_not_live_1(1, 2, 3)", "1"); +shouldBe("delete_not_live_2(1, 2, 3)", "2"); +shouldBe("delete_not_live_3(1, 2, 3)", "3"); + +shouldBe("delete_not_live_1(1)", "1"); +shouldBe("delete_not_live_2(1)", "undefined"); +shouldBe("delete_not_live_3(1)", "undefined"); + +shouldBe("delete_not_live_1(1, 2, 3, 4, 5)", "1"); +shouldBe("delete_not_live_2(1, 2, 3, 4, 5)", "2"); +shouldBe("delete_not_live_3(1, 2, 3, 4, 5)", "3"); + +function tear_off_delete_not_live_1(a, b, c) +{ + return function() + { + delete arguments[0]; + return a; + }; +} + +function tear_off_delete_not_live_2(a, b, c) +{ + return function () + { + delete arguments[1]; + return b; + }; +} + +function tear_off_delete_not_live_3(a, b, c) +{ + return function() + { + delete arguments[2]; + return c; + }; +} + +shouldBe("tear_off_delete_not_live_1(1, 2, 3)()", "1"); +shouldBe("tear_off_delete_not_live_2(1, 2, 3)()", "2"); +shouldBe("tear_off_delete_not_live_3(1, 2, 3)()", "3"); + +shouldBe("tear_off_delete_not_live_1(1)()", "1"); +shouldBe("tear_off_delete_not_live_2(1)()", "undefined"); +shouldBe("tear_off_delete_not_live_3(1)()", "undefined"); + +shouldBe("tear_off_delete_not_live_1(1, 2, 3, 4, 5)()", "1"); +shouldBe("tear_off_delete_not_live_2(1, 2, 3, 4, 5)()", "2"); +shouldBe("tear_off_delete_not_live_3(1, 2, 3, 4, 5)()", "3"); + +function access_after_delete_named_2(a, b, c) +{ + delete arguments[0]; + return b; +} + +function access_after_delete_named_3(a, b, c) +{ + delete arguments[0]; + return c; +} + +function access_after_delete_named_4(a, b, c) +{ + delete arguments[0]; + return arguments[3]; +} + +shouldBe("access_after_delete_named_2(1, 2, 3)", "2"); +shouldBe("access_after_delete_named_3(1, 2, 3)", "3"); +shouldBe("access_after_delete_named_4(1, 2, 3)", "undefined"); + +shouldBe("access_after_delete_named_2(1)", "undefined"); +shouldBe("access_after_delete_named_3(1)", "undefined"); +shouldBe("access_after_delete_named_4(1)", "undefined"); + +shouldBe("access_after_delete_named_2(1, 2, 3, 4)", "2"); +shouldBe("access_after_delete_named_3(1, 2, 3, 4)", "3"); +shouldBe("access_after_delete_named_4(1, 2, 3, 4)", "4"); + +function access_after_delete_extra_1(a, b, c) +{ + delete arguments[3]; + return a; +} + +function access_after_delete_extra_2(a, b, c) +{ + delete arguments[3]; + return b; +} + +function access_after_delete_extra_3(a, b, c) +{ + delete arguments[3]; + return c; +} + +function access_after_delete_extra_5(a, b, c) +{ + delete arguments[3]; + return arguments[4]; +} + +shouldBe("access_after_delete_extra_1(1, 2, 3)", "1"); +shouldBe("access_after_delete_extra_2(1, 2, 3)", "2"); +shouldBe("access_after_delete_extra_3(1, 2, 3)", "3"); +shouldBe("access_after_delete_extra_5(1, 2, 3)", "undefined"); + +shouldBe("access_after_delete_extra_1(1)", "1"); +shouldBe("access_after_delete_extra_2(1)", "undefined"); +shouldBe("access_after_delete_extra_3(1)", "undefined"); +shouldBe("access_after_delete_extra_5(1)", "undefined"); + +shouldBe("access_after_delete_extra_1(1, 2, 3, 4, 5)", "1"); +shouldBe("access_after_delete_extra_2(1, 2, 3, 4, 5)", "2"); +shouldBe("access_after_delete_extra_3(1, 2, 3, 4, 5)", "3"); +shouldBe("access_after_delete_extra_5(1, 2, 3, 4, 5)", "5"); + +function argumentsParam(arguments) +{ + return arguments; +} +shouldBeTrue("argumentsParam(true)"); + +var argumentsFunctionConstructorParam = new Function("arguments", "return arguments;"); +shouldBeTrue("argumentsFunctionConstructorParam(true)"); + +function argumentsVarUndefined() +{ + var arguments; + return String(arguments); +} +shouldBe("argumentsVarUndefined()", "'[object Arguments]'"); + +function argumentsConstUndefined() +{ + const arguments; + return String(arguments); +} +shouldBe("argumentsConstUndefined()", "'[object Arguments]'"); + +function argumentCalleeInException() { + try { + throw ""; + } catch (e) { + return arguments.callee; + } +} +shouldBe("argumentCalleeInException()", "argumentCalleeInException") + +function shadowedArgumentsApply(arguments) { + return function(a){ return a; }.apply(null, arguments); +} + +function shadowedArgumentsLength(arguments) { + return arguments.length; +} + +function shadowedArgumentsCallee(arguments) { + return arguments.callee; +} + +function shadowedArgumentsIndex(arguments) { + return arguments[0] +} + +shouldBeTrue("shadowedArgumentsApply([true])"); +shouldBe("shadowedArgumentsLength([])", '0'); +shouldThrow("shadowedArgumentsLength()"); +shouldBeUndefined("shadowedArgumentsCallee([])"); +shouldBeTrue("shadowedArgumentsIndex([true])"); + +descriptor = (function(){ return Object.getOwnPropertyDescriptor(arguments, 1); })("zero","one","two"); +shouldBe("descriptor.value", '"one"'); +shouldBe("descriptor.writable", 'true'); +shouldBe("descriptor.enumerable", 'true'); +shouldBe("descriptor.configurable", 'true'); + +// Test cases for [[DefineOwnProperty]] applied to the arguments object. +(function(a0,a1,a2,a3){ + Object.defineProperties(arguments, { + 1: { get: function(){ return 201; } }, + 2: { value: 202, writable: false }, + 3: { writable: false }, + }); + + // Test a0 is a live mapped argument. + shouldBeTrue(String( a0 === 100 )); + shouldBeTrue(String( arguments[0] === 100 )); + a0 = 300; + shouldBeTrue(String( a0 === 300 )); + shouldBeTrue(String( arguments[0] === 300 )); + arguments[0] = 400; + shouldBeTrue(String( a0 === 400 )); + shouldBeTrue(String( arguments[0] === 400 )); + + // When a1 is redefined as an accessor, it is no longer live. + shouldBeTrue(String( a1 === 101 )); + shouldBeTrue(String( arguments[1] === 201 )); + a1 = 301; + shouldBeTrue(String( a1 === 301 )); + shouldBeTrue(String( arguments[1] === 201 )); + arguments[1] = 401; + shouldBeTrue(String( a1 === 301 )); + shouldBeTrue(String( arguments[1] === 201 )); + + // When a2 is made read-only the value is set, but it is no longer live. + // (per 10.6 [[DefineOwnProperty]] 5.b.ii.1) + shouldBeTrue(String( a2 === 202 )); + shouldBeTrue(String( arguments[2] === 202 )); + a2 = 302; + shouldBeTrue(String( a2 === 302 )); + shouldBeTrue(String( arguments[2] === 202 )); + arguments[2] = 402; + shouldBeTrue(String( a2 === 302 )); + shouldBeTrue(String( arguments[2] === 202 )); + + // When a3 is made read-only, it is no longer live. + // (per 10.6 [[DefineOwnProperty]] 5.b.ii.1) + shouldBeTrue(String( a3 === 103 )); + shouldBeTrue(String( arguments[3] === 103 )); + a3 = 303; + shouldBeTrue(String( a3 === 303 )); + shouldBeTrue(String( arguments[3] === 103 )); + arguments[3] = 403; + shouldBeTrue(String( a3 === 303 )); + shouldBeTrue(String( arguments[3] === 103 )); + +})(100,101,102,103); + +// Test cases for [[DefineOwnProperty]] applied to the arguments object. +(function(arg){ + shouldBeTrue(String( Object.getOwnPropertyDescriptor(arguments, 0).writable )); + shouldBeTrue(String( Object.getOwnPropertyDescriptor(arguments, 0).enumerable )); + Object.defineProperty(arguments, 0, { writable: false }); + shouldBeFalse(String( Object.getOwnPropertyDescriptor(arguments, 0).writable )); + shouldBeTrue(String( Object.getOwnPropertyDescriptor(arguments, 0).enumerable )); + Object.defineProperty(arguments, 0, { enumerable: false }); + shouldBeFalse(String( Object.getOwnPropertyDescriptor(arguments, 0).writable )); + shouldBeFalse(String( Object.getOwnPropertyDescriptor(arguments, 0).enumerable )); + + delete arguments[1]; + shouldBeUndefined(String( Object.getOwnPropertyDescriptor(arguments, 1) )); + Object.defineProperty(arguments, 1, { writable: true }); + shouldBeTrue(String( Object.getOwnPropertyDescriptor(arguments, 1).writable )); + shouldBeFalse(String( Object.getOwnPropertyDescriptor(arguments, 1).enumerable )); +})(0,1); diff --git a/deps/v8/test/webkit/fast/js/array-bad-time-expected.txt b/deps/v8/test/webkit/fast/js/array-bad-time-expected.txt new file mode 100644 index 0000000..7668e7e --- /dev/null +++ b/deps/v8/test/webkit/fast/js/array-bad-time-expected.txt @@ -0,0 +1,1034 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Tests that defining a setter on the Array prototype works even if it is done after arrays are allocated. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +Henceforth I will have a bad time. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL ouches should be 50. Was 0. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/array-bad-time.js b/deps/v8/test/webkit/fast/js/array-bad-time.js new file mode 100644 index 0000000..1d3802e --- /dev/null +++ b/deps/v8/test/webkit/fast/js/array-bad-time.js @@ -0,0 +1,55 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"Tests that defining a setter on the Array prototype works even if it is done after arrays are allocated." +); + +var ouches = 0; + +function foo(haveABadTime) { + var result = []; + result.length = 5; + for (var i = 0; i < result.length; ++i) { + if (i == haveABadTime) { + debug("Henceforth I will have a bad time."); + Array.prototype.__defineSetter__("3", function() { debug("Ouch!"); ouches++; }); + } + result[i] = i; + } + return result; +} + +var expected = "\"0,1,2,3,4\""; + +for (var i = 0; i < 1000; ++i) { + var haveABadTime; + if (i == 950) { + haveABadTime = 2; + expected = "\"0,1,2,,4\""; + } else + haveABadTime = -1; + shouldBe("\"" + foo(haveABadTime).join(",") + "\"", expected); +} + +shouldBe("ouches", "50"); diff --git a/deps/v8/test/webkit/fast/js/array-float-delete-expected.txt b/deps/v8/test/webkit/fast/js/array-float-delete-expected.txt new file mode 100644 index 0000000..99778c8 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/array-float-delete-expected.txt @@ -0,0 +1,33 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks for regression against 6234: Can delete array index property incorrectly. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS a[1] is "before" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/array-float-delete.js b/deps/v8/test/webkit/fast/js/array-float-delete.js new file mode 100644 index 0000000..e1e712e --- /dev/null +++ b/deps/v8/test/webkit/fast/js/array-float-delete.js @@ -0,0 +1,32 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'This test checks for regression against 6234: Can delete array index property incorrectly.' +); + +var a = new Array(); +a[1] = "before"; +a['1.0'] = "after"; +delete a['1.0']; +shouldBe("a[1]", '"before"'); diff --git a/deps/v8/test/webkit/fast/js/array-functions-non-arrays-expected.txt b/deps/v8/test/webkit/fast/js/array-functions-non-arrays-expected.txt new file mode 100644 index 0000000..51f7ceb --- /dev/null +++ b/deps/v8/test/webkit/fast/js/array-functions-non-arrays-expected.txt @@ -0,0 +1,122 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test some array functions on non-array objects. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS properties(['b', 'a']) is '0:b, 1:a, length:2(DontDelete, DontEnum)' +PASS properties({ length:2, 0:'b', 1:'a' }) is '0:b, 1:a, length:2' +PASS properties(new OneItemConstructor) is '0:a(FromPrototype), length:1(FromPrototype)' +PASS properties(new TwoItemConstructor) is '0:b(FromPrototype), 1:a(FromPrototype), length:2(FromPrototype)' +PASS Array.prototype.toString.call({}) is "[object Object]" +PASS Array.prototype.toString.call(new Date) is "[object Date]" +PASS Array.prototype.toString.call({sort: function() { return 'sort' }}) is "[object Object]" +PASS Array.prototype.toString.call({join: function() { return 'join' }}) is "join" +PASS Array.prototype.toString.call({__proto__: Array.prototype, 0: 'a', 1: 'b', 2: 'c', length: 3}) is "a,b,c" +PASS ({__proto__: Array.prototype, 0: 'a', 1: 'b', 2: 'c', length: 3}).toString() is "a,b,c" +PASS Array.prototype.toString.call({__proto__: Array.prototype, 0: 'a', 1: 'b', 2: 'c', length: 3, join: function() { return 'join' }}) is "join" +PASS ({__proto__: Array.prototype, 0: 'a', 1: 'b', 2: 'c', length: 3, join: function() { return 'join' }}).toString() is "join" +PASS Array.prototype.toString.call(42) is "Number.prototype.join:42" +PASS [0, 1, 2].toString() is "array-join" +FAIL Array.prototype.toLocaleString.call({}) should throw an exception. Was . +PASS Array.prototype.concat.call(x = { length:2, 0:'b', 1:'a' }) is [x] +PASS Array.prototype.join.call({}) is '' +PASS Array.prototype.join.call(['b', 'a']) is 'b,a' +PASS Array.prototype.join.call({ length:2, 0:'b', 1:'a' }) is 'b,a' +PASS Array.prototype.join.call(new TwoItemConstructor) is 'b,a' +PASS Array.prototype.pop.call({}) is undefined +PASS Array.prototype.pop.call({ length:2, 0:'b', 1:'a' }) is 'a' +PASS Array.prototype.pop.call({ length:2, 0:'b', 1:'a' }) is 'a' +PASS Array.prototype.pop.call(new TwoItemConstructor) is 'a' +PASS Array.prototype.pop.call(x = {}); properties(x) is 'length:0' +PASS Array.prototype.pop.call(x = ['b', 'a']); properties(x) is '0:b, length:1(DontDelete, DontEnum)' +PASS Array.prototype.pop.call(x = { length:2, 0:'b', 1:'a' }); properties(x) is '0:b, length:1' +PASS Array.prototype.pop.call(x = new TwoItemConstructor); properties(x) is '0:b(FromPrototype), 1:a(FromPrototype), length:1' +PASS Array.prototype.push.call({}) is 0 +PASS Array.prototype.push.call(['b', 'a']) is 2 +PASS Array.prototype.push.call({ length:2, 0:'b', 1:'a' }) is 2 +PASS Array.prototype.push.call(new TwoItemConstructor) is 2 +PASS Array.prototype.push.call(x = {}); properties(x) is 'length:0' +PASS Array.prototype.push.call(x = ['b', 'a']); properties(x) is '0:b, 1:a, length:2(DontDelete, DontEnum)' +PASS Array.prototype.push.call(x = { length:2, 0:'b', 1:'a' }); properties(x) is '0:b, 1:a, length:2' +PASS Array.prototype.push.call(x = new TwoItemConstructor); properties(x) is '0:b(FromPrototype), 1:a(FromPrototype), length:2' +PASS Array.prototype.push.call({}, 'c') is 1 +PASS Array.prototype.push.call(['b', 'a'], 'c') is 3 +PASS Array.prototype.push.call({ length:2, 0:'b', 1:'a' }, 'c') is 3 +PASS Array.prototype.push.call(new TwoItemConstructor, 'c') is 3 +PASS Array.prototype.push.call(x = {}, 'c'); properties(x) is '0:c, length:1' +PASS Array.prototype.push.call(x = ['b', 'a'], 'c'); properties(x) is '0:b, 1:a, 2:c, length:3(DontDelete, DontEnum)' +PASS Array.prototype.push.call(x = { length:2, 0:'b', 1:'a' }, 'c'); properties(x) is '0:b, 1:a, 2:c, length:3' +PASS Array.prototype.push.call(x = new TwoItemConstructor, 'c'); properties(x) is '0:b(FromPrototype), 1:a(FromPrototype), 2:c, length:3' +PASS properties(Array.prototype.reverse.call({})) is '' +PASS properties(Array.prototype.reverse.call(['b', 'a'])) is '0:a, 1:b, length:2(DontDelete, DontEnum)' +PASS properties(Array.prototype.reverse.call({ length:2, 0:'b', 1:'a' })) is '0:a, 1:b, length:2' +PASS properties(Array.prototype.reverse.call(new OneItemConstructor)) is '0:a(FromPrototype), length:1(FromPrototype)' +PASS properties(Array.prototype.reverse.call(new TwoItemConstructor)) is '0:a, 1:b, length:2(FromPrototype)' +PASS Array.prototype.shift.call({}) is undefined +PASS Array.prototype.shift.call(['b', 'a']) is 'b' +PASS Array.prototype.shift.call({ length:2, 0:'b', 1:'a' }) is 'b' +PASS Array.prototype.shift.call(new TwoItemConstructor) is 'b' +PASS Array.prototype.shift.call(x = {}); properties(x) is 'length:0' +PASS Array.prototype.shift.call(x = ['b', 'a']); properties(x) is '0:a, length:1(DontDelete, DontEnum)' +PASS Array.prototype.shift.call(x = { length:2, 0:'b', 1:'a' }); properties(x) is '0:a, length:1' +PASS Array.prototype.shift.call(x = new TwoItemConstructor); properties(x) is '0:a, 1:a(FromPrototype), length:1' +PASS Array.prototype.slice.call({}, 0, 1) is [] +PASS Array.prototype.slice.call(['b', 'a'], 0, 1) is ['b'] +PASS Array.prototype.slice.call({ length:2, 0:'b', 1:'a' }, 0, 1) is ['b'] +PASS Array.prototype.slice.call(new TwoItemConstructor, 0, 1) is ['b'] +PASS properties(Array.prototype.sort.call({})) is '' +PASS properties(Array.prototype.sort.call(['b', 'a'])) is '0:a, 1:b, length:2(DontDelete, DontEnum)' +PASS properties(Array.prototype.sort.call({ length:2, 0:'b', 1:'a' })) is '0:a, 1:b, length:2' +PASS properties(Array.prototype.sort.call(new OneItemConstructor)) is '0:a(FromPrototype), length:1(FromPrototype)' +PASS properties(Array.prototype.sort.call(new TwoItemConstructor)) is '0:a, 1:b, length:2(FromPrototype)' +PASS Array.prototype.splice.call({}, 0, 1) is [] +PASS Array.prototype.splice.call(['b', 'a'], 0, 1) is ['b'] +PASS Array.prototype.splice.call({ length:2, 0:'b', 1:'a' }, 0, 1) is ['b'] +PASS Array.prototype.splice.call(new TwoItemConstructor, 0, 1) is ['b'] +PASS Array.prototype.splice.call(x = {}, 0, 1); properties(x) is 'length:0' +PASS Array.prototype.splice.call(x = ['b', 'a'], 0, 1); properties(x) is '0:a, length:1(DontDelete, DontEnum)' +PASS Array.prototype.splice.call(x = { length:2, 0:'b', 1:'a' }, 0, 1); properties(x) is '0:a, length:1' +PASS Array.prototype.splice.call(x = new TwoItemConstructor, 0, 1); properties(x) is '0:a, 1:a(FromPrototype), length:1' +PASS Array.prototype.unshift.call({}) is 0 +PASS Array.prototype.unshift.call(['b', 'a']) is 2 +PASS Array.prototype.unshift.call({ length:2, 0:'b', 1:'a' }) is 2 +PASS Array.prototype.unshift.call(new TwoItemConstructor) is 2 +PASS Array.prototype.unshift.call(x = {}); properties(x) is 'length:0' +PASS Array.prototype.unshift.call(x = ['b', 'a']); properties(x) is '0:b, 1:a, length:2(DontDelete, DontEnum)' +PASS Array.prototype.unshift.call(x = { length:2, 0:'b', 1:'a' }); properties(x) is '0:b, 1:a, length:2' +PASS Array.prototype.unshift.call(x = new TwoItemConstructor); properties(x) is '0:b(FromPrototype), 1:a(FromPrototype), length:2' +PASS Array.prototype.unshift.call({}, 'c') is 1 +PASS Array.prototype.unshift.call(['b', 'a'], 'c') is 3 +PASS Array.prototype.unshift.call({ length:2, 0:'b', 1:'a' }, 'c') is 3 +PASS Array.prototype.unshift.call(new TwoItemConstructor, 'c') is 3 +PASS Array.prototype.unshift.call(x = {}, 'c'); properties(x) is '0:c, length:1' +PASS Array.prototype.unshift.call(x = ['b', 'a'], 'c'); properties(x) is '0:c, 1:b, 2:a, length:3(DontDelete, DontEnum)' +PASS Array.prototype.unshift.call(x = { length:2, 0:'b', 1:'a' }, 'c'); properties(x) is '0:c, 1:b, 2:a, length:3' +PASS Array.prototype.unshift.call(x = new TwoItemConstructor, 'c'); properties(x) is '0:c, 1:b, 2:a, length:3' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/array-functions-non-arrays.js b/deps/v8/test/webkit/fast/js/array-functions-non-arrays.js new file mode 100644 index 0000000..60e555e --- /dev/null +++ b/deps/v8/test/webkit/fast/js/array-functions-non-arrays.js @@ -0,0 +1,204 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"Test some array functions on non-array objects." +); + +function properties(object, extraName1, extraName2, extraName3) +{ + var string = ""; + + // destructive, lists properties + var names = []; + var enumerables = {}; + for (propertyName in object) { + names.push(propertyName); + enumerables[propertyName] = 1; + } + names.push("length"); + names.push(extraName1); + names.push(extraName2); + names.push(extraName3); + names.sort(); + + var propertyStrings = []; + for (i = 0; i < names.length; ++i) { + var name = names[i]; + if (name == names[i - 1]) + continue; + if (!(name in object)) + continue; + + var propertyString = name + ":" + object[name]; + + var flags = []; + if (!object.hasOwnProperty(name)) + flags.push("FromPrototype"); + if (!enumerables[name]) + flags.push("DontEnum"); + if (name != "length") { + try { + object[name] = "ReadOnlyTestValue"; + } catch (e) { + } + if (object[name] != "ReadOnlyTestValue") + flags.push("ReadOnly"); + } + delete object[name]; + if (object.hasOwnProperty(name)) + flags.push("DontDelete"); + + flags.sort(); + + if (flags.length) + propertyString += "(" + flags.join(", ") + ")"; + + propertyStrings.push(propertyString); + } + return propertyStrings.join(", "); +} + +var x; + +var oneItemPrototype = { length:1, 0:'a' }; +function OneItemConstructor() +{ +} +OneItemConstructor.prototype = oneItemPrototype; + +var twoItemPrototype = { length:2, 0:'b', 1:'a' }; +function TwoItemConstructor() +{ +} +TwoItemConstructor.prototype = twoItemPrototype; + +shouldBe("properties(['b', 'a'])", "'0:b, 1:a, length:2(DontDelete, DontEnum)'"); +shouldBe("properties({ length:2, 0:'b', 1:'a' })", "'0:b, 1:a, length:2'"); + +shouldBe("properties(new OneItemConstructor)", "'0:a(FromPrototype), length:1(FromPrototype)'"); +shouldBe("properties(new TwoItemConstructor)", "'0:b(FromPrototype), 1:a(FromPrototype), length:2(FromPrototype)'"); + +shouldBe("Array.prototype.toString.call({})", '"' + ({}).toString() + '"'); +shouldBe("Array.prototype.toString.call(new Date)", '"' + Object.prototype.toString.call(new Date) + '"'); +shouldBe("Array.prototype.toString.call({sort: function() { return 'sort' }})", '"' + Object.prototype.toString.call({}) + '"'); +shouldBe("Array.prototype.toString.call({join: function() { return 'join' }})", '"join"'); +shouldBe("Array.prototype.toString.call({__proto__: Array.prototype, 0: 'a', 1: 'b', 2: 'c', length: 3})", '"a,b,c"'); +shouldBe("({__proto__: Array.prototype, 0: 'a', 1: 'b', 2: 'c', length: 3}).toString()", '"a,b,c"'); +shouldBe("Array.prototype.toString.call({__proto__: Array.prototype, 0: 'a', 1: 'b', 2: 'c', length: 3, join: function() { return 'join' }})", '"join"'); +shouldBe("({__proto__: Array.prototype, 0: 'a', 1: 'b', 2: 'c', length: 3, join: function() { return 'join' }}).toString()", '"join"'); +Number.prototype.join = function() { return "Number.prototype.join:" + this; } +shouldBe("Array.prototype.toString.call(42)", '"Number.prototype.join:42"'); +var arrayJoin = Array.prototype.join; +Array.prototype.join = function() { return 'array-join' }; +shouldBe("[0, 1, 2].toString()", '"array-join"'); +Array.prototype.join = arrayJoin; + +shouldThrow("Array.prototype.toLocaleString.call({})"); + +shouldBe("Array.prototype.concat.call(x = { length:2, 0:'b', 1:'a' })", "[x]"); + +shouldBe("Array.prototype.join.call({})", "''"); +shouldBe("Array.prototype.join.call(['b', 'a'])", "'b,a'"); +shouldBe("Array.prototype.join.call({ length:2, 0:'b', 1:'a' })", "'b,a'"); +shouldBe("Array.prototype.join.call(new TwoItemConstructor)", "'b,a'"); + +shouldBe("Array.prototype.pop.call({})", "undefined"); +shouldBe("Array.prototype.pop.call({ length:2, 0:'b', 1:'a' })", "'a'"); +shouldBe("Array.prototype.pop.call({ length:2, 0:'b', 1:'a' })", "'a'"); +shouldBe("Array.prototype.pop.call(new TwoItemConstructor)", "'a'"); +shouldBe("Array.prototype.pop.call(x = {}); properties(x)", "'length:0'"); +shouldBe("Array.prototype.pop.call(x = ['b', 'a']); properties(x)", "'0:b, length:1(DontDelete, DontEnum)'"); +shouldBe("Array.prototype.pop.call(x = { length:2, 0:'b', 1:'a' }); properties(x)", "'0:b, length:1'"); +shouldBe("Array.prototype.pop.call(x = new TwoItemConstructor); properties(x)", "'0:b(FromPrototype), 1:a(FromPrototype), length:1'"); + +shouldBe("Array.prototype.push.call({})", "0"); +shouldBe("Array.prototype.push.call(['b', 'a'])", "2"); +shouldBe("Array.prototype.push.call({ length:2, 0:'b', 1:'a' })", "2"); +shouldBe("Array.prototype.push.call(new TwoItemConstructor)", "2"); +shouldBe("Array.prototype.push.call(x = {}); properties(x)", "'length:0'"); +shouldBe("Array.prototype.push.call(x = ['b', 'a']); properties(x)", "'0:b, 1:a, length:2(DontDelete, DontEnum)'"); +shouldBe("Array.prototype.push.call(x = { length:2, 0:'b', 1:'a' }); properties(x)", "'0:b, 1:a, length:2'"); +shouldBe("Array.prototype.push.call(x = new TwoItemConstructor); properties(x)", "'0:b(FromPrototype), 1:a(FromPrototype), length:2'"); +shouldBe("Array.prototype.push.call({}, 'c')", "1"); +shouldBe("Array.prototype.push.call(['b', 'a'], 'c')", "3"); +shouldBe("Array.prototype.push.call({ length:2, 0:'b', 1:'a' }, 'c')", "3"); +shouldBe("Array.prototype.push.call(new TwoItemConstructor, 'c')", "3"); +shouldBe("Array.prototype.push.call(x = {}, 'c'); properties(x)", "'0:c, length:1'"); +shouldBe("Array.prototype.push.call(x = ['b', 'a'], 'c'); properties(x)", "'0:b, 1:a, 2:c, length:3(DontDelete, DontEnum)'"); +shouldBe("Array.prototype.push.call(x = { length:2, 0:'b', 1:'a' }, 'c'); properties(x)", "'0:b, 1:a, 2:c, length:3'"); +shouldBe("Array.prototype.push.call(x = new TwoItemConstructor, 'c'); properties(x)", "'0:b(FromPrototype), 1:a(FromPrototype), 2:c, length:3'"); + +shouldBe("properties(Array.prototype.reverse.call({}))", "''"); +shouldBe("properties(Array.prototype.reverse.call(['b', 'a']))", "'0:a, 1:b, length:2(DontDelete, DontEnum)'"); +shouldBe("properties(Array.prototype.reverse.call({ length:2, 0:'b', 1:'a' }))", "'0:a, 1:b, length:2'"); +shouldBe("properties(Array.prototype.reverse.call(new OneItemConstructor))", "'0:a(FromPrototype), length:1(FromPrototype)'"); +shouldBe("properties(Array.prototype.reverse.call(new TwoItemConstructor))", "'0:a, 1:b, length:2(FromPrototype)'"); + +shouldBe("Array.prototype.shift.call({})", "undefined"); +shouldBe("Array.prototype.shift.call(['b', 'a'])", "'b'"); +shouldBe("Array.prototype.shift.call({ length:2, 0:'b', 1:'a' })", "'b'"); +shouldBe("Array.prototype.shift.call(new TwoItemConstructor)", "'b'"); +shouldBe("Array.prototype.shift.call(x = {}); properties(x)", "'length:0'"); +shouldBe("Array.prototype.shift.call(x = ['b', 'a']); properties(x)", "'0:a, length:1(DontDelete, DontEnum)'"); +shouldBe("Array.prototype.shift.call(x = { length:2, 0:'b', 1:'a' }); properties(x)", "'0:a, length:1'"); +shouldBe("Array.prototype.shift.call(x = new TwoItemConstructor); properties(x)", "'0:a, 1:a(FromPrototype), length:1'"); + +shouldBe("Array.prototype.slice.call({}, 0, 1)", "[]"); +shouldBe("Array.prototype.slice.call(['b', 'a'], 0, 1)", "['b']"); +shouldBe("Array.prototype.slice.call({ length:2, 0:'b', 1:'a' }, 0, 1)", "['b']"); +shouldBe("Array.prototype.slice.call(new TwoItemConstructor, 0, 1)", "['b']"); + +shouldBe("properties(Array.prototype.sort.call({}))", "''"); +shouldBe("properties(Array.prototype.sort.call(['b', 'a']))", "'0:a, 1:b, length:2(DontDelete, DontEnum)'"); +shouldBe("properties(Array.prototype.sort.call({ length:2, 0:'b', 1:'a' }))", "'0:a, 1:b, length:2'"); +shouldBe("properties(Array.prototype.sort.call(new OneItemConstructor))", "'0:a(FromPrototype), length:1(FromPrototype)'"); +shouldBe("properties(Array.prototype.sort.call(new TwoItemConstructor))", "'0:a, 1:b, length:2(FromPrototype)'"); + +shouldBe("Array.prototype.splice.call({}, 0, 1)", "[]"); +shouldBe("Array.prototype.splice.call(['b', 'a'], 0, 1)", "['b']"); +shouldBe("Array.prototype.splice.call({ length:2, 0:'b', 1:'a' }, 0, 1)", "['b']"); +shouldBe("Array.prototype.splice.call(new TwoItemConstructor, 0, 1)", "['b']"); +shouldBe("Array.prototype.splice.call(x = {}, 0, 1); properties(x)", "'length:0'"); +shouldBe("Array.prototype.splice.call(x = ['b', 'a'], 0, 1); properties(x)", "'0:a, length:1(DontDelete, DontEnum)'"); +shouldBe("Array.prototype.splice.call(x = { length:2, 0:'b', 1:'a' }, 0, 1); properties(x)", "'0:a, length:1'"); +shouldBe("Array.prototype.splice.call(x = new TwoItemConstructor, 0, 1); properties(x)", "'0:a, 1:a(FromPrototype), length:1'"); + +shouldBe("Array.prototype.unshift.call({})", "0"); +shouldBe("Array.prototype.unshift.call(['b', 'a'])", "2"); +shouldBe("Array.prototype.unshift.call({ length:2, 0:'b', 1:'a' })", "2"); +shouldBe("Array.prototype.unshift.call(new TwoItemConstructor)", "2"); +shouldBe("Array.prototype.unshift.call(x = {}); properties(x)", "'length:0'"); +shouldBe("Array.prototype.unshift.call(x = ['b', 'a']); properties(x)", "'0:b, 1:a, length:2(DontDelete, DontEnum)'"); +shouldBe("Array.prototype.unshift.call(x = { length:2, 0:'b', 1:'a' }); properties(x)", "'0:b, 1:a, length:2'"); +shouldBe("Array.prototype.unshift.call(x = new TwoItemConstructor); properties(x)", "'0:b(FromPrototype), 1:a(FromPrototype), length:2'"); +shouldBe("Array.prototype.unshift.call({}, 'c')", "1"); +shouldBe("Array.prototype.unshift.call(['b', 'a'], 'c')", "3"); +shouldBe("Array.prototype.unshift.call({ length:2, 0:'b', 1:'a' }, 'c')", "3"); +shouldBe("Array.prototype.unshift.call(new TwoItemConstructor, 'c')", "3"); +shouldBe("Array.prototype.unshift.call(x = {}, 'c'); properties(x)", "'0:c, length:1'"); +shouldBe("Array.prototype.unshift.call(x = ['b', 'a'], 'c'); properties(x)", "'0:c, 1:b, 2:a, length:3(DontDelete, DontEnum)'"); +shouldBe("Array.prototype.unshift.call(x = { length:2, 0:'b', 1:'a' }, 'c'); properties(x)", "'0:c, 1:b, 2:a, length:3'"); +shouldBe("Array.prototype.unshift.call(x = new TwoItemConstructor, 'c'); properties(x)", "'0:c, 1:b, 2:a, length:3'"); + +// FIXME: Add tests for every, forEach, some, indexOf, lastIndexOf, filter, and map diff --git a/deps/v8/test/webkit/fast/js/array-prototype-properties-expected.txt b/deps/v8/test/webkit/fast/js/array-prototype-properties-expected.txt new file mode 100644 index 0000000..6ab72a4 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/array-prototype-properties-expected.txt @@ -0,0 +1,54 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This is a test case for bug 64679. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS Array.prototype.toString.call(undefined) threw exception TypeError: Cannot convert undefined or null to object. +PASS Array.prototype.toLocaleString.call(undefined) threw exception TypeError: Cannot convert undefined or null to object. +PASS Array.prototype.concat.call(undefined, []) threw exception TypeError: Array.prototype.concat called on null or undefined. +PASS Array.prototype.join.call(undefined, []) threw exception TypeError: Array.prototype.join called on null or undefined. +PASS Array.prototype.pop.call(undefined) threw exception TypeError: Array.prototype.pop called on null or undefined. +PASS Array.prototype.push.call(undefined, {}) threw exception TypeError: Array.prototype.push called on null or undefined. +PASS Array.prototype.reverse.call(undefined) threw exception TypeError: Array.prototype.reverse called on null or undefined. +PASS Array.prototype.shift.call(undefined) threw exception TypeError: Array.prototype.shift called on null or undefined. +PASS Array.prototype.slice.call(undefined, 0, 1) threw exception TypeError: Array.prototype.slice called on null or undefined. +PASS Array.prototype.sort.call(undefined) threw exception TypeError: Array.prototype.sort called on null or undefined. +PASS Array.prototype.splice.call(undefined, 0, 1) threw exception TypeError: Array.prototype.splice called on null or undefined. +PASS Array.prototype.unshift.call(undefined, {}) threw exception TypeError: Array.prototype.unshift called on null or undefined. +PASS Array.prototype.every.call(undefined, toString) threw exception TypeError: Array.prototype.every called on null or undefined. +PASS Array.prototype.forEach.call(undefined, toString) threw exception TypeError: Array.prototype.forEach called on null or undefined. +PASS Array.prototype.some.call(undefined, toString) threw exception TypeError: Array.prototype.some called on null or undefined. +PASS Array.prototype.indexOf.call(undefined, 0) threw exception TypeError: Array.prototype.indexOf called on null or undefined. +PASS Array.prototype.indlastIndexOfexOf.call(undefined, 0) threw exception TypeError: Cannot call method 'call' of undefined. +PASS Array.prototype.filter.call(undefined, toString) threw exception TypeError: Array.prototype.filter called on null or undefined. +PASS Array.prototype.reduce.call(undefined, toString) threw exception TypeError: Array.prototype.reduce called on null or undefined. +PASS Array.prototype.reduceRight.call(undefined, toString) threw exception TypeError: Array.prototype.reduceRight called on null or undefined. +PASS Array.prototype.map.call(undefined, toString) threw exception TypeError: Array.prototype.map called on null or undefined. +PASS [{toLocaleString:function(){throw 1}},{toLocaleString:function(){throw 2}}].toLocaleString() threw exception 1. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/array-prototype-properties.js b/deps/v8/test/webkit/fast/js/array-prototype-properties.js new file mode 100644 index 0000000..12f2f9c --- /dev/null +++ b/deps/v8/test/webkit/fast/js/array-prototype-properties.js @@ -0,0 +1,52 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'This is a test case for bug 64679.' +); + +// These calls pass undefined as this value, and as such should throw in toObject. +shouldThrow("Array.prototype.toString.call(undefined)"); +shouldThrow("Array.prototype.toLocaleString.call(undefined)"); +shouldThrow("Array.prototype.concat.call(undefined, [])"); +shouldThrow("Array.prototype.join.call(undefined, [])"); +shouldThrow("Array.prototype.pop.call(undefined)"); +shouldThrow("Array.prototype.push.call(undefined, {})"); +shouldThrow("Array.prototype.reverse.call(undefined)"); +shouldThrow("Array.prototype.shift.call(undefined)"); +shouldThrow("Array.prototype.slice.call(undefined, 0, 1)"); +shouldThrow("Array.prototype.sort.call(undefined)"); +shouldThrow("Array.prototype.splice.call(undefined, 0, 1)"); +shouldThrow("Array.prototype.unshift.call(undefined, {})"); +shouldThrow("Array.prototype.every.call(undefined, toString)"); +shouldThrow("Array.prototype.forEach.call(undefined, toString)"); +shouldThrow("Array.prototype.some.call(undefined, toString)"); +shouldThrow("Array.prototype.indexOf.call(undefined, 0)"); +shouldThrow("Array.prototype.indlastIndexOfexOf.call(undefined, 0)"); +shouldThrow("Array.prototype.filter.call(undefined, toString)"); +shouldThrow("Array.prototype.reduce.call(undefined, toString)"); +shouldThrow("Array.prototype.reduceRight.call(undefined, toString)"); +shouldThrow("Array.prototype.map.call(undefined, toString)"); + +// Test exception ordering in Array.prototype.toLocaleString ( https://bugs.webkit.org/show_bug.cgi?id=80663 ) +shouldThrow("[{toLocaleString:function(){throw 1}},{toLocaleString:function(){throw 2}}].toLocaleString()", '1'); diff --git a/deps/v8/test/webkit/fast/js/array-slow-put-expected.txt b/deps/v8/test/webkit/fast/js/array-slow-put-expected.txt new file mode 100644 index 0000000..4748462 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/array-slow-put-expected.txt @@ -0,0 +1,133 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Tests that defining a setter on the Array prototype works. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL ouches should be 100. Was 0. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/array-slow-put.js b/deps/v8/test/webkit/fast/js/array-slow-put.js new file mode 100644 index 0000000..1e8c44d --- /dev/null +++ b/deps/v8/test/webkit/fast/js/array-slow-put.js @@ -0,0 +1,42 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"Tests that defining a setter on the Array prototype works." +); + +var ouches = 0; +Array.prototype.__defineSetter__("3", function() { debug("Ouch!"); ouches++; }); + +function foo() { + var result = []; + result.length = 5; + for (var i = 0; i < result.length; ++i) + result[i] = i; + return result; +} + +for (var i = 0; i < 100; ++i) + shouldBe("\"" + foo().join(",") + "\"", "\"0,1,2,,4\""); + +shouldBe("ouches", "100"); diff --git a/deps/v8/test/webkit/fast/js/array-tostring-ignore-separator-expected.txt b/deps/v8/test/webkit/fast/js/array-tostring-ignore-separator-expected.txt new file mode 100644 index 0000000..9826480 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/array-tostring-ignore-separator-expected.txt @@ -0,0 +1,33 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks for regressions against 6261:Do not use a separator argument when doing toString/toLocalString. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS a.toString('!') is '5,3' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/array-tostring-ignore-separator.js b/deps/v8/test/webkit/fast/js/array-tostring-ignore-separator.js new file mode 100644 index 0000000..3390eb2 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/array-tostring-ignore-separator.js @@ -0,0 +1,32 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'This test checks for regressions against 6261:Do not use a separator argument when doing toString/toLocalString.' +); + +var a = new Array; +a[0] = 5; +a[1] = 3; +//Shouldn't use argument for toString +shouldBe("a.toString('!')", "'5,3'"); diff --git a/deps/v8/test/webkit/fast/js/basic-strict-mode-expected.txt b/deps/v8/test/webkit/fast/js/basic-strict-mode-expected.txt new file mode 100644 index 0000000..f743f6d --- /dev/null +++ b/deps/v8/test/webkit/fast/js/basic-strict-mode-expected.txt @@ -0,0 +1,237 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test behaviour of strict mode + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS testThis.call(null) is null +PASS testThis.call(1) is 1 +PASS testThis.call(true) is true +PASS testThis.call(false) is false +PASS testThis.call(undefined) is undefined +PASS testLineContinuation.call(undefined) === undefined is false +PASS testEscapeSequence.call(undefined) === undefined is false +PASS testThis.call('a string') is 'a string' +PASS testThisDotAccess.call('a string') is 'a string'.length +PASS testThisDotAccess.call(null) threw exception TypeError: Cannot read property 'length' of null. +PASS testThisDotAccess.call(undefined) threw exception TypeError: Cannot read property 'length' of undefined. +PASS testThisDotAccess.call(true) is undefined. +PASS testThisDotAccess.call(false) is undefined. +PASS testThisDotAccess.call(1) is undefined. +PASS testThisBracketAccess.call('a string', 'length') is 'a string'.length +PASS testThisBracketAccess.call(null, 'length') threw exception TypeError: Cannot read property 'length' of null. +PASS testThisBracketAccess.call(undefined, 'length') threw exception TypeError: Cannot read property 'length' of undefined. +PASS testThisBracketAccess.call(true, 'length') is undefined. +PASS testThisBracketAccess.call(false, 'length') is undefined. +PASS testThisBracketAccess.call(1, 'length') is undefined. +PASS Function('"use strict"; return this;')() is undefined. +PASS Function('"use strict"; with({});') threw exception SyntaxError: Strict mode code may not include a with statement. +PASS testGlobalAccess() is undefined +PASS testThis.call() is undefined +PASS testThis.apply() is undefined +PASS testThis.call(undefined) is undefined +PASS testThis.apply(undefined) is undefined +PASS (function eval(){'use strict';}) threw exception SyntaxError: Function name may not be eval or arguments in strict mode. +PASS (function(){(function eval(){'use strict';})}) threw exception SyntaxError: Function name may not be eval or arguments in strict mode. +PASS (function (eval){'use strict';}) threw exception SyntaxError: Parameter name eval or arguments is not allowed in strict mode. +PASS (function(){(function (eval){'use strict';})}) threw exception SyntaxError: Parameter name eval or arguments is not allowed in strict mode. +PASS (function arguments(){'use strict';}) threw exception SyntaxError: Function name may not be eval or arguments in strict mode. +PASS (function(){(function arguments(){'use strict';})}) threw exception SyntaxError: Function name may not be eval or arguments in strict mode. +PASS (function (arguments){'use strict';}) threw exception SyntaxError: Parameter name eval or arguments is not allowed in strict mode. +PASS (function(){(function (arguments){'use strict';})}) threw exception SyntaxError: Parameter name eval or arguments is not allowed in strict mode. +PASS (function (){'use strict'; var eval;}) threw exception SyntaxError: Variable name may not be eval or arguments in strict mode. +PASS (function(){(function (){'use strict'; var eval;})}) threw exception SyntaxError: Variable name may not be eval or arguments in strict mode. +PASS (function (){'use strict'; var arguments;}) threw exception SyntaxError: Variable name may not be eval or arguments in strict mode. +PASS (function(){(function (){'use strict'; var arguments;})}) threw exception SyntaxError: Variable name may not be eval or arguments in strict mode. +PASS (function (){'use strict'; try{}catch(eval){}}) threw exception SyntaxError: Catch variable may not be eval or arguments in strict mode. +PASS (function(){(function (){'use strict'; try{}catch(eval){}})}) threw exception SyntaxError: Catch variable may not be eval or arguments in strict mode. +PASS (function (){'use strict'; try{}catch(arguments){}}) threw exception SyntaxError: Catch variable may not be eval or arguments in strict mode. +PASS (function(){(function (){'use strict'; try{}catch(arguments){}})}) threw exception SyntaxError: Catch variable may not be eval or arguments in strict mode. +PASS (function (a, a){'use strict';}) threw exception SyntaxError: Strict mode function may not have duplicate parameter names. +PASS (function(){(function (a, a){'use strict';})}) threw exception SyntaxError: Strict mode function may not have duplicate parameter names. +PASS (function (a){'use strict'; delete a;})() threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS (function(){(function (a){'use strict'; delete a;})()}) threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS (function (){'use strict'; var a; delete a;})() threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS (function(){(function (){'use strict'; var a; delete a;})()}) threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS (function (){var a; function f() {'use strict'; delete a;} })() threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS (function(){(function (){var a; function f() {'use strict'; delete a;} })()}) threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS (function (){'use strict'; with(1){};}) threw exception SyntaxError: Strict mode code may not include a with statement. +PASS (function(){(function (){'use strict'; with(1){};})}) threw exception SyntaxError: Strict mode code may not include a with statement. +PASS (function (){'use strict'; arguments.callee; })() threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +PASS (function (){'use strict'; arguments.caller; })() threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +PASS (function f(){'use strict'; f.arguments; })() threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +PASS (function f(){'use strict'; f.caller; })() threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +PASS (function f(){'use strict'; f.arguments=5; })() threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +PASS (function f(){'use strict'; f.caller=5; })() threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +PASS (function (arg){'use strict'; arguments.callee; })() threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +PASS (function (arg){'use strict'; arguments.caller; })() threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +PASS (function f(arg){'use strict'; f.arguments; })() threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +PASS (function f(arg){'use strict'; f.caller; })() threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +PASS (function f(arg){'use strict'; f.arguments=5; })() threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +PASS (function f(arg){'use strict'; f.caller=5; })() threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +PASS "caller" in function(){"use strict"} is true +PASS (function(){"use strict";}).hasOwnProperty("caller") is true +PASS "arguments" in function(){"use strict"} is true +PASS (function(){"use strict";}).hasOwnProperty("arguments") is true +PASS 'use strict'; (function (){with(1){};}) threw exception SyntaxError: Strict mode code may not include a with statement. +PASS (function(){'use strict'; (function (){with(1){};})}) threw exception SyntaxError: Strict mode code may not include a with statement. +PASS 'use strict'; (function (){var a; delete a;}) threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS (function(){'use strict'; (function (){var a; delete a;})}) threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS 'use strict'; var a; (function (){ delete a;}) threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS (function(){'use strict'; var a; (function (){ delete a;})}) threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS var a; (function (){ 'use strict'; delete a;}) threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS (function(){var a; (function (){ 'use strict'; delete a;})}) threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS 'misc directive'; 'use strict'; with({}){} threw exception SyntaxError: Strict mode code may not include a with statement. +PASS (function(){'misc directive'; 'use strict'; with({}){}}) threw exception SyntaxError: Strict mode code may not include a with statement. +PASS 'use strict'; return threw exception SyntaxError: Illegal return statement. +PASS 'use strict'; break threw exception SyntaxError: Illegal break statement. +PASS (function(){'use strict'; break}) threw exception SyntaxError: Illegal break statement. +PASS 'use strict'; continue threw exception SyntaxError: Illegal continue statement. +PASS (function(){'use strict'; continue}) threw exception SyntaxError: Illegal continue statement. +PASS 'use strict'; for(;;)return threw exception SyntaxError: Illegal return statement. +PASS 'use strict'; for(;;)break missingLabel threw exception SyntaxError: Undefined label 'missingLabel'. +PASS (function(){'use strict'; for(;;)break missingLabel}) threw exception SyntaxError: Undefined label 'missingLabel'. +PASS 'use strict'; for(;;)continue missingLabel threw exception SyntaxError: Undefined label 'missingLabel'. +PASS (function(){'use strict'; for(;;)continue missingLabel}) threw exception SyntaxError: Undefined label 'missingLabel'. +PASS 'use strict'; 007; threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS (function(){'use strict'; 007;}) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS 'use strict'; '\007'; threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS (function(){'use strict'; '\007';}) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS '\007'; 'use strict'; threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS (function(){'\007'; 'use strict';}) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS 'use strict'; delete aDeletableProperty; threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS (function(){'use strict'; delete aDeletableProperty;}) threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS 'use strict'; (function (){ delete someDeclaredGlobal;}) threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS (function(){'use strict'; (function (){ delete someDeclaredGlobal;})}) threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS (function (){ 'use strict'; delete someDeclaredGlobal;}) threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS (function(){(function (){ 'use strict'; delete someDeclaredGlobal;})}) threw exception SyntaxError: Delete of an unqualified identifier in strict mode.. +PASS 'use strict'; if (0) { someGlobal = 'Shouldn\'t be able to assign this.'; }; true; is true +PASS 'use strict'; someGlobal = 'Shouldn\'t be able to assign this.'; threw exception ReferenceError: someGlobal is not defined. +FAIL 'use strict'; (function f(){ f = 'shouldn\'t be able to assign to function expression name'; })() should throw an exception. Was undefined. +PASS 'use strict'; eval('var introducedVariable = "FAIL: variable introduced into containing scope";'); introducedVariable threw exception ReferenceError: introducedVariable is not defined. +PASS 'use strict'; objectWithReadonlyProperty.prop = 'fail' threw exception TypeError: Cannot assign to read only property 'prop' of #. +PASS 'use strict'; delete objectWithReadonlyProperty.prop threw exception TypeError: Cannot delete property 'prop' of #. +PASS 'use strict'; delete objectWithReadonlyProperty[readonlyPropName] threw exception TypeError: Cannot delete property 'prop' of #. +PASS 'use strict'; ++eval threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS (function(){'use strict'; ++eval}) threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS 'use strict'; eval++ threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS (function(){'use strict'; eval++}) threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS 'use strict'; --eval threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS (function(){'use strict'; --eval}) threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS 'use strict'; eval-- threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS (function(){'use strict'; eval--}) threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS 'use strict'; function f() { ++arguments } threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS (function(){'use strict'; function f() { ++arguments }}) threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS 'use strict'; function f() { arguments++ } threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS (function(){'use strict'; function f() { arguments++ }}) threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS 'use strict'; function f() { --arguments } threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS (function(){'use strict'; function f() { --arguments }}) threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS 'use strict'; function f() { arguments-- } threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS (function(){'use strict'; function f() { arguments-- }}) threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS global.eval('"use strict"; if (0) ++arguments; true;') threw exception SyntaxError: Prefix increment/decrement may not have eval or arguments operand in strict mode. +PASS 'use strict'; ++(1, eval) threw exception ReferenceError: Invalid left-hand side expression in prefix operation. +FAIL (function(){'use strict'; ++(1, eval)}) should throw an exception. Was function (){'use strict'; ++(1, eval)}. +PASS 'use strict'; (1, eval)++ threw exception ReferenceError: Invalid left-hand side expression in postfix operation. +FAIL (function(){'use strict'; (1, eval)++}) should throw an exception. Was function (){'use strict'; (1, eval)++}. +PASS 'use strict'; --(1, eval) threw exception ReferenceError: Invalid left-hand side expression in prefix operation. +FAIL (function(){'use strict'; --(1, eval)}) should throw an exception. Was function (){'use strict'; --(1, eval)}. +PASS 'use strict'; (1, eval)-- threw exception ReferenceError: Invalid left-hand side expression in postfix operation. +FAIL (function(){'use strict'; (1, eval)--}) should throw an exception. Was function (){'use strict'; (1, eval)--}. +FAIL 'use strict'; function f() { ++(1, arguments) } should throw an exception. Was use strict. +FAIL (function(){'use strict'; function f() { ++(1, arguments) }}) should throw an exception. Was function (){'use strict'; function f() { ++(1, arguments) }}. +FAIL 'use strict'; function f() { (1, arguments)++ } should throw an exception. Was use strict. +FAIL (function(){'use strict'; function f() { (1, arguments)++ }}) should throw an exception. Was function (){'use strict'; function f() { (1, arguments)++ }}. +FAIL 'use strict'; function f() { --(1, arguments) } should throw an exception. Was use strict. +FAIL (function(){'use strict'; function f() { --(1, arguments) }}) should throw an exception. Was function (){'use strict'; function f() { --(1, arguments) }}. +FAIL 'use strict'; function f() { (1, arguments)-- } should throw an exception. Was use strict. +FAIL (function(){'use strict'; function f() { (1, arguments)-- }}) should throw an exception. Was function (){'use strict'; function f() { (1, arguments)-- }}. +FAIL 'use strict'; if (0) delete +a.b should throw an exception. Was use strict. +FAIL (function(){'use strict'; if (0) delete +a.b}) should throw an exception. Was function (){'use strict'; if (0) delete +a.b}. +FAIL 'use strict'; if (0) delete ++a.b should throw an exception. Was use strict. +FAIL (function(){'use strict'; if (0) delete ++a.b}) should throw an exception. Was function (){'use strict'; if (0) delete ++a.b}. +FAIL 'use strict'; if (0) delete void a.b should throw an exception. Was use strict. +FAIL (function(){'use strict'; if (0) delete void a.b}) should throw an exception. Was function (){'use strict'; if (0) delete void a.b}. +PASS (function (a){'use strict'; a = false; return a !== arguments[0]; })(true) is true +PASS (function (a){'use strict'; arguments[0] = false; return a !== arguments[0]; })(true) is true +PASS (function (a){'use strict'; a=false; return arguments; })(true)[0] is true +PASS (function (a){'use strict'; arguments[0]=false; return a; })(true) is true +PASS (function (a){'use strict'; arguments[0]=true; return arguments; })(false)[0] is true +PASS (function (){'use strict'; arguments[0]=true; return arguments; })(false)[0] is true +PASS (function (a){'use strict'; arguments[0]=true; a=false; return arguments; })()[0] is true +PASS (function (a){'use strict'; arguments[0]=false; a=true; return a; })() is true +PASS (function (a){'use strict'; arguments[0]=true; return arguments; })()[0] is true +PASS (function (){'use strict'; arguments[0]=true; return arguments; })()[0] is true +PASS (function (a){'use strict'; var local; (function (){local;})(); a = false; return a !== arguments[0]; })(true) is true +PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0] = false; return a !== arguments[0]; })(true) is true +PASS (function (a){'use strict'; var local; (function (){local;})(); a=false; return arguments; })(true)[0] is true +PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0]=false; return a; })(true) is true +PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0]=true; return arguments; })(false)[0] is true +PASS (function (){'use strict'; var local; (function (){local;})(); arguments[0]=true; return arguments; })(false)[0] is true +PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0]=true; a=false; return arguments; })()[0] is true +PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0]=true; return arguments; })()[0] is true +PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0]=false; a=true; return a; })() is true +PASS (function (){'use strict'; var local; (function (){local;})(); arguments[0]=true; return arguments; })()[0] is true +PASS 'use strict'; (function (){var a = true; eval('var a = false'); return a; })() is true +PASS (function (){var a = true; eval('"use strict"; var a = false'); return a; })() is true +PASS (function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(f, 'arguments').value; })() is undefined. +PASS (function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(f, 'caller').value; })() is undefined. +PASS (function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(arguments, 'callee').value; })() is undefined. +PASS (function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(arguments, 'caller').value; })() is undefined. +PASS (function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(arguments, 'caller'); return descriptor.get === descriptor.set; })() is true +PASS (function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(arguments, 'callee'); return descriptor.get === descriptor.set; })() is true +PASS (function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(f, 'caller'); return descriptor.get === descriptor.set; })() is true +PASS (function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(f, 'arguments'); return descriptor.get === descriptor.set; })() is true +PASS 'use strict'; (function f() { for(var i in this); })(); true; is true +PASS 'use strict'̻ threw exception SyntaxError: Unexpected token ILLEGAL. +PASS (function(){'use strict'̻}) threw exception SyntaxError: Unexpected token ILLEGAL. +PASS 'use strict'5.f threw exception SyntaxError: Unexpected token ILLEGAL. +PASS (function(){'use strict'5.f}) threw exception SyntaxError: Unexpected token ILLEGAL. +PASS 'use strict';̻ threw exception SyntaxError: Unexpected token ILLEGAL. +PASS (function(){'use strict';̻}) threw exception SyntaxError: Unexpected token ILLEGAL. +PASS 'use strict';5.f threw exception SyntaxError: Unexpected token ILLEGAL. +PASS (function(){'use strict';5.f}) threw exception SyntaxError: Unexpected token ILLEGAL. +PASS 'use strict';1-(eval=1); threw exception SyntaxError: Assignment to eval or arguments is not allowed in strict mode. +PASS (function(){'use strict';1-(eval=1);}) threw exception SyntaxError: Assignment to eval or arguments is not allowed in strict mode. +PASS 'use strict';arguments=1; threw exception SyntaxError: Assignment to eval or arguments is not allowed in strict mode. +PASS (function(){'use strict';arguments=1;}) threw exception SyntaxError: Assignment to eval or arguments is not allowed in strict mode. +PASS 'use strict';1-(arguments=1); threw exception SyntaxError: Assignment to eval or arguments is not allowed in strict mode. +PASS (function(){'use strict';1-(arguments=1);}) threw exception SyntaxError: Assignment to eval or arguments is not allowed in strict mode. +PASS 'use strict';var a=(eval=1); threw exception SyntaxError: Assignment to eval or arguments is not allowed in strict mode. +PASS (function(){'use strict';var a=(eval=1);}) threw exception SyntaxError: Assignment to eval or arguments is not allowed in strict mode. +PASS 'use strict';var a=(arguments=1); threw exception SyntaxError: Assignment to eval or arguments is not allowed in strict mode. +PASS (function(){'use strict';var a=(arguments=1);}) threw exception SyntaxError: Assignment to eval or arguments is not allowed in strict mode. +PASS 'use strict'; try { throw 1; } catch (e) { aGlobal = true; } is true +PASS 'use strict'; (function () { try { throw 1; } catch (e) { aGlobal = true; }})(); aGlobal; is true +PASS (function () {'use strict'; try { throw 1; } catch (e) { aGlobal = true; }})(); aGlobal; is true +PASS try { throw 1; } catch (e) { aGlobal = true; } is true +PASS (function () { try { throw 1; } catch (e) { aGlobal = true; }})(); aGlobal; is true +PASS (function () {try { throw 1; } catch (e) { aGlobal = true; }})(); aGlobal; is true +FAIL String(Object.getOwnPropertyDescriptor(function() { "use strict"; }, "caller").get) should be function () { + [native code] +}. Was function ThrowTypeError() { [native code] }. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/basic-strict-mode.js b/deps/v8/test/webkit/fast/js/basic-strict-mode.js new file mode 100644 index 0000000..f34b14e --- /dev/null +++ b/deps/v8/test/webkit/fast/js/basic-strict-mode.js @@ -0,0 +1,231 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description("Test behaviour of strict mode"); + +var globalThisTest; +function testThis() { + "use strict"; + return this; +} +function testThisDotAccess() { + "use strict"; + return this.length; +} +function testThisBracketAccess(prop) { + "use strict"; + return this[prop]; +} +function testGlobalAccess() { + return testThis(); +} +function shouldBeSyntaxError(str) { + shouldThrow(str); + shouldThrow("(function(){" + str + "})"); +} +function testLineContinuation() { + "use stric\ +t"; + return this; +} +function testEscapeSequence() { + "use\u0020strict"; + return this; +} + +shouldBe("testThis.call(null)", "null"); +shouldBe("testThis.call(1)", "1"); +shouldBe("testThis.call(true)", "true"); +shouldBe("testThis.call(false)", "false"); +shouldBe("testThis.call(undefined)", "undefined"); +shouldBeFalse("testLineContinuation.call(undefined) === undefined"); +shouldBeFalse("testEscapeSequence.call(undefined) === undefined"); +shouldBe("testThis.call('a string')", "'a string'"); +shouldBe("testThisDotAccess.call('a string')", "'a string'.length"); +shouldThrow("testThisDotAccess.call(null)"); +shouldThrow("testThisDotAccess.call(undefined)"); +shouldBeUndefined("testThisDotAccess.call(true)"); +shouldBeUndefined("testThisDotAccess.call(false)"); +shouldBeUndefined("testThisDotAccess.call(1)"); +shouldBe("testThisBracketAccess.call('a string', 'length')", "'a string'.length"); +shouldThrow("testThisBracketAccess.call(null, 'length')"); +shouldThrow("testThisBracketAccess.call(undefined, 'length')"); +shouldBeUndefined("testThisBracketAccess.call(true, 'length')"); +shouldBeUndefined("testThisBracketAccess.call(false, 'length')"); +shouldBeUndefined("testThisBracketAccess.call(1, 'length')"); +shouldBeUndefined("Function('\"use strict\"; return this;')()"); +shouldThrow("Function('\"use strict\"; with({});')"); + + +shouldBe("testGlobalAccess()", "undefined"); +shouldBe("testThis.call()", "undefined"); +shouldBe("testThis.apply()", "undefined"); +shouldBe("testThis.call(undefined)", "undefined"); +shouldBe("testThis.apply(undefined)", "undefined"); + +shouldBeSyntaxError("(function eval(){'use strict';})"); +shouldBeSyntaxError("(function (eval){'use strict';})"); +shouldBeSyntaxError("(function arguments(){'use strict';})"); +shouldBeSyntaxError("(function (arguments){'use strict';})"); +shouldBeSyntaxError("(function (){'use strict'; var eval;})"); +shouldBeSyntaxError("(function (){'use strict'; var arguments;})"); +shouldBeSyntaxError("(function (){'use strict'; try{}catch(eval){}})"); +shouldBeSyntaxError("(function (){'use strict'; try{}catch(arguments){}})"); +shouldBeSyntaxError("(function (a, a){'use strict';})"); +shouldBeSyntaxError("(function (a){'use strict'; delete a;})()"); +shouldBeSyntaxError("(function (){'use strict'; var a; delete a;})()"); +shouldBeSyntaxError("(function (){var a; function f() {'use strict'; delete a;} })()"); +shouldBeSyntaxError("(function (){'use strict'; with(1){};})"); +shouldThrow("(function (){'use strict'; arguments.callee; })()"); +shouldThrow("(function (){'use strict'; arguments.caller; })()"); +shouldThrow("(function f(){'use strict'; f.arguments; })()"); +shouldThrow("(function f(){'use strict'; f.caller; })()"); +shouldThrow("(function f(){'use strict'; f.arguments=5; })()"); +shouldThrow("(function f(){'use strict'; f.caller=5; })()"); +shouldThrow("(function (arg){'use strict'; arguments.callee; })()"); +shouldThrow("(function (arg){'use strict'; arguments.caller; })()"); +shouldThrow("(function f(arg){'use strict'; f.arguments; })()"); +shouldThrow("(function f(arg){'use strict'; f.caller; })()"); +shouldThrow("(function f(arg){'use strict'; f.arguments=5; })()"); +shouldThrow("(function f(arg){'use strict'; f.caller=5; })()"); + +// arguments/caller poisoning should be visible but not throw with 'in' & 'hasOwnProperty'. +shouldBeTrue('"caller" in function(){"use strict"}'); +shouldBeTrue('(function(){"use strict";}).hasOwnProperty("caller")'); +shouldBeTrue('"arguments" in function(){"use strict"}'); +shouldBeTrue('(function(){"use strict";}).hasOwnProperty("arguments")'); + +shouldBeSyntaxError("'use strict'; (function (){with(1){};})"); +shouldBeSyntaxError("'use strict'; (function (){var a; delete a;})"); +shouldBeSyntaxError("'use strict'; var a; (function (){ delete a;})"); +shouldBeSyntaxError("var a; (function (){ 'use strict'; delete a;})"); +shouldBeSyntaxError("'misc directive'; 'use strict'; with({}){}"); +shouldThrow("'use strict'; return"); +shouldBeSyntaxError("'use strict'; break"); +shouldBeSyntaxError("'use strict'; continue"); +shouldThrow("'use strict'; for(;;)return"); +shouldBeSyntaxError("'use strict'; for(;;)break missingLabel"); +shouldBeSyntaxError("'use strict'; for(;;)continue missingLabel"); +shouldBeSyntaxError("'use strict'; 007;"); +shouldBeSyntaxError("'use strict'; '\\007';"); +shouldBeSyntaxError("'\\007'; 'use strict';"); + +var someDeclaredGlobal; +aDeletableProperty = 'test'; + +shouldBeSyntaxError("'use strict'; delete aDeletableProperty;"); +shouldBeSyntaxError("'use strict'; (function (){ delete someDeclaredGlobal;})"); +shouldBeSyntaxError("(function (){ 'use strict'; delete someDeclaredGlobal;})"); +shouldBeTrue("'use strict'; if (0) { someGlobal = 'Shouldn\\'t be able to assign this.'; }; true;"); +shouldThrow("'use strict'; someGlobal = 'Shouldn\\'t be able to assign this.'; "); +shouldThrow("'use strict'; (function f(){ f = 'shouldn\\'t be able to assign to function expression name'; })()"); +shouldThrow("'use strict'; eval('var introducedVariable = \"FAIL: variable introduced into containing scope\";'); introducedVariable"); +var objectWithReadonlyProperty = {}; +Object.defineProperty(objectWithReadonlyProperty, "prop", {value: "value", writable:false}); +shouldThrow("'use strict'; objectWithReadonlyProperty.prop = 'fail'"); +shouldThrow("'use strict'; delete objectWithReadonlyProperty.prop"); +readonlyPropName = "prop"; +shouldThrow("'use strict'; delete objectWithReadonlyProperty[readonlyPropName]"); +shouldBeSyntaxError("'use strict'; ++eval"); +shouldBeSyntaxError("'use strict'; eval++"); +shouldBeSyntaxError("'use strict'; --eval"); +shouldBeSyntaxError("'use strict'; eval--"); +shouldBeSyntaxError("'use strict'; function f() { ++arguments }"); +shouldBeSyntaxError("'use strict'; function f() { arguments++ }"); +shouldBeSyntaxError("'use strict'; function f() { --arguments }"); +shouldBeSyntaxError("'use strict'; function f() { arguments-- }"); +var global = this; +shouldThrow("global.eval('\"use strict\"; if (0) ++arguments; true;')"); +shouldBeSyntaxError("'use strict'; ++(1, eval)"); +shouldBeSyntaxError("'use strict'; (1, eval)++"); +shouldBeSyntaxError("'use strict'; --(1, eval)"); +shouldBeSyntaxError("'use strict'; (1, eval)--"); +shouldBeSyntaxError("'use strict'; function f() { ++(1, arguments) }"); +shouldBeSyntaxError("'use strict'; function f() { (1, arguments)++ }"); +shouldBeSyntaxError("'use strict'; function f() { --(1, arguments) }"); +shouldBeSyntaxError("'use strict'; function f() { (1, arguments)-- }"); +shouldBeSyntaxError("'use strict'; if (0) delete +a.b"); +shouldBeSyntaxError("'use strict'; if (0) delete ++a.b"); +shouldBeSyntaxError("'use strict'; if (0) delete void a.b"); + +shouldBeTrue("(function (a){'use strict'; a = false; return a !== arguments[0]; })(true)"); +shouldBeTrue("(function (a){'use strict'; arguments[0] = false; return a !== arguments[0]; })(true)"); +shouldBeTrue("(function (a){'use strict'; a=false; return arguments; })(true)[0]"); +shouldBeTrue("(function (a){'use strict'; arguments[0]=false; return a; })(true)"); +shouldBeTrue("(function (a){'use strict'; arguments[0]=true; return arguments; })(false)[0]"); +shouldBeTrue("(function (){'use strict'; arguments[0]=true; return arguments; })(false)[0]"); +shouldBeTrue("(function (a){'use strict'; arguments[0]=true; a=false; return arguments; })()[0]"); +shouldBeTrue("(function (a){'use strict'; arguments[0]=false; a=true; return a; })()"); +shouldBeTrue("(function (a){'use strict'; arguments[0]=true; return arguments; })()[0]"); +shouldBeTrue("(function (){'use strict'; arguments[0]=true; return arguments; })()[0]"); + +// Same tests again, this time forcing an activation to be created as well +shouldBeTrue("(function (a){'use strict'; var local; (function (){local;})(); a = false; return a !== arguments[0]; })(true)"); +shouldBeTrue("(function (a){'use strict'; var local; (function (){local;})(); arguments[0] = false; return a !== arguments[0]; })(true)"); +shouldBeTrue("(function (a){'use strict'; var local; (function (){local;})(); a=false; return arguments; })(true)[0]"); +shouldBeTrue("(function (a){'use strict'; var local; (function (){local;})(); arguments[0]=false; return a; })(true)"); +shouldBeTrue("(function (a){'use strict'; var local; (function (){local;})(); arguments[0]=true; return arguments; })(false)[0]"); +shouldBeTrue("(function (){'use strict'; var local; (function (){local;})(); arguments[0]=true; return arguments; })(false)[0]"); +shouldBeTrue("(function (a){'use strict'; var local; (function (){local;})(); arguments[0]=true; a=false; return arguments; })()[0]"); +shouldBeTrue("(function (a){'use strict'; var local; (function (){local;})(); arguments[0]=true; return arguments; })()[0]"); +shouldBeTrue("(function (a){'use strict'; var local; (function (){local;})(); arguments[0]=false; a=true; return a; })()"); +shouldBeTrue("(function (){'use strict'; var local; (function (){local;})(); arguments[0]=true; return arguments; })()[0]"); + +shouldBeTrue("'use strict'; (function (){var a = true; eval('var a = false'); return a; })()"); +shouldBeTrue("(function (){var a = true; eval('\"use strict\"; var a = false'); return a; })()"); + +shouldBeUndefined("(function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(f, 'arguments').value; })()"); +shouldBeUndefined("(function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(f, 'caller').value; })()"); +shouldBeUndefined("(function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(arguments, 'callee').value; })()"); +shouldBeUndefined("(function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(arguments, 'caller').value; })()"); +shouldBeTrue("(function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(arguments, 'caller'); return descriptor.get === descriptor.set; })()"); +shouldBeTrue("(function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(arguments, 'callee'); return descriptor.get === descriptor.set; })()"); +shouldBeTrue("(function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(f, 'caller'); return descriptor.get === descriptor.set; })()"); +shouldBeTrue("(function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(f, 'arguments'); return descriptor.get === descriptor.set; })()"); +shouldBeTrue("'use strict'; (function f() { for(var i in this); })(); true;") + +shouldBeSyntaxError("'use strict'\u033b"); +shouldBeSyntaxError("'use strict'5.f"); +shouldBeSyntaxError("'use strict';\u033b"); +shouldBeSyntaxError("'use strict';5.f"); +shouldBeSyntaxError("'use strict';1-(eval=1);"); +shouldBeSyntaxError("'use strict';arguments=1;"); +shouldBeSyntaxError("'use strict';1-(arguments=1);"); +shouldBeSyntaxError("'use strict';var a=(eval=1);"); +shouldBeSyntaxError("'use strict';var a=(arguments=1);"); + +var aGlobal = false; +shouldBeTrue("'use strict'; try { throw 1; } catch (e) { aGlobal = true; }"); +aGlobal = false; +shouldBeTrue("'use strict'; (function () { try { throw 1; } catch (e) { aGlobal = true; }})(); aGlobal;"); +aGlobal = false; +shouldBeTrue("(function () {'use strict'; try { throw 1; } catch (e) { aGlobal = true; }})(); aGlobal;"); +aGlobal = false; +shouldBeTrue("try { throw 1; } catch (e) { aGlobal = true; }"); +aGlobal = false; +shouldBeTrue("(function () { try { throw 1; } catch (e) { aGlobal = true; }})(); aGlobal;"); +aGlobal = false; +shouldBeTrue("(function () {try { throw 1; } catch (e) { aGlobal = true; }})(); aGlobal;"); + +// Make sure this doesn't crash! +shouldBe('String(Object.getOwnPropertyDescriptor(function() { "use strict"; }, "caller").get)', "'function () {\\n [native code]\\n}'"); diff --git a/deps/v8/test/webkit/fast/js/caller-property-expected.txt b/deps/v8/test/webkit/fast/js/caller-property-expected.txt new file mode 100644 index 0000000..a5d4dd2 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/caller-property-expected.txt @@ -0,0 +1,51 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This tests for caller property in functions. Only functions that are called from inside of other functions and have a parent should have this property set. Tests return true when caller is found and false when the caller is null. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS childHasCallerWhenExecutingGlobalCode is false +PASS childHasCallerWhenCalledWithoutParent is false +PASS childHasCallerWhenCalledFromWithinParent is true +PASS nonStrictCaller(nonStrictCallee) is nonStrictCaller +FAIL nonStrictCaller(strictCallee) should throw TypeError: Type error. Threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +FAIL strictCaller(nonStrictCallee) should throw TypeError: Function.caller used to retrieve strict caller. Was null. +FAIL strictCaller(strictCallee) should throw TypeError: Type error. Threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +PASS nonStrictCaller(boundNonStrictCallee) is nonStrictCaller +FAIL nonStrictCaller(boundStrictCallee) should throw TypeError: Type error. Threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +FAIL strictCaller(boundNonStrictCallee) should throw TypeError: Function.caller used to retrieve strict caller. Was null. +FAIL strictCaller(boundStrictCallee) should throw TypeError: Type error. Threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +PASS nonStrictGetter(nonStrictAccessor) is nonStrictGetter +PASS nonStrictSetter(nonStrictAccessor) is true +FAIL nonStrictGetter(strictAccessor) should throw TypeError: Type error. Threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +FAIL nonStrictSetter(strictAccessor) should throw TypeError: Type error. Threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +FAIL strictGetter(nonStrictAccessor) should throw TypeError: Function.caller used to retrieve strict caller. Was null. +FAIL strictSetter(nonStrictAccessor) should throw TypeError: Function.caller used to retrieve strict caller. Was undefined. +FAIL strictGetter(strictAccessor) should throw TypeError: Type error. Threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +FAIL strictSetter(strictAccessor) should throw TypeError: Type error. Threw exception TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/caller-property.js b/deps/v8/test/webkit/fast/js/caller-property.js new file mode 100644 index 0000000..d28ccf8 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/caller-property.js @@ -0,0 +1,85 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'This tests for caller property in functions. Only functions that are called from inside of other functions and have a parent should have this property set. Tests return true when caller is found and false when the caller is null.' +) +function child() +{ + return (child.caller !== null); +} + +function parent() +{ + return child(); +} + +var childHasCallerWhenExecutingGlobalCode = (child.caller !== null); +var childHasCallerWhenCalledWithoutParent = child(); +var childHasCallerWhenCalledFromWithinParent = parent(); + +shouldBe('childHasCallerWhenExecutingGlobalCode', 'false'); +shouldBe('childHasCallerWhenCalledWithoutParent', 'false'); +shouldBe('childHasCallerWhenCalledFromWithinParent', 'true') + +// The caller property should throw in strict mode, and a non-strict function cannot use caller to reach a strict caller (see ES5.1 15.3.5.4). +function nonStrictCallee() { return nonStrictCallee.caller; } +function strictCallee() { "use strict"; return strictCallee.caller; } +function nonStrictCaller(x) { return x(); } +function strictCaller(x) { "use strict"; return x(); } +shouldBe("nonStrictCaller(nonStrictCallee)", "nonStrictCaller"); +shouldThrow("nonStrictCaller(strictCallee)", '"TypeError: Type error"'); +shouldThrow("strictCaller(nonStrictCallee)", '"TypeError: Function.caller used to retrieve strict caller"'); +shouldThrow("strictCaller(strictCallee)", '"TypeError: Type error"'); + +// .caller within a bound function reaches the caller, ignoring the binding. +var boundNonStrictCallee = nonStrictCallee.bind(); +var boundStrictCallee = strictCallee.bind(); +shouldBe("nonStrictCaller(boundNonStrictCallee)", "nonStrictCaller"); +shouldThrow("nonStrictCaller(boundStrictCallee)", '"TypeError: Type error"'); +shouldThrow("strictCaller(boundNonStrictCallee)", '"TypeError: Function.caller used to retrieve strict caller"'); +shouldThrow("strictCaller(boundStrictCallee)", '"TypeError: Type error"'); + +// Check that .caller works (or throws) as expected, over an accessor call. +function getFooGetter(x) { return Object.getOwnPropertyDescriptor(x, 'foo').get; } +function getFooSetter(x) { return Object.getOwnPropertyDescriptor(x, 'foo').set; } +var nonStrictAccessor = { + get foo() { return getFooGetter(nonStrictAccessor).caller; }, + set foo(x) { if (getFooSetter(nonStrictAccessor).caller !==x) throw false; } +}; +var strictAccessor = { + get foo() { "use strict"; return getFooGetter(strictAccessor).caller; }, + set foo(x) { "use strict"; if (getFooSetter(strictAccessor).caller !==x) throw false; } +}; +function nonStrictGetter(x) { return x.foo; } +function nonStrictSetter(x) { x.foo = nonStrictSetter; return true; } +function strictGetter(x) { "use strict"; return x.foo; } +function strictSetter(x) { "use strict"; x.foo = nonStrictSetter; return true; } +shouldBe("nonStrictGetter(nonStrictAccessor)", "nonStrictGetter"); +shouldBeTrue("nonStrictSetter(nonStrictAccessor)"); +shouldThrow("nonStrictGetter(strictAccessor)", '"TypeError: Type error"'); +shouldThrow("nonStrictSetter(strictAccessor)", '"TypeError: Type error"'); +shouldThrow("strictGetter(nonStrictAccessor)", '"TypeError: Function.caller used to retrieve strict caller"'); +shouldThrow("strictSetter(nonStrictAccessor)", '"TypeError: Function.caller used to retrieve strict caller"'); +shouldThrow("strictGetter(strictAccessor)", '"TypeError: Type error"'); +shouldThrow("strictSetter(strictAccessor)", '"TypeError: Type error"'); diff --git a/deps/v8/test/webkit/fast/js/date-big-setmonth-expected.txt b/deps/v8/test/webkit/fast/js/date-big-setmonth-expected.txt new file mode 100644 index 0000000..6132d7a --- /dev/null +++ b/deps/v8/test/webkit/fast/js/date-big-setmonth-expected.txt @@ -0,0 +1,33 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks for a regression against Date.setMonth fails with big values due to overflow. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS d.valueOf() is new Date(1980, 8, 1).valueOf() +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/date-big-setmonth.js b/deps/v8/test/webkit/fast/js/date-big-setmonth.js new file mode 100644 index 0000000..c985bae --- /dev/null +++ b/deps/v8/test/webkit/fast/js/date-big-setmonth.js @@ -0,0 +1,30 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'This test checks for a regression against Date.setMonth fails with big values due to overflow.' +); + +var d = new Date(1970, 0, 1); +d.setMonth(128); +shouldBe("d.valueOf()", "new Date(1980, 8, 1).valueOf()"); diff --git a/deps/v8/test/webkit/fast/js/date-negative-setmonth-expected.txt b/deps/v8/test/webkit/fast/js/date-negative-setmonth-expected.txt new file mode 100644 index 0000000..2a01eba --- /dev/null +++ b/deps/v8/test/webkit/fast/js/date-negative-setmonth-expected.txt @@ -0,0 +1,33 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks for a regression against Date.setMonth fails with negative values. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS d.valueOf() is new Date(2004, 9, 15).valueOf() +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/date-negative-setmonth.js b/deps/v8/test/webkit/fast/js/date-negative-setmonth.js new file mode 100644 index 0000000..8fcd73d --- /dev/null +++ b/deps/v8/test/webkit/fast/js/date-negative-setmonth.js @@ -0,0 +1,30 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'This test checks for a regression against Date.setMonth fails with negative values.' +); + +var d = new Date(2005, 6, 15); +d.setMonth(-3); +shouldBe("d.valueOf()", "new Date(2004, 9, 15).valueOf()"); diff --git a/deps/v8/test/webkit/fast/js/date-preserve-milliseconds-expected.txt b/deps/v8/test/webkit/fast/js/date-preserve-milliseconds-expected.txt new file mode 100644 index 0000000..8830485 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/date-preserve-milliseconds-expected.txt @@ -0,0 +1,38 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The following test checks if an existing milliseconds value gets preserved if a call to setHours(), setMinutes() or setSeconds() does not specify the milliseconds. See https://bugs.webkit.org/show_bug.cgi?id=3759 + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS d.getMilliseconds() is 1 +PASS d.getMilliseconds() is 1 +PASS d.getMilliseconds() is 1 +PASS d.getMilliseconds() is 1 +PASS d.getMilliseconds() is 1 +PASS d.getMilliseconds() is 1 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/date-preserve-milliseconds.js b/deps/v8/test/webkit/fast/js/date-preserve-milliseconds.js new file mode 100644 index 0000000..4608bfc --- /dev/null +++ b/deps/v8/test/webkit/fast/js/date-preserve-milliseconds.js @@ -0,0 +1,44 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'The following test checks if an existing milliseconds value gets preserved if a call to setHours(), setMinutes() or setSeconds() does not specify the milliseconds. See https://bugs.webkit.org/show_bug.cgi?id=3759' +); + +var d = new Date(0); +d.setMilliseconds(1); + +var oldValue = d.getMilliseconds(); + +d.setHours(8); +shouldBe("d.getMilliseconds()", oldValue.toString()); +d.setHours(8, 30); +shouldBe("d.getMilliseconds()", oldValue.toString()); +d.setHours(8, 30, 40); +shouldBe("d.getMilliseconds()", oldValue.toString()); +d.setMinutes(45); +shouldBe("d.getMilliseconds()", oldValue.toString()); +d.setMinutes(45, 40); +shouldBe("d.getMilliseconds()", oldValue.toString()); +d.setSeconds(50); +shouldBe("d.getMilliseconds()", oldValue.toString()); diff --git a/deps/v8/test/webkit/fast/js/date-toisostring-expected.txt b/deps/v8/test/webkit/fast/js/date-toisostring-expected.txt new file mode 100644 index 0000000..865090a --- /dev/null +++ b/deps/v8/test/webkit/fast/js/date-toisostring-expected.txt @@ -0,0 +1,43 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Tests for Date.toISOString + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS Date.toISOString.call({}) threw exception TypeError: Cannot call method 'call' of undefined. +PASS Date.toISOString.call(0) threw exception TypeError: Cannot call method 'call' of undefined. +PASS new Date(-400).toISOString() is '1969-12-31T23:59:59.600Z' +PASS new Date(0).toISOString() is '1970-01-01T00:00:00.000Z' +PASS new Date('1 January 1500 UTC').toISOString() is '1500-01-01T00:00:00.000Z' +PASS new Date('1 January 2000 UTC').toISOString() is '2000-01-01T00:00:00.000Z' +PASS new Date('1 January 4000 UTC').toISOString() is '4000-01-01T00:00:00.000Z' +PASS new Date('1 January 100000 UTC').toISOString() is '+100000-01-01T00:00:00.000Z' +FAIL new Date('1 January -1 UTC').toISOString() should be -000001-01-01T00:00:00.000Z. Threw exception RangeError: Invalid time value +PASS new Date('10 March 2000 UTC').toISOString() is '2000-03-10T00:00:00.000Z' +PASS throwsRangeError("new Date(NaN).toISOString()") is true +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/date-toisostring.js b/deps/v8/test/webkit/fast/js/date-toisostring.js new file mode 100644 index 0000000..2515b14 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/date-toisostring.js @@ -0,0 +1,47 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description("Tests for Date.toISOString"); + +function throwsRangeError(str) +{ + try { + eval(str); + } catch (e) { + return e instanceof RangeError; + } + return false; +} + +shouldThrow("Date.toISOString.call({})"); +shouldThrow("Date.toISOString.call(0)"); + +shouldBe("new Date(-400).toISOString()", "'1969-12-31T23:59:59.600Z'"); +shouldBe("new Date(0).toISOString()", "'1970-01-01T00:00:00.000Z'"); +shouldBe("new Date('1 January 1500 UTC').toISOString()", "'1500-01-01T00:00:00.000Z'"); +shouldBe("new Date('1 January 2000 UTC').toISOString()", "'2000-01-01T00:00:00.000Z'"); +shouldBe("new Date('1 January 4000 UTC').toISOString()", "'4000-01-01T00:00:00.000Z'"); +shouldBe("new Date('1 January 100000 UTC').toISOString()", "'+100000-01-01T00:00:00.000Z'"); +shouldBe("new Date('1 January -1 UTC').toISOString()", "'-000001-01-01T00:00:00.000Z'"); +shouldBe("new Date('10 March 2000 UTC').toISOString()", "'2000-03-10T00:00:00.000Z'"); +shouldBeTrue('throwsRangeError("new Date(NaN).toISOString()")'); diff --git a/deps/v8/test/webkit/fast/js/end-in-string-escape-expected.txt b/deps/v8/test/webkit/fast/js/end-in-string-escape-expected.txt new file mode 100644 index 0000000..2ccc90d --- /dev/null +++ b/deps/v8/test/webkit/fast/js/end-in-string-escape-expected.txt @@ -0,0 +1,33 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test for bug 33641: Assertion failure in Lexer.cpp if input stream ends while in string escape. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +Passed if no assertion failure. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/end-in-string-escape.js b/deps/v8/test/webkit/fast/js/end-in-string-escape.js new file mode 100644 index 0000000..e5c0906 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/end-in-string-escape.js @@ -0,0 +1,31 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description('Test for bug 33641: Assertion failure in Lexer.cpp if input stream ends while in string escape.'); + +debug("Passed if no assertion failure."); + +try { + eval('"\\'); +} catch (ex) { +} diff --git a/deps/v8/test/webkit/fast/js/exception-properties-expected.txt b/deps/v8/test/webkit/fast/js/exception-properties-expected.txt new file mode 100644 index 0000000..f9ce634 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/exception-properties-expected.txt @@ -0,0 +1,36 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test for correct properties on Error objects. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS enumerableProperties(error) is [] +FAIL enumerableProperties(nativeError) should be stack,line,sourceURL. Was . +PASS Object.getPrototypeOf(nativeError).name is "RangeError" +PASS Object.getPrototypeOf(nativeError).message is "" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/exception-properties.js b/deps/v8/test/webkit/fast/js/exception-properties.js new file mode 100644 index 0000000..0bbbe76 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/exception-properties.js @@ -0,0 +1,46 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description("Test for correct properties on Error objects."); + +function enumerableProperties(object) +{ + var result = []; + for (var i in object) + result.push(i); + return result; +} + +try { + // generate a RangeError. + [].length = -1; +} catch (rangeError) { + var nativeError = rangeError; + var error = new Error("message"); + + shouldBe('enumerableProperties(error)', '[]'); + shouldBe('enumerableProperties(nativeError)', '["stack", "line", "sourceURL"]'); + + shouldBe('Object.getPrototypeOf(nativeError).name', '"RangeError"'); + shouldBe('Object.getPrototypeOf(nativeError).message', '""'); +} diff --git a/deps/v8/test/webkit/fast/js/exception-registerfile-shrink-expected.txt b/deps/v8/test/webkit/fast/js/exception-registerfile-shrink-expected.txt new file mode 100644 index 0000000..45bec8b --- /dev/null +++ b/deps/v8/test/webkit/fast/js/exception-registerfile-shrink-expected.txt @@ -0,0 +1,32 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test for REGRESSION(r60392): Registerfile can be unwound too far following an exception. If the test doesn't crash, you pass. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/exception-registerfile-shrink.js b/deps/v8/test/webkit/fast/js/exception-registerfile-shrink.js new file mode 100644 index 0000000..d534db3 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/exception-registerfile-shrink.js @@ -0,0 +1,31 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"Test for REGRESSION(r60392): Registerfile can be unwound too far following an exception. If the test doesn't crash, you pass." +); + +eval('try { throw 0; } catch(e) {}'); + +var x = new String(); +'' + escape(x.substring(0, 1)); diff --git a/deps/v8/test/webkit/fast/js/excessive-comma-usage-expected.txt b/deps/v8/test/webkit/fast/js/excessive-comma-usage-expected.txt new file mode 100644 index 0000000..2460768 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/excessive-comma-usage-expected.txt @@ -0,0 +1,35 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test that we can handle excessively large initializer lists + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS new Function(initializerTestString)() is true +PASS new Function(declarationTestString)() is true +FAIL new Function(commaExpressionTestString)() should be true. Threw exception RangeError: Maximum call stack size exceeded +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/excessive-comma-usage.js b/deps/v8/test/webkit/fast/js/excessive-comma-usage.js new file mode 100644 index 0000000..d30ff6d --- /dev/null +++ b/deps/v8/test/webkit/fast/js/excessive-comma-usage.js @@ -0,0 +1,43 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description("Test that we can handle excessively large initializer lists"); + +var initializerTestString = "var a=0"; +for (var i = 0; i < 50000; i++) + initializerTestString += ",a"+i+"="+i; +initializerTestString += ";return true;"; + +var declarationTestString = "var a"; +for (var i = 0; i < 50000; i++) + declarationTestString += ",a"+i; +declarationTestString += ";return true;"; + +var commaExpressionTestString = "1"; +for (var i = 0; i < 50000; i++) + commaExpressionTestString += ",1"; +commaExpressionTestString += ";return true;"; + +shouldBeTrue("new Function(initializerTestString)()"); +shouldBeTrue("new Function(declarationTestString)()"); +shouldBeTrue("new Function(commaExpressionTestString)()"); diff --git a/deps/v8/test/webkit/fast/js/function-apply-expected.txt b/deps/v8/test/webkit/fast/js/function-apply-expected.txt new file mode 100644 index 0000000..5762037 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/function-apply-expected.txt @@ -0,0 +1,66 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Tests to ensure that Function.apply works correctly for Arrays, arguments and array-like objects. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS argumentsApply1(1, 2, 3) is 1 +PASS argumentsApply2(1, 2, 3) is 2 +PASS argumentsApply3(1, 2, 3) is 3 +PASS argumentsApplyLength(1, 2, 3) is 3 +PASS argumentsApplyExcessArguments(1, 2, 3) is 3 +PASS executedAdditionalArgument is true +PASS arrayApply1([1, 2, 3]) is 1 +PASS arrayApply2([1, 2, 3]) is 2 +PASS arrayApply3([1, 2, 3]) is 3 +PASS arrayApplyLength([1, 2, 3]) is 3 +PASS argumentsApplyDelete1(1, 2, 3) is 1 +PASS argumentsApplyDelete2(1, 2, 3) is undefined +PASS argumentsApplyDelete3(1, 2, 3) is 3 +PASS argumentsApplyDeleteLength(1, 2, 3) is 3 +PASS arrayApplyDelete1([1, 2, 3]) is 1 +PASS arrayApplyDelete2([1, 2, 3]) is undefined +PASS arrayApplyDelete3([1, 2, 3]) is 3 +PASS arrayApplyDeleteLength([1, 2, 3]) is 3 +PASS argumentsApplyChangeLength1(1) is 2 +PASS argumentsApplyChangeLength2(1) is 2 +PASS argumentsApplyChangeLength3(1) is 2 +PASS argumentsApplyChangeLength4(1) is 0 +PASS argumentsApplyChangeLength5(1) is 0 +PASS arrayApplyChangeLength1() is 2 +PASS arrayApplyChangeLength2() is 2 +PASS arrayApplyChangeLength3() is 2 +PASS arrayApplyChangeLength4() is 0 +PASS var a = []; a.length = 0xFFFE; [].constructor.apply('', a).length is 0xFFFE +PASS var a = []; a.length = 0xFFFF; [].constructor.apply('', a).length is 0xFFFF +PASS var a = []; a.length = 0x10000; [].constructor.apply('', a).length is 0x10000 +FAIL var a = []; a.length = 0x10001; [].constructor.apply('', a).length should throw an exception. Was 65537. +PASS var a = []; a.length = 0xFFFFFFFE; [].constructor.apply('', a).length threw exception RangeError: Maximum call stack size exceeded. +PASS var a = []; a.length = 0xFFFFFFFF; [].constructor.apply('', a).length threw exception RangeError: Maximum call stack size exceeded. +PASS (function(a,b,c,d){ return d ? -1 : (a+b+c); }).apply(undefined, {length:3, 0:100, 1:20, 2:3}) is 123 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/function-apply.js b/deps/v8/test/webkit/fast/js/function-apply.js new file mode 100644 index 0000000..537dc24 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/function-apply.js @@ -0,0 +1,318 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description('Tests to ensure that Function.apply works correctly for Arrays, arguments and array-like objects.'); + +function argumentsApply1(a, b, c) +{ + function t(a, b, c) + { + return a; + } + return t.apply(null, arguments); +} + +function argumentsApply2(a, b, c) +{ + function t(a, b, c) + { + return b; + } + return t.apply(null, arguments); +} + +function argumentsApply3(a, b, c) +{ + function t(a, b, c) + { + return c; + } + return t.apply(null, arguments); +} + +function argumentsApplyLength(a, b, c) +{ + function t(a, b, c) + { + return arguments.length; + } + return t.apply(null, arguments); +} +var executedAdditionalArgument = false; +function argumentsApplyExcessArguments(a, b, c) +{ + function t(a, b, c) + { + return arguments.length; + } + return t.apply(null, arguments, executedAdditionalArgument = true); +} + +shouldBe("argumentsApply1(1, 2, 3)", "1"); +shouldBe("argumentsApply2(1, 2, 3)", "2"); +shouldBe("argumentsApply3(1, 2, 3)", "3"); +shouldBe("argumentsApplyLength(1, 2, 3)", "3"); +shouldBe("argumentsApplyExcessArguments(1, 2, 3)", "3"); +shouldBeTrue("executedAdditionalArgument"); + +function arrayApply1(array) +{ + function t(a, b, c) + { + return a; + } + return t.apply(null, array); +} + +function arrayApply2(array) +{ + function t(a, b, c) + { + return b; + } + return t.apply(null, array); +} + +function arrayApply3(array) +{ + function t(a, b, c) + { + return c; + } + return t.apply(null, array); +} + +function arrayApplyLength(array) +{ + function t(a, b, c) + { + return arguments.length; + } + return t.apply(null, array); +} + +shouldBe("arrayApply1([1, 2, 3])", "1"); +shouldBe("arrayApply2([1, 2, 3])", "2"); +shouldBe("arrayApply3([1, 2, 3])", "3"); +shouldBe("arrayApplyLength([1, 2, 3])", "3"); + + +function argumentsApplyDelete1(a, b, c) +{ + function t(a, b, c) + { + return a; + } + delete arguments[1]; + return t.apply(null, arguments); +} + +function argumentsApplyDelete2(a, b, c) +{ + function t(a, b, c) + { + return b; + } + delete arguments[1]; + return t.apply(null, arguments); +} + +function argumentsApplyDelete3(a, b, c) +{ + function t(a, b, c) + { + return c; + } + delete arguments[1]; + return t.apply(null, arguments); +} + +function argumentsApplyDeleteLength(a, b, c) +{ + function t(a, b, c) + { + return arguments.length; + } + delete arguments[1]; + return t.apply(null, arguments); +} + +shouldBe("argumentsApplyDelete1(1, 2, 3)", "1"); +shouldBe("argumentsApplyDelete2(1, 2, 3)", "undefined"); +shouldBe("argumentsApplyDelete3(1, 2, 3)", "3"); +shouldBe("argumentsApplyDeleteLength(1, 2, 3)", "3"); + + +function arrayApplyDelete1(array) +{ + function t(a, b, c) + { + return a; + } + delete array[1]; + return t.apply(null, array); +} + +function arrayApplyDelete2(array) +{ + function t(a, b, c) + { + return b; + } + delete array[1]; + return t.apply(null, array); +} + +function arrayApplyDelete3(array) +{ + function t(a, b, c) + { + return c; + } + delete array[1]; + return t.apply(null, array); +} + +function arrayApplyDeleteLength(array) +{ + function t(a, b, c) + { + return arguments.length; + } + delete array[1]; + return t.apply(null, array); +} + +shouldBe("arrayApplyDelete1([1, 2, 3])", "1"); +shouldBe("arrayApplyDelete2([1, 2, 3])", "undefined"); +shouldBe("arrayApplyDelete3([1, 2, 3])", "3"); +shouldBe("arrayApplyDeleteLength([1, 2, 3])", "3"); + + +function argumentsApplyChangeLength1() +{ + function f() { + return arguments.length; + }; + arguments.length = 2; + return f.apply(null, arguments); +} + + +function argumentsApplyChangeLength2() +{ + function f(a) { + return arguments.length; + }; + arguments.length = 2; + return f.apply(null, arguments); +} + + +function argumentsApplyChangeLength3() +{ + function f(a, b, c) { + return arguments.length; + }; + arguments.length = 2; + return f.apply(null, arguments); +}; + +function argumentsApplyChangeLength4() +{ + function f() { + return arguments.length; + }; + arguments.length = 0; + return f.apply(null, arguments); +}; + +function argumentsApplyChangeLength5() +{ + function f() { + return arguments.length; + }; + arguments.length = "Not A Number"; + return f.apply(null, arguments); +} + +shouldBe("argumentsApplyChangeLength1(1)", "2"); +shouldBe("argumentsApplyChangeLength2(1)", "2"); +shouldBe("argumentsApplyChangeLength3(1)", "2"); +shouldBe("argumentsApplyChangeLength4(1)", "0"); +shouldBe("argumentsApplyChangeLength5(1)", "0"); + +function arrayApplyChangeLength1() +{ + function f() { + return arguments.length; + }; + var array = []; + array.length = 2; + return f.apply(null, array); +} + +function arrayApplyChangeLength2() +{ + function f(a) { + return arguments.length; + }; + var array = []; + array.length = 2; + return f.apply(null, array); +} + +function arrayApplyChangeLength3() +{ + function f(a, b, c) { + return arguments.length; + }; + var array = []; + array.length = 2; + return f.apply(null, array); +} + +function arrayApplyChangeLength4() +{ + function f() { + return arguments.length; + }; + var array = [1]; + array.length = 0; + return f.apply(null, array); +}; + +shouldBe("arrayApplyChangeLength1()", "2"); +shouldBe("arrayApplyChangeLength2()", "2"); +shouldBe("arrayApplyChangeLength3()", "2"); +shouldBe("arrayApplyChangeLength4()", "0"); + +shouldBe("var a = []; a.length = 0xFFFE; [].constructor.apply('', a).length", "0xFFFE"); +shouldBe("var a = []; a.length = 0xFFFF; [].constructor.apply('', a).length", "0xFFFF"); +shouldBe("var a = []; a.length = 0x10000; [].constructor.apply('', a).length", "0x10000"); +shouldThrow("var a = []; a.length = 0x10001; [].constructor.apply('', a).length"); +shouldThrow("var a = []; a.length = 0xFFFFFFFE; [].constructor.apply('', a).length"); +shouldThrow("var a = []; a.length = 0xFFFFFFFF; [].constructor.apply('', a).length"); + +// ES5 permits apply with array-like objects. +shouldBe("(function(a,b,c,d){ return d ? -1 : (a+b+c); }).apply(undefined, {length:3, 0:100, 1:20, 2:3})", '123'); diff --git a/deps/v8/test/webkit/fast/js/function-constructor-error-expected.txt b/deps/v8/test/webkit/fast/js/function-constructor-error-expected.txt new file mode 100644 index 0000000..e42d01e --- /dev/null +++ b/deps/v8/test/webkit/fast/js/function-constructor-error-expected.txt @@ -0,0 +1,34 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks that the Function constructor detects some syntax errors correctly (bug#59795). + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +FAIL Function('(i + (j)') should throw SyntaxError: Expected token ')'. Threw exception SyntaxError: Unexpected token }. +FAIL Function('return (i + (j)') should throw SyntaxError: Expected token ')'. Threw exception SyntaxError: Unexpected token }. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/function-constructor-error.js b/deps/v8/test/webkit/fast/js/function-constructor-error.js new file mode 100644 index 0000000..dbe43d3 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/function-constructor-error.js @@ -0,0 +1,29 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"This test checks that the Function constructor detects some syntax errors correctly (bug#59795)." +); + +shouldThrow("Function('(i + (j)')", '"SyntaxError: Expected token \')\'"'); +shouldThrow("Function('return (i + (j)')", '"SyntaxError: Expected token \')\'"'); diff --git a/deps/v8/test/webkit/fast/js/function-toString-parentheses-expected.txt b/deps/v8/test/webkit/fast/js/function-toString-parentheses-expected.txt new file mode 100644 index 0000000..943db97 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/function-toString-parentheses-expected.txt @@ -0,0 +1,525 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks that parentheses are preserved when significant, and not added where inappropriate. We need this test because the JavaScriptCore parser removes all parentheses and the serializer then adds them back. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS compileAndSerialize('a * b * c') is 'a * b * c' +PASS compileAndSerialize('(a * b) * c') is '(a * b) * c' +PASS compileAndSerialize('a * (b * c)') is 'a * (b * c)' +PASS compileAndSerialize('a * b + c') is 'a * b + c' +PASS compileAndSerialize('(a * b) + c') is '(a * b) + c' +PASS compileAndSerialize('a * (b + c)') is 'a * (b + c)' +PASS compileAndSerialize('a * b - c') is 'a * b - c' +PASS compileAndSerialize('(a * b) - c') is '(a * b) - c' +PASS compileAndSerialize('a * (b - c)') is 'a * (b - c)' +PASS compileAndSerialize('a / b / c') is 'a / b / c' +PASS compileAndSerialize('(a / b) / c') is '(a / b) / c' +PASS compileAndSerialize('a / (b / c)') is 'a / (b / c)' +PASS compileAndSerialize('a * b / c') is 'a * b / c' +PASS compileAndSerialize('(a * b) / c') is '(a * b) / c' +PASS compileAndSerialize('a * (b / c)') is 'a * (b / c)' +PASS compileAndSerialize('a / b + c') is 'a / b + c' +PASS compileAndSerialize('(a / b) + c') is '(a / b) + c' +PASS compileAndSerialize('a / (b + c)') is 'a / (b + c)' +PASS compileAndSerialize('a % b % c') is 'a % b % c' +PASS compileAndSerialize('(a % b) % c') is '(a % b) % c' +PASS compileAndSerialize('a % (b % c)') is 'a % (b % c)' +PASS compileAndSerialize('a * b % c') is 'a * b % c' +PASS compileAndSerialize('(a * b) % c') is '(a * b) % c' +PASS compileAndSerialize('a * (b % c)') is 'a * (b % c)' +PASS compileAndSerialize('a % b + c') is 'a % b + c' +PASS compileAndSerialize('(a % b) + c') is '(a % b) + c' +PASS compileAndSerialize('a % (b + c)') is 'a % (b + c)' +PASS compileAndSerialize('a + b + c') is 'a + b + c' +PASS compileAndSerialize('(a + b) + c') is '(a + b) + c' +PASS compileAndSerialize('a + (b + c)') is 'a + (b + c)' +PASS compileAndSerialize('a + b << c') is 'a + b << c' +PASS compileAndSerialize('(a + b) << c') is '(a + b) << c' +PASS compileAndSerialize('a + (b << c)') is 'a + (b << c)' +PASS compileAndSerialize('a + b >> c') is 'a + b >> c' +PASS compileAndSerialize('(a + b) >> c') is '(a + b) >> c' +PASS compileAndSerialize('a + (b >> c)') is 'a + (b >> c)' +PASS compileAndSerialize('a + b >>> c') is 'a + b >>> c' +PASS compileAndSerialize('(a + b) >>> c') is '(a + b) >>> c' +PASS compileAndSerialize('a + (b >>> c)') is 'a + (b >>> c)' +PASS compileAndSerialize('a - b - c') is 'a - b - c' +PASS compileAndSerialize('(a - b) - c') is '(a - b) - c' +PASS compileAndSerialize('a - (b - c)') is 'a - (b - c)' +PASS compileAndSerialize('a + b - c') is 'a + b - c' +PASS compileAndSerialize('(a + b) - c') is '(a + b) - c' +PASS compileAndSerialize('a + (b - c)') is 'a + (b - c)' +PASS compileAndSerialize('a - b << c') is 'a - b << c' +PASS compileAndSerialize('(a - b) << c') is '(a - b) << c' +PASS compileAndSerialize('a - (b << c)') is 'a - (b << c)' +PASS compileAndSerialize('a << b << c') is 'a << b << c' +PASS compileAndSerialize('(a << b) << c') is '(a << b) << c' +PASS compileAndSerialize('a << (b << c)') is 'a << (b << c)' +PASS compileAndSerialize('a << b < c') is 'a << b < c' +PASS compileAndSerialize('(a << b) < c') is '(a << b) < c' +PASS compileAndSerialize('a << (b < c)') is 'a << (b < c)' +PASS compileAndSerialize('a << b > c') is 'a << b > c' +PASS compileAndSerialize('(a << b) > c') is '(a << b) > c' +PASS compileAndSerialize('a << (b > c)') is 'a << (b > c)' +PASS compileAndSerialize('a << b <= c') is 'a << b <= c' +PASS compileAndSerialize('(a << b) <= c') is '(a << b) <= c' +PASS compileAndSerialize('a << (b <= c)') is 'a << (b <= c)' +PASS compileAndSerialize('a << b >= c') is 'a << b >= c' +PASS compileAndSerialize('(a << b) >= c') is '(a << b) >= c' +PASS compileAndSerialize('a << (b >= c)') is 'a << (b >= c)' +PASS compileAndSerialize('a << b instanceof c') is 'a << b instanceof c' +PASS compileAndSerialize('(a << b) instanceof c') is '(a << b) instanceof c' +PASS compileAndSerialize('a << (b instanceof c)') is 'a << (b instanceof c)' +PASS compileAndSerialize('a << b in c') is 'a << b in c' +PASS compileAndSerialize('(a << b) in c') is '(a << b) in c' +PASS compileAndSerialize('a << (b in c)') is 'a << (b in c)' +PASS compileAndSerialize('a >> b >> c') is 'a >> b >> c' +PASS compileAndSerialize('(a >> b) >> c') is '(a >> b) >> c' +PASS compileAndSerialize('a >> (b >> c)') is 'a >> (b >> c)' +PASS compileAndSerialize('a << b >> c') is 'a << b >> c' +PASS compileAndSerialize('(a << b) >> c') is '(a << b) >> c' +PASS compileAndSerialize('a << (b >> c)') is 'a << (b >> c)' +PASS compileAndSerialize('a >> b < c') is 'a >> b < c' +PASS compileAndSerialize('(a >> b) < c') is '(a >> b) < c' +PASS compileAndSerialize('a >> (b < c)') is 'a >> (b < c)' +PASS compileAndSerialize('a >>> b >>> c') is 'a >>> b >>> c' +PASS compileAndSerialize('(a >>> b) >>> c') is '(a >>> b) >>> c' +PASS compileAndSerialize('a >>> (b >>> c)') is 'a >>> (b >>> c)' +PASS compileAndSerialize('a << b >>> c') is 'a << b >>> c' +PASS compileAndSerialize('(a << b) >>> c') is '(a << b) >>> c' +PASS compileAndSerialize('a << (b >>> c)') is 'a << (b >>> c)' +PASS compileAndSerialize('a >>> b < c') is 'a >>> b < c' +PASS compileAndSerialize('(a >>> b) < c') is '(a >>> b) < c' +PASS compileAndSerialize('a >>> (b < c)') is 'a >>> (b < c)' +PASS compileAndSerialize('a < b < c') is 'a < b < c' +PASS compileAndSerialize('(a < b) < c') is '(a < b) < c' +PASS compileAndSerialize('a < (b < c)') is 'a < (b < c)' +PASS compileAndSerialize('a < b == c') is 'a < b == c' +PASS compileAndSerialize('(a < b) == c') is '(a < b) == c' +PASS compileAndSerialize('a < (b == c)') is 'a < (b == c)' +PASS compileAndSerialize('a < b != c') is 'a < b != c' +PASS compileAndSerialize('(a < b) != c') is '(a < b) != c' +PASS compileAndSerialize('a < (b != c)') is 'a < (b != c)' +PASS compileAndSerialize('a < b === c') is 'a < b === c' +PASS compileAndSerialize('(a < b) === c') is '(a < b) === c' +PASS compileAndSerialize('a < (b === c)') is 'a < (b === c)' +PASS compileAndSerialize('a < b !== c') is 'a < b !== c' +PASS compileAndSerialize('(a < b) !== c') is '(a < b) !== c' +PASS compileAndSerialize('a < (b !== c)') is 'a < (b !== c)' +PASS compileAndSerialize('a > b > c') is 'a > b > c' +PASS compileAndSerialize('(a > b) > c') is '(a > b) > c' +PASS compileAndSerialize('a > (b > c)') is 'a > (b > c)' +PASS compileAndSerialize('a < b > c') is 'a < b > c' +PASS compileAndSerialize('(a < b) > c') is '(a < b) > c' +PASS compileAndSerialize('a < (b > c)') is 'a < (b > c)' +PASS compileAndSerialize('a > b == c') is 'a > b == c' +PASS compileAndSerialize('(a > b) == c') is '(a > b) == c' +PASS compileAndSerialize('a > (b == c)') is 'a > (b == c)' +PASS compileAndSerialize('a <= b <= c') is 'a <= b <= c' +PASS compileAndSerialize('(a <= b) <= c') is '(a <= b) <= c' +PASS compileAndSerialize('a <= (b <= c)') is 'a <= (b <= c)' +PASS compileAndSerialize('a < b <= c') is 'a < b <= c' +PASS compileAndSerialize('(a < b) <= c') is '(a < b) <= c' +PASS compileAndSerialize('a < (b <= c)') is 'a < (b <= c)' +PASS compileAndSerialize('a <= b == c') is 'a <= b == c' +PASS compileAndSerialize('(a <= b) == c') is '(a <= b) == c' +PASS compileAndSerialize('a <= (b == c)') is 'a <= (b == c)' +PASS compileAndSerialize('a >= b >= c') is 'a >= b >= c' +PASS compileAndSerialize('(a >= b) >= c') is '(a >= b) >= c' +PASS compileAndSerialize('a >= (b >= c)') is 'a >= (b >= c)' +PASS compileAndSerialize('a < b >= c') is 'a < b >= c' +PASS compileAndSerialize('(a < b) >= c') is '(a < b) >= c' +PASS compileAndSerialize('a < (b >= c)') is 'a < (b >= c)' +PASS compileAndSerialize('a >= b == c') is 'a >= b == c' +PASS compileAndSerialize('(a >= b) == c') is '(a >= b) == c' +PASS compileAndSerialize('a >= (b == c)') is 'a >= (b == c)' +PASS compileAndSerialize('a instanceof b instanceof c') is 'a instanceof b instanceof c' +PASS compileAndSerialize('(a instanceof b) instanceof c') is '(a instanceof b) instanceof c' +PASS compileAndSerialize('a instanceof (b instanceof c)') is 'a instanceof (b instanceof c)' +PASS compileAndSerialize('a < b instanceof c') is 'a < b instanceof c' +PASS compileAndSerialize('(a < b) instanceof c') is '(a < b) instanceof c' +PASS compileAndSerialize('a < (b instanceof c)') is 'a < (b instanceof c)' +PASS compileAndSerialize('a instanceof b == c') is 'a instanceof b == c' +PASS compileAndSerialize('(a instanceof b) == c') is '(a instanceof b) == c' +PASS compileAndSerialize('a instanceof (b == c)') is 'a instanceof (b == c)' +PASS compileAndSerialize('a in b in c') is 'a in b in c' +PASS compileAndSerialize('(a in b) in c') is '(a in b) in c' +PASS compileAndSerialize('a in (b in c)') is 'a in (b in c)' +PASS compileAndSerialize('a < b in c') is 'a < b in c' +PASS compileAndSerialize('(a < b) in c') is '(a < b) in c' +PASS compileAndSerialize('a < (b in c)') is 'a < (b in c)' +PASS compileAndSerialize('a in b == c') is 'a in b == c' +PASS compileAndSerialize('(a in b) == c') is '(a in b) == c' +PASS compileAndSerialize('a in (b == c)') is 'a in (b == c)' +PASS compileAndSerialize('a == b == c') is 'a == b == c' +PASS compileAndSerialize('(a == b) == c') is '(a == b) == c' +PASS compileAndSerialize('a == (b == c)') is 'a == (b == c)' +PASS compileAndSerialize('a == b & c') is 'a == b & c' +PASS compileAndSerialize('(a == b) & c') is '(a == b) & c' +PASS compileAndSerialize('a == (b & c)') is 'a == (b & c)' +PASS compileAndSerialize('a != b != c') is 'a != b != c' +PASS compileAndSerialize('(a != b) != c') is '(a != b) != c' +PASS compileAndSerialize('a != (b != c)') is 'a != (b != c)' +PASS compileAndSerialize('a == b != c') is 'a == b != c' +PASS compileAndSerialize('(a == b) != c') is '(a == b) != c' +PASS compileAndSerialize('a == (b != c)') is 'a == (b != c)' +PASS compileAndSerialize('a != b & c') is 'a != b & c' +PASS compileAndSerialize('(a != b) & c') is '(a != b) & c' +PASS compileAndSerialize('a != (b & c)') is 'a != (b & c)' +PASS compileAndSerialize('a === b === c') is 'a === b === c' +PASS compileAndSerialize('(a === b) === c') is '(a === b) === c' +PASS compileAndSerialize('a === (b === c)') is 'a === (b === c)' +PASS compileAndSerialize('a == b === c') is 'a == b === c' +PASS compileAndSerialize('(a == b) === c') is '(a == b) === c' +PASS compileAndSerialize('a == (b === c)') is 'a == (b === c)' +PASS compileAndSerialize('a === b & c') is 'a === b & c' +PASS compileAndSerialize('(a === b) & c') is '(a === b) & c' +PASS compileAndSerialize('a === (b & c)') is 'a === (b & c)' +PASS compileAndSerialize('a !== b !== c') is 'a !== b !== c' +PASS compileAndSerialize('(a !== b) !== c') is '(a !== b) !== c' +PASS compileAndSerialize('a !== (b !== c)') is 'a !== (b !== c)' +PASS compileAndSerialize('a == b !== c') is 'a == b !== c' +PASS compileAndSerialize('(a == b) !== c') is '(a == b) !== c' +PASS compileAndSerialize('a == (b !== c)') is 'a == (b !== c)' +PASS compileAndSerialize('a !== b & c') is 'a !== b & c' +PASS compileAndSerialize('(a !== b) & c') is '(a !== b) & c' +PASS compileAndSerialize('a !== (b & c)') is 'a !== (b & c)' +PASS compileAndSerialize('a & b & c') is 'a & b & c' +PASS compileAndSerialize('(a & b) & c') is '(a & b) & c' +PASS compileAndSerialize('a & (b & c)') is 'a & (b & c)' +PASS compileAndSerialize('a & b ^ c') is 'a & b ^ c' +PASS compileAndSerialize('(a & b) ^ c') is '(a & b) ^ c' +PASS compileAndSerialize('a & (b ^ c)') is 'a & (b ^ c)' +PASS compileAndSerialize('a ^ b ^ c') is 'a ^ b ^ c' +PASS compileAndSerialize('(a ^ b) ^ c') is '(a ^ b) ^ c' +PASS compileAndSerialize('a ^ (b ^ c)') is 'a ^ (b ^ c)' +PASS compileAndSerialize('a ^ b | c') is 'a ^ b | c' +PASS compileAndSerialize('(a ^ b) | c') is '(a ^ b) | c' +PASS compileAndSerialize('a ^ (b | c)') is 'a ^ (b | c)' +PASS compileAndSerialize('a | b | c') is 'a | b | c' +PASS compileAndSerialize('(a | b) | c') is '(a | b) | c' +PASS compileAndSerialize('a | (b | c)') is 'a | (b | c)' +PASS compileAndSerialize('a | b && c') is 'a | b && c' +PASS compileAndSerialize('(a | b) && c') is '(a | b) && c' +PASS compileAndSerialize('a | (b && c)') is 'a | (b && c)' +PASS compileAndSerialize('a && b && c') is 'a && b && c' +PASS compileAndSerialize('(a && b) && c') is '(a && b) && c' +PASS compileAndSerialize('a && (b && c)') is 'a && (b && c)' +PASS compileAndSerialize('a && b || c') is 'a && b || c' +PASS compileAndSerialize('(a && b) || c') is '(a && b) || c' +PASS compileAndSerialize('a && (b || c)') is 'a && (b || c)' +PASS compileAndSerialize('a || b || c') is 'a || b || c' +PASS compileAndSerialize('(a || b) || c') is '(a || b) || c' +PASS compileAndSerialize('a || (b || c)') is 'a || (b || c)' +PASS compileAndSerialize('a = b = c') is 'a = b = c' +PASS compileAndSerialize('(a = b) = c') is '(a = b) = c' +PASS compileAndSerialize('a = (b = c)') is 'a = (b = c)' +PASS compileAndSerialize('a = b + c') is 'a = b + c' +PASS compileAndSerialize('(a = b) + c') is '(a = b) + c' +PASS compileAndSerialize('a = (b + c)') is 'a = (b + c)' +FAIL compileAndSerialize('a + b = c') should throw an exception. Was a + b = c. +PASS compileAndSerialize('(a + b) = c') is '(a + b) = c' +PASS compileAndSerialize('a + (b = c)') is 'a + (b = c)' +PASS compileAndSerialize('a *= b *= c') is 'a *= b *= c' +PASS compileAndSerialize('(a *= b) *= c') is '(a *= b) *= c' +PASS compileAndSerialize('a *= (b *= c)') is 'a *= (b *= c)' +PASS compileAndSerialize('a = b *= c') is 'a = b *= c' +PASS compileAndSerialize('(a = b) *= c') is '(a = b) *= c' +PASS compileAndSerialize('a = (b *= c)') is 'a = (b *= c)' +PASS compileAndSerialize('a *= b + c') is 'a *= b + c' +PASS compileAndSerialize('(a *= b) + c') is '(a *= b) + c' +PASS compileAndSerialize('a *= (b + c)') is 'a *= (b + c)' +FAIL compileAndSerialize('a + b *= c') should throw an exception. Was a + b *= c. +PASS compileAndSerialize('(a + b) *= c') is '(a + b) *= c' +PASS compileAndSerialize('a + (b *= c)') is 'a + (b *= c)' +PASS compileAndSerialize('a /= b /= c') is 'a /= b /= c' +PASS compileAndSerialize('(a /= b) /= c') is '(a /= b) /= c' +PASS compileAndSerialize('a /= (b /= c)') is 'a /= (b /= c)' +PASS compileAndSerialize('a = b /= c') is 'a = b /= c' +PASS compileAndSerialize('(a = b) /= c') is '(a = b) /= c' +PASS compileAndSerialize('a = (b /= c)') is 'a = (b /= c)' +PASS compileAndSerialize('a /= b + c') is 'a /= b + c' +PASS compileAndSerialize('(a /= b) + c') is '(a /= b) + c' +PASS compileAndSerialize('a /= (b + c)') is 'a /= (b + c)' +FAIL compileAndSerialize('a + b /= c') should throw an exception. Was a + b /= c. +PASS compileAndSerialize('(a + b) /= c') is '(a + b) /= c' +PASS compileAndSerialize('a + (b /= c)') is 'a + (b /= c)' +PASS compileAndSerialize('a %= b %= c') is 'a %= b %= c' +PASS compileAndSerialize('(a %= b) %= c') is '(a %= b) %= c' +PASS compileAndSerialize('a %= (b %= c)') is 'a %= (b %= c)' +PASS compileAndSerialize('a = b %= c') is 'a = b %= c' +PASS compileAndSerialize('(a = b) %= c') is '(a = b) %= c' +PASS compileAndSerialize('a = (b %= c)') is 'a = (b %= c)' +PASS compileAndSerialize('a %= b + c') is 'a %= b + c' +PASS compileAndSerialize('(a %= b) + c') is '(a %= b) + c' +PASS compileAndSerialize('a %= (b + c)') is 'a %= (b + c)' +FAIL compileAndSerialize('a + b %= c') should throw an exception. Was a + b %= c. +PASS compileAndSerialize('(a + b) %= c') is '(a + b) %= c' +PASS compileAndSerialize('a + (b %= c)') is 'a + (b %= c)' +PASS compileAndSerialize('a += b += c') is 'a += b += c' +PASS compileAndSerialize('(a += b) += c') is '(a += b) += c' +PASS compileAndSerialize('a += (b += c)') is 'a += (b += c)' +PASS compileAndSerialize('a = b += c') is 'a = b += c' +PASS compileAndSerialize('(a = b) += c') is '(a = b) += c' +PASS compileAndSerialize('a = (b += c)') is 'a = (b += c)' +PASS compileAndSerialize('a += b + c') is 'a += b + c' +PASS compileAndSerialize('(a += b) + c') is '(a += b) + c' +PASS compileAndSerialize('a += (b + c)') is 'a += (b + c)' +FAIL compileAndSerialize('a + b += c') should throw an exception. Was a + b += c. +PASS compileAndSerialize('(a + b) += c') is '(a + b) += c' +PASS compileAndSerialize('a + (b += c)') is 'a + (b += c)' +PASS compileAndSerialize('a -= b -= c') is 'a -= b -= c' +PASS compileAndSerialize('(a -= b) -= c') is '(a -= b) -= c' +PASS compileAndSerialize('a -= (b -= c)') is 'a -= (b -= c)' +PASS compileAndSerialize('a = b -= c') is 'a = b -= c' +PASS compileAndSerialize('(a = b) -= c') is '(a = b) -= c' +PASS compileAndSerialize('a = (b -= c)') is 'a = (b -= c)' +PASS compileAndSerialize('a -= b + c') is 'a -= b + c' +PASS compileAndSerialize('(a -= b) + c') is '(a -= b) + c' +PASS compileAndSerialize('a -= (b + c)') is 'a -= (b + c)' +FAIL compileAndSerialize('a + b -= c') should throw an exception. Was a + b -= c. +PASS compileAndSerialize('(a + b) -= c') is '(a + b) -= c' +PASS compileAndSerialize('a + (b -= c)') is 'a + (b -= c)' +PASS compileAndSerialize('a <<= b <<= c') is 'a <<= b <<= c' +PASS compileAndSerialize('(a <<= b) <<= c') is '(a <<= b) <<= c' +PASS compileAndSerialize('a <<= (b <<= c)') is 'a <<= (b <<= c)' +PASS compileAndSerialize('a = b <<= c') is 'a = b <<= c' +PASS compileAndSerialize('(a = b) <<= c') is '(a = b) <<= c' +PASS compileAndSerialize('a = (b <<= c)') is 'a = (b <<= c)' +PASS compileAndSerialize('a <<= b + c') is 'a <<= b + c' +PASS compileAndSerialize('(a <<= b) + c') is '(a <<= b) + c' +PASS compileAndSerialize('a <<= (b + c)') is 'a <<= (b + c)' +FAIL compileAndSerialize('a + b <<= c') should throw an exception. Was a + b <<= c. +PASS compileAndSerialize('(a + b) <<= c') is '(a + b) <<= c' +PASS compileAndSerialize('a + (b <<= c)') is 'a + (b <<= c)' +PASS compileAndSerialize('a >>= b >>= c') is 'a >>= b >>= c' +PASS compileAndSerialize('(a >>= b) >>= c') is '(a >>= b) >>= c' +PASS compileAndSerialize('a >>= (b >>= c)') is 'a >>= (b >>= c)' +PASS compileAndSerialize('a = b >>= c') is 'a = b >>= c' +PASS compileAndSerialize('(a = b) >>= c') is '(a = b) >>= c' +PASS compileAndSerialize('a = (b >>= c)') is 'a = (b >>= c)' +PASS compileAndSerialize('a >>= b + c') is 'a >>= b + c' +PASS compileAndSerialize('(a >>= b) + c') is '(a >>= b) + c' +PASS compileAndSerialize('a >>= (b + c)') is 'a >>= (b + c)' +FAIL compileAndSerialize('a + b >>= c') should throw an exception. Was a + b >>= c. +PASS compileAndSerialize('(a + b) >>= c') is '(a + b) >>= c' +PASS compileAndSerialize('a + (b >>= c)') is 'a + (b >>= c)' +PASS compileAndSerialize('a >>>= b >>>= c') is 'a >>>= b >>>= c' +PASS compileAndSerialize('(a >>>= b) >>>= c') is '(a >>>= b) >>>= c' +PASS compileAndSerialize('a >>>= (b >>>= c)') is 'a >>>= (b >>>= c)' +PASS compileAndSerialize('a = b >>>= c') is 'a = b >>>= c' +PASS compileAndSerialize('(a = b) >>>= c') is '(a = b) >>>= c' +PASS compileAndSerialize('a = (b >>>= c)') is 'a = (b >>>= c)' +PASS compileAndSerialize('a >>>= b + c') is 'a >>>= b + c' +PASS compileAndSerialize('(a >>>= b) + c') is '(a >>>= b) + c' +PASS compileAndSerialize('a >>>= (b + c)') is 'a >>>= (b + c)' +FAIL compileAndSerialize('a + b >>>= c') should throw an exception. Was a + b >>>= c. +PASS compileAndSerialize('(a + b) >>>= c') is '(a + b) >>>= c' +PASS compileAndSerialize('a + (b >>>= c)') is 'a + (b >>>= c)' +PASS compileAndSerialize('a &= b &= c') is 'a &= b &= c' +PASS compileAndSerialize('(a &= b) &= c') is '(a &= b) &= c' +PASS compileAndSerialize('a &= (b &= c)') is 'a &= (b &= c)' +PASS compileAndSerialize('a = b &= c') is 'a = b &= c' +PASS compileAndSerialize('(a = b) &= c') is '(a = b) &= c' +PASS compileAndSerialize('a = (b &= c)') is 'a = (b &= c)' +PASS compileAndSerialize('a &= b + c') is 'a &= b + c' +PASS compileAndSerialize('(a &= b) + c') is '(a &= b) + c' +PASS compileAndSerialize('a &= (b + c)') is 'a &= (b + c)' +FAIL compileAndSerialize('a + b &= c') should throw an exception. Was a + b &= c. +PASS compileAndSerialize('(a + b) &= c') is '(a + b) &= c' +PASS compileAndSerialize('a + (b &= c)') is 'a + (b &= c)' +PASS compileAndSerialize('a ^= b ^= c') is 'a ^= b ^= c' +PASS compileAndSerialize('(a ^= b) ^= c') is '(a ^= b) ^= c' +PASS compileAndSerialize('a ^= (b ^= c)') is 'a ^= (b ^= c)' +PASS compileAndSerialize('a = b ^= c') is 'a = b ^= c' +PASS compileAndSerialize('(a = b) ^= c') is '(a = b) ^= c' +PASS compileAndSerialize('a = (b ^= c)') is 'a = (b ^= c)' +PASS compileAndSerialize('a ^= b + c') is 'a ^= b + c' +PASS compileAndSerialize('(a ^= b) + c') is '(a ^= b) + c' +PASS compileAndSerialize('a ^= (b + c)') is 'a ^= (b + c)' +FAIL compileAndSerialize('a + b ^= c') should throw an exception. Was a + b ^= c. +PASS compileAndSerialize('(a + b) ^= c') is '(a + b) ^= c' +PASS compileAndSerialize('a + (b ^= c)') is 'a + (b ^= c)' +PASS compileAndSerialize('a |= b |= c') is 'a |= b |= c' +PASS compileAndSerialize('(a |= b) |= c') is '(a |= b) |= c' +PASS compileAndSerialize('a |= (b |= c)') is 'a |= (b |= c)' +PASS compileAndSerialize('a = b |= c') is 'a = b |= c' +PASS compileAndSerialize('(a = b) |= c') is '(a = b) |= c' +PASS compileAndSerialize('a = (b |= c)') is 'a = (b |= c)' +PASS compileAndSerialize('a |= b + c') is 'a |= b + c' +PASS compileAndSerialize('(a |= b) + c') is '(a |= b) + c' +PASS compileAndSerialize('a |= (b + c)') is 'a |= (b + c)' +FAIL compileAndSerialize('a + b |= c') should throw an exception. Was a + b |= c. +PASS compileAndSerialize('(a + b) |= c') is '(a + b) |= c' +PASS compileAndSerialize('a + (b |= c)') is 'a + (b |= c)' +PASS compileAndSerialize('delete a + b') is 'delete a + b' +PASS compileAndSerialize('(delete a) + b') is '(delete a) + b' +PASS compileAndSerialize('delete (a + b)') is 'delete (a + b)' +PASS compileAndSerialize('!delete a') is '!delete a' +PASS compileAndSerialize('!(delete a)') is '!(delete a)' +PASS compileAndSerialize('void a + b') is 'void a + b' +PASS compileAndSerialize('(void a) + b') is '(void a) + b' +PASS compileAndSerialize('void (a + b)') is 'void (a + b)' +PASS compileAndSerialize('!void a') is '!void a' +PASS compileAndSerialize('!(void a)') is '!(void a)' +PASS compileAndSerialize('typeof a + b') is 'typeof a + b' +PASS compileAndSerialize('(typeof a) + b') is '(typeof a) + b' +PASS compileAndSerialize('typeof (a + b)') is 'typeof (a + b)' +PASS compileAndSerialize('!typeof a') is '!typeof a' +PASS compileAndSerialize('!(typeof a)') is '!(typeof a)' +PASS compileAndSerialize('++a + b') is '++a + b' +PASS compileAndSerialize('(++a) + b') is '(++a) + b' +PASS compileAndSerialize('++(a + b)') is '++(a + b)' +PASS compileAndSerialize('!++a') is '!++a' +PASS compileAndSerialize('!(++a)') is '!(++a)' +PASS compileAndSerialize('--a + b') is '--a + b' +PASS compileAndSerialize('(--a) + b') is '(--a) + b' +PASS compileAndSerialize('--(a + b)') is '--(a + b)' +PASS compileAndSerialize('!--a') is '!--a' +PASS compileAndSerialize('!(--a)') is '!(--a)' +PASS compileAndSerialize('+ a + b') is '+ a + b' +PASS compileAndSerialize('(+ a) + b') is '(+ a) + b' +PASS compileAndSerialize('+ (a + b)') is '+ (a + b)' +PASS compileAndSerialize('!+ a') is '!+ a' +PASS compileAndSerialize('!(+ a)') is '!(+ a)' +PASS compileAndSerialize('- a + b') is '- a + b' +PASS compileAndSerialize('(- a) + b') is '(- a) + b' +PASS compileAndSerialize('- (a + b)') is '- (a + b)' +PASS compileAndSerialize('!- a') is '!- a' +PASS compileAndSerialize('!(- a)') is '!(- a)' +PASS compileAndSerialize('~a + b') is '~a + b' +PASS compileAndSerialize('(~a) + b') is '(~a) + b' +PASS compileAndSerialize('~(a + b)') is '~(a + b)' +PASS compileAndSerialize('!~a') is '!~a' +PASS compileAndSerialize('!(~a)') is '!(~a)' +PASS compileAndSerialize('!a + b') is '!a + b' +PASS compileAndSerialize('(!a) + b') is '(!a) + b' +PASS compileAndSerialize('!(a + b)') is '!(a + b)' +PASS compileAndSerialize('!!a') is '!!a' +PASS compileAndSerialize('!(!a)') is '!(!a)' +PASS compileAndSerialize('!a++') is '!a++' +PASS compileAndSerialize('!(a++)') is '!(a++)' +PASS compileAndSerialize('(!a)++') is '(!a)++' +PASS compileAndSerialize('!a--') is '!a--' +PASS compileAndSerialize('!(a--)') is '!(a--)' +PASS compileAndSerialize('(!a)--') is '(!a)--' +PASS compileAndSerialize('(-1)[a]') is '(-1)[a]' +PASS compileAndSerialize('(-1)[a] = b') is '(-1)[a] = b' +PASS compileAndSerialize('(-1)[a] += b') is '(-1)[a] += b' +PASS compileAndSerialize('(-1)[a]++') is '(-1)[a]++' +PASS compileAndSerialize('++(-1)[a]') is '++(-1)[a]' +PASS compileAndSerialize('(-1)[a]()') is '(-1)[a]()' +PASS compileAndSerialize('new (-1)()') is 'new (-1)()' +PASS compileAndSerialize('(-1).a') is '(-1).a' +PASS compileAndSerialize('(-1).a = b') is '(-1).a = b' +PASS compileAndSerialize('(-1).a += b') is '(-1).a += b' +PASS compileAndSerialize('(-1).a++') is '(-1).a++' +PASS compileAndSerialize('++(-1).a') is '++(-1).a' +PASS compileAndSerialize('(-1).a()') is '(-1).a()' +PASS compileAndSerialize('(- 0)[a]') is '(- 0)[a]' +PASS compileAndSerialize('(- 0)[a] = b') is '(- 0)[a] = b' +PASS compileAndSerialize('(- 0)[a] += b') is '(- 0)[a] += b' +PASS compileAndSerialize('(- 0)[a]++') is '(- 0)[a]++' +PASS compileAndSerialize('++(- 0)[a]') is '++(- 0)[a]' +PASS compileAndSerialize('(- 0)[a]()') is '(- 0)[a]()' +PASS compileAndSerialize('new (- 0)()') is 'new (- 0)()' +PASS compileAndSerialize('(- 0).a') is '(- 0).a' +PASS compileAndSerialize('(- 0).a = b') is '(- 0).a = b' +PASS compileAndSerialize('(- 0).a += b') is '(- 0).a += b' +PASS compileAndSerialize('(- 0).a++') is '(- 0).a++' +PASS compileAndSerialize('++(- 0).a') is '++(- 0).a' +PASS compileAndSerialize('(- 0).a()') is '(- 0).a()' +PASS compileAndSerialize('(1)[a]') is '(1)[a]' +PASS compileAndSerialize('(1)[a] = b') is '(1)[a] = b' +PASS compileAndSerialize('(1)[a] += b') is '(1)[a] += b' +PASS compileAndSerialize('(1)[a]++') is '(1)[a]++' +PASS compileAndSerialize('++(1)[a]') is '++(1)[a]' +PASS compileAndSerialize('(1)[a]()') is '(1)[a]()' +PASS compileAndSerialize('new (1)()') is 'new (1)()' +PASS compileAndSerialize('(1).a') is '(1).a' +PASS compileAndSerialize('(1).a = b') is '(1).a = b' +PASS compileAndSerialize('(1).a += b') is '(1).a += b' +PASS compileAndSerialize('(1).a++') is '(1).a++' +PASS compileAndSerialize('++(1).a') is '++(1).a' +PASS compileAndSerialize('(1).a()') is '(1).a()' +PASS compileAndSerialize('(-1) = a') is '(-1) = a' +PASS compileAndSerialize('(- 0) = a') is '(- 0) = a' +PASS compileAndSerialize('1 = a') is '1 = a' +PASS compileAndSerialize('(-1) *= a') is '(-1) *= a' +PASS compileAndSerialize('(- 0) *= a') is '(- 0) *= a' +PASS compileAndSerialize('1 *= a') is '1 *= a' +PASS compileAndSerialize('(-1) /= a') is '(-1) /= a' +PASS compileAndSerialize('(- 0) /= a') is '(- 0) /= a' +PASS compileAndSerialize('1 /= a') is '1 /= a' +PASS compileAndSerialize('(-1) %= a') is '(-1) %= a' +PASS compileAndSerialize('(- 0) %= a') is '(- 0) %= a' +PASS compileAndSerialize('1 %= a') is '1 %= a' +PASS compileAndSerialize('(-1) += a') is '(-1) += a' +PASS compileAndSerialize('(- 0) += a') is '(- 0) += a' +PASS compileAndSerialize('1 += a') is '1 += a' +PASS compileAndSerialize('(-1) -= a') is '(-1) -= a' +PASS compileAndSerialize('(- 0) -= a') is '(- 0) -= a' +PASS compileAndSerialize('1 -= a') is '1 -= a' +PASS compileAndSerialize('(-1) <<= a') is '(-1) <<= a' +PASS compileAndSerialize('(- 0) <<= a') is '(- 0) <<= a' +PASS compileAndSerialize('1 <<= a') is '1 <<= a' +PASS compileAndSerialize('(-1) >>= a') is '(-1) >>= a' +PASS compileAndSerialize('(- 0) >>= a') is '(- 0) >>= a' +PASS compileAndSerialize('1 >>= a') is '1 >>= a' +PASS compileAndSerialize('(-1) >>>= a') is '(-1) >>>= a' +PASS compileAndSerialize('(- 0) >>>= a') is '(- 0) >>>= a' +PASS compileAndSerialize('1 >>>= a') is '1 >>>= a' +PASS compileAndSerialize('(-1) &= a') is '(-1) &= a' +PASS compileAndSerialize('(- 0) &= a') is '(- 0) &= a' +PASS compileAndSerialize('1 &= a') is '1 &= a' +PASS compileAndSerialize('(-1) ^= a') is '(-1) ^= a' +PASS compileAndSerialize('(- 0) ^= a') is '(- 0) ^= a' +PASS compileAndSerialize('1 ^= a') is '1 ^= a' +PASS compileAndSerialize('(-1) |= a') is '(-1) |= a' +PASS compileAndSerialize('(- 0) |= a') is '(- 0) |= a' +PASS compileAndSerialize('1 |= a') is '1 |= a' +PASS compileAndSerializeLeftmostTest('({ }).x') is '({ }).x' +PASS compileAndSerializeLeftmostTest('x = { }') is 'x = { }' +PASS compileAndSerializeLeftmostTest('(function () { })()') is '(function () { })()' +PASS compileAndSerializeLeftmostTest('x = function () { }') is 'x = function () { }' +PASS compileAndSerializeLeftmostTest('var a') is 'var a' +PASS compileAndSerializeLeftmostTest('var a = 1') is 'var a = 1' +PASS compileAndSerializeLeftmostTest('var a, b') is 'var a, b' +PASS compileAndSerializeLeftmostTest('var a = 1, b = 2') is 'var a = 1, b = 2' +PASS compileAndSerializeLeftmostTest('var a, b, c') is 'var a, b, c' +PASS compileAndSerializeLeftmostTest('var a = 1, b = 2, c = 3') is 'var a = 1, b = 2, c = 3' +PASS compileAndSerializeLeftmostTest('const a = 1') is 'const a = 1' +PASS compileAndSerializeLeftmostTest('const a = (1, 2)') is 'const a = (1, 2)' +PASS compileAndSerializeLeftmostTest('const a, b = 1') is 'const a, b = 1' +PASS compileAndSerializeLeftmostTest('const a = 1, b') is 'const a = 1, b' +PASS compileAndSerializeLeftmostTest('const a = 1, b = 1') is 'const a = 1, b = 1' +PASS compileAndSerializeLeftmostTest('const a = (1, 2), b = 1') is 'const a = (1, 2), b = 1' +PASS compileAndSerializeLeftmostTest('const a = 1, b = (1, 2)') is 'const a = 1, b = (1, 2)' +PASS compileAndSerializeLeftmostTest('const a = (1, 2), b = (1, 2)') is 'const a = (1, 2), b = (1, 2)' +PASS compileAndSerialize('(function () { new (a.b()).c })') is '(function () { new (a.b()).c })' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/function-toString-parentheses.js b/deps/v8/test/webkit/fast/js/function-toString-parentheses.js new file mode 100644 index 0000000..6bc62ab --- /dev/null +++ b/deps/v8/test/webkit/fast/js/function-toString-parentheses.js @@ -0,0 +1,234 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"This test checks that parentheses are preserved when significant, and not added where inappropriate. " + +"We need this test because the JavaScriptCore parser removes all parentheses and the serializer then adds them back." +); + +function compileAndSerialize(expression) +{ + var f = eval("(function () { return " + expression + "; })"); + var serializedString = f.toString(); + serializedString = serializedString.replace(/[ \t\r\n]+/g, " "); + serializedString = serializedString.replace("function () { return ", ""); + serializedString = serializedString.replace("; }", ""); + return serializedString; +} + +function compileAndSerializeLeftmostTest(expression) +{ + var f = eval("(function () { " + expression + "; })"); + var serializedString = f.toString(); + serializedString = serializedString.replace(/[ \t\r\n]+/g, " "); + serializedString = serializedString.replace("function () { ", ""); + serializedString = serializedString.replace("; }", ""); + return serializedString; +} + +var removesExtraParentheses = compileAndSerialize("(a + b) + c") == "a + b + c"; + +function testKeepParentheses(expression) +{ + shouldBe("compileAndSerialize('" + expression + "')", + "'" + expression + "'"); +} + +function testOptionalParentheses(expression) +{ + stripped_expression = removesExtraParentheses + ? expression.replace(/\(/g, '').replace(/\)/g, '') + : expression; + shouldBe("compileAndSerialize('" + expression + "')", + "'" + stripped_expression + "'"); +} + +function testLeftAssociativeSame(opA, opB) +{ + testKeepParentheses("a " + opA + " b " + opB + " c"); + testOptionalParentheses("(a " + opA + " b) " + opB + " c"); + testKeepParentheses("a " + opA + " (b " + opB + " c)"); +} + +function testRightAssociativeSame(opA, opB) +{ + testKeepParentheses("a " + opA + " b " + opB + " c"); + testKeepParentheses("(a " + opA + " b) " + opB + " c"); + testOptionalParentheses("a " + opA + " (b " + opB + " c)"); +} + +function testHigherFirst(opHigher, opLower) +{ + testKeepParentheses("a " + opHigher + " b " + opLower + " c"); + testOptionalParentheses("(a " + opHigher + " b) " + opLower + " c"); + testKeepParentheses("a " + opHigher + " (b " + opLower + " c)"); +} + +function testLowerFirst(opLower, opHigher) +{ + testKeepParentheses("a " + opLower + " b " + opHigher + " c"); + testKeepParentheses("(a " + opLower + " b) " + opHigher + " c"); + testOptionalParentheses("a " + opLower + " (b " + opHigher + " c)"); +} + +var binaryOperators = [ + [ "*", "/", "%" ], [ "+", "-" ], + [ "<<", ">>", ">>>" ], + [ "<", ">", "<=", ">=", "instanceof", "in" ], + [ "==", "!=", "===", "!==" ], + [ "&" ], [ "^" ], [ "|" ], + [ "&&" ], [ "||" ] +]; + +for (i = 0; i < binaryOperators.length; ++i) { + var ops = binaryOperators[i]; + for (j = 0; j < ops.length; ++j) { + var op = ops[j]; + testLeftAssociativeSame(op, op); + if (j != 0) + testLeftAssociativeSame(ops[0], op); + if (i < binaryOperators.length - 1) { + var nextOps = binaryOperators[i + 1]; + if (j == 0) + for (k = 0; k < nextOps.length; ++k) + testHigherFirst(op, nextOps[k]); + else + testHigherFirst(op, nextOps[0]); + } + } +} + +var assignmentOperators = [ "=", "*=", "/=" , "%=", "+=", "-=", "<<=", ">>=", ">>>=", "&=", "^=", "|=" ]; + +for (i = 0; i < assignmentOperators.length; ++i) { + var op = assignmentOperators[i]; + testRightAssociativeSame(op, op); + if (i != 0) + testRightAssociativeSame("=", op); + testLowerFirst(op, "+"); + shouldThrow("compileAndSerialize('a + b " + op + " c')"); + testKeepParentheses("(a + b) " + op + " c"); + testKeepParentheses("a + (b " + op + " c)"); +} + +var prefixOperators = [ "delete", "void", "typeof", "++", "--", "+", "-", "~", "!" ]; +var prefixOperatorSpace = [ " ", " ", " ", "", "", " ", " ", "", "" ]; + +for (i = 0; i < prefixOperators.length; ++i) { + var op = prefixOperators[i] + prefixOperatorSpace[i]; + testKeepParentheses("" + op + "a + b"); + testOptionalParentheses("(" + op + "a) + b"); + testKeepParentheses("" + op + "(a + b)"); + testKeepParentheses("!" + op + "a"); + testOptionalParentheses("!(" + op + "a)"); +} + + +testKeepParentheses("!a++"); +testOptionalParentheses("!(a++)"); +testKeepParentheses("(!a)++"); + +testKeepParentheses("!a--"); +testOptionalParentheses("!(a--)"); +testKeepParentheses("(!a)--"); + +testKeepParentheses("(-1)[a]"); +testKeepParentheses("(-1)[a] = b"); +testKeepParentheses("(-1)[a] += b"); +testKeepParentheses("(-1)[a]++"); +testKeepParentheses("++(-1)[a]"); +testKeepParentheses("(-1)[a]()"); + +testKeepParentheses("new (-1)()"); + +testKeepParentheses("(-1).a"); +testKeepParentheses("(-1).a = b"); +testKeepParentheses("(-1).a += b"); +testKeepParentheses("(-1).a++"); +testKeepParentheses("++(-1).a"); +testKeepParentheses("(-1).a()"); + +testKeepParentheses("(- 0)[a]"); +testKeepParentheses("(- 0)[a] = b"); +testKeepParentheses("(- 0)[a] += b"); +testKeepParentheses("(- 0)[a]++"); +testKeepParentheses("++(- 0)[a]"); +testKeepParentheses("(- 0)[a]()"); + +testKeepParentheses("new (- 0)()"); + +testKeepParentheses("(- 0).a"); +testKeepParentheses("(- 0).a = b"); +testKeepParentheses("(- 0).a += b"); +testKeepParentheses("(- 0).a++"); +testKeepParentheses("++(- 0).a"); +testKeepParentheses("(- 0).a()"); + +testOptionalParentheses("(1)[a]"); +testOptionalParentheses("(1)[a] = b"); +testOptionalParentheses("(1)[a] += b"); +testOptionalParentheses("(1)[a]++"); +testOptionalParentheses("++(1)[a]"); + +shouldBe("compileAndSerialize('(1)[a]()')", + removesExtraParentheses ? "'1[a]()'" : "'(1)[a]()'"); + +shouldBe("compileAndSerialize('new (1)()')", + removesExtraParentheses ? "'new 1()'" : "'new (1)()'"); + +testKeepParentheses("(1).a"); +testKeepParentheses("(1).a = b"); +testKeepParentheses("(1).a += b"); +testKeepParentheses("(1).a++"); +testKeepParentheses("++(1).a"); +testKeepParentheses("(1).a()"); + +for (i = 0; i < assignmentOperators.length; ++i) { + var op = assignmentOperators[i]; + testKeepParentheses("(-1) " + op + " a"); + testKeepParentheses("(- 0) " + op + " a"); + testKeepParentheses("1 " + op + " a"); +} + +shouldBe("compileAndSerializeLeftmostTest('({ }).x')", "'({ }).x'"); +shouldBe("compileAndSerializeLeftmostTest('x = { }')", "'x = { }'"); +shouldBe("compileAndSerializeLeftmostTest('(function () { })()')", "'(function () { })()'"); +shouldBe("compileAndSerializeLeftmostTest('x = function () { }')", "'x = function () { }'"); + +shouldBe("compileAndSerializeLeftmostTest('var a')", "'var a'"); +shouldBe("compileAndSerializeLeftmostTest('var a = 1')", "'var a = 1'"); +shouldBe("compileAndSerializeLeftmostTest('var a, b')", "'var a, b'"); +shouldBe("compileAndSerializeLeftmostTest('var a = 1, b = 2')", "'var a = 1, b = 2'"); +shouldBe("compileAndSerializeLeftmostTest('var a, b, c')", "'var a, b, c'"); +shouldBe("compileAndSerializeLeftmostTest('var a = 1, b = 2, c = 3')", "'var a = 1, b = 2, c = 3'"); + +shouldBe("compileAndSerializeLeftmostTest('const a = 1')", "'const a = 1'"); +shouldBe("compileAndSerializeLeftmostTest('const a = (1, 2)')", "'const a = (1, 2)'"); +shouldBe("compileAndSerializeLeftmostTest('const a, b = 1')", "'const a, b = 1'"); +shouldBe("compileAndSerializeLeftmostTest('const a = 1, b')", "'const a = 1, b'"); +shouldBe("compileAndSerializeLeftmostTest('const a = 1, b = 1')", "'const a = 1, b = 1'"); +shouldBe("compileAndSerializeLeftmostTest('const a = (1, 2), b = 1')", "'const a = (1, 2), b = 1'"); +shouldBe("compileAndSerializeLeftmostTest('const a = 1, b = (1, 2)')", "'const a = 1, b = (1, 2)'"); +shouldBe("compileAndSerializeLeftmostTest('const a = (1, 2), b = (1, 2)')", "'const a = (1, 2), b = (1, 2)'"); + +shouldBe("compileAndSerialize('(function () { new (a.b()).c })')", "'(function () { new (a.b()).c })'"); diff --git a/deps/v8/test/webkit/fast/js/function-toString-semicolon-insertion-expected.txt b/deps/v8/test/webkit/fast/js/function-toString-semicolon-insertion-expected.txt new file mode 100644 index 0000000..edb651f --- /dev/null +++ b/deps/v8/test/webkit/fast/js/function-toString-semicolon-insertion-expected.txt @@ -0,0 +1,40 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks that functions re-string-ify in a way that is syntactically compatible with concatenation. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +FAIL (function(){return}).toString() should be function () {return;}. Was function (){return}. +FAIL (function(){return }).toString() should be function () {return; }. Was function (){return }. +FAIL (function(){return +}).toString() should be function () {return; +}. Was function (){return +}. +FAIL (function(){}).toString() should be function () {}. Was function (){}. +FAIL (function(){ }).toString() should be function () { }. Was function (){ }. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/function-toString-semicolon-insertion.js b/deps/v8/test/webkit/fast/js/function-toString-semicolon-insertion.js new file mode 100644 index 0000000..fa89b91 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/function-toString-semicolon-insertion.js @@ -0,0 +1,33 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"This test checks that functions re-string-ify in a way that is syntactically " + +"compatible with concatenation." +); + +shouldBe("(function(){return}).toString()", "'function () {return;}'"); +shouldBe("(function(){return }).toString()", "'function () {return; }'"); +shouldBe("(function(){return" + "\n" + "}).toString()", "'function () {return;" + "\\n" + "}'"); +shouldBe("(function(){}).toString()", "'function () {}'"); +shouldBe("(function(){ }).toString()", "'function () { }'"); diff --git a/deps/v8/test/webkit/fast/js/modify-non-references-expected.txt b/deps/v8/test/webkit/fast/js/modify-non-references-expected.txt new file mode 100644 index 0000000..ea20652 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/modify-non-references-expected.txt @@ -0,0 +1,39 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PASS function f() { g()++; } f.toString() is 'function f() { g()++; }' +PASS function f() { g()--; } f.toString() is 'function f() { g()--; }' +PASS function f() { ++g(); } f.toString() is 'function f() { ++g(); }' +PASS function f() { --g(); } f.toString() is 'function f() { --g(); }' +PASS function f() { g() = 1; } f.toString() is 'function f() { g() = 1; }' +PASS function f() { g() += 1; } f.toString() is 'function f() { g() += 1; }' +FAIL g()++ should throw ReferenceError: Postfix ++ operator applied to value that is not a reference.. Threw exception ReferenceError: Invalid left-hand side expression in postfix operation. +FAIL g()-- should throw ReferenceError: Postfix -- operator applied to value that is not a reference.. Threw exception ReferenceError: Invalid left-hand side expression in postfix operation. +FAIL ++g() should throw ReferenceError: Prefix ++ operator applied to value that is not a reference.. Threw exception ReferenceError: Invalid left-hand side expression in prefix operation. +FAIL --g() should throw ReferenceError: Prefix -- operator applied to value that is not a reference.. Threw exception ReferenceError: Invalid left-hand side expression in prefix operation. +FAIL g() = 1 should throw ReferenceError: Left side of assignment is not a reference.. Threw exception ReferenceError: Invalid left-hand side in assignment. +FAIL g() += 1 should throw ReferenceError: Left side of assignment is not a reference.. Threw exception ReferenceError: Invalid left-hand side in assignment. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/modify-non-references.js b/deps/v8/test/webkit/fast/js/modify-non-references.js new file mode 100644 index 0000000..e8b9682 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/modify-non-references.js @@ -0,0 +1,35 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +shouldBe("function f() { g()++; } f.toString()", "'function f() { g()++; }'"); +shouldBe("function f() { g()--; } f.toString()", "'function f() { g()--; }'"); +shouldBe("function f() { ++g(); } f.toString()", "'function f() { ++g(); }'"); +shouldBe("function f() { --g(); } f.toString()", "'function f() { --g(); }'"); +shouldBe("function f() { g() = 1; } f.toString()", "'function f() { g() = 1; }'"); +shouldBe("function f() { g() += 1; } f.toString()", "'function f() { g() += 1; }'"); +shouldThrow("g()++", "'ReferenceError: Postfix ++ operator applied to value that is not a reference.'"); +shouldThrow("g()--", "'ReferenceError: Postfix -- operator applied to value that is not a reference.'"); +shouldThrow("++g()", "'ReferenceError: Prefix ++ operator applied to value that is not a reference.'"); +shouldThrow("--g()", "'ReferenceError: Prefix -- operator applied to value that is not a reference.'"); +shouldThrow("g() = 1", "'ReferenceError: Left side of assignment is not a reference.'"); +shouldThrow("g() += 1", "'ReferenceError: Left side of assignment is not a reference.'"); diff --git a/deps/v8/test/webkit/fast/js/native-error-prototype-expected.txt b/deps/v8/test/webkit/fast/js/native-error-prototype-expected.txt new file mode 100644 index 0000000..137620b --- /dev/null +++ b/deps/v8/test/webkit/fast/js/native-error-prototype-expected.txt @@ -0,0 +1,37 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This is a test case for bugs 55346, 70889, and 75452. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS ({}).toString.call(Error.prototype) is "[object Error]" +PASS ({}).toString.call(RangeError.prototype) is "[object Error]" +PASS err.toString() is "message" +PASS err.hasOwnProperty('message') is false +PASS err.hasOwnProperty('message') is false +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/native-error-prototype.js b/deps/v8/test/webkit/fast/js/native-error-prototype.js new file mode 100644 index 0000000..588deaf --- /dev/null +++ b/deps/v8/test/webkit/fast/js/native-error-prototype.js @@ -0,0 +1,39 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'This is a test case for bugs 55346, 70889, and 75452.' +); + +shouldBe("({}).toString.call(Error.prototype)", '"[object Error]"'); +shouldBe("({}).toString.call(RangeError.prototype)", '"[object Error]"'); + +var err = new Error("message"); +err.name = ""; +shouldBe("err.toString()", '"message"'); + +var err = new Error(); +shouldBeFalse("err.hasOwnProperty('message')"); + +var err = new Error(undefined); +shouldBeFalse("err.hasOwnProperty('message')"); diff --git a/deps/v8/test/webkit/fast/js/number-toString-expected.txt b/deps/v8/test/webkit/fast/js/number-toString-expected.txt new file mode 100644 index 0000000..cc87114 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/number-toString-expected.txt @@ -0,0 +1,84 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PASS (0.0).toString(4) is "0" +PASS (-0.0).toString(4) is "0" +PASS (0.0).toString() is "0" +PASS (-0.0).toString() is "0" +PASS (1234.567).toString() is "1234.567" +PASS (1234.567).toString(0) threw exception RangeError: toString() radix argument must be between 2 and 36. +PASS (1234.567).toString(null) threw exception RangeError: toString() radix argument must be between 2 and 36. +PASS (1234.567).toString(false) threw exception RangeError: toString() radix argument must be between 2 and 36. +PASS (1234.567).toString('foo') threw exception RangeError: toString() radix argument must be between 2 and 36. +PASS (1234.567).toString(nan) threw exception RangeError: toString() radix argument must be between 2 and 36. +PASS (1234.567).toString(1) threw exception RangeError: toString() radix argument must be between 2 and 36. +PASS (1234.567).toString(true) threw exception RangeError: toString() radix argument must be between 2 and 36. +PASS (1234.567).toString('1') threw exception RangeError: toString() radix argument must be between 2 and 36. +PASS (1234.567).toString(2) is "10011010010.1001000100100110111010010111100011010101" +FAIL (1234.567).toString(3) should be 1200201.120022100021001021021002202. Was 1200201.1200221000210010210210022012001102222001211021211122102120100010210200200010021222011100022102111111220000120121020202022222012221002020211012221122112000100011101001001002222022012020010220022122022110202002002202222202212010021201212012220021121111000000211200200222000112012112202111102102221120000212111202201022111021100221120010011220020100220021221110002212111200002212221102221002020220001110120021210211010221211001220011121210110000101120102000202011022002220222101010221211000120010022102002210021221002122211021120201111101202110100001121111120122120122110201201222020221011002121022200201210122000022020200001000000221221112200220100222120210020001201202121010200011210020001210210121202022102101110122020100020021222102012012222212121111121121121101212122021001010222201200221200011220111121111111102022222110022222112200020021100202210020012212001001102111111221201020222201000210220121000100220121111222121011110101102001002022021011201200101200001210210121000020121110102110210201010021122012201111111201102000222010212012002220010220121211212002120011021000212221221222212221011021. +PASS (1234.567).toString(4) is "103102.21010212322113203111" +PASS (1234.567).toString(4.9) is "103102.21010212322113203111" +FAIL (1234.567).toString(5) should be 14414.240414141414141414. Was 14414.2404141414141414142001330114424340310401243302440231242000113043123113241003203103222323344012414440233013014243114024103434404401442341212210040423132144332233123403444214333034032120122342101304444100213130221312124302310000121420313130233324403331401413403104022134310103342230131122120400243010014400433301114434003131440210024041411240133114442212311404331144241232301112122233011302123243314440102021213421324210233021414231204242131230022200231142043201230104303340241341442024130004234014013344014122213220012003331442013023201013321330311133442440004210432424442444401411440310341433001141420244030003112023323232320133200241102233100204304444111043004140140141144243401313223011344420021202301444431004242024100001143300134104422421212224430111011311014301200423321110111323443032012124004240034223202410113442322244113243224440124111213032021200234200040422323123042101210040023131304002301141034233014440442324424432201121202113441433213220402344201401121222133443421241121332411332403342011024024040100401130140011130024320113121001032003303020321103014011343210443044311143011222133112. +FAIL (1234.567).toString(6) should be 5414.32224554134430233. Was 5414.3222455413443023323355441432422515541513. +FAIL (1234.567).toString(7) should be 3412.365323661111653. Was 3412.3653236611116525003006322001106262526423502236603135500642356240035335103351460444366123312630635446606624066252003331211022200461254221636430052553433322130415044420314121050016230251621043431515223434032660363546150133624211620331415335465112653210536541511650034050150553414415665203055401246562556516133264533422365114510442555452630202303465460006656451212301252554640421611202036412061014401243411616220124332503616404021512066541520132022166233352620436006601654615351142605225051331456655265644105464440620612132004102631611401411525363001644642360540514225416521440326255225162603053331303316510461104502455554160645203341631356523430651650156421214464434124323364312205115015543452230222456662313645241632222032243101333560524353153562141365266513365213006245146623530264344641542505545411201433543030321150013666622601245411100615134643634103435262652604406356254334116220032346102205431241506222463415513362655416243154405541220162461435601431260412250030100014066644353326405410000146050110633266400161543564314366114435655151420653606640546532414512600015136011520161555441252606026212. +PASS (1234.567).toString(8) is "2322.44223351361524" +FAIL (1234.567).toString(9) should be 1621.50830703723265. Was 1621.5083070372326504286173774837630372060325814027244480051722228818706673584846030433103286816612627827366208288276325176580754400075062801517567437284602545263843732750315621080784308545008584283222604350772412773180455340034636066426282833385401610836270783258424664435241004744657657365186683407728065356026660100085748081087670605167712015320172355227234356630625836518877744754735556703388162760481454444228840887560624068320576104244485122863072653032654487714334203226715161160172353021741242363324818144464202812516280381775507613702585788583424881125807185888538676210831486144562375864261345147383222322272055634547363306683408365573860425234373548873681638548110246868604100746883165721244675751048012126782157878154353713371758462432003183582526011586844378053200827331008624516010554456712807563108347046657674665651131422144550256168047014215677030141443587008105610375340533658384385003266047014066632784512440300865616602765820164258867505802667163243085767301453006274266560838042613666653021737412176552874258744101065687672444665763184042125577415816217234264077124502247240847650642. +PASS (1234.567).toString(10) is "1234.567" +FAIL (1234.567).toString(11) should be a22.62674a0a5885. Was a22.62674a0a58849145684a462507384219787878954737689989a347647680876095a2345860885046031287a9a1694a397131934142026745166a704344773a73700802694683125343988941755546a814849594a364029607aa0771a2447068930aa55775996897257a3855716340286a996939669868425056a42944a4543725202099605343316045838659207562a00519a4023622a82606539a94736645317056aa9482468a996994a347471153a71a8684a881786634929410231554133396466810a1310137999aa9911076821099a20247541213715118123019574636441209452414914a696a2969849328944530a34844533922965306848a95a2189454316192787338072241118032120757808a2588a900a7419391324061a544aa1a74a8a9373669362927a4020a628a7341a920559382a473291439394a52447455278191a0074944991223446a09529857938a8944181884714a37592416309652596060a15950167253414370287593729386550380730aa21059a04131a274936a843348919329612133271998378a57529794259a5644a51915812aa102320721422511533436064026a268a4677401310870620386925a6224540a78a8032945065017470785084793207763a3a02a9449127443659851a98297920300353402081344029399a9121852511105716a9325013222074551a466973999087784363a362609a1976a4869aa33009a6770a4896225643669258159743602a1919a1a561. +FAIL (1234.567).toString(12) should be 86a.697938b17701. Was 86a.697938b1770127290b99. +FAIL (1234.567).toString(13) should be 73c.74a91191a65. Was 73c.74a91191a64cb86850bc08a694340c765979634a010706991c088a61018b29a16a74093795640793846a7520587816ba56405b7a872869b395c336ca519474baa17539169173a880b49c178074ba551a5781a115152793324291b9260b60333573955737845b03a2321a65277a780923b262898597973bc4b669705680a0b1b88b366b6386c96208979c14a9632c516326883522840165b38c8b415b7a339abc6ca7051b0ac70277244a05477b8a0a09cab072a27b920389477b65616831116514419c44512967a92b39ca73ac01c461b6735ca31bcc17aba7a76412a7a599a8c217c6a74a67aa6c4664432065732caa7c24a1856170748647c2b049c19c572323c03301c283b69cb46b09a045b444a4c7c82901656583267697389b318a73b171a18406324a78b5c478a9c67c99c877b107448cac651945570a83220baa4a3048157189845cb66b7361c129cc3016c52c4b858cb0874ca122b8b7ba9333aa946391a24b8c86958968773bc18278022b1ba76b24727c2cca55442697549392a152927139208c12745bc26a5c17432332990a3267915b06331374a7a84b9469c0208358290337c99cb323a9076a284c5b318bc826989c8b8663bc249a9c687395504958825c1a541b08710bb647288ca4c1179cc2ac84761123a7b275910cb7a43c18c293b1c754b01cb9a211767356a626887980b384822c14a57494331946a5916c953ba85b08461b96168c8296237065623c3950a939746c6c200b5b1a6b60c671c6b91b3. +FAIL (1234.567).toString(14) should be 642.7d1bc2caa757. Was 642.7d1bc2caa75735ccb458a0d0b6bb6131b9114537. +FAIL (1234.567).toString(15) should be 574.87895959596. Was 574.87895959595a4bbac80bc1e90eeb5bc8c18b3dc77a5962116b159d66bbb7bd95a4c7984c63322434615e80235b8a482669a85e97218c41518e00eb898aba463593d3b4d00e7dc1d0343cd27161096dd810593669d1561982bcc35cda2e54c28de7759c1586adc867209b034293039e03bdce29cb6a8be7d65e09844094989a2d53663d122330bc94048d1bd67722a86db068a0679025d78db9312272c8b91671596d75d80c53331eb018579c83115c2d00581db910e8e4cb44c4c958c8d86dd59d55439b7c849da32130ded53a697a26a8dcea6b8ddc2ad047624bba922909d8c2d48460bc33a2e816d9ecde13d6d24ee6589b0ad9d696cc28753b8020ad21e86ac4363914adc4a87139ab188313439cd2ea8622b4bd54033e8a4a6e61a80c8229dc37399d73978d1d3443b31c987e158904214cce785d84e22e2a60623b141292e67575b1d1a050dbccd02c4732638d24b4c226e9dcc1a387cd7d2a1e797e0757a9de108846719aab2999b58669b21ab06cee3ac6e29990781505958595a4ce0be0710c5b2190365a2dbbbc5eea4993665e1d25266de37c19605488a2b1ce054361097e63c08ebbb7de7092476ddb0b52c89470a957b999b34b2bcb730053e89ed48789d9a20405b360d084b3805659900bd8b831852929bb542e45e3836c26c423e8421724619c2a9725e437c96a83484961985ddc2d4d8a060dae117d710c53e729a934964b59dd977b203a05e87c87d1839c0254d34775cd6becc912a817d21719e47a7. +PASS (1234.567).toString(16) is "4d2.9126e978d5" +FAIL (1234.567).toString(17) should be 44a.9aeb6faa0da. Was 44a.9aeb6faa0da2c5e88788d0f52d2ebc023ae5494926de55072ee4114fb38ga5258dd24a1ga4250bb32247g582114g92gc99462cbb5d8584a21d09eaadg00dc40ec938ggdb9e2091gf2ac482442fbcbc28cde82aa6e79e6a57af38e51fg176526dabc6549900c8976140bb4f5cd0d9c642bdbb7e7135d0ea35feb5805e7ba97975a1f2fa45f62e774307g760ec230e43064edg517gf7c9c93d24c43bg24094406b0b4792cg54a38f2b3065agg390efe33e7655f0288d30ec6b6cb994961625d18g636bf1g3443c2a9g5dc222c546c417a50b3e74df94d217bgeee8fad1cf5c2517g9e7babecd38b7092fd9cg519g029gf701a829e98g37402bc496dc3g0f1473564b33aeede5cc70ge58778ddad730feef409449acgd2a2bcc1917b797c94ec57eb4g8805e9708c5g57a78626029b5c247ae12gf8e7c54bd8024cfgc63a1f723d295cdf3gdf83gg17736a84614g1f68ddd1e4494f27d61ba5901f2384d6dedc7875b1babb8g09570fa3fd32f197d59fg499729261g8fgbg753ead4dafcff1fa8ef719a694db92a80f535c6128eg5659a68efdggd9b32ec6970e7cb41fbg99af02d38c1egb828407eegcc4cf985c77ggdf5gc5b54a8g7bdd4ag2318gdf3512ea7a41d1be2c665gbc5619342b9200f0gda9cd2c957af6d29gegee7228b7dbae7f6788c4eg4556a9ca2e13e75588g369ba1272a1b400201fbeb7d2d2d4a41f895e5fce3e2g7523d3573d67dagdee47b77g36106804a1857bd3g0a3e8bc8ebcf368f5382519e9af50. +FAIL (1234.567).toString(18) should be 3ea.a3cd7102ac. Was 3ea.a3cd7102abf03dd3fcf0535638d9d313eha75b49. +FAIL (1234.567).toString(19) should be 37i.aed102a04d. Was 37i.aed102a04d40782ebh1e2gc7i558c30fbe230dha57019e3a30e434220f7142ab33f6e4h3ec9ha57b474a52a9ddheb151594e7661418if1ggc24h26e6574769g148c278efc63ded13615bf6b1igddig1i6d0ffe64a9faad5b4gf240cd074b5hc3idafec1be77g4cb0755g8a0d652ceg9e749bdah56a2h5d3b94c74ff0b78aidgab693if10ab8h046425137ae5250f04c07dc22ifbda3fgdeh9a6e1d23d5ebga293ge581441eeb07b884197424b0c3gfech7820fbgg95eahdc3aceahci65i823d3h146dd80ieff23bi84bec219ea9he47ig3g309ci1h7f0i0i29bab4b1fhd19f9edf4if1f28a5b0bac87cihe28abbh1f4abegba22geh1c6h52c07e0ci5gi819e41d3d0fdee50h27c8hid03a95gcf4hac16188ae5ii719di85ad3a8fd059aa63b1ge9fc541hf69ee66gf0175b41ca1dhahaa39hc7id7c91dc8d09e7h0id0252532dg493g5f80a209c31f41c92ifh02i23iged06i6cf9777g3a10hif3i3217d32b00fii7ag4c8ee9iadf3201i366b4g23gc505g63c846b5102d5gg86dhh2d8eaf301ac13cg0f45d171ff479g1995f1hc7c7ii1i0b981e2e042b371a68hb64c5fh92hf30fd72e073bf439ae10dg4g739h170ddf394cbea90hh5490fia83d36bigf72a5ecf8cf126d54h7ghdeg5fic0i21db77hf88haefdb12h3222fc5c7d307707h5ceg3i01a17be5c31a5gb9dhad6ca6ica7c4ba4491504b7h21c2d83b2db3fi67chgi75d13f5c01dhcbgc34888bc70ecbe66ga096195gch11a936a622c4dccff7if4g8423hifh4. +FAIL (1234.567).toString(20) should be 31e.b6g. Was 31e.b6g000000019g0ibbcg5. +FAIL (1234.567).toString(21) should be 2gg.bj0kf5cfe9. Was 2gg.bj0kf5cfe91hk6fg383b1938ff8d00h4k9295959jcbj9c9282e840b169kji1eg32893afe063f0bbfkef2cbaegca035bf10b2aj3e6f6fg0kg35k8j82j82e08e6bi0c2ie8hhcgc57ih6aegb9bh7g808619k264h6hc29k812a70gk210g315d9bfh7if6h6ck9511b2kfb1fg4ed66gdigb641738d5a65gc748e1b688cigkcif51cb261hd4jhj5h4602e2addbie0d3d5dc26bhkecea961h4ia838e2bc92ag34a370c6ejaf27djiebghch29feekj17gf62g74d0h575g94aekd7kdfcbb55ejbb2e96bhj7b91450jaab24jii3aehaed6141ej3fccj8hfjk34kh5idghfb8d1kh39adaf2ce5eh756ej088gg9ab99fb332158dcd59b8ah108ei3431j6i11k092ciibkh2ih9dgh9b0922119c98684b38846630diejg60k1d93cg6ifk57e54akihbi89kh9h084ckcg5a7iieg6c01e90d09dbaik9b15k9kfj0igh00di8bcei4ifek38heea014f0ei2afa8ib08ii9eg2e0k71d43906f13bac08g9e6f22b76kihca1a13ff0eci4217h784ahgd5789j308bdgfjgekhkjhf6fe43dkih40hb2163i613dd4g1jfcb1ibc4i469ekbc38kh99i93k14ag7ikejfa528c38j90fhab8keai8cccikg5f69749934d2856i5908jh2hh99f5jig8hh2eh4ca8gh19k7h2g0a63hbc96d0kg27ke0759dc8107e63jd0ddkb8fe0kk0a04ciadaib51kf101i364i0ic1gedh145i2ghi4ie4j1agc3fgb5hckjj4ea5eke04hj59ie9e4hc4bce16ghf37g4b7fh3jh43bfc52a815bbe69e7h79gk8if00jb9020b4c7fb3bbb388h54kji9e14j7afjhi4ch547jdi53f89d7e5ckj. +FAIL (1234.567).toString(22) should be 2c2.ca9937cak. Was 2c2.ca9937cak1d502399f2hka8a3c87h0kc76fa6j5b. +FAIL (1234.567).toString(23) should be 27f.d0lfjb1a7c. Was 27f.d0lfjb1a7c6cabfj7gee33jdja9fg9cmjg378fhea19cfabg896fi0ab1gl839fil5cg8dj1hbgjagb0ilm88em2l9e3jg8hmm19ebmmjj6fk1l19fg7011c1j6ji3c6bl1lhk3khbl105c2d3ce1j2b3818aml72lch658elc4d1h9d94cj861eg75j0k59fdl596i978be821lgkiml5da72bd3j0h563h6khf70m64d9h2eac46l4a2g335i010hdl0h5h1b61agdhmd7kdmmch05iljadhh10i86lah1ajf4fj7i2m8h18jjf2amd2e66a86ei3j0h77b7kf6j657am1f6imjaaa28f021m9a13icka536c0fa65aalbbliei26cll38ac1cm343h0ec8h0k4mh1kbhla6a9889llj6db07eb9gmfihggd1kaim70gb6l082jcaldg353ae9i35g77fem7bg77k7em4c41fhbejmhhggj4blli3f7510l55l1j0c0h862ci9he2dlaki2j0ieah36d8i3gf3di7h095ajkbd3amglggc5i6ifh4076g436jcc9bc335mbgec23bjgfki54fm9fc105c2g1l9mc8mmgm1j3e8i96hjd38ic5keb8m53kb2kcec18c04369lg97dk660idbijfcfh9ef0g05c41116i1l664900jjf5jgkikl9kkhj6j8clm5h584l2875j4j8c358k8j3f88c4a297cbc818j26a0ihmf21ll6kkfm911ae4e7hb2l5ha85ffdi63hmk97cdd4mfcim97gmhclh43ig2j5ma5c19hle8i2hhlm2gjjmiae30754mb7d0l7881ighhh0c0bfagekm07h344bdli77m5jj97g69aeg8163ed6amgfm039bj2b9ib9aldfa103i83cebh0bgdj8m7l823k2d6h4l8mia9hk673maia22mik4k3l07h02mb9g56lk26g3micj053g308if9349kamm3jf7bamh3ele3024acbad8ib02cgef9h3f6dgml9ah6cj4mhdm3e9k3kc17lib. +FAIL (1234.567).toString(24) should be 23a.dee4nj99j. Was 23a.dee4nj99j0fg7c. +FAIL (1234.567).toString(25) should be 1o9.e49999999. Was 1o9.e49999999a1i19mnkg41ei2o2gea06fn7g8e53ag3cddjk7lokdf81mn6ke5jjko1odlbc544d8boici7j3om9ifj3ba7dm584ol0bgfc877n2g0079aggfdiekigk98kg42bjg13jcf86c740ef51o0ni16oj0ggo252kll7k8g9oc7g94i6oe7hf677ci1827hngok5abbjbhm5dfblmgamm87f2c0d6m4h1d14fike8loae804dk91io1lcbha1a3i9m1fda58h8fg6ioek0m5neeoeok96o35j9i06lm2o3036adhhhh1ia2l5ci524foo65n0lk91l9mnk88cf6joa272f9on54eae5019i08l4mebbcen161861n1a4dh6568dofh1be0mk3mdae56jmhco6hncok7l6bfh270dm044chgd4b1b0k2ggfk2f6l3mi1okodemoha6bab8o9ibhakdoa9177c8jnm7l78hl8hkim15e2kk54181k16f2na6gb05h0i323b5f918nb4n4n69f6cbi6eenjbhl7knoe3cgg7mam85goed2a7gdo13o374h8945hi6e9g311b5ohb636dc05g54k2jkh1532l495l91a8licnb4m8ibnmmc4fnfa1423mne1n8g09jjl149i4j8j171if83onjg1474014kcbb60hfackaonn7d0km7ajbakfng7dac201a9j2f872je2jjh3lf2o5593h0bmn9e0em502menh17kc4abi9n9hl986i5m1381kbh36l1be3fo090i6i58789fcic7b586650j8ejjh9h2m99nc9icmij65c955o35499c5n54d27ddfc3hmj247i65n4kmel3gckj06150e146l8bcdof887babce844kd9aold9hh24f7520h8e2768cg00ojfbd9o5d3aflcnh3h3n1a02nefdkjniknid3fd3f83d31a5ibe3k00i0a2bgk4k0m4l18d3b1d368i50cg3e3fmeebb1f2dh1cb5bh2330l7o3h7eo8hijg8eegl3de180o3gnkhaiagomceac7g0. +FAIL (1234.567).toString(26) should be 1lc.ej7fa4pkf. Was 1lc.ej7fa4pkfb5i3961o8k832hm594h8p558gbk836d. +FAIL (1234.567).toString(27) should be 1ij.f8971772k. Was 1ij.f8971772jicqigbgeln3176612hjc2lmdh055b6kqjq9k7aqemi31c999qkjk182nkm6iioqopj2fgjq2ed907f68i4jmomclqe07mfobmbc8e11h2382hd0pmf0pqcq9k80d52g7a8g9h1eg403e3i6jbiq8la8g9512lip2h9npbe6dcfm30ede5n5m6fhk8a9nbo6g5i2k60908hdo838n720ffna61g20g75fklld5k322hljjqpndeeecgnk9a8of8f1h4eddckqm2qmo22c6p21pi9cmdhfb8o97859385dhnad3ci9kkaff3f0g75925d3m76a2ejoddfci8j7jiq185ggin1b97qhhpqabeq3bhilhhqplq7ij2l4hiddo77hoco44fdm89k726p65h3dmm6a0k8a9p6gpbo1bfld7amqpb853pmoa0mkoq0c92dkq9fhb3me7he34o16bkh6enpoed5baa75epf7c609haq7ki14qkmd7o59i2km330q2dji11ndeka8imo99p4l4k5n7e6h53c4b6ddn0nifo4l1cjh7l30d4daql0o9h117g41lb5p8d8f09oi4l1c6k38hdj7d102oh1k08fhk0fcnqomihi86lf9m98hfm04e90ipcojo2lo481b6k5925cma6gjn8pcnqdc936h8n77de6hf9hc46bgpmahjijllcoc7lbdi6mlm2mn5247kbkaejjemg2ehioi75p64b9q7cae046m1b7eqp74348kqmj643hf40o48na9lm2p3k3cf3eall2aqk7p73h5hgq6k82clgn11kdcb150cq5607jpadoonpp5i78a3lmhnbbq4l8325a03hd7m37fl94igi43cgp0g4hgd5hkpk1gijhea508eqbgdgmbbikh9k67d60hne52lc68c4jf491kj8bi691p91d6a4bg1ppkn3cq0h34oc9b2mj33oollqj5p3c47lg83l32j0kep8jn11mo160667pe18d7kq5m7dh5kfnhl541bc73pjpn5al27a1n9bd0llg74434np75joa3f1fge73g8k28aqd6io. +FAIL (1234.567).toString(28) should be 1g2.foelqia8e. Was 1g2.foelqia8ebflde2c988l. +FAIL (1234.567).toString(29) should be 1dg.gcog9e05q. Was 1dg.gcog9e05po0nh1nj03cbgo1s4id5kf2fqf8nq7rcokr5r63no6b9hj1gnhjbcc4m6kfc7fde17chdp5qbfqc50f2sqjmqoo74sm9k5lskgpr9r8fd5cn9343kr8115oifrk2g7hnnrm1q1es93b3llrihs93si1s3bcjeqrcpbgi0kahhp3d4gpckqmai7019sicnm99i9ssbc783514d47f6qm4m89p5rd0hpear8p3lr0lcigo23bfa0h1c7e0rjh660r8ef5h68f0qb767c22rnlf3223qcaq9ob0ii69f21q8kj29b29f3rs36f56rksdq9438ci9e16hlg3rqm3mj7gmrfsl5662sg7opi1egbap2orejfjghr6oakhgo34s3mdn3p8b94ipfjo64cmhbicgiqk53b4bosjhmi32p0k1iamfqi967a564srpam1h941f6k6mhnp4bf9dkri5qdq4j5fmkl8obhd2697qc2k1s1ekjcqg7oa8akcfkhlorkmqd4hgkh6i74l1apj80kf666p30fh1q9dg8a8ljoeagcjh39139ofgrelf1f6oc8m6ag0gcip89o71sg8befga8n0kie7o227f7qqi3iejklc31n4mghl24d47j895s56a66g73mkp6s5eg1911e04jdc5lkrrrm0gimnm5rc0eoderkjof545drclphj5l3forgmnibdpo4s463rg9ag4nke52mib07hd26jhba5ip94bp2q05b6njlre33mikb8r61l58eii962i6ao6q8iosok7sih21df1c33m4g33fbbke709spj8m0fdnc0rml6c94prrle4614bs1069kck62g48ke386rbknn2sak70slj4j49o39cs6h7eri3lb4n8d7dsa279moms3qg28n26dhddn9j8ckk697j9kn2lk8oo39p099eo71po4hl6255of7m657folsppcc5g39afqbqf5ds0q97a32kkif0omn62hf58g0638brcapql0dbb0og0kjb6cdjdbms3d9pd5h60fi9odqfl6nkh87ja5fs4afrpiqknrif0p6cjqamsj. +FAIL (1234.567).toString(30) should be 1b4.h09. Was 1b4.h0900000048qm7t47k6ehb9has3ibc3cosop9b7f. +FAIL (1234.567).toString(31) should be 18p.hhrfcj3t. Was 18p.hhrfcj3t1k41f3ur475nm0bg1h8gu4g13ce2ne0rm2ir3rpqaee5mf5tgth2o8lguf8e3b88bhpt2r51g78uluu3a1fqftitn46hk0acq4stpemhna1kallplbo232fqtj4ch1mksr0kn38g2g3k9nbttettehjr56st04tcdn6o95guhiqe9a0bcrlmha7ht7e45uet5pk0s3928bjguhhrc4ij98hhpthu95pju4d4097r7ipc1k2b5o8qj9qeck5dfdeqimkp155fh2oe5mfk3abkebaq6j3eubssrjfod3p17is71tqieaf7na99p482sll6jr1oihribth5bg41ha7qd3tenff7g171kfdgut580s2noh9qlq8lckgsiukrt21ongno1jc477rf07cr6d5ujqa7srl1bdkon156619a1o9olmctbiiu1ih28fbjuphcd0ngqijsh8n5h59sfs4qhpdu62jkur6tigkgem50ogh37n3jsrdr4d8h7ta3h84p2iureoimpa31eiott237la8d0b9sqjq9l8ra97m4ldnersbmpun64dl50jf32kop6idibf7bekrr6ppot5utdknbq0lid0fkehoc3ssf6orm3g50h6emfsml0ppc1ae6881duufiuj3e84b6uhon93qk4ame494oclafd1mpprsiaqd8gpi7m5brmq8nrh2nlro7phb7pdli1pb0gfedluh0bjb9ennetsfdjs3u00os2649841h6eiiitq12ik8uoio9fo2ddj124nu17tp4go804hsrm8gih707o1l5efdmq7r5cpde3ai3edu2o3hi7eps3lr8rpindhqu47k22g5f6a3qdkmnreultenpftup2momtqksbhjlk2bbbdbtgb62l3dq392htmfod8msrmh92hkp6rqt675emb0ce5an6gqd2421h7gpol0bkhggt6k9ethhau8005ktd0r68b5r28b7asmhodb0bk6bi290fjpl0ic9ta2u66lhteopo000p60rspseqs4scdqafbqlebui3m33t19o6a465jj27ufu36e5po2i4k6dg3u89l. +PASS (1234.567).toString(32) is "16i.i4jeiu6l" +FAIL (1234.567).toString(33) should be 14d.inf96rdvm. Was 14d.inf96rdvlmnwci9088vbndq4uf4futpirf3tt6bdnmikf5vptow2lfdo9gm6hbr9bvrb7sld6ceb0nm0e6af6b00a24f4s37kschc3ofqlcadm1gqn8uupf16h1vlcoo3pidc6179cdowhp30e3vfhmt67wcsvv39b4ubav6bejs2rfj0g4vdckkgkeemjrlk5v0cqsvnnvq21rpq0lcb25ac0vqu9jniunkjt8343hp8nhha4tlsb70ws36e1cjl78n2qf59fbw1a6ki068ivmrkfc91sbk9mc5uqunumfjobgtfnqk2mgqf8aolom2wur0862bpktrnb452e14w8iwojga2ngb7kd4459ki6mt9pn7a85aseqfmsdl5owmfbtfm002w8sus5tu5afjb03ahekeptae5q2wvvkapng5o1d1jp8bwmcjfnldp3ktrhpl49htmdiq8srejnq3e7ibp217ve3du7ob886cd84wr5su4ac88dhmjsak6rt9tgp1e2wam38vof695m981w7l7g17cc4s7wkmp2aa6rvtc7ebmuqhemi9sanpa01dea47bejtoc8w1w8vm77i09dnnoturoo8v31j9f8lwi7d57bu2lrobhnw154drkcp7w5nmcn5m8sc0fc0tcui26d40tuu4k56qj9ikfawhd71w6v42hpdp0b7ucs3jo6u3i626vim8ramcvp0k7lq0ofcuwdn1wn6kgl5i3qqke7dk7fhfjt3f4mla25cccqcr2eqo6fva2vewgofkpnqlvu280krculq5tcusewm1mhwsa7m1tfb7w1nw7bovkeo5j8g14ohj317j4juo2d4pu0mo1srufah8prdbh53k6fbggh2keqltho0ntnq4fefv3tktrkvssshvtkun4wb5k2q64e9ekvum783qbjm3090ark9va6k6t02b4i0mw25unlq4aepwfnuur40b1ouk3cud9jmofti67ujwwjt958h4bqsrgunw15djw3we5kbudrggkfhmutv8vbndr0ete7k5iljk1cujt5doff9vmndn3db239hw1gjaeo743cin8n9qpwoq9n. +FAIL (1234.567).toString(34) should be 12a.j9fchdtm. Was 12a.j9fchdtm1i0e8edbf0vogn0it8vsx3r8s9s5al8h. +FAIL (1234.567).toString(35) should be 109.jtk4d4d4e. Was 109.jtk4d4d4doflfe7xi169wd6oyjq01vqcl2f150bis1clidgo4vg3nybjteo1lmjwxvahfy6dqnwydgaympbcv0gpgka2bwejgn0u0gutj58og5m4ab2udlvxfofqyjor4tqqrg1ik6nc1elynjm0p43j43691y6cfxirrmynomfo0xt808yft9pevk3ljiwboaq0uyr6h989pn5aexskwpp8kb0hrwe45vomiv7phkl1msuk8tya7aagjndr5fhkia6illwtjqjv8kpg9j1cm9yh60x0udj60cwu5nd12d59p8vg0ws7qvmnwn47sdbxr97o60st8bussl2932ughjiitjna9p6s55bjdkgxeobvk9euc04gu79pna4oqoxcv4522ggbcgo852pn9jayroy86sf2q119hymgrct7gj7gidbi88iow66djcbqg1g5j6fc5umb5fssde5uq3rvc9x0g81eo5ursjb1ptwu18ljskttqiixfmthionnj7l5p7qemqtn9cdr4xnax361l60vistm8pmjifgbh0j9se6rnekyyekn1c80o95ivbpnmewa1ac1p2suh4dkt0p7jmshx5qb92cov6v12wn7dxdr8tit051nctry8yt7jpsfsex4683ywbtcx9cjul52scv1ud7c996cwa1ieshpa4g6ocyvwm786lhhkwsbt0ep0a088xuuomg2hqga2pk7ibsb457ui5cle42t7yj7ugfp2ynivha0bxqs868b5yq59hg3ri3v9b0akxg0xgk3fx4o5pcayb9gv0sm1vhget72g6lp20f1q3i6subc9qkvvytcli037h3w47x9j343wxe53vodb3dyo9q8a4aj4dcysx95k5ose36267be1mdli4tqw7hcj3oaewepe0livh58p1w1vjc3w31m5c4v1ke94qdaml45dulv8gj7k75bwpd97h9emvycbe7akuvjt1v5d37kshsrekjfodf957jnak4agnkbv9993ycb69im9ygwbtptbghi30i4ph89si4l4hcitimvstrxs5tracv16v00adx14wxt1450cvrhxkdyge20q52. +FAIL (1234.567).toString(36) should be ya.kety9sifl. Was ya.kety9sifklzsakqhbyb9. +PASS (1234.567).toString(37) threw exception RangeError: toString() radix argument must be between 2 and 36. +PASS (1234.567).toString(-1) threw exception RangeError: toString() radix argument must be between 2 and 36. +PASS (1234.567).toString(posInf) threw exception RangeError: toString() radix argument must be between 2 and 36. +PASS (1234.567).toString(negInf) threw exception RangeError: toString() radix argument must be between 2 and 36. +PASS posInf.toString() is "Infinity" +PASS negInf.toString() is "-Infinity" +PASS nan.toString() is "NaN" +PASS "" + -0.0 is "0" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/number-toString.js b/deps/v8/test/webkit/fast/js/number-toString.js new file mode 100644 index 0000000..8d99e34 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/number-toString.js @@ -0,0 +1,93 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +var posInf = 1/0; +var negInf = -1/0; +var nan = 0/0; + +shouldBeEqualToString("(0.0).toString(4)", "0"); +shouldBeEqualToString("(-0.0).toString(4)", "0"); +shouldBeEqualToString("(0.0).toString()", "0"); +shouldBeEqualToString("(-0.0).toString()", "0"); + +// From http://bugs.webkit.org/show_bug.cgi?id=5258 +shouldBeEqualToString("(1234.567).toString()", "1234.567"); +shouldThrow("(1234.567).toString(0)"); +// 0 equivilents +shouldThrow("(1234.567).toString(null)"); +shouldThrow("(1234.567).toString(false)"); +shouldThrow("(1234.567).toString('foo')"); +shouldThrow("(1234.567).toString(nan)"); // nan is treated like 0 + +shouldThrow("(1234.567).toString(1)"); +shouldThrow("(1234.567).toString(true)"); +shouldThrow("(1234.567).toString('1')"); + +// These test for Firefox compatibility, the spec is "implementation defined" +shouldBeEqualToString("(1234.567).toString(2)", "10011010010.1001000100100110111010010111100011010101"); +shouldBeEqualToString("(1234.567).toString(3)", "1200201.120022100021001021021002202"); +shouldBeEqualToString("(1234.567).toString(4)", "103102.21010212322113203111"); +shouldBeEqualToString("(1234.567).toString(4.9)", "103102.21010212322113203111"); +shouldBeEqualToString("(1234.567).toString(5)", "14414.240414141414141414"); +shouldBeEqualToString("(1234.567).toString(6)", "5414.32224554134430233"); +shouldBeEqualToString("(1234.567).toString(7)", "3412.365323661111653"); +shouldBeEqualToString("(1234.567).toString(8)", "2322.44223351361524"); +shouldBeEqualToString("(1234.567).toString(9)", "1621.50830703723265"); +shouldBeEqualToString("(1234.567).toString(10)", "1234.567"); +shouldBeEqualToString("(1234.567).toString(11)", "a22.62674a0a5885"); +shouldBeEqualToString("(1234.567).toString(12)", "86a.697938b17701"); +shouldBeEqualToString("(1234.567).toString(13)", "73c.74a91191a65"); +shouldBeEqualToString("(1234.567).toString(14)", "642.7d1bc2caa757"); +shouldBeEqualToString("(1234.567).toString(15)", "574.87895959596"); +shouldBeEqualToString("(1234.567).toString(16)", "4d2.9126e978d5"); +shouldBeEqualToString("(1234.567).toString(17)", "44a.9aeb6faa0da"); +shouldBeEqualToString("(1234.567).toString(18)", "3ea.a3cd7102ac"); +shouldBeEqualToString("(1234.567).toString(19)", "37i.aed102a04d"); +shouldBeEqualToString("(1234.567).toString(20)", "31e.b6g"); +shouldBeEqualToString("(1234.567).toString(21)", "2gg.bj0kf5cfe9"); +shouldBeEqualToString("(1234.567).toString(22)", "2c2.ca9937cak"); +shouldBeEqualToString("(1234.567).toString(23)", "27f.d0lfjb1a7c"); +shouldBeEqualToString("(1234.567).toString(24)", "23a.dee4nj99j"); +shouldBeEqualToString("(1234.567).toString(25)", "1o9.e49999999"); +shouldBeEqualToString("(1234.567).toString(26)", "1lc.ej7fa4pkf"); +shouldBeEqualToString("(1234.567).toString(27)", "1ij.f8971772k"); +shouldBeEqualToString("(1234.567).toString(28)", "1g2.foelqia8e"); +shouldBeEqualToString("(1234.567).toString(29)", "1dg.gcog9e05q"); +shouldBeEqualToString("(1234.567).toString(30)", "1b4.h09"); +shouldBeEqualToString("(1234.567).toString(31)", "18p.hhrfcj3t"); +shouldBeEqualToString("(1234.567).toString(32)", "16i.i4jeiu6l"); +shouldBeEqualToString("(1234.567).toString(33)", "14d.inf96rdvm"); +shouldBeEqualToString("(1234.567).toString(34)", "12a.j9fchdtm"); +shouldBeEqualToString("(1234.567).toString(35)", "109.jtk4d4d4e"); +shouldBeEqualToString("(1234.567).toString(36)", "ya.kety9sifl"); + +shouldThrow("(1234.567).toString(37)"); +shouldThrow("(1234.567).toString(-1)"); +shouldThrow("(1234.567).toString(posInf)"); +shouldThrow("(1234.567).toString(negInf)"); + +shouldBeEqualToString("posInf.toString()", "Infinity"); +shouldBeEqualToString("negInf.toString()", "-Infinity"); +shouldBeEqualToString("nan.toString()", "NaN"); + +shouldBeEqualToString('"" + -0.0', "0"); diff --git a/deps/v8/test/webkit/fast/js/number-tofixed-expected.txt b/deps/v8/test/webkit/fast/js/number-tofixed-expected.txt new file mode 100644 index 0000000..68bfe25 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/number-tofixed-expected.txt @@ -0,0 +1,84 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks a few Number.toFixed cases, including 5307: Number.toFixed does not round 0.5 up and 5308: Number.toFixed does not include leading zero. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS (0).toFixed(0) is '0' +PASS (0.49).toFixed(0) is '0' +PASS (0.5).toFixed(0) is '1' +PASS (0.51).toFixed(0) is '1' +PASS (-0.49).toFixed(0) is '-0' +PASS (-0.5).toFixed(0) is '-1' +PASS (-0.51).toFixed(0) is '-1' +PASS (0).toFixed(1) is '0.0' +PASS (0.449).toFixed(1) is '0.4' +PASS (0.45).toFixed(1) is '0.5' +PASS (0.451).toFixed(1) is '0.5' +PASS (0.5).toFixed(1) is '0.5' +PASS (0.549).toFixed(1) is '0.5' +PASS (0.55).toFixed(1) is '0.6' +PASS (0.551).toFixed(1) is '0.6' +PASS (-0.449).toFixed(1) is '-0.4' +PASS (-0.45).toFixed(1) is '-0.5' +PASS (-0.451).toFixed(1) is '-0.5' +PASS (-0.5).toFixed(1) is '-0.5' +PASS (-0.549).toFixed(1) is '-0.5' +PASS (-0.55).toFixed(1) is '-0.6' +PASS (-0.551).toFixed(1) is '-0.6' +PASS (0.0).toFixed(4) is "0.0000" +PASS (-0.0).toFixed(4) is "0.0000" +PASS (0.0).toFixed() is "0" +PASS (-0.0).toFixed() is "0" +PASS (1234.567).toFixed() is "1235" +PASS (1234.567).toFixed(0) is "1235" +PASS (1234.567).toFixed(null) is "1235" +PASS (1234.567).toFixed(false) is "1235" +PASS (1234.567).toFixed('foo') is "1235" +PASS (1234.567).toFixed(nan) is "1235" +PASS (1234.567).toFixed(1) is "1234.6" +PASS (1234.567).toFixed(true) is "1234.6" +PASS (1234.567).toFixed('1') is "1234.6" +PASS (1234.567).toFixed(2) is "1234.57" +PASS (1234.567).toFixed(2.9) is "1234.57" +PASS (1234.567).toFixed(5) is "1234.56700" +PASS (1234.567).toFixed(20) is "1234.56700000000000727596" +PASS (1234.567).toFixed(21) threw exception RangeError: toFixed() digits argument must be between 0 and 20. +PASS (1234.567).toFixed(100) threw exception RangeError: toFixed() digits argument must be between 0 and 20. +PASS (1234.567).toFixed(101) threw exception RangeError: toFixed() digits argument must be between 0 and 20. +PASS (1234.567).toFixed(-1) threw exception RangeError: toFixed() digits argument must be between 0 and 20. +PASS (1234.567).toFixed(-4) threw exception RangeError: toFixed() digits argument must be between 0 and 20. +PASS (1234.567).toFixed(-5) threw exception RangeError: toFixed() digits argument must be between 0 and 20. +PASS (1234.567).toFixed(-20) threw exception RangeError: toFixed() digits argument must be between 0 and 20. +PASS (1234.567).toFixed(-21) threw exception RangeError: toFixed() digits argument must be between 0 and 20. +PASS (1234.567).toFixed(posInf) threw exception RangeError: toFixed() digits argument must be between 0 and 20. +PASS (1234.567).toFixed(negInf) threw exception RangeError: toFixed() digits argument must be between 0 and 20. +PASS posInf.toFixed() is "Infinity" +PASS negInf.toFixed() is "-Infinity" +PASS nan.toFixed() is "NaN" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/number-tofixed.js b/deps/v8/test/webkit/fast/js/number-tofixed.js new file mode 100644 index 0000000..bb322db --- /dev/null +++ b/deps/v8/test/webkit/fast/js/number-tofixed.js @@ -0,0 +1,102 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( + 'This test checks a few Number.toFixed cases, including ' + + '5307: Number.toFixed does not round 0.5 up' + + ' and ' + + '5308: Number.toFixed does not include leading zero' + + '.'); + +shouldBe("(0).toFixed(0)", "'0'"); + +shouldBe("(0.49).toFixed(0)", "'0'"); +shouldBe("(0.5).toFixed(0)", "'1'"); +shouldBe("(0.51).toFixed(0)", "'1'"); + +shouldBe("(-0.49).toFixed(0)", "'-0'"); +shouldBe("(-0.5).toFixed(0)", "'-1'"); +shouldBe("(-0.51).toFixed(0)", "'-1'"); + +shouldBe("(0).toFixed(1)", "'0.0'"); + +shouldBe("(0.449).toFixed(1)", "'0.4'"); +shouldBe("(0.45).toFixed(1)", "'0.5'"); +shouldBe("(0.451).toFixed(1)", "'0.5'"); +shouldBe("(0.5).toFixed(1)", "'0.5'"); +shouldBe("(0.549).toFixed(1)", "'0.5'"); +shouldBe("(0.55).toFixed(1)", "'0.6'"); +shouldBe("(0.551).toFixed(1)", "'0.6'"); + +shouldBe("(-0.449).toFixed(1)", "'-0.4'"); +shouldBe("(-0.45).toFixed(1)", "'-0.5'"); +shouldBe("(-0.451).toFixed(1)", "'-0.5'"); +shouldBe("(-0.5).toFixed(1)", "'-0.5'"); +shouldBe("(-0.549).toFixed(1)", "'-0.5'"); +shouldBe("(-0.55).toFixed(1)", "'-0.6'"); +shouldBe("(-0.551).toFixed(1)", "'-0.6'"); + +var posInf = 1/0; +var negInf = -1/0; +var nan = 0/0; + +// From Acid3, http://bugs.webkit.org/show_bug.cgi?id=16640 +shouldBeEqualToString("(0.0).toFixed(4)", "0.0000"); +shouldBeEqualToString("(-0.0).toFixed(4)", "0.0000"); +shouldBeEqualToString("(0.0).toFixed()", "0"); +shouldBeEqualToString("(-0.0).toFixed()", "0"); + +// From http://bugs.webkit.org/show_bug.cgi?id=5258 +shouldBeEqualToString("(1234.567).toFixed()", "1235"); +shouldBeEqualToString("(1234.567).toFixed(0)", "1235"); +// 0 equivilents +shouldBeEqualToString("(1234.567).toFixed(null)", "1235"); +shouldBeEqualToString("(1234.567).toFixed(false)", "1235"); +shouldBeEqualToString("(1234.567).toFixed('foo')", "1235"); +shouldBeEqualToString("(1234.567).toFixed(nan)", "1235"); // nan is treated like 0 + +shouldBeEqualToString("(1234.567).toFixed(1)", "1234.6"); +shouldBeEqualToString("(1234.567).toFixed(true)", "1234.6"); // just like 1 +shouldBeEqualToString("(1234.567).toFixed('1')", "1234.6"); // just like 1 + +shouldBeEqualToString("(1234.567).toFixed(2)", "1234.57"); +shouldBeEqualToString("(1234.567).toFixed(2.9)", "1234.57"); +shouldBeEqualToString("(1234.567).toFixed(5)", "1234.56700"); +shouldBeEqualToString("(1234.567).toFixed(20)", "1234.56700000000000727596"); + +// SpiderMonkey allows precision values -20 to 100, the spec only allows 0 to 20 +shouldThrow("(1234.567).toFixed(21)"); +shouldThrow("(1234.567).toFixed(100)"); +shouldThrow("(1234.567).toFixed(101)"); +shouldThrow("(1234.567).toFixed(-1)"); +shouldThrow("(1234.567).toFixed(-4)"); +shouldThrow("(1234.567).toFixed(-5)"); +shouldThrow("(1234.567).toFixed(-20)"); +shouldThrow("(1234.567).toFixed(-21)"); + +shouldThrow("(1234.567).toFixed(posInf)"); +shouldThrow("(1234.567).toFixed(negInf)"); + +shouldBeEqualToString("posInf.toFixed()", "Infinity"); +shouldBeEqualToString("negInf.toFixed()", "-Infinity"); +shouldBeEqualToString("nan.toFixed()", "NaN"); diff --git a/deps/v8/test/webkit/fast/js/number-toprecision-expected.txt b/deps/v8/test/webkit/fast/js/number-toprecision-expected.txt new file mode 100644 index 0000000..6a8a334 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/number-toprecision-expected.txt @@ -0,0 +1,61 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks a few Number.toPrecision cases, including 15145: (0.999).toPrecision(1) returns incorrect result. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS (0.999).toPrecision(1) is "1" +PASS (0.999).toPrecision(2) is "1.0" +PASS (0.999).toPrecision(3) is "0.999" +PASS (0.0).toPrecision(4) is "0.000" +PASS (-0.0).toPrecision(4) is "0.000" +PASS (0.0).toPrecision() is "0" +PASS (-0.0).toPrecision() is "0" +PASS (1234.567).toPrecision() is "1234.567" +PASS (1234.567).toPrecision(0) threw exception RangeError: toPrecision() argument must be between 1 and 21. +PASS (1234.567).toPrecision(null) threw exception RangeError: toPrecision() argument must be between 1 and 21. +PASS (1234.567).toPrecision(false) threw exception RangeError: toPrecision() argument must be between 1 and 21. +PASS (1234.567).toPrecision('foo') threw exception RangeError: toPrecision() argument must be between 1 and 21. +PASS (1234.567).toPrecision(-1) threw exception RangeError: toPrecision() argument must be between 1 and 21. +PASS (1234.567).toPrecision(1) is "1e+3" +PASS (1234.567).toPrecision(true) is "1e+3" +PASS (1234.567).toPrecision('1') is "1e+3" +PASS (1234.567).toPrecision(2) is "1.2e+3" +PASS (1234.567).toPrecision(2.9) is "1.2e+3" +PASS (1234.567).toPrecision(5) is "1234.6" +PASS (1234.567).toPrecision(21) is "1234.56700000000000728" +PASS (1234.567).toPrecision(22) threw exception RangeError: toPrecision() argument must be between 1 and 21. +PASS (1234.567).toPrecision(100) threw exception RangeError: toPrecision() argument must be between 1 and 21. +PASS (1234.567).toPrecision(101) threw exception RangeError: toPrecision() argument must be between 1 and 21. +PASS (1234.567).toPrecision(posInf) threw exception RangeError: toPrecision() argument must be between 1 and 21. +PASS (1234.567).toPrecision(negInf) threw exception RangeError: toPrecision() argument must be between 1 and 21. +PASS (1234.567).toPrecision(nan) threw exception RangeError: toPrecision() argument must be between 1 and 21. +PASS posInf.toPrecision() is "Infinity" +PASS negInf.toPrecision() is "-Infinity" +PASS nan.toPrecision() is "NaN" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/number-toprecision.js b/deps/v8/test/webkit/fast/js/number-toprecision.js new file mode 100644 index 0000000..f829b3c --- /dev/null +++ b/deps/v8/test/webkit/fast/js/number-toprecision.js @@ -0,0 +1,65 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( + 'This test checks a few Number.toPrecision cases, including ' + + '15145: (0.999).toPrecision(1) returns incorrect result' + + '.'); + +shouldBeEqualToString("(0.999).toPrecision(1)", "1"); +shouldBeEqualToString("(0.999).toPrecision(2)", "1.0"); +shouldBeEqualToString("(0.999).toPrecision(3)", "0.999"); + +var posInf = 1/0; +var negInf = -1/0; +var nan = 0/0; + +shouldBeEqualToString("(0.0).toPrecision(4)", "0.000"); +shouldBeEqualToString("(-0.0).toPrecision(4)", "0.000"); +shouldBeEqualToString("(0.0).toPrecision()", "0"); +shouldBeEqualToString("(-0.0).toPrecision()", "0"); +shouldBeEqualToString("(1234.567).toPrecision()", "1234.567"); +shouldThrow("(1234.567).toPrecision(0)"); +shouldThrow("(1234.567).toPrecision(null)"); // just like 0 +shouldThrow("(1234.567).toPrecision(false)"); // just like 0 +shouldThrow("(1234.567).toPrecision('foo')"); // just like 0 +shouldThrow("(1234.567).toPrecision(-1)"); +shouldBeEqualToString("(1234.567).toPrecision(1)", "1e+3"); +shouldBeEqualToString("(1234.567).toPrecision(true)", "1e+3"); // just like 1 +shouldBeEqualToString("(1234.567).toPrecision('1')", "1e+3"); // just like 1 +shouldBeEqualToString("(1234.567).toPrecision(2)", "1.2e+3"); +shouldBeEqualToString("(1234.567).toPrecision(2.9)", "1.2e+3"); +shouldBeEqualToString("(1234.567).toPrecision(5)", "1234.6"); +shouldBeEqualToString("(1234.567).toPrecision(21)", "1234.56700000000000728"); +// SpiderMonkey allows precision values 1 to 100, we implement the spec and only allow 1 to 21. +shouldThrow("(1234.567).toPrecision(22)"); +shouldThrow("(1234.567).toPrecision(100)"); +shouldThrow("(1234.567).toPrecision(101)"); + +shouldThrow("(1234.567).toPrecision(posInf)"); +shouldThrow("(1234.567).toPrecision(negInf)"); +shouldThrow("(1234.567).toPrecision(nan)"); // nan is treated like 0 + +shouldBeEqualToString("posInf.toPrecision()", "Infinity"); +shouldBeEqualToString("negInf.toPrecision()", "-Infinity"); +shouldBeEqualToString("nan.toPrecision()", "NaN"); diff --git a/deps/v8/test/webkit/fast/js/numeric-escapes-in-string-literals-expected.txt b/deps/v8/test/webkit/fast/js/numeric-escapes-in-string-literals-expected.txt new file mode 100644 index 0000000..f5c6fee --- /dev/null +++ b/deps/v8/test/webkit/fast/js/numeric-escapes-in-string-literals-expected.txt @@ -0,0 +1,68 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test numeric escapes in string literals - https://bugs.webkit.org/show_bug.cgi?id=51724 + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS eval(stringLiteral) is nonStrictResult +PASS eval(stringLiteral) is strictResult +PASS eval(stringLiteral) is nonStrictResult +PASS eval(stringLiteral) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS eval(stringLiteral) is nonStrictResult +PASS eval(stringLiteral) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS eval(stringLiteral) is nonStrictResult +FAIL eval(stringLiteral) should throw an exception. Was 8. +PASS eval(stringLiteral) is nonStrictResult +FAIL eval(stringLiteral) should throw an exception. Was 9. +PASS eval(stringLiteral) is nonStrictResult +PASS eval(stringLiteral) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS eval(stringLiteral) is nonStrictResult +PASS eval(stringLiteral) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS eval(stringLiteral) is nonStrictResult +PASS eval(stringLiteral) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS eval(stringLiteral) is nonStrictResult +PASS eval(stringLiteral) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS eval(stringLiteral) is nonStrictResult +PASS eval(stringLiteral) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS eval(stringLiteral) is nonStrictResult +PASS eval(stringLiteral) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS eval(stringLiteral) is nonStrictResult +PASS eval(stringLiteral) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS eval(stringLiteral) is nonStrictResult +PASS eval(stringLiteral) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS eval(stringLiteral) is nonStrictResult +PASS eval(stringLiteral) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS eval(stringLiteral) is nonStrictResult +PASS eval(stringLiteral) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS eval(stringLiteral) is nonStrictResult +PASS eval(stringLiteral) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS eval(stringLiteral) is nonStrictResult +PASS eval(stringLiteral) threw exception SyntaxError: Octal literals are not allowed in strict mode.. +PASS eval(stringLiteral) is nonStrictResult +FAIL eval(stringLiteral) should throw an exception. Was 99. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/numeric-escapes-in-string-literals.js b/deps/v8/test/webkit/fast/js/numeric-escapes-in-string-literals.js new file mode 100644 index 0000000..8ecd70b --- /dev/null +++ b/deps/v8/test/webkit/fast/js/numeric-escapes-in-string-literals.js @@ -0,0 +1,69 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"Test numeric escapes in string literals - https://bugs.webkit.org/show_bug.cgi?id=51724" +); + +function test(_stringLiteral, _nonStrictResult, _strictResult) +{ + stringLiteral = '"' + _stringLiteral + '"'; + nonStrictResult = _nonStrictResult; + shouldBe("eval(stringLiteral)", "nonStrictResult"); + + stringLiteral = '"use strict"; ' + stringLiteral; + if (_strictResult) { + strictResult = _strictResult; + shouldBe("eval(stringLiteral)", "strictResult"); + } else + shouldThrow("eval(stringLiteral)"); +} + +// Tests for single digit octal and decimal escapes. +// In non-strict mode 0-7 are octal escapes, 8-9 are NonEscapeCharacters. +// In strict mode only "\0" is permitted. +test("\\0", "\x00", "\x00"); +test("\\1", "\x01"); +test("\\7", "\x07"); +test("\\8", "8"); +test("\\9", "9"); + +// Tests for multi-digit octal values outside strict mode; +// Octal literals may be 1-3 digits long. In strict more all multi-digit sequences are illegal. +test("\\00", "\x00"); +test("\\000", "\x00"); +test("\\0000", "\x000"); + +test("\\01", "\x01"); +test("\\001", "\x01"); +test("\\0001", "\x001"); + +test("\\10", "\x08"); +test("\\100", "\x40"); +test("\\1000", "\x400"); + +test("\\19", "\x019"); +test("\\109", "\x089"); +test("\\1009", "\x409"); + +test("\\99", "99"); diff --git a/deps/v8/test/webkit/fast/js/object-bad-time-expected.txt b/deps/v8/test/webkit/fast/js/object-bad-time-expected.txt new file mode 100644 index 0000000..b282bd8 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/object-bad-time-expected.txt @@ -0,0 +1,1034 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Tests that defining a setter on the prototype of an object used for indexed storage works even if it is done after objects with indexed storage are allocated. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +PASS "0,1,2,3,4" is "0,1,2,3,4" +Henceforth I will have a bad time. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL ouches should be 50. Was 0. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/object-bad-time.js b/deps/v8/test/webkit/fast/js/object-bad-time.js new file mode 100644 index 0000000..2fdb2d1 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/object-bad-time.js @@ -0,0 +1,58 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"Tests that defining a setter on the prototype of an object used for indexed storage works even if it is done after objects with indexed storage are allocated." +); + +function Cons() { +} + +var ouches = 0; + +function foo(haveABadTime) { + var result = new Cons(); + result.length = 5; + for (var i = 0; i < result.length; ++i) { + if (i == haveABadTime) { + debug("Henceforth I will have a bad time."); + Cons.prototype.__defineSetter__("3", function() { debug("Ouch!"); ouches++; }); + } + result[i] = i; + } + return result; +} + +var expected = "\"0,1,2,3,4\""; + +for (var i = 0; i < 1000; ++i) { + var haveABadTime; + if (i == 950) { + haveABadTime = 2; + expected = "\"0,1,2,,4\""; + } else + haveABadTime = -1; + shouldBe("\"" + Array.prototype.join.apply(foo(haveABadTime), [","]) + "\"", expected); +} + +shouldBe("ouches", "50"); diff --git a/deps/v8/test/webkit/fast/js/object-extra-comma-expected.txt b/deps/v8/test/webkit/fast/js/object-extra-comma-expected.txt new file mode 100644 index 0000000..22511af --- /dev/null +++ b/deps/v8/test/webkit/fast/js/object-extra-comma-expected.txt @@ -0,0 +1,37 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks some object construction cases, including 5939: final comma in javascript object prevents parsing. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS var foo = { 'bar' : 'YES' }; foo.bar is 'YES' +PASS var foo = { 'bar' : 'YES', }; foo.bar is 'YES' +PASS var foo = { 'bar' : 'YES' , }; foo.bar is 'YES' +PASS var foo = { , 'bar' : 'YES' }; foo.bar threw exception SyntaxError: Unexpected token ,. +PASS var foo = { 'bar' : 'YES',, }; foo.bar threw exception SyntaxError: Unexpected token ,. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/object-extra-comma.js b/deps/v8/test/webkit/fast/js/object-extra-comma.js new file mode 100644 index 0000000..720ff0c --- /dev/null +++ b/deps/v8/test/webkit/fast/js/object-extra-comma.js @@ -0,0 +1,33 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( + 'This test checks some object construction cases, including ' + + '5939: final comma in javascript object prevents parsing' + + '.'); + +shouldBe("var foo = { 'bar' : 'YES' }; foo.bar", "'YES'"); +shouldBe("var foo = { 'bar' : 'YES', }; foo.bar", "'YES'"); +shouldBe("var foo = { 'bar' : 'YES' , }; foo.bar", "'YES'"); +shouldThrow("var foo = { , 'bar' : 'YES' }; foo.bar"); +shouldThrow("var foo = { 'bar' : 'YES',, }; foo.bar"); diff --git a/deps/v8/test/webkit/fast/js/object-prototype-constructor-expected.txt b/deps/v8/test/webkit/fast/js/object-prototype-constructor-expected.txt new file mode 100644 index 0000000..0a95e5c --- /dev/null +++ b/deps/v8/test/webkit/fast/js/object-prototype-constructor-expected.txt @@ -0,0 +1,38 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This is a test case for bug 3537. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS f.constructor is Foo.Bar +PASS typeof f.constructor is "function" +PASS f2.constructor is Foo2.Bar +PASS typeof f2.constructor is "function" +PASS f3.constructor is Foo3.Bar +PASS typeof f3.constructor is "function" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/object-prototype-constructor.js b/deps/v8/test/webkit/fast/js/object-prototype-constructor.js new file mode 100644 index 0000000..d3031ae --- /dev/null +++ b/deps/v8/test/webkit/fast/js/object-prototype-constructor.js @@ -0,0 +1,42 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'This is a test case for bug 3537.' +); + +var Foo = { Bar: function () {}}; +var f = new Foo.Bar(); +shouldBe("f.constructor", "Foo.Bar"); +shouldBe("typeof f.constructor", '"function"'); + +function F() {}; +var Foo2 = { Bar: F}; +var f2 = new Foo2.Bar(); +shouldBe("f2.constructor", "Foo2.Bar"); +shouldBe("typeof f2.constructor", '"function"'); + +var Foo3 = { Bar: new Function("")}; +var f3 = new Foo3.Bar(); +shouldBe("f3.constructor", "Foo3.Bar"); +shouldBe("typeof f3.constructor", '"function"'); diff --git a/deps/v8/test/webkit/fast/js/object-prototype-properties-expected.txt b/deps/v8/test/webkit/fast/js/object-prototype-properties-expected.txt new file mode 100644 index 0000000..0d936f6 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/object-prototype-properties-expected.txt @@ -0,0 +1,39 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This is a test case for bug 64678. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS Object.prototype.toString.call(undefined) is "[object Undefined]" +PASS Object.prototype.toString.call(null) is "[object Null]" +PASS Object.prototype.toLocaleString.call(undefined) threw exception TypeError: Object.prototype.toLocaleString called on null or undefined. +PASS Object.prototype.valueOf.call(undefined) threw exception TypeError: Cannot convert undefined or null to object. +PASS Object.prototype.hasOwnProperty.call(undefined, 'hasOwnProperty') threw exception TypeError: Cannot convert undefined or null to object. +PASS Object.prototype.propertyIsEnumerable.call(undefined, 'propertyIsEnumerable') threw exception TypeError: Cannot convert undefined or null to object. +PASS Object.prototype.isPrototypeOf.call(undefined, this) threw exception TypeError: Object.prototype.isPrototypeOf called on null or undefined. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/object-prototype-properties.js b/deps/v8/test/webkit/fast/js/object-prototype-properties.js new file mode 100644 index 0000000..76b40e4 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/object-prototype-properties.js @@ -0,0 +1,37 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'This is a test case for bug 64678.' +); + +//ES 5.1 allows for Object.prototype.toString being called with undefined/null. +shouldBe("Object.prototype.toString.call(undefined)", '"[object Undefined]"'); +shouldBe("Object.prototype.toString.call(null)", '"[object Null]"'); + +// These calls pass undefined as this value, and as such should throw in toObject. +shouldThrow("Object.prototype.toLocaleString.call(undefined)"); +shouldThrow("Object.prototype.valueOf.call(undefined)"); +shouldThrow("Object.prototype.hasOwnProperty.call(undefined, 'hasOwnProperty')"); +shouldThrow("Object.prototype.propertyIsEnumerable.call(undefined, 'propertyIsEnumerable')"); +shouldThrow("Object.prototype.isPrototypeOf.call(undefined, this)"); diff --git a/deps/v8/test/webkit/fast/js/object-prototype-toLocaleString-expected.txt b/deps/v8/test/webkit/fast/js/object-prototype-toLocaleString-expected.txt new file mode 100644 index 0000000..ee7987d --- /dev/null +++ b/deps/v8/test/webkit/fast/js/object-prototype-toLocaleString-expected.txt @@ -0,0 +1,36 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Tests: Object.prototype.toLocaleString(). Related bug: 3989 JSC doesn't implement Object.prototype.toLocaleString() + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS o.toLocaleString() is o.toString() +PASS o.toLocaleString() is "Dynamic toLocaleString()" +PASS Object.prototype.toLocaleString.call('Hello, world!') is "Hello, world!" +PASS Object.prototype.toLocaleString.call('Hello, world!') is "stringPrototypeToString" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/object-prototype-toLocaleString.js b/deps/v8/test/webkit/fast/js/object-prototype-toLocaleString.js new file mode 100644 index 0000000..213b5b9 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/object-prototype-toLocaleString.js @@ -0,0 +1,38 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'Tests: Object.prototype.toLocaleString(). Related bug: 3989 JSC doesn\'t implement Object.prototype.toLocaleString()' +); + +var o = new Object(); +shouldBe("o.toLocaleString()", "o.toString()"); +o.toLocaleString = function () { return "Dynamic toLocaleString()"; } +shouldBe("o.toLocaleString()", '"Dynamic toLocaleString()"'); + +shouldBe("Object.prototype.toLocaleString.call('Hello, world!')", '"Hello, world!"'); + +var stringPrototypeToString = String.prototype.toString; +String.prototype.toString = (function(){ return "stringPrototypeToString"; }); +shouldBe("Object.prototype.toLocaleString.call('Hello, world!')", '"stringPrototypeToString"'); +String.prototype.toString = stringPrototypeToString; diff --git a/deps/v8/test/webkit/fast/js/object-slow-put-expected.txt b/deps/v8/test/webkit/fast/js/object-slow-put-expected.txt new file mode 100644 index 0000000..901133b --- /dev/null +++ b/deps/v8/test/webkit/fast/js/object-slow-put-expected.txt @@ -0,0 +1,133 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Tests that defining a setter on the prototype of an object used for indexed storage works. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL "0,1,2,3,4" should be 0,1,2,,4. Was 0,1,2,3,4. +FAIL ouches should be 100. Was 0. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/object-slow-put.js b/deps/v8/test/webkit/fast/js/object-slow-put.js new file mode 100644 index 0000000..bf8234f --- /dev/null +++ b/deps/v8/test/webkit/fast/js/object-slow-put.js @@ -0,0 +1,45 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"Tests that defining a setter on the prototype of an object used for indexed storage works." +); + +function Cons() { +} + +var ouches = 0; +Cons.prototype.__defineSetter__("3", function() { debug("Ouch!"); ouches++; }); + +function foo() { + var result = new Cons(); + result.length = 5; + for (var i = 0; i < result.length; ++i) + result[i] = i; + return result; +} + +for (var i = 0; i < 100; ++i) + shouldBe("\"" + Array.prototype.join.apply(foo(), [","]) + "\"", "\"0,1,2,,4\""); + +shouldBe("ouches", "100"); diff --git a/deps/v8/test/webkit/fast/js/parser-syntax-check-expected.txt b/deps/v8/test/webkit/fast/js/parser-syntax-check-expected.txt new file mode 100644 index 0000000..32819e7 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/parser-syntax-check-expected.txt @@ -0,0 +1,611 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks that the following expressions or statements are valid ECMASCRIPT code or should throw parse error + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +Unary operators and member access +PASS Valid: "" +PASS Valid: "function f() { }" +PASS Invalid: "(a" +PASS Invalid: "function f() { (a }" +PASS Invalid: "a[5" +PASS Invalid: "function f() { a[5 }" +PASS Invalid: "a[5 + 6" +PASS Invalid: "function f() { a[5 + 6 }" +PASS Invalid: "a." +PASS Invalid: "function f() { a. }" +PASS Invalid: "()" +PASS Invalid: "function f() { () }" +PASS Invalid: "a.'l'" +PASS Invalid: "function f() { a.'l' }" +PASS Valid: "a: +~!new a" +PASS Valid: "function f() { a: +~!new a }" +PASS Invalid: "new -a" +PASS Invalid: "function f() { new -a }" +PASS Valid: "new (-1)" +PASS Valid: "function f() { new (-1) }" +PASS Valid: "a: b: c: new f(x++)++" +PASS Valid: "function f() { a: b: c: new f(x++)++ }" +PASS Valid: "(a)++" +PASS Valid: "function f() { (a)++ }" +PASS Valid: "(1--).x" +PASS Valid: "function f() { (1--).x }" +PASS Invalid: "a-- ++" +PASS Invalid: "function f() { a-- ++ }" +PASS Invalid: "(a:) --b" +PASS Invalid: "function f() { (a:) --b }" +PASS Valid: "++ -- ++ a" +PASS Valid: "function f() { ++ -- ++ a }" +PASS Valid: "++ new new a ++" +PASS Valid: "function f() { ++ new new a ++ }" +PASS Valid: "delete void 0" +PASS Valid: "function f() { delete void 0 }" +PASS Invalid: "delete the void" +PASS Invalid: "function f() { delete the void }" +PASS Invalid: "(a++" +PASS Invalid: "function f() { (a++ }" +PASS Valid: "++a--" +PASS Valid: "function f() { ++a-- }" +PASS Valid: "++((a))--" +PASS Valid: "function f() { ++((a))-- }" +PASS Valid: "(a.x++)++" +PASS Valid: "function f() { (a.x++)++ }" +PASS Invalid: "1: null" +PASS Invalid: "function f() { 1: null }" +PASS Invalid: "+-!~" +PASS Invalid: "function f() { +-!~ }" +PASS Invalid: "+-!~((" +PASS Invalid: "function f() { +-!~(( }" +PASS Invalid: "a)" +PASS Invalid: "function f() { a) }" +PASS Invalid: "a]" +PASS Invalid: "function f() { a] }" +PASS Invalid: ".l" +PASS Invalid: "function f() { .l }" +PASS Invalid: "1.l" +PASS Invalid: "function f() { 1.l }" +PASS Valid: "1 .l" +PASS Valid: "function f() { 1 .l }" +Binary and conditional operators +PASS Valid: "a + + typeof this" +PASS Valid: "function f() { a + + typeof this }" +PASS Invalid: "a + * b" +PASS Invalid: "function f() { a + * b }" +PASS Invalid: "a ? b" +PASS Invalid: "function f() { a ? b }" +PASS Invalid: "a ? b :" +PASS Invalid: "function f() { a ? b : }" +PASS Invalid: "%a" +PASS Invalid: "function f() { %a }" +PASS Invalid: "a-" +PASS Invalid: "function f() { a- }" +PASS Valid: "a = b ? b = c : d = e" +PASS Valid: "function f() { a = b ? b = c : d = e }" +PASS Valid: "s: a[1].l ? b.l['s'] ? c++ : d : true" +PASS Valid: "function f() { s: a[1].l ? b.l['s'] ? c++ : d : true }" +PASS Valid: "a ? b + 1 ? c + 3 * d.l : d[5][6] : e" +PASS Valid: "function f() { a ? b + 1 ? c + 3 * d.l : d[5][6] : e }" +PASS Valid: "a in b instanceof delete -c" +PASS Valid: "function f() { a in b instanceof delete -c }" +PASS Invalid: "a in instanceof b.l" +PASS Invalid: "function f() { a in instanceof b.l }" +PASS Valid: "- - true % 5" +PASS Valid: "function f() { - - true % 5 }" +FAIL Invalid: "- false = 3" should throw undefined +FAIL Invalid: "function f() { - false = 3 }" should throw undefined +PASS Valid: "a: b: c: (1 + null) = 3" +PASS Valid: "function f() { a: b: c: (1 + null) = 3 }" +PASS Valid: "a[2] = b.l += c /= 4 * 7 ^ !6" +PASS Valid: "function f() { a[2] = b.l += c /= 4 * 7 ^ !6 }" +FAIL Invalid: "a + typeof b += c in d" should throw undefined +FAIL Invalid: "function f() { a + typeof b += c in d }" should throw undefined +FAIL Invalid: "typeof a &= typeof b" should throw undefined +FAIL Invalid: "function f() { typeof a &= typeof b }" should throw undefined +PASS Valid: "a: ((typeof (a))) >>>= a || b.l && c" +PASS Valid: "function f() { a: ((typeof (a))) >>>= a || b.l && c }" +PASS Valid: "a: b: c[a /= f[a %= b]].l[c[x] = 7] -= a ? b <<= f : g" +PASS Valid: "function f() { a: b: c[a /= f[a %= b]].l[c[x] = 7] -= a ? b <<= f : g }" +PASS Valid: "-void+x['y'].l == x.l != 5 - f[7]" +PASS Valid: "function f() { -void+x['y'].l == x.l != 5 - f[7] }" +Function calls (and new with arguments) +PASS Valid: "a()()()" +PASS Valid: "function f() { a()()() }" +PASS Valid: "s: l: a[2](4 == 6, 5 = 6)(f[4], 6)" +PASS Valid: "function f() { s: l: a[2](4 == 6, 5 = 6)(f[4], 6) }" +PASS Valid: "s: eval(a.apply(), b.call(c[5] - f[7]))" +PASS Valid: "function f() { s: eval(a.apply(), b.call(c[5] - f[7])) }" +PASS Invalid: "a(" +PASS Invalid: "function f() { a( }" +PASS Invalid: "a(5" +PASS Invalid: "function f() { a(5 }" +PASS Invalid: "a(5," +PASS Invalid: "function f() { a(5, }" +PASS Invalid: "a(5,)" +PASS Invalid: "function f() { a(5,) }" +PASS Invalid: "a(5,6" +PASS Invalid: "function f() { a(5,6 }" +PASS Valid: "a(b[7], c e.l, new a() > b)" +PASS Valid: "function f() { a(b[7], c e.l, new a() > b) }" +PASS Invalid: "a(b[5)" +PASS Invalid: "function f() { a(b[5) }" +PASS Invalid: "a(b.)" +PASS Invalid: "function f() { a(b.) }" +PASS Valid: "~new new a(1)(i++)(c[l])" +PASS Valid: "function f() { ~new new a(1)(i++)(c[l]) }" +PASS Invalid: "a(*a)" +PASS Invalid: "function f() { a(*a) }" +PASS Valid: "((((a))((b)()).l))()" +PASS Valid: "function f() { ((((a))((b)()).l))() }" +PASS Valid: "(a)[b + (c) / (d())].l--" +PASS Valid: "function f() { (a)[b + (c) / (d())].l-- }" +PASS Valid: "new (5)" +PASS Valid: "function f() { new (5) }" +PASS Invalid: "new a(5" +PASS Invalid: "function f() { new a(5 }" +PASS Valid: "new (f + 5)(6, (g)() - 'l'() - true(false))" +PASS Valid: "function f() { new (f + 5)(6, (g)() - 'l'() - true(false)) }" +PASS Invalid: "a(.length)" +PASS Invalid: "function f() { a(.length) }" +function declaration and expression +PASS Valid: "function f() {}" +PASS Valid: "function f() { function f() {} }" +PASS Valid: "function f(a,b) {}" +PASS Valid: "function f() { function f(a,b) {} }" +PASS Invalid: "function () {}" +PASS Invalid: "function f() { function () {} }" +PASS Invalid: "function f(a b) {}" +PASS Invalid: "function f() { function f(a b) {} }" +PASS Invalid: "function f(a,) {}" +PASS Invalid: "function f() { function f(a,) {} }" +PASS Invalid: "function f(a," +PASS Invalid: "function f() { function f(a, }" +PASS Invalid: "function f(a, 1) {}" +PASS Invalid: "function f() { function f(a, 1) {} }" +PASS Valid: "function g(arguments, eval) {}" +PASS Valid: "function f() { function g(arguments, eval) {} }" +PASS Valid: "function f() {} + function g() {}" +PASS Valid: "function f() { function f() {} + function g() {} }" +PASS Invalid: "(function a{})" +PASS Invalid: "function f() { (function a{}) }" +PASS Invalid: "(function this(){})" +PASS Invalid: "function f() { (function this(){}) }" +PASS Valid: "(delete new function f(){} + function(a,b){}(5)(6))" +PASS Valid: "function f() { (delete new function f(){} + function(a,b){}(5)(6)) }" +PASS Valid: "6 - function (m) { function g() {} }" +PASS Valid: "function f() { 6 - function (m) { function g() {} } }" +PASS Invalid: "function l() {" +PASS Invalid: "function f() { function l() { }" +PASS Invalid: "function l++(){}" +PASS Invalid: "function f() { function l++(){} }" +Array and object literal, comma operator +PASS Valid: "[] in [5,6] * [,5,] / [,,5,,] || [a,] && new [,b] % [,,]" +PASS Valid: "function f() { [] in [5,6] * [,5,] / [,,5,,] || [a,] && new [,b] % [,,] }" +PASS Invalid: "[5," +PASS Invalid: "function f() { [5, }" +PASS Invalid: "[," +PASS Invalid: "function f() { [, }" +PASS Invalid: "(a,)" +PASS Invalid: "function f() { (a,) }" +PASS Valid: "1 + {get get(){}, set set(a){}, get1:4, set1:get-set, }" +PASS Valid: "function f() { 1 + {get get(){}, set set(a){}, get1:4, set1:get-set, } }" +PASS Invalid: "1 + {a" +PASS Invalid: "function f() { 1 + {a }" +PASS Invalid: "1 + {a:" +PASS Invalid: "function f() { 1 + {a: }" +PASS Invalid: "1 + {get l(" +PASS Invalid: "function f() { 1 + {get l( }" +PASS Invalid: ",a" +PASS Invalid: "function f() { ,a }" +PASS Valid: "(4,(5,a(3,4))),f[4,a-6]" +PASS Valid: "function f() { (4,(5,a(3,4))),f[4,a-6] }" +PASS Invalid: "(,f)" +PASS Invalid: "function f() { (,f) }" +PASS Invalid: "a,,b" +PASS Invalid: "function f() { a,,b }" +PASS Invalid: "a ? b, c : d" +PASS Invalid: "function f() { a ? b, c : d }" +simple statements +PASS Valid: "{ }" +PASS Valid: "function f() { { } }" +PASS Invalid: "{ { }" +PASS Invalid: "function f() { { { } }" +PASS Valid: "{ ; ; ; }" +PASS Valid: "function f() { { ; ; ; } }" +PASS Valid: "a: { ; }" +PASS Valid: "function f() { a: { ; } }" +PASS Invalid: "{ a: }" +PASS Invalid: "function f() { { a: } }" +PASS Valid: "{} f; { 6 + f() }" +PASS Valid: "function f() { {} f; { 6 + f() } }" +PASS Valid: "{ a[5],6; {} ++b-new (-5)() } c().l++" +PASS Valid: "function f() { { a[5],6; {} ++b-new (-5)() } c().l++ }" +PASS Valid: "{ l1: l2: l3: { this } a = 32 ; { i++ ; { { { } } ++i } } }" +PASS Valid: "function f() { { l1: l2: l3: { this } a = 32 ; { i++ ; { { { } } ++i } } } }" +PASS Valid: "if (a) ;" +PASS Valid: "function f() { if (a) ; }" +PASS Invalid: "{ if (a) }" +PASS Invalid: "function f() { { if (a) } }" +PASS Invalid: "if a {}" +PASS Invalid: "function f() { if a {} }" +PASS Invalid: "if (a" +PASS Invalid: "function f() { if (a }" +PASS Invalid: "if (a { }" +PASS Invalid: "function f() { if (a { } }" +PASS Valid: "x: s: if (a) ; else b" +PASS Valid: "function f() { x: s: if (a) ; else b }" +PASS Invalid: "else {}" +PASS Invalid: "function f() { else {} }" +PASS Valid: "if (a) if (b) y; else {} else ;" +PASS Valid: "function f() { if (a) if (b) y; else {} else ; }" +PASS Invalid: "if (a) {} else x; else" +PASS Invalid: "function f() { if (a) {} else x; else }" +PASS Invalid: "if (a) { else }" +PASS Invalid: "function f() { if (a) { else } }" +PASS Valid: "if (a.l + new b()) 4 + 5 - f()" +PASS Valid: "function f() { if (a.l + new b()) 4 + 5 - f() }" +PASS Valid: "if (a) with (x) ; else with (y) ;" +PASS Valid: "function f() { if (a) with (x) ; else with (y) ; }" +PASS Invalid: "with a.b { }" +PASS Invalid: "function f() { with a.b { } }" +PASS Valid: "while (a() - new b) ;" +PASS Valid: "function f() { while (a() - new b) ; }" +PASS Invalid: "while a {}" +PASS Invalid: "function f() { while a {} }" +PASS Valid: "do ; while(0) i++" +PASS Valid: "function f() { do ; while(0) i++ }" +PASS Valid: "do if (a) x; else y; while(z)" +PASS Valid: "function f() { do if (a) x; else y; while(z) }" +PASS Invalid: "do g; while 4" +PASS Invalid: "function f() { do g; while 4 }" +PASS Invalid: "do g; while ((4)" +PASS Invalid: "function f() { do g; while ((4) }" +PASS Valid: "{ { do do do ; while(0) while(0) while(0) } }" +PASS Valid: "function f() { { { do do do ; while(0) while(0) while(0) } } }" +PASS Valid: "do while (0) if (a) {} else y; while(0)" +PASS Valid: "function f() { do while (0) if (a) {} else y; while(0) }" +PASS Valid: "if (a) while (b) if (c) with(d) {} else e; else f" +PASS Valid: "function f() { if (a) while (b) if (c) with(d) {} else e; else f }" +PASS Invalid: "break ; break your_limits ; continue ; continue living ; debugger" +PASS Invalid: "function f() { break ; break your_limits ; continue ; continue living ; debugger }" +PASS Invalid: "debugger X" +PASS Invalid: "function f() { debugger X }" +PASS Invalid: "break 0.2" +PASS Invalid: "function f() { break 0.2 }" +PASS Invalid: "continue a++" +PASS Invalid: "function f() { continue a++ }" +PASS Invalid: "continue (my_friend)" +PASS Invalid: "function f() { continue (my_friend) }" +PASS Valid: "while (1) break" +PASS Valid: "function f() { while (1) break }" +PASS Valid: "do if (a) with (b) continue; else debugger; while (false)" +PASS Valid: "function f() { do if (a) with (b) continue; else debugger; while (false) }" +PASS Invalid: "do if (a) while (false) else debugger" +PASS Invalid: "function f() { do if (a) while (false) else debugger }" +PASS Invalid: "while if (a) ;" +PASS Invalid: "function f() { while if (a) ; }" +PASS Valid: "if (a) function f() {} else function g() {}" +PASS Valid: "function f() { if (a) function f() {} else function g() {} }" +PASS Valid: "if (a()) while(0) function f() {} else function g() {}" +PASS Valid: "function f() { if (a()) while(0) function f() {} else function g() {} }" +PASS Invalid: "if (a()) function f() { else function g() }" +PASS Invalid: "function f() { if (a()) function f() { else function g() } }" +PASS Invalid: "if (a) if (b) ; else function f {}" +PASS Invalid: "function f() { if (a) if (b) ; else function f {} }" +PASS Invalid: "if (a) if (b) ; else function (){}" +PASS Invalid: "function f() { if (a) if (b) ; else function (){} }" +PASS Valid: "throw a" +PASS Valid: "function f() { throw a }" +PASS Valid: "throw a + b in void c" +PASS Valid: "function f() { throw a + b in void c }" +PASS Invalid: "throw" +PASS Invalid: "function f() { throw }" +var and const statements +PASS Valid: "var a, b = null" +PASS Valid: "function f() { var a, b = null }" +PASS Valid: "const a = 5, b, c" +PASS Valid: "function f() { const a = 5, b, c }" +PASS Invalid: "var" +PASS Invalid: "function f() { var }" +PASS Invalid: "var = 7" +PASS Invalid: "function f() { var = 7 }" +PASS Invalid: "var c (6)" +PASS Invalid: "function f() { var c (6) }" +PASS Valid: "if (a) var a,b; else const b, c" +PASS Valid: "function f() { if (a) var a,b; else const b, c }" +PASS Invalid: "var 5 = 6" +PASS Invalid: "function f() { var 5 = 6 }" +PASS Valid: "while (0) var a, b, c=6, d, e, f=5*6, g=f*h, h" +PASS Valid: "function f() { while (0) var a, b, c=6, d, e, f=5*6, g=f*h, h }" +PASS Invalid: "var a = if (b) { c }" +PASS Invalid: "function f() { var a = if (b) { c } }" +PASS Invalid: "var a = var b" +PASS Invalid: "function f() { var a = var b }" +PASS Valid: "const a = b += c, a, a, a = (b - f())" +PASS Valid: "function f() { const a = b += c, a, a, a = (b - f()) }" +PASS Invalid: "var a %= b | 5" +PASS Invalid: "function f() { var a %= b | 5 }" +PASS Invalid: "var (a) = 5" +PASS Invalid: "function f() { var (a) = 5 }" +PASS Invalid: "var a = (4, b = 6" +PASS Invalid: "function f() { var a = (4, b = 6 }" +PASS Invalid: "const 'l' = 3" +PASS Invalid: "function f() { const 'l' = 3 }" +PASS Invalid: "var var = 3" +PASS Invalid: "function f() { var var = 3 }" +PASS Valid: "var varr = 3 in 1" +PASS Valid: "function f() { var varr = 3 in 1 }" +PASS Valid: "const a, a, a = void 7 - typeof 8, a = 8" +PASS Valid: "function f() { const a, a, a = void 7 - typeof 8, a = 8 }" +PASS Valid: "const x_x = 6 /= 7 ? e : f" +PASS Valid: "function f() { const x_x = 6 /= 7 ? e : f }" +PASS Invalid: "var a = ?" +PASS Invalid: "function f() { var a = ? }" +PASS Invalid: "const a = *7" +PASS Invalid: "function f() { const a = *7 }" +PASS Invalid: "var a = :)" +PASS Invalid: "function f() { var a = :) }" +PASS Valid: "var a = a in b in c instanceof d" +PASS Valid: "function f() { var a = a in b in c instanceof d }" +PASS Invalid: "var a = b ? c, b" +PASS Invalid: "function f() { var a = b ? c, b }" +PASS Invalid: "const a = b : c" +PASS Invalid: "function f() { const a = b : c }" +for statement +PASS Valid: "for ( ; ; ) { break }" +PASS Valid: "function f() { for ( ; ; ) { break } }" +PASS Valid: "for ( a ; ; ) { break }" +PASS Valid: "function f() { for ( a ; ; ) { break } }" +PASS Valid: "for ( ; a ; ) { break }" +PASS Valid: "function f() { for ( ; a ; ) { break } }" +PASS Valid: "for ( ; ; a ) { break }" +PASS Valid: "function f() { for ( ; ; a ) { break } }" +PASS Valid: "for ( a ; a ; ) break" +PASS Valid: "function f() { for ( a ; a ; ) break }" +PASS Valid: "for ( a ; ; a ) break" +PASS Valid: "function f() { for ( a ; ; a ) break }" +PASS Valid: "for ( ; a ; a ) break" +PASS Valid: "function f() { for ( ; a ; a ) break }" +PASS Invalid: "for () { }" +PASS Invalid: "function f() { for () { } }" +PASS Invalid: "for ( a ) { }" +PASS Invalid: "function f() { for ( a ) { } }" +PASS Invalid: "for ( ; ) ;" +PASS Invalid: "function f() { for ( ; ) ; }" +PASS Invalid: "for a ; b ; c { }" +PASS Invalid: "function f() { for a ; b ; c { } }" +PASS Invalid: "for (a ; { }" +PASS Invalid: "function f() { for (a ; { } }" +PASS Invalid: "for ( a ; ) ;" +PASS Invalid: "function f() { for ( a ; ) ; }" +PASS Invalid: "for ( ; a ) break" +PASS Invalid: "function f() { for ( ; a ) break }" +PASS Valid: "for (var a, b ; ; ) { break } " +PASS Valid: "function f() { for (var a, b ; ; ) { break } }" +PASS Valid: "for (var a = b, b = a ; ; ) break" +PASS Valid: "function f() { for (var a = b, b = a ; ; ) break }" +PASS Valid: "for (var a = b, c, d, b = a ; x in b ; ) { break }" +PASS Valid: "function f() { for (var a = b, c, d, b = a ; x in b ; ) { break } }" +PASS Valid: "for (var a = b, c, d ; ; 1 in a()) break" +PASS Valid: "function f() { for (var a = b, c, d ; ; 1 in a()) break }" +PASS Invalid: "for ( ; var a ; ) break" +PASS Invalid: "function f() { for ( ; var a ; ) break }" +FAIL Invalid: "for (const a; ; ) break" should throw undefined +FAIL Invalid: "function f() { for (const a; ; ) break }" should throw undefined +PASS Invalid: "for ( %a ; ; ) { }" +PASS Invalid: "function f() { for ( %a ; ; ) { } }" +PASS Valid: "for (a in b) break" +PASS Valid: "function f() { for (a in b) break }" +PASS Valid: "for (a() in b) break" +PASS Valid: "function f() { for (a() in b) break }" +PASS Valid: "for (a().l[4] in b) break" +PASS Valid: "function f() { for (a().l[4] in b) break }" +PASS Valid: "for (new a in b in c in d) break" +PASS Valid: "function f() { for (new a in b in c in d) break }" +PASS Valid: "for (new new new a in b) break" +PASS Valid: "function f() { for (new new new a in b) break }" +FAIL Invalid: "for (delete new a() in b) break" should throw undefined +FAIL Invalid: "function f() { for (delete new a() in b) break }" should throw undefined +FAIL Invalid: "for (a * a in b) break" should throw undefined +FAIL Invalid: "function f() { for (a * a in b) break }" should throw undefined +PASS Valid: "for ((a * a) in b) break" +PASS Valid: "function f() { for ((a * a) in b) break }" +FAIL Invalid: "for (a++ in b) break" should throw undefined +FAIL Invalid: "function f() { for (a++ in b) break }" should throw undefined +PASS Valid: "for ((a++) in b) break" +PASS Valid: "function f() { for ((a++) in b) break }" +FAIL Invalid: "for (++a in b) break" should throw undefined +FAIL Invalid: "function f() { for (++a in b) break }" should throw undefined +PASS Valid: "for ((++a) in b) break" +PASS Valid: "function f() { for ((++a) in b) break }" +FAIL Invalid: "for (a, b in c) break" should throw undefined +FAIL Invalid: "function f() { for (a, b in c) break }" should throw undefined +PASS Invalid: "for (a,b in c ;;) break" +PASS Invalid: "function f() { for (a,b in c ;;) break }" +PASS Valid: "for (a,(b in c) ;;) break" +PASS Valid: "function f() { for (a,(b in c) ;;) break }" +PASS Valid: "for ((a, b) in c) break" +PASS Valid: "function f() { for ((a, b) in c) break }" +FAIL Invalid: "for (a ? b : c in c) break" should throw undefined +FAIL Invalid: "function f() { for (a ? b : c in c) break }" should throw undefined +PASS Valid: "for ((a ? b : c) in c) break" +PASS Valid: "function f() { for ((a ? b : c) in c) break }" +PASS Valid: "for (var a in b in c) break" +PASS Valid: "function f() { for (var a in b in c) break }" +PASS Valid: "for (var a = 5 += 6 in b) break" +PASS Valid: "function f() { for (var a = 5 += 6 in b) break }" +PASS Invalid: "for (var a += 5 in b) break" +PASS Invalid: "function f() { for (var a += 5 in b) break }" +PASS Invalid: "for (var a = in b) break" +PASS Invalid: "function f() { for (var a = in b) break }" +PASS Invalid: "for (var a, b in b) break" +PASS Invalid: "function f() { for (var a, b in b) break }" +PASS Invalid: "for (var a = -6, b in b) break" +PASS Invalid: "function f() { for (var a = -6, b in b) break }" +PASS Invalid: "for (var a, b = 8 in b) break" +PASS Invalid: "function f() { for (var a, b = 8 in b) break }" +PASS Valid: "for (var a = (b in c) in d) break" +PASS Valid: "function f() { for (var a = (b in c) in d) break }" +PASS Invalid: "for (var a = (b in c in d) break" +PASS Invalid: "function f() { for (var a = (b in c in d) break }" +PASS Invalid: "for (var (a) in b) { }" +PASS Invalid: "function f() { for (var (a) in b) { } }" +PASS Valid: "for (var a = 7, b = c < d >= d ; f()[6]++ ; --i()[1]++ ) {}" +PASS Valid: "function f() { for (var a = 7, b = c < d >= d ; f()[6]++ ; --i()[1]++ ) {} }" +try statement +PASS Invalid: "try { break } catch(e) {}" +PASS Invalid: "function f() { try { break } catch(e) {} }" +PASS Valid: "try {} finally { c++ }" +PASS Valid: "function f() { try {} finally { c++ } }" +PASS Valid: "try { with (x) { } } catch(e) {} finally { if (a) ; }" +PASS Valid: "function f() { try { with (x) { } } catch(e) {} finally { if (a) ; } }" +PASS Invalid: "try {}" +PASS Invalid: "function f() { try {} }" +PASS Invalid: "catch(e) {}" +PASS Invalid: "function f() { catch(e) {} }" +PASS Invalid: "finally {}" +PASS Invalid: "function f() { finally {} }" +PASS Invalid: "try a; catch(e) {}" +PASS Invalid: "function f() { try a; catch(e) {} }" +PASS Invalid: "try {} catch(e) a()" +PASS Invalid: "function f() { try {} catch(e) a() }" +PASS Invalid: "try {} finally a()" +PASS Invalid: "function f() { try {} finally a() }" +PASS Invalid: "try {} catch(e)" +PASS Invalid: "function f() { try {} catch(e) }" +PASS Invalid: "try {} finally" +PASS Invalid: "function f() { try {} finally }" +PASS Invalid: "try {} finally {} catch(e) {}" +PASS Invalid: "function f() { try {} finally {} catch(e) {} }" +PASS Invalid: "try {} catch (...) {}" +PASS Invalid: "function f() { try {} catch (...) {} }" +PASS Invalid: "try {} catch {}" +PASS Invalid: "function f() { try {} catch {} }" +PASS Valid: "if (a) try {} finally {} else b;" +PASS Valid: "function f() { if (a) try {} finally {} else b; }" +PASS Valid: "if (--a()) do with(1) try {} catch(ke) { f() ; g() } while (a in b) else {}" +PASS Valid: "function f() { if (--a()) do with(1) try {} catch(ke) { f() ; g() } while (a in b) else {} }" +PASS Invalid: "if (a) try {} else b; catch (e) { }" +PASS Invalid: "function f() { if (a) try {} else b; catch (e) { } }" +PASS Invalid: "try { finally {}" +PASS Invalid: "function f() { try { finally {} }" +switch statement +PASS Valid: "switch (a) {}" +PASS Valid: "function f() { switch (a) {} }" +PASS Invalid: "switch () {}" +PASS Invalid: "function f() { switch () {} }" +PASS Invalid: "case 5:" +PASS Invalid: "function f() { case 5: }" +PASS Invalid: "default:" +PASS Invalid: "function f() { default: }" +PASS Invalid: "switch (a) b;" +PASS Invalid: "function f() { switch (a) b; }" +PASS Invalid: "switch (a) case 3: b;" +PASS Invalid: "function f() { switch (a) case 3: b; }" +PASS Valid: "switch (f()) { case 5 * f(): default: case '6' - 9: ++i }" +PASS Valid: "function f() { switch (f()) { case 5 * f(): default: case '6' - 9: ++i } }" +PASS Invalid: "switch (true) { default: case 6: default: }" +PASS Invalid: "function f() { switch (true) { default: case 6: default: } }" +PASS Invalid: "switch (l) { f(); }" +PASS Invalid: "function f() { switch (l) { f(); } }" +PASS Invalid: "switch (l) { case 1: ; a: case 5: }" +PASS Invalid: "function f() { switch (l) { case 1: ; a: case 5: } }" +PASS Valid: "switch (g() - h[5].l) { case 1 + 6: a: b: c: ++f }" +PASS Valid: "function f() { switch (g() - h[5].l) { case 1 + 6: a: b: c: ++f } }" +PASS Invalid: "switch (g) { case 1: a: }" +PASS Invalid: "function f() { switch (g) { case 1: a: } }" +PASS Invalid: "switch (g) { case 1: a: default: }" +PASS Invalid: "function f() { switch (g) { case 1: a: default: } }" +PASS Invalid: "switch g { case 1: l() }" +PASS Invalid: "function f() { switch g { case 1: l() } }" +PASS Invalid: "switch (g) { case 1:" +PASS Invalid: "function f() { switch (g) { case 1: }" +PASS Valid: "switch (l) { case a = b ? c : d : }" +PASS Valid: "function f() { switch (l) { case a = b ? c : d : } }" +PASS Valid: "switch (sw) { case a ? b - 7[1] ? [c,,] : d = 6 : { } : }" +PASS Valid: "function f() { switch (sw) { case a ? b - 7[1] ? [c,,] : d = 6 : { } : } }" +PASS Invalid: "switch (l) { case b ? c : }" +PASS Invalid: "function f() { switch (l) { case b ? c : } }" +PASS Valid: "switch (l) { case 1: a: with(g) switch (g) { case 2: default: } default: }" +PASS Valid: "function f() { switch (l) { case 1: a: with(g) switch (g) { case 2: default: } default: } }" +PASS Invalid: "switch (4 - ) { }" +PASS Invalid: "function f() { switch (4 - ) { } }" +PASS Invalid: "switch (l) { default case: 5; }" +PASS Invalid: "function f() { switch (l) { default case: 5; } }" +PASS Invalid: "L: L: ;" +PASS Invalid: "function f() { L: L: ; }" +PASS Invalid: "L: L1: L: ;" +PASS Invalid: "function f() { L: L1: L: ; }" +PASS Invalid: "L: L1: L2: L3: L4: L: ;" +PASS Invalid: "function f() { L: L1: L2: L3: L4: L: ; }" +PASS Invalid: "for(var a,b 'this shouldn't be allowed' false ; ) ;" +PASS Invalid: "function f() { for(var a,b 'this shouldn't be allowed' false ; ) ; }" +PASS Invalid: "for(var a,b '" +PASS Invalid: "function f() { for(var a,b ' }" +PASS Valid: "function __proto__(){}" +PASS Valid: "function f() { function __proto__(){} }" +PASS Valid: "(function __proto__(){})" +PASS Valid: "function f() { (function __proto__(){}) }" +PASS Valid: "'use strict'; function __proto__(){}" +PASS Valid: "function f() { 'use strict'; function __proto__(){} }" +PASS Valid: "'use strict'; (function __proto__(){})" +PASS Valid: "function f() { 'use strict'; (function __proto__(){}) }" +PASS Valid: "if (0) $foo; " +PASS Valid: "function f() { if (0) $foo; }" +PASS Valid: "if (0) _foo; " +PASS Valid: "function f() { if (0) _foo; }" +PASS Valid: "if (0) foo$; " +PASS Valid: "function f() { if (0) foo$; }" +PASS Valid: "if (0) foo_; " +PASS Valid: "function f() { if (0) foo_; }" +PASS Valid: "if (0) obj.$foo; " +PASS Valid: "function f() { if (0) obj.$foo; }" +PASS Valid: "if (0) obj._foo; " +PASS Valid: "function f() { if (0) obj._foo; }" +PASS Valid: "if (0) obj.foo$; " +PASS Valid: "function f() { if (0) obj.foo$; }" +PASS Valid: "if (0) obj.foo_; " +PASS Valid: "function f() { if (0) obj.foo_; }" +PASS Valid: "if (0) obj.foo\u03bb; " +PASS Valid: "function f() { if (0) obj.foo\u03bb; }" +PASS Valid: "if (0) new a(b+c).d = 5" +PASS Valid: "function f() { if (0) new a(b+c).d = 5 }" +PASS Valid: "if (0) new a(b+c) = 5" +PASS Valid: "function f() { if (0) new a(b+c) = 5 }" +PASS Valid: "([1 || 1].a = 1)" +PASS Valid: "function f() { ([1 || 1].a = 1) }" +PASS Valid: "({a: 1 || 1}.a = 1)" +PASS Valid: "function f() { ({a: 1 || 1}.a = 1) }" +PASS Invalid: "var a.b = c" +PASS Invalid: "function f() { var a.b = c }" +PASS Invalid: "var a.b;" +PASS Invalid: "function f() { var a.b; }" +FAIL e.line should be 1 (of type number). Was undefined (of type undefined). +PASS foo is 'PASS' +PASS bar is 'PASS' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/parser-syntax-check.js b/deps/v8/test/webkit/fast/js/parser-syntax-check.js new file mode 100644 index 0000000..a1b0e92 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/parser-syntax-check.js @@ -0,0 +1,403 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"This test checks that the following expressions or statements are valid ECMASCRIPT code or should throw parse error" +); + +function runTest(_a, errorType) +{ + var success; + if (typeof _a != "string") + testFailed("runTest expects string argument: " + _a); + try { + eval(_a); + success = true; + } catch (e) { + success = !(e instanceof SyntaxError); + } + if ((!!errorType) == !success) { + if (errorType) + testPassed('Invalid: "' + _a + '"'); + else + testPassed('Valid: "' + _a + '"'); + } else { + if (errorType) + testFailed('Invalid: "' + _a + '" should throw ' + errorType.name); + else + testFailed('Valid: "' + _a + '" should NOT throw '); + } +} + +function valid(_a) +{ + // Test both the grammar and the syntax checker + runTest(_a, false); + runTest("function f() { " + _a + " }", false); +} + +function invalid(_a, _type) +{ + _type = _type || SyntaxError; + // Test both the grammar and the syntax checker + runTest(_a, true); + runTest("function f() { " + _a + " }", true); +} + +// known issue: +// some statements requires statement as argument, and +// it seems the End-Of-File terminator is converted to semicolon +// "a:[EOF]" is not parse error, while "{ a: }" is parse error +// "if (a)[EOF]" is not parse error, while "{ if (a) }" is parse error +// known issues of bison parser: +// accepts: 'function f() { return 6 + }' (only inside a function declaration) +// some comma expressions: see reparsing-semicolon-insertion.js + +debug ("Unary operators and member access"); + +valid (""); +invalid("(a"); +invalid("a[5"); +invalid("a[5 + 6"); +invalid("a."); +invalid("()"); +invalid("a.'l'"); +valid ("a: +~!new a"); +invalid("new -a"); +valid ("new (-1)") +valid ("a: b: c: new f(x++)++") +valid ("(a)++"); +valid ("(1--).x"); +invalid("a-- ++"); +invalid("(a:) --b"); +valid ("++ -- ++ a"); +valid ("++ new new a ++"); +valid ("delete void 0"); +invalid("delete the void"); +invalid("(a++"); +valid ("++a--"); +valid ("++((a))--"); +valid ("(a.x++)++"); +invalid("1: null"); +invalid("+-!~"); +invalid("+-!~(("); +invalid("a)"); +invalid("a]"); +invalid(".l"); +invalid("1.l"); +valid ("1 .l"); + +debug ("Binary and conditional operators"); + +valid ("a + + typeof this"); +invalid("a + * b"); +invalid("a ? b"); +invalid("a ? b :"); +invalid("%a"); +invalid("a-"); +valid ("a = b ? b = c : d = e"); +valid ("s: a[1].l ? b.l['s'] ? c++ : d : true"); +valid ("a ? b + 1 ? c + 3 * d.l : d[5][6] : e"); +valid ("a in b instanceof delete -c"); +invalid("a in instanceof b.l"); +valid ("- - true % 5"); +invalid("- false = 3"); +valid ("a: b: c: (1 + null) = 3"); +valid ("a[2] = b.l += c /= 4 * 7 ^ !6"); +invalid("a + typeof b += c in d"); +invalid("typeof a &= typeof b"); +valid ("a: ((typeof (a))) >>>= a || b.l && c"); +valid ("a: b: c[a /= f[a %= b]].l[c[x] = 7] -= a ? b <<= f : g"); +valid ("-void+x['y'].l == x.l != 5 - f[7]"); + +debug ("Function calls (and new with arguments)"); + +valid ("a()()()"); +valid ("s: l: a[2](4 == 6, 5 = 6)(f[4], 6)"); +valid ("s: eval(a.apply(), b.call(c[5] - f[7]))"); +invalid("a("); +invalid("a(5"); +invalid("a(5,"); +invalid("a(5,)"); +invalid("a(5,6"); +valid ("a(b[7], c e.l, new a() > b)"); +invalid("a(b[5)"); +invalid("a(b.)"); +valid ("~new new a(1)(i++)(c[l])"); +invalid("a(*a)"); +valid ("((((a))((b)()).l))()"); +valid ("(a)[b + (c) / (d())].l--"); +valid ("new (5)"); +invalid("new a(5"); +valid ("new (f + 5)(6, (g)() - 'l'() - true(false))"); +invalid("a(.length)"); + +debug ("function declaration and expression"); + +valid ("function f() {}"); +valid ("function f(a,b) {}"); +invalid("function () {}"); +invalid("function f(a b) {}"); +invalid("function f(a,) {}"); +invalid("function f(a,"); +invalid("function f(a, 1) {}"); +valid ("function g(arguments, eval) {}"); +valid ("function f() {} + function g() {}"); +invalid("(function a{})"); +invalid("(function this(){})"); +valid ("(delete new function f(){} + function(a,b){}(5)(6))"); +valid ("6 - function (m) { function g() {} }"); +invalid("function l() {"); +invalid("function l++(){}"); + +debug ("Array and object literal, comma operator"); + +// Note these are tested elsewhere, no need to repeat those tests here +valid ("[] in [5,6] * [,5,] / [,,5,,] || [a,] && new [,b] % [,,]"); +invalid("[5,"); +invalid("[,"); +invalid("(a,)"); +valid ("1 + {get get(){}, set set(a){}, get1:4, set1:get-set, }"); +invalid("1 + {a"); +invalid("1 + {a:"); +invalid("1 + {get l("); +invalid(",a"); +valid ("(4,(5,a(3,4))),f[4,a-6]"); +invalid("(,f)"); +invalid("a,,b"); +invalid("a ? b, c : d"); + +debug ("simple statements"); + +valid ("{ }"); +invalid("{ { }"); +valid ("{ ; ; ; }"); +valid ("a: { ; }"); +invalid("{ a: }"); +valid ("{} f; { 6 + f() }"); +valid ("{ a[5],6; {} ++b-new (-5)() } c().l++"); +valid ("{ l1: l2: l3: { this } a = 32 ; { i++ ; { { { } } ++i } } }"); +valid ("if (a) ;"); +invalid("{ if (a) }"); +invalid("if a {}"); +invalid("if (a"); +invalid("if (a { }"); +valid ("x: s: if (a) ; else b"); +invalid("else {}"); +valid ("if (a) if (b) y; else {} else ;"); +invalid("if (a) {} else x; else"); +invalid("if (a) { else }"); +valid ("if (a.l + new b()) 4 + 5 - f()"); +valid ("if (a) with (x) ; else with (y) ;"); +invalid("with a.b { }"); +valid ("while (a() - new b) ;"); +invalid("while a {}"); +valid ("do ; while(0) i++"); // Is this REALLY valid? (Firefox also accepts this) +valid ("do if (a) x; else y; while(z)"); +invalid("do g; while 4"); +invalid("do g; while ((4)"); +valid ("{ { do do do ; while(0) while(0) while(0) } }"); +valid ("do while (0) if (a) {} else y; while(0)"); +valid ("if (a) while (b) if (c) with(d) {} else e; else f"); +invalid("break ; break your_limits ; continue ; continue living ; debugger"); +invalid("debugger X"); +invalid("break 0.2"); +invalid("continue a++"); +invalid("continue (my_friend)"); +valid ("while (1) break"); +valid ("do if (a) with (b) continue; else debugger; while (false)"); +invalid("do if (a) while (false) else debugger"); +invalid("while if (a) ;"); +valid ("if (a) function f() {} else function g() {}"); +valid ("if (a()) while(0) function f() {} else function g() {}"); +invalid("if (a()) function f() { else function g() }"); +invalid("if (a) if (b) ; else function f {}"); +invalid("if (a) if (b) ; else function (){}"); +valid ("throw a"); +valid ("throw a + b in void c"); +invalid("throw"); + +debug ("var and const statements"); + +valid ("var a, b = null"); +valid ("const a = 5, b, c"); +invalid("var"); +invalid("var = 7"); +invalid("var c (6)"); +valid ("if (a) var a,b; else const b, c"); +invalid("var 5 = 6"); +valid ("while (0) var a, b, c=6, d, e, f=5*6, g=f*h, h"); +invalid("var a = if (b) { c }"); +invalid("var a = var b"); +valid ("const a = b += c, a, a, a = (b - f())"); +invalid("var a %= b | 5"); +invalid("var (a) = 5"); +invalid("var a = (4, b = 6"); +invalid("const 'l' = 3"); +invalid("var var = 3"); +valid ("var varr = 3 in 1"); +valid ("const a, a, a = void 7 - typeof 8, a = 8"); +valid ("const x_x = 6 /= 7 ? e : f"); +invalid("var a = ?"); +invalid("const a = *7"); +invalid("var a = :)"); +valid ("var a = a in b in c instanceof d"); +invalid("var a = b ? c, b"); +invalid("const a = b : c"); + +debug ("for statement"); + +valid ("for ( ; ; ) { break }"); +valid ("for ( a ; ; ) { break }"); +valid ("for ( ; a ; ) { break }"); +valid ("for ( ; ; a ) { break }"); +valid ("for ( a ; a ; ) break"); +valid ("for ( a ; ; a ) break"); +valid ("for ( ; a ; a ) break"); +invalid("for () { }"); +invalid("for ( a ) { }"); +invalid("for ( ; ) ;"); +invalid("for a ; b ; c { }"); +invalid("for (a ; { }"); +invalid("for ( a ; ) ;"); +invalid("for ( ; a ) break"); +valid ("for (var a, b ; ; ) { break } "); +valid ("for (var a = b, b = a ; ; ) break"); +valid ("for (var a = b, c, d, b = a ; x in b ; ) { break }"); +valid ("for (var a = b, c, d ; ; 1 in a()) break"); +invalid("for ( ; var a ; ) break"); +invalid("for (const a; ; ) break"); +invalid("for ( %a ; ; ) { }"); +valid ("for (a in b) break"); +valid ("for (a() in b) break"); +valid ("for (a().l[4] in b) break"); +valid ("for (new a in b in c in d) break"); +valid ("for (new new new a in b) break"); +invalid("for (delete new a() in b) break"); +invalid("for (a * a in b) break"); +valid ("for ((a * a) in b) break"); +invalid("for (a++ in b) break"); +valid ("for ((a++) in b) break"); +invalid("for (++a in b) break"); +valid ("for ((++a) in b) break"); +invalid("for (a, b in c) break"); +invalid("for (a,b in c ;;) break"); +valid ("for (a,(b in c) ;;) break"); +valid ("for ((a, b) in c) break"); +invalid("for (a ? b : c in c) break"); +valid ("for ((a ? b : c) in c) break"); +valid ("for (var a in b in c) break"); +valid ("for (var a = 5 += 6 in b) break"); +invalid("for (var a += 5 in b) break"); +invalid("for (var a = in b) break"); +invalid("for (var a, b in b) break"); +invalid("for (var a = -6, b in b) break"); +invalid("for (var a, b = 8 in b) break"); +valid ("for (var a = (b in c) in d) break"); +invalid("for (var a = (b in c in d) break"); +invalid("for (var (a) in b) { }"); +valid ("for (var a = 7, b = c < d >= d ; f()[6]++ ; --i()[1]++ ) {}"); + +debug ("try statement"); + +invalid("try { break } catch(e) {}"); +valid ("try {} finally { c++ }"); +valid ("try { with (x) { } } catch(e) {} finally { if (a) ; }"); +invalid("try {}"); +invalid("catch(e) {}"); +invalid("finally {}"); +invalid("try a; catch(e) {}"); +invalid("try {} catch(e) a()"); +invalid("try {} finally a()"); +invalid("try {} catch(e)"); +invalid("try {} finally"); +invalid("try {} finally {} catch(e) {}"); +invalid("try {} catch (...) {}"); +invalid("try {} catch {}"); +valid ("if (a) try {} finally {} else b;"); +valid ("if (--a()) do with(1) try {} catch(ke) { f() ; g() } while (a in b) else {}"); +invalid("if (a) try {} else b; catch (e) { }"); +invalid("try { finally {}"); + +debug ("switch statement"); + +valid ("switch (a) {}"); +invalid("switch () {}"); +invalid("case 5:"); +invalid("default:"); +invalid("switch (a) b;"); +invalid("switch (a) case 3: b;"); +valid ("switch (f()) { case 5 * f(): default: case '6' - 9: ++i }"); +invalid("switch (true) { default: case 6: default: }"); +invalid("switch (l) { f(); }"); +invalid("switch (l) { case 1: ; a: case 5: }"); +valid ("switch (g() - h[5].l) { case 1 + 6: a: b: c: ++f }"); +invalid("switch (g) { case 1: a: }"); +invalid("switch (g) { case 1: a: default: }"); +invalid("switch g { case 1: l() }"); +invalid("switch (g) { case 1:"); +valid ("switch (l) { case a = b ? c : d : }"); +valid ("switch (sw) { case a ? b - 7[1] ? [c,,] : d = 6 : { } : }"); +invalid("switch (l) { case b ? c : }"); +valid ("switch (l) { case 1: a: with(g) switch (g) { case 2: default: } default: }"); +invalid("switch (4 - ) { }"); +invalid("switch (l) { default case: 5; }"); + +invalid("L: L: ;"); +invalid("L: L1: L: ;"); +invalid("L: L1: L2: L3: L4: L: ;"); + +invalid("for(var a,b 'this shouldn\'t be allowed' false ; ) ;"); +invalid("for(var a,b '"); + +valid("function __proto__(){}") +valid("(function __proto__(){})") +valid("'use strict'; function __proto__(){}") +valid("'use strict'; (function __proto__(){})") + +valid("if (0) $foo; ") +valid("if (0) _foo; ") +valid("if (0) foo$; ") +valid("if (0) foo_; ") +valid("if (0) obj.$foo; ") +valid("if (0) obj._foo; ") +valid("if (0) obj.foo$; ") +valid("if (0) obj.foo_; ") +valid("if (0) obj.foo\\u03bb; ") +valid("if (0) new a(b+c).d = 5"); +valid("if (0) new a(b+c) = 5"); +valid("([1 || 1].a = 1)"); +valid("({a: 1 || 1}.a = 1)"); + +invalid("var a.b = c"); +invalid("var a.b;"); + +try { eval("a.b.c = {};"); } catch(e1) { e=e1; shouldBe("e.line", "1") } +foo = 'FAIL'; +bar = 'PASS'; +try { + eval("foo = 'PASS'; a.b.c = {}; bar = 'FAIL';"); +} catch(e) { + shouldBe("foo", "'PASS'"); + shouldBe("bar", "'PASS'"); +} diff --git a/deps/v8/test/webkit/fast/js/primitive-property-access-edge-cases-expected.txt b/deps/v8/test/webkit/fast/js/primitive-property-access-edge-cases-expected.txt new file mode 100644 index 0000000..f07d273 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/primitive-property-access-edge-cases-expected.txt @@ -0,0 +1,81 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This page tests for assertion failures in edge cases of property lookup on primitive values. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS checkGet(1, Number) is true +PASS checkGet('hello', String) is true +PASS checkGet(true, Boolean) is true +FAIL checkSet(1, Number) should be true. Was false. +FAIL checkSet('hello', String) should be true. Was false. +FAIL checkSet(true, Boolean) should be true. Was false. +PASS checkGetStrict(1, Number) is true +PASS checkGetStrict('hello', String) is true +PASS checkGetStrict(true, Boolean) is true +FAIL checkSetStrict(1, Number) should be true. Was false. +FAIL checkSetStrict('hello', String) should be true. Was false. +FAIL checkSetStrict(true, Boolean) should be true. Was false. +PASS checkRead(1, Number) is true +PASS checkRead('hello', String) is true +PASS checkRead(true, Boolean) is true +PASS checkWrite(1, Number) is true +PASS checkWrite('hello', String) is true +PASS checkWrite(true, Boolean) is true +PASS checkReadStrict(1, Number) is true +PASS checkReadStrict('hello', String) is true +PASS checkReadStrict(true, Boolean) is true +FAIL checkWriteStrict(1, Number) should throw an exception. Was true. +FAIL checkWriteStrict('hello', String) should throw an exception. Was true. +FAIL checkWriteStrict(true, Boolean) should throw an exception. Was true. +PASS checkNumericGet(1, Number) is true +PASS checkNumericGet('hello', String) is true +PASS checkNumericGet(true, Boolean) is true +FAIL checkNumericSet(1, Number) should be true. Was false. +FAIL checkNumericSet('hello', String) should be true. Was false. +FAIL checkNumericSet(true, Boolean) should be true. Was false. +FAIL checkNumericGetStrict(1, Number) should be true. Was false. +FAIL checkNumericGetStrict('hello', String) should be true. Was false. +FAIL checkNumericGetStrict(true, Boolean) should be true. Was false. +FAIL checkNumericSetStrict(1, Number) should be true. Was false. +FAIL checkNumericSetStrict('hello', String) should be true. Was false. +FAIL checkNumericSetStrict(true, Boolean) should be true. Was false. +PASS checkNumericRead(1, Number) is true +PASS checkNumericRead('hello', String) is true +PASS checkNumericRead(true, Boolean) is true +PASS checkNumericWrite(1, Number) is true +PASS checkNumericWrite('hello', String) is true +PASS checkNumericWrite(true, Boolean) is true +PASS checkNumericReadStrict(1, Number) is true +PASS checkNumericReadStrict('hello', String) is true +PASS checkNumericReadStrict(true, Boolean) is true +FAIL checkNumericWriteStrict(1, Number) should throw an exception. Was true. +FAIL checkNumericWriteStrict('hello', String) should throw an exception. Was true. +FAIL checkNumericWriteStrict(true, Boolean) should throw an exception. Was true. +PASS didNotCrash is true +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/primitive-property-access-edge-cases.js b/deps/v8/test/webkit/fast/js/primitive-property-access-edge-cases.js new file mode 100644 index 0000000..491f42b --- /dev/null +++ b/deps/v8/test/webkit/fast/js/primitive-property-access-edge-cases.js @@ -0,0 +1,238 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"This page tests for assertion failures in edge cases of property lookup on primitive values." +); + +var didNotCrash = true; + +(function () { + delete String.prototype.constructor; + for (var i = 0; i < 3; ++i) + "".replace; +})(); + +(function () { + String.prototype.__proto__ = { x: 1, y: 1 }; + delete String.prototype.__proto__.x; + for (var i = 0; i < 3; ++i) + "".y; +})(); + +(function () { + function f(x) { + x.y; + } + + String.prototype.x = 1; + String.prototype.y = 1; + delete String.prototype.x; + + Number.prototype.x = 1; + Number.prototype.y = 1; + delete Number.prototype.x; + + for (var i = 0; i < 3; ++i) + f(""); + + for (var i = 0; i < 3; ++i) + f(.5); +})(); + + +var checkOkay; + +function checkGet(x, constructor) +{ + checkOkay = false; + Object.defineProperty(constructor.prototype, "foo", { get: function() { checkOkay = typeof this === 'object'; }, configurable: true }); + x.foo; + delete constructor.prototype.foo; + return checkOkay; +} + +function checkSet(x, constructor) +{ + checkOkay = false; + Object.defineProperty(constructor.prototype, "foo", { set: function() { checkOkay = typeof this === 'object'; }, configurable: true }); + x.foo = null; + delete constructor.prototype.foo; + return checkOkay; +} + +function checkGetStrict(x, constructor) +{ + checkOkay = false; + Object.defineProperty(constructor.prototype, "foo", { get: function() { "use strict"; checkOkay = typeof this !== 'object'; }, configurable: true }); + x.foo; + delete constructor.prototype.foo; + return checkOkay; +} + +function checkSetStrict(x, constructor) +{ + checkOkay = false; + Object.defineProperty(constructor.prototype, "foo", { set: function() { "use strict"; checkOkay = typeof this !== 'object'; }, configurable: true }); + x.foo = null; + delete constructor.prototype.foo; + return checkOkay; +} + +shouldBeTrue("checkGet(1, Number)"); +shouldBeTrue("checkGet('hello', String)"); +shouldBeTrue("checkGet(true, Boolean)"); +shouldBeTrue("checkSet(1, Number)"); +shouldBeTrue("checkSet('hello', String)"); +shouldBeTrue("checkSet(true, Boolean)"); +shouldBeTrue("checkGetStrict(1, Number)"); +shouldBeTrue("checkGetStrict('hello', String)"); +shouldBeTrue("checkGetStrict(true, Boolean)"); +shouldBeTrue("checkSetStrict(1, Number)"); +shouldBeTrue("checkSetStrict('hello', String)"); +shouldBeTrue("checkSetStrict(true, Boolean)"); + +function checkRead(x, constructor) +{ + return x.foo === undefined; +} + +function checkWrite(x, constructor) +{ + x.foo = null; + return x.foo === undefined; +} + +function checkReadStrict(x, constructor) +{ + "use strict"; + return x.foo === undefined; +} + +function checkWriteStrict(x, constructor) +{ + "use strict"; + x.foo = null; + return x.foo === undefined; +} + +shouldBeTrue("checkRead(1, Number)"); +shouldBeTrue("checkRead('hello', String)"); +shouldBeTrue("checkRead(true, Boolean)"); +shouldBeTrue("checkWrite(1, Number)"); +shouldBeTrue("checkWrite('hello', String)"); +shouldBeTrue("checkWrite(true, Boolean)"); +shouldBeTrue("checkReadStrict(1, Number)"); +shouldBeTrue("checkReadStrict('hello', String)"); +shouldBeTrue("checkReadStrict(true, Boolean)"); +shouldThrow("checkWriteStrict(1, Number)"); +shouldThrow("checkWriteStrict('hello', String)"); +shouldThrow("checkWriteStrict(true, Boolean)"); + +function checkNumericGet(x, constructor) +{ + checkOkay = false; + Object.defineProperty(constructor.prototype, 42, { get: function() { checkOkay = typeof this === 'object'; }, configurable: true }); + x[42]; + delete constructor.prototype[42]; + return checkOkay; +} + +function checkNumericSet(x, constructor) +{ + checkOkay = false; + Object.defineProperty(constructor.prototype, 42, { set: function() { checkOkay = typeof this === 'object'; }, configurable: true }); + x[42] = null; + delete constructor.prototype[42]; + return checkOkay; +} + +function checkNumericGetStrict(x, constructor) +{ + checkOkay = false; + Object.defineProperty(constructor.prototype, 42, { get: function() { "use strict"; checkOkay = typeof this !== 'object'; }, configurable: true }); + x[42]; + delete constructor.prototype[42]; + return checkOkay; +} + +function checkNumericSetStrict(x, constructor) +{ + checkOkay = false; + Object.defineProperty(constructor.prototype, 42, { set: function() { "use strict"; checkOkay = typeof this !== 'object'; }, configurable: true }); + x[42] = null; + delete constructor.prototype[42]; + return checkOkay; +} + +shouldBeTrue("checkNumericGet(1, Number)"); +shouldBeTrue("checkNumericGet('hello', String)"); +shouldBeTrue("checkNumericGet(true, Boolean)"); +shouldBeTrue("checkNumericSet(1, Number)"); +shouldBeTrue("checkNumericSet('hello', String)"); +shouldBeTrue("checkNumericSet(true, Boolean)"); +shouldBeTrue("checkNumericGetStrict(1, Number)"); +shouldBeTrue("checkNumericGetStrict('hello', String)"); +shouldBeTrue("checkNumericGetStrict(true, Boolean)"); +shouldBeTrue("checkNumericSetStrict(1, Number)"); +shouldBeTrue("checkNumericSetStrict('hello', String)"); +shouldBeTrue("checkNumericSetStrict(true, Boolean)"); + +function checkNumericRead(x, constructor) +{ + return x[42] === undefined; +} + +function checkNumericWrite(x, constructor) +{ + x[42] = null; + return x[42] === undefined; +} + +function checkNumericReadStrict(x, constructor) +{ + "use strict"; + return x[42] === undefined; +} + +function checkNumericWriteStrict(x, constructor) +{ + "use strict"; + x[42] = null; + return x[42] === undefined; +} + +shouldBeTrue("checkNumericRead(1, Number)"); +shouldBeTrue("checkNumericRead('hello', String)"); +shouldBeTrue("checkNumericRead(true, Boolean)"); +shouldBeTrue("checkNumericWrite(1, Number)"); +shouldBeTrue("checkNumericWrite('hello', String)"); +shouldBeTrue("checkNumericWrite(true, Boolean)"); +shouldBeTrue("checkNumericReadStrict(1, Number)"); +shouldBeTrue("checkNumericReadStrict('hello', String)"); +shouldBeTrue("checkNumericReadStrict(true, Boolean)"); +shouldThrow("checkNumericWriteStrict(1, Number)"); +shouldThrow("checkNumericWriteStrict('hello', String)"); +shouldThrow("checkNumericWriteStrict(true, Boolean)"); + +shouldBeTrue("didNotCrash"); diff --git a/deps/v8/test/webkit/fast/js/read-modify-eval-expected.txt b/deps/v8/test/webkit/fast/js/read-modify-eval-expected.txt new file mode 100644 index 0000000..4a16d0a --- /dev/null +++ b/deps/v8/test/webkit/fast/js/read-modify-eval-expected.txt @@ -0,0 +1,49 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Tests whether eval() works inside statements that read and modify a value. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS multTest(); is true +PASS divTest(); is true +PASS addTest(); is true +PASS subTest(); is true +PASS lshiftTest(); is true +PASS rshiftTest(); is true +PASS urshiftTest(); is true +PASS andTest(); is true +PASS xorTest(); is true +PASS orTest(); is true +PASS modTest(); is true +PASS preIncTest(); is true +PASS preDecTest(); is true +PASS postIncTest(); is true +PASS postDecTest(); is true +PASS primitiveThisTest.call(1); is true +FAIL strictThisTest.call(1); should throw an exception. Was true. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/read-modify-eval.js b/deps/v8/test/webkit/fast/js/read-modify-eval.js new file mode 100644 index 0000000..637bc5e --- /dev/null +++ b/deps/v8/test/webkit/fast/js/read-modify-eval.js @@ -0,0 +1,169 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'Tests whether eval() works inside statements that read and modify a value.' +); + +function multTest() +{ + var x = 1; + x *= eval('2'); + return x == 2; +} + +function divTest() +{ + var x = 2; + x /= eval('2'); + return x == 1; +} + +function addTest() +{ + var x = 0; + x += eval('1'); + return x == 1; +} + +function subTest() +{ + var x = 0; + x -= eval('1'); + return x == -1; +} + +function lshiftTest() +{ + var x = 1; + x <<= eval('1'); + return x == 2; +} + +function rshiftTest() +{ + var x = 1; + x >>= eval('1'); + return x == 0; +} + +function urshiftTest() +{ + var x = 1; + x >>>= eval('1'); + return x == 0; +} + +function andTest() +{ + var x = 1; + x &= eval('1'); + return x == 1; +} + +function xorTest() +{ + var x = 0; + x ^= eval('1'); + return x == 1; +} + +function orTest() +{ + var x = 0; + x |= eval('1'); + return x == 1; +} + +function modTest() +{ + var x = 4; + x %= eval('3'); + return x == 1; +} + +function preIncTest() +{ + var x = { value: 0 }; + ++eval('x').value; + return x.value == 1; +} + +function preDecTest() +{ + var x = { value: 0 }; + --eval('x').value; + return x.value == -1; +} + +function postIncTest() +{ + var x = { value: 0 }; + eval('x').value++; + return x.value == 1; +} + +function postDecTest() +{ + var x = { value: 0 }; + eval('x').value--; + return x.value == -1; +} + +function primitiveThisTest() +{ + // Test that conversion of this is persistant over multiple calls to eval, + // even where 'this' is not directly used within the function. + eval('this.value = "Seekrit message";'); + return eval('this.value') === "Seekrit message"; +} + +function strictThisTest() +{ + // In a strict mode function primitive this values are not converted, so + // the property access in the first eval is writing a value to a temporary + // object. This throws, per section 8.7.2. + "use strict"; + eval('this.value = "Seekrit message";'); + return eval('this.value') === undefined; +} + +shouldBeTrue('multTest();'); +shouldBeTrue('divTest();'); +shouldBeTrue('addTest();'); +shouldBeTrue('subTest();'); +shouldBeTrue('lshiftTest();'); +shouldBeTrue('rshiftTest();'); +shouldBeTrue('urshiftTest();'); +shouldBeTrue('andTest();'); +shouldBeTrue('xorTest();'); +shouldBeTrue('orTest();'); +shouldBeTrue('modTest();'); + +shouldBeTrue('preIncTest();'); +shouldBeTrue('preDecTest();'); +shouldBeTrue('postIncTest();'); +shouldBeTrue('postDecTest();'); + +shouldBeTrue('primitiveThisTest.call(1);'); +shouldThrow('strictThisTest.call(1);'); diff --git a/deps/v8/test/webkit/fast/js/regexp-bol-expected.txt b/deps/v8/test/webkit/fast/js/regexp-bol-expected.txt new file mode 100644 index 0000000..8d045ea --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-bol-expected.txt @@ -0,0 +1,53 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test for beginning of line (BOL or ^) matching + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS s.match(/^notHere/) is null +PASS s.match(/^abc/) is ["abc"] +PASS s.match(/(^|X)abc/) is ["abc",""] +PASS s.match(/^longer|123/) is ["123"] +PASS s.match(/(^abc|c)123/) is ["abc123","abc"] +PASS s.match(/(c|^abc)123/) is ["abc123","abc"] +PASS s.match(/(^ab|abc)123/) is ["abc123","abc"] +PASS s.match(/(bc|^abc)([0-9]*)a/) is ["bc789a","bc","789"] +PASS /(?:(Y)X)|(X)/.exec("abc") is null +PASS /(?:(?:^|Y)X)|(X)/.exec("abc") is null +PASS /(?:(?:^|Y)X)|(X)/.exec("abcd") is null +PASS /(?:(?:^|Y)X)|(X)/.exec("Xabcd") is ["X",undefined] +PASS /(?:(?:^|Y)X)|(X)/.exec("aXbcd") is ["X","X"] +PASS /(?:(?:^|Y)X)|(X)/.exec("abXcd") is ["X","X"] +PASS /(?:(?:^|Y)X)|(X)/.exec("abcXd") is ["X","X"] +PASS /(?:(?:^|Y)X)|(X)/.exec("abcdX") is ["X","X"] +PASS /(?:(?:^|Y)X)|(X)/.exec("YXabcd") is ["YX",undefined] +PASS /(?:(?:^|Y)X)|(X)/.exec("aYXbcd") is ["YX",undefined] +PASS /(?:(?:^|Y)X)|(X)/.exec("abYXcd") is ["YX",undefined] +PASS /(?:(?:^|Y)X)|(X)/.exec("abcYXd") is ["YX",undefined] +PASS /(?:(?:^|Y)X)|(X)/.exec("abcdYX") is ["YX",undefined] +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/regexp-bol-with-multiline-expected.txt b/deps/v8/test/webkit/fast/js/regexp-bol-with-multiline-expected.txt new file mode 100644 index 0000000..a246b53 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-bol-with-multiline-expected.txt @@ -0,0 +1,37 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test for beginning of line (BOL or ^) matching in a multiline string + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS s.match(/^abc/) is null +PASS s.match(/^abc/m) is ["abc"] +PASS s.match(/(^|X)abc/) is null +PASS s.match(/(^|X)abc/m) is ["abc",""] +PASS s.match(/(^a|Xa)bc/m) is ["abc","a"] +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/regexp-bol-with-multiline.js b/deps/v8/test/webkit/fast/js/regexp-bol-with-multiline.js new file mode 100644 index 0000000..1611b69 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-bol-with-multiline.js @@ -0,0 +1,33 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'Test for beginning of line (BOL or ^) matching in a multiline string' +); + +var s = "aced\nabc"; +shouldBeNull('s.match(/^abc/)'); +shouldBe('s.match(/^abc/m)', '["abc"]'); +shouldBeNull('s.match(/(^|X)abc/)'); +shouldBe('s.match(/(^|X)abc/m)', '["abc",""]'); +shouldBe('s.match(/(^a|Xa)bc/m)', '["abc","a"]'); diff --git a/deps/v8/test/webkit/fast/js/regexp-bol.js b/deps/v8/test/webkit/fast/js/regexp-bol.js new file mode 100644 index 0000000..a28d4d5 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-bol.js @@ -0,0 +1,49 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'Test for beginning of line (BOL or ^) matching' +); + +var s = "abc123def456xyzabc789abc999"; +shouldBeNull('s.match(/^notHere/)'); +shouldBe('s.match(/^abc/)', '["abc"]'); +shouldBe('s.match(/(^|X)abc/)', '["abc",""]'); +shouldBe('s.match(/^longer|123/)', '["123"]'); +shouldBe('s.match(/(^abc|c)123/)', '["abc123","abc"]'); +shouldBe('s.match(/(c|^abc)123/)', '["abc123","abc"]'); +shouldBe('s.match(/(^ab|abc)123/)', '["abc123","abc"]'); +shouldBe('s.match(/(bc|^abc)([0-9]*)a/)', '["bc789a","bc","789"]'); +shouldBeNull('/(?:(Y)X)|(X)/.exec("abc")'); +shouldBeNull('/(?:(?:^|Y)X)|(X)/.exec("abc")'); +shouldBeNull('/(?:(?:^|Y)X)|(X)/.exec("abcd")'); +shouldBe('/(?:(?:^|Y)X)|(X)/.exec("Xabcd")', '["X",undefined]'); +shouldBe('/(?:(?:^|Y)X)|(X)/.exec("aXbcd")', '["X","X"]'); +shouldBe('/(?:(?:^|Y)X)|(X)/.exec("abXcd")', '["X","X"]'); +shouldBe('/(?:(?:^|Y)X)|(X)/.exec("abcXd")', '["X","X"]'); +shouldBe('/(?:(?:^|Y)X)|(X)/.exec("abcdX")', '["X","X"]'); +shouldBe('/(?:(?:^|Y)X)|(X)/.exec("YXabcd")', '["YX",undefined]'); +shouldBe('/(?:(?:^|Y)X)|(X)/.exec("aYXbcd")', '["YX",undefined]'); +shouldBe('/(?:(?:^|Y)X)|(X)/.exec("abYXcd")', '["YX",undefined]'); +shouldBe('/(?:(?:^|Y)X)|(X)/.exec("abcYXd")', '["YX",undefined]'); +shouldBe('/(?:(?:^|Y)X)|(X)/.exec("abcdYX")', '["YX",undefined]'); diff --git a/deps/v8/test/webkit/fast/js/regexp-extended-characters-crash-expected.txt b/deps/v8/test/webkit/fast/js/regexp-extended-characters-crash-expected.txt new file mode 100644 index 0000000..a8ba905 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-extended-characters-crash-expected.txt @@ -0,0 +1,37 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks for a regression against JavaScript regular expressions with certain ranges of Unicode characters cause a crash. If it fails, it may crash. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS new RegExp("[À-Ὅ]").toString() is /[À-Ὅ]/.toString() +PASS new RegExp("[ぁ-ゔ]").toString() is /[ぁ-ゔ]/.toString() +PASS new RegExp("[䴀-䶵]").toString() is /[䴀-䶵]/.toString() +PASS new RegExp("[一-龥]").toString() is /[一-龥]/.toString() +PASS new RegExp("[-Ὅ]").toString() is /[-Ὅ]/.toString() +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/regexp-extended-characters-crash.js b/deps/v8/test/webkit/fast/js/regexp-extended-characters-crash.js new file mode 100644 index 0000000..490faad --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-extended-characters-crash.js @@ -0,0 +1,36 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'This test checks for a regression against JavaScript regular expressions with certain ranges of Unicode characters cause a crash. If it fails, it may crash.' +); + + +// test ranges reported in bug +shouldBe('new RegExp("[\u00c0-\u1f4d]").toString()', '/[\u00c0-\u1f4d]/.toString()'); +shouldBe('new RegExp("[\u3041-\u3094]").toString()', '/[\u3041-\u3094]/.toString()'); +shouldBe('new RegExp("[\u4d00-\u4db5]").toString()', '/[\u4d00-\u4db5]/.toString()'); +shouldBe('new RegExp("[\u4e00-\u9fa5]").toString()', '/[\u4e00-\u9fa5]/.toString()'); + +// test first char < 255, last char > 255 +shouldBe('new RegExp("[\u0001-\u1f4d]").toString()', '/[\u0001-\u1f4d]/.toString()'); diff --git a/deps/v8/test/webkit/fast/js/regexp-lastindex-expected.txt b/deps/v8/test/webkit/fast/js/regexp-lastindex-expected.txt new file mode 100644 index 0000000..e2cee1d --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-lastindex-expected.txt @@ -0,0 +1,34 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test for regression against REGRESSION: RegExp("[^\s$]+", "g") returns extra matches + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS while (match = re.exec(" abcdefg")) accumulate += match + "; "; accumulate is "abcdefg; " +PASS while (match = re.exec("123456789")) accumulate += match + "; "; accumulate is "1; 2; 3; 4; 5; 6; 7; 8; 9; " +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/regexp-lastindex.js b/deps/v8/test/webkit/fast/js/regexp-lastindex.js new file mode 100644 index 0000000..0c939f0 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-lastindex.js @@ -0,0 +1,35 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'Test for regression against REGRESSION: RegExp("[^\\s$]+", "g") returns extra matches' +); + +var re = new RegExp("[^\\s$]+", "g"); +var accumulate = ""; +var match; +shouldBe('while (match = re.exec(" abcdefg")) accumulate += match + "; "; accumulate', '"abcdefg; "'); + +var re = new RegExp(/\d/g); +accumulate = ""; +shouldBe('while (match = re.exec("123456789")) accumulate += match + "; "; accumulate', '"1; 2; 3; 4; 5; 6; 7; 8; 9; "'); diff --git a/deps/v8/test/webkit/fast/js/regexp-look-ahead-expected.txt b/deps/v8/test/webkit/fast/js/regexp-look-ahead-expected.txt new file mode 100644 index 0000000..14c16cd --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-look-ahead-expected.txt @@ -0,0 +1,34 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test for regression against Yarr Interpreter is crashing in some cases of look-ahead regex patterns + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS "ab".match(/a(?=b|c)/) is ["a"] +PASS "abd".match(/a(?=c|b)|d/) is ["a"] +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/regexp-look-ahead.js b/deps/v8/test/webkit/fast/js/regexp-look-ahead.js new file mode 100644 index 0000000..a512e1b --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-look-ahead.js @@ -0,0 +1,29 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'Test for regression against Yarr Interpreter is crashing in some cases of look-ahead regex patterns' +); + +shouldBe('"ab".match(/a(?=b|c)/)', '["a"]'); +shouldBe('"abd".match(/a(?=c|b)|d/)', '["a"]'); diff --git a/deps/v8/test/webkit/fast/js/regexp-no-extensions-expected.txt b/deps/v8/test/webkit/fast/js/regexp-no-extensions-expected.txt new file mode 100644 index 0000000..97257a7 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-no-extensions-expected.txt @@ -0,0 +1,69 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Tests that regular expressions do not have extensions that diverge from the JavaScript specification. Because WebKit originally used a copy of PCRE, various non-JavaScript regular expression features were historically present. Also tests various related edge cases. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS /\x{41}/.exec("yA1") is null +PASS /[\x{41}]/.exec("yA1").toString() is "1" +PASS /\x1g/.exec("x1g").toString() is "x1g" +PASS /[\x1g]/.exec("x").toString() is "x" +PASS /[\x1g]/.exec("1").toString() is "1" +PASS /\2147483648/.exec(String.fromCharCode(140) + "7483648").toString() is String.fromCharCode(140) + "7483648" +PASS /\4294967296/.exec("\"94967296").toString() is "\"94967296" +FAIL /\8589934592/.exec("\\8589934592").toString() should be \8589934592. Was 8589934592. +PASS "\nAbc\n".replace(/(\n)[^\n]+$/, "$1") is "\nAbc\n" +PASS /x$/.exec("x\n") is null +PASS /x++/ threw exception SyntaxError: Invalid regular expression: /x++/: Nothing to repeat. +PASS /[]]/.exec("]") is null + +Octal escape sequences are in Annex B of the standard. + +PASS /\060/.exec("y01").toString() is "0" +PASS /[\060]/.exec("y01").toString() is "0" +PASS /\606/.exec("y06").toString() is "06" +PASS /[\606]/.exec("y06").toString() is "0" +PASS /[\606]/.exec("y6").toString() is "6" +PASS /\101/.exec("yA1").toString() is "A" +PASS /[\101]/.exec("yA1").toString() is "A" +PASS /\1011/.exec("yA1").toString() is "A1" +PASS /[\1011]/.exec("yA1").toString() is "A" +PASS /[\1011]/.exec("y1").toString() is "1" +PASS /\10q/.exec("y" + String.fromCharCode(8) + "q").toString() is String.fromCharCode(8) + "q" +PASS /[\10q]/.exec("y" + String.fromCharCode(8) + "q").toString() is String.fromCharCode(8) +PASS /\1q/.exec("y" + String.fromCharCode(1) + "q").toString() is String.fromCharCode(1) + "q" +PASS /[\1q]/.exec("y" + String.fromCharCode(1) + "q").toString() is String.fromCharCode(1) +PASS /[\1q]/.exec("yq").toString() is "q" +FAIL /\8q/.exec("\\8q").toString() should be \8q. Was 8q. +PASS /[\8q]/.exec("y8q").toString() is "8" +PASS /[\8q]/.exec("yq").toString() is "q" +PASS /(x)\1q/.exec("xxq").toString() is "xxq,x" +PASS /(x)[\1q]/.exec("xxq").toString() is "xq,x" +PASS /(x)[\1q]/.exec("xx" + String.fromCharCode(1)).toString() is "x" + String.fromCharCode(1) + ",x" + +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/regexp-no-extensions.js b/deps/v8/test/webkit/fast/js/regexp-no-extensions.js new file mode 100644 index 0000000..ddba7c0 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-no-extensions.js @@ -0,0 +1,69 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'Tests that regular expressions do not have extensions that diverge from the JavaScript specification. ' ++ 'Because WebKit originally used a copy of PCRE, various non-JavaScript regular expression features were historically present. ' ++ 'Also tests various related edge cases.' +); + +shouldBe('/\\x{41}/.exec("yA1")', 'null'); +shouldBe('/[\\x{41}]/.exec("yA1").toString()', '"1"'); +shouldBe('/\\x1g/.exec("x1g").toString()', '"x1g"'); +shouldBe('/[\\x1g]/.exec("x").toString()', '"x"'); +shouldBe('/[\\x1g]/.exec("1").toString()', '"1"'); +shouldBe('/\\2147483648/.exec(String.fromCharCode(140) + "7483648").toString()', 'String.fromCharCode(140) + "7483648"'); +shouldBe('/\\4294967296/.exec("\\"94967296").toString()', '"\\"94967296"'); +shouldBe('/\\8589934592/.exec("\\\\8589934592").toString()', '"\\\\8589934592"'); +shouldBe('"\\nAbc\\n".replace(/(\\n)[^\\n]+$/, "$1")', '"\\nAbc\\n"'); +shouldBe('/x$/.exec("x\\n")', 'null'); +shouldThrow('/x++/'); +shouldBe('/[]]/.exec("]")', 'null'); + +debug(''); +debug('Octal escape sequences are in Annex B of the standard.'); +debug(''); + +shouldBe('/\\060/.exec("y01").toString()', '"0"'); +shouldBe('/[\\060]/.exec("y01").toString()', '"0"'); +shouldBe('/\\606/.exec("y06").toString()', '"06"'); +shouldBe('/[\\606]/.exec("y06").toString()', '"0"'); +shouldBe('/[\\606]/.exec("y6").toString()', '"6"'); +shouldBe('/\\101/.exec("yA1").toString()', '"A"'); +shouldBe('/[\\101]/.exec("yA1").toString()', '"A"'); +shouldBe('/\\1011/.exec("yA1").toString()', '"A1"'); +shouldBe('/[\\1011]/.exec("yA1").toString()', '"A"'); +shouldBe('/[\\1011]/.exec("y1").toString()', '"1"'); +shouldBe('/\\10q/.exec("y" + String.fromCharCode(8) + "q").toString()', 'String.fromCharCode(8) + "q"'); +shouldBe('/[\\10q]/.exec("y" + String.fromCharCode(8) + "q").toString()', 'String.fromCharCode(8)'); +shouldBe('/\\1q/.exec("y" + String.fromCharCode(1) + "q").toString()', 'String.fromCharCode(1) + "q"'); +shouldBe('/[\\1q]/.exec("y" + String.fromCharCode(1) + "q").toString()', 'String.fromCharCode(1)'); +shouldBe('/[\\1q]/.exec("yq").toString()', '"q"'); +shouldBe('/\\8q/.exec("\\\\8q").toString()', '"\\\\8q"'); +shouldBe('/[\\8q]/.exec("y8q").toString()', '"8"'); +shouldBe('/[\\8q]/.exec("yq").toString()', '"q"'); +shouldBe('/(x)\\1q/.exec("xxq").toString()', '"xxq,x"'); +shouldBe('/(x)[\\1q]/.exec("xxq").toString()', '"xq,x"'); +shouldBe('/(x)[\\1q]/.exec("xx" + String.fromCharCode(1)).toString()', '"x" + String.fromCharCode(1) + ",x"'); + +debug(''); diff --git a/deps/v8/test/webkit/fast/js/regexp-non-capturing-groups-expected.txt b/deps/v8/test/webkit/fast/js/regexp-non-capturing-groups-expected.txt new file mode 100644 index 0000000..ba21ae6 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-non-capturing-groups-expected.txt @@ -0,0 +1,46 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test for behavior of non-capturing groups, as described in a blog post by Steven Levithan and bug 14931. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS /(x)?\1y/.test("y") is true +PASS /(x)?\1y/.exec("y") is ["y", undefined] +PASS /(x)?y/.exec("y") is ["y", undefined] +PASS "y".match(/(x)?\1y/) is ["y", undefined] +PASS "y".match(/(x)?y/) is ["y", undefined] +PASS "y".match(/(x)?\1y/g) is ["y"] +PASS "y".split(/(x)?\1y/) is ["", undefined, ""] +PASS "y".split(/(x)?y/) is ["", undefined, ""] +PASS "y".search(/(x)?\1y/) is 0 +PASS "y".replace(/(x)?\1y/, "z") is "z" +PASS "y".replace(/(x)?y/, "$1") is "" +PASS "y".replace(/(x)?\1y/, function($0, $1){ return String($1); }) is "undefined" +PASS "y".replace(/(x)?y/, function($0, $1){ return String($1); }) is "undefined" +PASS "y".replace(/(x)?y/, function($0, $1){ return $1; }) is "undefined" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/regexp-non-capturing-groups.js b/deps/v8/test/webkit/fast/js/regexp-non-capturing-groups.js new file mode 100644 index 0000000..4d39966 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-non-capturing-groups.js @@ -0,0 +1,42 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'Test for behavior of non-capturing groups, as described in ' + +'a blog post by Steven Levithan and bug 14931.' +); + +shouldBe('/(x)?\\1y/.test("y")', 'true'); +shouldBe('/(x)?\\1y/.exec("y")', '["y", undefined]'); +shouldBe('/(x)?y/.exec("y")', '["y", undefined]'); +shouldBe('"y".match(/(x)?\\1y/)', '["y", undefined]'); +shouldBe('"y".match(/(x)?y/)', '["y", undefined]'); +shouldBe('"y".match(/(x)?\\1y/g)', '["y"]'); +shouldBe('"y".split(/(x)?\\1y/)', '["", undefined, ""]'); +shouldBe('"y".split(/(x)?y/)', '["", undefined, ""]'); +shouldBe('"y".search(/(x)?\\1y/)', '0'); +shouldBe('"y".replace(/(x)?\\1y/, "z")', '"z"'); +shouldBe('"y".replace(/(x)?y/, "$1")', '""'); +shouldBe('"y".replace(/(x)?\\1y/, function($0, $1){ return String($1); })', '"undefined"'); +shouldBe('"y".replace(/(x)?y/, function($0, $1){ return String($1); })', '"undefined"'); +shouldBe('"y".replace(/(x)?y/, function($0, $1){ return $1; })', '"undefined"'); diff --git a/deps/v8/test/webkit/fast/js/regexp-non-greedy-parentheses-expected.txt b/deps/v8/test/webkit/fast/js/regexp-non-greedy-parentheses-expected.txt new file mode 100644 index 0000000..f2b665b --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-non-greedy-parentheses-expected.txt @@ -0,0 +1,40 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test for regression against Wrong result in case of non-iterative matching of subpatterns in non-greedy cases in YARR Interpreter + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS "a".match(/(a)??/) is ["", undefined] +PASS "b".match(/(a)??/) is ["", undefined] +PASS "ab".match(/(a)??b/) is ["ab", "a"] +PASS "aaab".match(/(a+)??b/) is ["aaab", "aaa"] +PASS "abbc".match(/(a)??(b+)??c/) is ["abbc", "a", "bb"] +PASS "ac".match(/(a)??(b)??c/) is ["ac", "a", undefined] +PASS "abc".match(/(a(b)??)??c/) is ["abc", "ab", "b"] +PASS "ac".match(/(a(b)??)??c/) is ["ac", "a", undefined] +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/regexp-non-greedy-parentheses.js b/deps/v8/test/webkit/fast/js/regexp-non-greedy-parentheses.js new file mode 100644 index 0000000..48f19f3 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-non-greedy-parentheses.js @@ -0,0 +1,35 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'Test for regression against Wrong result in case of non-iterative matching of subpatterns in non-greedy cases in YARR Interpreter' +); + +shouldBe('"a".match(/(a)??/)', '["", undefined]'); +shouldBe('"b".match(/(a)??/)', '["", undefined]'); +shouldBe('"ab".match(/(a)??b/)', '["ab", "a"]'); +shouldBe('"aaab".match(/(a+)??b/)', '["aaab", "aaa"]'); +shouldBe('"abbc".match(/(a)??(b+)??c/)', '["abbc", "a", "bb"]'); +shouldBe('"ac".match(/(a)??(b)??c/)', '["ac", "a", undefined]'); +shouldBe('"abc".match(/(a(b)??)??c/)', '["abc", "ab", "b"]'); +shouldBe('"ac".match(/(a(b)??)??c/)', '["ac", "a", undefined]'); diff --git a/deps/v8/test/webkit/fast/js/regexp-range-out-of-order-expected.txt b/deps/v8/test/webkit/fast/js/regexp-range-out-of-order-expected.txt new file mode 100644 index 0000000..39d4c93 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-range-out-of-order-expected.txt @@ -0,0 +1,33 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test for bug 16129: REGRESSION (r27761-r27811): malloc error while visiting http://mysit.es (crashes release build). + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS /^[s{-.[]()]$/ threw exception SyntaxError: Invalid regular expression: /^[s{-.[]()]$/: Range out of order in character class. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/regexp-range-out-of-order.js b/deps/v8/test/webkit/fast/js/regexp-range-out-of-order.js new file mode 100644 index 0000000..f1ca53b --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-range-out-of-order.js @@ -0,0 +1,30 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( + +'Test for bug 16129: REGRESSION (r27761-r27811): malloc error while visiting http://mysit.es (crashes release build).' + +); + +shouldThrow('/^[\s{-.\[\]\(\)]$/'); diff --git a/deps/v8/test/webkit/fast/js/regexp-ranges-and-escaped-hyphens-expected.txt b/deps/v8/test/webkit/fast/js/regexp-ranges-and-escaped-hyphens-expected.txt new file mode 100644 index 0000000..943a966 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-ranges-and-escaped-hyphens-expected.txt @@ -0,0 +1,49 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Tests for bug #21232, and related range issues described in bug. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS regexp01.toString() is "1235" +PASS regexp01a.toString() is "123 5" +PASS regexp01b.toString() is "1-3 5" +PASS regexp01c.toString() is "1-3 5" +PASS regexp01d.toString() is "123 5" +PASS regexp01e.toString() is "123 5" +PASS regexp01f.toString() is "-3" +PASS regexp01g.toString() is "2-" +PASS regexp02.toString() is "1-35" +PASS regexp02a.toString() is "1-3 5" +PASS regexp02b.toString() is "1-3 5" +PASS regexp02c.toString() is "1-3 5" +PASS regexp02d.toString() is "1-3 5" +PASS regexp02e.toString() is "1-3 5" +PASS regexp03a.toString() is "-.0" +PASS regexp03b.toString() is "+,-" +PASS bug21232 is false +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/regexp-ranges-and-escaped-hyphens.js b/deps/v8/test/webkit/fast/js/regexp-ranges-and-escaped-hyphens.js new file mode 100644 index 0000000..3540f0a --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-ranges-and-escaped-hyphens.js @@ -0,0 +1,75 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'Tests for bug #21232, and related range issues described in bug.' +); + +// Basic test for ranges - one to three and five are in regexp, four is not, and '-' should not match +var regexp01 = /[1-35]+/.exec("-12354"); +shouldBe('regexp01.toString()', '"1235"'); +// Tests inserting an escape character class into the above pattern - where the spaces fall within the +// range it is no longer a range - hyphens should now match, two should not. +var regexp01a = /[\s1-35]+/.exec("-123 54"); +shouldBe('regexp01a.toString()', '"123 5"'); + +// These are invalid ranges, according to ECMA-262, but we allow them. +var regexp01b = /[1\s-35]+/.exec("21-3 54"); +shouldBe('regexp01b.toString()', '"1-3 5"'); +var regexp01c = /[1-\s35]+/.exec("21-3 54"); +shouldBe('regexp01c.toString()', '"1-3 5"'); + +var regexp01d = /[1-3\s5]+/.exec("-123 54"); +shouldBe('regexp01d.toString()', '"123 5"'); +var regexp01e = /[1-35\s5]+/.exec("-123 54"); +shouldBe('regexp01e.toString()', '"123 5"'); +// hyphens are normal charaters if a range is not fully specified. +var regexp01f = /[-3]+/.exec("2-34"); +shouldBe('regexp01f.toString()', '"-3"'); +var regexp01g = /[2-]+/.exec("12-3"); +shouldBe('regexp01g.toString()', '"2-"'); + +// Similar to the above tests, but where the hyphen is escaped this is never a range. +var regexp02 = /[1\-35]+/.exec("21-354"); +shouldBe('regexp02.toString()', '"1-35"'); +// As above. +var regexp02a = /[\s1\-35]+/.exec("21-3 54"); +shouldBe('regexp02a.toString()', '"1-3 5"'); +var regexp02b = /[1\s\-35]+/.exec("21-3 54"); +shouldBe('regexp02b.toString()', '"1-3 5"'); +var regexp02c = /[1\-\s35]+/.exec("21-3 54"); +shouldBe('regexp02c.toString()', '"1-3 5"'); +var regexp02d = /[1\-3\s5]+/.exec("21-3 54"); +shouldBe('regexp02d.toString()', '"1-3 5"'); +var regexp02e = /[1\-35\s5]+/.exec("21-3 54"); +shouldBe('regexp02e.toString()', '"1-3 5"'); + +// Test that an escaped hyphen can be used as a bound on a range. +var regexp03a = /[\--0]+/.exec(",-.01"); +shouldBe('regexp03a.toString()', '"-.0"'); +var regexp03b = /[+-\-]+/.exec("*+,-."); +shouldBe('regexp03b.toString()', '"+,-"'); + +// The actual bug reported. +var bug21232 = (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test('@'); +shouldBe('bug21232', 'false'); diff --git a/deps/v8/test/webkit/fast/js/regexp-stack-overflow-expected.txt b/deps/v8/test/webkit/fast/js/regexp-stack-overflow-expected.txt new file mode 100644 index 0000000..b728ecc --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-stack-overflow-expected.txt @@ -0,0 +1,33 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test for bug 8870: Crash typing in Yahoo auto-complete widget. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS result.length is 5 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/regexp-stack-overflow.js b/deps/v8/test/webkit/fast/js/regexp-stack-overflow.js new file mode 100644 index 0000000..9c0f1b5 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-stack-overflow.js @@ -0,0 +1,34 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( + +'Test for bug 8870: Crash typing in Yahoo auto-complete widget.' + +); + +re = new RegExp('^(\\s+|[,:{}\\[\\]]|"(\\\\["\\\\\\/bfnrtu]|[^\\x00-\\x1f"\\\\]+)*"|-?\\d+(\\.\\d*)?([eE][+-]?\\d+)?|true|false|null)+$', ''); + +result= re.exec('{"ResultSet":{"totalResultsAvailable":"101000000","totalResultsReturned":100,"firstResultPosition":1,"Result":[{"Title":"Solar Eclipses of Saros 132","Summary":"Solar Eclipses of Saros 132 Solar Eclipses of Saros 132 The periodicity and recurrence of solar (and lunar) eclipses is governed by the Saros cycle, a period of approximately 6,585. 3 days (18 years 11 days 8 hours). When two eclipses are ...","Url":"http:\\/\\/sunearth.gsfc.nasa.gov\\/eclipse\\/SEsaros\\/SEsaros132.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBUBzdmMwF;_ylu=X3oDMTB2cXVjNTM5BGNvbG8DdwRsA1dTMQRwb3MDMQRzZWMDc3IEdnRpZAM-\\/SIG=19ip3vo9u\\/EXP=1147592336\\/**http%3a\\/\\/rdrw1.yahoo.com\\/click%3fu=http%3a\\/\\/sunearth.gsfc.nasa.gov\\/eclipse\\/SEsaros\\/SEsaros132.html%26y=0405DC60F30D6DD673%26i=482%26c=15685%26q=02%255ESSHPM%255BL7.,-6%26e=utf-8%26r=0%26d=wow%7eWBSV-en-us%26n=3O6KG7JU5PIK8T7I%26s=6%26t=%26m=44658D10%26x=05A6B5FDC2F29725CD6EE467684E0FE76D","ModificationDate":1146207600,"MimeType":"text\\/html"},{"Title":"Psalms 132 -Matthew Henry\'s Commentary - Bible Software by johnhurt.com","Summary":"Psalms 132 - Matthew Henry Commentary - Bible Software by johnhurt.com ... Henry\'s Psalms 131. Psalms 132. Outline of Psalms 132. David\'s care for the ark ...","Url":"http:\\/\\/www.htmlbible.com\\/kjv30\\/henry\\/H19C132.htm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBVhzdmMwF;_ylu=X3oDMTB2ZjQ4dDExBGNvbG8DdwRsA1dTMQRwb3MDMgRzZWMDc3IEdnRpZAM-\\/SIG=1246fjpfq\\/EXP=1147592336\\/**http%3a\\/\\/www.htmlbible.com\\/kjv30\\/henry\\/H19C132.htm","ModificationDate":1015660800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBWxzdmMwF;_ylu=X3oDMTBwZG5hOWwzBGNvbG8DdwRwb3MDMgRzZWMDc3IEdnRpZAM-\\/SIG=16llm3b1a\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.htmlbible.com\\/kjv30\\/henry\\/H19C132.htm%26w=132%26d=XlIIG0aqMlsm%26icp=1%26.intl=us","Size":"4160"}},{"Title":"General requirements. - 1910.132","Summary":"General%20requirements.%20-%201910.132 ... Regulations (Standards - 29 CFR) General requirements. - 1910.132 ... of any part of the body through absorption, inhalation or physical contact. 1910.132(b) Employee-owned equipment ...","Url":"http:\\/\\/www.osha.gov\\/pls\\/oshaweb\\/owadisp.show_document?p_table=STANDARDS&p_id=9777","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBXRzdmMwF;_ylu=X3oDMTB2M3MzdmZoBGNvbG8DdwRsA1dTMQRwb3MDMwRzZWMDc3IEdnRpZAM-\\/SIG=13916ebti\\/EXP=1147592336\\/**http%3a\\/\\/www.osha.gov\\/pls\\/oshaweb\\/owadisp.show_document%3fp_table=STANDARDS%26p_id=9777","ModificationDate":1147330800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBYhzdmMwF;_ylu=X3oDMTBwZ2dpZ2ZkBGNvbG8DdwRwb3MDMwRzZWMDc3IEdnRpZAM-\\/SIG=186osem1n\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.osha.gov\\/pls\\/oshaweb\\/owadisp.show_document%253Fp_table%253DSTANDARDS%2526p_id%253D9777%26w=132%26d=Ujn5sEaqMw88%26icp=1%26.intl=us","Size":"29922"}},{"Title":"USCCB - NAB - Psalm 132","Summary":"Chapter 132. 1. 1 A song of ascents. 2 LORD, remember David and all his anxious care; 2. 3 How he swore an oath to the LORD, vowed to the Mighty One of Jacob: 3. \\"I will not enter the house where I live, nor lie on the couch where I sleep; ... 1 [Psalm 132] A song for a liturgical ceremony in which the ark, the throne of Israel\'s God, was carried in ...","Url":"http:\\/\\/www.usccb.org\\/nab\\/bible\\/psalms\\/psalm132.htm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBZBzdmMwF;_ylu=X3oDMTB2OWM1MXQ5BGNvbG8DdwRsA1dTMQRwb3MDNARzZWMDc3IEdnRpZAM-\\/SIG=126n03p75\\/EXP=1147592336\\/**http%3a\\/\\/www.usccb.org\\/nab\\/bible\\/psalms\\/psalm132.htm","ModificationDate":1054623600,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBaRzdmMwF;_ylu=X3oDMTBwYzFnNmkxBGNvbG8DdwRwb3MDNARzZWMDc3IEdnRpZAM-\\/SIG=16nvcm74b\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.usccb.org\\/nab\\/bible\\/psalms\\/psalm132.htm%26w=132%26d=FMBGyUaqMh-a%26icp=1%26.intl=us","Size":"8840"}},{"Title":"* City of Lost Dreams Mod *","Summary":"Mafia game modification","Url":"http:\\/\\/www.citizen-132.com\\/","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBaxzdmMwF;_ylu=X3oDMTB2NW50aG1hBGNvbG8DdwRsA1dTMQRwb3MDNQRzZWMDc3IEdnRpZAM-\\/SIG=11fnqlf31\\/EXP=1147592336\\/**http%3a\\/\\/www.citizen-132.com\\/","ModificationDate":1107676800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBcBzdmMwF;_ylu=X3oDMTBwdDJ0dDBoBGNvbG8DdwRwb3MDNQRzZWMDc3IEdnRpZAM-\\/SIG=160jdk4g3\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.citizen-132.com\\/%26w=132%26d=ZiSHAkaqMuny%26icp=1%26.intl=us","Size":"6861"}},{"Title":"BibleGateway.com: Search for a Bible passage in over 35 languages and 50 versions.","Summary":"English (EN) Espa\\u00f1ol (ES) Passage results ... Footnotes: Psalm 132:6 That is, Kiriath Jearim. Psalm 132:6 Or heard of it in ...","Url":"http:\\/\\/www.biblegateway.com\\/passage\\/?book_id=23&chapter=132&version=31","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBchzdmMwF;_ylu=X3oDMTB2azJrdmpwBGNvbG8DdwRsA1dTMQRwb3MDNgRzZWMDc3IEdnRpZAM-\\/SIG=1300p6cfh\\/EXP=1147592336\\/**http%3a\\/\\/www.biblegateway.com\\/passage\\/%3fbook_id=23%26chapter=132%26version=31","ModificationDate":1147158000,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBdxzdmMwF;_ylu=X3oDMTBwYmwxdWo4BGNvbG8DdwRwb3MDNgRzZWMDc3IEdnRpZAM-\\/SIG=183q9adk2\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.biblegateway.com\\/passage\\/%253Fbook_id%253D23%2526chapter%253D132%2526version%253D31%26w=132%26d=XUM-1kaqMwKY%26icp=1%26.intl=us","Size":"27373"}},{"Title":"132 - Wikipedia, the free encyclopedia","Summary":"From Wikipedia, the free encyclopedia. This article is about the year. For other uses, see 132 (number). Events. Roman Empire. The Olympeion in Athens is completed ... Your continued donations keep Wikipedia running! 132. From Wikipedia, the free encyclopedia ... For other uses, see 132 (number). Years: 128 129 130 131 - 132 - 133 134 135 136 ...","Url":"http:\\/\\/en.wikipedia.org\\/wiki\\/132","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBeRzdmMwF;_ylu=X3oDMTB2bDEyNXM5BGNvbG8DdwRsA1dTMQRwb3MDNwRzZWMDc3IEdnRpZAM-\\/SIG=11k81281i\\/EXP=1147592336\\/**http%3a\\/\\/en.wikipedia.org\\/wiki\\/132","ModificationDate":1145862000,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBfhzdmMwF;_ylu=X3oDMTBwMTB0ZWFoBGNvbG8DdwRwb3MDNwRzZWMDc3IEdnRpZAM-\\/SIG=165kmnv8l\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=en.wikipedia.org\\/wiki\\/132%26w=132%26d=OcxF4UaqMuf2%26icp=1%26.intl=us","Size":"15956"}},{"Title":"BBC SPORT | Football | Internationals","Summary":"Visit BBC Sport for all the action as it happens - up-to-the-minute news, results, breaking news, video, audio and feature stories. BBC Sport covers the major events and all the professional football clubs in the UK, plus cricket, rugby, golf, ...","Url":"http:\\/\\/news.bbc.co.uk\\/sport1\\/hi\\/football\\/internationals\\/default.stm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBgBzdmMwF;_ylu=X3oDMTB2bTU4Zm85BGNvbG8DdwRsA1dTMQRwb3MDOARzZWMDc3IEdnRpZAM-\\/SIG=12n3aafin\\/EXP=1147592336\\/**http%3a\\/\\/news.bbc.co.uk\\/sport1\\/hi\\/football\\/internationals\\/default.stm","ModificationDate":1147417200,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBhRzdmMwF;_ylu=X3oDMTBwYTZ1aGtmBGNvbG8DdwRwb3MDOARzZWMDc3IEdnRpZAM-\\/SIG=178rplb9d\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=news.bbc.co.uk\\/sport1\\/hi\\/football\\/internationals\\/default.stm%26w=132%26d=PmSx-kaqMw8o%26icp=1%26.intl=us","Size":"52634"}},{"Title":"Metro Route 132 Timetable, Weekday","Summary":"... Custom Print Help. 132. Weekday: Feb. 11 thru June 2, 2006 ...","Url":"http:\\/\\/transit.metrokc.gov\\/tops\\/bus\\/schedules\\/s132_0_.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBhxzdmMwF;_ylu=X3oDMTB2dW8yNmN0BGNvbG8DdwRsA1dTMQRwb3MDOQRzZWMDc3IEdnRpZAM-\\/SIG=12eusl28m\\/EXP=1147592336\\/**http%3a\\/\\/transit.metrokc.gov\\/tops\\/bus\\/schedules\\/s132_0_.html","ModificationDate":1146553200,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBjBzdmMwF;_ylu=X3oDMTBwOTRzYmZlBGNvbG8DdwRwb3MDOQRzZWMDc3IEdnRpZAM-\\/SIG=16vd4gkvv\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=transit.metrokc.gov\\/tops\\/bus\\/schedules\\/s132_0_.html%26w=132%26d=Nvq_ekaqMulb%26icp=1%26.intl=us","Size":"27482"}},{"Title":"BBC NEWS | Politics | Bush arrives for state visit","Summary":"George Bush arrives in the UK for the first state visit by a US president amid some of the tightest security London has seen.","Url":"http:\\/\\/news.bbc.co.uk\\/1\\/hi\\/uk_politics\\/3279179.stm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBjhzdmMwF;_ylu=X3oDMTEwc3RuNTk4BGNvbG8DdwRsA1dTMQRwb3MDMTAEc2VjA3NyBHZ0aWQD\\/SIG=126am8694\\/EXP=1147592336\\/**http%3a\\/\\/news.bbc.co.uk\\/1\\/hi\\/uk_politics\\/3279179.stm","ModificationDate":1147417200,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBkxzdmMwF;_ylu=X3oDMTBxNTUzbTg4BGNvbG8DdwRwb3MDMTAEc2VjA3NyBHZ0aWQD\\/SIG=16nt5u57o\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=news.bbc.co.uk\\/1\\/hi\\/uk_politics\\/3279179.stm%26w=132%26d=CxDE2UaqMw8U%26icp=1%26.intl=us","Size":"43537"}},{"Title":"132 (number) - Wikipedia, the free encyclopedia","Summary":"... you can make from 132, you get 132: 12 + 13 + 21 + 23 + 31 + 32 = 132. 132 is the smallest number ...","Url":"http:\\/\\/en.wikipedia.org\\/wiki\\/132_(number)","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBlRzdmMwF;_ylu=X3oDMTEwNXN0b3YwBGNvbG8DdwRsA1dTMQRwb3MDMTEEc2VjA3NyBHZ0aWQD\\/SIG=11thbnu67\\/EXP=1147592336\\/**http%3a\\/\\/en.wikipedia.org\\/wiki\\/132_(number)","ModificationDate":1145430000,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBmhzdmMwF;_ylu=X3oDMTBxYnA3amlzBGNvbG8DdwRwb3MDMTEEc2VjA3NyBHZ0aWQD\\/SIG=16m4qjjlq\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=en.wikipedia.org\\/wiki\\/132_%2528number%2529%26w=132%26d=Ygdh6EaqMsBb%26icp=1%26.intl=us","Size":"13154"}},{"Title":"Psalms, Chapter 132","Summary":"King James Reference Suite - Bible Software by johnhurt.com ... Chapter 132. 1. Lord, remember David, and all his afflictions ... Notes on Chapter 132. 1. 2. 3 ...","Url":"http:\\/\\/www.htmlbible.com\\/kjv30\\/B19C132.htm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBnBzdmMwF;_ylu=X3oDMTEwNmgxNTZoBGNvbG8DdwRsA1dTMQRwb3MDMTIEc2VjA3NyBHZ0aWQD\\/SIG=11uujk8hq\\/EXP=1147592336\\/**http%3a\\/\\/www.htmlbible.com\\/kjv30\\/B19C132.htm","ModificationDate":1079942400,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBoRzdmMwF;_ylu=X3oDMTBxN2cybDkwBGNvbG8DdwRwb3MDMTIEc2VjA3NyBHZ0aWQD\\/SIG=16fpgk3vj\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.htmlbible.com\\/kjv30\\/B19C132.htm%26w=132%26d=TaFtBUaqMwcr%26icp=1%26.intl=us","Size":"8721"}},{"Title":"SPACE.com -- Privately Funded SpaceShipOne Breaks Sound Barrier","Summary":"A privately financed passenger-carrying sub-orbital rocket plane screamed its way through the sound barrier today, the 100th anniversary of the Wright Brothers historic 12-second flight over Kitty Hawk, North Carolina.","Url":"http:\\/\\/www.space.com\\/businesstechnology\\/technology\\/rutan_update_031217.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBoxzdmMwF;_ylu=X3oDMTEwNHRmcnV0BGNvbG8DdwRsA1dTMQRwb3MDMTMEc2VjA3NyBHZ0aWQD\\/SIG=12vltjpcd\\/EXP=1147592336\\/**http%3a\\/\\/www.space.com\\/businesstechnology\\/technology\\/rutan_update_031217.html","ModificationDate":1147330800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBqBzdmMwF;_ylu=X3oDMTBxajcxM3AwBGNvbG8DdwRwb3MDMTMEc2VjA3NyBHZ0aWQD\\/SIG=17g6i6br5\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.space.com\\/businesstechnology\\/technology\\/rutan_update_031217.html%26w=132%26d=CklT2kaqMwqb%26icp=1%26.intl=us","Size":"39319"}},{"Title":"D&C 132","Summary":"THE DOCTRINE AND COVENANTS. SECTION 132 ... LDS HomeScriptures Doctrine and Covenants Sections Section 132. Prev | Next ... SECTION 132. Revelation given through Joseph Smith the Prophet, at Nauvoo, Illinois, recorded July 12, 1843 ...","Url":"http:\\/\\/scriptures.lds.org\\/dc\\/132","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBqhzdmMwF;_ylu=X3oDMTEwamo4ZjVjBGNvbG8DdwRsA1dTMQRwb3MDMTQEc2VjA3NyBHZ0aWQD\\/SIG=11k67f7oi\\/EXP=1147592336\\/**http%3a\\/\\/scriptures.lds.org\\/dc\\/132","ModificationDate":1146985200,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBrxzdmMwF;_ylu=X3oDMTBxcDhuOXFrBGNvbG8DdwRwb3MDMTQEc2VjA3NyBHZ0aWQD\\/SIG=165qbp40u\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=scriptures.lds.org\\/dc\\/132%26w=132%26d=KIW1S0aqMwF3%26icp=1%26.intl=us","Size":"51549"}},{"Title":"State Representative District 132","Summary":"State Representative District 132. State Representative District 132 is shaded area. SACO. BIDDEFORD. 127. 132. 133. 136. OLD ORCHARD BEACH. SACO","Url":"http:\\/\\/mainegov-images.informe.org\\/sos\\/cec\\/elec\\/apport\\/House\\/h132.pdf","ClickUrl":"http:\\/\\/mainegov-images.informe.org\\/sos\\/cec\\/elec\\/apport\\/House\\/h132.pdf#search=\'\'","ModificationDate":1075968000,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBtBzdmMwF;_ylu=X3oDMTBxbnZxbGc1BGNvbG8DdwRwb3MDMTUEc2VjA3NyBHZ0aWQD\\/SIG=17at7erej\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=mainegov-images.informe.org\\/sos\\/cec\\/elec\\/apport\\/House\\/h132.pdf%26w=132%26d=DsRim0aqMiIQ%26icp=1%26.intl=us","Size":"129767"}},{"Title":"BLB Psa 132","Summary":"We apologize, but the page layout is not visible because you are using an older browser. We recommend upgrading to a standards-compliant browser. Without such, this page will remain viewable, though unformatted.","Url":"http:\\/\\/www.blueletterbible.org\\/kjv\\/Psa\\/Psa132.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBthzdmMwF;_ylu=X3oDMTEwdXRzN2p1BGNvbG8DdwRsA1dTMQRwb3MDMTYEc2VjA3NyBHZ0aWQD\\/SIG=126nkscdr\\/EXP=1147592336\\/**http%3a\\/\\/www.blueletterbible.org\\/kjv\\/Psa\\/Psa132.html","ModificationDate":1146985200,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBuxzdmMwF;_ylu=X3oDMTBxdWpsMnAxBGNvbG8DdwRwb3MDMTYEc2VjA3NyBHZ0aWQD\\/SIG=16nmo95in\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.blueletterbible.org\\/kjv\\/Psa\\/Psa132.html%26w=132%26d=RzXlkkaqMwDE%26icp=1%26.intl=us","Size":"40835"}},{"Title":"ADL Found Guilty Of Spying By California Court","Summary":"ADL Found Guilty Of Spying. By California Court. By Barbara Ferguson. Arab News Correspondent. 4-27-2","Url":"http:\\/\\/www.rense.com\\/general24\\/adl.htm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBvRzdmMwF;_ylu=X3oDMTEwcm5pb3BuBGNvbG8DdwRsA1dTMQRwb3MDMTcEc2VjA3NyBHZ0aWQD\\/SIG=11qjguns4\\/EXP=1147592336\\/**http%3a\\/\\/www.rense.com\\/general24\\/adl.htm","ModificationDate":1019890800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBwhzdmMwF;_ylu=X3oDMTBxN2RrOGV1BGNvbG8DdwRwb3MDMTcEc2VjA3NyBHZ0aWQD\\/SIG=16bnmcrht\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.rense.com\\/general24\\/adl.htm%26w=132%26d=Xkre4EaqMuwO%26icp=1%26.intl=us","Size":"5916"}},{"Title":"FindLaw for Legal Professionals - Case Law, Federal and State Resources, Forms, and Code","Summary":"FindLaw for Legal Professionals is a free resource for attorneys that includes online case law, free state codes, free federal codes, free legal forms, and a directory of products and services for lawyers. This online legal Web site also includes...","Url":"http:\\/\\/caselaw.lp.findlaw.com\\/cgi-bin\\/getcase.pl?court=US&vol=391&invol=936","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBxBzdmMwF;_ylu=X3oDMTEwa2drb20xBGNvbG8DdwRsA1dTMQRwb3MDMTgEc2VjA3NyBHZ0aWQD\\/SIG=135rsl3q8\\/EXP=1147592336\\/**http%3a\\/\\/caselaw.lp.findlaw.com\\/cgi-bin\\/getcase.pl%3fcourt=US%26vol=391%26invol=936","ModificationDate":1147330800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcByRzdmMwF;_ylu=X3oDMTBxZGJndmNzBGNvbG8DdwRwb3MDMTgEc2VjA3NyBHZ0aWQD\\/SIG=188s7bq1v\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=caselaw.lp.findlaw.com\\/cgi-bin\\/getcase.pl%253Fcourt%253DUS%2526vol%253D391%2526invol%253D936%26w=132%26d=GCWYIUaqMwZK%26icp=1%26.intl=us","Size":"57332"}},{"Title":"Chapter 132","Summary":"... Public Records. \\u00a7 132\\u20101. \\" Public records\\" defined ... Public records, as defined in G.S. 132\\u20101, shall not include written communications (and copies thereof) to any public ...","Url":"http:\\/\\/www.ncleg.net\\/EnactedLegislation\\/Statutes\\/HTML\\/ByChapter\\/Chapter_132.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcByxzdmMwF;_ylu=X3oDMTEwdjV0NWw0BGNvbG8DdwRsA1dTMQRwb3MDMTkEc2VjA3NyBHZ0aWQD\\/SIG=1349nldcc\\/EXP=1147592336\\/**http%3a\\/\\/www.ncleg.net\\/EnactedLegislation\\/Statutes\\/HTML\\/ByChapter\\/Chapter_132.html","ModificationDate":1141027200,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB0BzdmMwF;_ylu=X3oDMTBxdDJjbXM4BGNvbG8DdwRwb3MDMTkEc2VjA3NyBHZ0aWQD\\/SIG=17lgm2hmb\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.ncleg.net\\/EnactedLegislation\\/Statutes\\/HTML\\/ByChapter\\/Chapter_132.html%26w=132%26d=akl3I0aqMt5y%26icp=1%26.intl=us","Size":"76411"}},{"Title":"oremus Bible Browser : Psalm 132","Summary":"Psalm 132. A Song of Ascents. 1O Lord, remember in David\'s favour. all the hardships he endured; 2how he swore to the Lord. and vowed to the Mighty One of Jacob, 3 I will not enter my house. or get into my bed;","Url":"http:\\/\\/bible.oremus.org\\/?passage=Psalm+132","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB0hzdmMwF;_ylu=X3oDMTEwcDU0bmdlBGNvbG8DdwRsA1dTMQRwb3MDMjAEc2VjA3NyBHZ0aWQD\\/SIG=122hghelb\\/EXP=1147592336\\/**http%3a\\/\\/bible.oremus.org\\/%3fpassage=Psalm%2b132","ModificationDate":1138003200,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB1xzdmMwF;_ylu=X3oDMTBxbjVuNnZxBGNvbG8DdwRwb3MDMjAEc2VjA3NyBHZ0aWQD\\/SIG=16ppk73gi\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=bible.oremus.org\\/%253Fpassage%253DPsalm%2b132%26w=132%26d=MBPBT0aqMkLR%26icp=1%26.intl=us","Size":"6083"}},{"Title":"Electronic Code of Federal Regulations:","Summary":"... Application of part 132 requirements in Great Lakes States and Tribes ... Appendix A to Part 132 --Great Lakes Water Quality Initiative Methodologies for Development of Aquatic Life ...","Url":"http:\\/\\/ecfr.gpoaccess.gov\\/cgi\\/t\\/text\\/text-idx?c=ecfr&tpl=\\/ecfrbrowse\\/Title40\\/40cfr132_main_02.tpl","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB2RzdmMwF;_ylu=X3oDMTEwMGRnbnZ2BGNvbG8DdwRsA1dTMQRwb3MDMjEEc2VjA3NyBHZ0aWQD\\/SIG=13p811gl2\\/EXP=1147592336\\/**http%3a\\/\\/ecfr.gpoaccess.gov\\/cgi\\/t\\/text\\/text-idx%3fc=ecfr%26tpl=\\/ecfrbrowse\\/Title40\\/40cfr132_main_02.tpl","ModificationDate":1147244400,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB3hzdmMwF;_ylu=X3oDMTBxb2QzaXJsBGNvbG8DdwRwb3MDMjEEc2VjA3NyBHZ0aWQD\\/SIG=18m524f9v\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=ecfr.gpoaccess.gov\\/cgi\\/t\\/text\\/text-idx%253Fc%253Decfr%2526tpl%253D\\/ecfrbrowse\\/Title40\\/40cfr132_main_02.tpl%26w=132%26d=OC6Oa0aqMwQa%26icp=1%26.intl=us","Size":"24321"}},{"Title":"BibleGateway.com - Passage Lookup: Psalms 132;","Summary":"English (EN) Espa\\u00f1ol (ES) Passage results ... View commentary related to this passage : Psalm 132. Psalm 132 (Amplified Bible ...","Url":"http:\\/\\/www.biblegateway.com\\/passage?search=Psalms+132;&version=45;","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB4BzdmMwF;_ylu=X3oDMTEwMmJvNjYwBGNvbG8DdwRsA1dTMQRwb3MDMjIEc2VjA3NyBHZ0aWQD\\/SIG=12s5v8a5i\\/EXP=1147592336\\/**http%3a\\/\\/www.biblegateway.com\\/passage%3fsearch=Psalms%2b132;%26version=45;","ModificationDate":1139990400,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB5RzdmMwF;_ylu=X3oDMTBxOTdwc3RpBGNvbG8DdwRwb3MDMjIEc2VjA3NyBHZ0aWQD\\/SIG=1810cufkn\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.biblegateway.com\\/passage%253Fsearch%253DPsalms%2b132%253B%2526version%253D45%253B%26w=132%26d=KJ4R3EaqMjLm%26icp=1%26.intl=us","Size":"27611"}},{"Title":"N-132: Wu-ftpd Buffer Overflow Vulnerability","Summary":"INFORMATION BULLETIN. N-132: Wu-ftpd Buffer Overflow Vulnerability. [Red Hat Security Advisory RHSA-2003:245-15] July 31, 2003 18:00 GMT. [Revised 13 Aug 2003] [Revised 14 Aug 2003] [Revised 5 Sept 2003] [Revised 8 Oct 2003]","Url":"http:\\/\\/www.ciac.org\\/ciac\\/bulletins\\/n-132.shtml","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB5xzdmMwF;_ylu=X3oDMTEwZXVqN2J0BGNvbG8DdwRsA1dTMQRwb3MDMjMEc2VjA3NyBHZ0aWQD\\/SIG=122msf6uh\\/EXP=1147592336\\/**http%3a\\/\\/www.ciac.org\\/ciac\\/bulletins\\/n-132.shtml","ModificationDate":1146812400,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB7BzdmMwF;_ylu=X3oDMTBxbm8wZ2ZmBGNvbG8DdwRwb3MDMjMEc2VjA3NyBHZ0aWQD\\/SIG=16jq98ra6\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.ciac.org\\/ciac\\/bulletins\\/n-132.shtml%26w=132%26d=cBzeO0aqMu2t%26icp=1%26.intl=us","Size":"12337"}},{"Title":"Bumpy Objects","Summary":"Bumpy Objects","Url":"http:\\/\\/acm.uva.es\\/p\\/v1\\/132.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB7hzdmMwF;_ylu=X3oDMTEwZmNyM2VjBGNvbG8DdwRsA1dTMQRwb3MDMjQEc2VjA3NyBHZ0aWQD\\/SIG=11j1o5t64\\/EXP=1147592336\\/**http%3a\\/\\/acm.uva.es\\/p\\/v1\\/132.html","ModificationDate":1057820400,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB8xzdmMwF;_ylu=X3oDMTBxNWw4M3FvBGNvbG8DdwRwb3MDMjQEc2VjA3NyBHZ0aWQD\\/SIG=164vlv52k\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=acm.uva.es\\/p\\/v1\\/132.html%26w=132%26d=ZSctVkaqMvQs%26icp=1%26.intl=us","Size":"2803"}},{"Title":"The Hayes memo is important\\u2014but bogus. By Daniel Benjamin","Summary":"When they published their \\" Case Closed\\" cover story three weeks ago on the relationship between Saddam Hussein\'s Iraq and al-Qaida, the editors of the Weekly Standard aimed to set off a bomb. The article was centered on a sizable leak\\u2014a gusher...","Url":"http:\\/\\/www.slate.com\\/id\\/2092180\\/","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB9RzdmMwF;_ylu=X3oDMTEwamxzbHY1BGNvbG8DdwRsA1dTMQRwb3MDMjUEc2VjA3NyBHZ0aWQD\\/SIG=11kj0d4q1\\/EXP=1147592336\\/**http%3a\\/\\/www.slate.com\\/id\\/2092180\\/","ModificationDate":1147071600,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB.hzdmMwF;_ylu=X3oDMTBxdGc1MmltBGNvbG8DdwRwb3MDMjUEc2VjA3NyBHZ0aWQD\\/SIG=16507c1iu\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=slate.msn.com\\/id\\/2092180\\/%26w=132%26d=bWigBUaqMvyd%26icp=1%26.intl=us","Size":"40222"}},{"Title":"FNMOC WXMAP: North America","Summary":"UNCLASSIFIED. FNMOC WXMAP. Model: NOGAPS. Area: North America. DTG: 2006050500. UNCLASSIFIED","Url":"https:\\/\\/www.fnmoc.navy.mil\\/CGI\\/PUBLIC\\/wxmap_single.cgi?area=ngp_namer&prod=850&tau=132","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB_BzdmMwF;_ylu=X3oDMTEwNDNwbjA5BGNvbG8DdwRsA1dTMQRwb3MDMjYEc2VjA3NyBHZ0aWQD\\/SIG=13g43sejj\\/EXP=1147592336\\/**https%3a\\/\\/www.fnmoc.navy.mil\\/CGI\\/PUBLIC\\/wxmap_single.cgi%3farea=ngp_namer%26prod=850%26tau=132","ModificationDate":1146812400,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBAR3dmMwF;_ylu=X3oDMTBxN2ZrcnVrBGNvbG8DdwRwb3MDMjYEc2VjA3NyBHZ0aWQD\\/SIG=18s7gc72v\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=https%3a\\/\\/www.fnmoc.navy.mil\\/CGI\\/PUBLIC\\/wxmap_single.cgi%253Farea%253Dngp_namer%2526prod%253D850%2526tau%253D132%26w=132%26d=KiW5fUaqMvIm%26icp=1%26.intl=us","Size":"9048"}},{"Title":"O-132: BEA WebLogic Server and Express Certificate Spoofing Vulnerability","Summary":"INFORMATION BULLETIN. O-132: BEA WebLogic Server and Express Certificate Spoofing Vulnerability. [BEA Security Advisory: BEA04-54.00] April 30, 2004 20:00 GMT. PROBLEM:","Url":"http:\\/\\/ciac.llnl.gov\\/ciac\\/bulletins\\/o-132.shtml","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBAx3dmMwF;_ylu=X3oDMTEwb2lhN21nBGNvbG8DdwRsA1dTMQRwb3MDMjcEc2VjA3NyBHZ0aWQD\\/SIG=1231gt787\\/EXP=1147592336\\/**http%3a\\/\\/ciac.llnl.gov\\/ciac\\/bulletins\\/o-132.shtml","ModificationDate":1142064000,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBCB3dmMwF;_ylu=X3oDMTBxaGVsMDBlBGNvbG8DdwRwb3MDMjcEc2VjA3NyBHZ0aWQD\\/SIG=16k4puak0\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=ciac.llnl.gov\\/ciac\\/bulletins\\/o-132.shtml%26w=132%26d=ZZgzx0aqMjzn%26icp=1%26.intl=us","Size":"10701"}},{"Title":"NET Bible\\u00ae - Psalms 132","Summary":"... Psalms 132. Psalm 1321. A song of ascents.2. 132:1 O Lord, for David\'s sake remember ...","Url":"http:\\/\\/www.bible.org\\/netbible\\/psa132.htm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBCh3dmMwF;_ylu=X3oDMTEwYjBiNjdsBGNvbG8DdwRsA1dTMQRwb3MDMjgEc2VjA3NyBHZ0aWQD\\/SIG=11sp4034c\\/EXP=1147592336\\/**http%3a\\/\\/www.bible.org\\/netbible\\/psa132.htm","ModificationDate":1133769600,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBDx3dmMwF;_ylu=X3oDMTBxOWNtc2JjBGNvbG8DdwRwb3MDMjgEc2VjA3NyBHZ0aWQD\\/SIG=16duuokm4\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.bible.org\\/netbible\\/psa132.htm%26w=132%26d=aVzzT0aqMwNl%26icp=1%26.intl=us","Size":"6048"}},{"Title":"HoustonChronicle.com - Sports: Fran Blinebury","Summary":"06, 2006. Column archive 2002. [an error occurred while processing this directive]","Url":"http:\\/\\/www.chron.com\\/content\\/chronicle\\/sports\\/blinebury\\/home","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBER3dmMwF;_ylu=X3oDMTEwcmlvNjMyBGNvbG8DdwRsA1dTMQRwb3MDMjkEc2VjA3NyBHZ0aWQD\\/SIG=12gac009r\\/EXP=1147592336\\/**http%3a\\/\\/www.chron.com\\/content\\/chronicle\\/sports\\/blinebury\\/home","ModificationDate":1146898800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBFh3dmMwF;_ylu=X3oDMTBxNTVsY25mBGNvbG8DdwRwb3MDMjkEc2VjA3NyBHZ0aWQD\\/SIG=171sgehbh\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.chron.com\\/content\\/chronicle\\/sports\\/blinebury\\/home%26w=132%26d=I3QMYEaqMuxa%26icp=1%26.intl=us","Size":"27335"}},{"Title":"FNMOC WXMAP: North America","Summary":"UNCLASSIFIED. FNMOC WXMAP. Model: NOGAPS. Area: North America. DTG: 2006050512. UNCLASSIFIED","Url":"https:\\/\\/www.fnmoc.navy.mil\\/CGI\\/PUBLIC\\/wxmap_single.cgi?area=ngp_namer&prod=prp&tau=132","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBGB3dmMwF;_ylu=X3oDMTEwN2g4ZWdqBGNvbG8DdwRsA1dTMQRwb3MDMzAEc2VjA3NyBHZ0aWQD\\/SIG=13g08kode\\/EXP=1147592336\\/**https%3a\\/\\/www.fnmoc.navy.mil\\/CGI\\/PUBLIC\\/wxmap_single.cgi%3farea=ngp_namer%26prod=prp%26tau=132","ModificationDate":1146812400,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBHR3dmMwF;_ylu=X3oDMTBxaGdhODhjBGNvbG8DdwRwb3MDMzAEc2VjA3NyBHZ0aWQD\\/SIG=18solhmco\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=https%3a\\/\\/www.fnmoc.navy.mil\\/CGI\\/PUBLIC\\/wxmap_single.cgi%253Farea%253Dngp_namer%2526prod%253Dprp%2526tau%253D132%26w=132%26d=MKdCgkaqMuri%26icp=1%26.intl=us","Size":"9048"}},{"Title":"US CODE: Title 36,132. National School Lunch Week","Summary":"National School Lunch Week. Release date: 2005-10-11. (a) Designation.\\u2014. The week beginning on the second Sunday in October is National School Lunch Week. (b) Proclamation.\\u2014 ... TITLE 36 > Subtitle I > Part A > CHAPTER 1 > \\u00a7 132. Prev | Next. \\u00a7 132. National School Lunch Week ...","Url":"http:\\/\\/www4.law.cornell.edu\\/uscode\\/html\\/uscode36\\/usc_sec_36_00000132----000-.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBHx3dmMwF;_ylu=X3oDMTEwN3BsMm9vBGNvbG8DdwRsA1dTMQRwb3MDMzEEc2VjA3NyBHZ0aWQD\\/SIG=1359dp76s\\/EXP=1147592336\\/**http%3a\\/\\/www4.law.cornell.edu\\/uscode\\/html\\/uscode36\\/usc_sec_36_00000132----000-.html","ModificationDate":1145343600,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBJB3dmMwF;_ylu=X3oDMTBxNG81cnMxBGNvbG8DdwRwb3MDMzEEc2VjA3NyBHZ0aWQD\\/SIG=17m1he9ur\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www4.law.cornell.edu\\/uscode\\/html\\/uscode36\\/usc_sec_36_00000132----000-.html%26w=132%26d=NTi8bUaqMpvs%26icp=1%26.intl=us","Size":"8976"}},{"Title":"ATel #132: IGR J17464-3213","Summary":"Outside. Other. Present Time: 7 May 2006; 4:08 UT. RSS. XML Gamma Ray Bursts. IGR J17464-3213 ... IGR J17464-3213. ATel #132; M. Revnivtsev (IKI, Moscow; MPA, Garching), M ... XTE J1746-322 = IGR J17464-3213 = H1743-322. 132. IGR J17464-3213 ...","Url":"http:\\/\\/www.astronomerstelegram.org\\/?read=132","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBJh3dmMwF;_ylu=X3oDMTEwYWI0N2o2BGNvbG8DdwRsA1dTMQRwb3MDMzIEc2VjA3NyBHZ0aWQD\\/SIG=122qvcsd1\\/EXP=1147592336\\/**http%3a\\/\\/www.astronomerstelegram.org\\/%3fread=132","ModificationDate":1146985200,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBKx3dmMwF;_ylu=X3oDMTBxYmt2ZDZzBGNvbG8DdwRwb3MDMzIEc2VjA3NyBHZ0aWQD\\/SIG=16pipao89\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.astronomerstelegram.org\\/%253Fread%253D132%26w=132%26d=Pb4lcUaqMvBj%26icp=1%26.intl=us","Size":"9056"}},{"Title":"Vashegyite Mineral Data","Summary":"Vashegyite Mineral Data + General Vashegyite Information. Chemical Formula: Al11(PO4)9(OH)6\\u00b738(H2O) or Al6(PO4)5(OH)3\\u00b723(H2O) Composition: Molecular Weight = 1,938.16 gm. Aluminum 15.31 % Al 28.93 % Al2O3","Url":"http:\\/\\/www.webmineral.com\\/data\\/Vashegyite.shtml","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBLR3dmMwF;_ylu=X3oDMTEwNHFvMGppBGNvbG8DdwRsA1dTMQRwb3MDMzMEc2VjA3NyBHZ0aWQD\\/SIG=123ajp144\\/EXP=1147592336\\/**http%3a\\/\\/www.webmineral.com\\/data\\/Vashegyite.shtml","ModificationDate":1146898800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBMh3dmMwF;_ylu=X3oDMTBxNzAwNWY0BGNvbG8DdwRwb3MDMzMEc2VjA3NyBHZ0aWQD\\/SIG=16ktl9ibf\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.webmineral.com\\/data\\/Vashegyite.shtml%26w=132%26d=W38GQkaqMvCt%26icp=1%26.intl=us","Size":"29234"}},{"Title":"2003 CFR Title 40, Volume 19","Summary":"... CHAPTER I--ENVIRONMENTAL PROTECTION AGENCY. PART 132--WATER QUALITY GUIDANCE FOR THE GREAT LAKES SYSTEM. 132.1. Scope, purpose, and availability of documents ...","Url":"http:\\/\\/www.access.gpo.gov\\/nara\\/cfr\\/waisidx_03\\/40cfr132_03.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBNB3dmMwF;_ylu=X3oDMTEwdHZ0ZXZxBGNvbG8DdwRsA1dTMQRwb3MDMzQEc2VjA3NyBHZ0aWQD\\/SIG=12imj9jh5\\/EXP=1147592336\\/**http%3a\\/\\/www.access.gpo.gov\\/nara\\/cfr\\/waisidx_03\\/40cfr132_03.html","ModificationDate":1123916400,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBOR3dmMwF;_ylu=X3oDMTBxcml1MjI5BGNvbG8DdwRwb3MDMzQEc2VjA3NyBHZ0aWQD\\/SIG=173ahs683\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.access.gpo.gov\\/nara\\/cfr\\/waisidx_03\\/40cfr132_03.html%26w=132%26d=c8h16UaqMjB2%26icp=1%26.intl=us","Size":"4704"}},{"Title":"Chapter HFS 132","Summary":"... 145. HFS 132.13. DEPARTMENT OF HEALTH AND FAMILY SERVICES ... Subchapter I \\u2014 General. HFS 132.11. Statutory authority. HFS 132.12 ...","Url":"http:\\/\\/www.legis.state.wi.us\\/rsb\\/code\\/hfs\\/hfs132.pdf","ClickUrl":"http:\\/\\/www.legis.state.wi.us\\/rsb\\/code\\/hfs\\/hfs132.pdf#search=\'\'","ModificationDate":1099033200,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBPh3dmMwF;_ylu=X3oDMTBxaXI5cmVpBGNvbG8DdwRwb3MDMzUEc2VjA3NyBHZ0aWQD\\/SIG=16p8cmh99\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.legis.state.wi.us\\/rsb\\/code\\/hfs\\/hfs132.pdf%26w=132%26d=CN-yI0aqMkhi%26icp=1%26.intl=us","Size":"283151"}},{"Title":"U.S. Senate: Legislation & Records Home > Votes > Roll Call Vote","Summary":"... Vote Number: 132. Vote Date: June 8, 2005, 05:30 PM ...","Url":"http:\\/\\/www.senate.gov\\/legislative\\/LIS\\/roll_call_lists\\/roll_call_vote_cfm.cfm?congress=109&session=1&vote=00132","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBQB3dmMwF;_ylu=X3oDMTEwdTlzNmU2BGNvbG8DdwRsA1dTMQRwb3MDMzYEc2VjA3NyBHZ0aWQD\\/SIG=148g3pmm4\\/EXP=1147592336\\/**http%3a\\/\\/www.senate.gov\\/legislative\\/LIS\\/roll_call_lists\\/roll_call_vote_cfm.cfm%3fcongress=109%26session=1%26vote=00132","ModificationDate":1143360000,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBRR3dmMwF;_ylu=X3oDMTBxOTlsaWYxBGNvbG8DdwRwb3MDMzYEc2VjA3NyBHZ0aWQD\\/SIG=19b3rasjc\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.senate.gov\\/legislative\\/LIS\\/roll_call_lists\\/roll_call_vote_cfm.cfm%253Fcongress%253D109%2526session%253D1%2526vote%253D00132%26w=132%26d=dtev60aqMh1g%26icp=1%26.intl=us","Size":"51433"}},{"Title":"Storm Prediction Center Tornado Watch 132","Summary":"Severe weather, tornado, thunderstorm, fire weather, storm report, tornado watch, severe thunderstorm watch, mesoscale discussion, convective outlook products from the Storm Prediction Center. ... SEL2 URGENT - IMMEDIATE BROADCAST REQUESTED TORNADO WATCH NUMBER 132 NWS STORM PREDICTION CENTER NORMAN OK 325 PM CDT ...","Url":"http:\\/\\/www.spc.noaa.gov\\/products\\/watch\\/ww0132.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBRx3dmMwF;_ylu=X3oDMTEwanQ3MzU2BGNvbG8DdwRsA1dTMQRwb3MDMzcEc2VjA3NyBHZ0aWQD\\/SIG=126urlun7\\/EXP=1147592336\\/**http%3a\\/\\/www.spc.noaa.gov\\/products\\/watch\\/ww0132.html","ModificationDate":1146812400,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBTB3dmMwF;_ylu=X3oDMTBxNDRkc3R1BGNvbG8DdwRwb3MDMzcEc2VjA3NyBHZ0aWQD\\/SIG=16n3e4s74\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.spc.noaa.gov\\/products\\/watch\\/ww0132.html%26w=132%26d=N4g-pUaqMusz%26icp=1%26.intl=us","Size":"19990"}},{"Title":"PLANT PHYSIOLOGY ONLINE -- Table of Contents (132 [2])","Summary":"To see an article, click its [Full Text] link. To review many abstracts, check the boxes to the left of the titles you want, and click the \'Get All Checked Abstract(s)\' button. To see one abstract at a time, click its [Abstract] link.","Url":"http:\\/\\/www.plantphysiol.org\\/content\\/vol132\\/issue2\\/index.shtml","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBTh3dmMwF;_ylu=X3oDMTEwa2NtaWpsBGNvbG8DdwRsA1dTMQRwb3MDMzgEc2VjA3NyBHZ0aWQD\\/SIG=12hg0jpkp\\/EXP=1147592336\\/**http%3a\\/\\/www.plantphysiol.org\\/content\\/vol132\\/issue2\\/index.shtml","ModificationDate":1141804800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBUx3dmMwF;_ylu=X3oDMTBxYnZvM21yBGNvbG8DdwRwb3MDMzgEc2VjA3NyBHZ0aWQD\\/SIG=172cps28k\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.plantphysiol.org\\/content\\/vol132\\/issue2\\/index.shtml%26w=132%26d=Yvs4KUaqMjZc%26icp=1%26.intl=us","Size":"79038"}},{"Title":"AgGPS 132","Summary":"... The AgGPS 132 outputs sub- meter accuracy DGPS positions ... lightbar is connected to the. AgGPS 132. The AgGPS 132. can output positions up to 10 ...","Url":"http:\\/\\/www.farmgis.com\\/products\\/hardware\\/gps\\/aggps132.pdf","ClickUrl":"http:\\/\\/www.farmgis.com\\/products\\/hardware\\/gps\\/aggps132.pdf#search=\'\'","ModificationDate":1098169200,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBWB3dmMwF;_ylu=X3oDMTBxcXNibWtvBGNvbG8DdwRwb3MDMzkEc2VjA3NyBHZ0aWQD\\/SIG=16us46bp9\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.farmgis.com\\/products\\/hardware\\/gps\\/aggps132.pdf%26w=132%26d=EvLM70aqMkiV%26icp=1%26.intl=us","Size":"162160"}},{"Title":"Chapter 132 \\u2014 Grand Jury, Indictments and Other Accusatory Instruments","Summary":"The text appearing in this database was produced from material provided by the Legislative Counsel Committee of the Oregon Legislative Assembly. The official record copy is the printed published copy of the Oregon Revised Statutes. ... 132.010 Composition. A grand jury is a body of seven persons drawn from the jurors in attendance ... 132.030 Challenge of juror prohibited; when juror may be excused. Neither ...","Url":"http:\\/\\/www.leg.state.or.us\\/ors\\/132.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBWh3dmMwF;_ylu=X3oDMTEwYTAzbTUxBGNvbG8DdwRsA1dTMQRwb3MDNDAEc2VjA3NyBHZ0aWQD\\/SIG=11r91jes0\\/EXP=1147592336\\/**http%3a\\/\\/www.leg.state.or.us\\/ors\\/132.html","ModificationDate":1144220400,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBXx3dmMwF;_ylu=X3oDMTBxdGU5a2FhBGNvbG8DdwRwb3MDNDAEc2VjA3NyBHZ0aWQD\\/SIG=16cbqvrlb\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.leg.state.or.us\\/ors\\/132.html%26w=132%26d=MFh3EUaqMk41%26icp=1%26.intl=us","Size":"73717"}},{"Title":"Downloaded 19 Aug 2002 to 132.163.136.56. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip... ","Summary":"Downloaded 19 Aug 2002 to 132.163.136.56. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip.org\\/japo\\/japcr.jsp. Downloaded 19 Aug 2002 to 132.163.136.56.","Url":"http:\\/\\/tf.nist.gov\\/general\\/pdf\\/550.pdf","ClickUrl":"http:\\/\\/tf.nist.gov\\/general\\/pdf\\/550.pdf#search=\'\'","ModificationDate":1029740400,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBZB3dmMwF;_ylu=X3oDMTBxcDdtZjJoBGNvbG8DdwRwb3MDNDEEc2VjA3NyBHZ0aWQD\\/SIG=16bgqks5e\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=tf.nist.gov\\/general\\/pdf\\/550.pdf%26w=132%26d=PNXPXkaqMkLS%26icp=1%26.intl=us","Size":"2485625"}},{"Title":"Father Tom Inspired Pflugerville #132 To Evolve Into A Strong Fraternal Society","Summary":"... Monsignor Tom Frank is presented with the 2002 Society #132. Service Award by President Ray Pokorney ... ach year Society #132. of Pflugerville honors ...","Url":"http:\\/\\/www.kjtnet.org\\/web\\/benefits\\/newsletter\\/march03.pdf","ClickUrl":"http:\\/\\/www.kjtnet.org\\/web\\/benefits\\/newsletter\\/march03.pdf#search=\'\'","ModificationDate":1105603200,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBaR3dmMwF;_ylu=X3oDMTBxMWU2b2h1BGNvbG8DdwRwb3MDNDIEc2VjA3NyBHZ0aWQD\\/SIG=16u12rqgg\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.kjtnet.org\\/web\\/benefits\\/newsletter\\/march03.pdf%26w=132%26d=fjH4hEaqMwZd%26icp=1%26.intl=us","Size":"2791412"}},{"Title":"Alsakharovite-Zn Mineral Data","Summary":"Alsakharovite-Zn Mineral Data. [Log In] [Current Auction] [Register to Bid] [FAQ] [About Us] Tired of Ebay rip-offs, scams, and dishonest people?","Url":"http:\\/\\/www.webmineral.com\\/data\\/Alsakharovite-Zn.shtml","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBax3dmMwF;_ylu=X3oDMTEwN2JwMzlhBGNvbG8DdwRsA1dTMQRwb3MDNDMEc2VjA3NyBHZ0aWQD\\/SIG=129j54b3c\\/EXP=1147592336\\/**http%3a\\/\\/www.webmineral.com\\/data\\/Alsakharovite-Zn.shtml","ModificationDate":1147158000,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBcB3dmMwF;_ylu=X3oDMTBxamhmc2lnBGNvbG8DdwRwb3MDNDMEc2VjA3NyBHZ0aWQD\\/SIG=16q6pnttb\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.webmineral.com\\/data\\/Alsakharovite-Zn.shtml%26w=132%26d=B_smj0aqMwJU%26icp=1%26.intl=us","Size":"38594"}},{"Title":"Psalm 132","Summary":"... Psalm 132. The Eternal Dwelling of God in Zion ...","Url":"http:\\/\\/www.hope.edu\\/academic\\/religion\\/bandstra\\/BIBLE\\/PSA\\/PSA132.HTM","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBch3dmMwF;_ylu=X3oDMTEwdXE2dm1tBGNvbG8DdwRsA1dTMQRwb3MDNDQEc2VjA3NyBHZ0aWQD\\/SIG=12n448u4t\\/EXP=1147592336\\/**http%3a\\/\\/www.hope.edu\\/academic\\/religion\\/bandstra\\/BIBLE\\/PSA\\/PSA132.HTM","ModificationDate":1114758000,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBdx3dmMwF;_ylu=X3oDMTBxMjBjZXRuBGNvbG8DdwRwb3MDNDQEc2VjA3NyBHZ0aWQD\\/SIG=17829d5da\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.hope.edu\\/academic\\/religion\\/bandstra\\/BIBLE\\/PSA\\/PSA132.HTM%26w=132%26d=Gs9Yt0aqMhg_%26icp=1%26.intl=us","Size":"5137"}},{"Title":"Bug 132 - Heartbeat requires all nodes to be pre-configured in ha.cf","Summary":"... Bugzilla Bug 132. Heartbeat requires all nodes to be pre-configured in ha.cf ... Bug#: 132. Platform: All DEC HP Macintosh PC SGI Sun Other ...","Url":"http:\\/\\/www.osdl.org\\/developer_bugzilla\\/show_bug.cgi?id=132","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBeR3dmMwF;_ylu=X3oDMTEwa3QxajIyBGNvbG8DdwRsA1dTMQRwb3MDNDUEc2VjA3NyBHZ0aWQD\\/SIG=12g1vvd06\\/EXP=1147592336\\/**http%3a\\/\\/www.osdl.org\\/developer_bugzilla\\/show_bug.cgi%3fid=132","ModificationDate":1146553200,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBfh3dmMwF;_ylu=X3oDMTBxbHY2NGw5BGNvbG8DdwRwb3MDNDUEc2VjA3NyBHZ0aWQD\\/SIG=177hj2go7\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.osdl.org\\/developer_bugzilla\\/show_bug.cgi%253Fid%253D132%26w=132%26d=Uzd0n0aqMtwg%26icp=1%26.intl=us","Size":"40101"}},{"Title":"Bug 132 - ChargeDispositionPlea and ChargeDispositionVerdict","Summary":"... Bugzilla Bug 132. ChargeDispositionPlea and ChargeDispositionVerdict ... Bug#: 132. Domain: AAMVA Corrections Courts Juvenile Law Enforcement Parole Probation Prosecution Other ...","Url":"http:\\/\\/justicexml.gtri.gatech.edu\\/feedback\\/show_bug.cgi?id=132","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBgB3dmMwF;_ylu=X3oDMTEwdmhtYjA4BGNvbG8DdwRsA1dTMQRwb3MDNDYEc2VjA3NyBHZ0aWQD\\/SIG=12klknku3\\/EXP=1147592336\\/**http%3a\\/\\/justicexml.gtri.gatech.edu\\/feedback\\/show_bug.cgi%3fid=132","ModificationDate":1143360000,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBhR3dmMwF;_ylu=X3oDMTBxa2g2bWNnBGNvbG8DdwRwb3MDNDYEc2VjA3NyBHZ0aWQD\\/SIG=17bcs6mrt\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=justicexml.gtri.gatech.edu\\/feedback\\/show_bug.cgi%253Fid%253D132%26w=132%26d=e0Zoy0aqMjBn%26icp=1%26.intl=us","Size":"16410"}},{"Title":"Publications","Summary":"... Bulletin 132, Management of the California State Water Project, is a series of annual reports that describe the ... annual Appendix E to Bulletin 132 and the final edition of the ...","Url":"http:\\/\\/www.swpao.water.ca.gov\\/publications","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBhx3dmMwF;_ylu=X3oDMTEwZjVhYXMzBGNvbG8DdwRsA1dTMQRwb3MDNDcEc2VjA3NyBHZ0aWQD\\/SIG=11ud1cv0a\\/EXP=1147592336\\/**http%3a\\/\\/www.swpao.water.ca.gov\\/publications","ModificationDate":1143187200,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBjB3dmMwF;_ylu=X3oDMTBxcjNocmY0BGNvbG8DdwRwb3MDNDcEc2VjA3NyBHZ0aWQD\\/SIG=16fvue890\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.swpao.water.ca.gov\\/publications%26w=132%26d=CDqKvkaqMhfi%26icp=1%26.intl=us","Size":"27835"}},{"Title":"Sampling at Head Crater and Bench Crater","Summary":"... 132:10:41 Bean: Boy, this Hand Tool Carrier is light and nice compared to carrying it around ... 132:11:20 Bean: I can see everything from fine-grain basalt ...","Url":"http:\\/\\/www.hq.nasa.gov\\/alsj\\/a12\\/a12.head_bench.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBjh3dmMwF;_ylu=X3oDMTEwYjFmcHI4BGNvbG8DdwRsA1dTMQRwb3MDNDgEc2VjA3NyBHZ0aWQD\\/SIG=127h6jrgp\\/EXP=1147592336\\/**http%3a\\/\\/www.hq.nasa.gov\\/alsj\\/a12\\/a12.head_bench.html","ModificationDate":1139731200,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBkx3dmMwF;_ylu=X3oDMTBxazBuMTN2BGNvbG8DdwRwb3MDNDgEc2VjA3NyBHZ0aWQD\\/SIG=16of05gsq\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.hq.nasa.gov\\/alsj\\/a12\\/a12.head_bench.html%26w=132%26d=O2JTbEaqMul1%26icp=1%26.intl=us","Size":"91895"}},{"Title":"Psalms 132","Summary":"Psalms 132. 132:1 A Song of degrees.","Url":"http:\\/\\/www.masterstech-home.com\\/The_Library\\/The_Bible\\/Bible_Chapters\\/Psalms\\/132.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBlR3dmMwF;_ylu=X3oDMTEwOG85MWM5BGNvbG8DdwRsA1dTMQRwb3MDNDkEc2VjA3NyBHZ0aWQD\\/SIG=1381oeor0\\/EXP=1147592336\\/**http%3a\\/\\/www.masterstech-home.com\\/The_Library\\/The_Bible\\/Bible_Chapters\\/Psalms\\/132.html","ModificationDate":1135152000,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBmh3dmMwF;_ylu=X3oDMTBxNWpuM3FoBGNvbG8DdwRwb3MDNDkEc2VjA3NyBHZ0aWQD\\/SIG=17p7bjs0u\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.masterstech-home.com\\/The_Library\\/The_Bible\\/Bible_Chapters\\/Psalms\\/132.html%26w=132%26d=TUYYg0aqMhg4%26icp=1%26.intl=us","Size":"11669"}},{"Title":"California Highways (www.cahighways.org): Routes 129 through 136","Summary":"... The 2005 Transportation Bill included $14.4 million to widen Route 132 from Route 99 west to Dakota Avenue ... between Coulterville and Mariposa was cosigned as Route 49 and Route 132 ...","Url":"http:\\/\\/www.cahighways.org\\/129-136.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBnB3dmMwF;_ylu=X3oDMTEwaXBqZ2lxBGNvbG8DdwRsA1dTMQRwb3MDNTAEc2VjA3NyBHZ0aWQD\\/SIG=11q1ne7f6\\/EXP=1147592336\\/**http%3a\\/\\/www.cahighways.org\\/129-136.html","ModificationDate":1145689200,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBoR3dmMwF;_ylu=X3oDMTBxbmZjMXVuBGNvbG8DdwRwb3MDNTAEc2VjA3NyBHZ0aWQD\\/SIG=16bhah065\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.cahighways.org\\/129-136.html%26w=132%26d=fRBtE0aqMqve%26icp=1%26.intl=us","Size":"49110"}},{"Title":"Downloaded 11 Nov 2002 to 132.64.1.37. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip.org\\/... ","Summary":"Downloaded 11 Nov 2002 to 132.64.1.37. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip.org\\/rsio\\/rsicr.jsp. Downloaded 11 Nov 2002 to 132.64.1.37.","Url":"http:\\/\\/chem.ch.huji.ac.il\\/~porath\\/NST2\\/Lecture%205\\/Kuk%20and%20Silverman%20Rev_Sci_Inst_60_165_1989.pdf","ClickUrl":"http:\\/\\/chem.ch.huji.ac.il\\/~porath\\/NST2\\/Lecture%205\\/Kuk%20and%20Silverman%20Rev_Sci_Inst_60_165_1989.pdf#search=\'\'","ModificationDate":1069660800,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBph3dmMwF;_ylu=X3oDMTBxZHJldXUyBGNvbG8DdwRwb3MDNTEEc2VjA3NyBHZ0aWQD\\/SIG=190pnnu1n\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=chem.ch.huji.ac.il\\/%257Eporath\\/NST2\\/Lecture%2525205\\/Kuk%252520and%252520Silverman%252520Rev_Sci_Inst_60_165_1989.pdf%26w=132%26d=F4c-T0aqMhfn%26icp=1%26.intl=us","Size":"3386219"}},{"Title":"Phelps Personnel Associates","Summary":"Welcome to Phelps Personnel Associates. Recruiting and Placing Engineers and Management Professionals since 1976. Concentration in the Carolinas and Southeastern job market. Permanent, Company fee-paid positions only. Confidential, courteous service","Url":"http:\\/\\/www.phelpspersonnel.com\\/","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBqB3dmMwF;_ylu=X3oDMTEwazlldjdwBGNvbG8DdwRsA1dTMQRwb3MDNTIEc2VjA3NyBHZ0aWQD\\/SIG=11j85rkug\\/EXP=1147592336\\/**http%3a\\/\\/www.phelpspersonnel.com\\/","ModificationDate":1060239600,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBrR3dmMwF;_ylu=X3oDMTBxZWJqMW1lBGNvbG8DdwRwb3MDNTIEc2VjA3NyBHZ0aWQD\\/SIG=164jn86me\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.phelpspersonnel.com\\/%26w=132%26d=KRPdjUaqMwQa%26icp=1%26.intl=us","Size":"6288"}},{"Title":"132 - Loss and resumption of Australian citizenship - Declaration of desre to resume Australian citizenship under ... ","Summary":"... retain another citizenship \\u0096 be under the age of 25 years. 132 (Design date 0705) - Page 1 ... 23A, 23AA, 23AB or 23B. 132 (Design date 0705) - Page 2 ...","Url":"http:\\/\\/www.immi.gov.au\\/allforms\\/pdf\\/132.pdf","ClickUrl":"http:\\/\\/www.immi.gov.au\\/allforms\\/pdf\\/132.pdf#search=\'\'","ModificationDate":1141113600,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBsh3dmMwF;_ylu=X3oDMTBxYzdmNTNvBGNvbG8DdwRwb3MDNTMEc2VjA3NyBHZ0aWQD\\/SIG=16gtd8vkd\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.immi.gov.au\\/allforms\\/pdf\\/132.pdf%26w=132%26d=XLvxbUaqMvqk%26icp=1%26.intl=us","Size":"118238"}},{"Title":"Communication Workersof America Local 3808","Summary":"News Highlights and Headlines. Nominations for one (1) 402 Franklin Road Area Representative will be taken at the June 6, 2006 Membership Meeting. BellSouth CONTRACT INFO. Frequently asked Q&A","Url":"http:\\/\\/cwa3808.org\\/","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBtB3dmMwF;_ylu=X3oDMTEwMGJ0MmQ1BGNvbG8DdwRsA1dTMQRwb3MDNTQEc2VjA3NyBHZ0aWQD\\/SIG=117pqud0l\\/EXP=1147592336\\/**http%3a\\/\\/cwa3808.org\\/","ModificationDate":1147071600,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBuR3dmMwF;_ylu=X3oDMTBxY3NiaDkyBGNvbG8DdwRwb3MDNTQEc2VjA3NyBHZ0aWQD\\/SIG=15od3j3p8\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=cwa3808.org\\/%26w=132%26d=ahqtKEaqMwC6%26icp=1%26.intl=us","Size":"53103"}},{"Title":"Mirabilis ICQ 98a Vulnerability","Summary":"... Bugtraq ID: 132. Class: Failure to Handle Exceptional Conditions ...","Url":"http:\\/\\/www.securityfocus.com\\/bid\\/132","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBux3dmMwF;_ylu=X3oDMTEwNXIwZzI2BGNvbG8DdwRsA1dTMQRwb3MDNTUEc2VjA3NyBHZ0aWQD\\/SIG=11ocj9p23\\/EXP=1147592336\\/**http%3a\\/\\/www.securityfocus.com\\/bid\\/132","ModificationDate":1146034800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBwB3dmMwF;_ylu=X3oDMTBxbnNnYWFhBGNvbG8DdwRwb3MDNTUEc2VjA3NyBHZ0aWQD\\/SIG=169dn3s31\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.securityfocus.com\\/bid\\/132%26w=132%26d=bbuQiUaqMsU1%26icp=1%26.intl=us","Size":"11819"}},{"Title":"Downloaded 23 Dec 2001 to 132.76.33.15. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip.org\\/... ","Summary":"Downloaded 23 Dec 2001 to 132.76.33.15. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip.org\\/jcpo\\/jcpcr.jsp. Downloaded 23 Dec 2001 to 132.76.33.15.","Url":"http:\\/\\/theochem.weizmann.ac.il\\/AIPreprints\\/8.pdf","ClickUrl":"http:\\/\\/theochem.weizmann.ac.il\\/AIPreprints\\/8.pdf#search=\'\'","ModificationDate":1092294000,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBxR3dmMwF;_ylu=X3oDMTBxcjhpcTNrBGNvbG8DdwRwb3MDNTYEc2VjA3NyBHZ0aWQD\\/SIG=16l1r1fiu\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=theochem.weizmann.ac.il\\/AIPreprints\\/8.pdf%26w=132%26d=VrF160aqMjIt%26icp=1%26.intl=us","Size":"1754089"}},{"Title":"Chapter RL 132","Summary":"DEPARTMENT OF REGULATION AND LICENSING. Unofficial Text (See Printed Volume). Current through date and Register shown on Title Page. Register, July, 1999, No. 523. Chapter RL 132. APPLICATIONS. RL 132.01. Authority. RL 132.02 ... Note: Chapter RL 132 was created as an emergency rule effective 11\\u20131\\u201398 ...","Url":"http:\\/\\/www.legis.state.wi.us\\/rsb\\/code\\/rl\\/rl132.pdf","ClickUrl":"http:\\/\\/www.legis.state.wi.us\\/rsb\\/code\\/rl\\/rl132.pdf#search=\'\'","ModificationDate":1011859200,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcByh3dmMwF;_ylu=X3oDMTBxZjI4aHZhBGNvbG8DdwRwb3MDNTcEc2VjA3NyBHZ0aWQD\\/SIG=16nps3tc2\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.legis.state.wi.us\\/rsb\\/code\\/rl\\/rl132.pdf%26w=132%26d=VTECeUaqMi-4%26icp=1%26.intl=us","Size":"8138"}},{"Title":"Rebuffing Bush, 132 Mayors Embrace Kyoto Rules - New York Times","Summary":"Greg Nickels of Seattle and 131 other like-minded mayors have joined a bipartisan coalition to fight global warming on the local level.","Url":"http:\\/\\/www.nytimes.com\\/2005\\/05\\/14\\/national\\/14kyoto.html?ex=1273723200&en=c02e1cce1ca43706&ei=5088","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBzB3dmMwF;_ylu=X3oDMTEwbm43bzM3BGNvbG8DdwRsA1dTMQRwb3MDNTgEc2VjA3NyBHZ0aWQD\\/SIG=13repbe72\\/EXP=1147592336\\/**http%3a\\/\\/www.nytimes.com\\/2005\\/05\\/14\\/national\\/14kyoto.html%3fex=1273723200%26en=c02e1cce1ca43706%26ei=5088","ModificationDate":1147330800,"MimeType":"text\\/html"},{"Title":"DHS-Revised Rule 132","Summary":"Easy access to Illinois services and information ... an e-mail address to pose questions regarding Rule 132. Please review the Rule 132 Q&A document posted on ...","Url":"http:\\/\\/www.dhs.state.il.us\\/revisedRule132","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB0h3dmMwF;_ylu=X3oDMTEwMjl1dW84BGNvbG8DdwRsA1dTMQRwb3MDNTkEc2VjA3NyBHZ0aWQD\\/SIG=11tb4gcma\\/EXP=1147592336\\/**http%3a\\/\\/www.dhs.state.il.us\\/revisedRule132","ModificationDate":1147244400,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB1x3dmMwF;_ylu=X3oDMTBxOWMyazRxBGNvbG8DdwRwb3MDNTkEc2VjA3NyBHZ0aWQD\\/SIG=16e8khp3d\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.dhs.state.il.us\\/revisedRule132%26w=132%26d=Oc4YikaqMwgM%26icp=1%26.intl=us","Size":"22903"}},{"Title":"211 CMR: DIVISION OF INSURANCE 6\\/27\\/97 211 CMR - 837 211 CMR 132.00: ACTUARIAL OPINION AND MEMORANDUM REGULATION ... ","Summary":"... 132.01: Purpose. 132.02: Authority. 132.03: Scope. 132.04: Definitions. 132.05: General Requirements. 132.06: Required Opinions. 132 ... Adequacy Analysis. 132.08: Statement of Actuarial ...","Url":"http:\\/\\/www.mass.gov\\/doi\\/Legal_Hearings\\/211_132.PDF","ClickUrl":"http:\\/\\/www.mass.gov\\/doi\\/Legal_Hearings\\/211_132.PDF#search=\'\'","ModificationDate":1003906800,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB3B3dmMwF;_ylu=X3oDMTBxdG9ldThsBGNvbG8DdwRwb3MDNjAEc2VjA3NyBHZ0aWQD\\/SIG=16no3ibvg\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.mass.gov\\/doi\\/Legal_Hearings\\/211_132.PDF%26w=132%26d=C4QXPkaqMjRM%26icp=1%26.intl=us","Size":"45945"}},{"Title":"Downloaded 22 Jul 2003 to 132.66.16.23. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip.org\\/... ","Summary":"Downloaded 22 Jul 2003 to 132.66.16.23. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip.org\\/jcpo\\/jcpcr.jsp. Downloaded 22 Jul 2003 to 132.66.16.23.","Url":"http:\\/\\/star.tau.ac.il\\/~andelman\\/reprints\\/021_JCP_1987_87_7229.pdf","ClickUrl":"http:\\/\\/star.tau.ac.il\\/~andelman\\/reprints\\/021_JCP_1987_87_7229.pdf#search=\'\'","ModificationDate":1058857200,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB4R3dmMwF;_ylu=X3oDMTBxZzZxbDZiBGNvbG8DdwRwb3MDNjEEc2VjA3NyBHZ0aWQD\\/SIG=17adesqgt\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=star.tau.ac.il\\/%257Eandelman\\/reprints\\/021_JCP_1987_87_7229.pdf%26w=132%26d=Lvkyh0aqMh8L%26icp=1%26.intl=us","Size":"1798906"}},{"Title":"Special Troops Battalion, 4th Brigade, 10th Mountain Division Insignia","Summary":"The Institute of Heraldry\'s Special Troops Battalion Section, Special Troops Battalion, 4th Brigade, 10th Mountain Division Insignia Page","Url":"http:\\/\\/www.tioh.hqda.pentagon.mil\\/STB\\/STB4Brigade10MountainDivision.htm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB4x3dmMwF;_ylu=X3oDMTEwZjFqOHFiBGNvbG8DdwRsA1dTMQRwb3MDNjIEc2VjA3NyBHZ0aWQD\\/SIG=12rjb6bu4\\/EXP=1147592336\\/**http%3a\\/\\/www.tioh.hqda.pentagon.mil\\/STB\\/STB4Brigade10MountainDivision.htm","ModificationDate":1109923200,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB6B3dmMwF;_ylu=X3oDMTBxZzN1cnRoBGNvbG8DdwRwb3MDNjIEc2VjA3NyBHZ0aWQD\\/SIG=17c61sq2b\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.tioh.hqda.pentagon.mil\\/STB\\/STB4Brigade10MountainDivision.htm%26w=132%26d=CjDx1kaqMwEn%26icp=1%26.intl=us","Size":"8896"}},{"Title":"NNSA\'s Brooks lauds partnership in nonproliferation","Summary":"... ite Way. U133. 132. A-4. 135. 134. 132. Fun With Science ...","Url":"http:\\/\\/www.llnl.gov\\/llnl\\/06news\\/employee\\/articles\\/2001\\/12.21.01newsline.pdf","ClickUrl":"http:\\/\\/www.llnl.gov\\/llnl\\/06news\\/employee\\/articles\\/2001\\/12.21.01newsline.pdf#search=\'\'","ModificationDate":1099555200,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB7R3dmMwF;_ylu=X3oDMTBxZ25nbWN0BGNvbG8DdwRwb3MDNjMEc2VjA3NyBHZ0aWQD\\/SIG=17go91rgp\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.llnl.gov\\/llnl\\/06news\\/employee\\/articles\\/2001\\/12.21.01newsline.pdf%26w=132%26d=aLdSWEaqMjYB%26icp=1%26.intl=us","Size":"472758"}},{"Title":"Psalms 132. The Holy Bible: King James Version.","Summary":"... Reference > The Bible > The King James Version > Psalms > 132 ... The Psalms. 132. A Prayer for Blessing on the Sanctuary ...","Url":"http:\\/\\/www.bartleby.com\\/108\\/19\\/132.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB7x3dmMwF;_ylu=X3oDMTEwdm1iOTMzBGNvbG8DdwRsA1dTMQRwb3MDNjQEc2VjA3NyBHZ0aWQD\\/SIG=11rfct28r\\/EXP=1147592336\\/**http%3a\\/\\/www.bartleby.com\\/108\\/19\\/132.html","ModificationDate":1134460800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB9B3dmMwF;_ylu=X3oDMTBxa3RqY29tBGNvbG8DdwRwb3MDNjQEc2VjA3NyBHZ0aWQD\\/SIG=16ckhlf21\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.bartleby.com\\/108\\/19\\/132.html%26w=132%26d=Om0HPEaqMjyM%26icp=1%26.intl=us","Size":"26896"}},{"Title":"The Criterion Collection: Ruling Class, The","Summary":"Title Person. Film Info. 1972. 154 minutes. Color. 1.77:1. Dolby Digital Mono 1.0. Anamorphic. English. Release Info. Catalog Number: CC1575D. ISBN: 1-55940-922-3. UPC: 7-15515-0124-2-3. SRP: $39.95. Synopsis","Url":"http:\\/\\/www.criterionco.com\\/asp\\/release.asp?id=132","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB9h3dmMwF;_ylu=X3oDMTEwcTRya2ltBGNvbG8DdwRsA1dTMQRwb3MDNjUEc2VjA3NyBHZ0aWQD\\/SIG=1272o9dh7\\/EXP=1147592336\\/**http%3a\\/\\/www.criterionco.com\\/asp\\/release.asp%3fid=132","ModificationDate":1147244400,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB.x3dmMwF;_ylu=X3oDMTBxdDMwMGJvBGNvbG8DdwRwb3MDNjUEc2VjA3NyBHZ0aWQD\\/SIG=16u4fa0dg\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.criterionco.com\\/asp\\/release.asp%253Fid%253D132%26w=132%26d=L2PGVEaqMwN7%26icp=1%26.intl=us","Size":"16920"}},{"Title":"AJP Legacy -- Table of Contents (February 28 1941, 132 [2])","Summary":"Contents: February 28 1941, Volume 132, Issue 2 [Index by Author] Other Issues: To see an article, click its [Full Text] link.","Url":"http:\\/\\/ajplegacy.physiology.org\\/content\\/vol132\\/issue2\\/index.shtml","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB_R3dmMwF;_ylu=X3oDMTEwZWhkczJpBGNvbG8DdwRsA1dTMQRwb3MDNjYEc2VjA3NyBHZ0aWQD\\/SIG=12lf1ce7j\\/EXP=1147592336\\/**http%3a\\/\\/ajplegacy.physiology.org\\/content\\/vol132\\/issue2\\/index.shtml","ModificationDate":1141459200,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBAh7dmMwF;_ylu=X3oDMTBxNzI0azAwBGNvbG8DdwRwb3MDNjYEc2VjA3NyBHZ0aWQD\\/SIG=176uub081\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=ajplegacy.physiology.org\\/content\\/vol132\\/issue2\\/index.shtml%26w=132%26d=Ms_vOEaqMj-H%26icp=1%26.intl=us","Size":"24095"}},{"Title":"released a letter (PDF)","Summary":"","Url":"http:\\/\\/www.house.gov\\/judiciary_democrats\\/letters\\/rovehrgrequestltr71405.pdf","ClickUrl":"http:\\/\\/www.house.gov\\/judiciary_democrats\\/letters\\/rovehrgrequestltr71405.pdf#search=\'\'","ModificationDate":1121410800,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBBx7dmMwF;_ylu=X3oDMTBxOXQ3MWF0BGNvbG8DdwRwb3MDNjcEc2VjA3NyBHZ0aWQD\\/SIG=17g69a880\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.house.gov\\/judiciary_democrats\\/letters\\/rovehrgrequestltr71405.pdf%26w=132%26d=LPrB50aqMqRY%26icp=1%26.intl=us","Size":"381000"}},{"Title":"NC General Statutes Chapter 132","Summary":"North Carolina. State Public Records Law. North Carolina General Statutes. Chapter 132. Public Records. Last updated December 10th, 1999. Contents. Section Title. 132-1. \\"Public records\\" defined. 132-1.1. ... Section Title. 132-1. \\"Public records\\" defined. 132-1.1. Confidential communications by legal counsel to public board or agency; State tax ...","Url":"http:\\/\\/www.ah.dcr.state.nc.us\\/e-records\\/ncgs\\/ncgs132.htm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBCR7dmMwF;_ylu=X3oDMTEwMjJmbW84BGNvbG8DdwRsA1dTMQRwb3MDNjgEc2VjA3NyBHZ0aWQD\\/SIG=12ctoo16c\\/EXP=1147592336\\/**http%3a\\/\\/www.ah.dcr.state.nc.us\\/e-records\\/ncgs\\/ncgs132.htm","ModificationDate":953625600,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBDh7dmMwF;_ylu=X3oDMTBxYjJtcGphBGNvbG8DdwRwb3MDNjgEc2VjA3NyBHZ0aWQD\\/SIG=16t5vbni8\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.ah.dcr.state.nc.us\\/e-records\\/ncgs\\/ncgs132.htm%26w=132%26d=MyfGH0aqMwR0%26icp=1%26.intl=us","Size":"43695"}},{"Title":"Technical Introduction to CDMA","Summary":"Course 132. Technical. Introduction to CDMA. Technical. Introduction to CDMA. IS-95, CDMA2000 and a glimpse of 1xEV. February, 2005. 132 - 1. Technical Introduction to CDMA v4.0 (c) 2005 Scott Baxter. Course Outline. Basic CDMA Principles. Coding","Url":"http:\\/\\/www.howcdmaworks.com\\/intro\\/132v3.pdf","ClickUrl":"http:\\/\\/www.howcdmaworks.com\\/intro\\/132v3.pdf#search=\'\'","ModificationDate":1107590400,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBEx7dmMwF;_ylu=X3oDMTBxbTJnbmxhBGNvbG8DdwRwb3MDNjkEc2VjA3NyBHZ0aWQD\\/SIG=16ghr9cvr\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.howcdmaworks.com\\/intro\\/132v3.pdf%26w=132%26d=B6dAbEaqMu7t%26icp=1%26.intl=us","Size":"4342039"}},{"Title":"Thread Images Digitizing","Summary":"Free embroidery design. Specializes in providing custom quality embroidery designs to the professional embroiderer.","Url":"http:\\/\\/www.threadimages.com\\/","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBFR7dmMwF;_ylu=X3oDMTEwMmI2cWQzBGNvbG8DdwRsA1dTMQRwb3MDNzAEc2VjA3NyBHZ0aWQD\\/SIG=11gsp7523\\/EXP=1147592336\\/**http%3a\\/\\/www.threadimages.com\\/","ModificationDate":1147158000,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBGx7dmMwF;_ylu=X3oDMTBxaml0dDF0BGNvbG8DdwRwb3MDNzAEc2VjA3NyBHZ0aWQD\\/SIG=161ukrsfh\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.threadimages.com\\/%26w=132%26d=BmPG10aqMwgW%26icp=1%26.intl=us","Size":"55861"}},{"Title":"Psalms Chapter 132:1-18.","Summary":"Read the Hebrew Transliteration Psalms 132:1-18 Online.","Url":"http:\\/\\/bibledbdata.org\\/onlinebibles\\/hebrew_translit\\/19_132.htm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBHR7dmMwF;_ylu=X3oDMTEwdXJnMnJuBGNvbG8DdwRsA1dTMQRwb3MDNzEEc2VjA3NyBHZ0aWQD\\/SIG=12i1mped7\\/EXP=1147592336\\/**http%3a\\/\\/bibledbdata.org\\/onlinebibles\\/hebrew_translit\\/19_132.htm","ModificationDate":1044172800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBIh7dmMwF;_ylu=X3oDMTBxNmJocG1iBGNvbG8DdwRwb3MDNzEEc2VjA3NyBHZ0aWQD\\/SIG=173o8ajtj\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=bibledbdata.org\\/onlinebibles\\/hebrew_translit\\/19_132.htm%26w=132%26d=dfiAJkaqMi1u%26icp=1%26.intl=us","Size":"9706"}},{"Title":"PRC-132","Summary":"K6ERO Portable and pedestrian mobile amateur radio. PRC-132 & M50B. To the left is a Loral Terracom M50B. made in 1988 Serial#19 . Its 10 inches tall. with out battery box or external power. box , 3.5 inches wide and 5.25 inches. deep, weight 6.9 lbs . ... The M50B is the early issue version of the. PRC-132 special operations HF Radio ...","Url":"http:\\/\\/www.muttmotorpool.com\\/PRC-132","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBJB7dmMwF;_ylu=X3oDMTEwYm80YTY1BGNvbG8DdwRsA1dTMQRwb3MDNzIEc2VjA3NyBHZ0aWQD\\/SIG=11ou3h7bi\\/EXP=1147592336\\/**http%3a\\/\\/www.muttmotorpool.com\\/PRC-132","ModificationDate":1146294000,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBKR7dmMwF;_ylu=X3oDMTBxaDgzYWcxBGNvbG8DdwRwb3MDNzIEc2VjA3NyBHZ0aWQD\\/SIG=169r7ofhd\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.muttmotorpool.com\\/PRC-132%26w=132%26d=Utj0H0aqMs48%26icp=1%26.intl=us","Size":"19723"}},{"Title":"Firenze 132 \\/ 170","Summary":"Firenze 132 \\/ 170. Matte Presentation Paper. 132 gram 2-side coated. 170 gram single side coated. Magicl\\u00e9e\\u00ae Firenze 132 and Firenze 170 matte. papers are designed for poster applications and. have an impressive price performance ratio. The ... If using the 132 gram. paper for 2-sided imaging ink limit on ...","Url":"http:\\/\\/www.magicinkjet.com\\/client_data_pdf\\/guides\\/Firenze.pdf","ClickUrl":"http:\\/\\/www.magicinkjet.com\\/client_data_pdf\\/guides\\/Firenze.pdf#search=\'\'","ModificationDate":1081839600,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBLh7dmMwF;_ylu=X3oDMTBxbXY4b2luBGNvbG8DdwRwb3MDNzMEc2VjA3NyBHZ0aWQD\\/SIG=172sdum75\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.magicinkjet.com\\/client_data_pdf\\/guides\\/Firenze.pdf%26w=132%26d=Q4ILzEaqMh1n%26icp=1%26.intl=us","Size":"2152647"}},{"Title":"Museletter # 132 \\/ February 2003: The US and Eurasia: End Game for the Industrial Era?","Summary":"Defining democracy in the wake of the 2002 elections in the U.S.A..","Url":"http:\\/\\/www.museletter.com\\/archive\\/132.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBMB7dmMwF;_ylu=X3oDMTEwNGRiZ3FjBGNvbG8DdwRsA1dTMQRwb3MDNzQEc2VjA3NyBHZ0aWQD\\/SIG=11upr7v32\\/EXP=1147592336\\/**http%3a\\/\\/www.museletter.com\\/archive\\/132.html","ModificationDate":1108540800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBNR7dmMwF;_ylu=X3oDMTBxZTNpbG1nBGNvbG8DdwRwb3MDNzQEc2VjA3NyBHZ0aWQD\\/SIG=16fg9g4no\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.museletter.com\\/archive\\/132.html%26w=132%26d=SS0AQEaqMvuR%26icp=1%26.intl=us","Size":"47428"}},{"Title":"Downloaded 25 Oct 2002 to 132.66.16.12. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip.org\\/... ","Summary":"Downloaded 25 Oct 2002 to 132.66.16.12. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip.org\\/jcpo\\/jcpcr.jsp. Downloaded 25 Oct 2002 to 132.66.16.12.","Url":"http:\\/\\/star.tau.ac.il\\/~andelman\\/reprints\\/018_JCP_1987_86_3673.pdf","ClickUrl":"http:\\/\\/star.tau.ac.il\\/~andelman\\/reprints\\/018_JCP_1987_86_3673.pdf#search=\'\'","ModificationDate":1035529200,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBOh7dmMwF;_ylu=X3oDMTBxbGZmanU1BGNvbG8DdwRwb3MDNzUEc2VjA3NyBHZ0aWQD\\/SIG=17a4s312u\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=star.tau.ac.il\\/%257Eandelman\\/reprints\\/018_JCP_1987_86_3673.pdf%26w=132%26d=YANT3kaqMhfd%26icp=1%26.intl=us","Size":"1204421"}},{"Title":"Hepatitis B Virus: A Comprehensive Strategy for Eliminating Transmission in the United States Through Universal ... ","Summary":"Hepatitis B Virus: A Comprehensive Strategy for Eliminating Transmission in the United States Through Universal Childhood Vaccination: Recommendations of the Immunization Practices Advisory Committee (ACIP)","Url":"http:\\/\\/www.cdc.gov\\/mmwr\\/preview\\/mmwrhtml\\/00033405.htm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBPB7dmMwF;_ylu=X3oDMTEwb2NlbHRuBGNvbG8DdwRsA1dTMQRwb3MDNzYEc2VjA3NyBHZ0aWQD\\/SIG=129kdm2n4\\/EXP=1147592336\\/**http%3a\\/\\/www.cdc.gov\\/mmwr\\/preview\\/mmwrhtml\\/00033405.htm","ModificationDate":1139990400,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBQR7dmMwF;_ylu=X3oDMTBxZm44bG9sBGNvbG8DdwRwb3MDNzYEc2VjA3NyBHZ0aWQD\\/SIG=16qv48dkp\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.cdc.gov\\/mmwr\\/preview\\/mmwrhtml\\/00033405.htm%26w=132%26d=b-Kz6UaqMwIM%26icp=1%26.intl=us","Size":"87232"}},{"Title":"Tour de France 2005","Summary":"... QUICK STEP - INNERGETIC. 132 - CRETSKENS Wilfried (BEL) Born in 10\\/07\\/1976 \\u00e0 Herk-de-Stad (BEL ...","Url":"http:\\/\\/www.letour.fr\\/2005\\/TDF\\/RIDERS\\/us\\/coureurs\\/132.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBQx7dmMwF;_ylu=X3oDMTEwYjdwazg2BGNvbG8DdwRsA1dTMQRwb3MDNzcEc2VjA3NyBHZ0aWQD\\/SIG=12dpjmcf6\\/EXP=1147592336\\/**http%3a\\/\\/www.letour.fr\\/2005\\/TDF\\/RIDERS\\/us\\/coureurs\\/132.html","ModificationDate":1121583600,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBSB7dmMwF;_ylu=X3oDMTBxa21laGFvBGNvbG8DdwRwb3MDNzcEc2VjA3NyBHZ0aWQD\\/SIG=16u0nn96f\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.letour.fr\\/2005\\/TDF\\/RIDERS\\/us\\/coureurs\\/132.html%26w=132%26d=BTTUC0aqMv4Z%26icp=1%26.intl=us","Size":"12171"}},{"Title":"This American Life | Father\'s Day \'99","Summary":"... 6\\/18\\/99. Episode 132. For Father\'s Day, stories about fathers going out of their way to protect their kids, and kids going ...","Url":"http:\\/\\/www.thisamericanlife.org\\/pages\\/descriptions\\/99\\/132.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBSh7dmMwF;_ylu=X3oDMTEwNDFvam42BGNvbG8DdwRsA1dTMQRwb3MDNzgEc2VjA3NyBHZ0aWQD\\/SIG=12iobnkgv\\/EXP=1147592336\\/**http%3a\\/\\/www.thisamericanlife.org\\/pages\\/descriptions\\/99\\/132.html","ModificationDate":1146466800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBTx7dmMwF;_ylu=X3oDMTBxZzFuNDV2BGNvbG8DdwRwb3MDNzgEc2VjA3NyBHZ0aWQD\\/SIG=1738d5fam\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.thisamericanlife.org\\/pages\\/descriptions\\/99\\/132.html%26w=132%26d=Ss_yvkaqMvWK%26icp=1%26.intl=us","Size":"8411"}},{"Title":"Downloaded 21 Jan 2004 to 132.66.16.34. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip.org\\/... ","Summary":"Downloaded 21 Jan 2004 to 132.66.16.34. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip.org\\/jcpo\\/jcpcr.jsp. Downloaded 21 Jan 2004 to 132.66.16.34.","Url":"http:\\/\\/femto.tau.ac.il\\/~nitzan\\/3.pdf","ClickUrl":"http:\\/\\/femto.tau.ac.il\\/~nitzan\\/3.pdf#search=\'\'","ModificationDate":1088665200,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBVB7dmMwF;_ylu=X3oDMTBxdXJmcnJsBGNvbG8DdwRwb3MDNzkEc2VjA3NyBHZ0aWQD\\/SIG=16da99c2u\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=femto.tau.ac.il\\/%257Enitzan\\/3.pdf%26w=132%26d=b5Br7UaqMjB1%26icp=1%26.intl=us","Size":"1071954"}},{"Title":"CHAPTER 12 ENVIRONMENTAL REVIEW \\u2013 EAST 132","Summary":"Solid Waste Management Plan. 12-1. October2004. DEIS. CHAPTER 12. ENVIRONMENTAL REVIEW \\u2013 EAST 132. ND. STREET SITE. 12.1 Introduction. The East 132. nd. Street Site is currently permitted to handle 2,999 tpd of putrescible waste, with a","Url":"http:\\/\\/www.nyc.gov\\/html\\/dsny\\/downloads\\/pdf\\/pubnrpts\\/swmp-4oct\\/deis\\/chapter12.pdf","ClickUrl":"http:\\/\\/www.nyc.gov\\/html\\/dsny\\/downloads\\/pdf\\/pubnrpts\\/swmp-4oct\\/deis\\/chapter12.pdf#search=\'\'","ModificationDate":1099555200,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBWR7dmMwF;_ylu=X3oDMTBxaHNlODZrBGNvbG8DdwRwb3MDODAEc2VjA3NyBHZ0aWQD\\/SIG=17llu5bkp\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.nyc.gov\\/html\\/dsny\\/downloads\\/pdf\\/pubnrpts\\/swmp-4oct\\/deis\\/chapter12.pdf%26w=132%26d=RPmqz0aqMiKh%26icp=1%26.intl=us","Size":"1417879"}},{"Title":"Psalms 132 \\/ Hebrew - English Bible \\/ Mechon-Mamre","Summary":"... 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 ... Psalms Chapter 132. \\u00e0 \\u00f9\\u00d1\\u00c4\\u00e9\\u00f8, \\u00e4\\u00c7\\u00ee\\u00cc\\u00c7\\u00f2\\u00c2\\u00ec\\u00e5\\u00c9\\u00fa ...","Url":"http:\\/\\/www.mechon-mamre.org\\/p\\/pt\\/pt26d2.htm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBWx7dmMwF;_ylu=X3oDMTEwc3RoZXBrBGNvbG8DdwRsA1dTMQRwb3MDODEEc2VjA3NyBHZ0aWQD\\/SIG=11vhbotpk\\/EXP=1147592336\\/**http%3a\\/\\/www.mechon-mamre.org\\/p\\/pt\\/pt26d2.htm","ModificationDate":1138694400,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBYB7dmMwF;_ylu=X3oDMTBxNjUwMGs2BGNvbG8DdwRwb3MDODEEc2VjA3NyBHZ0aWQD\\/SIG=16gg7tf89\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.mechon-mamre.org\\/p\\/pt\\/pt26d2.htm%26w=132%26d=WTHLVUaqMu6s%26icp=1%26.intl=us","Size":"13881"}},{"Title":"US CODE: Title 28,132. Creation and composition of district courts","Summary":"Creation and composition of district courts. Release date: 2005-09-29. (a) There shall be in each judicial district a district court which shall be a court of record known as the United States District Court for the district.","Url":"http:\\/\\/www4.law.cornell.edu\\/uscode\\/28\\/132.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBYh7dmMwF;_ylu=X3oDMTEwcWlsMGMxBGNvbG8DdwRsA1dTMQRwb3MDODIEc2VjA3NyBHZ0aWQD\\/SIG=122ek55sr\\/EXP=1147592336\\/**http%3a\\/\\/www4.law.cornell.edu\\/uscode\\/28\\/132.html","ModificationDate":1143273600,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBZx7dmMwF;_ylu=X3oDMTBxYWs1NmFvBGNvbG8DdwRwb3MDODIEc2VjA3NyBHZ0aWQD\\/SIG=16jb47dcg\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www4.law.cornell.edu\\/uscode\\/28\\/132.html%26w=132%26d=QQ2S7EaqMjbv%26icp=1%26.intl=us","Size":"9107"}},{"Title":"Fiscal Note","Summary":"... Bill, Resolutions and Memorial Documents. SB05-132 ... Final Act\\/ Resolutions or Memorial: 132_enr.pdfn. 132.enrn. Preamended Documents ...","Url":"http:\\/\\/www.leg.state.co.us\\/Clics2005a\\/csl.nsf\\/fsbillcont3\\/A4058D1E27570DC987256F7E0059EAA8?Open&file=132_enr.pdf","ClickUrl":"http:\\/\\/www.leg.state.co.us\\/Clics2005a\\/csl.nsf\\/fsbillcont3\\/A4058D1E27570DC987256F7E0059EAA8?Open&file=132_enr.pdf#search=\'\'","ModificationDate":1124521200,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBbB7dmMwF;_ylu=X3oDMTBxbGJmNjEwBGNvbG8DdwRwb3MDODMEc2VjA3NyBHZ0aWQD\\/SIG=191n41l4b\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.leg.state.co.us\\/Clics2005a\\/csl.nsf\\/fsbillcont3\\/A4058D1E27570DC987256F7E0059EAA8%253FOpen%2526file%253D132_enr.pdf%26w=132%26d=LViIXUaqMkKL%26icp=1%26.intl=us","Size":"87930"}},{"Title":"Development -- Table of Contents (January 1 2005, 132 [1])","Summary":"To see an article, click its [Full Text] link. To review many abstracts, check the boxes to the left of the titles you want, and click the \'Get All Checked Abstract(s)\' button. To see one abstract at a time, click its [Abstract] link.","Url":"http:\\/\\/dev.biologists.org\\/content\\/vol132\\/issue1","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBbh7dmMwF;_ylu=X3oDMTEwdWdwcnIyBGNvbG8DdwRsA1dTMQRwb3MDODQEc2VjA3NyBHZ0aWQD\\/SIG=123019ojj\\/EXP=1147592336\\/**http%3a\\/\\/dev.biologists.org\\/content\\/vol132\\/issue1","ModificationDate":1147071600,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBcx7dmMwF;_ylu=X3oDMTBxczM2ZHFvBGNvbG8DdwRwb3MDODQEc2VjA3NyBHZ0aWQD\\/SIG=16kng2m03\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=dev.biologists.org\\/content\\/vol132\\/issue1%26w=132%26d=LFOVEUaqMwR5%26icp=1%26.intl=us","Size":"25711"}},{"Title":"Winter Carnival (1939)","Summary":"Winter Carnival - Cast, Crew, Reviews, Plot Summary, Comments, Discussion, Taglines, Trailers, Posters, Photos, Showtimes, Link to Official Site, Fan Sites","Url":"http:\\/\\/www.imdb.com\\/title\\/tt0032132\\/","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBdR7dmMwF;_ylu=X3oDMTEwb3IzajNvBGNvbG8DdwRsA1dTMQRwb3MDODUEc2VjA3NyBHZ0aWQD\\/SIG=11o6bhdhm\\/EXP=1147592336\\/**http%3a\\/\\/www.imdb.com\\/title\\/tt0032132\\/","ModificationDate":1147417200,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBeh7dmMwF;_ylu=X3oDMTBxcG9jdDNjBGNvbG8DdwRwb3MDODUEc2VjA3NyBHZ0aWQD\\/SIG=1696d85k0\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.imdb.com\\/title\\/tt0032132\\/%26w=132%26d=OnC3HUaqMw5H%26icp=1%26.intl=us","Size":"44616"}},{"Title":"XM Radio - C-SPAN Radio","Summary":"... XM 132. <Previous. Next ...","Url":"http:\\/\\/www.xmradio.com\\/programming\\/channel_page.jsp?ch=132","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBfB7dmMwF;_ylu=X3oDMTEwa3RyODBuBGNvbG8DdwRsA1dTMQRwb3MDODYEc2VjA3NyBHZ0aWQD\\/SIG=12gtfnvt7\\/EXP=1147592336\\/**http%3a\\/\\/www.xmradio.com\\/programming\\/channel_page.jsp%3fch=132","ModificationDate":1147158000,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBgR7dmMwF;_ylu=X3oDMTBxN24xYzc0BGNvbG8DdwRwb3MDODYEc2VjA3NyBHZ0aWQD\\/SIG=1774en6i4\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.xmradio.com\\/programming\\/channel_page.jsp%253Fch%253D132%26w=132%26d=WS_5a0aqMwE5%26icp=1%26.intl=us","Size":"23601"}},{"Title":"Al-Qaeda tape says bin Laden alive, urges Iraqis to fight - theage.com.au","Summary":"Arabic television channel Al Arabiya has aired what it says is an audiotape from an al-Qaeda spokesman who says Osama bin Laden is alive and well. - The Age","Url":"http:\\/\\/www.theage.com.au\\/articles\\/2003\\/08\\/18\\/1061059775995.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBgx7dmMwF;_ylu=X3oDMTEwNXU4aDFlBGNvbG8DdwRsA1dTMQRwb3MDODcEc2VjA3NyBHZ0aWQD\\/SIG=12jscc3ng\\/EXP=1147592336\\/**http%3a\\/\\/www.theage.com.au\\/articles\\/2003\\/08\\/18\\/1061059775995.html","ModificationDate":1147158000,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBiB7dmMwF;_ylu=X3oDMTBxZjFrNnYwBGNvbG8DdwRwb3MDODcEc2VjA3NyBHZ0aWQD\\/SIG=174fs4fo6\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.theage.com.au\\/articles\\/2003\\/08\\/18\\/1061059775995.html%26w=132%26d=VUVD3UaqMwJD%26icp=1%26.intl=us","Size":"25163"}},{"Title":"Psalms 132","Summary":"Psalms 132. 132:1. Lord, remember David, and all his afflictions: 132:2. How he sware unto the LORD, and vowed unto the mighty God of Jacob; 132:3 ... Psalms 132. Chapters: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ... 132:3. Surely I will not come into the tabernacle of my ...","Url":"http:\\/\\/www.maitreg.com\\/bible\\/view.asp?book=38&chapter=132","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBih7dmMwF;_ylu=X3oDMTEwZjVxcHI4BGNvbG8DdwRsA1dTMQRwb3MDODgEc2VjA3NyBHZ0aWQD\\/SIG=12hild8td\\/EXP=1147592336\\/**http%3a\\/\\/www.maitreg.com\\/bible\\/view.asp%3fbook=38%26chapter=132","ModificationDate":1117609200,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBjx7dmMwF;_ylu=X3oDMTBxb2JpMW5pBGNvbG8DdwRwb3MDODgEc2VjA3NyBHZ0aWQD\\/SIG=17elhve1h\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.maitreg.com\\/bible\\/view.asp%253Fbook%253D38%2526chapter%253D132%26w=132%26d=TMHn-UaqMjbU%26icp=1%26.intl=us","Size":"27216"}},{"Title":"132","Summary":"35 U.S.C. 132 Notice of rejection; reexamination. - Patent Laws. 35 U.S.C. 132 Notice of rejection; reexamination.","Url":"http:\\/\\/www.uspto.gov\\/web\\/offices\\/pac\\/mpep\\/documents\\/appxl_35_U_S_C_132.htm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBkR7dmMwF;_ylu=X3oDMTEwNTA2aTh1BGNvbG8DdwRsA1dTMQRwb3MDODkEc2VjA3NyBHZ0aWQD\\/SIG=12ucmimjn\\/EXP=1147592336\\/**http%3a\\/\\/www.uspto.gov\\/web\\/offices\\/pac\\/mpep\\/documents\\/appxl_35_U_S_C_132.htm","ModificationDate":1133942400,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBlh7dmMwF;_ylu=X3oDMTBxNmVndjYxBGNvbG8DdwRwb3MDODkEc2VjA3NyBHZ0aWQD\\/SIG=17f2jjpsh\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.uspto.gov\\/web\\/offices\\/pac\\/mpep\\/documents\\/appxl_35_U_S_C_132.htm%26w=132%26d=Nil-N0aqMjBx%26icp=1%26.intl=us","Size":"8182"}},{"Title":"A CONCISE SUMMARY OF THE PUBLIC HEARINGS","Summary":"... hearing on Bill 132. It shows you who was for, who was ... Opposes BSL, pointed out many anomalies in Bill 132, for example you can\'t teach a pit bull to ...","Url":"http:\\/\\/www.dogwatch.net\\/bill132.pdf","ClickUrl":"http:\\/\\/www.dogwatch.net\\/bill132.pdf#search=\'\'","ModificationDate":1109232000,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBmx7dmMwF;_ylu=X3oDMTBxZ2gwNnM2BGNvbG8DdwRwb3MDOTAEc2VjA3NyBHZ0aWQD\\/SIG=168j23ta7\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.dogwatch.net\\/bill132.pdf%26w=132%26d=PkjRQEaqMuwO%26icp=1%26.intl=us","Size":"1982792"}},{"Title":"JPL News -- A Galaxy Far, Far Away Eyed by Linked Hawaiian Telescopes","Summary":"... Keck Observatory, Kamuela, Hawaii. 2003-132. Site Manager: Webmasters ...","Url":"http:\\/\\/www.jpl.nasa.gov\\/releases\\/2003\\/132.cfm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBnR7dmMwF;_ylu=X3oDMTEwaTAxcXV0BGNvbG8DdwRsA1dTMQRwb3MDOTEEc2VjA3NyBHZ0aWQD\\/SIG=12170u1vu\\/EXP=1147592336\\/**http%3a\\/\\/www.jpl.nasa.gov\\/releases\\/2003\\/132.cfm","ModificationDate":1136016000,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBoh7dmMwF;_ylu=X3oDMTBxanNkbHBvBGNvbG8DdwRwb3MDOTEEc2VjA3NyBHZ0aWQD\\/SIG=16i2p31tn\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.jpl.nasa.gov\\/releases\\/2003\\/132.cfm%26w=132%26d=VNPrSUaqMkiG%26icp=1%26.intl=us","Size":"22198"}},{"Title":"(132) Justinian I","Summary":"(132) Justinian I - AV solidus, A.D. 527-545, 4.45 g. ( inv. 91.270). Obverse: Facing helmeted and cuirassed bust of Justinian, holding globus cruciger in r.; at l.","Url":"http:\\/\\/www.lawrence.edu\\/dept\\/art\\/buerger\\/catalogue\\/132.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBpB7dmMwF;_ylu=X3oDMTEwamM1Y3A2BGNvbG8DdwRsA1dTMQRwb3MDOTIEc2VjA3NyBHZ0aWQD\\/SIG=12f6r1r1h\\/EXP=1147592336\\/**http%3a\\/\\/www.lawrence.edu\\/dept\\/art\\/buerger\\/catalogue\\/132.html","ModificationDate":1006848000,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBqR7dmMwF;_ylu=X3oDMTBxZWNpdmpnBGNvbG8DdwRwb3MDOTIEc2VjA3NyBHZ0aWQD\\/SIG=1709bh559\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.lawrence.edu\\/dept\\/art\\/buerger\\/catalogue\\/132.html%26w=132%26d=BJJDnkaqMjfk%26icp=1%26.intl=us","Size":"3186"}},{"Title":"131","Summary":"35 U.S.C. 131 Examination of application. - Patent Laws. 35 U.S.C. 131 Examination of application.","Url":"http:\\/\\/www.uspto.gov\\/web\\/offices\\/pac\\/mpep\\/documents\\/appxl_35_U_S_C_131.htm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBqx7dmMwF;_ylu=X3oDMTEwdDUzZHBhBGNvbG8DdwRsA1dTMQRwb3MDOTMEc2VjA3NyBHZ0aWQD\\/SIG=12u6cdfcn\\/EXP=1147592336\\/**http%3a\\/\\/www.uspto.gov\\/web\\/offices\\/pac\\/mpep\\/documents\\/appxl_35_U_S_C_131.htm","ModificationDate":1133942400,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBsB7dmMwF;_ylu=X3oDMTBxdXZhZWxkBGNvbG8DdwRwb3MDOTMEc2VjA3NyBHZ0aWQD\\/SIG=17f8j8d98\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.uspto.gov\\/web\\/offices\\/pac\\/mpep\\/documents\\/appxl_35_U_S_C_131.htm%26w=132%26d=R2aGhUaqMj30%26icp=1%26.intl=us","Size":"7341"}},{"Title":"132 on Flickr - Photo Sharing!","Summary":"... 132. To take full advantage of Flickr, you should use a JavaScript-enabled browser and ...","Url":"http:\\/\\/www.flickr.com\\/photos\\/brettsky\\/53839790\\/","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBsh7dmMwF;_ylu=X3oDMTEwZ2lxZDhhBGNvbG8DdwRsA1dTMQRwb3MDOTQEc2VjA3NyBHZ0aWQD\\/SIG=123ojcbf0\\/EXP=1147592336\\/**http%3a\\/\\/www.flickr.com\\/photos\\/brettsky\\/53839790\\/","ModificationDate":1145862000,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBtx7dmMwF;_ylu=X3oDMTBxYTJvNGFhBGNvbG8DdwRwb3MDOTQEc2VjA3NyBHZ0aWQD\\/SIG=16ks6e563\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.flickr.com\\/photos\\/brettsky\\/53839790\\/%26w=132%26d=GA_4oEaqMq4P%26icp=1%26.intl=us","Size":"74392"}},{"Title":"Ag GPS 124 \\/ 132","Summary":"AgGPS 124 \\/ 132. Operation Manual. AgGPS Receiver Firmware Version 1.40, 1.41 and 1.42. Part Number 38747-00-ENG. Revision C. September 2000. T. Support Offices. Trimble Precision Agricultural Systems. 9290 Bond Street, Suite 102. Overland Park, KS 66214 U.S.A. ... describes how to install and configure the AgGPS_ 124, 132, and 132. Air receivers ...","Url":"http:\\/\\/www.linco.com\\/AG124132REVB.PDF","ClickUrl":"http:\\/\\/www.linco.com\\/AG124132REVB.PDF#search=\'\'","ModificationDate":986281200,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBvB7dmMwF;_ylu=X3oDMTBxbDgxOWxkBGNvbG8DdwRwb3MDOTUEc2VjA3NyBHZ0aWQD\\/SIG=16ajtq3hk\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.linco.com\\/AG124132REVB.PDF%26w=132%26d=FCohUkaqMjOV%26icp=1%26.intl=us","Size":"3610097"}},{"Title":"Tehillim - Chapter 132 | Chabad.org","Summary":"Please login for more site features. Tehillim - Chapter 132. 1. A song of ascents. Remember, O Lord, onto David all his affliction. 2. That he swore to the Lord, he vowed to the Mighty One of Jacob; ... Chabad.org \\" Library \\" Classic Texts \\" The Bible (with Rashi) \\" K\'tuvim \\" Tehillim \\" Chapter 132 ...","Url":"http:\\/\\/www.chabad.org\\/library\\/article.asp?AID=16353","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBvh7dmMwF;_ylu=X3oDMTEwam44NW9vBGNvbG8DdwRsA1dTMQRwb3MDOTYEc2VjA3NyBHZ0aWQD\\/SIG=129b821nj\\/EXP=1147592336\\/**http%3a\\/\\/www.chabad.org\\/library\\/article.asp%3fAID=16353","ModificationDate":1146898800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBwx7dmMwF;_ylu=X3oDMTBxczRxYWlqBGNvbG8DdwRwb3MDOTYEc2VjA3NyBHZ0aWQD\\/SIG=170gmib5a\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.chabad.org\\/library\\/article.asp%253FAID%253D16353%26w=132%26d=I-adaEaqMvld%26icp=1%26.intl=us","Size":"41051"}},{"Title":"Downloaded 19 Jan 2003 to 132.77.4.43. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip.org\\/... ","Summary":"Downloaded 19 Jan 2003 to 132.77.4.43. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip.org\\/jcpo\\/jcpcr.jsp. Downloaded 19 Jan 2003 to 132.77.4.43.","Url":"http:\\/\\/www.weizmann.ac.il\\/chemphys\\/Frydman_group\\/Publications\\/ExchDynamics-JCP90.pdf","ClickUrl":"http:\\/\\/www.weizmann.ac.il\\/chemphys\\/Frydman_group\\/Publications\\/ExchDynamics-JCP90.pdf#search=\'\'","ModificationDate":1061622000,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcByB7dmMwF;_ylu=X3oDMTBxZGVwcTFiBGNvbG8DdwRwb3MDOTcEc2VjA3NyBHZ0aWQD\\/SIG=17p1893is\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.weizmann.ac.il\\/chemphys\\/Frydman_group\\/Publications\\/ExchDynamics-JCP90.pdf%26w=132%26d=KPVdS0aqMkW1%26icp=1%26.intl=us","Size":"816603"}},{"Title":"Downloaded 19 May 2003 to 132.77.4.43. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip.org\\/... ","Summary":"Downloaded 19 May 2003 to 132.77.4.43. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip.org\\/japo\\/japcr.jsp. Downloaded 19 May 2003 to 132.77.4.43.","Url":"http:\\/\\/www.weizmann.ac.il\\/wagner\\/COURSES\\/Reading%20material%20(papers)\\/030_JAP_1990_ContactAngle.pdf","ClickUrl":"http:\\/\\/www.weizmann.ac.il\\/wagner\\/COURSES\\/Reading%20material%20(papers)\\/030_JAP_1990_ContactAngle.pdf#search=\'\'","ModificationDate":1136880000,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBzR7dmMwF;_ylu=X3oDMTBxMjBxZ2VoBGNvbG8DdwRwb3MDOTgEc2VjA3NyBHZ0aWQD\\/SIG=18pfdig62\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.weizmann.ac.il\\/wagner\\/COURSES\\/Reading%252520material%252520%2528papers%2529\\/030_JAP_1990_ContactAngle.pdf%26w=132%26d=Nf5MWEaqMkV0%26icp=1%26.intl=us","Size":"784314"}},{"Title":"Downloaded 24 Jul 2002 to 132.163.135.12. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip... ","Summary":"Downloaded 24 Jul 2002 to 132.163.135.12. Redistribution subject to AIP license or copyright, see http:\\/\\/ojps.aip.org\\/japo\\/japcr.jsp. Downloaded 24 Jul 2002 to 132.163.135.12.","Url":"http:\\/\\/tf.nist.gov\\/general\\/pdf\\/569.pdf","ClickUrl":"http:\\/\\/tf.nist.gov\\/general\\/pdf\\/569.pdf#search=\'\'","ModificationDate":1027494000,"MimeType":"application\\/pdf","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB0h7dmMwF;_ylu=X3oDMTBxNmJhcjNhBGNvbG8DdwRwb3MDOTkEc2VjA3NyBHZ0aWQD\\/SIG=16b31en6n\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=tf.nist.gov\\/general\\/pdf\\/569.pdf%26w=132%26d=IpdTwEaqMirR%26icp=1%26.intl=us","Size":"1002734"}},{"Title":"[DB] naruto 132","Summary":"","Url":"http:\\/\\/yhbt.mine.nu\\/t\\/n132.torrent","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcB1B7dmMwF;_ylu=X3oDMTExaW11dG45BGNvbG8DdwRsA1dTMQRwb3MDMTAwBHNlYwNzcgR2dGlkAw--\\/SIG=11m58k4sj\\/EXP=1147592336\\/**http%3a\\/\\/yhbt.mine.nu\\/t\\/n132.torrent","ModificationDate":1114671600,"MimeType":"unknown"}]}}'); + +shouldBe("result.length", "5"); diff --git a/deps/v8/test/webkit/fast/js/regexp-unicode-handling-expected.txt b/deps/v8/test/webkit/fast/js/regexp-unicode-handling-expected.txt new file mode 100644 index 0000000..0791196 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-unicode-handling-expected.txt @@ -0,0 +1,72 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test for proper handling of Unicode RegExps and bug 7445: Gmail puts wrong subject in replies. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS cy('Re: Moose') is 'Moose' +PASS cy('\u8f6c\u53d1: Moose') is 'Moose' +PASS inlineRe.source is newFromInlineRe.source +PASS inlineRe.source is evalFromInlineRe.source +PASS inlineRe.source is evalInlineRe.source +PASS inlineRe.source is newFromEvalInlineRe.source +PASS inlineRe.source is evalFromEvalInlineRe.source +PASS inlineRe.source is explicitRe.source +PASS inlineRe.source is newFromExplicitRe.source +PASS inlineRe.source is evalFromExplicitRe.source +PASS inlineRe.toString() is newFromInlineRe.toString() +PASS inlineRe.toString() is evalFromInlineRe.toString() +PASS inlineRe.toString() is evalInlineRe.toString() +PASS inlineRe.toString() is newFromEvalInlineRe.toString() +PASS inlineRe.toString() is evalFromEvalInlineRe.toString() +PASS inlineRe.toString() is explicitRe.toString() +PASS inlineRe.toString() is newFromExplicitRe.toString() +PASS inlineRe.toString() is evalFromExplicitRe.toString() +PASS inlineRe.exec(sample)[0] is 'bm⠠p' +PASS evalInlineRe.exec(sample)[0] is 'bm⠠p' +PASS explicitRe.exec(sample)[0] is 'bm⠠p' +PASS binlineRe.source is bnewFromInlineRe.source +PASS binlineRe.source is bevalFromInlineRe.source +PASS binlineRe.source is bevalInlineRe.source +PASS binlineRe.source is bnewFromEvalInlineRe.source +PASS binlineRe.source is bevalFromEvalInlineRe.source +PASS binlineRe.source is bexplicitRe.source +PASS binlineRe.source is bnewFromExplicitRe.source +PASS binlineRe.source is bevalFromExplicitRe.source +PASS binlineRe.toString() is bnewFromInlineRe.toString() +PASS binlineRe.toString() is bevalFromInlineRe.toString() +PASS binlineRe.toString() is bevalInlineRe.toString() +PASS binlineRe.toString() is bnewFromEvalInlineRe.toString() +PASS binlineRe.toString() is bevalFromEvalInlineRe.toString() +PASS binlineRe.toString() is bexplicitRe.toString() +PASS binlineRe.toString() is bnewFromExplicitRe.toString() +PASS binlineRe.toString() is bevalFromExplicitRe.toString() +PASS binlineRe.exec(bsample)[0] is 'bm|p' +PASS bevalInlineRe.exec(bsample)[0] is 'bm|p' +PASS bexplicitRe.exec(bsample)[0] is 'bm|p' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/regexp-unicode-handling.js b/deps/v8/test/webkit/fast/js/regexp-unicode-handling.js new file mode 100644 index 0000000..43d4fa4 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/regexp-unicode-handling.js @@ -0,0 +1,128 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( + +'Test for proper handling of Unicode RegExps and bug 7445: Gmail puts wrong subject in replies.' + +); + +// Regex to match Re in various languanges straight from Gmail source +var I3=/^\s*(fwd|re|aw|antw|antwort|wg|sv|ang|odp|betreff|betr|transf|reenv\.|reenv|in|res|resp|resp\.|enc|\u8f6c\u53d1|\u56DE\u590D|\u041F\u0435\u0440\u0435\u0441\u043B|\u041E\u0442\u0432\u0435\u0442):\s*(.*)$/i; + +// Other RegExs from Gmail source +var Ci=/\s+/g; +var BC=/^ /; +var BG=/ $/; + +// Strips leading Re or similar (from Gmail source) +function cy(a) { + //var b = I3.exec(a); + var b = I3.exec(a); + + if (b) { + a = b[2]; + } + + return Gn(a); +} + +// This function replaces consecutive whitespace with a single space +// then removes a leading and trailing space if they exist. (From Gmail) +function Gn(a) { + return a.replace(Ci, " ").replace(BC, "").replace(BG, ""); +} + +shouldBe("cy('Re: Moose')", "'Moose'") +shouldBe("cy('\\u8f6c\\u53d1: Moose')", "'Moose'") + +// Test handling of \u2820 (skull and crossbones) +var sample="sample bm\u2820p cm\\u2820p"; + +var inlineRe=/.m\u2820p/ +var evalInlineRe=eval("/.m\\u2820p/") +var explicitRe=new RegExp(".m\\u2820p") +var newFromInlineRe=new RegExp(inlineRe.source) +var evalFromInlineRe=eval(inlineRe.toString()) +var newFromEvalInlineRe=new RegExp(evalInlineRe.source) +var evalFromEvalInlineRe=eval(evalInlineRe.toString()) +var newFromExplicitRe=new RegExp(explicitRe.source) +var evalFromExplicitRe=eval(explicitRe.toString()) + +shouldBe("inlineRe.source", "newFromInlineRe.source") +shouldBe("inlineRe.source", "evalFromInlineRe.source") +shouldBe("inlineRe.source", "evalInlineRe.source") +shouldBe("inlineRe.source", "newFromEvalInlineRe.source") +shouldBe("inlineRe.source", "evalFromEvalInlineRe.source") +shouldBe("inlineRe.source", "explicitRe.source") +shouldBe("inlineRe.source", "newFromExplicitRe.source") +shouldBe("inlineRe.source", "evalFromExplicitRe.source") + +shouldBe("inlineRe.toString()", "newFromInlineRe.toString()") +shouldBe("inlineRe.toString()", "evalFromInlineRe.toString()") +shouldBe("inlineRe.toString()", "evalInlineRe.toString()") +shouldBe("inlineRe.toString()", "newFromEvalInlineRe.toString()") +shouldBe("inlineRe.toString()", "evalFromEvalInlineRe.toString()") +shouldBe("inlineRe.toString()", "explicitRe.toString()") +shouldBe("inlineRe.toString()", "newFromExplicitRe.toString()") +shouldBe("inlineRe.toString()", "evalFromExplicitRe.toString()") + +shouldBe("inlineRe.exec(sample)[0]", "'bm\u2820p'") +shouldBe("evalInlineRe.exec(sample)[0]", "'bm\u2820p'") +shouldBe("explicitRe.exec(sample)[0]", "'bm\u2820p'") + + +// Test handling of \u007c "|" +var bsample="sample bm\u007cp cm\\u007cp"; + +var binlineRe=/.m\u007cp/ +var bevalInlineRe=eval("/.m\\u007cp/") +var bexplicitRe=new RegExp(".m\\u007cp") +var bnewFromInlineRe=new RegExp(binlineRe.source) +var bevalFromInlineRe=eval(binlineRe.toString()) +var bnewFromEvalInlineRe=new RegExp(bevalInlineRe.source) +var bevalFromEvalInlineRe=eval(bevalInlineRe.toString()) +var bnewFromExplicitRe=new RegExp(bexplicitRe.source) +var bevalFromExplicitRe=eval(bexplicitRe.toString()) + +shouldBe("binlineRe.source", "bnewFromInlineRe.source") +shouldBe("binlineRe.source", "bevalFromInlineRe.source") +shouldBe("binlineRe.source", "bevalInlineRe.source") +shouldBe("binlineRe.source", "bnewFromEvalInlineRe.source") +shouldBe("binlineRe.source", "bevalFromEvalInlineRe.source") +shouldBe("binlineRe.source", "bexplicitRe.source") +shouldBe("binlineRe.source", "bnewFromExplicitRe.source") +shouldBe("binlineRe.source", "bevalFromExplicitRe.source") + +shouldBe("binlineRe.toString()", "bnewFromInlineRe.toString()") +shouldBe("binlineRe.toString()", "bevalFromInlineRe.toString()") +shouldBe("binlineRe.toString()", "bevalInlineRe.toString()") +shouldBe("binlineRe.toString()", "bnewFromEvalInlineRe.toString()") +shouldBe("binlineRe.toString()", "bevalFromEvalInlineRe.toString()") +shouldBe("binlineRe.toString()", "bexplicitRe.toString()") +shouldBe("binlineRe.toString()", "bnewFromExplicitRe.toString()") +shouldBe("binlineRe.toString()", "bevalFromExplicitRe.toString()") + +shouldBe("binlineRe.exec(bsample)[0]", "'bm|p'") +shouldBe("bevalInlineRe.exec(bsample)[0]", "'bm|p'") +shouldBe("bexplicitRe.exec(bsample)[0]", "'bm|p'") diff --git a/deps/v8/test/webkit/fast/js/reserved-words-strict-expected.txt b/deps/v8/test/webkit/fast/js/reserved-words-strict-expected.txt new file mode 100644 index 0000000..2678d9e --- /dev/null +++ b/deps/v8/test/webkit/fast/js/reserved-words-strict-expected.txt @@ -0,0 +1,61 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file checks which ECMAScript 3 keywords are treated as reserved words in strict mode. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +SHOULD BE RESERVED: +FAIL isReserved('implements') should be true. Was false. +FAIL isReserved('interface') should be true. Was false. +FAIL isReserved('let') should be true. Was false. +FAIL isReserved('package') should be true. Was false. +FAIL isReserved('private') should be true. Was false. +FAIL isReserved('protected') should be true. Was false. +FAIL isReserved('public') should be true. Was false. +FAIL isReserved('static') should be true. Was false. +FAIL isReserved('yield') should be true. Was false. + +SHOULD NOT BE RESERVED: +PASS isReserved('abstract') is false +PASS isReserved('boolean') is false +PASS isReserved('byte') is false +PASS isReserved('char') is false +PASS isReserved('double') is false +PASS isReserved('final') is false +PASS isReserved('float') is false +PASS isReserved('goto') is false +PASS isReserved('int') is false +PASS isReserved('long') is false +PASS isReserved('native') is false +PASS isReserved('short') is false +PASS isReserved('synchronized') is false +PASS isReserved('throws') is false +PASS isReserved('transient') is false +PASS isReserved('volatile') is false + +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/reserved-words-strict.js b/deps/v8/test/webkit/fast/js/reserved-words-strict.js new file mode 100644 index 0000000..023ad7f --- /dev/null +++ b/deps/v8/test/webkit/fast/js/reserved-words-strict.js @@ -0,0 +1,88 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +function isReserved(word) +{ + try { + eval("\"use strict\";var " + word + ";"); + return false; + } catch (e) { +        var expectedError = "Use of reserved word '" + word + "' in strict mode"; +        if (expectedError == e.message) +        return true; + else +        return false; + } +} + +var reservedWords = [ + "implements", + "let", + "private", + "public", + "yield", + "interface", + "package", + "protected", + "static" +]; + +var unreservedWords = [ + "abstract", + "boolean", + "byte", + "char", + "double", + "final", + "float", + "goto", + "int", + "long", + "native", + "short", + "synchronized", + "throws", + "transient", + "volatile" +]; + +description( +"This file checks which ECMAScript 3 keywords are treated as reserved words in strict mode." +); + +reservedWords.sort(); +unreservedWords.sort(); + +debug("SHOULD BE RESERVED:"); +for (var p in reservedWords) { + shouldBeTrue("isReserved('" + reservedWords[p] + "')"); +} + +debug(""); + +debug("SHOULD NOT BE RESERVED:"); +for (var p in unreservedWords) { + shouldBeFalse("isReserved('" + unreservedWords[p] + "')"); +} + +debug(""); diff --git a/deps/v8/test/webkit/fast/js/stack-overflow-arrity-catch-expected.txt b/deps/v8/test/webkit/fast/js/stack-overflow-arrity-catch-expected.txt new file mode 100644 index 0000000..5fae72e --- /dev/null +++ b/deps/v8/test/webkit/fast/js/stack-overflow-arrity-catch-expected.txt @@ -0,0 +1,35 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test that if an arrity check causes a stack overflow, the exception goes to the right catch + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS gotRightCatch is true +PASS gotWrongCatch1 is false +FAIL gotWrongCatch2 should be false. Was true. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/stack-overflow-arrity-catch.js b/deps/v8/test/webkit/fast/js/stack-overflow-arrity-catch.js new file mode 100644 index 0000000..4cbcbbf --- /dev/null +++ b/deps/v8/test/webkit/fast/js/stack-overflow-arrity-catch.js @@ -0,0 +1,81 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description('Test that if an arrity check causes a stack overflow, the exception goes to the right catch'); + +function funcWith20Args(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, + arg9, arg10, arg11, arg12, arg13, arg14, arg15, + arg16, arg17, arg18, arg19, arg20) +{ + debug("ERROR: Shouldn't arrive in 20 arg function!"); +} + +var gotRightCatch = false, gotWrongCatch1 = false, gotWrongCatch2 = false; + +function test1() +{ + try { + test2(); + } catch (err) { + // Should get here because of stack overflow, + // now cause a stack overflow exception due to arrity processing + try { + var dummy = new RegExp('a|b|c'); + } catch(err) { + gotWrongCatch1 = true; + } + + try { + funcWith20Args(1, 2, 3); + } catch (err2) { + gotRightCatch = true; + } + } +} + +function test2() +{ + try { + var dummy = new Date(); + } catch(err) { + gotWrongCatch2 = true; + } + + try { + test1(); + } catch (err) { + // Should get here because of stack overflow, + // now cause a stack overflow exception due to arrity processing + try { + funcWith20Args(1, 2, 3, 4, 5, 6); + } catch (err2) { + gotRightCatch = true; + } + } +} + +test1(); + +shouldBeTrue("gotRightCatch"); +shouldBeFalse("gotWrongCatch1"); +shouldBeFalse("gotWrongCatch2"); diff --git a/deps/v8/test/webkit/fast/js/string-capitalization-expected.txt b/deps/v8/test/webkit/fast/js/string-capitalization-expected.txt new file mode 100644 index 0000000..817db11 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/string-capitalization-expected.txt @@ -0,0 +1,53 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks that toLowerCase and toUpperCase handle certain non-trivial cases correctly. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +FAIL String("A𐐀").toLowerCase() should be a𐐨. Was a𐐀. +FAIL String("a𐐨").toUpperCase() should be A𐐀. Was A𐐨. +PASS String("ΚΟΣΜΟΣ ΚΟΣΜΟΣ").toLowerCase() is "κοσμος κοσμος" +PASS String("ß").toUpperCase() is "SS" +PASS String("ʼn").toUpperCase() is "ʼN" +PASS String("ǰ").toUpperCase() is "J̌" +PASS String("ffi").toUpperCase() is "FFI" +PASS String("FFI").toLowerCase() is "ffi" +PASS String("IJ").toLowerCase() is "ij" +PASS expected[String.fromCharCode(0xA78D).toLowerCase()] is true +PASS expected[String.fromCharCode(0x0265).toUpperCase()] is true +PASS expected[String.fromCharCode(0x10C7).toLowerCase()] is true +PASS expected[String.fromCharCode(0x2D27).toUpperCase()] is true +PASS expected[String.fromCharCode(0x2D2D).toLowerCase()] is true +PASS expected[String.fromCharCode(0x10CD).toUpperCase()] is true +PASS expected[String.fromCharCode(0x2CF2).toLowerCase()] is true +PASS expected[String.fromCharCode(0x2CF3).toUpperCase()] is true +PASS expected[String.fromCharCode(0xA792).toLowerCase()] is true +PASS expected[String.fromCharCode(0xA793).toUpperCase()] is true +PASS expected[String.fromCharCode(0xA7AA).toLowerCase()] is true +PASS expected[String.fromCharCode(0x0266).toUpperCase()] is true +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/string-capitalization.js b/deps/v8/test/webkit/fast/js/string-capitalization.js new file mode 100644 index 0000000..d1af25e --- /dev/null +++ b/deps/v8/test/webkit/fast/js/string-capitalization.js @@ -0,0 +1,95 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( + +"This test checks that toLowerCase and toUpperCase handle certain non-trivial cases correctly." + +); + +shouldBe('String("A𐐀").toLowerCase()', '"a𐐨"'); +shouldBe('String("a𐐨").toUpperCase()', '"A𐐀"'); +shouldBe('String("ΚΟΣΜΟΣ ΚΟΣΜΟΣ").toLowerCase()', '"κοσμος κοσμος"'); +shouldBe('String("ß").toUpperCase()', '"SS"'); +shouldBe('String("ʼn").toUpperCase()', '"ʼN"'); +shouldBe('String("ǰ").toUpperCase()', '"J̌"'); +shouldBe('String("ffi").toUpperCase()', '"FFI"'); +shouldBe('String("FFI").toLowerCase()', '"ffi"'); +shouldBe('String("IJ").toLowerCase()', '"ij"'); + +// Test the toUpper and toLower changes made in Unicode versions 5.2 and 6.1 +// Construct the tests so that it passes if the toLowerCase()/toUpperCase() +// either return the updated results for compliant platforms or the +// passed in arguments if not. This should be changed when all platforms +// support Unicode 5.2 and Unicode 6.1. +function createExpected(/* ... */) +{ + expected = {}; + + for (var i = 0; i < arguments.length; i++) { + var s = String.fromCharCode(arguments[i]); + expected[s] = true; + } + + return expected; +} + +// Check Unicode additions in version 5.2. From UnicodeData.txt: +// 0265;LATIN SMALL LETTER TURNED H;Ll;0;L;;;;;N;;;A78D;;A78D +// A78D;LATIN CAPITAL LETTER TURNED H;Lu;0;L;;;;;N;;;;0265; + +var expected = createExpected(0xA78D, 0x0265); +shouldBeTrue('expected[String.fromCharCode(0xA78D).toLowerCase()]'); +shouldBeTrue('expected[String.fromCharCode(0x0265).toUpperCase()]'); + +// Check Unicode additions in version 6.1 From UnicodeData.txt: +// 0266;LATIN SMALL LETTER H WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER H HOOK;;A7AA;;A7AA +// 10C7;GEORGIAN CAPITAL LETTER YN;Lu;0;L;;;;;N;;;;2D27; +// 10CD;GEORGIAN CAPITAL LETTER AEN;Lu;0;L;;;;;N;;;;2D2D; +// 2CF2;COPTIC CAPITAL LETTER BOHAIRIC KHEI;Lu;0;L;;;;;N;;;;2CF3; +// 2CF3;COPTIC SMALL LETTER BOHAIRIC KHEI;Ll;0;L;;;;;N;;;2CF2;;2CF2 +// 2D27;GEORGIAN SMALL LETTER YN;Ll;0;L;;;;;N;;;10C7;;10C7 +// 2D2D;GEORGIAN SMALL LETTER AEN;Ll;0;L;;;;;N;;;10CD;;10CD +// A792;LATIN CAPITAL LETTER C WITH BAR;Lu;0;L;;;;;N;;;;A793; +// A793;LATIN SMALL LETTER C WITH BAR;Ll;0;L;;;;;N;;;A792;;A792 +// A7AA;LATIN CAPITAL LETTER H WITH HOOK;Lu;0;L;;;;;N;;;;0266; + +var expected = createExpected(0x10C7, 0x2D27); +shouldBeTrue('expected[String.fromCharCode(0x10C7).toLowerCase()]'); +shouldBeTrue('expected[String.fromCharCode(0x2D27).toUpperCase()]'); + +var expected = createExpected(0x10CD, 0x2D2D); +shouldBeTrue('expected[String.fromCharCode(0x2D2D).toLowerCase()]'); +shouldBeTrue('expected[String.fromCharCode(0x10CD).toUpperCase()]'); + +var expected = createExpected(0x2CF2, 0x2CF3); +shouldBeTrue('expected[String.fromCharCode(0x2CF2).toLowerCase()]'); +shouldBeTrue('expected[String.fromCharCode(0x2CF3).toUpperCase()]'); + +var expected = createExpected(0xA792, 0xA793); +shouldBeTrue('expected[String.fromCharCode(0xA792).toLowerCase()]'); +shouldBeTrue('expected[String.fromCharCode(0xA793).toUpperCase()]'); + +var expected = createExpected(0xA7AA, 0x0266); +shouldBeTrue('expected[String.fromCharCode(0xA7AA).toLowerCase()]'); +shouldBeTrue('expected[String.fromCharCode(0x0266).toUpperCase()]'); diff --git a/deps/v8/test/webkit/fast/js/string-split-conformance-expected.txt b/deps/v8/test/webkit/fast/js/string-split-conformance-expected.txt new file mode 100644 index 0000000..90ed9dc --- /dev/null +++ b/deps/v8/test/webkit/fast/js/string-split-conformance-expected.txt @@ -0,0 +1,90 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks for a regression against String#split is buggy. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS ''.split() is testCode[i][1] +PASS ''.split(/./) is testCode[i][1] +PASS ''.split(/.?/) is testCode[i][1] +PASS ''.split(/.??/) is testCode[i][1] +PASS 'ab'.split(/a*/) is testCode[i][1] +PASS 'ab'.split(/a*?/) is testCode[i][1] +PASS 'ab'.split(/(?:ab)/) is testCode[i][1] +PASS 'ab'.split(/(?:ab)*/) is testCode[i][1] +PASS 'ab'.split(/(?:ab)*?/) is testCode[i][1] +PASS 'test'.split('') is testCode[i][1] +PASS 'test'.split() is testCode[i][1] +PASS '111'.split(1) is testCode[i][1] +PASS 'test'.split(/(?:)/, 2) is testCode[i][1] +PASS 'test'.split(/(?:)/, -1) is testCode[i][1] +PASS 'test'.split(/(?:)/, undefined) is testCode[i][1] +PASS 'test'.split(/(?:)/, null) is testCode[i][1] +PASS 'test'.split(/(?:)/, NaN) is testCode[i][1] +PASS 'test'.split(/(?:)/, true) is testCode[i][1] +PASS 'test'.split(/(?:)/, '2') is testCode[i][1] +PASS 'test'.split(/(?:)/, 'two') is testCode[i][1] +PASS 'a'.split(/-/) is testCode[i][1] +PASS 'a'.split(/-?/) is testCode[i][1] +PASS 'a'.split(/-??/) is testCode[i][1] +PASS 'a'.split(/a/) is testCode[i][1] +PASS 'a'.split(/a?/) is testCode[i][1] +PASS 'a'.split(/a??/) is testCode[i][1] +PASS 'ab'.split(/-/) is testCode[i][1] +PASS 'ab'.split(/-?/) is testCode[i][1] +PASS 'ab'.split(/-??/) is testCode[i][1] +PASS 'a-b'.split(/-/) is testCode[i][1] +PASS 'a-b'.split(/-?/) is testCode[i][1] +PASS 'a-b'.split(/-??/) is testCode[i][1] +PASS 'a--b'.split(/-/) is testCode[i][1] +PASS 'a--b'.split(/-?/) is testCode[i][1] +PASS 'a--b'.split(/-??/) is testCode[i][1] +PASS ''.split(/()()/) is testCode[i][1] +PASS '.'.split(/()()/) is testCode[i][1] +PASS '.'.split(/(.?)(.?)/) is testCode[i][1] +PASS '.'.split(/(.??)(.??)/) is testCode[i][1] +PASS '.'.split(/(.)?(.)?/) is testCode[i][1] +PASS 'Aboldandcoded'.split(ecmaSampleRe) is testCode[i][1] +PASS 'tesst'.split(/(s)*/) is testCode[i][1] +PASS 'tesst'.split(/(s)*?/) is testCode[i][1] +PASS 'tesst'.split(/(s*)/) is testCode[i][1] +PASS 'tesst'.split(/(s*?)/) is testCode[i][1] +PASS 'tesst'.split(/(?:s)*/) is testCode[i][1] +PASS 'tesst'.split(/(?=s+)/) is testCode[i][1] +PASS 'test'.split('t') is testCode[i][1] +PASS 'test'.split('es') is testCode[i][1] +PASS 'test'.split(/t/) is testCode[i][1] +PASS 'test'.split(/es/) is testCode[i][1] +PASS 'test'.split(/(t)/) is testCode[i][1] +PASS 'test'.split(/(es)/) is testCode[i][1] +PASS 'test'.split(/(t)(e)(s)(t)/) is testCode[i][1] +PASS '.'.split(/(((.((.??)))))/) is testCode[i][1] +PASS '.'.split(/(((((.??)))))/) is testCode[i][1] +PASS 'hello'.split({toString:function(){return 'e';}}) is ["h", "llo"] +PASS var a = 'hello'.split({toString:function(){separatorToStringCalled='OKAY';return 'e';}},0); a.push(separatorToStringCalled); a is ["OKAY"] +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/string-split-conformance.js b/deps/v8/test/webkit/fast/js/string-split-conformance.js new file mode 100644 index 0000000..e4484e2 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/string-split-conformance.js @@ -0,0 +1,96 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'This test checks for a regression against String#split is buggy.' +); + +// The following JavaScript code (including "".split tests) is copyright by Steven Levithan, +// and released under the MIT License +var testCode = [ + ["''.split()",                        [""]], + ["''.split(/./)",                [""]], + ["''.split(/.?/)",                []], + ["''.split(/.??/)",                []], + ["'ab'.split(/a*/)",                ["", "b"]], + ["'ab'.split(/a*?/)",                ["a", "b"]], + ["'ab'.split(/(?:ab)/)",        ["", ""]], + ["'ab'.split(/(?:ab)*/)",        ["", ""]], + ["'ab'.split(/(?:ab)*?/)",        ["a", "b"]], + ["'test'.split('')",                ["t", "e", "s", "t"]], + ["'test'.split()",                ["test"]], + ["'111'.split(1)",                ["", "", "", ""]], + ["'test'.split(/(?:)/, 2)",                ["t", "e"]], + ["'test'.split(/(?:)/, -1)",        ["t", "e", "s", "t"]], + ["'test'.split(/(?:)/, undefined)",        ["t", "e", "s", "t"]], + ["'test'.split(/(?:)/, null)",        []], + ["'test'.split(/(?:)/, NaN)",        []], + ["'test'.split(/(?:)/, true)",        ["t"]], + ["'test'.split(/(?:)/, '2')",        ["t", "e"]], + ["'test'.split(/(?:)/, 'two')",        []], + ["'a'.split(/-/)",                ["a"]], + ["'a'.split(/-?/)",                ["a"]], + ["'a'.split(/-??/)",                ["a"]], + ["'a'.split(/a/)",                ["", ""]], + ["'a'.split(/a?/)",                ["", ""]], + ["'a'.split(/a??/)",                ["a"]], + ["'ab'.split(/-/)",                ["ab"]], + ["'ab'.split(/-?/)",                ["a", "b"]], + ["'ab'.split(/-??/)",                ["a", "b"]], + ["'a-b'.split(/-/)",                ["a", "b"]], + ["'a-b'.split(/-?/)",                ["a", "b"]], + ["'a-b'.split(/-??/)",                ["a", "-", "b"]], + ["'a--b'.split(/-/)",                ["a", "", "b"]], + ["'a--b'.split(/-?/)",                ["a", "", "b"]], + ["'a--b'.split(/-??/)",                ["a", "-", "-", "b"]], + ["''.split(/()()/)",                []], + ["'.'.split(/()()/)",                ["."]], + ["'.'.split(/(.?)(.?)/)",        ["", ".", "", ""]], + ["'.'.split(/(.??)(.??)/)",        ["."]], + ["'.'.split(/(.)?(.)?/)",        ["", ".", undefined, ""]], + ["'Aboldandcoded'.split(ecmaSampleRe)", ["A", undefined, "B", "bold", "/", "B", "and", undefined, "CODE", "coded", "/", "CODE", ""]], + ["'tesst'.split(/(s)*/)",        ["t", undefined, "e", "s", "t"]], + ["'tesst'.split(/(s)*?/)",        ["t", undefined, "e", undefined, "s", undefined, "s", undefined, "t"]], + ["'tesst'.split(/(s*)/)",        ["t", "", "e", "ss", "t"]], + ["'tesst'.split(/(s*?)/)",        ["t", "", "e", "", "s", "", "s", "", "t"]], + ["'tesst'.split(/(?:s)*/)",        ["t", "e", "t"]], + ["'tesst'.split(/(?=s+)/)",        ["te", "s", "st"]], + ["'test'.split('t')",                ["", "es", ""]], + ["'test'.split('es')",                ["t", "t"]], + ["'test'.split(/t/)",                ["", "es", ""]], + ["'test'.split(/es/)",                ["t", "t"]], + ["'test'.split(/(t)/)",                ["", "t", "es", "t", ""]], + ["'test'.split(/(es)/)",        ["t", "es", "t"]], + ["'test'.split(/(t)(e)(s)(t)/)",["", "t", "e", "s", "t", ""]], + ["'.'.split(/(((.((.??)))))/)",        ["", ".", ".", ".", "", "", ""]], + ["'.'.split(/(((((.??)))))/)",        ["."]] +]; +var ecmaSampleRe = /<(\/)?([^<>]+)>/; + +for (var i in testCode) + shouldBe(testCode[i][0], 'testCode[i][1]'); + +// Check that split works with object separators, and that steps 8 & 9 are performed in the correct order. +var separatorToStringCalled = "ToString not called on the separator"; +shouldBe("'hello'.split({toString:function(){return 'e';}})", '["h", "llo"]'); +shouldBe("var a = 'hello'.split({toString:function(){separatorToStringCalled='OKAY';return 'e';}},0); a.push(separatorToStringCalled); a", '["OKAY"]'); diff --git a/deps/v8/test/webkit/fast/js/string-split-double-empty-expected.txt b/deps/v8/test/webkit/fast/js/string-split-double-empty-expected.txt new file mode 100644 index 0000000..a7acfdc --- /dev/null +++ b/deps/v8/test/webkit/fast/js/string-split-double-empty-expected.txt @@ -0,0 +1,34 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks for a regression against split() function returns wrong answer for second empty split. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS "".split(/s+/) is [""] +PASS "".split(/s+/) is [""] +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/string-split-double-empty.js b/deps/v8/test/webkit/fast/js/string-split-double-empty.js new file mode 100644 index 0000000..f7c0cbc --- /dev/null +++ b/deps/v8/test/webkit/fast/js/string-split-double-empty.js @@ -0,0 +1,29 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'This test checks for a regression against split() function returns wrong answer for second empty split.' +); + +shouldBe('"".split(/s+/)', '[""]'); +shouldBe('"".split(/s+/)', '[""]'); diff --git a/deps/v8/test/webkit/fast/js/string-split-ignore-case-expected.txt b/deps/v8/test/webkit/fast/js/string-split-ignore-case-expected.txt new file mode 100644 index 0000000..2052ff7 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/string-split-ignore-case-expected.txt @@ -0,0 +1,33 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks for a regression against split() function ignores case insensitive modifier. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS "1s2S3".split(/s/i).toString() is "1,2,3" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/string-split-ignore-case.js b/deps/v8/test/webkit/fast/js/string-split-ignore-case.js new file mode 100644 index 0000000..2c36aee --- /dev/null +++ b/deps/v8/test/webkit/fast/js/string-split-ignore-case.js @@ -0,0 +1,28 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'This test checks for a regression against split() function ignores case insensitive modifier.' +); + +shouldBe('"1s2S3".split(/s/i).toString()', '"1,2,3"'); diff --git a/deps/v8/test/webkit/fast/js/toString-exception-expected.txt b/deps/v8/test/webkit/fast/js/toString-exception-expected.txt new file mode 100644 index 0000000..1f29de3 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/toString-exception-expected.txt @@ -0,0 +1,33 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks for regression against 7343: REGRESSION: fast/js/toString-overrides.html fails when run multiple times. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS caught is true +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/toString-exception.js b/deps/v8/test/webkit/fast/js/toString-exception.js new file mode 100644 index 0000000..2a8b50c --- /dev/null +++ b/deps/v8/test/webkit/fast/js/toString-exception.js @@ -0,0 +1,43 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'This test checks for regression against 7343: REGRESSION: fast/js/toString-overrides.html fails when run multiple times.' +); + +var a = [{ toString : 0 }]; + +try { + a.toString(); +} catch (e) { +} + +var caught = false; + +try { + a.toString(); +} catch (e) { +caught = true; +} + +shouldBeTrue("caught"); diff --git a/deps/v8/test/webkit/fast/js/toString-overrides-expected.txt b/deps/v8/test/webkit/fast/js/toString-overrides-expected.txt new file mode 100644 index 0000000..6bf5ae5 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/toString-overrides-expected.txt @@ -0,0 +1,39 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks for regression against 4147: Array.toString() and toLocaleString() improvements from KDE KJS. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS [1].toString() is '1' +PASS [1].toLocaleString() is 'toLocaleString' +FAIL [1].toLocaleString() should be 1. Threw exception TypeError: Property 'toLocaleString' of object [object Number] is not a function +PASS [/r/].toString() is 'toString2' +PASS [/r/].toLocaleString() is 'toLocaleString2' +FAIL [/r/].toLocaleString() should be toString2. Threw exception TypeError: Property 'toLocaleString' of object [object RegExp] is not a function +PASS caught is true +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/toString-overrides.js b/deps/v8/test/webkit/fast/js/toString-overrides.js new file mode 100644 index 0000000..cf27713 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/toString-overrides.js @@ -0,0 +1,65 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// 15.4 Array Objects +// (c) 2001 Harri Porten + +description( +'This test checks for regression against 4147: Array.toString() and toLocaleString() improvements from KDE KJS.' +); + +// backup +var backupNumberToString = Number.prototype.toString; +var backupNumberToLocaleString = Number.prototype.toLocaleString; +var backupRegExpToString = RegExp.prototype.toString; +var backupRegExpToLocaleString = RegExp.prototype.toLocaleString; + +// change functions +Number.prototype.toString = function() { return "toString"; } +Number.prototype.toLocaleString = function() { return "toLocaleString"; } +RegExp.prototype.toString = function() { return "toString2"; } +RegExp.prototype.toLocaleString = function() { return "toLocaleString2"; } + +// the tests +shouldBe("[1].toString()", "'1'"); +shouldBe("[1].toLocaleString()", "'toLocaleString'"); +Number.prototype.toLocaleString = "invalid"; +shouldBe("[1].toLocaleString()", "'1'"); +shouldBe("[/r/].toString()", "'toString2'"); +shouldBe("[/r/].toLocaleString()", "'toLocaleString2'"); +RegExp.prototype.toLocaleString = "invalid"; +shouldBe("[/r/].toLocaleString()", "'toString2'"); + +var caught = false; +try { +[{ toString : 0 }].toString(); +} catch (e) { +caught = true; +} +shouldBeTrue("caught"); + +// restore +Number.prototype.toString = backupNumberToString; +Number.prototype.toLocaleString = backupNumberToLocaleString; +RegExp.prototype.toString = backupRegExpToString; +RegExp.prototype.toLocaleString = backupRegExpToLocaleString; diff --git a/deps/v8/test/webkit/fast/regex/alternative-length-miscalculation-expected.txt b/deps/v8/test/webkit/fast/regex/alternative-length-miscalculation-expected.txt new file mode 100644 index 0000000..ff4e3a2 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/alternative-length-miscalculation-expected.txt @@ -0,0 +1,34 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This page tests for length miscalculations in regular expression processing. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS re.exec('a') is null +PASS re2.test('') is false +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/alternative-length-miscalculation.js b/deps/v8/test/webkit/fast/regex/alternative-length-miscalculation.js new file mode 100644 index 0000000..7602d5a --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/alternative-length-miscalculation.js @@ -0,0 +1,33 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"This page tests for length miscalculations in regular expression processing." +); + +var re = /b|[^b]/g; +re.lastIndex = 1; +shouldBe("re.exec('a')", "null"); + +var re2 = /[^a]|ab/; +shouldBe("re2.test('')", "false"); diff --git a/deps/v8/test/webkit/fast/regex/assertion-expected.txt b/deps/v8/test/webkit/fast/regex/assertion-expected.txt new file mode 100644 index 0000000..1bc1f41 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/assertion-expected.txt @@ -0,0 +1,69 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This page tests handling of parenthetical assertions. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS regex1.exec('xx') is ['xx','x'] +PASS regex2.exec('baaabaac') is ['baaabaac','ba',undefined,'abaac'] +PASS regex3.exec('aaab') is ['aab','a','aab'] +PASS regex4.exec('aaab') is ['aab','a','aab'] +PASS regex5.exec('P11') is ['P11','1','1'] +PASS regex6.exec('ababbbcbc') is ['ababb','bb','b'] +PASS regex7.exec('xx') is ['xx','x'] +PASS regex8.exec('xx') is ['xx','x','x'] +PASS regex9.exec('xy') is null +PASS regex10.exec('xy') is null +PASS regex11.exec('xy') is null +PASS regex12.exec('x') is null +PASS regex12.exec('xx') is ['xx','x'] +PASS regex12.exec('xxy') is ['xx','x'] +PASS regex13.exec('xzzzx') is ['xzzzx','x'] +PASS regex13.exec('xzzzxy') is ['xzzzx','x'] +PASS regex14.exec('aabc') is ['aabc','a','bc'] +PASS regex14.exec('aabcx') is ['aabc','a','bc'] +PASS regex15.exec('aabc') is ['aabc','a','bc'] +PASS regex15.exec('aabcx') is ['aabc','a','bc'] +PASS regex16.exec('ab') is null +PASS regex16.exec('abc') is ['abc','bc'] +PASS regex17.exec('ab') is ['a','ab'] +PASS regex17.exec('abc') is ['a','ab'] +PASS regex18.exec('x') is ['x',''] +PASS regex18.exec('xx') is ['x','xx'] +PASS regex18.exec('xxx') is ['x','xx'] +PASS regex19.exec('x') is ['x','',undefined] +PASS regex19.exec('xx') is ['x','xx','xx'] +PASS regex19.exec('xxx') is ['x','xx','xx'] +PASS regex20.exec('x') is null +PASS regex20.exec('xx') is ['x','xx'] +PASS regex20.exec('xxx') is ['x','xx'] +PASS regex21.exec('aab') is ['aab'] +PASS regex22.exec('55up') is null +PASS regex23.exec('ax') is null +PASS regex24.exec('x') is null +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/assertion.js b/deps/v8/test/webkit/fast/regex/assertion.js new file mode 100644 index 0000000..3d980ce --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/assertion.js @@ -0,0 +1,110 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description("This page tests handling of parenthetical assertions."); + +var regex1 = /(x)(?=\1)x/; +shouldBe("regex1.exec('xx')", "['xx','x']"); + +var regex2 = /(.*?)a(?!(a+)b\2c)\2(.*)/; +shouldBe("regex2.exec('baaabaac')", "['baaabaac','ba',undefined,'abaac']"); + +var regex3 = /(?=(a+?))(\1ab)/; +shouldBe("regex3.exec('aaab')", "['aab','a','aab']"); + +var regex4 = /(?=(a+?))(\1ab)/; +shouldBe("regex4.exec('aaab')", "['aab','a','aab']"); + +var regex5 = /^P([1-6])(?=\1)([1-6])$/; +shouldBe("regex5.exec('P11')", "['P11','1','1']"); + +var regex6 = /(([a-c])b*?\2)*/; +shouldBe("regex6.exec('ababbbcbc')", "['ababb','bb','b']"); + +var regex7 = /(x)(?=x)x/; +shouldBe("regex7.exec('xx')", "['xx','x']"); + +var regex8 = /(x)(\1)/; +shouldBe("regex8.exec('xx')", "['xx','x','x']"); + +var regex9 = /(x)(?=\1)x/; +shouldBeNull("regex9.exec('xy')"); + +var regex10 = /(x)(?=x)x/; +shouldBeNull("regex10.exec('xy')"); + +var regex11 = /(x)(\1)/; +shouldBeNull("regex11.exec('xy')"); + +var regex12 = /(x)(?=\1)x/; +shouldBeNull("regex12.exec('x')"); +shouldBe("regex12.exec('xx')", "['xx','x']"); +shouldBe("regex12.exec('xxy')", "['xx','x']"); + +var regex13 = /(x)zzz(?=\1)x/; +shouldBe("regex13.exec('xzzzx')", "['xzzzx','x']"); +shouldBe("regex13.exec('xzzzxy')", "['xzzzx','x']"); + +var regex14 = /(a)\1(?=(b*c))bc/; +shouldBe("regex14.exec('aabc')", "['aabc','a','bc']"); +shouldBe("regex14.exec('aabcx')", "['aabc','a','bc']"); + +var regex15 = /(a)a(?=(b*c))bc/; +shouldBe("regex15.exec('aabc')", "['aabc','a','bc']"); +shouldBe("regex15.exec('aabcx')", "['aabc','a','bc']"); + +var regex16 = /a(?=(b*c))bc/; +shouldBeNull("regex16.exec('ab')"); +shouldBe("regex16.exec('abc')", "['abc','bc']"); + +var regex17 = /(?=((?:ab)*))a/; +shouldBe("regex17.exec('ab')", "['a','ab']"); +shouldBe("regex17.exec('abc')", "['a','ab']"); + +var regex18 = /(?=((?:xx)*))x/; +shouldBe("regex18.exec('x')", "['x','']"); +shouldBe("regex18.exec('xx')", "['x','xx']"); +shouldBe("regex18.exec('xxx')", "['x','xx']"); + +var regex19 = /(?=((xx)*))x/; +shouldBe("regex19.exec('x')", "['x','',undefined]"); +shouldBe("regex19.exec('xx')", "['x','xx','xx']"); +shouldBe("regex19.exec('xxx')", "['x','xx','xx']"); + +var regex20 = /(?=(xx))+x/; +shouldBeNull("regex20.exec('x')"); +shouldBe("regex20.exec('xx')", "['x','xx']"); +shouldBe("regex20.exec('xxx')", "['x','xx']"); + +var regex21 = /(?=a+b)aab/; +shouldBe("regex21.exec('aab')", "['aab']"); + +var regex22 = /(?!(u|m{0,}g+)u{1,}|2{2,}!1%n|(?!K|(?=y)|(?=ip))+?)(?=(?=(((?:7))*?)*?))p/m; +shouldBe("regex22.exec('55up')", "null"); + +var regex23 = /(?=(a)b|c?)()*d/; +shouldBe("regex23.exec('ax')", "null"); + +var regex24 = /(?=a|b?)c/; +shouldBe("regex24.exec('x')", "null"); + diff --git a/deps/v8/test/webkit/fast/regex/constructor-expected.txt b/deps/v8/test/webkit/fast/regex/constructor-expected.txt new file mode 100644 index 0000000..e59c322 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/constructor-expected.txt @@ -0,0 +1,36 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks use of the regexp constructor. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS re === RegExp(re) is true +PASS re !== new RegExp(re) is true +PASS re === RegExp(re,'i') threw exception TypeError: Cannot supply flags when constructing one RegExp from another. +PASS re !== new RegExp(re,'i') threw exception TypeError: Cannot supply flags when constructing one RegExp from another. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/constructor.js b/deps/v8/test/webkit/fast/regex/constructor.js new file mode 100644 index 0000000..9d35245 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/constructor.js @@ -0,0 +1,32 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description("This test checks use of the regexp constructor."); + +var re = /abc/; + +shouldBeTrue("re === RegExp(re)"); +shouldBeTrue("re !== new RegExp(re)"); +shouldThrow("re === RegExp(re,'i')"); +shouldThrow("re !== new RegExp(re,'i')"); + diff --git a/deps/v8/test/webkit/fast/regex/dotstar-expected.txt b/deps/v8/test/webkit/fast/regex/dotstar-expected.txt new file mode 100644 index 0000000..1014967 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/dotstar-expected.txt @@ -0,0 +1,141 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This page tests handling of parentheses subexpressions. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS regexp1.exec('test') is null +PASS regexp1.exec('blah') is ['blah'] +PASS regexp1.exec('1blah') is ['1blah'] +PASS regexp1.exec('blah1') is ['blah1'] +PASS regexp1.exec('blah blah blah') is ['blah blah blah'] +PASS regexp1.exec('blah\nsecond') is ['blah'] +PASS regexp1.exec('first\nblah') is ['blah'] +PASS regexp1.exec('first\nblah\nthird') is ['blah'] +PASS regexp1.exec('first\nblah2\nblah3') is ['blah2'] +PASS regexp2.exec('test') is null +PASS regexp2.exec('blah') is ['blah'] +PASS regexp2.exec('1blah') is ['1blah'] +PASS regexp2.exec('blah1') is ['blah1'] +PASS regexp2.exec('blah blah blah') is ['blah blah blah'] +PASS regexp2.exec('blah\nsecond') is ['blah'] +PASS regexp2.exec('first\nblah') is null +PASS regexp2.exec('first\nblah\nthird') is null +PASS regexp2.exec('first\nblah2\nblah3') is null +PASS regexp3.exec('test') is null +PASS regexp3.exec('blah') is ['blah'] +PASS regexp3.exec('1blah') is ['1blah'] +PASS regexp3.exec('blah1') is ['blah1'] +PASS regexp3.exec('blah blah blah') is ['blah blah blah'] +PASS regexp3.exec('blah\nsecond') is null +PASS regexp3.exec('first\nblah') is ['blah'] +PASS regexp3.exec('first\nblah\nthird') is null +PASS regexp3.exec('first\nblah2\nblah3') is ['blah3'] +PASS regexp4.exec('test') is null +PASS regexp4.exec('blah') is ['blah'] +PASS regexp4.exec('1blah') is ['1blah'] +PASS regexp4.exec('blah1') is ['blah1'] +PASS regexp4.exec('blah blah blah') is ['blah blah blah'] +PASS regexp4.exec('blah\nsecond') is null +PASS regexp4.exec('first\nblah') is null +PASS regexp4.exec('first\nblah\nthird') is null +PASS regexp4.exec('first\nblah2\nblah3') is null +PASS regexp5.exec('test') is null +PASS regexp5.exec('blah') is ['blah'] +PASS regexp5.exec('1blah') is ['1blah'] +PASS regexp5.exec('blah1') is ['blah1'] +PASS regexp5.exec('blah blah blah') is ['blah blah blah'] +PASS regexp5.exec('blah\nsecond') is ['blah'] +PASS regexp5.exec('first\nblah') is ['blah'] +PASS regexp5.exec('first\nblah\nthird') is ['blah'] +PASS regexp5.exec('first\nblah2\nblah3') is ['blah2'] +PASS regexp6.exec('test') is null +PASS regexp6.exec('blah') is ['blah'] +PASS regexp6.exec('1blah') is ['1blah'] +PASS regexp6.exec('blah1') is ['blah'] +PASS regexp6.exec('blah blah blah') is ['blah blah blah'] +PASS regexp6.exec('blah\nsecond') is ['blah'] +PASS regexp6.exec('first\nblah') is ['blah'] +PASS regexp6.exec('first\nblah\nthird') is ['blah'] +PASS regexp6.exec('first\nblah2\nblah3') is ['blah'] +PASS regexp7.exec('test') is null +PASS regexp7.exec('blah') is ['blah'] +PASS regexp7.exec('1blah') is ['1blah'] +PASS regexp7.exec('blah1') is ['blah1'] +PASS regexp7.exec('blah blah blah') is ['blah blah blah'] +PASS regexp7.exec('blah\nsecond') is null +PASS regexp7.exec('first\nblah') is null +PASS regexp7.exec('first\nblah\nthird') is null +PASS regexp7.exec('first\nblah2\nblah3') is null +PASS regexp8.exec('test') is null +PASS regexp8.exec('blah') is ['blah',''] +PASS regexp8.exec('1blah') is ['1blah','1'] +PASS regexp8.exec('blah1') is ['blah1',''] +PASS regexp8.exec('blah blah blah') is ['blah blah blah','blah blah '] +PASS regexp8.exec('blah\nsecond') is null +PASS regexp8.exec('first\nblah') is null +PASS regexp8.exec('first\nblah\nthird') is null +PASS regexp8.exec('first\nblah2\nblah3') is null +PASS regexp9.exec('test') is null +PASS regexp9.exec('blah') is ['blah'] +PASS regexp9.exec('1blah') is ['1blah'] +PASS regexp9.exec('blah1') is ['blah1'] +PASS regexp9.exec('blah blah blah') is ['blah blah blah'] +PASS regexp9.exec('blah\nsecond') is ['blah'] +PASS regexp9.exec('first\nblah') is ['blah'] +PASS regexp9.exec('first\nblah\nthird') is ['blah'] +PASS regexp9.exec('first\nblah2\nblah3') is ['blah2'] +PASS regexp10.exec('test') is null +PASS regexp10.exec('blah') is ['blah'] +PASS regexp10.exec('1blah') is ['1blah'] +PASS regexp10.exec('blah1') is ['blah1'] +PASS regexp10.exec('blah blah blah') is ['blah blah blah'] +PASS regexp10.exec('blah\nsecond') is ['blah'] +PASS regexp10.exec('first\nblah') is ['blah'] +PASS regexp10.exec('first\nblah\nthird') is ['blah'] +PASS regexp10.exec('first\nblah2\nblah3') is ['blah2'] +PASS regexp11.exec('test') is null +PASS regexp11.exec('blah') is ['blah'] +PASS regexp11.exec('1blah') is ['1blah'] +PASS regexp11.exec('blah1') is ['blah1'] +PASS regexp11.exec('blah blah blah') is ['blah blah blah'] +PASS regexp11.exec('blah\nsecond') is null +PASS regexp11.exec('first\nblah') is ['blah'] +PASS regexp11.exec('first\nblah\nthird') is null +PASS regexp11.exec('first\nblah2\nblah3') is ['blah3'] +PASS regexp12.exec('test') is null +PASS regexp12.exec('blah') is ['blah'] +PASS regexp12.exec('1blah') is ['1blah'] +PASS regexp12.exec('blah1') is ['blah1'] +PASS regexp12.exec('blah blah blah') is ['blah blah blah'] +PASS regexp12.exec('blah\nsecond') is null +PASS regexp12.exec('first\nblah') is ['blah'] +PASS regexp12.exec('first\nblah\nthird') is null +PASS regexp12.exec('first\nblah2\nblah3') is ['blah3'] +PASS regexp13.exec('abc\n123') is ['abc\n123'] +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/dotstar.js b/deps/v8/test/webkit/fast/regex/dotstar.js new file mode 100644 index 0000000..2069637 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/dotstar.js @@ -0,0 +1,160 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description("This page tests handling of parentheses subexpressions."); + +var regexp1 = /.*blah.*/; +shouldBeNull("regexp1.exec('test')"); +shouldBe("regexp1.exec('blah')", "['blah']"); +shouldBe("regexp1.exec('1blah')", "['1blah']"); +shouldBe("regexp1.exec('blah1')", "['blah1']"); +shouldBe("regexp1.exec('blah blah blah')", "['blah blah blah']"); +shouldBe("regexp1.exec('blah\\nsecond')", "['blah']"); +shouldBe("regexp1.exec('first\\nblah')", "['blah']"); +shouldBe("regexp1.exec('first\\nblah\\nthird')", "['blah']"); +shouldBe("regexp1.exec('first\\nblah2\\nblah3')", "['blah2']"); + +var regexp2 = /^.*blah.*/; +shouldBeNull("regexp2.exec('test')"); +shouldBe("regexp2.exec('blah')", "['blah']"); +shouldBe("regexp2.exec('1blah')", "['1blah']"); +shouldBe("regexp2.exec('blah1')", "['blah1']"); +shouldBe("regexp2.exec('blah blah blah')", "['blah blah blah']"); +shouldBe("regexp2.exec('blah\\nsecond')", "['blah']"); +shouldBeNull("regexp2.exec('first\\nblah')"); +shouldBeNull("regexp2.exec('first\\nblah\\nthird')"); +shouldBeNull("regexp2.exec('first\\nblah2\\nblah3')"); + +var regexp3 = /.*blah.*$/; +shouldBeNull("regexp3.exec('test')"); +shouldBe("regexp3.exec('blah')", "['blah']"); +shouldBe("regexp3.exec('1blah')", "['1blah']"); +shouldBe("regexp3.exec('blah1')", "['blah1']"); +shouldBe("regexp3.exec('blah blah blah')", "['blah blah blah']"); +shouldBeNull("regexp3.exec('blah\\nsecond')"); +shouldBe("regexp3.exec('first\\nblah')", "['blah']"); +shouldBeNull("regexp3.exec('first\\nblah\\nthird')"); +shouldBe("regexp3.exec('first\\nblah2\\nblah3')", "['blah3']"); + +var regexp4 = /^.*blah.*$/; +shouldBeNull("regexp4.exec('test')"); +shouldBe("regexp4.exec('blah')", "['blah']"); +shouldBe("regexp4.exec('1blah')", "['1blah']"); +shouldBe("regexp4.exec('blah1')", "['blah1']"); +shouldBe("regexp4.exec('blah blah blah')", "['blah blah blah']"); +shouldBeNull("regexp4.exec('blah\\nsecond')"); +shouldBeNull("regexp4.exec('first\\nblah')"); +shouldBeNull("regexp4.exec('first\\nblah\\nthird')"); +shouldBeNull("regexp4.exec('first\\nblah2\\nblah3')"); + +var regexp5 = /.*?blah.*/; +shouldBeNull("regexp5.exec('test')"); +shouldBe("regexp5.exec('blah')", "['blah']"); +shouldBe("regexp5.exec('1blah')", "['1blah']"); +shouldBe("regexp5.exec('blah1')", "['blah1']"); +shouldBe("regexp5.exec('blah blah blah')", "['blah blah blah']"); +shouldBe("regexp5.exec('blah\\nsecond')", "['blah']"); +shouldBe("regexp5.exec('first\\nblah')", "['blah']"); +shouldBe("regexp5.exec('first\\nblah\\nthird')", "['blah']"); +shouldBe("regexp5.exec('first\\nblah2\\nblah3')", "['blah2']"); + +var regexp6 = /.*blah.*?/; +shouldBeNull("regexp6.exec('test')"); +shouldBe("regexp6.exec('blah')", "['blah']"); +shouldBe("regexp6.exec('1blah')", "['1blah']"); +shouldBe("regexp6.exec('blah1')", "['blah']"); +shouldBe("regexp6.exec('blah blah blah')", "['blah blah blah']"); +shouldBe("regexp6.exec('blah\\nsecond')", "['blah']"); +shouldBe("regexp6.exec('first\\nblah')", "['blah']"); +shouldBe("regexp6.exec('first\\nblah\\nthird')", "['blah']"); +shouldBe("regexp6.exec('first\\nblah2\\nblah3')", "['blah']"); + +var regexp7 = /^.*?blah.*?$/; +shouldBeNull("regexp7.exec('test')"); +shouldBe("regexp7.exec('blah')", "['blah']"); +shouldBe("regexp7.exec('1blah')", "['1blah']"); +shouldBe("regexp7.exec('blah1')", "['blah1']"); +shouldBe("regexp7.exec('blah blah blah')", "['blah blah blah']"); +shouldBeNull("regexp7.exec('blah\\nsecond')"); +shouldBeNull("regexp7.exec('first\\nblah')"); +shouldBeNull("regexp7.exec('first\\nblah\\nthird')"); +shouldBeNull("regexp7.exec('first\\nblah2\\nblah3')"); + +var regexp8 = /^(.*)blah.*$/; +shouldBeNull("regexp8.exec('test')"); +shouldBe("regexp8.exec('blah')", "['blah','']"); +shouldBe("regexp8.exec('1blah')", "['1blah','1']"); +shouldBe("regexp8.exec('blah1')", "['blah1','']"); +shouldBe("regexp8.exec('blah blah blah')", "['blah blah blah','blah blah ']"); +shouldBeNull("regexp8.exec('blah\\nsecond')"); +shouldBeNull("regexp8.exec('first\\nblah')"); +shouldBeNull("regexp8.exec('first\\nblah\\nthird')"); +shouldBeNull("regexp8.exec('first\\nblah2\\nblah3')"); + +var regexp9 = /.*blah.*/m; +shouldBeNull("regexp9.exec('test')"); +shouldBe("regexp9.exec('blah')", "['blah']"); +shouldBe("regexp9.exec('1blah')", "['1blah']"); +shouldBe("regexp9.exec('blah1')", "['blah1']"); +shouldBe("regexp9.exec('blah blah blah')", "['blah blah blah']"); +shouldBe("regexp9.exec('blah\\nsecond')", "['blah']"); +shouldBe("regexp9.exec('first\\nblah')", "['blah']"); +shouldBe("regexp9.exec('first\\nblah\\nthird')", "['blah']"); +shouldBe("regexp9.exec('first\\nblah2\\nblah3')", "['blah2']"); + +var regexp10 = /^.*blah.*/m; +shouldBeNull("regexp10.exec('test')"); +shouldBe("regexp10.exec('blah')", "['blah']"); +shouldBe("regexp10.exec('1blah')", "['1blah']"); +shouldBe("regexp10.exec('blah1')", "['blah1']"); +shouldBe("regexp10.exec('blah blah blah')", "['blah blah blah']"); +shouldBe("regexp10.exec('blah\\nsecond')", "['blah']"); +shouldBe("regexp10.exec('first\\nblah')", "['blah']"); +shouldBe("regexp10.exec('first\\nblah\\nthird')", "['blah']"); +shouldBe("regexp10.exec('first\\nblah2\\nblah3')", "['blah2']"); + +var regexp11 = /.*(?:blah).*$/; +shouldBeNull("regexp11.exec('test')"); +shouldBe("regexp11.exec('blah')", "['blah']"); +shouldBe("regexp11.exec('1blah')", "['1blah']"); +shouldBe("regexp11.exec('blah1')", "['blah1']"); +shouldBe("regexp11.exec('blah blah blah')", "['blah blah blah']"); +shouldBeNull("regexp11.exec('blah\\nsecond')"); +shouldBe("regexp11.exec('first\\nblah')", "['blah']"); +shouldBeNull("regexp11.exec('first\\nblah\\nthird')"); +shouldBe("regexp11.exec('first\\nblah2\\nblah3')", "['blah3']"); + +var regexp12 = /.*(?:blah|buzz|bang).*$/; +shouldBeNull("regexp12.exec('test')"); +shouldBe("regexp12.exec('blah')", "['blah']"); +shouldBe("regexp12.exec('1blah')", "['1blah']"); +shouldBe("regexp12.exec('blah1')", "['blah1']"); +shouldBe("regexp12.exec('blah blah blah')", "['blah blah blah']"); +shouldBeNull("regexp12.exec('blah\\nsecond')"); +shouldBe("regexp12.exec('first\\nblah')", "['blah']"); +shouldBeNull("regexp12.exec('first\\nblah\\nthird')"); +shouldBe("regexp12.exec('first\\nblah2\\nblah3')", "['blah3']"); + +var regexp13 = /.*\n\d+.*/; +shouldBe("regexp13.exec('abc\\n123')", "['abc\\n123']"); + diff --git a/deps/v8/test/webkit/fast/regex/early-acid3-86-expected.txt b/deps/v8/test/webkit/fast/regex/early-acid3-86-expected.txt new file mode 100644 index 0000000..4bc1fe2 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/early-acid3-86-expected.txt @@ -0,0 +1,35 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Test that covers capturing brackets, and was adapted from a part of an early version of Acid3. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS /TA[])]/.exec('TA]') threw exception SyntaxError: Invalid regular expression: /TA[])]/: Unmatched ')'. +PASS /[]/.exec('') is null +PASS /(\3)(\1)(a)/.exec('cat').toString() is 'a,,,a' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/early-acid3-86.js b/deps/v8/test/webkit/fast/regex/early-acid3-86.js new file mode 100644 index 0000000..488364f --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/early-acid3-86.js @@ -0,0 +1,33 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +'Test that covers capturing brackets, and was adapted from a part of an early version of Acid3.' +); + +// JS regexps aren't like Perl regexps, if their character +// classes start with a ] that means they're empty. So this +// is a syntax error; if we get here it's a bug. +shouldThrow("/TA[])]/.exec('TA]')"); +shouldBe("/[]/.exec('')", "null"); +shouldBe("/(\\3)(\\1)(a)/.exec('cat').toString()", "'a,,,a'"); diff --git a/deps/v8/test/webkit/fast/regex/ecma-regex-examples-expected.txt b/deps/v8/test/webkit/fast/regex/ecma-regex-examples-expected.txt new file mode 100644 index 0000000..7ac4113 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/ecma-regex-examples-expected.txt @@ -0,0 +1,44 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This page tests the regex examples from the ECMA-262 specification. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS regex01.exec("abc") is ["a"] +PASS regex02.exec("abc") is ["abc", "a", "a", undefined, "bc", undefined, "bc"] +PASS regex03.exec("abcdefghi") is ["abcde"] +PASS regex04.exec("abcdefghi") is ["abc"] +PASS regex05.exec("aabaac") is ["aaba", "ba"] +PASS "aaaaaaaaaa,aaaaaaaaaaaaaaa".replace(regex06,"$1") is "aaaaa" +PASS regex07.exec("zaacbbbcac") is ["zaacbbbcac", "z", "ac", "a", undefined, "c"] +PASS regex08.exec("b") is ["", undefined] +PASS regex09.exec("baaaac") is ["b", ""] +PASS regex10.exec("baaabac") is ["", "aaa"] +PASS regex11.exec("baaabac") is ["aba", "a"] +PASS regex12.exec("baaabaac") is ["baaabaac", "ba", undefined, "abaac"] +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/ecma-regex-examples.js b/deps/v8/test/webkit/fast/regex/ecma-regex-examples.js new file mode 100644 index 0000000..70ecb6b --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/ecma-regex-examples.js @@ -0,0 +1,62 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"This page tests the regex examples from the ECMA-262 specification." +); + +var regex01 = /a|ab/; +shouldBe('regex01.exec("abc")', '["a"]'); + +var regex02 = /((a)|(ab))((c)|(bc))/; +shouldBe('regex02.exec("abc")', '["abc", "a", "a", undefined, "bc", undefined, "bc"]'); + +var regex03 = /a[a-z]{2,4}/; +shouldBe('regex03.exec("abcdefghi")', '["abcde"]'); + +var regex04 = /a[a-z]{2,4}?/; +shouldBe('regex04.exec("abcdefghi")', '["abc"]'); + +var regex05 = /(aa|aabaac|ba|b|c)*/; +shouldBe('regex05.exec("aabaac")', '["aaba", "ba"]'); + +var regex06 = /^(a+)\1*,\1+$/; +shouldBe('"aaaaaaaaaa,aaaaaaaaaaaaaaa".replace(regex06,"$1")', '"aaaaa"'); + +var regex07 = /(z)((a+)?(b+)?(c))*/; +shouldBe('regex07.exec("zaacbbbcac")', '["zaacbbbcac", "z", "ac", "a", undefined, "c"]'); + +var regex08 = /(a*)*/; +shouldBe('regex08.exec("b")', '["", undefined]'); + +var regex09 = /(a*)b\1+/; +shouldBe('regex09.exec("baaaac")', '["b", ""]'); + +var regex10 = /(?=(a+))/; +shouldBe('regex10.exec("baaabac")', '["", "aaa"]'); + +var regex11 = /(?=(a+))a*b\1/; +shouldBe('regex11.exec("baaabac")', '["aba", "a"]'); + +var regex12 = /(.*?)a(?!(a+)b\2c)\2(.*)/; +shouldBe('regex12.exec("baaabaac")', '["baaabaac", "ba", undefined, "abaac"]'); diff --git a/deps/v8/test/webkit/fast/regex/invalid-range-in-class-expected.txt b/deps/v8/test/webkit/fast/regex/invalid-range-in-class-expected.txt new file mode 100644 index 0000000..6268eee --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/invalid-range-in-class-expected.txt @@ -0,0 +1,43 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This page tests invalid character ranges in character classes. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS /[a-c]+/.exec("-acbd"); is ["acb"] +PASS /[a\-c]+/.exec("-acbd") is ["-ac"] +PASS /[c-a]+/.exec("-acbd"); threw exception SyntaxError: Invalid regular expression: /[c-a]+/: Range out of order in character class. +PASS /[\d-x]+/.exec("1-3xy"); is ["1-3x"] +PASS /[x-\d]+/.exec("1-3xy"); is ["1-3x"] +PASS /[\d-\d]+/.exec("1-3xy"); is ["1-3"] +PASS /[\d-a-z]+/.exec("az1-3y"); is ["az1-3"] +PASS /[\d\-x]+/.exec("1-3xy"); is ["1-3x"] +PASS /[x\-\d]+/.exec("1-3xy"); is ["1-3x"] +PASS /[\d\-\d]+/.exec("1-3xy"); is ["1-3"] +PASS /[\d-]+/.exec("1-3xy") is ["1-3"] +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/invalid-range-in-class.js b/deps/v8/test/webkit/fast/regex/invalid-range-in-class.js new file mode 100644 index 0000000..35bf32d --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/invalid-range-in-class.js @@ -0,0 +1,50 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"This page tests invalid character ranges in character classes." +); + +// These test a basic range / non range. +shouldBe('/[a-c]+/.exec("-acbd");', '["acb"]'); +shouldBe('/[a\\-c]+/.exec("-acbd")', '["-ac"]'); + +// A reverse-range is invalid. +shouldThrow('/[c-a]+/.exec("-acbd");'); + +// A character-class in a range is invalid, according to ECMA-262, but we allow it. +shouldBe('/[\\d-x]+/.exec("1-3xy");', '["1-3x"]'); +shouldBe('/[x-\\d]+/.exec("1-3xy");', '["1-3x"]'); +shouldBe('/[\\d-\\d]+/.exec("1-3xy");', '["1-3"]'); + +// Whilst we break with ECMA-262's definition of CharacterRange, we do comply with +// the grammar, and as such in the following regex a-z cannot be matched as a range. +shouldBe('/[\\d-a-z]+/.exec("az1-3y");', '["az1-3"]'); + +// An escaped hypen should not be confused for an invalid range. +shouldBe('/[\\d\\-x]+/.exec("1-3xy");', '["1-3x"]'); +shouldBe('/[x\\-\\d]+/.exec("1-3xy");', '["1-3x"]'); +shouldBe('/[\\d\\-\\d]+/.exec("1-3xy");', '["1-3"]'); + +// A hyphen after a character-class is not invalid. +shouldBe('/[\\d-]+/.exec("1-3xy")', '["1-3"]'); diff --git a/deps/v8/test/webkit/fast/regex/lastIndex-expected.txt b/deps/v8/test/webkit/fast/regex/lastIndex-expected.txt new file mode 100644 index 0000000..1e0959c --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/lastIndex-expected.txt @@ -0,0 +1,53 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This page tests that a RegExp object's lastIndex behaves like a regular property. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS delete /x/.lastIndex is false +PASS 'use strict'; delete /x/.lastIndex threw exception TypeError: Cannot delete property 'lastIndex' of [object RegExp]. +PASS 'lastIndex' in /x/ is true +PASS for (property in /x/) if (property === 'lastIndex') throw false; true is true +PASS var re = /x/; re.lastIndex = re; re.lastIndex === re is true +PASS Object.defineProperty(/x/, {get:function(){}}) threw exception TypeError: Property description must be an object: undefined. +PASS Object.defineProperty(/x/, 'lastIndex', {enumerable:true}); true threw exception TypeError: Cannot redefine property: lastIndex. +PASS Object.defineProperty(/x/, 'lastIndex', {enumerable:false}); true is true +PASS Object.defineProperty(/x/, 'lastIndex', {configurable:true}); true threw exception TypeError: Cannot redefine property: lastIndex. +PASS Object.defineProperty(/x/, 'lastIndex', {configurable:false}); true is true +PASS var re = Object.defineProperty(/x/, 'lastIndex', {writable:true}); re.lastIndex = 42; re.lastIndex is 42 +PASS var re = Object.defineProperty(/x/, 'lastIndex', {writable:false}); re.lastIndex = 42; re.lastIndex is 0 +PASS var re = Object.defineProperty(/x/, 'lastIndex', {value:42}); re.lastIndex is 42 +PASS Object.defineProperty(Object.defineProperty(/x/, 'lastIndex', {writable:false}), 'lastIndex', {writable:true}); true threw exception TypeError: Cannot redefine property: lastIndex. +PASS Object.defineProperty(Object.defineProperty(/x/, 'lastIndex', {writable:false}), 'lastIndex', {value:42}); true threw exception TypeError: Cannot redefine property: lastIndex. +PASS Object.defineProperty(Object.defineProperty(/x/, 'lastIndex', {writable:false}), 'lastIndex', {value:0}); true is true +PASS Object.defineProperty(/x/, 'lastIndex', {writable:false}).exec('') is null +PASS Object.defineProperty(/x/, 'lastIndex', {writable:false}).exec('x') is ["x"] +FAIL Object.defineProperty(/x/g, 'lastIndex', {writable:false}).exec('') should throw an exception. Was null. +FAIL Object.defineProperty(/x/g, 'lastIndex', {writable:false}).exec('x') should throw an exception. Was x. +PASS var re = /x/; Object.freeze(re); Object.isFrozen(re); is true +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/lastIndex.js b/deps/v8/test/webkit/fast/regex/lastIndex.js new file mode 100644 index 0000000..143631d --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/lastIndex.js @@ -0,0 +1,71 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"This page tests that a RegExp object's lastIndex behaves like a regular property." +); + +// lastIndex is not configurable +shouldBeFalse("delete /x/.lastIndex"); +shouldThrow("'use strict'; delete /x/.lastIndex"); + +// lastIndex is not enumerable +shouldBeTrue("'lastIndex' in /x/"); +shouldBeTrue("for (property in /x/) if (property === 'lastIndex') throw false; true"); + +// lastIndex is writable +shouldBeTrue("var re = /x/; re.lastIndex = re; re.lastIndex === re"); + +// Cannot redefine lastIndex as an accessor +shouldThrow("Object.defineProperty(/x/, {get:function(){}})"); + +// Cannot redefine lastIndex as enumerable +shouldThrow("Object.defineProperty(/x/, 'lastIndex', {enumerable:true}); true"); +shouldBeTrue("Object.defineProperty(/x/, 'lastIndex', {enumerable:false}); true"); + +// Cannot redefine lastIndex as configurable +shouldThrow("Object.defineProperty(/x/, 'lastIndex', {configurable:true}); true"); +shouldBeTrue("Object.defineProperty(/x/, 'lastIndex', {configurable:false}); true"); + +// Can redefine lastIndex as read-only +shouldBe("var re = Object.defineProperty(/x/, 'lastIndex', {writable:true}); re.lastIndex = 42; re.lastIndex", '42'); +shouldBe("var re = Object.defineProperty(/x/, 'lastIndex', {writable:false}); re.lastIndex = 42; re.lastIndex", '0'); + +// Can redefine the value +shouldBe("var re = Object.defineProperty(/x/, 'lastIndex', {value:42}); re.lastIndex", '42'); + +// Cannot redefine read-only lastIndex as writable +shouldThrow("Object.defineProperty(Object.defineProperty(/x/, 'lastIndex', {writable:false}), 'lastIndex', {writable:true}); true"); + +// Can only redefine the value of a read-only lastIndex as the current value +shouldThrow("Object.defineProperty(Object.defineProperty(/x/, 'lastIndex', {writable:false}), 'lastIndex', {value:42}); true"); +shouldBeTrue("Object.defineProperty(Object.defineProperty(/x/, 'lastIndex', {writable:false}), 'lastIndex', {value:0}); true"); + +// Trying to run a global regular expression should throw, if lastIndex is read-only +shouldBe("Object.defineProperty(/x/, 'lastIndex', {writable:false}).exec('')", 'null'); +shouldBe("Object.defineProperty(/x/, 'lastIndex', {writable:false}).exec('x')", '["x"]'); +shouldThrow("Object.defineProperty(/x/g, 'lastIndex', {writable:false}).exec('')"); +shouldThrow("Object.defineProperty(/x/g, 'lastIndex', {writable:false}).exec('x')"); + +// Should be able to freeze a regular expression object. +shouldBeTrue("var re = /x/; Object.freeze(re); Object.isFrozen(re);"); diff --git a/deps/v8/test/webkit/fast/regex/malformed-escapes-expected.txt b/deps/v8/test/webkit/fast/regex/malformed-escapes-expected.txt new file mode 100644 index 0000000..0b3e2cf --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/malformed-escapes-expected.txt @@ -0,0 +1,65 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This page tests handling of malformed escape sequences. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + + +Testing regexp: /\ug/gm +PASS regexp.test('ug') is true +PASS regexp.lastIndex is 2 + +Testing regexp: /\xg/gm +PASS regexp.test('xg') is true +PASS regexp.lastIndex is 2 + +Testing regexp: /\c_/gm +PASS regexp.test('\\c_') is true +PASS regexp.lastIndex is 3 + +Testing regexp: /[\B]/gm +PASS regexp.test('B') is true +PASS regexp.lastIndex is 1 + +Testing regexp: /[\b]/gm +PASS regexp.test('\b') is true +PASS regexp.lastIndex is 1 + +Testing regexp: /\8/gm +PASS regexp.test('\\8') is true +PASS regexp.lastIndex is 2 + +Testing regexp: /^[\c]$/ +PASS regexp.test('c') is true + +Testing regexp: /^[\c_]$/ +PASS regexp.test('c') is false + +Testing regexp: /^[\c]]$/ +PASS regexp.test('c]') is true +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/malformed-escapes.js b/deps/v8/test/webkit/fast/regex/malformed-escapes.js new file mode 100644 index 0000000..bf03683 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/malformed-escapes.js @@ -0,0 +1,70 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"This page tests handling of malformed escape sequences." +); + +var regexp; + +regexp = /\ug/gm; +debug("\nTesting regexp: " + regexp); +shouldBeTrue("regexp.test('ug')"); +shouldBe("regexp.lastIndex", "2"); + +regexp = /\xg/gm; +debug("\nTesting regexp: " + regexp); +shouldBeTrue("regexp.test('xg')"); +shouldBe("regexp.lastIndex", "2"); + +regexp = /\c_/gm; +debug("\nTesting regexp: " + regexp); +shouldBeTrue("regexp.test('\\\\c_')"); +shouldBe("regexp.lastIndex", "3"); + +regexp = /[\B]/gm; +debug("\nTesting regexp: " + regexp); +shouldBeTrue("regexp.test('B')"); +shouldBe("regexp.lastIndex", "1"); + +regexp = /[\b]/gm; +debug("\nTesting regexp: " + regexp); +shouldBeTrue("regexp.test('\\b')"); +shouldBe("regexp.lastIndex", "1"); + +regexp = /\8/gm; +debug("\nTesting regexp: " + regexp); +shouldBeTrue("regexp.test('\\\\8')"); +shouldBe("regexp.lastIndex", "2"); + +regexp = /^[\c]$/; +debug("\nTesting regexp: " + regexp); +shouldBeTrue("regexp.test('c')"); + +regexp = /^[\c_]$/; +debug("\nTesting regexp: " + regexp); +shouldBeFalse("regexp.test('c')"); + +regexp = /^[\c]]$/; +debug("\nTesting regexp: " + regexp); +shouldBeTrue("regexp.test('c]')"); diff --git a/deps/v8/test/webkit/fast/regex/non-capturing-backtracking-expected.txt b/deps/v8/test/webkit/fast/regex/non-capturing-backtracking-expected.txt new file mode 100644 index 0000000..ca798d3 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/non-capturing-backtracking-expected.txt @@ -0,0 +1,33 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This page tests for proper backtracking with greedy quantifiers and non-capturing parentheses. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS re.exec('a') is ['a'] +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/non-capturing-backtracking.js b/deps/v8/test/webkit/fast/regex/non-capturing-backtracking.js new file mode 100644 index 0000000..e086dc7 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/non-capturing-backtracking.js @@ -0,0 +1,29 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"This page tests for proper backtracking with greedy quantifiers and non-capturing parentheses." +); + +var re = /(?:a*)a/; +shouldBe("re.exec('a')", "['a']"); diff --git a/deps/v8/test/webkit/fast/regex/overflow-expected.txt b/deps/v8/test/webkit/fast/regex/overflow-expected.txt new file mode 100644 index 0000000..be978ab --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/overflow-expected.txt @@ -0,0 +1,36 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This test checks expressions with alternative lengths of appox. 2^31. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS regexp1.exec('') is null +PASS regexp2.exec('') is null +PASS regexp3.exec(s3) is null +FAIL function f() { /[^a$]{4294967295}/ } should throw SyntaxError: Invalid regular expression: number too large in {} quantifier. Was undefined. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/overflow.js b/deps/v8/test/webkit/fast/regex/overflow.js new file mode 100644 index 0000000..825cd1d --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/overflow.js @@ -0,0 +1,36 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description("This test checks expressions with alternative lengths of appox. 2^31."); + +var regexp1 = /(?:(?=g))|(?:m).{2147483648,}/; +shouldBe("regexp1.exec('')", 'null'); + +var regexp2 = /(?:(?=g)).{2147483648,}/; +shouldBe("regexp2.exec('')", 'null'); + +var s3 = "&{6}u4a64YfQP{C}u88c4u5772Qu8693{4294967167}u85f2u7f3fs((uf202){4})u5bc6u1947"; +var regexp3 = new RegExp(s3, ""); +shouldBe("regexp3.exec(s3)", 'null'); + +shouldThrow("function f() { /[^a$]{4294967295}/ }", '"SyntaxError: Invalid regular expression: number too large in {} quantifier"'); diff --git a/deps/v8/test/webkit/fast/regex/parentheses-expected.txt b/deps/v8/test/webkit/fast/regex/parentheses-expected.txt new file mode 100644 index 0000000..80bee97 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/parentheses-expected.txt @@ -0,0 +1,124 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This page tests handling of parentheses subexpressions. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS regexp1.exec('abc') is ['ab','a','b'] +PASS regexp2.exec('abacadabe') is ['abe','ab','b','b'] +PASS regexp3.exec('abacadabe') is ['abe','ab','b',undefined] +PASS regexp4.exec('abacadabe') is ['abe','ab','b',undefined] +PASS regexp5.exec('abacadabe') is ['abe','ab','b','b',undefined,undefined] +PASS regexp6.exec('abcde') is ['ab','ab','b','b',undefined,undefined] +PASS regexp7.exec('abc') is ['abc','ab','b'] +PASS regexp8.exec('bcaddxqy') is ['qy','q','q','y'] +PASS regexp9.exec('asdfjejgsdflaksdfjkeljghkjea') is ['a','a',undefined] +PASS regexp10.exec('asdfjejgsdflaksdfjkeljghat') is ['at'] +PASS regexp11.exec('Developing with JavaScript is dangerous, do not try it without assistance') is null +PASS regexp12.exec('Seattle, WA to Buckley, WA') is ['Seattle, WA to Buckley, WA', undefined, 'Seattle', 'WA', undefined, 'Buckley', 'WA'] +PASS regexp13.exec('zxcasd;fl ^AaaAAaaaf;lrlrzs') is ['AaaAAaaaf;lrlrzs',undefined,'AaaAAaaaf;lrlrzs'] +PASS regexp14.exec('b') is ['b',undefined,'b'] +PASS regexp15.exec('abdf') is ['abdf',undefined,'abd','f'] +PASS regexp16.exec('abc') is ['ab','a','b'] +PASS regexp17.exec('bcaDxqy') is ['Dx','D'] +PASS regexp18.exec('Hello: World') is ['Hello:',':'] +PASS regexp19.exec('barrel') is ['bar',''] +PASS regexp20.exec('barrel') is ['barrel','rel'] +PASS regexp20.exec('2barrel') is ['2barrel','rel'] +PASS regexp21.exec('abc') is ['ab','ab','b'] +PASS regexp22.exec('abcdlskfgjdslkfg') is null +PASS regexp23.exec(' ') is ['>',undefined,undefined,'>'] +PASS regexp34.exec('xyz123') is null +PASS regexp34.exec('btn-abc') is ['btn-abc'] +PASS regexp34.exec('btn- abc') is null +PASS regexp34.exec('XXbtn-abc') is null +PASS regexp34.exec('XX btn-abc') is ['btn-abc'] +PASS regexp35.exec('ax') is ['ax','ax','a','x'] +PASS regexp35.exec('axx') is null +PASS regexp35.exec('axxx') is ['axxx','axxx','a','xxx'] +PASS regexp35.exec('bx') is ['bx','bx','b','x'] +PASS regexp35.exec('bxx') is null +PASS regexp35.exec('bxxx') is ['bxxx','bxxx','b','xxx'] +PASS regexp36.exec('/2011') is ['/2011','/2011','/','2011'] +PASS regexp36.exec('/11') is ['/11','/11','/','11'] +PASS regexp36.exec('/123') is null +PASS regexp37.exec('7/4/1776') is ['7/4/1776','7','/','4','/1776','/','1776'] +PASS regexp37.exec('07-04-1776') is ['07-04-1776','07','-','04','-1776','-','1776'] +PASS regexp38.exec('xx') is ['xx','xx','xx'] +PASS regexp38.exec('b') is ['b','b',undefined] +PASS regexp38.exec('z') is ['z','z',undefined] +PASS regexp38.exec('') is ['','',undefined] +PASS regexp39.exec('') is ['',undefined,undefined] +PASS regexp39.exec('8') is ['8','8',undefined] +PASS regexp39.exec('zP') is ['',undefined,undefined] +PASS regexp40.exec('') is ['',undefined,undefined,undefined,''] +PASS regexp40.exec('8') is ['8','8','8',undefined,''] +PASS regexp40.exec('zPz') is ['',undefined,undefined,undefined,''] +PASS regexp40.exec('zPPz') is ['',undefined,undefined,undefined,''] +PASS regexp40.exec('zPPPz') is ['',undefined,undefined,undefined,''] +PASS regexp40.exec('zPPPPz') is ['',undefined,undefined,undefined,''] +PASS regexp41.exec('Here is a link: http://www.acme.com/our_products/index.html. That is all we want!') is ['http://www.acme.com/our_products/index.html','http://www.acme.com/our_products/index.html','http://','l',undefined] +PASS regexp42.exec('') is ['',undefined,undefined] +PASS regexp42.exec('4') is ['4','4','4'] +PASS regexp42.exec('4321') is ['4','4','4'] +PASS /(?!(?=r{0}){2,})|((z)?)?/gi.test('') is true +PASS regexp43.exec('SSS') is [''] +PASS regexp44.exec('SSS') is ['',undefined] +PASS regexp45.exec('vt') is null +PASS regexp46.exec('5') is null +PASS regexp46.exec('pk') is ['pk',undefined,undefined] +PASS regexp46.exec('Xw555') is ['w555','w',undefined] +PASS regexp46.exec('Xw55pk5') is ['w','w',''] +PASS regexp47.exec('/www.acme.com/this/is/a/path/file.txt') is ['/www.acme.com/this/is/a/path/file.txt','/www.acme.com/this/is/a/path/file.txt',undefined] +PASS regexp48.exec('http://www.acme.com/this/is/a/path/file.txt') is ['http://www.acme.com/this/is/a/path/file.txt','http','www.acme.com',undefined,'this/is/a/path/file.txt',undefined,undefined] +PASS regexp49.exec('http://www.acme.com/this/is/a/path/file.txt') is ['http://www.acme.com/this/is/a/path/file.txt',undefined,undefined,'http','www.acme.com',undefined,'this/is/a/path/file.txt',undefined,undefined] +PASS regexp50.exec('((a)b{28,}c|d)x') is null +PASS regexp50.exec('abbbbbbbbbbbbbbbbbbbbbbbbbbbbcx') is ['abbbbbbbbbbbbbbbbbbbbbbbbbbbbcx', 'abbbbbbbbbbbbbbbbbbbbbbbbbbbbc', 'a'] +PASS regexp50.exec('dx') is ['dx', 'd', undefined] +PASS regexp51.exec('abc') is null +PASS regexp51.exec(s) is [')ž{-,}P{Any}',')',undefined] +PASS 'Hi Bob'.match(regexp52) is ['Bob',undefined,'Bob',undefined,undefined] +PASS regexp53.exec('#') is ['',undefined,''] +PASS regexp54.exec('#') is ['','',undefined,undefined,''] +PASS regexp55.exec('#') is ['',''] +PASS regexp56.exec('a') is ['',''] +PASS regexp57.exec('a') is ['a','a'] +PASS regexp58.exec('badbc') is ['a'] +PASS 'Y aaa X Match1 Y aaa Y Match2 Z'.match(regexp59) is ['X Match1 Y','Y Match2 Z'] +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/parentheses.js b/deps/v8/test/webkit/fast/regex/parentheses.js new file mode 100644 index 0000000..57a2830 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/parentheses.js @@ -0,0 +1,277 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description("This page tests handling of parentheses subexpressions."); + +var regexp1 = /(a|A)(b|B)/; +shouldBe("regexp1.exec('abc')", "['ab','a','b']"); + +var regexp2 = /(a((b)|c|d))e/; +shouldBe("regexp2.exec('abacadabe')", "['abe','ab','b','b']"); + +var regexp3 = /(a(b|(c)|d))e/; +shouldBe("regexp3.exec('abacadabe')", "['abe','ab','b',undefined]"); + +var regexp4 = /(a(b|c|(d)))e/; +shouldBe("regexp4.exec('abacadabe')", "['abe','ab','b',undefined]"); + +var regexp5 = /(a((b)|(c)|(d)))e/; +shouldBe("regexp5.exec('abacadabe')", "['abe','ab','b','b',undefined,undefined]"); + +var regexp6 = /(a((b)|(c)|(d)))/; +shouldBe("regexp6.exec('abcde')", "['ab','ab','b','b',undefined,undefined]"); + +var regexp7 = /(a(b)??)??c/; +shouldBe("regexp7.exec('abc')", "['abc','ab','b']"); + +var regexp8 = /(a|(e|q))(x|y)/; +shouldBe("regexp8.exec('bcaddxqy')" , "['qy','q','q','y']"); + +var regexp9 = /((t|b)?|a)$/; +shouldBe("regexp9.exec('asdfjejgsdflaksdfjkeljghkjea')", "['a','a',undefined]"); + +var regexp10 = /(?:h|e?(?:t|b)?|a?(?:t|b)?)(?:$)/; +shouldBe("regexp10.exec('asdfjejgsdflaksdfjkeljghat')", "['at']"); + +var regexp11 = /([Jj]ava([Ss]cript)?)\sis\s(fun\w*)/; +shouldBeNull("regexp11.exec('Developing with JavaScript is dangerous, do not try it without assistance')"); + +var regexp12 = /(?:(.+), )?(.+), (..) to (?:(.+), )?(.+), (..)/; +shouldBe("regexp12.exec('Seattle, WA to Buckley, WA')", "['Seattle, WA to Buckley, WA', undefined, 'Seattle', 'WA', undefined, 'Buckley', 'WA']"); + +var regexp13 = /(A)?(A.*)/; +shouldBe("regexp13.exec('zxcasd;fl\ ^AaaAAaaaf;lrlrzs')", "['AaaAAaaaf;lrlrzs',undefined,'AaaAAaaaf;lrlrzs']"); + +var regexp14 = /(a)|(b)/; +shouldBe("regexp14.exec('b')", "['b',undefined,'b']"); + +var regexp15 = /^(?!(ab)de|x)(abd)(f)/; +shouldBe("regexp15.exec('abdf')", "['abdf',undefined,'abd','f']"); + +var regexp16 = /(a|A)(b|B)/; +shouldBe("regexp16.exec('abc')", "['ab','a','b']"); + +var regexp17 = /(a|d|q|)x/i; +shouldBe("regexp17.exec('bcaDxqy')", "['Dx','D']"); + +var regexp18 = /^.*?(:|$)/; +shouldBe("regexp18.exec('Hello: World')", "['Hello:',':']"); + +var regexp19 = /(ab|^.{0,2})bar/; +shouldBe("regexp19.exec('barrel')", "['bar','']"); + +var regexp20 = /(?:(?!foo)...|^.{0,2})bar(.*)/; +shouldBe("regexp20.exec('barrel')", "['barrel','rel']"); +shouldBe("regexp20.exec('2barrel')", "['2barrel','rel']"); + +var regexp21 = /([a-g](b|B)|xyz)/; +shouldBe("regexp21.exec('abc')", "['ab','ab','b']"); + +var regexp22 = /(?:^|;)\s*abc=([^;]*)/; +shouldBeNull("regexp22.exec('abcdlskfgjdslkfg')"); + +var regexp23 = /"[^<"]*"|'[^<']*'/; +shouldBe("regexp23.exec('"\'\s]*)?)|(/?>)|.[^\w\s>]*)'); +shouldBe("regexp33.exec('> ')","['>',undefined,undefined,'>']"); + +var regexp34 = /(?:^|\b)btn-\S+/; +shouldBeNull("regexp34.exec('xyz123')"); +shouldBe("regexp34.exec('btn-abc')","['btn-abc']"); +shouldBeNull("regexp34.exec('btn- abc')"); +shouldBeNull("regexp34.exec('XXbtn-abc')"); +shouldBe("regexp34.exec('XX btn-abc')","['btn-abc']"); + +var regexp35 = /^((a|b)(x|xxx)|)$/; +shouldBe("regexp35.exec('ax')", "['ax','ax','a','x']"); +shouldBeNull("regexp35.exec('axx')"); +shouldBe("regexp35.exec('axxx')", "['axxx','axxx','a','xxx']"); +shouldBe("regexp35.exec('bx')", "['bx','bx','b','x']"); +shouldBeNull("regexp35.exec('bxx')"); +shouldBe("regexp35.exec('bxxx')", "['bxxx','bxxx','b','xxx']"); + +var regexp36 = /^((\/|\.|\-)(\d\d|\d\d\d\d)|)$/; +shouldBe("regexp36.exec('/2011')", "['/2011','/2011','/','2011']"); +shouldBe("regexp36.exec('/11')", "['/11','/11','/','11']"); +shouldBeNull("regexp36.exec('/123')"); + +var regexp37 = /^([1][0-2]|[0]\d|\d)(\/|\.|\-)([0-2]\d|[3][0-1]|\d)((\/|\.|\-)(\d\d|\d\d\d\d)|)$/; +shouldBe("regexp37.exec('7/4/1776')", "['7/4/1776','7','/','4','/1776','/','1776']"); +shouldBe("regexp37.exec('07-04-1776')", "['07-04-1776','07','-','04','-1776','-','1776']"); + +var regexp38 = /^(z|(x|xx)|b|)$/; +shouldBe("regexp38.exec('xx')", "['xx','xx','xx']"); +shouldBe("regexp38.exec('b')", "['b','b',undefined]"); +shouldBe("regexp38.exec('z')", "['z','z',undefined]"); +shouldBe("regexp38.exec('')", "['','',undefined]"); + +var regexp39 = /(8|((?=P)))?/; +shouldBe("regexp39.exec('')", "['',undefined,undefined]"); +shouldBe("regexp39.exec('8')", "['8','8',undefined]"); +shouldBe("regexp39.exec('zP')", "['',undefined,undefined]"); + +var regexp40 = /((8)|((?=P){4}))?()/; +shouldBe("regexp40.exec('')", "['',undefined,undefined,undefined,'']"); +shouldBe("regexp40.exec('8')", "['8','8','8',undefined,'']"); +shouldBe("regexp40.exec('zPz')", "['',undefined,undefined,undefined,'']"); +shouldBe("regexp40.exec('zPPz')", "['',undefined,undefined,undefined,'']"); +shouldBe("regexp40.exec('zPPPz')", "['',undefined,undefined,undefined,'']"); +shouldBe("regexp40.exec('zPPPPz')", "['',undefined,undefined,undefined,'']"); + +var regexp41 = /(([\w\-]+:\/\/?|www[.])[^\s()<>]+(?:([\w\d]+)|([^\[:punct:\]\s()<>\W]|\/)))/; +shouldBe("regexp41.exec('Here is a link: http://www.acme.com/our_products/index.html. That is all we want!')", "['http://www.acme.com/our_products/index.html','http://www.acme.com/our_products/index.html','http://','l',undefined]"); + +var regexp42 = /((?:(4)?))?/; +shouldBe("regexp42.exec('')", "['',undefined,undefined]"); +shouldBe("regexp42.exec('4')", "['4','4','4']"); +shouldBe("regexp42.exec('4321')", "['4','4','4']"); + +shouldBeTrue("/(?!(?=r{0}){2,})|((z)?)?/gi.test('')"); + +var regexp43 = /(?!(?:\1+s))/; +shouldBe("regexp43.exec('SSS')", "['']"); + +var regexp44 = /(?!(?:\3+(s+?)))/g; +shouldBe("regexp44.exec('SSS')", "['',undefined]"); + +var regexp45 = /((?!(?:|)v{2,}|))/; +shouldBeNull("regexp45.exec('vt')"); + +var regexp46 = /(w)(?:5{3}|())|pk/; +shouldBeNull("regexp46.exec('5')"); +shouldBe("regexp46.exec('pk')", "['pk',undefined,undefined]"); +shouldBe("regexp46.exec('Xw555')", "['w555','w',undefined]"); +shouldBe("regexp46.exec('Xw55pk5')", "['w','w','']"); + +var regexp47 = /(.*?)(?:(?:\?(.*?)?)?)(?:(?:#)?)$/; +shouldBe("regexp47.exec('/www.acme.com/this/is/a/path/file.txt')", "['/www.acme.com/this/is/a/path/file.txt','/www.acme.com/this/is/a/path/file.txt',undefined]"); + +var regexp48 = /^(?:(\w+):\/*([\w\.\-\d]+)(?::(\d+)|)(?=(?:\/|$))|)(?:$|\/?(.*?)(?:\?(.*?)?|)(?:#(.*)|)$)/; +/* The regexp on the prior line confuses Xcode syntax highlighting, this coment fixes it! */ +shouldBe("regexp48.exec('http://www.acme.com/this/is/a/path/file.txt')", "['http://www.acme.com/this/is/a/path/file.txt','http','www.acme.com',undefined,'this/is/a/path/file.txt',undefined,undefined]"); + +var regexp49 = /(?:([^:]*?)(?:(?:\?(.*?)?)?)(?:(?:#)?)$)|(?:^(?:(\w+):\/*([\w\.\-\d]+)(?::(\d+)|)(?=(?:\/|$))|)(?:$|\/?(.*?)(?:\?(.*?)?|)(?:#(.*)|)$))/; +/* The regexp on the prior line confuses Xcode syntax highlighting, this coment fixes it! */ +shouldBe("regexp49.exec('http://www.acme.com/this/is/a/path/file.txt')", "['http://www.acme.com/this/is/a/path/file.txt',undefined,undefined,'http','www.acme.com',undefined,'this/is/a/path/file.txt',undefined,undefined]"); + +var regexp50 = /((a)b{28,}c|d)x/; +shouldBeNull("regexp50.exec('((a)b{28,}c|d)x')"); +shouldBe("regexp50.exec('abbbbbbbbbbbbbbbbbbbbbbbbbbbbcx')", "['abbbbbbbbbbbbbbbbbbbbbbbbbbbbcx', 'abbbbbbbbbbbbbbbbbbbbbbbbbbbbc', 'a']"); +shouldBe("regexp50.exec('dx')", "['dx', 'd', undefined]"); + +var s = "((.\s{-}).{28,}\P{Yi}?{,30}\|.)\x9e{-,}\P{Any}"; +var regexp51 = new RegExp(s); +shouldBeNull("regexp51.exec('abc')"); +shouldBe("regexp51.exec(s)", "[')\x9e{-,}P{Any}',')',undefined]"); + +var regexp52 = /(Rob)|(Bob)|(Robert)|(Bobby)/; +shouldBe("'Hi Bob'.match(regexp52)", "['Bob',undefined,'Bob',undefined,undefined]"); + +// Test cases discovered by fuzzing that crashed the compiler. +var regexp53 = /(?=(?:(?:(gB)|(?!cs|<))((?=(?!v6){0,})))|(?=#)+?)/m; +shouldBe("regexp53.exec('#')", "['',undefined,'']"); +var regexp54 = /((?:(?:()|(?!))((?=(?!))))|())/m; +shouldBe("regexp54.exec('#')", "['','',undefined,undefined,'']"); +var regexp55 = /(?:(?:(?:a?|(?:))((?:)))|a?)/m; +shouldBe("regexp55.exec('#')", "['','']"); + +// Test evaluation order of empty subpattern alternatives. +var regexp56 = /(|a)/; +shouldBe("regexp56.exec('a')", "['','']"); +var regexp57 = /(a|)/; +shouldBe("regexp57.exec('a')", "['a','a']"); + +// Tests that non-greedy repeat quantified parentheses will backtrack through multiple frames of subpattern matches. +var regexp58 = /a|b(?:[^b])*?c/; +shouldBe("regexp58.exec('badbc')", "['a']"); +var regexp59 = /(X(?:.(?!X))*?Y)|(Y(?:.(?!Y))*?Z)/g; +shouldBe("'Y aaa X Match1 Y aaa Y Match2 Z'.match(regexp59)", "['X Match1 Y','Y Match2 Z']"); + diff --git a/deps/v8/test/webkit/fast/regex/pcre-test-4-expected.txt b/deps/v8/test/webkit/fast/regex/pcre-test-4-expected.txt new file mode 100644 index 0000000..cfb588a --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/pcre-test-4-expected.txt @@ -0,0 +1,275 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +A chunk of our port of PCRE's test suite, adapted to be more applicable to JavaScript. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS regex0.exec(input0); is results +PASS regex0.exec(input1); is results +PASS regex0.exec(input2); is results +PASS regex0.exec(input3); is results +PASS regex1.exec(input0); is results +PASS regex1.exec(input1); is results +PASS regex1.exec(input2); is results +PASS regex1.exec(input3); is results +PASS regex1.exec(input4); is results +PASS regex2.exec(input0); is results +PASS regex3.exec(input0); is results +PASS regex4.exec(input0); is results +PASS regex5.exec(input0); is results +PASS regex6.exec(input0); is results +PASS regex7.exec(input0); is results +PASS regex8.exec(input0); is results +PASS regex9.exec(input0); is results +PASS regex10.exec(input0); is results +PASS regex11.exec(input0); is results +PASS regex12.exec(input0); is results +PASS regex12.exec(input1); is results +PASS regex12.exec(input2); is results +PASS regex12.exec(input3); is results +PASS regex12.exec(input4); is results +PASS regex13.exec(input0); is results +PASS regex13.exec(input1); is results +PASS regex13.exec(input2); is results +PASS regex13.exec(input3); is results +PASS regex13.exec(input4); is results +PASS regex13.exec(input5); is results +PASS regex14.exec(input0); is results +PASS regex14.exec(input1); is results +PASS regex14.exec(input2); is results +PASS regex14.exec(input3); is results +PASS regex14.exec(input4); is results +PASS regex14.exec(input5); is results +PASS regex15.exec(input0); is results +PASS regex15.exec(input1); is results +PASS regex15.exec(input2); is results +PASS regex15.exec(input3); is results +PASS regex15.exec(input4); is results +PASS regex15.exec(input5); is results +PASS regex15.exec(input6); is results +PASS regex15.exec(input7); is results +PASS regex15.exec(input8); is results +PASS regex16.exec(input0); is results +PASS regex16.exec(input1); is results +PASS regex16.exec(input2); is results +PASS regex16.exec(input3); is results +PASS regex16.exec(input4); is results +PASS regex16.exec(input5); is results +PASS regex16.exec(input6); is results +PASS regex16.exec(input7); is results +PASS regex16.exec(input8); is results +PASS regex17.exec(input0); is results +PASS regex21.exec(input0); is results +PASS regex21.exec(input1); is results +PASS regex22.exec(input0); is results +PASS regex22.exec(input1); is results +PASS regex22.exec(input2); is results +PASS regex30.exec(input0); is results +PASS regex31.exec(input0); is results +PASS regex32.exec(input0); is results +PASS regex33.exec(input0); is results +PASS regex34.exec(input0); is results +PASS regex35.exec(input0); is results +PASS regex36.exec(input0); is results +PASS regex37.exec(input0); is results +PASS regex37.exec(input1); is results +PASS regex38.exec(input0); is results +PASS regex38.exec(input1); is results +PASS regex39.exec(input0); is results +PASS regex39.exec(input1); is results +PASS regex40.exec(input0); is results +PASS regex41.exec(input0); is results +PASS regex42.exec(input0); is results +PASS regex43.exec(input0); is results +PASS regex44.exec(input0); is results +PASS regex45.exec(input0); is results +PASS regex47.exec(input0); is results +PASS regex48.exec(input0); is results +PASS regex49.exec(input0); is results +PASS regex49.exec(input1); is results +PASS regex50.exec(input0); is results +PASS regex50.exec(input1); is results +PASS regex51.exec(input0); is results +PASS regex52.exec(input0); is results +PASS regex53.exec(input0); is results +PASS regex53.exec(input1); is results +PASS regex54.exec(input0); is results +PASS regex54.exec(input1); is results +PASS regex54.exec(input2); is results +PASS regex54.exec(input3); is results +PASS regex55.exec(input0); is results +PASS regex55.exec(input1); is results +PASS regex55.exec(input2); is results +PASS regex55.exec(input3); is results +PASS regex56.exec(input0); is results +PASS regex57.exec(input0); is results +PASS regex57.exec(input1); is results +PASS regex57.exec(input2); is results +PASS regex58.exec(input0); is results +PASS regex58.exec(input1); is results +PASS regex58.exec(input2); is results +PASS regex59.exec(input0); is results +PASS regex59.exec(input1); is results +PASS regex60.exec(input0); is results +PASS regex60.exec(input1); is results +PASS regex60.exec(input2); is results +PASS regex61.exec(input0); is results +PASS regex61.exec(input1); is results +PASS regex61.exec(input2); is results +PASS regex62.exec(input0); is results +PASS regex63.exec(input0); is results +PASS regex63.exec(input1); is results +PASS regex63.exec(input2); is results +PASS regex64.exec(input0); is results +PASS regex64.exec(input1); is results +PASS regex64.exec(input2); is results +PASS regex65.exec(input0); is results +PASS regex65.exec(input1); is results +PASS regex66.exec(input0); is results +PASS regex66.exec(input1); is results +PASS regex66.exec(input2); is results +PASS regex67.exec(input0); is results +PASS regex67.exec(input1); is results +PASS regex67.exec(input2); is results +PASS regex68.exec(input0); is results +PASS regex68.exec(input1); is results +PASS regex69.exec(input0); is results +PASS regex69.exec(input1); is results +PASS regex69.exec(input2); is results +PASS regex70.exec(input0); is results +PASS regex70.exec(input1); is results +PASS regex70.exec(input2); is results +PASS regex71.exec(input0); is results +PASS regex71.exec(input1); is results +PASS regex71.exec(input2); is results +PASS regex72.exec(input0); is results +PASS regex72.exec(input1); is results +PASS regex72.exec(input2); is results +PASS regex73.exec(input0); is results +PASS regex73.exec(input1); is results +PASS regex74.exec(input0); is results +PASS regex74.exec(input1); is results +PASS regex74.exec(input2); is results +PASS regex75.exec(input0); is results +PASS regex75.exec(input1); is results +PASS regex75.exec(input2); is results +PASS regex75.exec(input3); is results +PASS regex75.exec(input4); is results +PASS regex76.exec(input0); is results +PASS regex76.exec(input1); is results +PASS regex76.exec(input2); is results +PASS regex77.exec(input0); is results +PASS regex77.exec(input1); is results +PASS regex77.exec(input2); is results +PASS regex77.exec(input3); is results +PASS regex78.exec(input0); is results +PASS regex78.exec(input1); is results +PASS regex78.exec(input2); is results +PASS regex78.exec(input3); is results +PASS regex78.exec(input4); is results +PASS regex78.exec(input5); is results +PASS regex79.exec(input0); is results +PASS regex79.exec(input1); is results +PASS regex79.exec(input2); is results +PASS regex80.exec(input0); is results +PASS regex80.exec(input1); is results +PASS regex80.exec(input2); is results +PASS regex81.exec(input0); is results +PASS regex81.exec(input1); is results +PASS regex81.exec(input2); is results +PASS regex82.exec(input0); is results +PASS regex82.exec(input1); is results +PASS regex82.exec(input2); is results +PASS regex86.exec(input0); is results +PASS regex86.exec(input1); is results +PASS regex86.exec(input2); is results +PASS regex86.exec(input3); is results +PASS regex86.exec(input4); is results +PASS regex87.exec(input0); is results +PASS regex87.exec(input1); is results +PASS regex87.exec(input2); is results +PASS regex87.exec(input3); is results +PASS regex87.exec(input4); is results +PASS regex87.exec(input5); is results +PASS regex88.exec(input0); is results +PASS regex88.exec(input1); is results +PASS regex88.exec(input2); is results +PASS regex88.exec(input3); is results +PASS regex88.exec(input4); is results +PASS regex91.exec(input0); is results +PASS regex91.exec(input1); is results +PASS regex91.exec(input2); is results +PASS regex91.exec(input3); is results +PASS regex91.exec(input4); is results +PASS regex92.exec(input0); is results +PASS regex93.exec(input0); is results +PASS regex94.exec(input0); is results +PASS regex95.exec(input0); is results +PASS regex95.exec(input1); is results +PASS regex96.exec(input0); is results +PASS regex97.exec(input0); is results +PASS regex98.exec(input0); is results +PASS regex99.exec(input0); is results +PASS regex100.exec(input0); is results +PASS regex102.exec(input0); is results +PASS regex103.exec(input0); is results +PASS regex104.exec(input0); is results +PASS regex105.exec(input0); is results +PASS regex105.exec(input1); is results +PASS regex106.exec(input0); is results +PASS regex107.exec(input0); is results +PASS input0.match(regexGlobal0); is results +PASS input1.match(regexGlobal0); is results +PASS input0.match(regexGlobal1); is results +PASS input0.match(regexGlobal2); is results +PASS input0.match(regexGlobal3); is results +PASS input0.match(regexGlobal4); is results +PASS input0.match(regexGlobal5); is results +PASS input0.match(regexGlobal6); is results +PASS input0.match(regexGlobal7); is results +PASS input0.match(regexGlobal8); is results +PASS input0.match(regexGlobal9); is results +PASS input0.match(regexGlobal10); is results +PASS input0.match(regexGlobal11); is results +PASS input0.match(regexGlobal12); is results +PASS input0.match(regexGlobal13); is results +PASS input0.match(regexGlobal14); is results +PASS input0.match(regexGlobal15); is results +PASS input0.match(regexGlobal16); is results +PASS input0.match(regexGlobal17); is results +PASS input0.match(regexGlobal19); is results +PASS input0.match(regexGlobal21); is results +PASS input0.match(regexGlobal24); is results +PASS input0.match(regexGlobal25); is results +PASS input0.match(regexGlobal26); is results +PASS input0.match(regexGlobal27); is results +PASS input0.match(regexGlobal28); is results +PASS input1.match(regexGlobal28); is results +PASS input0.match(regexGlobal29); is results +PASS input1.match(regexGlobal29); is results +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/pcre-test-4.js b/deps/v8/test/webkit/fast/regex/pcre-test-4.js new file mode 100644 index 0000000..a352585 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/pcre-test-4.js @@ -0,0 +1,1169 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"A chunk of our port of PCRE's test suite, adapted to be more applicable to JavaScript." +); + +var regex0 = /a.b/; +var input0 = "acb"; +var results = ["acb"]; +shouldBe('regex0.exec(input0);', 'results'); +var input1 = "a\x7fb"; +var results = ["a\u007fb"]; +shouldBe('regex0.exec(input1);', 'results'); +var input2 = "a\u0100b"; +var results = ["a\u0100b"]; +shouldBe('regex0.exec(input2);', 'results'); +// Failers +var input3 = "a\nb"; +var results = null; +shouldBe('regex0.exec(input3);', 'results'); + +var regex1 = /a(.{3})b/; +var input0 = "a\u4000xyb"; +var results = ["a\u4000xyb", "\u4000xy"]; +shouldBe('regex1.exec(input0);', 'results'); +var input1 = "a\u4000\x7fyb"; +var results = ["a\u4000\u007fyb", "\u4000\u007fy"]; +shouldBe('regex1.exec(input1);', 'results'); +var input2 = "a\u4000\u0100yb"; +var results = ["a\u4000\u0100yb", "\u4000\u0100y"]; +shouldBe('regex1.exec(input2);', 'results'); +// Failers +var input3 = "a\u4000b"; +var results = null; +shouldBe('regex1.exec(input3);', 'results'); +var input4 = "ac\ncb"; +var results = null; +shouldBe('regex1.exec(input4);', 'results'); + +var regex2 = /a(.*?)(.)/; +var input0 = "a\xc0\x88b"; +var results = ["a\xc0", "", "\xc0"]; +shouldBe('regex2.exec(input0);', 'results'); + +var regex3 = /a(.*?)(.)/; +var input0 = "a\u0100b"; +var results = ["a\u0100", "", "\u0100"]; +shouldBe('regex3.exec(input0);', 'results'); + +var regex4 = /a(.*)(.)/; +var input0 = "a\xc0\x88b"; +var results = ["a\xc0\x88b", "\xc0\x88", "b"]; +shouldBe('regex4.exec(input0);', 'results'); + +var regex5 = /a(.*)(.)/; +var input0 = "a\u0100b"; +var results = ["a\u0100b", "\u0100", "b"]; +shouldBe('regex5.exec(input0);', 'results'); + +var regex6 = /a(.)(.)/; +var input0 = "a\xc0\x92bcd"; +var results = ["a\xc0\x92", "\xc0", "\x92"]; +shouldBe('regex6.exec(input0);', 'results'); + +var regex7 = /a(.)(.)/; +var input0 = "a\u0240bcd"; +var results = ["a\u0240b", "\u0240", "b"]; +shouldBe('regex7.exec(input0);', 'results'); + +var regex8 = /a(.?)(.)/; +var input0 = "a\xc0\x92bcd"; +var results = ["a\xc0\x92", "\xc0", "\x92"]; +shouldBe('regex8.exec(input0);', 'results'); + +var regex9 = /a(.?)(.)/; +var input0 = "a\u0240bcd"; +var results = ["a\u0240b", "\u0240", "b"]; +shouldBe('regex9.exec(input0);', 'results'); + +var regex10 = /a(.??)(.)/; +var input0 = "a\xc0\x92bcd"; +var results = ["a\xc0", "", "\xc0"]; +shouldBe('regex10.exec(input0);', 'results'); + +var regex11 = /a(.??)(.)/; +var input0 = "a\u0240bcd"; +var results = ["a\u0240", "", "\u0240"]; +shouldBe('regex11.exec(input0);', 'results'); + +var regex12 = /a(.{3})b/; +var input0 = "a\u1234xyb"; +var results = ["a\u1234xyb", "\u1234xy"]; +shouldBe('regex12.exec(input0);', 'results'); +var input1 = "a\u1234\u4321yb"; +var results = ["a\u1234\u4321yb", "\u1234\u4321y"]; +shouldBe('regex12.exec(input1);', 'results'); +var input2 = "a\u1234\u4321\u3412b"; +var results = ["a\u1234\u4321\u3412b", "\u1234\u4321\u3412"]; +shouldBe('regex12.exec(input2);', 'results'); +// Failers +var input3 = "a\u1234b"; +var results = null; +shouldBe('regex12.exec(input3);', 'results'); +var input4 = "ac\ncb"; +var results = null; +shouldBe('regex12.exec(input4);', 'results'); + +var regex13 = /a(.{3,})b/; +var input0 = "a\u1234xyb"; +var results = ["a\u1234xyb", "\u1234xy"]; +shouldBe('regex13.exec(input0);', 'results'); +var input1 = "a\u1234\u4321yb"; +var results = ["a\u1234\u4321yb", "\u1234\u4321y"]; +shouldBe('regex13.exec(input1);', 'results'); +var input2 = "a\u1234\u4321\u3412b"; +var results = ["a\u1234\u4321\u3412b", "\u1234\u4321\u3412"]; +shouldBe('regex13.exec(input2);', 'results'); +var input3 = "axxxxbcdefghijb"; +var results = ["axxxxbcdefghijb", "xxxxbcdefghij"]; +shouldBe('regex13.exec(input3);', 'results'); +var input4 = "a\u1234\u4321\u3412\u3421b"; +var results = ["a\u1234\u4321\u3412\u3421b", "\u1234\u4321\u3412\u3421"]; +shouldBe('regex13.exec(input4);', 'results'); +// Failers +var input5 = "a\u1234b"; +var results = null; +shouldBe('regex13.exec(input5);', 'results'); + +var regex14 = /a(.{3,}?)b/; +var input0 = "a\u1234xyb"; +var results = ["a\u1234xyb", "\u1234xy"]; +shouldBe('regex14.exec(input0);', 'results'); +var input1 = "a\u1234\u4321yb"; +var results = ["a\u1234\u4321yb", "\u1234\u4321y"]; +shouldBe('regex14.exec(input1);', 'results'); +var input2 = "a\u1234\u4321\u3412b"; +var results = ["a\u1234\u4321\u3412b", "\u1234\u4321\u3412"]; +shouldBe('regex14.exec(input2);', 'results'); +var input3 = "axxxxbcdefghijb"; +var results = ["axxxxb", "xxxx"]; +shouldBe('regex14.exec(input3);', 'results'); +var input4 = "a\u1234\u4321\u3412\u3421b"; +var results = ["a\u1234\u4321\u3412\u3421b", "\u1234\u4321\u3412\u3421"]; +shouldBe('regex14.exec(input4);', 'results'); +// Failers +var input5 = "a\u1234b"; +var results = null; +shouldBe('regex14.exec(input5);', 'results'); + +var regex15 = /a(.{3,5})b/; +var input0 = "a\u1234xyb"; +var results = ["a\u1234xyb", "\u1234xy"]; +shouldBe('regex15.exec(input0);', 'results'); +var input1 = "a\u1234\u4321yb"; +var results = ["a\u1234\u4321yb", "\u1234\u4321y"]; +shouldBe('regex15.exec(input1);', 'results'); +var input2 = "a\u1234\u4321\u3412b"; +var results = ["a\u1234\u4321\u3412b", "\u1234\u4321\u3412"]; +shouldBe('regex15.exec(input2);', 'results'); +var input3 = "axxxxbcdefghijb"; +var results = ["axxxxb", "xxxx"]; +shouldBe('regex15.exec(input3);', 'results'); +var input4 = "a\u1234\u4321\u3412\u3421b"; +var results = ["a\u1234\u4321\u3412\u3421b", "\u1234\u4321\u3412\u3421"]; +shouldBe('regex15.exec(input4);', 'results'); +var input5 = "axbxxbcdefghijb"; +var results = ["axbxxb", "xbxx"]; +shouldBe('regex15.exec(input5);', 'results'); +var input6 = "axxxxxbcdefghijb"; +var results = ["axxxxxb", "xxxxx"]; +shouldBe('regex15.exec(input6);', 'results'); +// Failers +var input7 = "a\u1234b"; +var results = null; +shouldBe('regex15.exec(input7);', 'results'); +var input8 = "axxxxxxbcdefghijb"; +var results = null; +shouldBe('regex15.exec(input8);', 'results'); + +var regex16 = /a(.{3,5}?)b/; +var input0 = "a\u1234xyb"; +var results = ["a\u1234xyb", "\u1234xy"]; +shouldBe('regex16.exec(input0);', 'results'); +var input1 = "a\u1234\u4321yb"; +var results = ["a\u1234\u4321yb", "\u1234\u4321y"]; +shouldBe('regex16.exec(input1);', 'results'); +var input2 = "a\u1234\u4321\u3412b"; +var results = ["a\u1234\u4321\u3412b", "\u1234\u4321\u3412"]; +shouldBe('regex16.exec(input2);', 'results'); +var input3 = "axxxxbcdefghijb"; +var results = ["axxxxb", "xxxx"]; +shouldBe('regex16.exec(input3);', 'results'); +var input4 = "a\u1234\u4321\u3412\u3421b"; +var results = ["a\u1234\u4321\u3412\u3421b", "\u1234\u4321\u3412\u3421"]; +shouldBe('regex16.exec(input4);', 'results'); +var input5 = "axbxxbcdefghijb"; +var results = ["axbxxb", "xbxx"]; +shouldBe('regex16.exec(input5);', 'results'); +var input6 = "axxxxxbcdefghijb"; +var results = ["axxxxxb", "xxxxx"]; +shouldBe('regex16.exec(input6);', 'results'); +// Failers +var input7 = "a\u1234b"; +var results = null; +shouldBe('regex16.exec(input7);', 'results'); +var input8 = "axxxxxxbcdefghijb"; +var results = null; +shouldBe('regex16.exec(input8);', 'results'); + +var regex17 = /^[a\u00c0]/; +// Failers +var input0 = "\u0100"; +var results = null; +shouldBe('regex17.exec(input0);', 'results'); + +var regex21 = /(?:\u0100){3}b/; +var input0 = "\u0100\u0100\u0100b"; +var results = ["\u0100\u0100\u0100b"]; +shouldBe('regex21.exec(input0);', 'results'); +// Failers +var input1 = "\u0100\u0100b"; +var results = null; +shouldBe('regex21.exec(input1);', 'results'); + +var regex22 = /\u00ab/; +var input0 = "\u00ab"; +var results = ["\u00ab"]; +shouldBe('regex22.exec(input0);', 'results'); +var input1 = "\xc2\xab"; +var results = ["\u00ab"]; +shouldBe('regex22.exec(input1);', 'results'); +// Failers +var input2 = "\x00{ab}"; +var results = null; +shouldBe('regex22.exec(input2);', 'results'); + +var regex30 = /^[^a]{2}/; +var input0 = "\u0100bc"; +var results = ["\u0100b"]; +shouldBe('regex30.exec(input0);', 'results'); + +var regex31 = /^[^a]{2,}/; +var input0 = "\u0100bcAa"; +var results = ["\u0100bcA"]; +shouldBe('regex31.exec(input0);', 'results'); + +var regex32 = /^[^a]{2,}?/; +var input0 = "\u0100bca"; +var results = ["\u0100b"]; +shouldBe('regex32.exec(input0);', 'results'); + +var regex33 = /^[^a]{2}/i; +var input0 = "\u0100bc"; +var results = ["\u0100b"]; +shouldBe('regex33.exec(input0);', 'results'); + +var regex34 = /^[^a]{2,}/i; +var input0 = "\u0100bcAa"; +var results = ["\u0100bc"]; +shouldBe('regex34.exec(input0);', 'results'); + +var regex35 = /^[^a]{2,}?/i; +var input0 = "\u0100bca"; +var results = ["\u0100b"]; +shouldBe('regex35.exec(input0);', 'results'); + +var regex36 = /\u0100{0,0}/; +var input0 = "abcd"; +var results = [""]; +shouldBe('regex36.exec(input0);', 'results'); + +var regex37 = /\u0100?/; +var input0 = "abcd"; +var results = [""]; +shouldBe('regex37.exec(input0);', 'results'); +var input1 = "\u0100\u0100"; +var results = ["\u0100"]; +shouldBe('regex37.exec(input1);', 'results'); + +var regex38 = /\u0100{0,3}/; +var input0 = "\u0100\u0100"; +var results = ["\u0100\u0100"]; +shouldBe('regex38.exec(input0);', 'results'); +var input1 = "\u0100\u0100\u0100\u0100"; +var results = ["\u0100\u0100\u0100"]; +shouldBe('regex38.exec(input1);', 'results'); + +var regex39 = /\u0100*/; +var input0 = "abce"; +var results = [""]; +shouldBe('regex39.exec(input0);', 'results'); +var input1 = "\u0100\u0100\u0100\u0100"; +var results = ["\u0100\u0100\u0100\u0100"]; +shouldBe('regex39.exec(input1);', 'results'); + +var regex40 = /\u0100{1,1}/; +var input0 = "abcd\u0100\u0100\u0100\u0100"; +var results = ["\u0100"]; +shouldBe('regex40.exec(input0);', 'results'); + +var regex41 = /\u0100{1,3}/; +var input0 = "abcd\u0100\u0100\u0100\u0100"; +var results = ["\u0100\u0100\u0100"]; +shouldBe('regex41.exec(input0);', 'results'); + +var regex42 = /\u0100+/; +var input0 = "abcd\u0100\u0100\u0100\u0100"; +var results = ["\u0100\u0100\u0100\u0100"]; +shouldBe('regex42.exec(input0);', 'results'); + +var regex43 = /\u0100{3}/; +var input0 = "abcd\u0100\u0100\u0100XX"; +var results = ["\u0100\u0100\u0100"]; +shouldBe('regex43.exec(input0);', 'results'); + +var regex44 = /\u0100{3,5}/; +var input0 = "abcd\u0100\u0100\u0100\u0100\u0100\u0100\u0100XX"; +var results = ["\u0100\u0100\u0100\u0100\u0100"]; +shouldBe('regex44.exec(input0);', 'results'); + +var regex45 = /\u0100{3,}/; +var input0 = "abcd\u0100\u0100\u0100\u0100\u0100\u0100\u0100XX"; +var results = ["\u0100\u0100\u0100\u0100\u0100\u0100\u0100"]; +shouldBe('regex45.exec(input0);', 'results'); + +var regex47 = /\D*/; +var input0 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; +var results = ["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"]; +shouldBe('regex47.exec(input0);', 'results'); + +var regex48 = /\D*/; +var input0 = "\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100"; +var results = ["\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100"]; +shouldBe('regex48.exec(input0);', 'results'); + +var regex49 = /\D/; +var input0 = "1X2"; +var results = ["X"]; +shouldBe('regex49.exec(input0);', 'results'); +var input1 = "1\u01002"; +var results = ["\u0100"]; +shouldBe('regex49.exec(input1);', 'results'); + +var regex50 = />\S/; +var input0 = "> >X Y"; +var results = [">X"]; +shouldBe('regex50.exec(input0);', 'results'); +var input1 = "> >\u0100 Y"; +var results = [">\u0100"]; +shouldBe('regex50.exec(input1);', 'results'); + +var regex51 = /\d/; +var input0 = "\u01003"; +var results = ["3"]; +shouldBe('regex51.exec(input0);', 'results'); + +var regex52 = /\s/; +var input0 = "\u0100 X"; +var results = [" "]; +shouldBe('regex52.exec(input0);', 'results'); + +var regex53 = /\D+/; +var input0 = "12abcd34"; +var results = ["abcd"]; +shouldBe('regex53.exec(input0);', 'results'); +// Failers +var input1 = "1234"; +var results = null; +shouldBe('regex53.exec(input1);', 'results'); + +var regex54 = /\D{2,3}/; +var input0 = "12abcd34"; +var results = ["abc"]; +shouldBe('regex54.exec(input0);', 'results'); +var input1 = "12ab34"; +var results = ["ab"]; +shouldBe('regex54.exec(input1);', 'results'); +// Failers +var input2 = "1234"; +var results = null; +shouldBe('regex54.exec(input2);', 'results'); +var input3 = "12a34"; +var results = null; +shouldBe('regex54.exec(input3);', 'results'); + +var regex55 = /\D{2,3}?/; +var input0 = "12abcd34"; +var results = ["ab"]; +shouldBe('regex55.exec(input0);', 'results'); +var input1 = "12ab34"; +var results = ["ab"]; +shouldBe('regex55.exec(input1);', 'results'); +// Failers +var input2 = "1234"; +var results = null; +shouldBe('regex55.exec(input2);', 'results'); +var input3 = "12a34"; +var results = null; +shouldBe('regex55.exec(input3);', 'results'); + +var regex56 = /\d+/; +var input0 = "12abcd34"; +var results = ["12"]; +shouldBe('regex56.exec(input0);', 'results'); + +var regex57 = /\d{2,3}/; +var input0 = "12abcd34"; +var results = ["12"]; +shouldBe('regex57.exec(input0);', 'results'); +var input1 = "1234abcd"; +var results = ["123"]; +shouldBe('regex57.exec(input1);', 'results'); +// Failers +var input2 = "1.4"; +var results = null; +shouldBe('regex57.exec(input2);', 'results'); + +var regex58 = /\d{2,3}?/; +var input0 = "12abcd34"; +var results = ["12"]; +shouldBe('regex58.exec(input0);', 'results'); +var input1 = "1234abcd"; +var results = ["12"]; +shouldBe('regex58.exec(input1);', 'results'); +// Failers +var input2 = "1.4"; +var results = null; +shouldBe('regex58.exec(input2);', 'results'); + +var regex59 = /\S+/; +var input0 = "12abcd34"; +var results = ["12abcd34"]; +shouldBe('regex59.exec(input0);', 'results'); +// Failers +var input1 = " "; +var results = null; +shouldBe('regex59.exec(input1);', 'results'); + +var regex60 = /\S{2,3}/; +var input0 = "12abcd34"; +var results = ["12a"]; +shouldBe('regex60.exec(input0);', 'results'); +var input1 = "1234abcd"; +var results = ["123"]; +shouldBe('regex60.exec(input1);', 'results'); +// Failers +var input2 = " "; +var results = null; +shouldBe('regex60.exec(input2);', 'results'); + +var regex61 = /\S{2,3}?/; +var input0 = "12abcd34"; +var results = ["12"]; +shouldBe('regex61.exec(input0);', 'results'); +var input1 = "1234abcd"; +var results = ["12"]; +shouldBe('regex61.exec(input1);', 'results'); +// Failers +var input2 = " "; +var results = null; +shouldBe('regex61.exec(input2);', 'results'); + +var regex62 = />\s+ <34"; +var results = ["> <"]; +shouldBe('regex62.exec(input0);', 'results'); + +var regex63 = />\s{2,3} <"]; +shouldBe('regex63.exec(input0);', 'results'); +var input1 = "ab> <"]; +shouldBe('regex63.exec(input1);', 'results'); +// Failers +var input2 = "ab> \s{2,3}? <"]; +shouldBe('regex64.exec(input0);', 'results'); +var input1 = "ab> <"]; +shouldBe('regex64.exec(input1);', 'results'); +// Failers +var input2 = "ab> ) constructs. These are not currently valid in ECMAScript, +// but these tests may be useful if similar constructs are introduced in the future. + +//var regex18 = /(?<=aXb)cd/; +//var input0 = "aXbcd"; +//var results = ["cd"]; +//shouldBe('regex18.exec(input0);', 'results'); +// +//var regex19 = /(?<=a\u0100b)cd/; +//var input0 = "a\u0100bcd"; +//var results = ["cd"]; +//shouldBe('regex19.exec(input0);', 'results'); +// +//var regex20 = /(?<=a\u100000b)cd/; +//var input0 = "a\u100000bcd"; +//var results = ["cd"]; +//shouldBe('regex20.exec(input0);', 'results'); +// +//var regex23 = /(?<=(.))X/; +//var input0 = "WXYZ"; +//var results = ["X", "W"]; +//shouldBe('regex23.exec(input0);', 'results'); +//var input1 = "\u0256XYZ"; +//var results = ["X", "\u0256"]; +//shouldBe('regex23.exec(input1);', 'results'); +//// Failers +//var input2 = "XYZ"; +//var results = null; +//shouldBe('regex23.exec(input2);', 'results'); +// +//var regex46 = /(?<=a\u0100{2}b)X/; +//var input0 = "Xyyya\u0100\u0100bXzzz"; +//var results = ["X"]; +//shouldBe('regex46.exec(input0);', 'results'); +// +//var regex83 = /(?<=[\u0100\u0200])X/; +//var input0 = "abc\u0200X"; +//var results = ["X"]; +//shouldBe('regex83.exec(input0);', 'results'); +//var input1 = "abc\u0100X"; +//var results = ["X"]; +//shouldBe('regex83.exec(input1);', 'results'); +//// Failers +//var input2 = "X"; +//var results = null; +//shouldBe('regex83.exec(input2);', 'results'); +// +//var regex84 = /(?<=[Q\u0100\u0200])X/; +//var input0 = "abc\u0200X"; +//var results = ["X"]; +//shouldBe('regex84.exec(input0);', 'results'); +//var input1 = "abc\u0100X"; +//var results = ["X"]; +//shouldBe('regex84.exec(input1);', 'results'); +//var input2 = "abQX"; +//var results = ["X"]; +//shouldBe('regex84.exec(input2);', 'results'); +//// Failers +//var input3 = "X"; +//var results = null; +//shouldBe('regex84.exec(input3);', 'results'); +// +//var regex85 = /(?<=[\u0100\u0200]{3})X/; +//var input0 = "abc\u0100\u0200\u0100X"; +//var results = ["X"]; +//shouldBe('regex85.exec(input0);', 'results'); +//// Failers +//var input1 = "abc\u0200X"; +//var results = null; +//shouldBe('regex85.exec(input1);', 'results'); +//var input2 = "X"; +//var results = null; +//shouldBe('regex85.exec(input2);', 'results'); + +// DISABLED: +// These tests use PCRE's \C token. This is not currently valid in ECMAScript, +// but these tests may be useful if similar constructs are introduced in the future. + +//var regex24 = /X(\C{3})/; +//var input0 = "X\u1234"; +//var results = ["X\u1234", "\u1234"]; +//shouldBe('regex24.exec(input0);', 'results'); +// +//var regex25 = /X(\C{4})/; +//var input0 = "X\u1234YZ"; +//var results = ["X\u1234Y", "\u1234Y"]; +//shouldBe('regex25.exec(input0);', 'results'); +// +//var regex26 = /X\C*/; +//var input0 = "XYZabcdce"; +//var results = ["XYZabcdce"]; +//shouldBe('regex26.exec(input0);', 'results'); +// +//var regex27 = /X\C*?/; +//var input0 = "XYZabcde"; +//var results = ["X"]; +//shouldBe('regex27.exec(input0);', 'results'); +// +//var regex28 = /X\C{3,5}/; +//var input0 = "Xabcdefg"; +//var results = ["Xabcde"]; +//shouldBe('regex28.exec(input0);', 'results'); +//var input1 = "X\u1234"; +//var results = ["X\u1234"]; +//shouldBe('regex28.exec(input1);', 'results'); +//var input2 = "X\u1234YZ"; +//var results = ["X\u1234YZ"]; +//shouldBe('regex28.exec(input2);', 'results'); +//var input3 = "X\u1234\u0512"; +//var results = ["X\u1234\u0512"]; +//shouldBe('regex28.exec(input3);', 'results'); +//var input4 = "X\u1234\u0512YZ"; +//var results = ["X\u1234\u0512"]; +//shouldBe('regex28.exec(input4);', 'results'); +// +//var regex29 = /X\C{3,5}?/; +//var input0 = "Xabcdefg"; +//var results = ["Xabc"]; +//shouldBe('regex29.exec(input0);', 'results'); +//var input1 = "X\u1234"; +//var results = ["X\u1234"]; +//shouldBe('regex29.exec(input1);', 'results'); +//var input2 = "X\u1234YZ"; +//var results = ["X\u1234"]; +//shouldBe('regex29.exec(input2);', 'results'); +//var input3 = "X\u1234\u0512"; +//var results = ["X\u1234"]; +//shouldBe('regex29.exec(input3);', 'results'); +// +//var regex89 = /a\Cb/; +//var input0 = "aXb"; +//var results = ["aXb"]; +//shouldBe('regex89.exec(input0);', 'results'); +//var input1 = "a\nb"; +//var results = ["a\x0ab"]; +//shouldBe('regex89.exec(input1);', 'results'); +// +//var regex90 = /a\Cb/; +//var input0 = "aXb"; +//var results = ["aXb"]; +//shouldBe('regex90.exec(input0);', 'results'); +//var input1 = "a\nb"; +//var results = ["a\u000ab"]; +//shouldBe('regex90.exec(input1);', 'results'); +//// Failers +//var input2 = "a\u0100b"; +//var results = null; +//shouldBe('regex90.exec(input2);', 'results'); diff --git a/deps/v8/test/webkit/fast/regex/quantified-assertions-expected.txt b/deps/v8/test/webkit/fast/regex/quantified-assertions-expected.txt new file mode 100644 index 0000000..717df05 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/quantified-assertions-expected.txt @@ -0,0 +1,49 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This page tests assertions followed by quantifiers. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + + +Testing regexp: /(?=a){0}/gm +PASS regexp.test('a') is true +PASS regexp.lastIndex is 0 + +Testing regexp: /(?=a){1}/gm +PASS regexp.test('a') is true +PASS regexp.lastIndex is 0 + +Testing regexp: /(?!a){0}/gm +PASS regexp.test('b') is true +PASS regexp.lastIndex is 0 + +Testing regexp: /(?!a){1}/gm +PASS regexp.test('b') is true +PASS regexp.lastIndex is 0 +PASS /^(?=a)?b$/.test("b") is true +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/quantified-assertions.js b/deps/v8/test/webkit/fast/regex/quantified-assertions.js new file mode 100644 index 0000000..966ca32 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/quantified-assertions.js @@ -0,0 +1,50 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"This page tests assertions followed by quantifiers." +); + +var regexp; + +regexp = /(?=a){0}/gm; +debug("\nTesting regexp: " + regexp); +shouldBeTrue("regexp.test('a')"); +shouldBe("regexp.lastIndex", "0"); + +regexp = /(?=a){1}/gm; +debug("\nTesting regexp: " + regexp); +shouldBeTrue("regexp.test('a')"); +shouldBe("regexp.lastIndex", "0"); + +regexp = /(?!a){0}/gm; +debug("\nTesting regexp: " + regexp); +shouldBeTrue("regexp.test('b')"); +shouldBe("regexp.lastIndex", "0"); + +regexp = /(?!a){1}/gm; +debug("\nTesting regexp: " + regexp); +shouldBeTrue("regexp.test('b')"); +shouldBe("regexp.lastIndex", "0"); + +shouldBeTrue('/^(?=a)?b$/.test("b")'); diff --git a/deps/v8/test/webkit/fast/regex/repeat-match-waldemar-expected.txt b/deps/v8/test/webkit/fast/regex/repeat-match-waldemar-expected.txt new file mode 100644 index 0000000..e67b862 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/repeat-match-waldemar-expected.txt @@ -0,0 +1,53 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Some test cases identified by Waldemar Horwat in response to this bug: https://bugs.webkit.org/show_bug.cgi?id=48101 + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS /(?:a*?){2,}/.exec("aa") is ["aa"] +PASS /(?:a*?){2,}/.exec("a") is ["a"] +PASS /(?:a*?){2,}/.exec("") is [""] +PASS /(?:a*?)/.exec("aa") is [""] +PASS /(?:a*?)/.exec("a") is [""] +PASS /(?:a*?)/.exec("") is [""] +PASS /(?:a*?)(?:a*?)(?:a*?)/.exec("aa") is [""] +PASS /(?:a*?)(?:a*?)(?:a*?)/.exec("a") is [""] +PASS /(?:a*?)(?:a*?)(?:a*?)/.exec("") is [""] +PASS /(?:a*?){2}/.exec("aa") is [""] +PASS /(?:a*?){2}/.exec("a") is [""] +PASS /(?:a*?){2}/.exec("") is [""] +PASS /(?:a*?){2,3}/.exec("aa") is ["a"] +PASS /(?:a*?){2,3}/.exec("a") is ["a"] +PASS /(?:a*?){2,3}/.exec("") is [""] +PASS /(?:a*?)?/.exec("aa") is ["a"] +PASS /(?:a*?)?/.exec("a") is ["a"] +PASS /(?:a*?)?/.exec("") is [""] +PASS /(?:a*?)*/.exec("aa") is ["aa"] +PASS /(?:a*?)*/.exec("a") is ["a"] +PASS /(?:a*?)*/.exec("") is [""] +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/repeat-match-waldemar.js b/deps/v8/test/webkit/fast/regex/repeat-match-waldemar.js new file mode 100644 index 0000000..85cb20b --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/repeat-match-waldemar.js @@ -0,0 +1,54 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description( +"Some test cases identified by Waldemar Horwat in response to this bug: https://bugs.webkit.org/show_bug.cgi?id=48101" +); + +shouldBe('/(?:a*?){2,}/.exec("aa")', '["aa"]'); +shouldBe('/(?:a*?){2,}/.exec("a")', '["a"]'); +shouldBe('/(?:a*?){2,}/.exec("")', '[""]'); + +shouldBe('/(?:a*?)/.exec("aa")', '[""]'); +shouldBe('/(?:a*?)/.exec("a")', '[""]'); +shouldBe('/(?:a*?)/.exec("")', '[""]'); + +shouldBe('/(?:a*?)(?:a*?)(?:a*?)/.exec("aa")', '[""]'); +shouldBe('/(?:a*?)(?:a*?)(?:a*?)/.exec("a")', '[""]'); +shouldBe('/(?:a*?)(?:a*?)(?:a*?)/.exec("")', '[""]'); + +shouldBe('/(?:a*?){2}/.exec("aa")', '[""]'); +shouldBe('/(?:a*?){2}/.exec("a")', '[""]'); +shouldBe('/(?:a*?){2}/.exec("")', '[""]'); + +shouldBe('/(?:a*?){2,3}/.exec("aa")', '["a"]'); +shouldBe('/(?:a*?){2,3}/.exec("a")', '["a"]'); +shouldBe('/(?:a*?){2,3}/.exec("")', '[""]'); + +shouldBe('/(?:a*?)?/.exec("aa")', '["a"]'); +shouldBe('/(?:a*?)?/.exec("a")', '["a"]'); +shouldBe('/(?:a*?)?/.exec("")', '[""]'); + +shouldBe('/(?:a*?)*/.exec("aa")', '["aa"]'); +shouldBe('/(?:a*?)*/.exec("a")', '["a"]'); +shouldBe('/(?:a*?)*/.exec("")', '[""]'); diff --git a/deps/v8/test/webkit/fast/regex/toString-expected.txt b/deps/v8/test/webkit/fast/regex/toString-expected.txt new file mode 100644 index 0000000..a6eefd9 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/toString-expected.txt @@ -0,0 +1,60 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This page tests toString conversion of RegExp objects, particularly wrt to '/' characters and RegExp.prototype. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +FAIL RegExp('/').source should be \/. Was /. +PASS RegExp('').source is "(?:)" +PASS RegExp.prototype.source is "(?:)" +FAIL RegExp('/').toString() should be /\//. Was ///. +PASS RegExp('').toString() is "/(?:)/" +PASS RegExp.prototype.toString() is "/(?:)/" +FAIL testForwardSlash("^/$", "/"); should be true. Threw exception SyntaxError: Unexpected end of input +FAIL testForwardSlash("^/$", "/"); should be true. Threw exception SyntaxError: Unexpected end of input +FAIL testForwardSlash("^\/$", "/"); should be true. Threw exception SyntaxError: Unexpected end of input +PASS testForwardSlash("^\\/$", "\/"); is true +PASS testForwardSlash("^\\\/$", "\/"); is true +FAIL testForwardSlash("^\\\\/$", "\\/"); should be true. Threw exception SyntaxError: Unexpected end of input +FAIL testForwardSlash("^\\\\\/$", "\\/"); should be true. Threw exception SyntaxError: Unexpected end of input +FAIL testForwardSlash("x/x/x", "x\/x\/x"); should be true. Threw exception SyntaxError: Unexpected end of input +FAIL testForwardSlash("x\/x/x", "x\/x\/x"); should be true. Threw exception SyntaxError: Unexpected end of input +FAIL testForwardSlash("x/x\/x", "x\/x\/x"); should be true. Threw exception SyntaxError: Unexpected end of input +FAIL testForwardSlash("x\/x\/x", "x\/x\/x"); should be true. Threw exception SyntaxError: Unexpected end of input +FAIL testLineTerminator("\n"); should be false. Was true. +PASS testLineTerminator("\\n"); is false +FAIL testLineTerminator("\r"); should be false. Was true. +PASS testLineTerminator("\\r"); is false +FAIL testLineTerminator("\u2028"); should be false. Was true. +PASS testLineTerminator("\\u2028"); is false +FAIL testLineTerminator("\u2029"); should be false. Was true. +PASS testLineTerminator("\\u2029"); is false +PASS RegExp('[/]').source is '[/]' +FAIL RegExp('\\[/]').source should be \[\/]. Was \[/]. +PASS var o = new RegExp(); o.toString() === '/'+o.source+'/' && eval(o.toString()+'.exec(String())') is [""] +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/toString.js b/deps/v8/test/webkit/fast/regex/toString.js new file mode 100644 index 0000000..a76fbe8 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/toString.js @@ -0,0 +1,87 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description("This page tests toString conversion of RegExp objects, particularly wrt to '/' characters and RegExp.prototype."); + +function testForwardSlash(pattern, _string) +{ + string = _string; + + re1 = new RegExp(pattern); + re2 = eval(re1.toString()); + + return re1.test(string) && re2.test(string); +} + +function testLineTerminator(pattern) +{ + re1 = new RegExp(pattern); + + return /\n|\r|\u2028|\u2029/.test(re1.toString()); +} + +shouldBe("RegExp('/').source", '"\\\\/"'); +shouldBe("RegExp('').source", '"(?:)"'); +shouldBe("RegExp.prototype.source", '"(?:)"'); + +shouldBe("RegExp('/').toString()", '"/\\\\//"'); +shouldBe("RegExp('').toString()", '"/(?:)/"'); +shouldBe("RegExp.prototype.toString()", '"/(?:)/"'); + +// These strings are equivalent, since the '\' is identity escaping the '/' at the string level. +shouldBeTrue('testForwardSlash("^/$", "/");'); +shouldBeTrue('testForwardSlash("^\/$", "/");'); +// This string passes "^\/$" to the RegExp, so the '/' is escaped in the re! +shouldBeTrue('testForwardSlash("^\\/$", "/");'); +// These strings pass "^\\/$" and "^\\\/$" respectively to the RegExp, giving one '\' to match. +shouldBeTrue('testForwardSlash("^\\\\/$", "\\/");'); +shouldBeTrue('testForwardSlash("^\\\\\\/$", "\\/");'); +// These strings match two backslashes (the second with the '/' escaped). +shouldBeTrue('testForwardSlash("^\\\\\\\\/$", "\\\\/");'); +shouldBeTrue('testForwardSlash("^\\\\\\\\\\/$", "\\\\/");'); +// Test that nothing goes wrongif there are multiple forward slashes! +shouldBeTrue('testForwardSlash("x/x/x", "x\\/x\\/x");'); +shouldBeTrue('testForwardSlash("x\\/x/x", "x\\/x\\/x");'); +shouldBeTrue('testForwardSlash("x/x\\/x", "x\\/x\\/x");'); +shouldBeTrue('testForwardSlash("x\\/x\\/x", "x\\/x\\/x");'); + +shouldBeFalse('testLineTerminator("\\n");'); +shouldBeFalse('testLineTerminator("\\\\n");'); +shouldBeFalse('testLineTerminator("\\r");'); +shouldBeFalse('testLineTerminator("\\\\r");'); +shouldBeFalse('testLineTerminator("\\u2028");'); +shouldBeFalse('testLineTerminator("\\\\u2028");'); +shouldBeFalse('testLineTerminator("\\u2029");'); +shouldBeFalse('testLineTerminator("\\\\u2029");'); + +shouldBe("RegExp('[/]').source", "'[/]'"); +shouldBe("RegExp('\\\\[/]').source", "'\\\\[\\\\/]'"); + +// See 15.10.6.4 +// The first half of this checks that: +// Return the String value formed by concatenating the Strings "/", the +// String value of the source property of this RegExp object, and "/"; +// The second half checks that: +// The returned String has the form of a RegularExpressionLiteral that +// evaluates to another RegExp object with the same behaviour as this object. +shouldBe("var o = new RegExp(); o.toString() === '/'+o.source+'/' && eval(o.toString()+'.exec(String())')", '[""]'); diff --git a/deps/v8/test/webkit/fast/regex/unicodeCaseInsensitive-expected.txt b/deps/v8/test/webkit/fast/regex/unicodeCaseInsensitive-expected.txt new file mode 100644 index 0000000..2b80b36 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/unicodeCaseInsensitive-expected.txt @@ -0,0 +1,349 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +https://bugs.webkit.org/show_bug.cgi?id=82063 + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS /ΣΤΙΓΜΑΣ/i.test("στιγμας") is true +PASS /ΔΣΔ/i.test("δςδ") is true +PASS /ς/i.test("σ") is true +PASS /σ/i.test("ς") is true +PASS /἖/i.test("἖") is true +PASS /DŽ/i.test("DŽ") is true +PASS /[ǃ-Dž]/i.test("DŽ") is true +PASS /DŽ/i.test("Dž") is true +PASS /[ǃ-Dž]/i.test("Dž") is true +PASS /DŽ/i.test("dž") is true +PASS /[ǃ-Dž]/i.test("dž") is true +PASS /Dž/i.test("DŽ") is true +PASS /[DŽ-dž]/i.test("DŽ") is true +PASS /Dž/i.test("Dž") is true +PASS /[DŽ-dž]/i.test("Dž") is true +PASS /Dž/i.test("dž") is true +PASS /[DŽ-dž]/i.test("dž") is true +PASS /dž/i.test("DŽ") is true +PASS /[Dž-LJ]/i.test("DŽ") is true +PASS /dž/i.test("Dž") is true +PASS /[Dž-LJ]/i.test("Dž") is true +PASS /dž/i.test("dž") is true +PASS /[Dž-LJ]/i.test("dž") is true +PASS /LJ/i.test("LJ") is true +PASS /[dž-Lj]/i.test("LJ") is true +PASS /LJ/i.test("Lj") is true +PASS /[dž-Lj]/i.test("Lj") is true +PASS /LJ/i.test("lj") is true +PASS /[dž-Lj]/i.test("lj") is true +PASS /Lj/i.test("LJ") is true +PASS /[LJ-lj]/i.test("LJ") is true +PASS /Lj/i.test("Lj") is true +PASS /[LJ-lj]/i.test("Lj") is true +PASS /Lj/i.test("lj") is true +PASS /[LJ-lj]/i.test("lj") is true +PASS /lj/i.test("LJ") is true +PASS /[Lj-NJ]/i.test("LJ") is true +PASS /lj/i.test("Lj") is true +PASS /[Lj-NJ]/i.test("Lj") is true +PASS /lj/i.test("lj") is true +PASS /[Lj-NJ]/i.test("lj") is true +PASS /NJ/i.test("NJ") is true +PASS /[lj-Nj]/i.test("NJ") is true +PASS /NJ/i.test("Nj") is true +PASS /[lj-Nj]/i.test("Nj") is true +PASS /NJ/i.test("nj") is true +PASS /[lj-Nj]/i.test("nj") is true +PASS /Nj/i.test("NJ") is true +PASS /[NJ-nj]/i.test("NJ") is true +PASS /Nj/i.test("Nj") is true +PASS /[NJ-nj]/i.test("Nj") is true +PASS /Nj/i.test("nj") is true +PASS /[NJ-nj]/i.test("nj") is true +PASS /nj/i.test("NJ") is true +PASS /[Nj-Ǎ]/i.test("NJ") is true +PASS /nj/i.test("Nj") is true +PASS /[Nj-Ǎ]/i.test("Nj") is true +PASS /nj/i.test("nj") is true +PASS /[Nj-Ǎ]/i.test("nj") is true +PASS /DZ/i.test("DZ") is true +PASS /[ǰ-Dz]/i.test("DZ") is true +PASS /DZ/i.test("Dz") is true +PASS /[ǰ-Dz]/i.test("Dz") is true +PASS /DZ/i.test("dz") is true +PASS /[ǰ-Dz]/i.test("dz") is true +PASS /Dz/i.test("DZ") is true +PASS /[DZ-dz]/i.test("DZ") is true +PASS /Dz/i.test("Dz") is true +PASS /[DZ-dz]/i.test("Dz") is true +PASS /Dz/i.test("dz") is true +PASS /[DZ-dz]/i.test("dz") is true +PASS /dz/i.test("DZ") is true +PASS /[Dz-Ǵ]/i.test("DZ") is true +PASS /dz/i.test("Dz") is true +PASS /[Dz-Ǵ]/i.test("Dz") is true +PASS /dz/i.test("dz") is true +PASS /[Dz-Ǵ]/i.test("dz") is true +PASS /Β/i.test("Β") is true +PASS /[Α-Γ]/i.test("Β") is true +PASS /Β/i.test("β") is true +PASS /[Α-Γ]/i.test("β") is true +PASS /Β/i.test("ϐ") is true +PASS /[Α-Γ]/i.test("ϐ") is true +PASS /β/i.test("Β") is true +PASS /[α-γ]/i.test("Β") is true +PASS /β/i.test("β") is true +PASS /[α-γ]/i.test("β") is true +PASS /β/i.test("ϐ") is true +PASS /[α-γ]/i.test("ϐ") is true +PASS /ϐ/i.test("Β") is true +PASS /[Ϗ-ϑ]/i.test("Β") is true +PASS /ϐ/i.test("β") is true +PASS /[Ϗ-ϑ]/i.test("β") is true +PASS /ϐ/i.test("ϐ") is true +PASS /[Ϗ-ϑ]/i.test("ϐ") is true +PASS /Ε/i.test("Ε") is true +PASS /[Δ-Ζ]/i.test("Ε") is true +PASS /Ε/i.test("ε") is true +PASS /[Δ-Ζ]/i.test("ε") is true +PASS /Ε/i.test("ϵ") is true +PASS /[Δ-Ζ]/i.test("ϵ") is true +PASS /ε/i.test("Ε") is true +PASS /[δ-ζ]/i.test("Ε") is true +PASS /ε/i.test("ε") is true +PASS /[δ-ζ]/i.test("ε") is true +PASS /ε/i.test("ϵ") is true +PASS /[δ-ζ]/i.test("ϵ") is true +PASS /ϵ/i.test("Ε") is true +PASS /[ϴ-϶]/i.test("Ε") is true +PASS /ϵ/i.test("ε") is true +PASS /[ϴ-϶]/i.test("ε") is true +PASS /ϵ/i.test("ϵ") is true +PASS /[ϴ-϶]/i.test("ϵ") is true +PASS /Θ/i.test("Θ") is true +PASS /[Η-Ι]/i.test("Θ") is true +PASS /Θ/i.test("θ") is true +PASS /[Η-Ι]/i.test("θ") is true +PASS /Θ/i.test("ϑ") is true +PASS /[Η-Ι]/i.test("ϑ") is true +PASS /θ/i.test("Θ") is true +PASS /[η-ι]/i.test("Θ") is true +PASS /θ/i.test("θ") is true +PASS /[η-ι]/i.test("θ") is true +PASS /θ/i.test("ϑ") is true +PASS /[η-ι]/i.test("ϑ") is true +PASS /ϑ/i.test("Θ") is true +PASS /[ϐ-ϒ]/i.test("Θ") is true +PASS /ϑ/i.test("θ") is true +PASS /[ϐ-ϒ]/i.test("θ") is true +PASS /ϑ/i.test("ϑ") is true +PASS /[ϐ-ϒ]/i.test("ϑ") is true +PASS /ͅ/i.test("ͅ") is true +PASS /[̈́-͆]/i.test("ͅ") is true +PASS /ͅ/i.test("Ι") is true +PASS /[̈́-͆]/i.test("Ι") is true +PASS /ͅ/i.test("ι") is true +PASS /[̈́-͆]/i.test("ι") is true +PASS /ͅ/i.test("ι") is true +PASS /[̈́-͆]/i.test("ι") is true +PASS /Ι/i.test("ͅ") is true +PASS /[Θ-Κ]/i.test("ͅ") is true +PASS /Ι/i.test("Ι") is true +PASS /[Θ-Κ]/i.test("Ι") is true +PASS /Ι/i.test("ι") is true +PASS /[Θ-Κ]/i.test("ι") is true +PASS /Ι/i.test("ι") is true +PASS /[Θ-Κ]/i.test("ι") is true +PASS /ι/i.test("ͅ") is true +PASS /[θ-κ]/i.test("ͅ") is true +PASS /ι/i.test("Ι") is true +PASS /[θ-κ]/i.test("Ι") is true +PASS /ι/i.test("ι") is true +PASS /[θ-κ]/i.test("ι") is true +PASS /ι/i.test("ι") is true +PASS /[θ-κ]/i.test("ι") is true +PASS /ι/i.test("ͅ") is true +PASS /[᾽-᾿]/i.test("ͅ") is true +PASS /ι/i.test("Ι") is true +PASS /[᾽-᾿]/i.test("Ι") is true +PASS /ι/i.test("ι") is true +PASS /[᾽-᾿]/i.test("ι") is true +PASS /ι/i.test("ι") is true +PASS /[᾽-᾿]/i.test("ι") is true +PASS /Κ/i.test("Κ") is true +PASS /[Ι-Λ]/i.test("Κ") is true +PASS /Κ/i.test("κ") is true +PASS /[Ι-Λ]/i.test("κ") is true +PASS /Κ/i.test("ϰ") is true +PASS /[Ι-Λ]/i.test("ϰ") is true +PASS /κ/i.test("Κ") is true +PASS /[ι-λ]/i.test("Κ") is true +PASS /κ/i.test("κ") is true +PASS /[ι-λ]/i.test("κ") is true +PASS /κ/i.test("ϰ") is true +PASS /[ι-λ]/i.test("ϰ") is true +PASS /ϰ/i.test("Κ") is true +PASS /[ϯ-ϱ]/i.test("Κ") is true +PASS /ϰ/i.test("κ") is true +PASS /[ϯ-ϱ]/i.test("κ") is true +PASS /ϰ/i.test("ϰ") is true +PASS /[ϯ-ϱ]/i.test("ϰ") is true +PASS /µ/i.test("µ") is true +PASS /[´-¶]/i.test("µ") is true +PASS /µ/i.test("Μ") is true +PASS /[´-¶]/i.test("Μ") is true +PASS /µ/i.test("μ") is true +PASS /[´-¶]/i.test("μ") is true +PASS /Μ/i.test("µ") is true +PASS /[Λ-Ν]/i.test("µ") is true +PASS /Μ/i.test("Μ") is true +PASS /[Λ-Ν]/i.test("Μ") is true +PASS /Μ/i.test("μ") is true +PASS /[Λ-Ν]/i.test("μ") is true +PASS /μ/i.test("µ") is true +PASS /[λ-ν]/i.test("µ") is true +PASS /μ/i.test("Μ") is true +PASS /[λ-ν]/i.test("Μ") is true +PASS /μ/i.test("μ") is true +PASS /[λ-ν]/i.test("μ") is true +PASS /Π/i.test("Π") is true +PASS /[Ο-Ρ]/i.test("Π") is true +PASS /Π/i.test("π") is true +PASS /[Ο-Ρ]/i.test("π") is true +PASS /Π/i.test("ϖ") is true +PASS /[Ο-Ρ]/i.test("ϖ") is true +PASS /π/i.test("Π") is true +PASS /[ο-ρ]/i.test("Π") is true +PASS /π/i.test("π") is true +PASS /[ο-ρ]/i.test("π") is true +PASS /π/i.test("ϖ") is true +PASS /[ο-ρ]/i.test("ϖ") is true +PASS /ϖ/i.test("Π") is true +PASS /[ϕ-ϗ]/i.test("Π") is true +PASS /ϖ/i.test("π") is true +PASS /[ϕ-ϗ]/i.test("π") is true +PASS /ϖ/i.test("ϖ") is true +PASS /[ϕ-ϗ]/i.test("ϖ") is true +PASS /Ρ/i.test("Ρ") is true +PASS /[Π-΢]/i.test("Ρ") is true +PASS /Ρ/i.test("ρ") is true +PASS /[Π-΢]/i.test("ρ") is true +PASS /Ρ/i.test("ϱ") is true +PASS /[Π-΢]/i.test("ϱ") is true +PASS /ρ/i.test("Ρ") is true +PASS /[π-ς]/i.test("Ρ") is true +PASS /ρ/i.test("ρ") is true +PASS /[π-ς]/i.test("ρ") is true +PASS /ρ/i.test("ϱ") is true +PASS /[π-ς]/i.test("ϱ") is true +PASS /ϱ/i.test("Ρ") is true +PASS /[ϰ-ϲ]/i.test("Ρ") is true +PASS /ϱ/i.test("ρ") is true +PASS /[ϰ-ϲ]/i.test("ρ") is true +PASS /ϱ/i.test("ϱ") is true +PASS /[ϰ-ϲ]/i.test("ϱ") is true +PASS /Σ/i.test("Σ") is true +PASS /[΢-Τ]/i.test("Σ") is true +PASS /Σ/i.test("ς") is true +PASS /[΢-Τ]/i.test("ς") is true +PASS /Σ/i.test("σ") is true +PASS /[΢-Τ]/i.test("σ") is true +PASS /ς/i.test("Σ") is true +PASS /[ρ-σ]/i.test("Σ") is true +PASS /ς/i.test("ς") is true +PASS /[ρ-σ]/i.test("ς") is true +PASS /ς/i.test("σ") is true +PASS /[ρ-σ]/i.test("σ") is true +PASS /σ/i.test("Σ") is true +PASS /[ς-τ]/i.test("Σ") is true +PASS /σ/i.test("ς") is true +PASS /[ς-τ]/i.test("ς") is true +PASS /σ/i.test("σ") is true +PASS /[ς-τ]/i.test("σ") is true +PASS /Φ/i.test("Φ") is true +PASS /[Υ-Χ]/i.test("Φ") is true +PASS /Φ/i.test("φ") is true +PASS /[Υ-Χ]/i.test("φ") is true +PASS /Φ/i.test("ϕ") is true +PASS /[Υ-Χ]/i.test("ϕ") is true +PASS /φ/i.test("Φ") is true +PASS /[υ-χ]/i.test("Φ") is true +PASS /φ/i.test("φ") is true +PASS /[υ-χ]/i.test("φ") is true +PASS /φ/i.test("ϕ") is true +PASS /[υ-χ]/i.test("ϕ") is true +PASS /ϕ/i.test("Φ") is true +PASS /[ϔ-ϖ]/i.test("Φ") is true +PASS /ϕ/i.test("φ") is true +PASS /[ϔ-ϖ]/i.test("φ") is true +PASS /ϕ/i.test("ϕ") is true +PASS /[ϔ-ϖ]/i.test("ϕ") is true +PASS /Ṡ/i.test("Ṡ") is true +PASS /[ṟ-ṡ]/i.test("Ṡ") is true +PASS /Ṡ/i.test("ṡ") is true +PASS /[ṟ-ṡ]/i.test("ṡ") is true +PASS /Ṡ/i.test("ẛ") is true +PASS /[ṟ-ṡ]/i.test("ẛ") is true +PASS /ṡ/i.test("Ṡ") is true +PASS /[Ṡ-Ṣ]/i.test("Ṡ") is true +PASS /ṡ/i.test("ṡ") is true +PASS /[Ṡ-Ṣ]/i.test("ṡ") is true +PASS /ṡ/i.test("ẛ") is true +PASS /[Ṡ-Ṣ]/i.test("ẛ") is true +PASS /ẛ/i.test("Ṡ") is true +PASS /[ẚ-ẜ]/i.test("Ṡ") is true +PASS /ẛ/i.test("ṡ") is true +PASS /[ẚ-ẜ]/i.test("ṡ") is true +PASS /ẛ/i.test("ẛ") is true +PASS /[ẚ-ẜ]/i.test("ẛ") is true +PASS /Ϗ/i.test("Ϗ") is true +PASS /ϗ/i.test("Ϗ") is true +PASS /Ϗ/i.test("ϗ") is true +PASS /ϗ/i.test("ϗ") is true +PASS /ἑ/i.test("ἑ") is true +PASS /Ἑ/i.test("ἑ") is true +PASS /ἑ/i.test("Ἑ") is true +PASS /Ἑ/i.test("Ἑ") is true +PASS /҉/i.test("Ҋ") is false +PASS /Ҋ/i.test("Ҋ") is true +PASS /ҋ/i.test("Ҋ") is true +PASS /Ҍ/i.test("Ҋ") is false +PASS /҉/i.test("ҋ") is false +PASS /Ҋ/i.test("ҋ") is true +PASS /ҋ/i.test("ҋ") is true +PASS /Ҍ/i.test("ҋ") is false +PASS /[҉-Ҋ]/i.test("ҋ") is true +PASS /[ҋ-Ҍ]/i.test("Ҋ") is true +PASS /ӄ/i.test("Ӆ") is false +PASS /Ӆ/i.test("Ӆ") is true +PASS /ӆ/i.test("Ӆ") is true +PASS /Ӈ/i.test("Ӆ") is false +PASS /ӄ/i.test("ӆ") is false +PASS /Ӆ/i.test("ӆ") is true +PASS /ӆ/i.test("ӆ") is true +PASS /Ӈ/i.test("ӆ") is false +PASS /[ӄ-Ӆ]/i.test("ӆ") is true +PASS /[ӆ-Ӈ]/i.test("Ӆ") is true +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/regex/unicodeCaseInsensitive.js b/deps/v8/test/webkit/fast/regex/unicodeCaseInsensitive.js new file mode 100644 index 0000000..3fb0a29 --- /dev/null +++ b/deps/v8/test/webkit/fast/regex/unicodeCaseInsensitive.js @@ -0,0 +1,101 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +description("https://bugs.webkit.org/show_bug.cgi?id=82063"); + +shouldBeTrue('/ΣΤΙΓΜΑΣ/i.test("στιγμας")'); +shouldBeTrue('/ΔΣΔ/i.test("δςδ")'); +shouldBeTrue('/ς/i.test("σ")'); +shouldBeTrue('/σ/i.test("ς")'); + +// Simple case, has no canonical equivalents +shouldBeTrue('/\u1f16/i.test("\u1f16")') + +// Test the sets of USC2 code points that have more than one canonically equivalent value. +function ucs2CodePoint(x) +{ + var s = x.toString(16); + while (s.length < 4) + s = 0 + s; + return eval('"\\u' + s + '"'); +} +function testSet(set) +{ + for (i in set) { + for (j in set) { + shouldBeTrue('/' + ucs2CodePoint(set[i]) + '/i.test("' + ucs2CodePoint(set[j]) + '")') + shouldBeTrue('/[' + ucs2CodePoint(set[i] - 1) + '-' + ucs2CodePoint(set[i] + 1) + ']/i.test("' + ucs2CodePoint(set[j]) + '")') + } + } +} +testSet([ 0x01c4, 0x01c5, 0x01c6 ]); +testSet([ 0x01c7, 0x01c8, 0x01c9 ]); +testSet([ 0x01ca, 0x01cb, 0x01cc ]); +testSet([ 0x01f1, 0x01f2, 0x01f3 ]); +testSet([ 0x0392, 0x03b2, 0x03d0 ]); +testSet([ 0x0395, 0x03b5, 0x03f5 ]); +testSet([ 0x0398, 0x03b8, 0x03d1 ]); +testSet([ 0x0345, 0x0399, 0x03b9, 0x1fbe ]); +testSet([ 0x039a, 0x03ba, 0x03f0 ]); +testSet([ 0x00b5, 0x039c, 0x03bc ]); +testSet([ 0x03a0, 0x03c0, 0x03d6 ]); +testSet([ 0x03a1, 0x03c1, 0x03f1 ]); +testSet([ 0x03a3, 0x03c2, 0x03c3 ]); +testSet([ 0x03a6, 0x03c6, 0x03d5 ]); +testSet([ 0x1e60, 0x1e61, 0x1e9b ]); + +// Test a couple of lo/hi pairs +shouldBeTrue('/\u03cf/i.test("\u03cf")') +shouldBeTrue('/\u03d7/i.test("\u03cf")') +shouldBeTrue('/\u03cf/i.test("\u03d7")') +shouldBeTrue('/\u03d7/i.test("\u03d7")') +shouldBeTrue('/\u1f11/i.test("\u1f11")') +shouldBeTrue('/\u1f19/i.test("\u1f11")') +shouldBeTrue('/\u1f11/i.test("\u1f19")') +shouldBeTrue('/\u1f19/i.test("\u1f19")') + +// Test an aligned alternating capitalization pair. +shouldBeFalse('/\u0489/i.test("\u048a")') +shouldBeTrue('/\u048a/i.test("\u048a")') +shouldBeTrue('/\u048b/i.test("\u048a")') +shouldBeFalse('/\u048c/i.test("\u048a")') +shouldBeFalse('/\u0489/i.test("\u048b")') +shouldBeTrue('/\u048a/i.test("\u048b")') +shouldBeTrue('/\u048b/i.test("\u048b")') +shouldBeFalse('/\u048c/i.test("\u048b")') +shouldBeTrue('/[\u0489-\u048a]/i.test("\u048b")') +shouldBeTrue('/[\u048b-\u048c]/i.test("\u048a")') + +// Test an unaligned alternating capitalization pair. +shouldBeFalse('/\u04c4/i.test("\u04c5")') +shouldBeTrue('/\u04c5/i.test("\u04c5")') +shouldBeTrue('/\u04c6/i.test("\u04c5")') +shouldBeFalse('/\u04c7/i.test("\u04c5")') +shouldBeFalse('/\u04c4/i.test("\u04c6")') +shouldBeTrue('/\u04c5/i.test("\u04c6")') +shouldBeTrue('/\u04c6/i.test("\u04c6")') +shouldBeFalse('/\u04c7/i.test("\u04c6")') +shouldBeTrue('/[\u04c4-\u04c5]/i.test("\u04c6")') +shouldBeTrue('/[\u04c6-\u04c7]/i.test("\u04c5")') + +var successfullyParsed = true; diff --git a/deps/v8/test/webkit/resources/standalone-pre.js b/deps/v8/test/webkit/resources/standalone-pre.js index f1cbe9f..5f164db 100644 --- a/deps/v8/test/webkit/resources/standalone-pre.js +++ b/deps/v8/test/webkit/resources/standalone-pre.js @@ -22,11 +22,15 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. var wasPostTestScriptParsed = false; -var errorMessage; + +function removeLink(text) +{ + return text.replace(/]*>/g, "").replace(/<\/a>/g, ""); +} function description(msg) { - print(msg); + print(removeLink(msg)); print("\nOn success, you will see a series of \"PASS\" messages, followed by \"TEST COMPLETE\".\n"); print(); } @@ -48,7 +52,6 @@ function testPassed(msg) function testFailed(msg) { - errorMessage = msg; print("FAIL", escapeString(msg)); } @@ -173,9 +176,7 @@ function shouldThrow(_a, _e) function isSuccessfullyParsed() { - // FIXME: Remove this and only report unexpected syntax errors. - if (!errorMessage) - successfullyParsed = true; + successfullyParsed = true; shouldBeTrue("successfullyParsed"); debug("\nTEST COMPLETE\n"); } diff --git a/deps/v8/tools/blink_tests/TestExpectations b/deps/v8/tools/blink_tests/TestExpectations index b5f4905..c5596eb 100644 --- a/deps/v8/tools/blink_tests/TestExpectations +++ b/deps/v8/tools/blink_tests/TestExpectations @@ -25,3 +25,6 @@ crbug.com/178745 [ Win Debug ] plugins/open-and-close-window-with-plugin.html [ [ Linux Debug ] fast/js/regress/function-dot-apply.html [ Slow ] crbug.com/249894 [ Linux Debug ] fast/js/regress/inline-arguments-access.html [ Pass Failure Crash Slow ] [ Linux Debug ] fast/js/regress/inline-arguments-local-escape.html [ Slow ] + +# Slow on windows: +webkit.org/b/48655 [ Win ] plugins/js-from-destroy.html [ Crash Slow ] diff --git a/deps/v8/tools/gyp/v8.gyp b/deps/v8/tools/gyp/v8.gyp index 3f66603..a80f591 100644 --- a/deps/v8/tools/gyp/v8.gyp +++ b/deps/v8/tools/gyp/v8.gyp @@ -337,6 +337,8 @@ '../../src/heap.h', '../../src/hydrogen-bce.cc', '../../src/hydrogen-bce.h', + '../../src/hydrogen-bch.cc', + '../../src/hydrogen-bch.h', '../../src/hydrogen-canonicalize.cc', '../../src/hydrogen-canonicalize.h', '../../src/hydrogen-dce.cc', @@ -430,9 +432,6 @@ '../../src/parser.cc', '../../src/parser.h', '../../src/platform-posix.h', - '../../src/platform-tls-mac.h', - '../../src/platform-tls-win32.h', - '../../src/platform-tls.h', '../../src/platform.h', '../../src/preparse-data-format.h', '../../src/preparse-data.cc', diff --git a/deps/v8/tools/run-deopt-fuzzer.py b/deps/v8/tools/run-deopt-fuzzer.py new file mode 100755 index 0000000..e53f269 --- /dev/null +++ b/deps/v8/tools/run-deopt-fuzzer.py @@ -0,0 +1,467 @@ +#!/usr/bin/env python +# +# Copyright 2012 the V8 project authors. All rights reserved. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +import json +import math +import multiprocessing +import optparse +import os +from os.path import join +import random +import shlex +import subprocess +import sys +import time + +from testrunner.local import execution +from testrunner.local import progress +from testrunner.local import testsuite +from testrunner.local import utils +from testrunner.local import verbose +from testrunner.objects import context + + +ARCH_GUESS = utils.DefaultArch() +DEFAULT_TESTS = ["mjsunit"] +TIMEOUT_DEFAULT = 60 +TIMEOUT_SCALEFACTOR = {"debug" : 4, + "release" : 1 } + +MODE_FLAGS = { + "debug" : ["--nobreak-on-abort", "--nodead-code-elimination", + "--nofold-constants", "--enable-slow-asserts", + "--debug-code", "--verify-heap", + "--noparallel-recompilation"], + "release" : ["--nobreak-on-abort", "--nodead-code-elimination", + "--nofold-constants", "--noparallel-recompilation"]} + +SUPPORTED_ARCHS = ["android_arm", + "android_ia32", + "arm", + "ia32", + "mipsel", + "nacl_ia32", + "nacl_x64", + "x64"] +# Double the timeout for these: +SLOW_ARCHS = ["android_arm", + "android_ia32", + "arm", + "mipsel", + "nacl_ia32", + "nacl_x64"] +MAX_DEOPT = 1000000000 +DISTRIBUTION_MODES = ["smooth", "random"] + + +class RandomDistribution: + def __init__(self, seed=None): + seed = seed or random.randint(1, sys.maxint) + print "Using random distribution with seed %d" % seed + self._random = random.Random(seed) + + def Distribute(self, n, m): + if n > m: + n = m + return self._random.sample(xrange(1, m + 1), n) + + +class SmoothDistribution: + """Distribute n numbers into the interval [1:m]. + F1: Factor of the first derivation of the distribution function. + F2: Factor of the second derivation of the distribution function. + With F1 and F2 set to 0, the distribution will be equal. + """ + def __init__(self, factor1=2.0, factor2=0.2): + self._factor1 = factor1 + self._factor2 = factor2 + + def Distribute(self, n, m): + if n > m: + n = m + if n <= 1: + return [ 1 ] + + result = [] + x = 0.0 + dx = 1.0 + ddx = self._factor1 + dddx = self._factor2 + for i in range(0, n): + result += [ x ] + x += dx + dx += ddx + ddx += dddx + + # Project the distribution into the interval [0:M]. + result = [ x * m / result[-1] for x in result ] + + # Equalize by n. The closer n is to m, the more equal will be the + # distribution. + for (i, x) in enumerate(result): + # The value of x if it was equally distributed. + equal_x = i / float(n - 1) * float(m - 1) + 1 + + # Difference factor between actual and equal distribution. + diff = 1 - (x / equal_x) + + # Equalize x dependent on the number of values to distribute. + result[i] = int(x + (i + 1) * diff) + return result + + +def Distribution(options): + if options.distribution_mode == "random": + return RandomDistribution(options.seed) + if options.distribution_mode == "smooth": + return SmoothDistribution(options.distribution_factor1, + options.distribution_factor2) + + +def BuildOptions(): + result = optparse.OptionParser() + result.add_option("--arch", + help=("The architecture to run tests for, " + "'auto' or 'native' for auto-detect"), + default="ia32,x64,arm") + result.add_option("--arch-and-mode", + help="Architecture and mode in the format 'arch.mode'", + default=None) + result.add_option("--buildbot", + help="Adapt to path structure used on buildbots", + default=False, action="store_true") + result.add_option("--command-prefix", + help="Prepended to each shell command used to run a test", + default="") + result.add_option("--coverage", help=("Exponential test coverage " + "(range 0.0, 1.0) -- 0.0: one test, 1.0 all tests (slow)"), + default=0.4, type="float") + result.add_option("--coverage-lift", help=("Lifts test coverage for tests " + "with a small number of deopt points (range 0, inf)"), + default=20, type="int") + result.add_option("--download-data", help="Download missing test suite data", + default=False, action="store_true") + result.add_option("--distribution-factor1", help=("Factor of the first " + "derivation of the distribution function"), default=2.0, + type="float") + result.add_option("--distribution-factor2", help=("Factor of the second " + "derivation of the distribution function"), default=0.7, + type="float") + result.add_option("--distribution-mode", help=("How to select deopt points " + "for a given test (smooth|random)"), + default="smooth") + result.add_option("--dump-results-file", help=("Dump maximum number of " + "deopt points per test to a file")) + result.add_option("--extra-flags", + help="Additional flags to pass to each test command", + default="") + result.add_option("--isolates", help="Whether to test isolates", + default=False, action="store_true") + result.add_option("-j", help="The number of parallel tasks to run", + default=0, type="int") + result.add_option("-m", "--mode", + help="The test modes in which to run (comma-separated)", + default="release,debug") + result.add_option("--outdir", help="Base directory with compile output", + default="out") + result.add_option("-p", "--progress", + help=("The style of progress indicator" + " (verbose, dots, color, mono)"), + choices=progress.PROGRESS_INDICATORS.keys(), + default="mono") + result.add_option("--shard-count", + help="Split testsuites into this number of shards", + default=1, type="int") + result.add_option("--shard-run", + help="Run this shard from the split up tests.", + default=1, type="int") + result.add_option("--shell-dir", help="Directory containing executables", + default="") + result.add_option("--seed", help="The seed for the random distribution", + type="int") + result.add_option("-t", "--timeout", help="Timeout in seconds", + default= -1, type="int") + result.add_option("-v", "--verbose", help="Verbose output", + default=False, action="store_true") + return result + + +def ProcessOptions(options): + global VARIANT_FLAGS + + # Architecture and mode related stuff. + if options.arch_and_mode: + tokens = options.arch_and_mode.split(".") + options.arch = tokens[0] + options.mode = tokens[1] + options.mode = options.mode.split(",") + for mode in options.mode: + if not mode.lower() in ["debug", "release"]: + print "Unknown mode %s" % mode + return False + if options.arch in ["auto", "native"]: + options.arch = ARCH_GUESS + options.arch = options.arch.split(",") + for arch in options.arch: + if not arch in SUPPORTED_ARCHS: + print "Unknown architecture %s" % arch + return False + + # Special processing of other options, sorted alphabetically. + options.command_prefix = shlex.split(options.command_prefix) + options.extra_flags = shlex.split(options.extra_flags) + if options.j == 0: + options.j = multiprocessing.cpu_count() + if not options.distribution_mode in DISTRIBUTION_MODES: + print "Unknown distribution mode %s" % options.distribution_mode + return False + if options.distribution_factor1 < 0.0: + print ("Distribution factor1 %s is out of range. Defaulting to 0.0" + % options.distribution_factor1) + options.distribution_factor1 = 0.0 + if options.distribution_factor2 < 0.0: + print ("Distribution factor2 %s is out of range. Defaulting to 0.0" + % options.distribution_factor2) + options.distribution_factor2 = 0.0 + if options.coverage < 0.0 or options.coverage > 1.0: + print ("Coverage %s is out of range. Defaulting to 0.4" + % options.coverage) + options.coverage = 0.4 + if options.coverage_lift < 0: + print ("Coverage lift %s is out of range. Defaulting to 0" + % options.coverage_lift) + options.coverage_lift = 0 + return True + + +def ShardTests(tests, shard_count, shard_run): + if shard_count < 2: + return tests + if shard_run < 1 or shard_run > shard_count: + print "shard-run not a valid number, should be in [1:shard-count]" + print "defaulting back to running all tests" + return tests + count = 0 + shard = [] + for test in tests: + if count % shard_count == shard_run - 1: + shard.append(test) + count += 1 + return shard + + +def Main(): + parser = BuildOptions() + (options, args) = parser.parse_args() + if not ProcessOptions(options): + parser.print_help() + return 1 + + exit_code = 0 + workspace = os.path.abspath(join(os.path.dirname(sys.argv[0]), "..")) + + suite_paths = utils.GetSuitePaths(join(workspace, "test")) + + if len(args) == 0: + suite_paths = [ s for s in suite_paths if s in DEFAULT_TESTS ] + else: + args_suites = set() + for arg in args: + suite = arg.split(os.path.sep)[0] + if not suite in args_suites: + args_suites.add(suite) + suite_paths = [ s for s in suite_paths if s in args_suites ] + + suites = [] + for root in suite_paths: + suite = testsuite.TestSuite.LoadTestSuite( + os.path.join(workspace, "test", root)) + if suite: + suites.append(suite) + + if options.download_data: + for s in suites: + s.DownloadData() + + for mode in options.mode: + for arch in options.arch: + code = Execute(arch, mode, args, options, suites, workspace) + exit_code = exit_code or code + return exit_code + + +def CalculateNTests(m, options): + """Calculates the number of tests from m deopt points with exponential + coverage. + The coverage is expected to be between 0.0 and 1.0. + The 'coverage lift' lifts the coverage for tests with smaller m values. + """ + c = float(options.coverage) + l = float(options.coverage_lift) + return int(math.pow(m, (m * c + l) / (m + l))) + + +def Execute(arch, mode, args, options, suites, workspace): + print(">>> Running tests for %s.%s" % (arch, mode)) + + dist = Distribution(options) + + shell_dir = options.shell_dir + if not shell_dir: + if options.buildbot: + shell_dir = os.path.join(workspace, options.outdir, mode) + mode = mode.lower() + else: + shell_dir = os.path.join(workspace, options.outdir, + "%s.%s" % (arch, mode)) + shell_dir = os.path.relpath(shell_dir) + + # Populate context object. + mode_flags = MODE_FLAGS[mode] + timeout = options.timeout + if timeout == -1: + # Simulators are slow, therefore allow a longer default timeout. + if arch in SLOW_ARCHS: + timeout = 2 * TIMEOUT_DEFAULT; + else: + timeout = TIMEOUT_DEFAULT; + + timeout *= TIMEOUT_SCALEFACTOR[mode] + ctx = context.Context(arch, mode, shell_dir, + mode_flags, options.verbose, + timeout, options.isolates, + options.command_prefix, + options.extra_flags) + + # Find available test suites and read test cases from them. + variables = { + "mode": mode, + "arch": arch, + "system": utils.GuessOS(), + "isolates": options.isolates, + "deopt_fuzzer": True, + } + all_tests = [] + num_tests = 0 + test_id = 0 + + # Remember test case prototypes for the fuzzing phase. + test_backup = dict((s, []) for s in suites) + + for s in suites: + s.ReadStatusFile(variables) + s.ReadTestCases(ctx) + if len(args) > 0: + s.FilterTestCasesByArgs(args) + all_tests += s.tests + s.FilterTestCasesByStatus(False) + test_backup[s] = s.tests + analysis_flags = ["--deopt-every-n-times", "%d" % MAX_DEOPT, + "--print-deopt-stress"] + s.tests = [ t.CopyAddingFlags(analysis_flags) for t in s.tests ] + num_tests += len(s.tests) + for t in s.tests: + t.id = test_id + test_id += 1 + + if num_tests == 0: + print "No tests to run." + return 0 + + try: + print(">>> Collection phase") + progress_indicator = progress.PROGRESS_INDICATORS[options.progress]() + runner = execution.Runner(suites, progress_indicator, ctx) + + exit_code = runner.Run(options.j) + if runner.terminate: + return exit_code + + except KeyboardInterrupt: + return 1 + + print(">>> Analysis phase") + num_tests = 0 + test_id = 0 + for s in suites: + test_results = {} + for t in s.tests: + for line in t.output.stdout.splitlines(): + if line.startswith("=== Stress deopt counter: "): + test_results[t.path] = MAX_DEOPT - int(line.split(" ")[-1]) + for t in s.tests: + if t.path not in test_results: + print "Missing results for %s" % t.path + if options.dump_results_file: + results_dict = dict((t.path, n) for (t, n) in test_results.iteritems()) + with file("%s.%d.txt" % (dump_results_file, time.time()), "w") as f: + f.write(json.dumps(results_dict)) + + # Reset tests and redistribute the prototypes from the collection phase. + s.tests = [] + if options.verbose: + print "Test distributions:" + for t in test_backup[s]: + max_deopt = test_results.get(t.path, 0) + if max_deopt == 0: + continue + n_deopt = CalculateNTests(max_deopt, options) + distribution = dist.Distribute(n_deopt, max_deopt) + if options.verbose: + print "%s %s" % (t.path, distribution) + for i in distribution: + fuzzing_flags = ["--deopt-every-n-times", "%d" % i] + s.tests.append(t.CopyAddingFlags(fuzzing_flags)) + num_tests += len(s.tests) + for t in s.tests: + t.id = test_id + test_id += 1 + + if num_tests == 0: + print "No tests to run." + return 0 + + try: + print(">>> Deopt fuzzing phase (%d test cases)" % num_tests) + progress_indicator = progress.PROGRESS_INDICATORS[options.progress]() + runner = execution.Runner(suites, progress_indicator, ctx) + + exit_code = runner.Run(options.j) + if runner.terminate: + return exit_code + + except KeyboardInterrupt: + return 1 + + return exit_code + + +if __name__ == "__main__": + sys.exit(Main()) diff --git a/deps/v8/tools/run-tests.py b/deps/v8/tools/run-tests.py index 959fe48..761d03f 100755 --- a/deps/v8/tools/run-tests.py +++ b/deps/v8/tools/run-tests.py @@ -303,7 +303,8 @@ def Execute(arch, mode, args, options, suites, workspace): "mode": mode, "arch": arch, "system": utils.GuessOS(), - "isolates": options.isolates + "isolates": options.isolates, + "deopt_fuzzer": False, } all_tests = [] num_tests = 0 -- 2.7.4